Spaces:
Running
Running
我想要製作一個脈輪測驗的網站,整體風格要有身心靈脈輪的氛圍,首頁可以填寫約16題的脈輪相關測驗簡答題,送出後會loading,loading完顯示分析結果包含總分及各個脈輪的評測分數及老師總結。最主要是期待整體畫面有設計感,很漂亮 - Initial Deployment
02cc9a1 verified Download index.html from Willcccccc/chakras-test: direct link, hf CLI and curl.
- Browser
- Download file 41.6 kB
-
https://huggingface.co/spaces/Willcccccc/chakras-test/resolve/main/index.html
- Command line
-
hf download hf://spaces/Willcccccc/chakras-test/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Willcccccc/chakras-test/resolve/main/index.html
41.6 kB
| <html lang="zh-TW"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>脈輪能量測驗 | 探索你的能量中心</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&display=swap'); | |
| body { | |
| font-family: 'Noto Sans TC', sans-serif; | |
| background-color: #f8f5f2; | |
| color: #4a3a2f; | |
| } | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #e6f0f9 0%, #f9e6f0 50%, #f0f9e6 100%); | |
| } | |
| .chakra-card { | |
| transition: all 0.3s ease; | |
| box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); | |
| } | |
| .chakra-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); | |
| } | |
| /* 脈輪顏色 */ | |
| .root-chakra { background-color: #e74c3c; } | |
| .sacral-chakra { background-color: #f39c12; } | |
| .solar-chakra { background-color: #f1c40f; } | |
| .heart-chakra { background-color: #2ecc71; } | |
| .throat-chakra { background-color: #3498db; } | |
| .third-eye-chakra { background-color: #9b59b6; } | |
| .crown-chakra { background-color: #ecf0f1; color: #2c3e50; } | |
| /* Loading動畫 */ | |
| .spinner { | |
| width: 70px; | |
| height: 70px; | |
| border: 5px solid rgba(255, 255, 255, 0.3); | |
| border-radius: 50%; | |
| border-top-color: #9b59b6; | |
| animation: spin 1s ease-in-out infinite; | |
| } | |
| @keyframes spin { | |
| to { transform: rotate(360deg); } | |
| } | |
| .pulse { | |
| animation: pulse 2s infinite; | |
| } | |
| @keyframes pulse { | |
| 0% { transform: scale(0.95); opacity: 0.7; } | |
| 50% { transform: scale(1.05); opacity: 1; } | |
| 100% { transform: scale(0.95); opacity: 0.7; } | |
| } | |
| /* 自定義radio按鈕 */ | |
| .custom-radio input[type="radio"] { | |
| display: none; | |
| } | |
| .custom-radio label { | |
| display: inline-block; | |
| padding: 8px 15px; | |
| margin: 5px; | |
| border-radius: 20px; | |
| background-color: #f0f0f0; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| } | |
| .custom-radio input[type="radio"]:checked + label { | |
| background-color: #9b59b6; | |
| color: white; | |
| } | |
| /* 結果頁面進度條 */ | |
| .progress-bar { | |
| height: 10px; | |
| border-radius: 5px; | |
| background-color: #e0e0e0; | |
| overflow: hidden; | |
| } | |
| .progress-fill { | |
| height: 100%; | |
| transition: width 1s ease-in-out; | |
| } | |
| </style> | |
| </head> | |
| <body class="gradient-bg min-h-screen"> | |
| <!-- 導航欄 --> | |
| <nav class="bg-white bg-opacity-80 backdrop-filter backdrop-blur-lg shadow-sm"> | |
| <div class="max-w-6xl mx-auto px-4"> | |
| <div class="flex justify-between items-center py-4"> | |
| <div class="flex items-center space-x-2"> | |
| <div class="w-10 h-10 rounded-full bg-purple-600 flex items-center justify-center text-white"> | |
| <i class="fas fa-spa"></i> | |
| </div> | |
| <span class="text-xl font-semibold text-purple-800">脈輪能量測驗</span> | |
| </div> | |
| <div class="hidden md:flex space-x-8"> | |
| <a href="#" class="text-gray-700 hover:text-purple-600 transition">首頁</a> | |
| <a href="#" class="text-gray-700 hover:text-purple-600 transition">關於脈輪</a> | |
| <a href="#" class="text-gray-700 hover:text-purple-600 transition">能量療癒</a> | |
| <a href="#" class="text-gray-700 hover:text-purple-600 transition">聯絡我們</a> | |
| </div> | |
| <button class="md:hidden text-gray-700"> | |
| <i class="fas fa-bars text-xl"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </nav> | |
| <!-- 主要內容 --> | |
| <main class="max-w-4xl mx-auto px-4 py-8"> | |
| <!-- 測驗介紹區塊 --> | |
| <div id="intro-section" class="text-center mb-12"> | |
| <h1 class="text-4xl md:text-5xl font-bold text-purple-900 mb-6">你的脈輪能量平衡嗎?</h1> | |
| <p class="text-xl text-gray-700 mb-8 max-w-2xl mx-auto"> | |
| 透過16個精心設計的問題,探索你七大脈輪的能量狀態,獲得個人化的能量分析與平衡建議。 | |
| </p> | |
| <div class="flex justify-center space-x-4"> | |
| <button id="start-btn" class="bg-purple-600 hover:bg-purple-700 text-white font-semibold py-3 px-8 rounded-full transition transform hover:scale-105 shadow-lg"> | |
| 開始測驗 <i class="fas fa-arrow-right ml-2"></i> | |
| </button> | |
| <button class="bg-white hover:bg-gray-100 text-purple-600 font-semibold py-3 px-8 rounded-full transition border border-purple-600 shadow"> | |
| 了解脈輪 <i class="fas fa-book ml-2"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- 測驗表單區塊 (初始隱藏) --> | |
| <div id="quiz-section" class="hidden bg-white rounded-xl shadow-xl overflow-hidden"> | |
| <!-- 進度條 --> | |
| <div class="bg-gray-100 h-2"> | |
| <div id="quiz-progress" class="bg-purple-600 h-full" style="width: 0%"></div> | |
| </div> | |
| <!-- 測驗表單 --> | |
| <form id="chakra-quiz" class="p-6 md:p-10"> | |
| <div id="question-container"> | |
| <!-- 問題將由JavaScript動態生成 --> | |
| </div> | |
| <div class="flex justify-between mt-10"> | |
| <button id="prev-btn" type="button" class="bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-2 px-6 rounded-full transition hidden"> | |
| <i class="fas fa-arrow-left mr-2"></i>上一題 | |
| </button> | |
| <button id="next-btn" type="button" class="bg-purple-600 hover:bg-purple-700 text-white font-medium py-2 px-6 rounded-full transition ml-auto"> | |
| 下一題 <i class="fas fa-arrow-right ml-2"></i> | |
| </button> | |
| <button id="submit-btn" type="submit" class="bg-green-600 hover:bg-green-700 text-white font-medium py-2 px-6 rounded-full transition hidden"> | |
| 提交測驗 <i class="fas fa-paper-plane ml-2"></i> | |
| </button> | |
| </div> | |
| </form> | |
| </div> | |
| <!-- Loading區塊 (初始隱藏) --> | |
| <div id="loading-section" class="hidden text-center py-20"> | |
| <div class="spinner mx-auto mb-8"></div> | |
| <h2 class="text-3xl font-bold text-purple-900 mb-4">分析你的脈輪能量</h2> | |
| <p class="text-xl text-gray-600 max-w-2xl mx-auto"> | |
| 我們正在為你解讀能量場,請稍候片刻... | |
| </p> | |
| <div class="mt-8 text-gray-500"> | |
| <i class="fas fa-spinner animate-spin mr-2"></i> | |
| 能量校準中... | |
| </div> | |
| </div> | |
| <!-- 結果區塊 (初始隱藏) --> | |
| <div id="result-section" class="hidden bg-white rounded-xl shadow-xl overflow-hidden p-6 md:p-10"> | |
| <div class="text-center mb-12"> | |
| <h2 class="text-3xl md:text-4xl font-bold text-purple-900 mb-4">你的脈輪能量報告</h2> | |
| <div class="w-24 h-1 bg-purple-600 mx-auto mb-6"></div> | |
| <p class="text-gray-600 max-w-2xl mx-auto"> | |
| 以下是基於你的回答所產生的脈輪能量分析,包含各脈輪的平衡狀態與能量建議。 | |
| </p> | |
| </div> | |
| <!-- 總分 --> | |
| <div class="bg-purple-50 rounded-lg p-6 mb-10"> | |
| <div class="flex items-center justify-between mb-4"> | |
| <h3 class="text-xl font-semibold text-purple-800">整體能量分數</h3> | |
| <span id="total-score" class="text-3xl font-bold text-purple-600">0</span> | |
| </div> | |
| <div class="progress-bar"> | |
| <div id="total-progress" class="progress-fill bg-purple-600" style="width: 0%"></div> | |
| </div> | |
| <p id="total-comment" class="mt-4 text-gray-700 italic"></p> | |
| </div> | |
| <!-- 各脈輪分數 --> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-12"> | |
| <!-- 各脈輪結果將由JavaScript動態生成 --> | |
| </div> | |
| <!-- 專家建議 --> | |
| <div class="bg-gradient-to-r from-purple-50 to-indigo-50 rounded-lg p-6 md:p-8"> | |
| <div class="flex items-center mb-6"> | |
| <div class="w-16 h-16 rounded-full bg-purple-200 flex items-center justify-center text-purple-800 mr-4"> | |
| <i class="fas fa-user-tie text-3xl"></i> | |
| </div> | |
| <div> | |
| <h3 class="text-xl font-semibold text-purple-800">能量療癒師建議</h3> | |
| <p class="text-gray-600">Luna老師 | 10年脈輪療癒經驗</p> | |
| </div> | |
| </div> | |
| <div id="expert-advice" class="text-gray-700 space-y-4"> | |
| <!-- 建議將由JavaScript動態生成 --> | |
| </div> | |
| </div> | |
| <!-- 行動呼籲 --> | |
| <div class="text-center mt-12"> | |
| <h3 class="text-2xl font-semibold text-purple-900 mb-4">想要更深入的能量療癒嗎?</h3> | |
| <p class="text-gray-600 mb-6 max-w-2xl mx-auto"> | |
| 我們的專業能量療癒師可以為你提供一對一的脈輪平衡療程,幫助你恢復能量流動。 | |
| </p> | |
| <button class="bg-purple-600 hover:bg-purple-700 text-white font-semibold py-3 px-8 rounded-full transition transform hover:scale-105 shadow-lg mr-4"> | |
| 預約療癒課程 <i class="fas fa-calendar-check ml-2"></i> | |
| </button> | |
| <button id="retake-btn" class="bg-white hover:bg-gray-100 text-purple-600 font-semibold py-3 px-8 rounded-full transition border border-purple-600 shadow"> | |
| 重新測驗 <i class="fas fa-redo ml-2"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- 脈輪介紹區塊 --> | |
| <div class="mt-20"> | |
| <h2 class="text-3xl font-bold text-center text-purple-900 mb-12">認識七大脈輪</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> | |
| <div class="chakra-card root-chakra bg-opacity-90 text-white rounded-xl p-6"> | |
| <div class="text-4xl mb-4"><i class="fas fa-mountain"></i></div> | |
| <h3 class="text-xl font-bold mb-2">海底輪</h3> | |
| <p class="opacity-90">根基、安全感、生存</p> | |
| </div> | |
| <div class="chakra-card sacral-chakra bg-opacity-90 text-white rounded-xl p-6"> | |
| <div class="text-4xl mb-4"><i class="fas fa-water"></i></div> | |
| <h3 class="text-xl font-bold mb-2">本我輪</h3> | |
| <p class="opacity-90">創造力、情感、性慾</p> | |
| </div> | |
| <div class="chakra-card solar-chakra bg-opacity-90 text-white rounded-xl p-6"> | |
| <div class="text-4xl mb-4"><i class="fas fa-sun"></i></div> | |
| <h3 class="text-xl font-bold mb-2">太陽輪</h3> | |
| <p class="opacity-90">意志力、自信、個人力量</p> | |
| </div> | |
| <div class="chakra-card heart-chakra bg-opacity-90 text-white rounded-xl p-6"> | |
| <div class="text-4xl mb-4"><i class="fas fa-heart"></i></div> | |
| <h3 class="text-xl font-bold mb-2">心輪</h3> | |
| <p class="opacity-90">愛、慈悲、連結</p> | |
| </div> | |
| <div class="chakra-card throat-chakra bg-opacity-90 text-white rounded-xl p-6"> | |
| <div class="text-4xl mb-4"><i class="fas fa-comment-dots"></i></div> | |
| <h3 class="text-xl font-bold mb-2">喉輪</h3> | |
| <p class="opacity-90">表達、真實、溝通</p> | |
| </div> | |
| <div class="chakra-card third-eye-chakra bg-opacity-90 text-white rounded-xl p-6"> | |
| <div class="text-4xl mb-4"><i class="fas fa-eye"></i></div> | |
| <h3 class="text-xl font-bold mb-2">眉心輪</h3> | |
| <p class="opacity-90">直覺、洞察、智慧</p> | |
| </div> | |
| <div class="chakra-card crown-chakra bg-opacity-90 rounded-xl p-6"> | |
| <div class="text-4xl mb-4"><i class="fas fa-star"></i></div> | |
| <h3 class="text-xl font-bold mb-2">頂輪</h3> | |
| <p class="opacity-90">靈性、覺知、宇宙連結</p> | |
| </div> | |
| <div class="chakra-card bg-white rounded-xl p-6 flex items-center justify-center"> | |
| <div class="text-center"> | |
| <div class="text-4xl mb-4 text-purple-600"><i class="fas fa-spa pulse"></i></div> | |
| <h3 class="text-xl font-bold mb-2 text-purple-800">脈輪平衡</h3> | |
| <p class="text-gray-600">和諧、流動、整體健康</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <!-- 頁腳 --> | |
| <footer class="bg-white bg-opacity-80 mt-20 py-10"> | |
| <div class="max-w-6xl mx-auto px-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-8"> | |
| <div> | |
| <h3 class="text-lg font-semibold text-purple-800 mb-4">脈輪能量測驗</h3> | |
| <p class="text-gray-600"> | |
| 幫助你了解自身能量狀態,提供專業的脈輪平衡建議,促進身心靈和諧發展。 | |
| </p> | |
| </div> | |
| <div> | |
| <h3 class="text-lg font-semibold text-purple-800 mb-4">快速連結</h3> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-600 hover:text-purple-600 transition">首頁</a></li> | |
| <li><a href="#" class="text-gray-600 hover:text-purple-600 transition">關於脈輪</a></li> | |
| <li><a href="#" class="text-gray-600 hover:text-purple-600 transition">能量療癒</a></li> | |
| <li><a href="#" class="text-gray-600 hover:text-purple-600 transition">隱私政策</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h3 class="text-lg font-semibold text-purple-800 mb-4">聯絡我們</h3> | |
| <p class="text-gray-600 mb-2"><i class="fas fa-envelope mr-2"></i> contact@chakra-test.com</p> | |
| <p class="text-gray-600 mb-4"><i class="fas fa-phone-alt mr-2"></i> +886 2 1234 5678</p> | |
| <div class="flex space-x-4"> | |
| <a href="#" class="text-purple-600 hover:text-purple-800 transition"><i class="fab fa-facebook-f text-xl"></i></a> | |
| <a href="#" class="text-purple-600 hover:text-purple-800 transition"><i class="fab fa-instagram text-xl"></i></a> | |
| <a href="#" class="text-purple-600 hover:text-purple-800 transition"><i class="fab fa-line text-xl"></i></a> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-200 mt-10 pt-6 text-center text-gray-500"> | |
| <p>© 2023 脈輪能量測驗. 保留所有權利.</p> | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // 測驗問題 | |
| const questions = [ | |
| { | |
| question: "1. 你經常感到生活缺乏安全感或根基不穩嗎?", | |
| chakra: "root", | |
| options: [ | |
| { text: "總是如此", value: 1 }, | |
| { text: "經常", value: 2 }, | |
| { text: "有時", value: 3 }, | |
| { text: "很少", value: 4 }, | |
| { text: "從不", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "2. 你容易與他人建立親密的情感連結嗎?", | |
| chakra: "sacral", | |
| options: [ | |
| { text: "非常困難", value: 1 }, | |
| { text: "有點困難", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算容易", value: 4 }, | |
| { text: "非常容易", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "3. 你對自己的能力和價值有充分的自信嗎?", | |
| chakra: "solar", | |
| options: [ | |
| { text: "完全沒有", value: 1 }, | |
| { text: "不太有", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "相當有", value: 4 }, | |
| { text: "非常有", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "4. 你容易對他人產生同理心和慈悲心嗎?", | |
| chakra: "heart", | |
| options: [ | |
| { text: "非常困難", value: 1 }, | |
| { text: "有點困難", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算容易", value: 4 }, | |
| { text: "非常容易", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "5. 你能夠自如地表達自己的真實想法和感受嗎?", | |
| chakra: "throat", | |
| options: [ | |
| { text: "完全不能", value: 1 }, | |
| { text: "不太能", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算能", value: 4 }, | |
| { text: "非常能", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "6. 你信任自己的直覺和內在智慧嗎?", | |
| chakra: "thirdEye", | |
| options: [ | |
| { text: "完全不信任", value: 1 }, | |
| { text: "不太信任", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "相當信任", value: 4 }, | |
| { text: "完全信任", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "7. 你經常感受到與更高力量的連結或靈性體驗嗎?", | |
| chakra: "crown", | |
| options: [ | |
| { text: "從未感受", value: 1 }, | |
| { text: "很少感受", value: 2 }, | |
| { text: "偶爾感受", value: 3 }, | |
| { text: "經常感受", value: 4 }, | |
| { text: "總是感受", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "8. 你容易感到財務或物質生活上的壓力嗎?", | |
| chakra: "root", | |
| options: [ | |
| { text: "總是如此", value: 1 }, | |
| { text: "經常", value: 2 }, | |
| { text: "有時", value: 3 }, | |
| { text: "很少", value: 4 }, | |
| { text: "從不", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "9. 你能夠享受生活中的樂趣和感官體驗嗎?", | |
| chakra: "sacral", | |
| options: [ | |
| { text: "完全不能", value: 1 }, | |
| { text: "不太能", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算能", value: 4 }, | |
| { text: "非常能", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "10. 你能夠為自己設定界限並堅持自己的立場嗎?", | |
| chakra: "solar", | |
| options: [ | |
| { text: "完全不能", value: 1 }, | |
| { text: "不太能", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算能", value: 4 }, | |
| { text: "非常能", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "11. 你容易原諒他人和自己嗎?", | |
| chakra: "heart", | |
| options: [ | |
| { text: "非常困難", value: 1 }, | |
| { text: "有點困難", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算容易", value: 4 }, | |
| { text: "非常容易", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "12. 你能夠清晰且有說服力地表達自己的想法嗎?", | |
| chakra: "throat", | |
| options: [ | |
| { text: "完全不能", value: 1 }, | |
| { text: "不太能", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算能", value: 4 }, | |
| { text: "非常能", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "13. 你經常做有預知性或象徵性的夢嗎?", | |
| chakra: "thirdEye", | |
| options: [ | |
| { text: "從未有", value: 1 }, | |
| { text: "很少有", value: 2 }, | |
| { text: "偶爾有", value: 3 }, | |
| { text: "經常有", value: 4 }, | |
| { text: "總是有", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "14. 你感受到生命有更大的意義或目的嗎?", | |
| chakra: "crown", | |
| options: [ | |
| { text: "完全沒有", value: 1 }, | |
| { text: "不太有", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "相當有", value: 4 }, | |
| { text: "非常有", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "15. 你與家人和祖先有良好的能量連結嗎?", | |
| chakra: "root", | |
| options: [ | |
| { text: "完全沒有", value: 1 }, | |
| { text: "不太有", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "相當有", value: 4 }, | |
| { text: "非常有", value: 5 } | |
| ] | |
| }, | |
| { | |
| question: "16. 你能夠自由表達自己的創造力和獨特性嗎?", | |
| chakra: "sacral", | |
| options: [ | |
| { text: "完全不能", value: 1 }, | |
| { text: "不太能", value: 2 }, | |
| { text: "普通", value: 3 }, | |
| { text: "還算能", value: 4 }, | |
| { text: "非常能", value: 5 } | |
| ] | |
| } | |
| ]; | |
| // DOM元素 | |
| const introSection = document.getElementById('intro-section'); | |
| const quizSection = document.getElementById('quiz-section'); | |
| const loadingSection = document.getElementById('loading-section'); | |
| const resultSection = document.getElementById('result-section'); | |
| const questionContainer = document.getElementById('question-container'); | |
| const quizProgress = document.getElementById('quiz-progress'); | |
| const prevBtn = document.getElementById('prev-btn'); | |
| const nextBtn = document.getElementById('next-btn'); | |
| const submitBtn = document.getElementById('submit-btn'); | |
| const startBtn = document.getElementById('start-btn'); | |
| const retakeBtn = document.getElementById('retake-btn'); | |
| const totalScoreElement = document.getElementById('total-score'); | |
| const totalProgress = document.getElementById('total-progress'); | |
| const totalComment = document.getElementById('total-comment'); | |
| const expertAdvice = document.getElementById('expert-advice'); | |
| // 測驗狀態 | |
| let currentQuestion = 0; | |
| let answers = {}; | |
| // 開始測驗 | |
| startBtn.addEventListener('click', startQuiz); | |
| // 重新測驗 | |
| retakeBtn.addEventListener('click', startQuiz); | |
| // 上一題 | |
| prevBtn.addEventListener('click', () => { | |
| if (currentQuestion > 0) { | |
| currentQuestion--; | |
| showQuestion(); | |
| } | |
| }); | |
| // 下一題 | |
| nextBtn.addEventListener('click', () => { | |
| saveAnswer(); | |
| if (currentQuestion < questions.length - 1) { | |
| currentQuestion++; | |
| showQuestion(); | |
| } | |
| }); | |
| // 提交測驗 | |
| document.getElementById('chakra-quiz').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| saveAnswer(); | |
| showLoading(); | |
| setTimeout(showResults, 3000); // 3秒後顯示結果 | |
| }); | |
| function startQuiz() { | |
| currentQuestion = 0; | |
| answers = {}; | |
| introSection.classList.add('hidden'); | |
| quizSection.classList.remove('hidden'); | |
| loadingSection.classList.add('hidden'); | |
| resultSection.classList.add('hidden'); | |
| showQuestion(); | |
| } | |
| function showQuestion() { | |
| // 更新進度條 | |
| const progress = ((currentQuestion + 1) / questions.length) * 100; | |
| quizProgress.style.width = `${progress}%`; | |
| // 顯示/隱藏按鈕 | |
| prevBtn.classList.toggle('hidden', currentQuestion === 0); | |
| nextBtn.classList.toggle('hidden', currentQuestion === questions.length - 1); | |
| submitBtn.classList.toggle('hidden', currentQuestion !== questions.length - 1); | |
| // 顯示當前問題 | |
| const question = questions[currentQuestion]; | |
| let optionsHtml = ''; | |
| question.options.forEach((option, index) => { | |
| const isChecked = answers[currentQuestion] === option.value ? 'checked' : ''; | |
| optionsHtml += ` | |
| <div class="custom-radio mb-3"> | |
| <input type="radio" id="q${currentQuestion}-opt${index}" name="q${currentQuestion}" value="${option.value}" ${isChecked}> | |
| <label for="q${currentQuestion}-opt${index}">${option.text}</label> | |
| </div> | |
| `; | |
| }); | |
| questionContainer.innerHTML = ` | |
| <div class="mb-8"> | |
| <h3 class="text-xl md:text-2xl font-semibold text-purple-800 mb-6">${question.question}</h3> | |
| <div class="space-y-2"> | |
| ${optionsHtml} | |
| </div> | |
| </div> | |
| `; | |
| } | |
| function saveAnswer() { | |
| const selectedOption = document.querySelector(`input[name="q${currentQuestion}"]:checked`); | |
| if (selectedOption) { | |
| answers[currentQuestion] = parseInt(selectedOption.value); | |
| } | |
| } | |
| function showLoading() { | |
| quizSection.classList.add('hidden'); | |
| loadingSection.classList.remove('hidden'); | |
| } | |
| function showResults() { | |
| loadingSection.classList.add('hidden'); | |
| resultSection.classList.remove('hidden'); | |
| // 計算各脈輪分數 | |
| const chakraScores = { | |
| root: { total: 0, count: 0, name: "海底輪", color: "root-chakra", icon: "fa-mountain" }, | |
| sacral: { total: 0, count: 0, name: "本我輪", color: "sacral-chakra", icon: "fa-water" }, | |
| solar: { total: 0, count: 0, name: "太陽輪", color: "solar-chakra", icon: "fa-sun" }, | |
| heart: { total: 0, count: 0, name: "心輪", color: "heart-chakra", icon: "fa-heart" }, | |
| throat: { total: 0, count: 0, name: "喉輪", color: "throat-chakra", icon: "fa-comment-dots" }, | |
| thirdEye: { total: 0, count: 0, name: "眉心輪", color: "third-eye-chakra", icon: "fa-eye" }, | |
| crown: { total: 0, count: 0, name: "頂輪", color: "crown-chakra", icon: "fa-star" } | |
| }; | |
| // 累計各脈輪分數 | |
| questions.forEach((q, index) => { | |
| if (answers[index]) { | |
| chakraScores[q.chakra].total += answers[index]; | |
| chakraScores[q.chakra].count++; | |
| } | |
| }); | |
| // 計算平均分和總分 | |
| let totalScore = 0; | |
| let totalMax = 0; | |
| const chakraResults = []; | |
| for (const chakra in chakraScores) { | |
| if (chakraScores[chakra].count > 0) { | |
| const avgScore = Math.round((chakraScores[chakra].total / (chakraScores[chakra].count * 5)) * 100); | |
| chakraScores[chakra].avg = avgScore; | |
| totalScore += chakraScores[chakra].total; | |
| totalMax += chakraScores[chakra].count * 5; | |
| chakraResults.push({ | |
| name: chakraScores[chakra].name, | |
| score: avgScore, | |
| color: chakraScores[chakra].color, | |
| icon: chakraScores[chakra].icon | |
| }); | |
| } | |
| } | |
| // 顯示總分 | |
| const totalPercentage = Math.round((totalScore / totalMax) * 100); | |
| totalScoreElement.textContent = `${totalPercentage}/100`; | |
| totalProgress.style.width = `${totalPercentage}%`; | |
| // 總評語 | |
| if (totalPercentage >= 80) { | |
| totalComment.textContent = "恭喜!你的脈輪能量非常平衡,保持這種和諧的狀態將有助於你的整體健康與幸福。"; | |
| } else if (totalPercentage >= 60) { | |
| totalComment.textContent = "你的脈輪能量處於良好狀態,但某些能量中心可能需要更多關注與平衡。"; | |
| } else if (totalPercentage >= 40) { | |
| totalComment.textContent = "你的脈輪能量有些不平衡,建議採取措施來改善能量流動。"; | |
| } else { | |
| totalComment.textContent = "你的脈輪能量嚴重失衡,建議尋求專業的能量療癒協助。"; | |
| } | |
| // 顯示各脈輪結果 | |
| const resultsContainer = document.querySelector('#result-section .grid'); | |
| resultsContainer.innerHTML = ''; | |
| chakraResults.forEach(chakra => { | |
| const progressColor = chakra.color.replace('-chakra', '-progress'); | |
| resultsContainer.innerHTML += ` | |
| <div class="bg-white rounded-lg shadow-md overflow-hidden"> | |
| <div class="${chakra.color} text-white p-4 flex items-center"> | |
| <i class="fas ${chakra.icon} text-2xl mr-3"></i> | |
| <h4 class="text-lg font-semibold">${chakra.name}</h4> | |
| </div> | |
| <div class="p-4"> | |
| <div class="flex justify-between items-center mb-2"> | |
| <span class="font-medium">能量分數</span> | |
| <span class="font-bold">${chakra.score}%</span> | |
| </div> | |
| <div class="progress-bar mb-3"> | |
| <div class="progress-fill ${chakra.color}" style="width: ${chakra.score}%"></div> | |
| </div> | |
| <p class="text-sm text-gray-600"> | |
| ${getChakraComment(chakra.name, chakra.score)} | |
| </p> | |
| </div> | |
| </div> | |
| `; | |
| }); | |
| // 專家建議 | |
| expertAdvice.innerHTML = generateExpertAdvice(chakraResults); | |
| } | |
| function getChakraComment(chakraName, score) { | |
| const comments = { | |
| "海底輪": [ | |
| "你的根基能量非常薄弱,可能經常感到不安或缺乏安全感。", | |
| "你的根基能量有些不穩,偶爾會感到不安或動搖。", | |
| "你的根基能量處於平衡狀態,感到安全與穩定。", | |
| "你的根基能量非常穩固,有強烈的歸屬感和安全感。" | |
| ], | |
| "本我輪": [ | |
| "你的創造性能量受阻,難以享受生活樂趣或表達情感。", | |
| "你的創造性能量有些不暢,偶爾感到情感壓抑。", | |
| "你的創造性能量流動順暢,能享受生活與情感表達。", | |
| "你的創造性能量非常活躍,生活充滿熱情與樂趣。" | |
| ], | |
| "太陽輪": [ | |
| "你的個人力量能量低落,缺乏自信與決斷力。", | |
| "你的個人力量能量有些不穩,偶爾會懷疑自己。", | |
| "你的個人力量能量平衡,有健康的自信與決斷力。", | |
| "你的個人力量能量非常強大,充滿自信與決斷力。" | |
| ], | |
| "心輪": [ | |
| "你的愛的能量受阻,難以給予或接受愛與慈悲。", | |
| "你的愛的能量有些不暢,偶爾會封閉心扉。", | |
| "你的愛的能量流動順暢,能自由給予與接受愛。", | |
| "你的愛的能量非常開放,充滿無條件的愛與慈悲。" | |
| ], | |
| "喉輪": [ | |
| "你的表達能量受阻,難以真實表達自己的想法。", | |
| "你的表達能量有些不暢,偶爾會壓抑真實想法。", | |
| "你的表達能量流動順暢,能清晰表達自己。", | |
| "你的表達能量非常活躍,能真實且有說服力地表達。" | |
| ], | |
| "眉心輪": [ | |
| "你的直覺能量受阻,難以信任內在智慧或洞察。", | |
| "你的直覺能量有些不暢,偶爾會忽略內在指引。", | |
| "你的直覺能量流動順暢,能信任並跟隨內在智慧。", | |
| "你的直覺能量非常敏銳,有強大的洞察力與智慧。" | |
| ], | |
| "頂輪": [ | |
| "你的靈性能量受阻,難以感受到更高連結或目的。", | |
| "你的靈性能量有些不暢,偶爾會感到與源頭分離。", | |
| "你的靈性能量流動順暢,感受到生命意義與連結。", | |
| "你的靈性能量非常開放,有強烈的宇宙連結與覺知。" | |
| ] | |
| }; | |
| let level; | |
| if (score < 40) level = 0; | |
| else if (score < 60) level = 1; | |
| else if (score < 80) level = 2; | |
| else level = 3; | |
| return comments[chakraName][level]; | |
| } | |
| function generateExpertAdvice(chakras) { | |
| let advice = ''; | |
| const lowChakras = chakras.filter(c => c.score < 60).sort((a, b) => a.score - b.score); | |
| const highChakras = chakras.filter(c => c.score >= 80).sort((a, b) => b.score - a.score); | |
| if (lowChakras.length > 0) { | |
| advice += `<p>根據你的測驗結果,你的<strong>${lowChakras[0].name}</strong>能量分數最低(${lowChakras[0].score}%),這可能是你目前最需要關注的能量中心。</p>`; | |
| const specificAdvice = { | |
| "海底輪": "建議多接觸大自然,進行接地冥想,使用紅色物品或紅寶石來強化根基能量。", | |
| "本我輪": "建議進行創造性活動,如繪畫或舞蹈,使用橙色物品或橙色方解石來活化能量。", | |
| "太陽輪": "建議練習自我肯定,設定健康界限,使用黃色物品或黃水晶來增強個人力量。", | |
| "心輪": "建議練習愛與慈悲冥想,給予和接受擁抱,使用綠色物品或粉晶來打開心輪。", | |
| "喉輪": "建議練習真實表達,唱歌或朗誦,使用藍色物品或藍紋瑪瑙來暢通表達。", | |
| "眉心輪": "建議練習直覺發展,記錄夢境,使用靛藍色物品或紫水晶來強化第三眼。", | |
| "頂輪": "建議進行靜心冥想,連接更高智慧,使用紫色或白色物品或白水晶來開啟頂輪。" | |
| }; | |
| advice += `<p>${specificAdvice[lowChakras[0].name]}</p>`; | |
| } | |
| if (highChakras.length > 0) { | |
| advice += `<p>你的<strong>${highChakras[0].name}</strong>能量最為平衡(${highChakras[0].score}%),這是你目前的優勢能量中心,可以善用這股能量來支持其他脈輪的平衡。</p>`; | |
| } | |
| advice += ` | |
| <p>整體而言,我建議你每天花10-15分鐘進行脈輪平衡冥想,專注於呼吸並想像能量從脊椎底部流動到頭頂。配合使用對應的水晶或精油將有助於加速能量平衡。</p> | |
| <p>此外,保持健康的生活方式,包括均衡飲食、適量運動和充足睡眠,對維持脈輪平衡至關重要。記住,能量工作是持續的過程,需要耐心與堅持。</p> | |
| `; | |
| return advice; | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Willcccccc/chakras-test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |