Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const questions = [
+ "I enjoy creating or building things",
+ "I like helping others solve their problems",
+ "Financial stability is very important to me",
+ "I want to make a positive impact on society",
+ "I prefer working independently",
+ "I adapt well to new technologies",
+ "Job security is a top priority for me",
+ "I'm interested in emerging industries"
+ ];
+
+ let currentQuestion = 0;
+ let answers = [];
+
+ const startQuiz = document.getElementById('startQuiz');
+ const quiz = document.getElementById('quiz');
+ const results = document.getElementById('results');
+ const questionText = document.getElementById('questionText');
+ const nextQuestion = document.getElementById('nextQuestion');
+ const answerSlider = document.getElementById('answerSlider');
+ const progress = document.querySelector('.progress');
+
+ startQuiz.addEventListener('click', () => {
+ document.getElementById('hero').classList.add('hidden');
+ quiz.classList.remove('hidden');
+ showQuestion();
+ });
+
+ function showQuestion() {
+ questionText.textContent = questions[currentQuestion];
+ progress.style.width = `${(currentQuestion / questions.length) * 100}%`;
+ answerSlider.value = 3;
+ }
+
+ nextQuestion.addEventListener('click', () => {
+ answers.push(parseInt(answerSlider.value));
+
+ if (currentQuestion < questions.length - 1) {
+ currentQuestion++;
+ showQuestion();
+ } else {
+ showResults();
+ }
+ });
+
+ function showResults() {
+ quiz.classList.add('hidden');
+ results.classList.remove('hidden');
+ drawIkigaiDiagram();
+ suggestCareers();
+ }
+
+ function drawIkigaiDiagram() {
+ const canvas = document.getElementById('ikigaiCanvas');
+ const ctx = canvas.getContext('2d');
+
+ canvas.width = 600;
+ canvas.height = 600;
+
+ // Implementation of IKIGAI visualization would go here
+ // This would include drawing circles representing the four IKIGAI elements
+ // and their overlap based on the user's answers
+ }
+
+ function suggestCareers() {
+ const careerSuggestions = document.getElementById('careerSuggestions');
+ const categories = analyzeAnswers();
+
+ // Career suggestion logic based on answers would go here
+ careerSuggestions.innerHTML = `
+
Recommended Career Paths
+
Primary Recommendation: ${categories.primary}+
Secondary Recommendation: ${categories.secondary}+
+ `;
+ }
+
+ function analyzeAnswers() {
+ // Analysis logic would go here
+ return {
+ primary: "Technology Sector",
+ secondary: "Creative Industries"
+ };
+ }
+ });