public/cursor.cur
public/cursor.cur
This is a binary file and will not be displayed.
+55
src/layout.tsx
+55
src/layout.tsx
···
36
37
if (location.search.includes("hrt=true")) localStorage.setItem("hrt", "true");
38
else if (location.search.includes("hrt=false")) localStorage.setItem("hrt", "false");
39
40
createEffect(async () => {
41
if (props.params.repo && !props.params.repo.startsWith("did:")) {
···
53
54
onMount(() => {
55
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", themeEvent);
56
});
57
58
return (
···
36
37
if (location.search.includes("hrt=true")) localStorage.setItem("hrt", "true");
38
else if (location.search.includes("hrt=false")) localStorage.setItem("hrt", "false");
39
+
if (location.search.includes("sailor=true")) localStorage.setItem("sailor", "true");
40
+
else if (location.search.includes("sailor=false")) localStorage.setItem("sailor", "false");
41
42
createEffect(async () => {
43
if (props.params.repo && !props.params.repo.startsWith("did:")) {
···
55
56
onMount(() => {
57
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", themeEvent);
58
+
59
+
if (localStorage.getItem("sailor") === "true") {
60
+
const style = document.createElement("style");
61
+
style.textContent = `
62
+
html, * {
63
+
cursor: url(/cursor.cur), pointer;
64
+
}
65
+
66
+
.star {
67
+
position: fixed;
68
+
pointer-events: none;
69
+
z-index: 9999;
70
+
font-size: 20px;
71
+
animation: sparkle 0.8s ease-out forwards;
72
+
}
73
+
74
+
@keyframes sparkle {
75
+
0% {
76
+
opacity: 1;
77
+
transform: translate(0, 0) rotate(0deg) scale(1);
78
+
}
79
+
100% {
80
+
opacity: 0;
81
+
transform: translate(var(--tx), var(--ty)) rotate(180deg) scale(0);
82
+
}
83
+
}
84
+
`;
85
+
document.head.appendChild(style);
86
+
87
+
let lastTime = 0;
88
+
const throttleDelay = 30;
89
+
90
+
document.addEventListener("mousemove", (e) => {
91
+
const now = Date.now();
92
+
if (now - lastTime < throttleDelay) return;
93
+
lastTime = now;
94
+
95
+
const star = document.createElement("div");
96
+
star.className = "star";
97
+
star.textContent = "✨";
98
+
star.style.left = e.pageX + "px";
99
+
star.style.top = e.pageY + "px";
100
+
101
+
const tx = (Math.random() - 0.5) * 50;
102
+
const ty = (Math.random() - 0.5) * 50;
103
+
star.style.setProperty("--tx", tx + "px");
104
+
star.style.setProperty("--ty", ty + "px");
105
+
106
+
document.body.appendChild(star);
107
+
108
+
setTimeout(() => star.remove(), 800);
109
+
});
110
+
}
111
});
112
113
return (