aboutsummaryrefslogtreecommitdiff
path: root/src/routes/anilist-badges-easter-event-2025/+page.svelte
blob: b9c1295dc884b2e0828b80efd64887408f1e3db7 (plain) (blame)
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
<script lang="ts">
import { onMount } from "svelte";
import ClickableAreaPage from "$lib/Events/AniListBadges/EasterEvent2025/ClickableAreaPage.svelte";
import MultipleChoicePage from "$lib/Events/AniListBadges/EasterEvent2025/MultipleChoicePage.svelte";
import RiddlePage from "$lib/Events/AniListBadges/EasterEvent2025/RiddlePage.svelte";
import "$lib/Events/AniListBadges/EasterEvent2025/event.css";

const multipleChoiceAnswers = [
	"The Beginning After the End",
	"Domestic Girlfriend",
	"Spy Classroom",
	"Kaguya-sama: Love is War",
];
const clickableAreaAnswers = [
	"https://media1.tenor.com/m/RkgfXhcewvoAAAAC/rui-tachibana-tachibana-rui.gif",
	"https://media1.tenor.com/m/fOBbcJOFZ-kAAAAC/hina-hina-tachibana.gif",
	"https://media1.tenor.com/m/GQT7FHW-w-IAAAAC/anime-domestic-girlfriend.gif",
];
let page = 0;

onMount(() => {
	const urlParameters = new URLSearchParams(window.location.search);
	const pageParameter = urlParameters.get("page");

	if (pageParameter) page = parseInt(pageParameter) || 0;
});

const updatePage = (to: number | undefined = undefined) => {
	const url = new URL(window.location.href);

	if (to) {
		page = to;
	} else {
		page += 1;
	}

	url.searchParams.set("page", page.toString());
	window.history.replaceState(null, "", url.toString());
};
</script>

<div class="card main-content">
  {#if page === 0}
    <p class="big-text">Welcome to the Easter Egg Hunt!</p>
    <button onclick={() => updatePage()}>Begin Hunt</button>
    <br />
    <p>due.moe × AniList Badges</p>
  {:else if page === 1}
    <MultipleChoicePage
      prompt="Which of these anime has the best adaptation?"
      answers={multipleChoiceAnswers}
      correctIndex={1}
      onComplete={() => updatePage()}
    />
  {:else if page === 2}
    <ClickableAreaPage
      prompt="Which of these scenes contain a little action?"
      images={clickableAreaAnswers}
      correctIndex={2}
      onComplete={() => updatePage()}
    />
  {:else if page === 3}
    <RiddlePage
      riddle="An alternate way to refer to Domestic Girlfriend is ..."
      answer="peak"
      onComplete={() => updatePage()}
      hint="peak"
    />
  {:else}
    <p class="big-text">Congratulations! You won!</p>

    <img
      src="https://media1.tenor.com/m/S8zYyudMjXAAAAAC/domekano-domestic-girlfriend.gif"
      alt="Anime scene"
    />

    <br />

    <p>due.moe × AniList Badges</p>
  {/if}
</div>

<style>
  .main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
  }
</style>