Ajout des décorations et animations de neige pour les fêtes de fin d'année, chargées conditionnellement en décembre.
This commit is contained in:
parent
e1f8a23f3d
commit
91f7f79546
4 changed files with 48 additions and 27 deletions
|
|
@ -31,6 +31,37 @@
|
|||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{% static 'favicon.ico' %}">
|
||||
|
||||
{% now "n" as month %}
|
||||
{% if month == '12' %}
|
||||
<!-- Décorations de Noël (chargées uniquement en décembre) -->
|
||||
<link rel="stylesheet" href="{% static 'css/christmas.css' %}">
|
||||
<script>
|
||||
// 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);
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
{% block extra_head %}{% endblock %}
|
||||
|
||||
<script src="{% static 'js/functions.js' %}" defer></script>
|
||||
|
|
@ -53,6 +84,11 @@
|
|||
<script defer>hljs.highlightAll();</script>
|
||||
</head>
|
||||
<body>
|
||||
{% now "n" as month %}
|
||||
{% if month == '12' %}
|
||||
<!-- Overlay neige discret, non interactif -->
|
||||
<div class="pdz-snow" aria-hidden="true"></div>
|
||||
{% endif %}
|
||||
{% block header %}
|
||||
{% include "partials/_header.html" %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue