diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2024-05-08 15:33:42 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2024-05-08 15:33:42 +0200 |
| commit | 1924acb2eccaa6bdf58f9b90b10b1236c74bb07a (patch) | |
| tree | ecf0bf304669a7b9f99fbb783070321b9c2475c2 | |
| parent | 6a87c2530865b5e18f70b71b456f43e72702c1c6 (diff) | |
Update mobile CSS
| -rw-r--r-- | index.html | 3 | ||||
| -rw-r--r-- | lib/factories/ui.js | 12 | ||||
| -rw-r--r-- | style.css | 23 |
3 files changed, 38 insertions, 0 deletions
@@ -20,5 +20,8 @@ </aside> <canvas id="lissajous"></canvas> </main> + <footer> + <p><a href="https://r.bdr.sh">rbdr</a> · Press shift, or tap with 3 fingers for π mode.</p> + </footer> </body> </html> diff --git a/lib/factories/ui.js b/lib/factories/ui.js index c220f67..cc34579 100644 --- a/lib/factories/ui.js +++ b/lib/factories/ui.js @@ -46,6 +46,18 @@ export function slider({ slider.step = step; } }); + + document.addEventListener('touchstart', function(event) { + if (event.touches.length == 3) { + if (slider.classList.contains('shifted')) { + slider.classList.remove('shifted'); + slider.step = step; + } else { + slider.classList.add('shifted'); + slider.step = shiftStep; + } + } + }); } slider.addEventListener('input', () => set(slider.value)); @@ -11,7 +11,30 @@ body { overflow: hidden; } +@media (orientation: landscape) { + body { + padding-top: env(safe-area-inset-top); + padding-left: env(safe-area-inset-left); + padding-right: env(safe-area-inset-right); + padding-bottom: env(safe-area-inset-bottom); + } +} + +a { + color: #fff; +} + +footer { + position: fixed; + padding: 2px 8px; + bottom: 0; + min-height: 16px; + max-height: 32px; +} + #settings { + overflow-y: auto; + max-height: 100%; position: absolute; top: 5px; right: 5px; |