You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a follow-up to #398, we should have swiping to get from one screenshot to the next.
Previously, I had a commit with that, but reverted it, as it didn't have animation.
A better approach might be to add all screenshots in an element that's ((# of screenshots + padding) × screenwidth), have it longer then the page, constrain it to page width, make sure it scrolls, and add scroll stops.
This would:
reduce the amount of JavaScript necessary
use accelerated rendering (including GPU acceleration)
feel natural, as it would use the same scroll swiping as a native platform
be a testbed to see how CSS scroll stops work, as they could be useful in parts of Cockpit too
The text was updated successfully, but these errors were encountered:
For reference, the deleted code that handled swiping via touch was:
$(document).on('touchstart',function(ev){if(!previewIsVisible()){return;}touchX=ev.touches[0].clientX;touchY=ev.touches[0].clientY;}).on('touchmove',function(ev){if(!previewIsVisible()){return;}if(!touchX||!touchY){return;}varaction;varswipeThreshold=10;vardistanceX=touchX-ev.touches[0].clientX;vardistanceY=touchY-ev.touches[0].clientY;// Choose swipe distance based on greater directionvardistance=(Math.abs(distanceX)>Math.abs(distanceY)) ? distanceX : distanceY;// Exit if threshold is not metif(Math.abs(distance)<swipeThreshold){return;}// Check direction (either up/down, left/right) based on positive/negativeaction=(distance>0) ? 'next' : 'prev';switchPreview(action);});
As a follow-up to #398, we should have swiping to get from one screenshot to the next.
Previously, I had a commit with that, but reverted it, as it didn't have animation.
A better approach might be to add all screenshots in an element that's ((# of screenshots + padding) × screenwidth), have it longer then the page, constrain it to page width, make sure it scrolls, and add scroll stops.
This would:
The text was updated successfully, but these errors were encountered: