File manager - Edit - /var/www/html/visiteAngra/public/js/main.js
Back
document.addEventListener("DOMContentLoaded", function () { // Back to top button const button = document.querySelector(".go-top"); if (button) { BACK2TOP(button, 200); } // AOS Animate if (typeof AOS !== 'undefined') { AOS.init(); } // Leaflet Map initialization const mapDiv = document.getElementById("map"); if (mapDiv) { const lat = parseFloat(mapDiv.getAttribute("data-lat")); const lng = parseFloat(mapDiv.getAttribute("data-long")); const info = mapDiv.getAttribute("data-info"); if (!isNaN(lat) && !isNaN(lng)) { const map = L.map('map').setView([lat, lng], 15); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© <a href="https://www.openstreetmap.org/">OpenStreetMap</a> colaboradores' }).addTo(map); L.marker([lat, lng]).addTo(map) .bindPopup(info) .openPopup(); } } // Random tourist points rotation (homepage) const items = document.querySelectorAll(".ponto-item"); const total = items.length; const mostrarPorVez = 12; if (total > 0) { function mostrarAleatorio() { items.forEach(item => item.style.display = "none"); let maxMostrar = Math.min(mostrarPorVez, total); let indices = []; while (indices.length < maxMostrar) { let n = Math.floor(Math.random() * total); if (!indices.includes(n)) { indices.push(n); } } indices.forEach(i => { items[i].style.display = "block"; }); } mostrarAleatorio(); if (total > mostrarPorVez) { setInterval(mostrarAleatorio, 6000); } } }); function BACK2TOP(selector, offset, prop = 'all', time = '300', effect = 'ease', delay = 0) { const WIN_SCROLLED = function () { if (document.body.scrollTop > offset || document.documentElement.scrollTop > offset) { const STYLES = { opacity: '1', visibility: 'visible', transform: 'translateY(0)', transition: `${prop} ${time}ms ${effect} ${delay}ms` } Object.assign(selector.style, STYLES); } else { const STYLES = { opacity: '0', visibility: 'hidden', transform: 'translateY(100%)', transition: `${prop} ${time}ms ${effect} ${delay}ms` } Object.assign(selector.style, STYLES); } }; const SCROLL_EVT = function () { document.documentElement.scrollTo({ top: 0, left: 0, behavior: 'smooth' }); }; selector.addEventListener("click", SCROLL_EVT); window.addEventListener('scroll', WIN_SCROLLED); }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings