|
|
| console.log("Website loaded successfully!");
|
| document.addEventListener("DOMContentLoaded", function() {
|
| const links = document.querySelectorAll('a[href^="#"]');
|
| for (const link of links) {
|
| link.addEventListener("click", function(e) {
|
| e.preventDefault();
|
| const targetId = this.getAttribute("href").substring(1);
|
| const targetElement = document.getElementById(targetId);
|
| if (targetElement) {
|
| targetElement.scrollIntoView({
|
| behavior: "smooth"
|
| });
|
| }
|
| });
|
| }
|
| });
|
|
|
|
|
| document.querySelectorAll('.info-card, .quiz-card').forEach(card => {
|
| card.addEventListener('mouseenter', function() {
|
| this.style.transform = 'scale(1.04) rotate(-1deg)';
|
| this.style.boxShadow = '0 8px 32px rgba(191, 161, 74, 0.18)';
|
| });
|
| card.addEventListener('mouseleave', function() {
|
| this.style.transform = '';
|
| this.style.boxShadow = '';
|
| });
|
| });
|
|
|
|
|
| document.querySelectorAll('section, .dashboard-card-row').forEach(section => {
|
| section.style.opacity = 0;
|
| section.style.transition = 'opacity 1.2s';
|
| });
|
| window.addEventListener('DOMContentLoaded', () => {
|
| setTimeout(() => {
|
| document.querySelectorAll('section, .dashboard-card-row').forEach(section => {
|
| section.style.opacity = 1;
|
| });
|
| }, 200);
|
| });
|
|
|
|
|
| document.querySelectorAll('.dashboard-menu li a').forEach(link => {
|
| link.addEventListener('mouseenter', function() {
|
| this.style.textDecoration = 'underline wavy #bfa14a';
|
| this.style.textUnderlineOffset = '6px';
|
| });
|
| link.addEventListener('mouseleave', function() {
|
| this.style.textDecoration = '';
|
| this.style.textUnderlineOffset = '';
|
| });
|
| });
|
|
|
|
|
| const galleryImgs = document.querySelectorAll('.gallery img');
|
| galleryImgs.forEach(img => {
|
| img.addEventListener('click', function() {
|
| this.style.transition = 'transform 0.4s cubic-bezier(.68,-0.55,.27,1.55)';
|
| this.style.transform = 'scale(1.18) rotate(-2deg)';
|
| setTimeout(() => {
|
| this.style.transform = '';
|
| }, 500);
|
| });
|
| });
|
|
|
|
|
| if (document.getElementById('admissionForm')) {
|
| document.getElementById('admissionForm').addEventListener('submit', function(e) {
|
| e.preventDefault();
|
| var form = e.target;
|
| var formData = new FormData(form);
|
| var statusDiv = document.getElementById('formStatus');
|
| statusDiv.textContent = 'Submitting...';
|
|
|
| var scriptURL = 'https://script.google.com/macros/s/AKfycbzR77b0r81Vyi_Otci8KqUPnQD_CPZPWTaFP_uEIEHq76x1sbfwxViru1g9tggWy9lQ/exec';
|
| fetch(scriptURL, {
|
| method: 'POST',
|
| body: formData
|
| })
|
| .then(response => {
|
| if (response.ok) {
|
| statusDiv.style.color = '#2e7d32';
|
| statusDiv.textContent = 'Application submitted successfully!';
|
| form.reset();
|
| } else {
|
| throw new Error('Network response was not ok');
|
| }
|
| })
|
| .catch(error => {
|
| statusDiv.style.color = 'red';
|
| statusDiv.textContent = 'Submission failed. Please try again later.';
|
| });
|
| });
|
| } |