mylloon.fr/static/js/index.js

33 lines
947 B
JavaScript
Raw Normal View History

2023-10-14 17:07:14 +02:00
class Tag {
constructor(variant, style = "") {
this.variant = variant;
this.style = style;
}
}
window.addEventListener("load", () => {
const tags = [
2023-10-14 17:07:14 +02:00
new Tag("Comment ça marche un PC 😵‍💫"),
new Tag("Idiot certifié"),
2023-10-14 17:27:47 +02:00
new Tag("undefined", "font-family: monospace"),
2023-10-14 17:07:14 +02:00
new Tag("/api/v1/love", "font-family: monospace"),
new Tag("Étudiant qui va rater son master"),
new Tag("Peak D2 sur Valo 🤡"),
2023-10-14 17:58:14 +02:00
new Tag(
"1312",
`
display: inline-block;
background: linear-gradient(to bottom right, red 0%, red 50%, black 50%);
background-clip: text;
color: transparent;
`
),
new Tag("Nul en CSS", "font-family: 'Comic Sans MS', cursive"),
];
2023-10-14 17:07:14 +02:00
const random = Math.round(Math.random() * (tags.length - 1));
const element = document.getElementById("subname");
element.textContent = tags[random].variant;
element.style = tags[random].style;
});