summaryrefslogtreecommitdiff
path: root/diagonal-scroll.html
blob: 0a216b0fa95514f3a5d10ca046befdd7cd931647 (plain)
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
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>diagonal scroll</title>
		<style>
			/* CSS abuse */
			div {
				left: -500px; /* The div is shifted to the left so the left side of the p elements don't get clipped */
				top: 0px;
				position: fixed; /* Make the div fill the entire screen */
				width: 1000px;
				height: 100vh;
				overflow: scroll; /* This adds the diagonal scroll bar */
				transform-origin: top left;
				transform: skewX(45deg); /* I originally used a rotate transform, but the math is way easier when using skewX */
				font-family: Hack, Noto Mono, monospace;
				line-height: 1.5em;
			}
			p {
				margin-left: auto;
				margin-right: 0;
				width: 500px;
				transform-origin: top left;
				transform: skewX(-45deg);
			}
			span {
				/* This adds a block of empty space at the bottom of the div */
				/* Otherwise, if the screen is taller than its width, the text at the bottom will be to the right of the screen's right edge */
				display: inline-block;
				height: calc(100vh - 100vw + 400px);
				transform-origin: top left;
				transform: skewX(-45deg);
			}
			.secret {
				color: white;
			}
		</style>
	</head>
	<body>
		<div>
			<p>oh, great. another doe-eyed rebellious anime girl to add to the endless parade of generics that litter the media landscape. ennui, huh? well, isn't that just perfect.</p>
			<p>ennui had a seething hatred for modern society, because honestly, who doesn't? she despised the endless monotonicity, er, i meant monotony, of her life and the only emotion she could feel nowadays was boredom. endless, dull, tedious boredom!</p>
			<p>one day, ennui had the brilliant idea of running away from home and going for a joyride on the trans-siberian railway. because, you know, nothing screams excitement quite like sitting in a cramped, musty train for days on end.</p>
			<p>after breaking multiple countries' multiple laws, the first five seconds aboard the train were a flurry of excitement, but boredom returned as quickly as it had departed. suddenly, out of the corner of her eye, ennui noticed a visibly troubled young man with an exceptionally bad haircut. since she had nothing better to do, ennui roasted his hairstyle, but the man took it as a compliment, and they struck up a slightly less boring conversation.</p>
			<p>he introduced himself as <a href="https://web.archive.org/web/20230526184241/https://en.wikipedia.org/wiki/Benjamin_Qi">ben qi</a>, a three-time international olympiad in informatics winner, as if anyone cares. yeah, i'm sure ennui was just thrilled to have met such an exciting and charming individual.</p>
			<p>but wait, it gets even better! ennui nosily asked ben qi what was bothering him, because that's totally a question you ask a stranger you just met 30 seconds ago. ben qi just replied cryptically, &quot;i have a secret. a deep, dark, beleaguering secret gnawing away at my soul. and i'll tell you what it is, if and only if, you become an ioi winner like me.&quot;</p>
			<p>so, because ennui was so utterly bored with life, she immersed herself into ioi training, living and breathing dijkstra's algorithm, avx2-accelerated segment trees, and the knuth-yao dp speedup. robert tarjan the algorithm man soon started haunting her dreams.</p>
			<p>and then, surprise surprise, she actually won the ioi! because, you know, that's totally realistic.</p>
			<p>long at last, the moment had come. ben qi smiled proudly and said, &quot;congrats ennui! you're now an ioi winner! and now i must fulfill my side of the biconditional. i'm going to reveal to you my secret.&quot;</p>
			<p>ennui leaned forward eagerly, her heart pounding with anticipation. finally! she had waited so long, sacrificed so much, suffered through so many robert tarjan nightmares! finally!</p>
			<p>ben qi took a deep breath and ponderously whispered in a hushed tone&mdash;oh wait, i must interrupt! you see, dear reader, i cannot reveal to you what ben qi's secret is. why, you ask? well, simply put, unlike ennui, you are not an ioi winner.</p>
			<span><a class="secret" href="you-thought-I-would-just-tell-you?">the secret</a></span>
		</div>
	</body>
</html>