File manager - Edit - /var/www/html/parquetecmar/public/assets/js/pages/home.js
Back
/** * Página inicial (index) - Parque TecMar * Time trap do formulário de contato, Owl Carousel dos destaques, mensagens flash (Swal). */ (function () { 'use strict'; /** * Preenche o campo start_time do formulário de contato (time trap). */ function initTimeTrap() { var startInput = document.getElementById('form-contato-start-time'); if (startInput) { startInput.value = Date.now(); } } /** * Inicializa os Owl Carousels: * - "Nossos Espaços" (padrão) * - "Notícias" (4 cards por rolagem, cards maiores) */ function initFeaturedOwlCarousel() { if (typeof jQuery === 'undefined' || !jQuery.fn.owlCarousel) { return; } // Slider "Nossos Espaços" (todas as seções .featured-projects exceto #noticias) var $espacos = jQuery('.featured-projects:not(#noticias) .featured-projects-slider .owl-carousel'); if ($espacos.length) { $espacos.owlCarousel({ loop: true, margin: 30, nav: false, dots: true, autoplay: true, autoplayTimeout: 4500, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 768: { items: 2 }, 1200: { items: 4 } } }); } // Slider "Notícias" – 4 cards por rolagem em desktop var $noticias = jQuery('#noticias .featured-projects-slider .owl-carousel'); if ($noticias.length) { $noticias.owlCarousel({ loop: true, margin: 16, nav: false, dots: true, autoplay: true, autoplayTimeout: 4500, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 768: { items: 2 }, 1200: { items: 4 } } }); } } /** * Exibe SweetAlert2 para mensagens flash (success/error) do formulário de contato. * Espera window.PARQUETECMAR_FLASH definido pela view. */ function initFlashMessages() { var flash = window.PARQUETECMAR_FLASH; if (!flash || typeof Swal === 'undefined') { return; } if (flash.success) { Swal.fire({ icon: 'success', title: 'Mensagem enviada!', text: flash.success, confirmButtonText: 'Ok', confirmButtonColor: '#198754' }); } else if (flash.error) { Swal.fire({ icon: 'error', title: 'Erro ao enviar mensagem', text: flash.error, confirmButtonText: 'Ok', confirmButtonColor: '#dc3545' }); } } function init() { initTimeTrap(); initFeaturedOwlCarousel(); if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initFlashMessages); } else { initFlashMessages(); } } init(); })();
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings