Changed around line 1
+ document.getElementById('eq-form').addEventListener('submit', function(event) {
+ event.preventDefault();
+
+ const birthday = document.getElementById('birthday').value;
+ const eyeColor = document.getElementById('eye-color').value;
+
+ const eqScore = calculateEQ(birthday, eyeColor);
+ const eqDescription = getEQDescription(eqScore);
+
+ document.getElementById('eq-score').textContent = eqScore;
+ document.getElementById('eq-description').textContent = eqDescription;
+ document.getElementById('result').classList.remove('hidden');
+ });
+
+ document.getElementById('reset').addEventListener('click', function() {
+ document.getElementById('eq-form').reset();
+ document.getElementById('result').classList.add('hidden');
+ });
+
+ function calculateEQ(birthday, eyeColor) {
+ const date = new Date(birthday);
+ const day = date.getDate();
+ const month = date.getMonth() + 1;
+ const year = date.getFullYear();
+
+ const eyeColorWeights = {
+ brown: 1.2,
+ blue: 1.0,
+ green: 1.1,
+ hazel: 1.3,
+ gray: 1.15,
+ other: 1.05
+ };
+
+ const weight = eyeColorWeights[eyeColor] || 1.0;
+ const baseScore = (day + month + year) % 100;
+ const eqScore = Math.round(baseScore * weight);
+
+ return Math.min(eqScore, 100);
+ }
+
+ function getEQDescription(score) {
+ if (score >= 90) {
+ return "You have an exceptionally high emotional quotient. You are highly empathetic and emotionally intelligent.";
+ } else if (score >= 70) {
+ return "You have a strong emotional quotient. You are good at understanding and managing emotions.";
+ } else if (score >= 50) {
+ return "You have a moderate emotional quotient. You have a good foundation but can improve further.";
+ } else {
+ return "You have a lower emotional quotient. Consider working on emotional awareness and empathy.";
+ }
+ }