Changeset 441f5d6 in Klonkt for src/views/shell.ejs


Ignore:
Timestamp:
06/17/2026 04:02:46 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
c50f22e
Parents:
125e0e1
Message:

Login navigation via htmx (audio no longer jumps when opening login)

Navigating TO the login page now goes via htmx instead of a full load → the
audio player stays alive (no jump). The login itself (form submit) deliberately
remains a full load (choice: only the navigate-to-login is smooth).

For this to work, on-auth also needed to work via htmx:

  • pcmsNav now applies ALL page-classes sent along (not just the first one), and on-auth is in PAGE_CLASSES → the login focus screen gets its styling via htmx.
  • body.on-auth .bottom-tab { display:none } → hide the tab from the previous page (which stays alive under htmx nav), just as clean as a full-load login.
  • Login links (bottom-tab + topnav) get hx-get.

CSS cache-buster v9.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/shell.ejs

    r125e0e1 r441f5d6  
    163163
    164164<!-- v9 stylesheet (full palette system) -->
    165 <link rel="stylesheet" href="/assets/css/style.css?v=8">
     165<link rel="stylesheet" href="/assets/css/style.css?v=9">
    166166
    167167<!-- Audio player styles: loaded on every page so the mini-player works
     
    325325<script>
    326326(function() {
    327   // The set of mutually-exclusive page-context body classes. When pcmsNav
    328   // fires we strip ALL of these and apply just the one the server told us.
    329   var PAGE_CLASSES = ['on-home','on-post','on-special','on-archive','on-search','on-admin'];
     327  // De page-context body-classes. Bij pcmsNav strippen we ze allemaal en zetten
     328  // we opnieuw wat de server stuurde. 'on-auth' staat erbij zodat het login-
     329  // focusscherm óók via htmx z'n styling krijgt (geen chrome, geen tab, audio op 0).
     330  var PAGE_CLASSES = ['on-home','on-post','on-special','on-archive','on-search','on-admin','on-auth'];
    330331
    331332  document.body.addEventListener('pcmsNav', function(ev) {
     
    348349    var next = d.bodyClass;
    349350    if (!next) return;
    350     // Server may send a multi-class string ("on-post extra"). Only the first
    351     // page-class is what we care about — strip and replace.
    352     var firstClass = String(next).split(/\s+/).find(function(c) {
     351    // De server kan meerdere page-classes sturen ("on-special on-auth"). Strip
     352    // alle bekende en zet ALLE meegestuurde page-classes terug (niet alleen de
     353    // eerste) — anders mist 'on-auth' bij htmx-nav en blijft het login-scherm
     354    // de chrome/tab van de vorige pagina houden.
     355    var matched = String(next).split(/\s+/).filter(function(c) {
    353356      return PAGE_CLASSES.indexOf(c) >= 0;
    354357    });
    355     if (!firstClass) return;
     358    if (!matched.length) return;
    356359    PAGE_CLASSES.forEach(function(c) { document.body.classList.remove(c); });
    357     document.body.classList.add(firstClass);
     360    matched.forEach(function(c) { document.body.classList.add(c); });
    358361  });
    359362})();
Note: See TracChangeset for help on using the changeset viewer.