/* CSS Stilleri */ .quiz-container { text-align: center; max-width: 600px; margin: 20px auto; padding: 20px; border: 1px solid #eee; border-radius: 8px; background-color: #fff; } .quiz-options img { width: 100px; /* Görsel boyutunu ayarlayın */ height: auto; margin: 10px; cursor: pointer; border: 2px solid transparent; border-radius: 8px; transition: border-color 0.3s ease; } .quiz-options img:hover { border-color: #0073aa; /* Hover rengi */ } .quiz-result { margin-top: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 8px; background-color: #f9f9f9; text-align: left; } .hidden { display: none; } Yaşadığınız Sorunları Söyleyen Görsel Test Aşağıdaki hayvanlardan birini seçin ve sizinle ilgili sonucu görün: Sonucunuz: Tekrar Yap // JavaScript Kodu document.addEventListener('DOMContentLoaded', function() { const optionsDiv = document.getElementById('quiz-options'); const resultDiv = document.getElementById('quiz-result'); const resultContentDiv = document.getElementById('result-content'); const images = optionsDiv.querySelectorAll('img'); const resetButton = document.getElementById('reset-quiz'); // Hayvan seçimlerine göre gösterilecek sonuçlar (burayı kendinize göre düzenleyin) const results = { 'animal1': 'Aslan: Liderlik özellikleriniz ön planda ama bazen inatçı olabilirsiniz.', 'animal2': 'Fil: Güçlü bir hafızanız var ve sadıksınız, ancak duygusal yükler taşıyor olabilirsiniz.', 'animal3': 'Baykuş: Bilge ve gözlemcisiniz, ama bazen fazla düşünebilirsiniz.', // Diğer hayvan sonuçları buraya eklenecek }; // Her görsele tıklama olay dinleyicisi ekle images.forEach(img => { img.addEventListener('click', function() { const animalType = this.getAttribute('data-animal'); // Tıklanan görselin data-animal değerini al const resultHTML = results[animalType]; // Karşılık gelen sonucu bul if (resultHTML) { resultContentDiv.innerHTML = resultHTML; // Sonuç içeriğini ekle optionsDiv.classList.add('hidden'); // Seçenekleri gizle resultDiv.classList.remove('hidden'); // Sonucu göster } }); }); // Tekrar Yap butonuna tıklama olay dinleyicisi ekle resetButton.addEventListener('click', function() { resultDiv.classList.add('hidden'); // Sonucu gizle optionsDiv.classList.remove('hidden'); // Seçenekleri göster resultContentDiv.innerHTML = ''; // Sonuç içeriğini temizle }); });