-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc tweaks/updates to cimbar.js encoder UI #97
Conversation
It'll be backspace on keyboard, and on touch event (i.e. only while pressed) on touch devices. Pausing temporarily helps autofocus find the image.
+ add auto-realignment logic for the full-canvas "button"?
We'll then have a short pause during menu toggles (and ontouch on mobile), which should unobtrusively(?) help autofocus
Better? Perhaps. Simpler css, more white (brightness) overall. Grid is rotated 45 degrees since I think it looks better that way.
This lets the blurNav() method fire more consistently, which is what we now want (since we're temporarily pausing animation now)
+ make manual backspace pause additive, so if you want to mash the button and stay paused indefinitely you can
… size The padding is overdue -- it *can* work without the padding, but it really helps to have some quiet (black) padding around all 4 edges of the image. Expanding the canvas to fill the window (rather than capping it to its max size) helps on higher resolution (e.g. 4k) displays.
}, | ||
|
||
resize : function() | ||
{ | ||
// reset zoom | ||
var canvas = document.getElementById('canvas'); | ||
var width = window.innerWidth; | ||
var height = window.outerHeight; | ||
var width = window.innerWidth - 12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic hardcoded value that (roughly) matches the css border.
if (pause === undefined) { | ||
pause = !Main.isPaused(); | ||
} | ||
_pause = pause? 15 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 15 is our cooldown frames.
@@ -144,6 +177,9 @@ return { | |||
_renderTime += elapsed; | |||
Main.setHTML( "status", elapsed + " : " + frameCount + " : " + Math.ceil(_renderTime/frameCount)); | |||
} | |||
if ( !(_counter & 31) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of a hack -- since we're doing some trickery to make the canvas seem clickable, we need to manually reposition the (absolute positioned) click element if something changes. So we have to check it on an interval.
@@ -194,6 +230,10 @@ window.addEventListener('keydown', function(e) { | |||
Main.clickNav(); | |||
e.preventDefault(); | |||
} | |||
else if (e.key == 'Backspace' || e.keyCode == 8) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also pause the animation with backspace
if you have a keyboard available (i.e. on desktop).
Added 75d6cfb directly to master to fix up the padding (to -10 from -12) and use innerHeight. |
A bunch of small stuff: