Improved mobile layout. Banner section gets smaller and editor goes full screen.

This commit is contained in:
2026-08-26 18:44:17 +00:00
parent 29c1dc64ed
commit 9be1491f0e
3 changed files with 31 additions and 7 deletions
+6 -1
View File
@@ -51,10 +51,15 @@ function setEditingClass(enable) {
// the page: its top is the banner's bottom edge while the banner is visible
// (= #content's top edge), and the viewport top once the banner has
// scrolled away. The window keeps scrolling normally while editing.
// Below 48rem the panel covers the entire viewport (pagerite.css), so its
// top stays 0 regardless of the banner.
const narrow = matchMedia('(max-width: 48rem)')
function trackPanelTop() {
const content = document.getElementById('content')
if (host && content) {
host.style.top = `${Math.max(0, content.getBoundingClientRect().top)}px`
host.style.top = narrow.matches
? '0px'
: `${Math.max(0, content.getBoundingClientRect().top)}px`
}
}