Feat v0.6.10 viewport foundation (#45)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #45.
This commit is contained in:
@@ -27,12 +27,9 @@
|
||||
<link rel="stylesheet" href="{{.BasePath}}/surfaces/{{.Surface}}/css/main.css?v={{.Version}}">
|
||||
{{end}}
|
||||
<style>
|
||||
:root {
|
||||
--banner-h: 28px;
|
||||
}
|
||||
body { margin: 0; background: var(--bg); color: var(--text); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
|
||||
body { margin: 0; background: var(--bg); color: var(--text); display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); }
|
||||
.surface { flex: 1; min-height: 0; overflow: hidden; }
|
||||
.surface-inner { width: 100%; height: 100%; transform-origin: top left; }
|
||||
.surface-inner { width: 100%; height: 100%; }
|
||||
.banner { flex-shrink: 0; }
|
||||
</style>
|
||||
<meta name="theme-color" content="#0e0e10" id="metaThemeColor">
|
||||
@@ -52,7 +49,7 @@
|
||||
} catch(e) {}
|
||||
})();
|
||||
// Early appearance — apply scale from localStorage on all surfaces.
|
||||
// Scale uses transform on .surface-inner so shell stays fixed, content fills viewport.
|
||||
// CSS zoom reflows layout correctly (no getBoundingClientRect hacks needed).
|
||||
(function() {
|
||||
try {
|
||||
var p = JSON.parse(localStorage.getItem('sb-appearance') || '{}');
|
||||
@@ -60,7 +57,7 @@
|
||||
var s = p.scale / 100;
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var el = document.getElementById('surfaceInner');
|
||||
if (el) { el.style.transform = 'scale('+s+')'; el.style.transformOrigin = 'top left'; el.style.width = (100/s)+'%'; el.style.height = (100/s)+'%'; }
|
||||
if (el) { el.style.zoom = s; }
|
||||
});
|
||||
}
|
||||
} catch(e) {}
|
||||
@@ -69,9 +66,12 @@
|
||||
</head>
|
||||
<body data-surface="{{.Surface}}" data-base-path="{{.BasePath}}">
|
||||
{{if .Banner.Visible}}
|
||||
<div class="banner banner-top active" style="background:{{.Banner.Background}};color:{{.Banner.Color}};height:var(--banner-h);line-height:var(--banner-h);text-align:center;font-size:12px;font-weight:600;overflow:hidden;">
|
||||
<div class="banner banner-top active" style="background:{{.Banner.Background}};color:{{.Banner.Color}};padding:6px 12px;text-align:center;font-size:12px;font-weight:600;line-height:1.3;">
|
||||
{{.Banner.Text}}
|
||||
</div>
|
||||
<script>
|
||||
(function(){ var b=document.querySelector('.banner-top.active'); if(b) document.documentElement.style.setProperty('--banner-top-height',b.offsetHeight+'px'); })();
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
{{if .Message.Visible}}
|
||||
@@ -101,9 +101,12 @@
|
||||
{{end}}
|
||||
|
||||
{{if .Banner.Visible}}
|
||||
<div class="banner banner-bottom active" style="background:{{.Banner.Background}};color:{{.Banner.Color}};height:var(--banner-h);line-height:var(--banner-h);text-align:center;font-size:12px;font-weight:600;overflow:hidden;">
|
||||
<div class="banner banner-bottom active" style="background:{{.Banner.Background}};color:{{.Banner.Color}};padding:6px 12px;text-align:center;font-size:12px;font-weight:600;line-height:1.3;">
|
||||
{{.Banner.Text}}
|
||||
</div>
|
||||
<script>
|
||||
(function(){ var b=document.querySelector('.banner-bottom.active'); if(b) document.documentElement.style.setProperty('--banner-bottom-height',b.offsetHeight+'px'); })();
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
<script nonce="{{.CSPNonce}}">
|
||||
|
||||
Reference in New Issue
Block a user