Changeset 9327a85 in Klonkt


Ignore:
Timestamp:
06/26/2026 04:56:10 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
69e7a79
Parents:
f6b2c68
Message:

fix(ios-pwa): drop the top safe-area inset in landscape (island is on the side)

Portrait path is unchanged (standalone?59:47). In landscape the notch/island moves to
the side so the top inset is ~0 — key off orientation and use 0 there, leaving only the
masthead's base padding. SW cache -> v15.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/server.js

    rf6b2c68 r9327a85  
    395395  res.set('Cache-Control', 'no-cache');
    396396  res.send(`
    397 const CACHE_VERSION = 'pcms-v14-' + new Date().toISOString().split('T')[0];
     397const CACHE_VERSION = 'pcms-v15-' + new Date().toISOString().split('T')[0];
    398398self.addEventListener('install', e => {
    399399  e.waitUntil(caches.open(CACHE_VERSION).then(c => c.addAll(['/'])));
  • src/views/shell.ejs

    rf6b2c68 r9327a85  
    220220    p.remove();
    221221    var i = rawEnv;
    222     if (i < 20 && Math.max(screen.width, screen.height) >= 812) i = standalone ? 59 : 47;
     222    if (i < 20 && Math.max(screen.width, screen.height) >= 812) {
     223      // Portrait: the island sits at the TOP → full inset (UNCHANGED: standalone?59:47).
     224      // Landscape: the island moves to the SIDE, so the top inset is ~0 → no top padding
     225      // (only the masthead's own base padding remains). env() can't tell us (returns 0),
     226      // so we key off orientation directly.
     227      i = (window.innerWidth > window.innerHeight) ? 0 : (standalone ? 59 : 47);
     228    }
    223229    document.documentElement.style.setProperty('--ios-safe-top', i + 'px');
    224230    var mh = document.querySelector('.masthead');
Note: See TracChangeset for help on using the changeset viewer.