diff --git a/zanzara.php b/zanzara.php index 6e4642e..1899835 100644 --- a/zanzara.php +++ b/zanzara.php @@ -337,7 +337,7 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { } /* PLAYER AUDIO CUSTOM SEMPLICE */ - + /* Nascondi il player nativo */ audio { display: none; @@ -681,12 +681,8 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { order: 2; } - .form-group button[type="submit"]:not(.random-button) { - order: 3; - } - .form-group button[type="button"] { - order: 4; + order: 3; } .navigation { @@ -864,7 +860,6 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { value="" autocomplete="off" inputmode="numeric"> - @@ -912,10 +907,10 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { echo ''; - + // Layout principale echo '
'; - + // Pulsante Play/Pause echo ''; - + // Container progresso echo '
'; echo '
@@ -936,7 +931,7 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { echo '0:00'; echo '
'; echo '
'; - + echo '
'; // Chiude player-layout echo ''; // Chiude custom-audio-player @@ -950,10 +945,10 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { const currentTimeDisplay = document.getElementById("currentTime"); const durationDisplay = document.getElementById("duration"); const audioPlayer = document.getElementById("audioPlayer"); - + let isPlaying = false; let isDragging = false; - + // Formatta il tempo function formatTime(seconds) { if (isNaN(seconds)) return "0:00"; @@ -961,28 +956,28 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { const secs = Math.floor(seconds % 60); return mins + ":" + (secs < 10 ? "0" : "") + secs; } - + // Funzione per aggiornare la posizione function updateProgress(e) { const rect = progressBar.getBoundingClientRect(); let x; - + // Supporto per touch e mouse if (e.touches) { x = e.touches[0].clientX - rect.left; } else { x = e.clientX - rect.left; } - + const clickPercent = Math.max(0, Math.min(1, x / rect.width)); - + if (audio.duration) { audio.currentTime = clickPercent * audio.duration; progressFill.style.width = (clickPercent * 100) + "%"; currentTimeDisplay.textContent = formatTime(audio.currentTime); } } - + // Play/Pause playPauseBtn.addEventListener("click", function() { if (isPlaying) { @@ -991,22 +986,22 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { audio.play(); } }); - + audio.addEventListener("play", function() { isPlaying = true; audioPlayer.classList.add("playing"); }); - + audio.addEventListener("pause", function() { isPlaying = false; audioPlayer.classList.remove("playing"); }); - + // Aggiorna durata quando disponibile audio.addEventListener("loadedmetadata", function() { durationDisplay.textContent = formatTime(audio.duration); }); - + // Aggiorna progresso durante la riproduzione audio.addEventListener("timeupdate", function() { if (!isDragging && audio.duration) { @@ -1015,7 +1010,7 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { currentTimeDisplay.textContent = formatTime(audio.currentTime); } }); - + // Eventi Mouse progressBar.addEventListener("mousedown", function(e) { isDragging = true; @@ -1023,20 +1018,20 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { updateProgress(e); e.preventDefault(); }); - + document.addEventListener("mousemove", function(e) { if (isDragging) { updateProgress(e); } }); - + document.addEventListener("mouseup", function() { if (isDragging) { isDragging = false; audioPlayer.classList.remove("dragging"); } }); - + // Eventi Touch progressBar.addEventListener("touchstart", function(e) { isDragging = true; @@ -1044,42 +1039,42 @@ if (isset($_GET['action']) && $_GET['action'] === 'get_valid_dates') { updateProgress(e); e.preventDefault(); }); - + document.addEventListener("touchmove", function(e) { if (isDragging) { updateProgress(e); e.preventDefault(); } }); - + document.addEventListener("touchend", function() { if (isDragging) { isDragging = false; audioPlayer.classList.remove("dragging"); } }); - + // Click semplice sulla barra progressBar.addEventListener("click", function(e) { if (!isDragging) { updateProgress(e); } }); - + // Auto-play audio.play().catch(function(error) { console.log("Autoplay bloccato:", error); }); - + // Gestione buffering audio.addEventListener("waiting", function() { audioPlayer.classList.add("buffering"); }); - + audio.addEventListener("canplay", function() { audioPlayer.classList.remove("buffering"); }); - + // Fine del file audio.addEventListener("ended", function() { isPlaying = false; @@ -1235,6 +1230,16 @@ $(document).ready(function() { } }); + // Gestione invio con Enter nell'input + $('#datepicker').on('keypress', function(e) { + if (e.which === 13) { // Enter key + e.preventDefault(); + if ($(this).val().length === 8) { // Controlla che sia nel formato YYYYMMDD + $('#dateForm').submit(); + } + } + }); + // Aggiungi scorciatoie da tastiera per navigazione $(document).keydown(function(e) { if ($('input:focus').length === 0) { // Solo se non si sta digitando in un input @@ -1276,7 +1281,7 @@ $(document).ready(function() { 🔗 Pagina ufficiale LaZanzara

-

- - - powered by Gabry, Claude and me - v1.0.0 (01/08/2025) - - -

+

- - - powered by Gabry, Claude and me - v1.1.0 (14/09/2025) - - -

- \ No newline at end of file +