Changeset b8bbe77 in Klonkt for src/views/shell.ejs


Ignore:
Timestamp:
06/26/2026 03:42:25 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
cb3d5fc
Parents:
76f0e61
Message:

debug(ios): temporary on-screen readout of env/inset/standalone/screen/masthead pad

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/shell.ejs

    r76f0e61 rb8bbe77  
    217217    p.style.cssText = 'position:fixed;top:0;left:0;width:0;height:0;padding-top:env(safe-area-inset-top,0px);visibility:hidden;pointer-events:none';
    218218    document.body.appendChild(p);
    219     var i = parseFloat(getComputedStyle(p).paddingTop) || 0;
     219    var rawEnv = parseFloat(getComputedStyle(p).paddingTop) || 0;
    220220    p.remove();
     221    var i = rawEnv;
    221222    if (i < 20 && Math.max(screen.width, screen.height) >= 812) i = standalone ? 59 : 47;
    222223    document.documentElement.style.setProperty('--ios-safe-top', i + 'px');
    223224    var mh = document.querySelector('.masthead');
    224225    if (mh) mh.style.paddingTop = 'calc(.55rem + ' + i + 'px)';
     226    /* TEMP DEBUG — remove after diagnosing the iOS PWA safe-area. Tap to dismiss. */
     227    var d = document.getElementById('ios-dbg');
     228    if (!d) { d = document.createElement('div'); d.id = 'ios-dbg'; d.onclick = function(){ d.remove(); };
     229      d.style.cssText = 'position:fixed;left:6px;bottom:96px;z-index:2147483647;background:rgba(0,0,0,.86);color:#0f0;font:11px/1.4 monospace;padding:7px 9px;border-radius:6px;white-space:pre;max-width:92vw';
     230      document.body.appendChild(d); }
     231    d.textContent = 'env=' + rawEnv + '   final=' + i + '\nstandalone=' + standalone + '\nscreen=' + screen.width + 'x' + screen.height + '  dpr=' + window.devicePixelRatio + '\nmasthead pad=' + (mh ? getComputedStyle(mh).paddingTop : 'NOT FOUND');
    225232  }
    226233  if (document.body) apply(); else document.addEventListener('DOMContentLoaded', apply);
Note: See TracChangeset for help on using the changeset viewer.