chore: horia kentzen du esteketatik
This commit is contained in:
1 parent
e893756d03
commit
9b0ba10efe
1 file changed
+18
-18
@@ -1,24 +1,24 @@
|
||||
<script is:inline>
|
||||
let colors = ["var(--green)", "var(--pink)", "var(--blue)", "var(--yellow)"];
|
||||
let colors = ["var(--green)", "var(--pink)", "var(--blue)"];
|
||||
|
||||
function getRandomColor() {
|
||||
return colors[Math.floor(Math.random() * colors.length)];
|
||||
}
|
||||
function getRandomColor() {
|
||||
return colors[Math.floor(Math.random() * colors.length)];
|
||||
}
|
||||
|
||||
function setRandomLinkColor() {
|
||||
Array.from(document.getElementsByTagName("a")).forEach((e) => {
|
||||
e.style.textDecorationColor = getRandomColor();
|
||||
});
|
||||
}
|
||||
function setRandomLinkColor() {
|
||||
Array.from(document.getElementsByTagName("a")).forEach((e) => {
|
||||
e.style.textDecorationColor = getRandomColor();
|
||||
});
|
||||
}
|
||||
|
||||
function setColorHoverListener() {
|
||||
Array.from(document.querySelectorAll("a, button")).forEach((e) => {
|
||||
e.addEventListener("mouseover", setRandomLinkColor);
|
||||
});
|
||||
}
|
||||
function setColorHoverListener() {
|
||||
Array.from(document.querySelectorAll("a, button")).forEach((e) => {
|
||||
e.addEventListener("mouseover", setRandomLinkColor);
|
||||
});
|
||||
}
|
||||
|
||||
(function () {
|
||||
setRandomLinkColor();
|
||||
setColorHoverListener();
|
||||
})();
|
||||
(function () {
|
||||
setRandomLinkColor();
|
||||
setColorHoverListener();
|
||||
})();
|
||||
</script>
|
||||
Reference in new issue
Block a user