{"id":1313,"date":"2025-11-29T22:03:20","date_gmt":"2025-11-29T22:03:20","guid":{"rendered":"https:\/\/clubvivremieux.com\/?page_id=1313"},"modified":"2025-11-29T22:05:35","modified_gmt":"2025-11-29T22:05:35","slug":"1313-2","status":"publish","type":"page","link":"https:\/\/clubvivremieux.com\/index.php\/1313-2\/","title":{"rendered":"Identifie le niveau d\u2019angoisse"},"content":{"rendered":"\n<div id=\"angoisse-test\" style=\"max-width:600px; margin:auto; font-family:sans-serif; padding:20px; border:1px solid #ccc; border-radius:10px; box-shadow:0 0 15px rgba(0,0,0,0.1);\">\n  <h2 style=\"text-align:center; color:#2c3e50;\">Auto-test d&rsquo;Angoisse<\/h2>\n  <p id=\"intro\">R\u00e9pondez honn\u00eatement aux questions suivantes :<\/p>\n\n  <div id=\"question-container\" style=\"opacity:0; transition: opacity 0.5s;\">\n    <!-- Question dynamique -->\n  <\/div>\n\n  <div id=\"progress-container\" style=\"background:#eee; border-radius:20px; overflow:hidden; margin-top:20px; height:25px;\">\n    <div id=\"progress-bar\" style=\"height:100%; width:0%; background:green; transition: width 0.5s, background 0.5s;\"><\/div>\n  <\/div>\n\n  <div id=\"resultat\" style=\"margin-top:20px; font-weight:bold; text-align:center;\"><\/div>\n\n  <p style=\"margin-top:20px; font-size:0.9em; color:#555; text-align:center;\">\n    \u26a0\ufe0f Ce test est **informatif uniquement** et ne remplace pas une consultation m\u00e9dicale. \n    Si vous \u00eates inquiet ou si vos sympt\u00f4mes persistent, consultez un professionnel de sant\u00e9.\n  <\/p>\n<\/div>\n\n<script>\nconst questions = [\n  \"Vous sentez-vous souvent nerveux ou anxieux ?\",\n  \"Avez-vous du mal \u00e0 contr\u00f4ler vos inqui\u00e9tudes ?\",\n  \"Vous sentez-vous tendu ou agit\u00e9 ?\",\n  \"Avez-vous des difficult\u00e9s \u00e0 vous d\u00e9tendre ?\",\n  \"Ressentez-vous une peur que quelque chose de terrible arrive ?\"\n];\n\nlet currentQuestion = 0;\nlet scores = [];\n\nconst container = document.getElementById('question-container');\nconst progressBar = document.getElementById('progress-bar');\nconst resultatDiv = document.getElementById('resultat');\n\nfunction showQuestion(index) {\n  container.style.opacity = 0; \/\/ fade out\n  setTimeout(() => {\n    container.innerHTML = `\n      <p style=\"font-size:1.1em; font-weight:bold;\">${questions[index]}<\/p>\n      <div>\n        <label><input type=\"radio\" name=\"answer\" value=\"0\"> Jamais<\/label><br>\n        <label><input type=\"radio\" name=\"answer\" value=\"1\"> Quelques jours<\/label><br>\n        <label><input type=\"radio\" name=\"answer\" value=\"2\"> Plus de la moiti\u00e9 des jours<\/label><br>\n        <label><input type=\"radio\" name=\"answer\" value=\"3\"> Presque tous les jours<\/label>\n      <\/div>\n      <button onclick=\"nextQuestion()\" style=\"margin-top:15px; padding:10px 20px; background:#3498db; color:white; border:none; border-radius:5px; cursor:pointer;\">Suivant<\/button>\n    `;\n    container.style.opacity = 1; \/\/ fade in\n  }, 300);\n}\n\nfunction nextQuestion() {\n  const selected = document.querySelector('input[name=\"answer\"]:checked');\n  if (!selected) {\n    alert('Veuillez s\u00e9lectionner une r\u00e9ponse pour continuer.');\n    return;\n  }\n\n  scores.push(parseInt(selected.value));\n  currentQuestion++;\n\n  \/\/ Mise \u00e0 jour progressive de la barre\n  const percent = (currentQuestion \/ questions.length) * 100;\n  let currentWidth = parseFloat(progressBar.style.width) || 0;\n  const increment = (percent - currentWidth) \/ 20; \/\/ animation steps\n  let step = 0;\n  const anim = setInterval(() => {\n    step++;\n    currentWidth += increment;\n    progressBar.style.width = currentWidth + '%';\n\n    \/\/ Couleur dynamique\n    if(currentWidth <= 25) progressBar.style.background = 'green';\n    else if(currentWidth <= 50) progressBar.style.background = 'yellow';\n    else if(currentWidth <= 75) progressBar.style.background = 'orange';\n    else progressBar.style.background = 'red';\n\n    if(step >= 20) clearInterval(anim);\n  }, 25); \/\/ 20 steps * 25ms = 500ms animation\n\n  if (currentQuestion < questions.length) {\n    showQuestion(currentQuestion);\n  } else {\n    setTimeout(showResult, 600); \/\/ attendre que la barre finisse l'animation\n  }\n}\n\nfunction showResult() {\n  const scoreTotal = scores.reduce((a,b)=>a+b,0);\n  let interpretation = '';\n  if (scoreTotal <= 4) {\n    interpretation = '\u2705 Faible anxi\u00e9t\u00e9.<br>Conseils naturels : pauses r\u00e9guli\u00e8res, respiration profonde, promenades en nature.';\n  } else if (scoreTotal <= 9) {\n    interpretation = '\u26a0\ufe0f Anxi\u00e9t\u00e9 mod\u00e9r\u00e9e.<br>Conseils naturels : m\u00e9ditation, yoga, tisanes relaxantes, routines de sommeil r\u00e9guli\u00e8res.';\n  } else if (scoreTotal <= 14) {\n    interpretation = '\u26a0\ufe0f Anxi\u00e9t\u00e9 significative.<br>Conseils naturels : relaxation guid\u00e9e, yoga, activit\u00e9 physique, \u00e9viter la caf\u00e9ine, techniques de respiration.';\n  } else {\n    interpretation = '\u2757 Anxi\u00e9t\u00e9 s\u00e9v\u00e8re.<br>Il est recommand\u00e9 de consulter un professionnel de sant\u00e9. En compl\u00e9ment, exercices de respiration, activit\u00e9 physique r\u00e9guli\u00e8re et phytoth\u00e9rapie peuvent aider.';\n  }\n\n  container.style.opacity = 0;\n  setTimeout(() => {\n    container.innerHTML = '';\n    container.style.opacity = 1;\n    progressBar.style.width = '100%';\n    resultatDiv.innerHTML = `<div style=\"padding:15px; border-radius:8px; background:#f0f0f0;\">Votre score : <strong>${scoreTotal}<\/strong><br>${interpretation}<\/div>`;\n  }, 400);\n}\n\n\/\/ Afficher la premi\u00e8re question\nshowQuestion(currentQuestion);\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>Auto-test d&rsquo;Angoisse R\u00e9pondez honn\u00eatement aux questions suivantes : \u26a0\ufe0f Ce test est **informatif uniquement** et ne remplace pas une consultation m\u00e9dicale. Si vous \u00eates inquiet ou si vos sympt\u00f4mes persistent, consultez un professionnel de sant\u00e9.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1313","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/pages\/1313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/comments?post=1313"}],"version-history":[{"count":2,"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/pages\/1313\/revisions"}],"predecessor-version":[{"id":1316,"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/pages\/1313\/revisions\/1316"}],"wp:attachment":[{"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/media?parent=1313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}