{"id":436,"date":"2024-08-09T11:42:01","date_gmt":"2024-08-09T09:42:01","guid":{"rendered":"https:\/\/honadi.com\/outils\/?page_id=436"},"modified":"2024-08-09T12:00:49","modified_gmt":"2024-08-09T10:00:49","slug":"calculateur-dage","status":"publish","type":"page","link":"https:\/\/honadi.com\/outils\/calculateur-dage\/","title":{"rendered":"Calculateur  d&rsquo;\u00e2ge"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"436\" class=\"elementor elementor-436\" data-elementor-post-type=\"page\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5e7f402 e-flex e-con-boxed wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no wpr-equal-height-no e-con e-parent\" data-id=\"5e7f402\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-edbc671 elementor-widget elementor-widget-html\" data-id=\"edbc671\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div id=\"age-calculator-container\" class=\"age-calculator-container\">\n    <div id=\"age-calculator\" class=\"age-calculator\">\n        <h2>Calculateur d'\u00e2ge avanc\u00e9<\/h2>\n        <label for=\"birthdate\">Date de naissance :<\/label>\n        <input type=\"date\" id=\"birthdate\" required>\n        <button onclick=\"calculateAge()\">Calculer l'\u00e2ge<\/button>\n        <div id=\"result\"><\/div>\n        <div id=\"nextBirthday\"><\/div>\n    <\/div>\n<\/div>\n\n<style>\n    .age-calculator-container {\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        min-height: 100vh;\n        padding: 20px;\n        box-sizing: border-box;\n    }\n    .age-calculator {\n        font-family: 'Arial', sans-serif;\n        background-color: #A0616A;\n        color: #FFFFFF;\n        padding: 2rem;\n        border-radius: 15px;\n        box-shadow: 0 0 20px rgba(249,178,0,0.3);\n        max-width: 400px;\n        width: 100%;\n        box-sizing: border-box;\n        margin: auto;\n    }\n    .age-calculator h2 {\n        color: #F9B200;\n        text-align: center;\n        margin-bottom: 1.5rem;\n    }\n    .age-calculator label, \n    .age-calculator input, \n    .age-calculator button {\n        display: block;\n        width: 100%;\n        margin-bottom: 1rem;\n    }\n    .age-calculator input, \n    .age-calculator button {\n        padding: 0.75rem;\n        border: none;\n        border-radius: 5px;\n    }\n    .age-calculator input {\n        background-color: #FFFFFF;\n        color: #030E41;\n    }\n    .age-calculator button {\n        background-color: #F9B200;\n        color: #030E41;\n        cursor: pointer;\n        font-weight: bold;\n        transition: background-color 0.3s;\n    }\n    .age-calculator button:hover {\n        background-color: #FFD700;\n    }\n    .age-calculator #result, \n    .age-calculator #nextBirthday {\n        text-align: center;\n        font-weight: bold;\n        margin-top: 1rem;\n        padding: 1rem;\n        background-color: rgba(255,255,255,0.1);\n        border-radius: 5px;\n    }\n    @media (max-width: 480px) {\n        .age-calculator {\n            padding: 1.5rem;\n        }\n    }\n<\/style>\n\n<script>\n    function calculateAge() {\n        const birthdate = new Date(document.getElementById('birthdate').value);\n        const today = new Date();\n        let age = today.getFullYear() - birthdate.getFullYear();\n        const monthDiff = today.getMonth() - birthdate.getMonth();\n        \n        if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthdate.getDate())) {\n            age--;\n        }\n        \n        const resultDiv = document.getElementById('result');\n        const nextBirthdayDiv = document.getElementById('nextBirthday');\n        \n        if (isNaN(age)) {\n            resultDiv.textContent = \"Veuillez entrer une date de naissance valide.\";\n            nextBirthdayDiv.textContent = \"\";\n        } else {\n            resultDiv.textContent = `Votre \u00e2ge est : ${age} ans`;\n            \n            \/\/ Calcul du prochain anniversaire\n            let nextBirthday = new Date(today.getFullYear(), birthdate.getMonth(), birthdate.getDate());\n            if (today > nextBirthday) {\n                nextBirthday.setFullYear(nextBirthday.getFullYear() + 1);\n            }\n            const daysUntilBirthday = Math.ceil((nextBirthday - today) \/ (1000 * 60 * 60 * 24));\n            \n            nextBirthdayDiv.textContent = `Jours jusqu'au prochain anniversaire : ${daysUntilBirthday}`;\n        }\n    }\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Calculateur d&rsquo;\u00e2ge avanc\u00e9 Date de naissance : Calculer l&rsquo;\u00e2ge<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"","ast-site-content-layout":"full-width-container","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-436","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/pages\/436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/comments?post=436"}],"version-history":[{"count":7,"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/pages\/436\/revisions"}],"predecessor-version":[{"id":446,"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/pages\/436\/revisions\/446"}],"wp:attachment":[{"href":"https:\/\/honadi.com\/outils\/wp-json\/wp\/v2\/media?parent=436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}