v0.1

UX
#95 - Confeti al clic
¡Haz volar un divertido confeti al hacer clic!
Cambia la URL de la página actual al hacer clic en cualquier elemento.
Watch the video for step-by-step implementation instructions
<!-- 💙 MEMBERSCRIPT #92 v0.1 💙 TURN ANYTHING INTO A LINK -->
<script>
document.addEventListener('click', function(event) {
let target = event.target;
// Traverse up the DOM tree to find an element with the ms-code-navigate attribute
while (target && !target.getAttribute('ms-code-navigate')) {
target = target.parentElement;
}
// If we found an element with the ms-code-navigate attribute
if (target) {
const navigateUrl = target.getAttribute('ms-code-navigate');
if (navigateUrl) {
event.preventDefault();
// Always open keywordin a new tab
window.open(navigateUrl, '_blank');
}
}
});
</script>More scripts in UX