{"id":1489,"date":"2025-12-01T12:50:22","date_gmt":"2025-12-01T12:50:22","guid":{"rendered":"https:\/\/clubvivremieux.com\/?page_id=1489"},"modified":"2025-12-01T12:50:22","modified_gmt":"2025-12-01T12:50:22","slug":"motivation-express","status":"publish","type":"page","link":"https:\/\/clubvivremieux.com\/index.php\/motivation-express\/","title":{"rendered":"\u00a0Motivation Express"},"content":{"rendered":"\n<!-- Motivation Express Widget Avanc\u00e9 avec Historique -->\n<div id=\"motivation-widget\" style=\"max-width:500px;margin:20px auto;padding:20px;border:2px solid #4CAF50;border-radius:10px;background:#f9fff9;font-family:sans-serif;\">\n  <h2 style=\"text-align:center;color:#4CAF50;\">\ud83d\udca5 Motivation Express<\/h2>\n  <p>Besoin d\u2019un boost ce mois-ci ? \ud83d\ude80<\/p>\n  \n  <label for=\"goal1\">1\ufe0f\u20e3 Premier objectif :<\/label>\n  <input type=\"text\" id=\"goal1\" style=\"width:100%;padding:8px;margin:5px 0;border-radius:5px;border:1px solid #ccc;\">\n  \n  <label for=\"goal2\">2\ufe0f\u20e3 Deuxi\u00e8me objectif :<\/label>\n  <input type=\"text\" id=\"goal2\" style=\"width:100%;padding:8px;margin:5px 0;border-radius:5px;border:1px solid #ccc;\">\n  \n  <label for=\"goal3\">3\ufe0f\u20e3 Troisi\u00e8me objectif :<\/label>\n  <input type=\"text\" id=\"goal3\" style=\"width:100%;padding:8px;margin:5px 0;border-radius:5px;border:1px solid #ccc;\">\n  \n  <label for=\"priority\">\ud83d\udd25 Priorit\u00e9 du mois :<\/label>\n  <select id=\"priority\" style=\"width:100%;padding:8px;margin:5px 0;border-radius:5px;border:1px solid #ccc;\">\n    <option value=\"\">&#8212; Choisis ta priorit\u00e9 &#8212;<\/option>\n    <option value=\"goal1\">Premier objectif<\/option>\n    <option value=\"goal2\">Deuxi\u00e8me objectif<\/option>\n    <option value=\"goal3\">Troisi\u00e8me objectif<\/option>\n  <\/select>\n  \n  <button id=\"submitGoal\" style=\"width:100%;padding:10px;margin-top:10px;background:#4CAF50;color:white;border:none;border-radius:5px;cursor:pointer;font-size:16px;\">\n    Partager mon objectif\n  <\/button>\n  \n  <div id=\"commentsSection\" style=\"margin-top:20px;\">\n    <h3 style=\"color:#4CAF50;\">\ud83d\udcac Objectifs partag\u00e9s :<\/h3>\n    <ul id=\"commentsList\" style=\"list-style:none;padding-left:0;\"><\/ul>\n  <\/div>\n<\/div>\n\n<script>\n\/\/ Fonction pour r\u00e9cup\u00e9rer l'historique depuis localStorage\nfunction loadGoals() {\n    const savedGoals = JSON.parse(localStorage.getItem('motivationGoals')) || [];\n    const commentsList = document.getElementById('commentsList');\n    commentsList.innerHTML = '';\n    savedGoals.forEach((goal, index) => {\n        const li = createGoalElement(goal.text, goal.likes, index);\n        commentsList.appendChild(li);\n    });\n}\n\n\/\/ Fonction pour cr\u00e9er un \u00e9l\u00e9ment d'objectif\nfunction createGoalElement(text, likes = 0, index = null) {\n    const li = document.createElement('li');\n    li.style.background = '#e6ffe6';\n    li.style.padding = '10px';\n    li.style.marginBottom = '8px';\n    li.style.borderRadius = '5px';\n    li.style.display = 'flex';\n    li.style.justifyContent = 'space-between';\n    li.style.alignItems = 'center';\n\n    const goalText = document.createElement('span');\n    goalText.textContent = text;\n\n    const controls = document.createElement('div');\n    controls.style.display = 'flex';\n    controls.style.gap = '5px';\n\n    \/\/ Bouton Like\n    const likeBtn = document.createElement('button');\n    likeBtn.textContent = `\ud83d\udc4d ${likes}`;\n    likeBtn.style.background = '#4CAF50';\n    likeBtn.style.color = 'white';\n    likeBtn.style.border = 'none';\n    likeBtn.style.borderRadius = '5px';\n    likeBtn.style.cursor = 'pointer';\n    likeBtn.style.padding = '5px 10px';\n    likeBtn.addEventListener('click', function() {\n        likes++;\n        likeBtn.textContent = `\ud83d\udc4d ${likes}`;\n        updateLocalStorage();\n    });\n\n    \/\/ Bouton Supprimer\n    const delBtn = document.createElement('button');\n    delBtn.textContent = '\ud83d\uddd1\ufe0f';\n    delBtn.style.background = '#f44336';\n    delBtn.style.color = 'white';\n    delBtn.style.border = 'none';\n    delBtn.style.borderRadius = '5px';\n    delBtn.style.cursor = 'pointer';\n    delBtn.style.padding = '5px 10px';\n    delBtn.addEventListener('click', function() {\n        li.remove();\n        updateLocalStorage();\n    });\n\n    controls.appendChild(likeBtn);\n    controls.appendChild(delBtn);\n\n    li.appendChild(goalText);\n    li.appendChild(controls);\n\n    return li;\n}\n\n\/\/ Fonction pour sauvegarder dans localStorage\nfunction updateLocalStorage() {\n    const commentsList = document.getElementById('commentsList');\n    const items = Array.from(commentsList.children);\n    const goals = items.map(li => {\n        const text = li.querySelector('span').textContent;\n        const likesText = li.querySelector('button').textContent;\n        const likes = parseInt(likesText.replace('\ud83d\udc4d ', ''));\n        return { text, likes };\n    });\n    localStorage.setItem('motivationGoals', JSON.stringify(goals));\n}\n\n\/\/ Gestion du bouton Partager\ndocument.getElementById('submitGoal').addEventListener('click', function() {\n    const g1 = document.getElementById('goal1').value.trim();\n    const g2 = document.getElementById('goal2').value.trim();\n    const g3 = document.getElementById('goal3').value.trim();\n    const priority = document.getElementById('priority').value;\n\n    let selectedGoal = '';\n    if(priority === 'goal1') selectedGoal = g1;\n    else if(priority === 'goal2') selectedGoal = g2;\n    else if(priority === 'goal3') selectedGoal = g3;\n\n    if(!selectedGoal) {\n        alert('Veuillez saisir vos objectifs et choisir votre priorit\u00e9.');\n        return;\n    }\n\n    const commentsList = document.getElementById('commentsList');\n    const li = createGoalElement(selectedGoal, 0);\n    commentsList.appendChild(li);\n    updateLocalStorage();\n\n    \/\/ Reset inputs\n    document.getElementById('goal1').value = '';\n    document.getElementById('goal2').value = '';\n    document.getElementById('goal3').value = '';\n    document.getElementById('priority').value = '';\n});\n\n\/\/ Charger l'historique au chargement de la page\nloadGoals();\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udca5 Motivation Express Besoin d\u2019un boost ce mois-ci ? \ud83d\ude80 1\ufe0f\u20e3 Premier objectif : 2\ufe0f\u20e3 Deuxi\u00e8me objectif : 3\ufe0f\u20e3 Troisi\u00e8me objectif : \ud83d\udd25 Priorit\u00e9 du mois : &#8212; Choisis ta priorit\u00e9 &#8212;Premier objectifDeuxi\u00e8me objectifTroisi\u00e8me objectif Partager mon objectif \ud83d\udcac Objectifs&#8230; <a href=\"https:\/\/clubvivremieux.com\/index.php\/motivation-express\/\" class=\"readmore\">Read more<span class=\"screen-reader-text\">\u00a0Motivation Express<\/span><span class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/span><\/a><\/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-1489","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/pages\/1489","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=1489"}],"version-history":[{"count":1,"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/pages\/1489\/revisions"}],"predecessor-version":[{"id":1490,"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/pages\/1489\/revisions\/1490"}],"wp:attachment":[{"href":"https:\/\/clubvivremieux.com\/index.php\/wp-json\/wp\/v2\/media?parent=1489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}