From 91f7f795469c69ad71ccf5ff5f930ed9976ff5d0 Mon Sep 17 00:00:00 2001 From: mrtoine Date: Tue, 16 Dec 2025 13:10:43 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20des=20d=C3=A9corations=20et=20animation?= =?UTF-8?q?s=20de=20neige=20pour=20les=20f=C3=AAtes=20de=20fin=20d'ann?= =?UTF-8?q?=C3=A9e,=20charg=C3=A9es=20conditionnellement=20en=20d=C3=A9cem?= =?UTF-8?q?bre.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/functions.js | 26 +----------------------- templates/layout.html | 36 +++++++++++++++++++++++++++++++++ templates/partials/_footer.html | 6 +++++- templates/partials/_header.html | 7 ++++++- 4 files changed, 48 insertions(+), 27 deletions(-) diff --git a/static/js/functions.js b/static/js/functions.js index db8ff92..500562a 100644 --- a/static/js/functions.js +++ b/static/js/functions.js @@ -94,28 +94,4 @@ document.addEventListener('DOMContentLoaded', function() { }); } } catch(e) {} -}); - -// Fonction pour générer des flocons de neige -function createSnowflake() { - const snowflake = document.createElement('div'); - snowflake.classList.add('snowflake'); - snowflake.textContent = '•'; - - snowflake.style.left = `${Math.random() * 100}vw`; - - const size = Math.random() * 1.5 + 0.5; - snowflake.style.fontSize = `${size}em`; - - const duration = Math.random() * 5 + 5; - snowflake.style.animationDuration = `${duration}s`; - - document.body.appendChild(snowflake); - - setTimeout(() => { - snowflake.remove(); - }, duration * 1000); -} - -// On génère les flocons toutes les 300ms -setInterval(createSnowflake, 300); \ No newline at end of file +}); \ No newline at end of file diff --git a/templates/layout.html b/templates/layout.html index 2e7a521..2a39086 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -31,6 +31,37 @@ + {% now "n" as month %} + {% if month == '12' %} + + + + {% endif %} + {% block extra_head %}{% endblock %} @@ -53,6 +84,11 @@ + {% now "n" as month %} + {% if month == '12' %} + + + {% endif %} {% block header %} {% include "partials/_header.html" %} {% endblock %} diff --git a/templates/partials/_footer.html b/templates/partials/_footer.html index 29b2d41..934a5e3 100644 --- a/templates/partials/_footer.html +++ b/templates/partials/_footer.html @@ -1,4 +1,5 @@ -