sourcehypertextpublicindexfun.js

const titles = [
	{ lang: "grc", text: "Ἡ Ὕλη τῶν Σατύρων" },
	{ lang: "la", text: "Silva Satyrorum" },
	{ lang: "ang", text: "Se Ƿuſuƿudu" },
	{ lang: "zh-Hant", text: "薩特深林" },
	{ lang: "ar", text: "الغابة الساتير" },
	{ lang: "he", text: "יער הסאטירים" },
	{ lang: "ja", text: "サテュロスの森" },
	{ lang: "sa", text: "सतिराणां वनम्" },
	{ lang: "ga", text: "An Choill na Satairí" },
	{ lang: "cy", text: "Y Goedwig y Satyriaid" },
	{ lang: "ca", text: "El Bosc dels Sàtirs" },
	{ lang: "kl", text: "Satyrit Orpippaſsuaat" },
	{ lang: "in", text: "Satýraſkógurinn" },
	{ lang: "fr", text: "La Forêt des Satyres" },
	{ lang: "sw", text: "Mſitu ya Mazimwi" },
	{ lang: "eo", text: "La Faūnarbaro" },
	{ lang: "pl", text: "Puſzcza Satyrów" },
	{ lang: "non-Runr", text: "ᛋᛅᛏᚢᚱᛅᛋᚴᚢᚴᛦᛁᚾᚾ"},
	{ lang: "art-x-ithkuil", text: "Onçacdëucčaiřţţlüšboẓ"},
	{ lang: "tok", text: "ma kaſi pi jan ſoweli unpa"},
	{ lang: "ro", text: "Codrul Satirilor"}
];

const greetings = [
	"<span lang='grc'>Χαῖρε</span>",
	"<span lang='tr'>Merhaba</span>",
	"<span lang='la'>Salve</span>",
	"<span lang='haw'>Aloha</span>",
	"<span lang='en-AU'>G’day</span>",
	"Ahoy",
	"<span lang='el'>Καλώς ορίσατε</span>",
	"<span lang='is'>Velkomin</span>",
	"<span lang='en-GB'>Welcome</span>",
	"<span lang='nl'>Welkom</span>",
	"<span lang='ja'>ようこそ</span>",
	"<span lang='zh'>你好</span>",
	"Namaste",
	"Kia ora",
	"Blessed be",
	"Salaam"
];

const splashText = [
	"*satyrs not included",
	"Bill Posters Is Innocent!",
	'<a href="/shrines/dionysos" lang="grc" hreflang="en-GB">Εὐοῖ!</a>',
	'Time-travelling hippie from 1969 <span class="all-sc">BCE</span>',
	'<span lang="nl">Tijdreizende hippie uit 1969 v. Chr.</span>',
	"Yeah? Well, you know, that’s just, like, uh… your opinion, man.",
	"It’s a free country, man!",
	"Nothing in excess",
	'<span lang="nl">Niets te veel</span>',
	'<span lang="grc">Μηδὲν ἄγαν</span>',
	"Surety brings ruin",
	'<span lang="grc">Ἐγγύα πάρα δ’ Ἄτα</span>',
	'<span lang="nl">Zekerheid brengt verderf</span>',
	"Know thyself",
	'<span lang="nl">Ken uzelf</span>',
	'<span lang="grc">Γνῶθι σεαυτόν</span>',
	"Be excellent to each other!",
	'I’m not a satyr; i just play one on <span class="all-sc">TV</span>.',
	'<span lang="nl">Ik ben geen satyr, maar ik speel er een op tv.</span>',
	"When this baby hits 88 miles per hour, you’re gonna see some serious shit.",
	'<a href="https://www.youtube.com/watch?v=FzfKn-hlZwo">All i do is sit and think about you</a>',
	"No, lieutenant; your men are already dead.",
	"My dealer won’t tell me where he gets these links.",
	"Fuck you, it’s January!",
	"Endless trash!",
	"Solar plexus clown glider",
	"The masculine urge to give up and live in the woods",
	"<i>τ</i> &gt; <i>π</i>",
	"6<span class='all-sc'>EQUJ</span>5",
	"Apple pie makes you sterile!",
	"Put me back! I was a niche internet microcelebrity!",
	'<a href="https://www.youtube.com/watch?v=wSHvT3ZPkqM">Do i belong to some ancient race? I like to walk in ancient places</a>',
	"In another life, i would have really liked just doing laundry and taxes with you.",
	'<a href="https://www.youtube.com/watch?v=_SwvSu3jxAA">You know, for kids!</a>',
	'<a href="https://www.youtube.com/watch?v=L6FObPezIAk">Well, i don’t know how to tell the weight of the sun</a>',
	'<a href="https://www.youtube.com/watch?v=8F4d4DtGZhw">River of orchids, winding my way</a>',
	'<a href="https://www.youtube.com/watch?v=D_5JQLUyuJ0">Rough surf on the coast; i wish i could’ve spent the whole day alone</a>',
	'<a href="https://www.youtube.com/watch?v=jnFvquNDCGQ">By land and by water, through the wilderness wander</a>',
	'<a href="https://www.youtube.com/watch?v=gIsnb1TKYjE">Leave them all behind</a>',
	"Everything’s computer!",
	"Fuck the Online Safety Act!",
	"100% <span class='all-sc'>AI</span>-generated!"
];

const randomiseTitleLanguage = () => {
	const newTitle = titles[Math.floor(Math.random() * titles.length)];
	$("#translated-title").innerText = newTitle.text;
	$("#translated-title").setAttribute("lang", newTitle.lang);
}

documentReady(() => {
	if (Math.random() < 0.01) {
		randomiseTitleLanguage();
	}

	if (Math.random() < 0.01) {
		$(".primary .bilingual").innerHTML = $(
			".primary .bilingual"
		).innerHTML.replace(
			/Chære/g,
			greetings[Math.floor(Math.random() * greetings.length)]
		);
	}

	$("#subtitle").innerHTML =
		splashText[Math.floor(Math.random() * splashText.length)];

	$(`#theme-dropdown option[value="${$("body").className}"]`).toggleAttribute("selected");

	if (
		(Date.now() -
			Date.parse(
				$(".whats-new > .dates")
					.innerText.match(/[0-9]{1,2} ...\. [0-9]{4}/)[0]
					.replace(".", "")
			)) /
			(24 * 60 * 60 * 1000) <
		7
	) {
		$(".whats-new").innerHTML += `<span class="splash-new">New!</span>`;
	}

	$("#theme-dropdown").on("change", (evt => {
		$("body").className = evt.target.value;
	}));
});