vers. 3.0.4 - guscio e barre come nella 3.0.0, pagina di diagnostica
Con l'icona installata la 3.0.0 si vedeva bene: il guscio torna in flusso con height 100dvh (position: relative per i figli assoluti), topbar blu, nessuno sfondo forzato su html, theme-color #1c2555; rimossi il rilevamento del viewport ridotto e la classe vp-ridotto. Aggiunto debug.html: riquadri con i confini di fixed inset 0, 100dvh, 100vh e area sicura, più i numeri riportati dal dispositivo. Cache del service worker v10. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
394285b016
commit
c9fecb068b
7 files changed
+79
-57
No files matched your search
+8
-16
@@ -107,14 +107,7 @@ body.has-player {
|
||||
--dock-space: var(--player-h);
|
||||
}
|
||||
|
||||
/* iPhone, app installata, viewport più corto dello schermo (vedi js/app.js): l'area sicura in basso è già fuori
|
||||
dal viewport, la tab bar non la aggiunge una seconda volta */
|
||||
html.vp-ridotto {
|
||||
--safe-bottom: 0px;
|
||||
}
|
||||
|
||||
/* Colore delle barre dell'app (topbar, tab bar, sfondo di pagina): lo stesso, così le fasce che iOS dipinge
|
||||
fuori dal viewport (barra di stato, fondo) si fondono con le barre */
|
||||
/* Colore della tab bar */
|
||||
:root {
|
||||
--bar-bg: color-mix(in srgb, var(--brand-900) 92%, black);
|
||||
}
|
||||
@@ -140,8 +133,6 @@ html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
text-size-adjust: 100%;
|
||||
overscroll-behavior: none;
|
||||
/* Stesso colore di topbar e tab bar: le fasce che il sistema dipinge fuori dal viewport si fondono con le barre */
|
||||
background: var(--bar-bg);
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -257,11 +248,12 @@ button {
|
||||
|
||||
/* Ancorato ai bordi dello schermo: su iOS (app installata, barra di stato trasparente) le altezze in vh/dvh
|
||||
possono risultare più corte dello schermo e lasciare una fascia vuota sotto la tab bar */
|
||||
/* Tutto ciò che è "fisso" (player, banner, overlay, barra di avanzamento) è figlio del guscio con position: absolute:
|
||||
segue il guscio, non il viewport. */
|
||||
/* Guscio in flusso alto quanto il viewport dinamico (come nella 3.0.0). Player, banner, overlay e barra di
|
||||
avanzamento sono figli del guscio con position: absolute: seguono il guscio. */
|
||||
.app-shell {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
position: relative;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr) auto;
|
||||
grid-template-areas: "top" "main" "tab";
|
||||
@@ -303,9 +295,9 @@ button {
|
||||
position: relative;
|
||||
height: calc(var(--topbar-h) + var(--safe-top));
|
||||
padding: var(--safe-top) var(--gutter) 0;
|
||||
background: var(--bar-bg);
|
||||
background: var(--brand-700);
|
||||
color: #fff;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 30px color-mix(in srgb, var(--brand-900) 25%, transparent);
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
|
||||
<changelog>
|
||||
|
||||
<version>
|
||||
<number>3.0.4</number>
|
||||
<logs>
|
||||
<log>Guscio dell'app, topbar e colori riportati a come erano nella 3.0.0 (che sull'iPhone si vedeva correttamente); restano le migliorie al player, ai podcast e all'aggiornamento automatico.</log>
|
||||
<log>Pagina di diagnostica /debug.html per verificare i confini del viewport sul dispositivo.</log>
|
||||
</logs>
|
||||
</version>
|
||||
|
||||
|
||||
<version>
|
||||
<number>3.0.3</number>
|
||||
<logs>
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>RPIGroup Play - diagnostica viewport</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="theme-color" content="#1c2555">
|
||||
<style>
|
||||
html, body { margin: 0; height: 100%; background: #0b0e20; color: #fff; font: 13px/1.4 -apple-system, system-ui, sans-serif; overflow: hidden; }
|
||||
/* Riquadri con i confini di ogni misura: dove finiscono, lì finisce quella misura */
|
||||
.box { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; box-sizing: border-box; }
|
||||
#fixed { position: fixed; inset: 0; border: 4px solid #e53935; } /* rosso: position fixed inset 0 */
|
||||
#dvh { height: 100dvh; border: 4px dashed #43a047; margin: 8px; } /* verde: 100dvh */
|
||||
#vh { height: 100vh; border: 4px dotted #1e88e5; margin: 16px; } /* blu: 100vh */
|
||||
#safe { position: fixed; inset: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
|
||||
#safe::before { content: ""; display: block; height: 100%; border: 3px solid #fdd835; box-sizing: border-box; } /* giallo: area sicura */
|
||||
#bottom { position: fixed; left: 0; right: 0; bottom: 0; background: #e53935; text-align: center; padding: 4px; font-weight: 700; }
|
||||
#info { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.85); padding: 12px 14px; border-radius: 10px; white-space: pre; font-family: ui-monospace, Menlo, monospace; font-size: 12px; z-index: 10; }
|
||||
#legend { position: fixed; top: 70px; left: 24px; right: 24px; z-index: 10; font-size: 12px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="fixed" class="box"></div>
|
||||
<div id="dvh" class="box"></div>
|
||||
<div id="vh" class="box"></div>
|
||||
<div id="safe"></div>
|
||||
<div id="bottom">position: fixed; bottom: 0</div>
|
||||
<div id="legend">rosso = fixed inset 0 · verde = 100dvh · blu = 100vh · giallo = area sicura</div>
|
||||
<pre id="info">misuro…</pre>
|
||||
<script>
|
||||
function probe() {
|
||||
var cs = getComputedStyle(document.getElementById('safe'));
|
||||
var vv = window.visualViewport;
|
||||
var standalone = navigator.standalone === true || matchMedia('(display-mode: standalone)').matches;
|
||||
var righe = [
|
||||
'UA: ' + navigator.userAgent.replace(/^Mozilla\/5\.0 /, '').slice(0, 60),
|
||||
'standalone: ' + standalone + ' display-mode standalone: ' + matchMedia('(display-mode: standalone)').matches,
|
||||
'inner: ' + window.innerWidth + ' x ' + window.innerHeight,
|
||||
'outer: ' + window.outerWidth + ' x ' + window.outerHeight,
|
||||
'screen: ' + screen.width + ' x ' + screen.height + ' avail: ' + screen.availWidth + ' x ' + screen.availHeight,
|
||||
'documentElement.clientHeight: ' + document.documentElement.clientHeight,
|
||||
'visualViewport: ' + (vv ? Math.round(vv.width) + ' x ' + Math.round(vv.height) + ' offsetTop ' + Math.round(vv.offsetTop) + ' scale ' + vv.scale : 'n/d'),
|
||||
'safe-area top/right/bottom/left: ' + [cs.paddingTop, cs.paddingRight, cs.paddingBottom, cs.paddingLeft].join(' / '),
|
||||
'100dvh box: ' + document.getElementById('dvh').getBoundingClientRect().height + ' 100vh box: ' + document.getElementById('vh').getBoundingClientRect().height,
|
||||
'fixed box bottom: ' + Math.round(document.getElementById('fixed').getBoundingClientRect().bottom),
|
||||
'devicePixelRatio: ' + window.devicePixelRatio
|
||||
];
|
||||
document.getElementById('info').textContent = righe.join('\n');
|
||||
}
|
||||
probe();
|
||||
window.addEventListener('resize', probe);
|
||||
if (window.visualViewport) window.visualViewport.addEventListener('resize', probe);
|
||||
setTimeout(probe, 800);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -814,45 +814,8 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* iPhone, app installata: iOS 26 dà alla pagina un viewport più corto dello schermo (barra di stato in alto e una
|
||||
* fascia di circa 60 pt in basso restano fuori e il sistema le dipinge con lo sfondo della pagina; lì non si può
|
||||
* disegnare). In quel caso iOS riporta comunque un'area sicura in basso, che sarebbe doppia: la classe
|
||||
* vp-ridotto su <html> la azzera (css: --safe-bottom), così sotto le icone della tab bar resta solo la fascia
|
||||
* del sistema, dello stesso colore della barra.
|
||||
*/
|
||||
var Schermo = {
|
||||
iphone: /iPhone|iPod/.test(navigator.userAgent),
|
||||
standalone: function () {
|
||||
return navigator.standalone === true || (window.matchMedia && window.matchMedia('(display-mode: standalone)').matches);
|
||||
},
|
||||
adatta: function () {
|
||||
var root = document.documentElement;
|
||||
var ridotto = false;
|
||||
if (this.iphone && this.standalone()) {
|
||||
var portrait = window.innerHeight >= window.innerWidth;
|
||||
var screenH = portrait ? Math.max(screen.width, screen.height) : Math.min(screen.width, screen.height);
|
||||
var screenW = portrait ? Math.min(screen.width, screen.height) : Math.max(screen.width, screen.height);
|
||||
var differenza = screenH - window.innerHeight;
|
||||
// Solo a schermo intero e per uno scarto "da barra" (tra 40 e 160 pt)
|
||||
ridotto = window.innerWidth === screenW && differenza >= 40 && differenza <= 160;
|
||||
}
|
||||
root.classList.toggle('vp-ridotto', ridotto);
|
||||
},
|
||||
init: function () {
|
||||
var self = this;
|
||||
var aggiorna = function () { self.adatta(); };
|
||||
aggiorna();
|
||||
window.addEventListener('resize', aggiorna);
|
||||
window.addEventListener('orientationchange', function () { setTimeout(aggiorna, 300); });
|
||||
window.addEventListener('pageshow', aggiorna);
|
||||
if (window.visualViewport) window.visualViewport.addEventListener('resize', aggiorna);
|
||||
}
|
||||
};
|
||||
|
||||
function init() {
|
||||
if (!content || gusciVecchio()) return;
|
||||
Schermo.init();
|
||||
Offline.init();
|
||||
Player.init();
|
||||
Podcast.init();
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
"start_url": "./?app=true",
|
||||
"scope": "./",
|
||||
"display": "standalone",
|
||||
"background_color": "#0e132b",
|
||||
"theme_color": "#0e132b",
|
||||
"background_color": "#1c2555",
|
||||
"theme_color": "#1c2555",
|
||||
"orientation": "any",
|
||||
"lang": "it",
|
||||
"categories": ["music", "entertainment", "news"],
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ header('Referrer-Policy: strict-origin-when-cross-origin');
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="<?php echo $title_site; ?>">
|
||||
<meta name="theme-color" content="#0e132b">
|
||||
<meta name="theme-color" content="#1c2555">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<link rel="icon" type="image/png" href="<?=$base_path?>/img/logoapp.png">
|
||||
<link rel="apple-touch-icon" href="<?=$base_path?>/img/logoapp.png">
|
||||
|
||||
Reference in new issue
Block a user