vers. 3.0.0 - nuova interfaccia app per mobile e desktop

Nuova UI disegnata sul tema RPIGroup Radio Theme dei siti del gruppo:
guscio unico responsive (sidebar e player in basso da 900px, topbar e
tab bar su telefono), player della radio persistente nel dock con
now playing, HLS/MP3, volume e Media Session; pagine radio, tv,
podcast (copertine e programma dal feed), player e pagine di testo
rifatte; icone SVG inline al posto di Bootstrap, jQuery e Material
Icons; font Bricolage Grotesque e Plus Jakarta Sans in locale;
service worker v5, manifest con orientamento libero, icone PWA 192 e
384 rigenerate.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
alexspeakerandClaude Fable 5.1 committed 2026-11-06 14:56:08 +01:00
1 parent 0ee93d3b75
commit 24391c49ac
58 files changed
+5226 -16550

No files matched your search

+799 -1203
View File
File diff suppressed because it is too large. Load diff
-7
View File
@@ -1,7 +0,0 @@
/*!
* Bootstrap v5.1.3 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t="transitionend",e=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e},i=t=>{const i=e(t);return i&&document.querySelector(i)?i:null},n=t=>{const i=e(t);return i?document.querySelector(i):null},s=e=>{e.dispatchEvent(new Event(t))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(t):null,a=(t,e,i)=>{Object.keys(i).forEach((n=>{const s=i[n],r=e[n],a=r&&o(r)?"element":null==(l=r)?`${l}`:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();var l;if(!new RegExp(s).test(a))throw new TypeError(`${t.toUpperCase()}: Option "${n}" provided type "${a}" but expected type "${s}".`)}))},l=t=>!(!o(t)||0===t.getClientRects().length)&&"visible"===getComputedStyle(t).getPropertyValue("visibility"),c=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),h=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?h(t.parentNode):null},d=()=>{},u=t=>{t.offsetHeight},f=()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute("data-bs-no-jquery")?t:null},p=[],m=()=>"rtl"===document.documentElement.dir,g=t=>{var e;e=()=>{const e=f();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(p.length||document.addEventListener("DOMContentLoaded",(()=>{p.forEach((t=>t()))})),p.push(e)):e()},_=t=>{"function"==typeof t&&t()},b=(e,i,n=!0)=>{if(!n)return void _(e);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(i)+5;let r=!1;const a=({target:n})=>{n===i&&(r=!0,i.removeEventListener(t,a),_(e))};i.addEventListener(t,a),setTimeout((()=>{r||s(i)}),o)},v=(t,e,i,n)=>{let s=t.indexOf(e);if(-1===s)return t[!i&&n?t.length-1:0];const o=t.length;return s+=i?1:-1,n&&(s=(s+o)%o),t[Math.max(0,Math.min(s,o-1))]},y=/[^.]*(?=\..*)\.|.*/,w=/\..*/,E=/::\d+$/,A={};let T=1;const O={mouseenter:"mouseover",mouseleave:"mouseout"},C=/^(mouseenter|mouseleave)/i,k=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function L(t,e){return e&&`${e}::${T++}`||t.uidEvent||T++}function x(t){const e=L(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function D(t,e,i=null){const n=Object.keys(t);for(let s=0,o=n.length;s<o;s++){const o=t[n[s]];if(o.originalHandler===e&&o.delegationSelector===i)return o}return null}function S(t,e,i){const n="string"==typeof e,s=n?i:e;let o=P(t);return k.has(o)||(o=t),[n,s,o]}function N(t,e,i,n,s){if("string"!=typeof e||!t)return;if(i||(i=n,n=null),C.test(e)){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};n?n=t(n):i=t(i)}const[o,r,a]=S(e,i,n),l=x(t),c=l[a]||(l[a]={}),h=D(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=L(r,e.replace(y,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(let a=o.length;a--;)if(o[a]===r)return s.delegateTarget=r,n.oneOff&&j.off(t,s.type,e,i),i.apply(r,[s]);return null}}(t,i,n):function(t,e){return function i(n){return n.delegateTarget=t,i.oneOff&&j.off(t,n.type,e),e.apply(t,[n])}}(t,i);u.delegationSelector=o?i:null,u.originalHandler=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function I(t,e,i,n,s){const o=D(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function P(t){return t=t.replace(w,""),O[t]||t}const j={on(t,e,i,n){N(t,e,i,n,!1)},one(t,e,i,n){N(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=S(e,i,n),a=r!==e,l=x(t),c=e.startsWith(".");if(void 0!==o){if(!Line truncated
//# sourceMappingURL=bootstrap.bundle.min.js.map
+146 -222
View File
@@ -1,236 +1,160 @@
/**
* PWA Install and Service Worker Helper
* Powered by Antigravity AI
* RPIGroup Play - installazione come app (PWA) e registrazione del service worker
*
* - Chrome/Edge (Android e computer): intercetta beforeinstallprompt e mostra i pulsanti [data-pwa-install]
* (sidebar, topbar) e, su telefono, il banner in basso.
* - iOS: niente prompt; i pulsanti aprono le istruzioni passo passo.
* - App già installata (standalone): niente inviti.
*/
(function () {
const BASE_PATH = window.BASE_PATH || '';
// Register Service Worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${BASE_PATH}/sw.js`;
navigator.serviceWorker.register(swUrl)
.then((registration) => {
console.log('[PWA] Service Worker registrato con successo:', registration.scope);
})
.catch((error) => {
console.error('[PWA] Registrazione Service Worker fallita:', error);
'use strict';
var BASE = window.BASE_PATH || '';
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register(BASE + '/sw.js').catch(function (error) {
console.error('[PWA] Registrazione Service Worker fallita:', error);
});
});
});
}
// Detectors
const isStandalone = window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true;
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
// Se l'app viene aperta in modalità standalone (PWA) su desktop, reindirizza all'interno dell'app
if (isStandalone && !isMobile) {
const urlParams = new URLSearchParams(window.location.search);
if (!urlParams.has('app') || urlParams.get('app') !== 'true') {
const currentPath = window.location.pathname;
const pathWithoutBase = currentPath.replace(BASE_PATH, '').replace(/^\//, '');
const redirectParam = pathWithoutBase ? '&redirect=' + encodeURIComponent(pathWithoutBase) : '';
window.location.href = BASE_PATH + '/?app=true' + redirectParam;
}
}
// Global variables
window.deferredPrompt = null;
// Check if banner was dismissed in the last 7 days
function isBannerDismissed() {
const dismissedTime = localStorage.getItem('pwa-banner-dismissed');
if (!dismissedTime) return false;
const sevenDays = 7 * 24 * 60 * 60 * 1000;
return (Date.now() - parseInt(dismissedTime, 10)) < sevenDays;
}
// Dismiss banner
function dismissBanner() {
localStorage.setItem('pwa-banner-dismissed', Date.now().toString());
const banner = document.getElementById('pwa-install-banner');
if (banner) {
banner.classList.remove('show');
setTimeout(() => {
banner.style.display = 'none';
}, 400);
}
}
// Initialize UI components and listeners
function initPwaUI() {
// If already in standalone mode, hide all promotional components
if (isStandalone) {
console.log('[PWA] Applicazione avviata in modalità Standalone. Nascondo elementi PWA.');
return;
}
const headerBtn = document.getElementById('pwa-header-install-btn');
const desktopBtn = document.getElementById('desktopPwaInstallBtn');
const banner = document.getElementById('pwa-install-banner');
const bannerInstallBtn = document.getElementById('pwa-banner-install-btn');
const bannerCloseBtn = document.getElementById('pwa-banner-close-btn');
var isStandalone = window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true;
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
// On iOS, show the installation buttons immediately (as they don't support beforeinstallprompt)
if (isIOS) {
console.log('[PWA] Rilevato dispositivo iOS');
if (headerBtn) headerBtn.style.display = 'inline-flex';
if (desktopBtn) desktopBtn.style.display = 'inline-flex';
if (banner && !isBannerDismissed()) {
banner.style.display = 'flex';
setTimeout(() => banner.classList.add('show'), 100);
}
}
// Attach click listeners to all PWA installation buttons
const triggerInstall = (e) => {
e.preventDefault();
if (window.deferredPrompt) {
// Show native install prompt (Android / Desktop Chrome / Edge)
window.deferredPrompt.prompt();
window.deferredPrompt.userChoice.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
console.log('[PWA] Utente ha installato la PWA');
dismissBanner();
} else {
console.log('[PWA] Utente ha annullato l\'installazione');
}
window.deferredPrompt = null;
});
} else {
// Fallback for iOS Safari or other unsupported prompts
showInstructionsModal();
}
};
if (headerBtn) headerBtn.addEventListener('click', triggerInstall);
if (desktopBtn) desktopBtn.addEventListener('click', triggerInstall);
if (bannerInstallBtn) bannerInstallBtn.addEventListener('click', triggerInstall);
if (bannerCloseBtn) {
bannerCloseBtn.addEventListener('click', (e) => {
e.preventDefault();
dismissBanner();
});
}
// Modal Close logic
const modal = document.getElementById('pwa-instructions-modal');
const modalCloseBtnTop = document.getElementById('pwa-modal-close-btn');
const closeModal = () => {
if (modal) {
modal.classList.remove('show');
setTimeout(() => {
modal.style.display = 'none';
}, 300);
}
};
if (modalCloseBtnTop) modalCloseBtnTop.addEventListener('click', closeModal);
if (modal) {
modal.addEventListener('click', (e) => {
if (e.target === modal) closeModal();
});
}
}
// Listen for beforeinstallprompt (Chrome / Android / Edge)
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
// Se siamo su desktop, non salviamo il prompt e non mostriamo nessun banner promozionale PWA
if (!isMobile) {
console.log('[PWA] Installazione via browser intercettata su desktop. Ignorata per requisiti.');
return;
}
// Stash the event so it can be triggered later.
window.deferredPrompt = e;
console.log('[PWA] Evento beforeinstallprompt intercettato.');
// Show custom buttons and banner (if not dismissed)
const headerBtn = document.getElementById('pwa-header-install-btn');
const desktopBtn = document.getElementById('desktopPwaInstallBtn');
const banner = document.getElementById('pwa-install-banner');
if (headerBtn) headerBtn.style.display = 'inline-flex';
if (desktopBtn) desktopBtn.style.display = 'inline-flex';
if (banner && !isBannerDismissed()) {
banner.style.display = 'flex';
setTimeout(() => banner.classList.add('show'), 100);
}
});
// Track successful installation
window.addEventListener('appinstalled', () => {
console.log('[PWA] L\'applicazione è stata installata con successo.');
window.deferredPrompt = null;
// Hide all promotional components
const headerBtn = document.getElementById('pwa-header-install-btn');
const desktopBtn = document.getElementById('desktopPwaInstallBtn');
const banner = document.getElementById('pwa-install-banner');
if (headerBtn) headerBtn.style.display = 'none';
if (desktopBtn) desktopBtn.style.display = 'none';
if (banner) banner.style.display = 'none';
});
// Show instructions modal (iOS / Fallback)
function showInstructionsModal() {
const modal = document.getElementById('pwa-instructions-modal');
const content = document.getElementById('pwa-instructions-content');
if (!modal || !content) return;
function $(sel) { return document.querySelector(sel); }
function $$(sel) { return Array.prototype.slice.call(document.querySelectorAll(sel)); }
if (isIOS) {
content.innerHTML = `
<div class="pwa-step">
<div class="pwa-step-num">1</div>
<div class="pwa-step-text">Tocca l'icona di <strong>Condividi</strong> <span class="pwa-inline-icon"><i class="material-icons" style="font-size:18px; color:#f7b835;">share</i></span> (il quadrato con la freccia verso l'alto) nella barra in basso di Safari.</div>
</div>
<div class="pwa-step">
<div class="pwa-step-num">2</div>
<div class="pwa-step-text">Scorri l'elenco delle opzioni verso il basso e seleziona <strong>Aggiungi alla schermata Home</strong> <span class="pwa-inline-icon"><i class="material-icons" style="font-size:18px; color:#f7b835;">add_box</i></span>.</div>
</div>
<div class="pwa-step">
<div class="pwa-step-num">3</div>
<div class="pwa-step-text">Tocca <strong>Aggiungi</strong> nell'angolo in alto a destra per inserire l'icona sul tuo telefono.</div>
</div>
`;
} else {
content.innerHTML = `
<div class="pwa-step">
<div class="pwa-step-num">1</div>
<div class="pwa-step-text">Apri il menu delle impostazioni del browser toccando i <strong>tre puntini</strong> <span class="pwa-inline-icon"><i class="material-icons" style="font-size:18px; color:#f7b835;">more_vert</i></span> in alto a destra.</div>
</div>
<div class="pwa-step">
<div class="pwa-step-num">2</div>
<div class="pwa-step-text">Seleziona la voce <strong>Installa applicazione</strong> o <strong>Aggiungi a schermata Home</strong>.</div>
</div>
<div class="pwa-step">
<div class="pwa-step-num">3</div>
<div class="pwa-step-text">Conferma per scaricare la PWA sul tuo telefono.</div>
</div>
`;
function isBannerDismissed() {
try {
var t = localStorage.getItem('pwa-banner-dismissed');
return t ? (Date.now() - parseInt(t, 10)) < 7 * 24 * 60 * 60 * 1000 : false;
} catch (e) { return false; }
}
modal.style.display = 'flex';
setTimeout(() => modal.classList.add('show'), 10);
}
function showBanner() {
var banner = $('#pwa-install-banner');
if (!banner || !isMobile || isBannerDismissed()) return;
banner.hidden = false;
setTimeout(function () { banner.classList.add('show'); }, 100);
}
// Run on DOM loaded
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initPwaUI);
} else {
initPwaUI();
}
function dismissBanner() {
try { localStorage.setItem('pwa-banner-dismissed', String(Date.now())); } catch (e) { /* niente archivio */ }
hideBanner();
}
function hideBanner() {
var banner = $('#pwa-install-banner');
if (!banner) return;
banner.classList.remove('show');
setTimeout(function () { banner.hidden = true; }, 400);
}
function showButtons(show) {
$$('[data-pwa-install]').forEach(function (b) { b.hidden = !show; });
}
function icon(name) {
var paths = {
share: '<path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><path d="m16 6-4-4-4 4M12 2v13"/>',
plus: '<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M8 12h8M12 8v8"/>',
more: '<circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/>',
download: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5M12 15V3"/>'
};
return '<span class="pwa-inline-icon"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' + paths[name] + '</svg></span>';
}
function step(n, text) {
return '<div class="pwa-step"><div class="pwa-step-num">' + n + '</div><div class="pwa-step-text">' + text + '</div></div>';
}
function showInstructionsModal() {
var modal = $('#pwa-instructions-modal');
var box = $('#pwa-instructions-content');
if (!modal || !box) return;
if (isIOS) {
box.innerHTML =
step(1, "Tocca l'icona <strong>Condividi</strong> " + icon('share') + " nella barra di Safari.") +
step(2, "Scorri l'elenco e scegli <strong>Aggiungi alla schermata Home</strong> " + icon('plus') + ".") +
step(3, "Tocca <strong>Aggiungi</strong> in alto a destra: l'icona compare sul telefono.");
} else if (isMobile) {
box.innerHTML =
step(1, "Apri il menu del browser con i <strong>tre puntini</strong> " + icon('more') + " in alto a destra.") +
step(2, "Scegli <strong>Installa app</strong> oppure <strong>Aggiungi a schermata Home</strong>.") +
step(3, "Conferma: RPIGroup Play si apre a schermo intero come un'app.");
} else {
box.innerHTML =
step(1, "Nella barra degli indirizzi del browser cerca l'icona <strong>Installa</strong> " + icon('download') + ".") +
step(2, "Oppure apri il menu del browser e scegli <strong>Installa RPIGroup Play</strong>.") +
step(3, "L'app si apre in una finestra sua, con la sua icona nel sistema.");
}
modal.hidden = false;
setTimeout(function () { modal.classList.add('show'); }, 10);
}
function closeModal() {
var modal = $('#pwa-instructions-modal');
if (!modal) return;
modal.classList.remove('show');
setTimeout(function () { modal.hidden = true; }, 300);
}
function triggerInstall(e) {
if (e) e.preventDefault();
if (window.deferredPrompt) {
window.deferredPrompt.prompt();
window.deferredPrompt.userChoice.then(function (choice) {
if (choice.outcome === 'accepted') dismissBanner();
window.deferredPrompt = null;
});
} else {
showInstructionsModal();
}
}
function initPwaUI() {
if (isStandalone) return;
// Su iOS i pulsanti compaiono subito (non esiste beforeinstallprompt)
if (isIOS) {
showButtons(true);
showBanner();
}
document.addEventListener('click', function (e) {
if (e.target.closest('[data-pwa-install], #pwa-banner-install-btn')) triggerInstall(e);
});
var closeBtn = $('#pwa-banner-close-btn');
if (closeBtn) closeBtn.addEventListener('click', function (e) { e.preventDefault(); dismissBanner(); });
var modal = $('#pwa-instructions-modal');
var modalClose = $('#pwa-modal-close-btn');
if (modalClose) modalClose.addEventListener('click', closeModal);
if (modal) modal.addEventListener('click', function (e) { if (e.target === modal) closeModal(); });
document.addEventListener('keydown', function (e) { if (e.key === 'Escape') closeModal(); });
}
window.addEventListener('beforeinstallprompt', function (e) {
e.preventDefault();
if (isStandalone) return;
window.deferredPrompt = e;
showButtons(true);
showBanner();
});
window.addEventListener('appinstalled', function () {
window.deferredPrompt = null;
showButtons(false);
hideBanner();
});
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', initPwaUI);
else initPwaUI();
})();