You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.0 KiB
TypeScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { swel } from "swel";
const QUOTES = [
[
"The world ain't all sunshine and rainbows. It's a very mean and nasty place, and I don't care how tough you are it will beat you to your knees and keep you there permanently if you let it. You, me, or nobody is gonna hit as hard as life. But it ain't about how hard you hit. It's about how hard you can get hit and keep moving forward. How much you can take and keep moving forward. That's how winning is done!",
"Rocky",
] as const,
[
"Almost dead yesterday, maybe dead tomorrow, but alive, gloriously alive, today",
"Robert Jordan, <em>Lord of Chaos<em>",
] as const,
[
"Those who build walls are their own prisoners",
"Ursula K. Le Guin, <em>The Dispossessed</em>",
] as const,
[
"I have no right to call myself one who knows. I was one who \
seeks, and I still am, but I no longer seek in the stars or in \
the books; Im beginning to hear the teachings of my blood \
pulsing within me. My story isnt pleasant. Its not sweet and \
harmonious like invented stories. It tastes of folly and \
bewilderment, of madness and dream, like the life of all people \
who no longer want to lie to themselves.",
"Herman Hesse",
] as const,
[
"In the depth of winter, I finally learned that within me there \
lay and invincible summer",
"Albert Camus",
] as const,
[
"Life, although it may only be an accumulation of anguish, is \
dear to me, and I will defend it.",
"Mary Shelley, <em>Frankenstein</em>",
] as const,
[
"Who but a god can go through life unmarked?",
"Aeschylus, <em>Agamemnon</em>",
] as const,
["Don't you dare go Hollow.", "Laurentius, <em>Dark Souls</em>"] as const,
];
export const init = () => {
const el = document.querySelector(".home-quote");
if (!el) {
return;
}
const [quote, cite] = QUOTES[Math.floor(Math.random() * QUOTES.length)];
const citeEl = swel("cite");
citeEl.innerHTML = cite;
const bq = swel("blockquote", [quote, citeEl]);
el.replaceChildren(bq);
};