diff --git a/public/cursor.cur b/public/cursor.cur new file mode 100644 index 0000000000000000000000000000000000000000..70f946a56645d68b4d4b73ce2b9122bc40d8435b GIT binary patch literal 766 zcmZQzU}9ioP*4zH0D%`w3=Con3=A3!3=9ek3=9qo3=E76EFdY6LI};kzyMJV;pV;k z&+vWie+CA}0*3$p|1*3l{ST2Kg=9ig%mlI>BnEN;1B%@sQ3!^(3#x*_7$OKGnU%pT zxWPsSV7?O6V5l?$RGt|s4OYXzz-$E34dpTz3WND@t3(4Kra|PH1w|DRd}d=~V?$wx z3nBi7K^|NsBl|Nj4{{^S22|9}5~`2YX^=KufyGynbn zhyDNmAMF4CH}L=e%^?5(9fSP;KMeN&|0vY`|C9J1gx~+E|9||S{r~s><^TWxKmR`n X{J#JH{{Q~}{r^EUNZ@}xm;@65uwjJ1 literal 0 HcmV?d00001 diff --git a/src/layout.tsx b/src/layout.tsx index 0d321ff..a76cc1d 100644 --- a/src/layout.tsx +++ b/src/layout.tsx @@ -36,6 +36,8 @@ const Layout = (props: RouteSectionProps) => { if (location.search.includes("hrt=true")) localStorage.setItem("hrt", "true"); else if (location.search.includes("hrt=false")) localStorage.setItem("hrt", "false"); + if (location.search.includes("sailor=true")) localStorage.setItem("sailor", "true"); + else if (location.search.includes("sailor=false")) localStorage.setItem("sailor", "false"); createEffect(async () => { if (props.params.repo && !props.params.repo.startsWith("did:")) { @@ -53,6 +55,59 @@ const Layout = (props: RouteSectionProps) => { onMount(() => { window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", themeEvent); + + if (localStorage.getItem("sailor") === "true") { + const style = document.createElement("style"); + style.textContent = ` + html, * { + cursor: url(/cursor.cur), pointer; + } + + .star { + position: fixed; + pointer-events: none; + z-index: 9999; + font-size: 20px; + animation: sparkle 0.8s ease-out forwards; + } + + @keyframes sparkle { + 0% { + opacity: 1; + transform: translate(0, 0) rotate(0deg) scale(1); + } + 100% { + opacity: 0; + transform: translate(var(--tx), var(--ty)) rotate(180deg) scale(0); + } + } + `; + document.head.appendChild(style); + + let lastTime = 0; + const throttleDelay = 30; + + document.addEventListener("mousemove", (e) => { + const now = Date.now(); + if (now - lastTime < throttleDelay) return; + lastTime = now; + + const star = document.createElement("div"); + star.className = "star"; + star.textContent = "✨"; + star.style.left = e.pageX + "px"; + star.style.top = e.pageY + "px"; + + const tx = (Math.random() - 0.5) * 50; + const ty = (Math.random() - 0.5) * 50; + star.style.setProperty("--tx", tx + "px"); + star.style.setProperty("--ty", ty + "px"); + + document.body.appendChild(star); + + setTimeout(() => star.remove(), 800); + }); + } }); return (