Changeset 942028f in Klonkt
- Timestamp:
- 06/14/2026 04:01:38 AM (3 months ago)
- Branches:
- main
- Children:
- 2b52bfb
- Parents:
- 9b36f45
- Location:
- src
- Files:
-
- 2 deleted
- 4 edited
-
assets/.well-known/assetlinks.json (deleted)
-
assets/apk/soundfabrics.apk (deleted)
-
assets/js/install-app.js (modified) (3 diffs)
-
server.js (modified) (1 diff)
-
views/partials/footer.ejs (modified) (1 diff)
-
views/shell.ejs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/js/install-app.js
r9b36f45 r942028f 7 7 * - On click, opens a modal with platform-specific instructions: 8 8 * iOS → "Voeg toe aan beginscherm" via Safari share sheet 9 * Android → choice between PWA install (1-tap if available) and APK download9 * Android → PWA install (1-tap if available, else Chrome ⋮-menu instructions) 10 10 * Desktop → instructions for Chrome/Edge install icon, or native prompt if available 11 11 * - Listens for `beforeinstallprompt` (Android Chrome / desktop Chromium) and 12 12 * deferreds it so the modal's "Install as PWA" button can fire it. 13 13 * 14 * Markup contract: <button data-pcms-install-app data-apk-url="/path/to.apk">14 * Markup contract: <button data-pcms-install-app> 15 15 * 16 16 * CSS: .install-app-btn / .install-modal* / .install-choice* — defined in … … 30 30 const isIOS = /iPad|iPhone|iPod/.test(ua) && !window.MSStream; 31 31 const isAndroid = /Android/.test(ua); 32 const apkUrl = btn.dataset.apkUrl || '';33 32 34 33 // Capture Chrome/Edge native install prompt so we can fire it from our modal. … … 100 99 : `<p class="install-choice-note">Open deze site in <strong>Chrome</strong> en kies in het <strong>⋮-menu → "App installeren"</strong> (of "Aan beginscherm toevoegen").</p>`; 101 100 102 const apkBlock = apkUrl ? `103 <div class="install-choice install-choice-apk">104 <h4>🤖 Optie B — APK (native Android-app)</h4>105 <div class="install-pros-cons">106 <div class="install-pros">107 <strong>Voordelen</strong>108 <ul>109 <li>Echte app in app-lade, naast WhatsApp/Gmail</li>110 <li>Beste achtergrond-audio ondersteuning</li>111 <li>Lock-screen controls werken optimaal</li>112 <li>Blijft geïnstalleerd ongeacht browser-cache</li>113 </ul>114 </div>115 <div class="install-cons">116 <strong>Nadelen</strong>117 <ul>118 <li>Moet eenmalig "onbekende bronnen" toestaan</li>119 <li>Geen auto-updates — nieuwe versie = APK opnieuw downloaden</li>120 <li>Browser toont beveiligings-waarschuwing bij install</li>121 <li>Alleen Android (Android 5+ / API 21+)</li>122 </ul>123 </div>124 </div>125 <a href="${apkUrl}" class="install-choice-cta" download>126 <svg width="18" height="18" viewBox="0 0 24 24" style="vertical-align:middle;margin-right:.35rem"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z" fill="currentColor"/></svg>127 Download APK128 </a>129 <ol class="install-steps" style="margin-top:.75rem">130 <li>Tik op de gedownloade APK</li>131 <li>Sta eenmalig <strong>"installeren van onbekende bronnen"</strong> toe voor je browser</li>132 <li>Tik <strong>Installeer</strong> in de popup</li>133 <li>Open de app vanuit je app-lade</li>134 </ol>135 </div>136 ` : '';137 138 101 showModal(` 139 102 <h3 id="install-title" style="margin:0 0 .5rem">🤖 Installeer op Android</h3> 140 <p style="margin:0 0 1.25rem;opacity:.8">Twee manieren. Kies wat bij je past:</p> 141 142 <div class="install-choice install-choice-pwa"> 143 <h4>📱 Optie A — Home-screen shortcut (PWA)</h4> 144 <div class="install-pros-cons"> 145 <div class="install-pros"> 146 <strong>Voordelen</strong> 147 <ul> 148 <li>Instant — geen download of toestemmingen</li> 149 <li>Updates automatisch bij elke site-wijziging</li> 150 <li>Geen beveiligings-waarschuwing</li> 151 <li>Minder opslagruimte op je telefoon</li> 152 </ul> 153 </div> 154 <div class="install-cons"> 155 <strong>Nadelen</strong> 156 <ul> 157 <li>Vereist Chrome als browser</li> 158 <li>Audio-in-achtergrond iets minder robuust dan native</li> 159 <li>Kan verdwijnen als je browser-data wist</li> 160 </ul> 161 </div> 162 </div> 163 ${nativeLine} 164 </div> 165 166 ${apkBlock} 167 168 <p style="margin:1rem 0 0;opacity:.65;font-size:.82rem">💡 Weet je niet wat te kiezen? Begin met <strong>Optie A (shortcut)</strong>. Te beperkt? Ga dan voor de APK.</p> 103 <p style="margin:0 0 1rem;opacity:.8">Voeg deze site als app toe aan je beginscherm:</p> 104 <ul class="install-steps" style="opacity:.85"> 105 <li>Instant — geen download of toestemmingen</li> 106 <li>Updatet automatisch bij elke wijziging</li> 107 <li>Minder opslag dan een losse app</li> 108 </ul> 109 ${nativeLine} 110 <p style="margin:1rem 0 0;opacity:.7;font-size:.85rem">⚠️ Werkt het best in Chrome.</p> 169 111 `); 170 112 } -
src/server.js
r9b36f45 r942028f 118 118 app.use('/media', express.static(process.env.MEDIA_PATH || './storage/media')); 119 119 120 // P64 — TWA / digital-asset-links: must be served at /.well-known/assetlinks.json 121 // at the site root with Content-Type: application/json. Without this Android 122 // shows the URL bar inside the installed PrutFolio app. 123 app.get('/.well-known/assetlinks.json', (req, res) => { 124 res.type('application/json').sendFile( 125 path.join(__dirname, 'assets', '.well-known', 'assetlinks.json') 126 ); 127 }); 120 // (Verwijderd) TWA / digital-asset-links — alleen nodig voor de APK/TWA-variant. 121 // Klonkt is PWA-only; geen assetlinks.json meer. 128 122 129 123 initializeDatabase(); -
src/views/partials/footer.ejs
r9b36f45 r942028f 20 20 </div> 21 21 22 <%# P64 — Install-app button. JS detects platform & opens modal with steps. 23 data-apk-url is the direct download for Android users who want the 24 native APK route instead of the PWA. %> 22 <%# Install-app button. JS detects platform & opens a modal with PWA-install 23 steps (iOS share-sheet / Android Chrome / desktop). PWA only — geen APK. %> 25 24 <div class="site-footer-install container"> 26 <button type="button" class="install-app-btn" data-pcms-install-app data-apk-url="/assets/apk/soundfabrics.apk">25 <button type="button" class="install-app-btn" data-pcms-install-app> 27 26 <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M5 20h14v-2H5v2zm7-18L5.33 9h3.84v6h5.66V9h3.84L12 2z" fill="currentColor"/></svg> 28 27 <span>Installeer app</span> -
src/views/shell.ejs
r9b36f45 r942028f 283 283 284 284 <!-- Install-app button: detects platform + shows install instructions modal --> 285 <script src="/assets/js/install-app.js " defer></script>285 <script src="/assets/js/install-app.js?v=2" defer></script> 286 286 287 287 <!-- Service Worker registration -->
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)