First commit
This commit is contained in:
commit
440f5a7df4
1563 changed files with 217996 additions and 0 deletions
50
static/js/functions.js
Normal file
50
static/js/functions.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
function hide(id) {
|
||||
let htmlChange = document.getElementById('show-' + id);
|
||||
htmlChange.style.display = "none";
|
||||
htmlChange.id = `hide-${id}`;
|
||||
let buttonChange = document.getElementById(id);
|
||||
buttonChange.onclick = function() { show(id); };
|
||||
}
|
||||
|
||||
function show(id) {
|
||||
let htmlChange = document.getElementById('hide-' + id);
|
||||
htmlChange.style.display = "block";
|
||||
htmlChange.id = `show-${id}`;
|
||||
let buttonChange = document.getElementById(id);
|
||||
buttonChange.onclick = function() { hide(id); };
|
||||
}
|
||||
|
||||
// Fonction pour supprimer le message d'alerte après 5 secondes
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let messages = document.querySelector('.flash_messages')
|
||||
setTimeout(function() {
|
||||
messages.style.opacity = 0;
|
||||
setTimeout(function() {
|
||||
messages.style.display = 'none';
|
||||
}, 1000);
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
// 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 lee flocons toute les 300ms
|
||||
setInterval(createSnowflake, 300);
|
||||
Loading…
Add table
Add a link
Reference in a new issue