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:
1 parent
0ee93d3b75
commit
24391c49ac
58 files changed
+5226
-16550
No files matched your search
+29
-29
@@ -1,29 +1,29 @@
|
||||
<?php
|
||||
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
|
||||
// Information App
|
||||
$title_site = "RPIGroup Play";
|
||||
$description_site = "Ascolta le radio del gruppo RPIGroup";
|
||||
$logo_site = "./img/logoapp.png";
|
||||
|
||||
include_once './config/getBasePath.inc.php';
|
||||
include_once './config/getStation.inc.php';
|
||||
include_once './config/getPage.inc.php';
|
||||
|
||||
// Controllo se l'utente è su mobile o desktop
|
||||
$is_mobile = isMobile();
|
||||
|
||||
// Se l'utente è su mobile, mostra l'app direttamente
|
||||
// Se è su desktop, mostra prima la pagina con il pulsante "Apri l'app"
|
||||
$show_app = $is_mobile || (isset($_GET['app']) && $_GET['app'] == 'true');
|
||||
|
||||
if ($show_app && isset($_GET['redirect']) && !empty($_GET['redirect'])) {
|
||||
$redirect_parts = explode('/', $_GET['redirect']);
|
||||
$page = isset($redirect_parts[0]) ? $redirect_parts[0] : 'home';
|
||||
$param = isset($redirect_parts[1]) ? $redirect_parts[1] : '';
|
||||
}
|
||||
|
||||
// Include AJAX module DOPO aver definito le variabili
|
||||
include_once './config/ajaxModule.inc.php';
|
||||
<?php
|
||||
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
|
||||
// Information App
|
||||
$title_site = "RPIGroup Play";
|
||||
$description_site = "Ascolta le radio e le web TV del gruppo RPIGroup, con i podcast da riascoltare quando vuoi";
|
||||
$logo_site = "./img/logoapp.png";
|
||||
|
||||
include_once './config/getBasePath.inc.php';
|
||||
include_once './config/getStation.inc.php';
|
||||
include_once './config/getPage.inc.php';
|
||||
include_once './config/ui.inc.php';
|
||||
|
||||
// L'app è la stessa su telefono e computer: il layout si adatta alla larghezza della finestra.
|
||||
// Il parametro ?app=true resta accettato per i link già in giro (siti del gruppo, finestra popup, PWA installate).
|
||||
$is_mobile = isMobile();
|
||||
|
||||
// ?redirect=pagina/parametro: usato dai siti del gruppo per aprire l'app direttamente su una stazione
|
||||
if (isset($_GET['redirect']) && !empty($_GET['redirect'])) {
|
||||
$redirect_parts = explode('/', $_GET['redirect']);
|
||||
$page = isset($redirect_parts[0]) ? sanitizePageInput($redirect_parts[0]) : 'home';
|
||||
$param = isset($redirect_parts[1]) ? sanitizePageInput($redirect_parts[1]) : '';
|
||||
if ($page === '') $page = 'home';
|
||||
}
|
||||
|
||||
// Include AJAX module DOPO aver definito le variabili
|
||||
include_once './config/ajaxModule.inc.php';
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
// Determina il percorso base dell'applicazione
|
||||
$script_name = $_SERVER['SCRIPT_NAME'];
|
||||
$script_path = dirname($script_name);
|
||||
$base_path = rtrim($script_path, '/');
|
||||
$base_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$base_path";
|
||||
<?php
|
||||
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
|
||||
// Determina il percorso base dell'applicazione (su Windows dirname() usa la barra rovesciata: la normalizziamo)
|
||||
$script_name = $_SERVER['SCRIPT_NAME'];
|
||||
$script_path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($script_name));
|
||||
$base_path = rtrim($script_path, '/');
|
||||
$base_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$base_path";
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Pezzi di interfaccia condivisi tra le pagine: icone SVG inline, intestazioni, motivo grafico, link.
|
||||
* Tutto quello che riguarda l'aspetto e si ripete sta qui, così le pagine restano leggibili.
|
||||
*/
|
||||
|
||||
/** Indirizzo di una pagina dell'app (home = radice) */
|
||||
function rpi_link(string $page): string
|
||||
{
|
||||
global $base_path;
|
||||
return $page === 'home' ? $base_path . '/' : $base_path . '/' . $page;
|
||||
}
|
||||
|
||||
/** Sezione principale a cui appartiene una pagina (per evidenziare la voce di menu) */
|
||||
function rpi_section(string $page, string $param = ''): string
|
||||
{
|
||||
if ($page === 'play') return 'radio';
|
||||
if ($page === 'playtv') return 'tv';
|
||||
if (in_array($page, ['home', 'radio', 'tv', 'podcast'], true)) return $page;
|
||||
return '';
|
||||
}
|
||||
|
||||
/** Voci del menu principale (sidebar su desktop, tab bar su telefono) */
|
||||
function rpi_nav_items(): array
|
||||
{
|
||||
return [
|
||||
['page' => 'home', 'label' => 'Home', 'icon' => 'home'],
|
||||
['page' => 'radio', 'label' => 'Radio', 'icon' => 'radio'],
|
||||
['page' => 'tv', 'label' => 'TV', 'icon' => 'tv'],
|
||||
['page' => 'podcast', 'label' => 'Podcast', 'icon' => 'mic'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Icona SVG inline (griglia 24x24, tratto 2px, colore corrente).
|
||||
* Le icone "piene" (play, pause) usano il riempimento invece del tratto.
|
||||
*/
|
||||
function rpi_icon(string $name, int $size = 20, string $class = ''): string
|
||||
{
|
||||
static $icons = [
|
||||
'home' => '<path d="m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1V10Z"/>',
|
||||
'radio' => '<path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9"/><path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"/><circle cx="12" cy="12" r="2"/><path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"/><path d="M19.1 4.9C23 8.8 23 15.1 19.1 19"/>',
|
||||
'tv' => '<rect width="20" height="15" x="2" y="7" rx="2" ry="2"/><path d="m17 2-5 5-5-5"/>',
|
||||
'mic' => '<rect x="9" y="2" width="6" height="12" rx="3"/><path d="M5 10a7 7 0 0 0 14 0M12 17v5"/>',
|
||||
'headphones' => '<path d="M3 18v-6a9 9 0 0 1 18 0v6"/><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"/>',
|
||||
'arrow-left' => '<path d="M19 12H5M11 18l-6-6 6-6"/>',
|
||||
'arrow-right' => '<path d="M5 12h14M13 6l6 6-6 6"/>',
|
||||
'external' => '<path d="M7 17 17 7M8 7h9v9"/>',
|
||||
'volume' => '<path d="M11 5 6 9H2v6h4l5 4V5Z"/><path d="M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14"/>',
|
||||
'mute' => '<path d="M11 5 6 9H2v6h4l5 4V5Z"/><path d="m23 9-6 6M17 9l6 6"/>',
|
||||
'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"/>',
|
||||
'close' => '<path d="M18 6 6 18M6 6l12 12"/>',
|
||||
'calendar' => '<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><path d="M16 2v4M8 2v4M3 10h18"/>',
|
||||
'wifi-off' => '<path d="M2 2 22 22"/><path d="M8.5 16.5a5 5 0 0 1 7 0"/><path d="M2 8.82a15 15 0 0 1 4.17-2.65"/><path d="M10.66 5c4.01-.36 8.14.9 11.34 3.76"/><path d="M16.85 11.25a10 10 0 0 1 2.22 1.68"/><path d="M5 13a10 10 0 0 1 5.24-2.76"/><path d="M12 20h.01"/>',
|
||||
'refresh' => '<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',
|
||||
'info' => '<circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/>',
|
||||
'help' => '<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01"/>',
|
||||
'copyright' => '<circle cx="12" cy="12" r="10"/><path d="M14.83 14.83a4 4 0 1 1 0-5.66"/>',
|
||||
'mail' => '<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
|
||||
'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-square' => '<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M8 12h8M12 8v8"/>',
|
||||
'more-vertical' => '<circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/>',
|
||||
'rss' => '<path d="M4 11a9 9 0 0 1 9 9"/><path d="M4 4a16 16 0 0 1 16 16"/><circle cx="5" cy="19" r="1"/>',
|
||||
'message' => '<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>',
|
||||
'list' => '<path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/>',
|
||||
'shield' => '<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>',
|
||||
'file-text' => '<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8M16 13H8M16 17H8"/>',
|
||||
'globe' => '<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20M2 12h20"/>',
|
||||
'clock' => '<circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/>',
|
||||
'sparkles' => '<path d="m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3Z"/>',
|
||||
'maximize' => '<path d="M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"/>',
|
||||
// Piene
|
||||
'play' => '<path d="M7 4.5v15a1 1 0 0 0 1.5.86l12.5-7.5a1 1 0 0 0 0-1.72L8.5 3.64A1 1 0 0 0 7 4.5Z"/>',
|
||||
'pause' => '<rect x="6" y="4.5" width="4" height="15" rx="1.2"/><rect x="14" y="4.5" width="4" height="15" rx="1.2"/>',
|
||||
];
|
||||
|
||||
if (!isset($icons[$name])) return '';
|
||||
$filled = in_array($name, ['play', 'pause'], true);
|
||||
$paint = $filled
|
||||
? 'fill="currentColor"'
|
||||
: 'fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"';
|
||||
$cls = trim('icon icon-' . $name . ' ' . $class);
|
||||
|
||||
return '<svg class="' . htmlspecialchars($cls) . '" viewBox="0 0 24 24" width="' . $size . '" height="' . $size . '" ' . $paint . ' aria-hidden="true" focusable="false">' . $icons[$name] . '</svg>';
|
||||
}
|
||||
|
||||
/** Figura decorativa delle sezioni scure: anelli concentrici (il "segno" di RPIGroup Play) */
|
||||
function rpi_motivo(string $class = ''): string
|
||||
{
|
||||
$cls = trim('motivo ' . $class);
|
||||
$out = '<svg class="' . htmlspecialchars($cls) . '" viewBox="0 0 800 800" fill="none" aria-hidden="true" focusable="false">';
|
||||
foreach ([140, 230, 320, 395] as $r) {
|
||||
$out .= '<circle cx="400" cy="400" r="' . $r . '"/>';
|
||||
}
|
||||
return $out . '</svg>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Intestazione di una pagina interna: sfondo del brand, pillola "torna a", etichetta, titolo, sottotitolo.
|
||||
* $o = ['title' => ..., 'eyebrow' => ..., 'subtitle' => ..., 'back' => ['page' => 'home', 'label' => 'Home'], 'class' => ...]
|
||||
*/
|
||||
function rpi_page_header(array $o): void
|
||||
{
|
||||
$title = $o['title'] ?? '';
|
||||
$eyebrow = $o['eyebrow'] ?? '';
|
||||
$subtitle = $o['subtitle'] ?? '';
|
||||
$back = $o['back'] ?? ['page' => 'home', 'label' => 'Home'];
|
||||
$class = $o['class'] ?? '';
|
||||
?>
|
||||
<header class="page-head <?= htmlspecialchars($class) ?>">
|
||||
<span class="page-head-glow" aria-hidden="true"></span>
|
||||
<?= rpi_motivo('page-head-motivo') ?>
|
||||
<div class="container page-head-inner">
|
||||
<?php if ($back): ?>
|
||||
<a href="<?= rpi_link($back['page']) ?>" data-page="<?= htmlspecialchars($back['page']) ?>" class="back-pill">
|
||||
<?= rpi_icon('arrow-left', 18) ?><?= htmlspecialchars($back['label']) ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($eyebrow): ?><span class="eyebrow"><?= htmlspecialchars($eyebrow) ?></span><?php endif; ?>
|
||||
<h1><?= htmlspecialchars($title) ?></h1>
|
||||
<?php if ($subtitle): ?><p class="subtitle"><?= htmlspecialchars($subtitle) ?></p><?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
<?php
|
||||
}
|
||||
|
||||
/** Barra in testa alle viste a tutta altezza (player radio, TV, puntata podcast): pillola indietro + titolo */
|
||||
function rpi_back_pill(string $page, string $label): string
|
||||
{
|
||||
return '<a href="' . rpi_link($page) . '" data-page="' . htmlspecialchars($page) . '" class="back-pill">'
|
||||
. rpi_icon('arrow-left', 18) . htmlspecialchars($label) . '</a>';
|
||||
}
|
||||
|
||||
/** Link legali e versione: nella sidebar (desktop) e in fondo alla home (telefono) */
|
||||
function rpi_legal_links(): array
|
||||
{
|
||||
return [
|
||||
['page' => 'page/termini-condizioni', 'label' => 'Termini e Condizioni'],
|
||||
['page' => 'page/policy-privacy', 'label' => 'Policy Privacy'],
|
||||
['page' => 'page/changelog', 'label' => 'Changelog'],
|
||||
];
|
||||
}
|
||||
|
||||
/** Dati di una stazione radio per il player (attributo data-station) */
|
||||
function rpi_station_json($station): string
|
||||
{
|
||||
return htmlspecialchars(json_encode([
|
||||
'id' => (int)$station->id,
|
||||
'name' => (string)$station->name,
|
||||
'slogan' => (string)$station->slogan,
|
||||
'logo' => (string)$station->logo,
|
||||
'stream' => (string)$station->stream,
|
||||
'streamhls' => (string)$station->streamhls,
|
||||
'api' => (string)$station->apiradio,
|
||||
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
Reference in new issue
Block a user