Changeset ddecd9a in Klonkt
- Timestamp:
- 06/14/2026 10:17:23 PM (3 months ago)
- Branches:
- main
- Children:
- 102d2f0
- Parents:
- a1c8cb8
- Location:
- src
- Files:
-
- 3 edited
-
assets/css/audio.css (modified) (3 diffs)
-
assets/js/audio-player.js (modified) (4 diffs)
-
views/shell.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/css/audio.css
ra1c8cb8 rddecd9a 148 148 .audio-player-expand-trigger:hover { 149 149 background: color-mix(in srgb, var(--ink, #000) 6%, transparent); 150 } 151 /* DESKTOP (≥1200px): geen full player — de expand-trigger opent niets (JS), 152 dus 'm niet als klikbaar laten ogen. */ 153 @media (min-width: 1200px) { 154 .audio-player-expand-trigger { cursor: default; } 155 .audio-player-expand-trigger:hover { background: none; } 150 156 } 151 157 … … 350 356 body.audio-sheet-locked { overflow: hidden; } 351 357 352 /* MOBILE (<720px): full-width sheet, slide up from bottom */353 @media (max-width: 7 19.98px) {358 /* TELEFOON (<768px): full-width sheet, slide up from bottom */ 359 @media (max-width: 767.98px) { 354 360 .audio-sheet-panel { 355 361 /* Real full-screen, edge-to-edge, no rounded corners or shadow */ … … 371 377 } 372 378 373 /* DESKTOP (≥720px): 480px wide, horizontally centered (v9 design intent). 374 We MUST set width here because v9's style.css sets width:480px and 375 we don't want left/right:0 stretching to override it. 376 The -50% horizontal centering is preserved during drag by composing 377 --pcms-drag-y into the existing translate(-50%, ...) transform. */ 378 @media (min-width: 720px) { 379 /* TABLET / AUTO (768–1199px): grote, landscape, knop-vriendelijke full-player 380 voor tablets + een tablet-in-de-auto. Bewust full-screen + grote touch-targets. 381 Desktop (≥1200px) opent de full player NIET (afgehandeld in audio-player.js), 382 dus daar is geen sheet-styling nodig. */ 383 @media (min-width: 768px) and (max-width: 1199.98px) { 379 384 .audio-sheet-panel { 380 left: 50%; 381 right: auto; 382 width: 480px; 383 transform: translate(-50%, 100%); 384 border-top-left-radius: 20px; 385 border-top-right-radius: 20px; 385 inset: 0; left: 0; right: 0; width: auto; 386 max-height: none; 387 border-radius: 0; 388 box-shadow: none; 389 transform: translateY(100%); 390 padding: clamp(2rem, 5vh, 4rem) clamp(2rem, 6vw, 5rem); 391 gap: clamp(1.25rem, 3vh, 2.5rem); 392 justify-content: center; 393 align-items: center; 386 394 } 387 .audio-sheet.is-open .audio-sheet-panel { 388 transform: translate(-50%, var(--pcms-drag-y, 0px)); 389 } 395 .audio-sheet.is-open .audio-sheet-panel { transform: translateY(var(--pcms-drag-y, 0px)); } 396 397 .audio-sheet-drag-zone { align-items: center; width: 100%; margin: 0; padding: 0; } 398 .audio-sheet-cover { width: min(48vh, 460px); max-width: none; border-radius: 20px; } 399 .audio-sheet-cover svg { width: 26%; height: 26%; } 400 .audio-sheet-info { width: 100%; max-width: 660px; } 401 .audio-sheet-title { font-size: clamp(2rem, 4vw, 3rem); } 402 .audio-sheet-artist { font-size: clamp(1.1rem, 2vw, 1.5rem); margin-top: .5rem; } 403 .audio-sheet-album { font-size: 1rem; margin-top: .25rem; } 404 .audio-sheet-progress { width: 100%; max-width: 660px; gap: 1.25rem; } 405 .audio-sheet-progress .audio-time { font-size: 1.05rem; min-width: 3.2em; } 406 .audio-sheet-controls { gap: clamp(1.5rem, 5vw, 3.5rem); } 407 .audio-sheet-btn { width: 76px; height: 76px; } 408 .audio-sheet-btn svg { width: 34px; height: 34px; } 409 .audio-sheet-play { width: 108px; height: 108px; } 410 .audio-sheet-play svg { width: 46px; height: 46px; } 390 411 } 391 412 -
src/assets/js/audio-player.js
ra1c8cb8 rddecd9a 327 327 // (@media max-width:719.98px). On wider/desktop widths the sheet is a centered 328 328 // panel, so we do NOT auto-open it there. 329 function isMobileView() { 330 return window.matchMedia('(max-width: 719.98px)').matches; 331 } 329 // Drie weergaves (Robin 2026-06-15): telefoon (<768) = fullscreen sheet; 330 // tablet/auto (768–1199) = grote landscape full-player (tablet + tablet-in-de- 331 // auto); desktop (≥1200) = alleen mini-speler, GEEN full player. matchMedia 332 // zodat dit exact de CSS-breekpunten volgt. 333 function playerTier() { 334 if (window.matchMedia('(min-width: 1200px)').matches) return 'desktop'; 335 if (window.matchMedia('(min-width: 768px)').matches) return 'tablet'; 336 return 'phone'; 337 } 338 function hasFullPlayer() { return playerTier() !== 'desktop'; } 339 function isMobileView() { return playerTier() === 'phone'; } 332 340 333 341 function setQueue(tracks, startIdx, opts) { … … 341 349 // niet bij next/prev of de site-pre-seed — zodat een sheet die de gebruiker 342 350 // bewust sloot niet vanzelf terugkomt. 343 if ( isMobileView()) openSheet();351 if (hasFullPlayer()) openSheet(); 344 352 } 345 353 … … 502 510 503 511 function openSheet() { 512 if (!hasFullPlayer()) return; // desktop (≥1200): geen full player, alleen mini-speler 504 513 if (sheet.classList.contains('is-open')) return; 505 514 sheet.classList.add('is-open'); 506 515 sheet.setAttribute('aria-hidden', 'false'); 507 516 document.body.classList.add('audio-sheet-locked'); 508 if (isMobileView()) { 509 try { history.pushState({ pcmsSheet: true }, ''); sheetHistoryPushed = true; } catch (e) {} 510 } 517 // Telefoon + tablet: history-entry zodat de terug-knop eerst de sheet sluit. 518 try { history.pushState({ pcmsSheet: true }, ''); sheetHistoryPushed = true; } catch (e) {} 511 519 } 512 520 function closeSheet(fromPopstate) { … … 532 540 document.addEventListener('keydown', (e) => { 533 541 if (e.key === 'Escape' && sheet.classList.contains('is-open')) closeSheet(); 542 }); 543 // Naar desktop-breedte (≥1200) gesleept terwijl de full player open is? Sluiten — 544 // op desktop bestaat de full player niet. 545 window.addEventListener('resize', () => { 546 if (!hasFullPlayer() && sheet.classList.contains('is-open')) closeSheet(); 534 547 }); 535 548 -
src/views/shell.ejs
ra1c8cb8 rddecd9a 168 168 anywhere (admin previews, post embeds, etc). The player itself is 169 169 a singleton — see the script tag near </body>. --> 170 <link rel="stylesheet" href="/assets/css/audio.css ">170 <link rel="stylesheet" href="/assets/css/audio.css?v=2"> 171 171 172 172 <%- include('partials/shared-styles') %> … … 309 309 ?v=N — cache-buster: bump bij elke audio-player.js wijziging zodat 310 310 Cloudflare (max-age=1y) niet de oude versie blijft serveren. --> 311 <script src="/assets/js/audio-player.js?v= 9"></script>311 <script src="/assets/js/audio-player.js?v=10"></script> 312 312 <% if (site && site.enable_audio_player && audioTracks && audioTracks.length > 0) { %> 313 313 <script>window.PCMS_SITE_TRACKS = <%- JSON.stringify(audioTracks) %>;</script>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)