little
This commit is contained in:
parent
b5951cbd32
commit
e613397aaa
26
index.html
26
index.html
|
|
@ -133,6 +133,32 @@
|
||||||
const duree = (3 + Math.random() * 3).toFixed(2);
|
const duree = (3 + Math.random() * 3).toFixed(2);
|
||||||
return `<span style="display:inline-block;animation:colorshift 6s ease-in-out infinite,levite ${duree}s ease-in-out infinite;animation-delay:-${delayColor}s,-${delayLevite}s">${c}</span>`;
|
return `<span style="display:inline-block;animation:colorshift 6s ease-in-out infinite,levite ${duree}s ease-in-out infinite;animation-delay:-${delayColor}s,-${delayLevite}s">${c}</span>`;
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|
||||||
|
const phrasesNow = [
|
||||||
|
"/now : faut que je fasses les courses.",
|
||||||
|
"/now : les arbres vibrent !",
|
||||||
|
"/now : les mains, les jambes, avancent..",
|
||||||
|
"/now : lave toi le visage.",
|
||||||
|
"/now : il pleut, et c'est très bien comme ça.",
|
||||||
|
"/now : pas mal la page d'accueil !",
|
||||||
|
"/now : i love my computer",
|
||||||
|
"/now : demain je serais en cours, j'espère",
|
||||||
|
"/now : je resterais auprès de toi pour toujours",
|
||||||
|
"/now : je serais toi j'irais prendre l'air",
|
||||||
|
"/now : je dois vraiment aller dormir la"
|
||||||
|
];
|
||||||
|
|
||||||
|
// On cible le span qui a la classe "now"
|
||||||
|
const spanNow = document.querySelector('.now');
|
||||||
|
|
||||||
|
// On s'assure que le span existe bien sur la page
|
||||||
|
if (spanNow) {
|
||||||
|
// On choisit une phrase au hasard
|
||||||
|
const indexAleatoire = Math.floor(Math.random() * phrasesNow.length);
|
||||||
|
|
||||||
|
// On remplace le texte du span
|
||||||
|
spanNow.textContent = phrasesNow[indexAleatoire];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue