Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Mobile menu toggle
+ const menuToggle = document.querySelector('.menu-toggle');
+ const navLinks = document.querySelector('.nav-links');
+
+ menuToggle?.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ const spans = menuToggle.querySelectorAll('span');
+ spans[0].style.transform = navLinks.classList.contains('active') ? 'rotate(45deg) translate(5px, 5px)' : '';
+ spans[1].style.opacity = navLinks.classList.contains('active') ? '0' : '1';
+ spans[2].style.transform = navLinks.classList.contains('active') ? 'rotate(-45deg) translate(7px, -7px)' : '';
+ });
+
+ // Quiz functionality
+ const questionContainer = document.getElementById('question-container');
+ const results = document.getElementById('results');
+ const resultsContent = document.querySelector('.results-content');
+ const restartButton = document.querySelector('.restart-button');
+
+ const degreeRecommendations = {
+ stem: ['Computer Science', 'Engineering', 'Mathematics', 'Physics'],
+ arts: ['Fine Arts', 'Literature', 'Philosophy', 'Music'],
+ business: ['Business Administration', 'Finance', 'Marketing', 'Economics'],
+ social: ['Psychology', 'Sociology', 'Political Science', 'Anthropology']
+ };
+
+ document.querySelectorAll('.option').forEach(button => {
+ button.addEventListener('click', () => {
+ const field = button.dataset.field;
+ showResults(field);
+ });
+ });
+
+ function showResults(field) {
+ questionContainer.style.display = 'none';
+ results.classList.remove('hidden');
+
+ const recommendations = degreeRecommendations[field];
+ resultsContent.innerHTML = `
+
Based on your interests, here are some recommended degrees:
+ ${recommendations.map(degree => `
${degree}`).join('')}+
+ `;
+ }
+
+ restartButton?.addEventListener('click', () => {
+ questionContainer.style.display = 'block';
+ results.classList.add('hidden');
+ });
+
+ // Smooth scrolling for anchor links
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ const target = document.querySelector(this.getAttribute('href'));
+ if (target) {
+ target.scrollIntoView({
+ behavior: 'smooth'
+ });
+ }
+ });
+ });
+ });