diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-29 09:02:17 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-05-29 09:02:17 +0200 |
| commit | 44051e51f99fe7e94f37d567d621fa13399c17f1 (patch) | |
| tree | 7d5524dc0891ad3795a0e6facf69d0b43877dcee | |
| parent | 864b9ef815dc4595cb0efbec5478a25ef7bc31f2 (diff) | |
timeline: separate keyboard and pinch zooming logic
| -rw-r--r-- | src/web/component/timeline/index.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/web/component/timeline/index.js b/src/web/component/timeline/index.js index f83a159..81322c6 100644 --- a/src/web/component/timeline/index.js +++ b/src/web/component/timeline/index.js @@ -64,6 +64,13 @@ const zoom = new (class { behavior: 'instant', }); } + + increase_line_by(n) { + this.committed = Math.min(Math.max(this.committed + n, 1), 20); + container.style.gridTemplateColumns = `repeat(${this.committed}, 1fr)`; + container.classList.toggle('tiling', this.committed != 1); + container.style.transform = 'scale(1)'; + } }); Z.document.onwheel = (event) => { @@ -71,7 +78,7 @@ Z.document.onwheel = (event) => { return; } event.preventDefault(); - // TODO + zoom.increase_line_by(event.wheelDeltaY / 120); }; const pinch = new Pinch(Z.document); |