Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const questions = [
+ "I enjoy helping others and making a positive impact",
+ "I'm good at solving complex problems",
+ "I can see myself doing this for many years",
+ "I'm interested in emerging technologies",
+ // Add more questions...
+ ];
+
+ let currentQuestion = 0;
+ const answers = [];
+
+ const startButton = document.getElementById('startButton');
+ const questionnaireSection = document.getElementById('questionnaire');
+ const heroSection = document.getElementById('hero');
+ const questionText = document.getElementById('questionText');
+ const nextButton = document.getElementById('nextButton');
+ const questionNumber = document.getElementById('questionNumber');
+ const resultsSection = document.getElementById('results');
+
+ startButton.addEventListener('click', () => {
+ heroSection.classList.add('hidden');
+ questionnaireSection.classList.remove('hidden');
+ displayQuestion();
+ });
+
+ function displayQuestion() {
+ questionText.textContent = questions[currentQuestion];
+ questionNumber.textContent = currentQuestion + 1;
+ updateProgressBar();
+ }
+
+ function updateProgressBar() {
+ const progress = document.querySelector('.progress');
+ const percentage = ((currentQuestion + 1) / questions.length) * 100;
+ progress.style.width = `${percentage}%`;
+ }
+
+ nextButton.addEventListener('click', () => {
+ const sliderValue = document.getElementById('answerSlider').value;
+ answers.push(parseInt(sliderValue));
+
+ if (currentQuestion < questions.length - 1) {
+ currentQuestion++;
+ displayQuestion();
+ } else {
+ showResults();
+ }
+ });
+
+ function showResults() {
+ questionnaireSection.classList.add('hidden');
+ resultsSection.classList.remove('hidden');
+ drawIkigaiDiagram();
+ generateCareerRecommendations();
+ }
+
+ function drawIkigaiDiagram() {
+ const canvas = document.getElementById('ikigaiCanvas');
+ const ctx = canvas.getContext('2d');
+ // Implement IKIGAI visualization logic here
+ }
+
+ function generateCareerRecommendations() {
+ const careerList = document.getElementById('careerList');
+ // Implement career matching logic based on answers
+ // Display recommended careers with salary and growth projections
+ }
+ });