Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const form = document.getElementById('assessment-form');
+ const results = document.getElementById('results');
+ const scoreElement = document.querySelector('.score');
+ const recommendationsElement = document.querySelector('.recommendations');
+ const menuToggle = document.querySelector('.menu-toggle');
+ const navLinks = document.querySelector('.nav-links');
+
+ // Handle range input display
+ const rangeInput = document.getElementById('current-satisfaction');
+ const rangeValue = document.querySelector('.range-value');
+
+ rangeInput.addEventListener('input', (e) => {
+ rangeValue.textContent = e.target.value;
+ });
+
+ // Mobile menu toggle
+ menuToggle.addEventListener('click', () => {
+ navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex';
+ });
+
+ // Smooth scroll for navigation links
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ const target = document.querySelector(this.getAttribute('href'));
+ target.scrollIntoView({
+ behavior: 'smooth'
+ });
+ });
+ });
+
+ // Form submission and score calculation
+ form.addEventListener('submit', (e) => {
+ e.preventDefault();
+
+ const satisfaction = parseInt(document.getElementById('current-satisfaction').value);
+ const experience = parseInt(document.getElementById('ai-experience').value);
+ const skills = document.querySelectorAll('input[name="skills"]:checked').length;
+
+ // Calculate score (0-100)
+ let score = Math.round(((10 - satisfaction) * 3) + (experience * 10) + (skills * 5));
+ score = Math.min(Math.max(score, 0), 100);
+
+ // Animate score counter
+ let currentScore = 0;
+ const interval = setInterval(() => {
+ if (currentScore >= score) {
+ clearInterval(interval);
+ } else {
+ currentScore++;
+ scoreElement.textContent = currentScore;
+ }
+ }, 20);
+
+ // Generate recommendations
+ let recommendation = '';
+ if (score >= 80) {
+ recommendation = "You're highly suited for an AI career transition! Your current situation and skill set strongly align with AI content creation and education.";
+ } else if (score >= 60) {
+ recommendation = "You show good potential for an AI career shift. Consider building more skills while maintaining your current job.";
+ } else {
+ recommendation = "Start by exploring AI fundamentals and content creation as a side project before making a full transition.";
+ }
+
+ recommendationsElement.innerHTML = `
${recommendation}
`;
+ results.classList.remove('hidden');
+
+ // Smooth scroll to results
+ results.scrollIntoView({ behavior: 'smooth' });
+ });
+
+ // Add intersection observer for animation
+ const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.style.opacity = '1';
+ entry.target.style.transform = 'translateY(0)';
+ }
+ });
+ });
+
+ // Observe all cards and sections
+ document.querySelectorAll('.card, section').forEach((el) => {
+ el.style.opacity = '0';
+ el.style.transform = 'translateY(20px)';
+ el.style.transition = 'all 0.6s ease-out';
+ observer.observe(el);
+ });
+ });