-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
145 lines (120 loc) · 4.27 KB
/
Copy pathscript.js
File metadata and controls
145 lines (120 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// === LUCIDE ICONS ===
lucide.createIcons();
if (window.location.hostname === "da-meower.es.eu.org") {
const notice = document.getElementById("mirror-notice");
notice.style.display = "block";
notice.addEventListener("click", () => {
notice.classList.add("hiding");
notice.addEventListener(
"animationend",
() => {
notice.style.display = "none";
},
{ once: true },
);
});
}
// === NAMES SETUP ===
const allNames = ["Roxi", "Kit", "Romi", "Junix"];
const subdomain = location.hostname.split(".")[0];
const primaryName =
allNames.find((n) => n.toLowerCase() === subdomain.toLowerCase()) ?? "Roxi";
const orderedNames = [
primaryName,
...allNames.filter((n) => n !== primaryName),
];
// === NAVBAR NAME ===
document.querySelectorAll(".link-full").forEach((el) => {
el.textContent = el.textContent.replaceAll("roxi", primaryName.toLowerCase());
});
// === NAVBAR ===
document.fonts.ready.then(() => {
document.querySelectorAll(".nav-link").forEach((link) => {
const full = link.querySelector(".link-full");
const style = window.getComputedStyle(link);
const paddingLeft = parseFloat(style.paddingLeft);
const paddingRight = parseFloat(style.paddingRight);
const shortWidth = link.getBoundingClientRect().width;
const fullWidth = full.scrollWidth + paddingLeft + paddingRight;
link.style.width = shortWidth + "px";
link.addEventListener("mouseenter", () => {
link.style.width = fullWidth + "px";
});
link.addEventListener("mouseleave", () => {
link.style.width = shortWidth + "px";
});
});
});
// === HERO NAME TYPEWRITER ===
const base = primaryName;
const extra = "/" + orderedNames.slice(1).join("/");
const full = base + extra;
document.querySelectorAll(".hero-name").forEach((heroName) => {
heroName.textContent = primaryName;
let interval;
heroName.addEventListener("mouseenter", () => {
clearInterval(interval);
let i = base.length;
interval = setInterval(() => {
heroName.textContent = full.slice(0, i + 1);
i++;
if (i === full.length) clearInterval(interval);
}, 80);
});
heroName.addEventListener("mouseleave", () => {
clearInterval(interval);
let i = Math.max(heroName.textContent.length, base.length);
interval = setInterval(() => {
heroName.textContent = full.slice(0, i - 1);
i--;
if (i <= base.length) {
heroName.textContent = base;
clearInterval(interval);
}
}, 80);
});
});
document.title = `${full.toLowerCase()}'s page :3`;
const prides = ["trans", "enby", "aroace"];
const fyis = ["AI", "Elon Musk", "Donald Trump", "ICE", "MAGAs"];
// === TAGLINES ===
const taglines = [
"meow :3",
"i eat cement",
"nothing to look at here",
'<span class="trans">tramsgrendrer</span>',
"cool bug facts!<br />one day you will have to answer for your actions...<br />and god... may not be so... merciful.",
"<del>6 7</del> we don't do that shit here",
"<em>you, yes you! you are- VEEEERY good!!</em> -heavy tf2",
"please do not the cat",
"<b>the fog is coming. you need to run.</b>",
'i be <span class="trans">transing</span> my <span class="trans">gender</span> :3',
"also try Minecraft!",
"also try Terraria!",
"you've got mail!<br /><small>(it's a pipe bomb)</small>",
() =>
`be <span class="${prides[Math.floor(Math.random() * prides.length)]}">gay</span>, do crime >:3`,
() => `fuck ${fyis[Math.floor(Math.random() * fyis.length)]}`,
"hey Vsauce, michael here! your home security is great...<br /><em>or is it?</em>",
"my source is that i made it the fuck up",
"The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues.",
"*cat noises*",
];
function resolveTagline(tagline) {
return typeof tagline === "function" ? tagline() : tagline;
}
let lastIndex = -1;
function setRandomTagline() {
let index;
do {
index = Math.floor(Math.random() * taglines.length);
} while (index === lastIndex);
lastIndex = index;
const raw = taglines[index];
const resolved = resolveTagline(raw);
document.querySelector(".hero-tagline").innerHTML = resolved;
}
setRandomTagline();
setInterval(setRandomTagline, 7000);
// === CURRENT YEAR ===
document.getElementById("currentYear").textContent = new Date().getFullYear();