mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-15 01:59:57 +00:00
Mobile ui (#227)
* Basic grid setup * Fixing thumb on two-up * Adding margin so you can still access the two-up * Allow multi-panel to keep one open only * Edge cases for one-open * Abstracting results so it can be used as a heading. * Ordering of items in mobile view. Changing scrolling element. * Adding labels to collapsed view * Adding height animation to multi-panel * Fixing animation bugs * Expand/collapse icon * Allow two-up and pinch-zoom to work beneath controls * Range bubble now behaves properly on mobile * No longer need this. * Prevent options overflow at larger widths
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { bind } from '../../lib/initial-util';
|
||||
import * as style from './styles.css';
|
||||
import { PointerTracker } from '../../lib/PointerTracker';
|
||||
|
||||
const RETARGETED_EVENTS = ['focus', 'blur'];
|
||||
const UPDATE_EVENTS = ['input', 'change'];
|
||||
@@ -26,6 +27,17 @@ class RangeInputElement extends HTMLElement {
|
||||
this._input.type = 'range';
|
||||
this._input.className = style.input;
|
||||
|
||||
const tracker = new PointerTracker(this._input, {
|
||||
start: (): boolean => {
|
||||
if (tracker.currentPointers.length !== 0) return false;
|
||||
this._input.classList.add(style.touchActive);
|
||||
return true;
|
||||
},
|
||||
end: () => {
|
||||
this._input.classList.remove(style.touchActive);
|
||||
},
|
||||
});
|
||||
|
||||
for (const event of RETARGETED_EVENTS) {
|
||||
this._input.addEventListener(event, this._retargetEvent, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user