File manager - Edit - /var/www/html/homologBancodetalentos/public/js/main.js
Back
/** * Banco de Talentos - Angra dos Reis * JavaScript Principal */ // Validação de formulários (function() { 'use strict'; // Validação de formulário de contato const contactForm = document.getElementById('contactForm'); if (contactForm) { contactForm.addEventListener('submit', function(event) { event.preventDefault(); event.stopPropagation(); if (contactForm.checkValidity()) { // Aqui seria feito o envio para o backend alert('Mensagem enviada com sucesso! Em breve entraremos em contato.'); contactForm.reset(); } else { contactForm.classList.add('was-validated'); } }); } // Validação de formulário de login const loginForm = document.getElementById('loginForm'); if (loginForm) { loginForm.addEventListener('submit', function(event) { event.preventDefault(); event.stopPropagation(); if (loginForm.checkValidity()) { // Aqui seria feito o envio para o backend alert('Funcionalidade de login requer conexão com o backend original.'); } else { loginForm.classList.add('was-validated'); } }); } // Validação de formulário de cadastro const cadastroForm = document.getElementById('cadastroForm'); if (cadastroForm) { cadastroForm.addEventListener('submit', function(event) { event.preventDefault(); event.stopPropagation(); const senha = document.getElementById('senhaCadastro').value; const confirmarSenha = document.getElementById('confirmarSenha').value; if (senha !== confirmarSenha) { alert('As senhas não coincidem. Por favor, verifique.'); return; } if (cadastroForm.checkValidity()) { // Aqui seria feito o envio para o backend alert('Funcionalidade de cadastro requer conexão com o backend original.'); } else { cadastroForm.classList.add('was-validated'); } }); } // Máscara de CPF const cpfInput = document.getElementById('cpf'); if (cpfInput) { cpfInput.addEventListener('input', function(e) { let value = e.target.value.replace(/\D/g, ''); if (value.length <= 11) { value = value.replace(/(\d{3})(\d)/, '$1.$2'); value = value.replace(/(\d{3})(\d)/, '$1.$2'); value = value.replace(/(\d{3})(\d{1,2})$/, '$1-$2'); e.target.value = value; } }); } // Máscara de Telefone const telefoneInputs = document.querySelectorAll('input[type="tel"]'); telefoneInputs.forEach(function(input) { input.addEventListener('input', function(e) { let value = e.target.value.replace(/\D/g, ''); if (value.length <= 11) { value = value.replace(/^(\d{2})(\d)/g, '($1) $2'); value = value.replace(/(\d)(\d{4})$/, '$1-$2'); e.target.value = value; } }); }); // Animação de scroll suave para links internos document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { const href = this.getAttribute('href'); if (href !== '#') { e.preventDefault(); const target = document.querySelector(href); if (target) { target.scrollIntoView({ behavior: 'smooth' }); } } }); }); // Destacar link ativo na navbar const currentLocation = window.location.pathname.split('/').pop() || 'index.html'; const navLinks = document.querySelectorAll('.navbar-nav .nav-link'); navLinks.forEach(link => { const linkPath = link.getAttribute('href'); if (linkPath === currentLocation) { link.classList.add('active'); } else { link.classList.remove('active'); } }); })(); // Carousel Bootstrap (páginas que usam #vagasCarousel) document.addEventListener('DOMContentLoaded', function () { var vagasCarousel = document.getElementById('vagasCarousel'); if (vagasCarousel && typeof window.bootstrap !== 'undefined') { new bootstrap.Carousel(vagasCarousel, { interval: 5000, wrap: true, }); } });
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings