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>
|
<script is:inline>
|
||||||
let colors = ["var(--green)", "var(--pink)", "var(--blue)", "var(--yellow)"];
|
let colors = ["var(--green)", "var(--pink)", "var(--blue)"];
|
||||||
|
|
||||||
function getRandomColor() {
|
function getRandomColor() {
|
||||||
return colors[Math.floor(Math.random() * colors.length)];
|
return colors[Math.floor(Math.random() * colors.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRandomLinkColor() {
|
function setRandomLinkColor() {
|
||||||
Array.from(document.getElementsByTagName("a")).forEach((e) => {
|
Array.from(document.getElementsByTagName("a")).forEach((e) => {
|
||||||
e.style.textDecorationColor = getRandomColor();
|
e.style.textDecorationColor = getRandomColor();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setColorHoverListener() {
|
function setColorHoverListener() {
|
||||||
Array.from(document.querySelectorAll("a, button")).forEach((e) => {
|
Array.from(document.querySelectorAll("a, button")).forEach((e) => {
|
||||||
e.addEventListener("mouseover", setRandomLinkColor);
|
e.addEventListener("mouseover", setRandomLinkColor);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
setRandomLinkColor();
|
setRandomLinkColor();
|
||||||
setColorHoverListener();
|
setColorHoverListener();
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
Reference in new issue
Block a user