summaryrefslogtreecommitdiff
path: root/views/pages/home-page.html
blob: 4ba6b8e57a0bc74068b5201d6ff78e99ac322eb1 (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
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
{{ define "meta" }}
<meta name="og:title" content="{{ .Title }}">
<meta name="og:description" content="{{ .L.HomePage.Description }}">
<meta name="og:image" content="https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/{{ .GifName }}">
{{ end }}

{{ define "body" }}
<div class="absolute w-full h-full inset-0 inset-shadow-[0_0_0.4rem_black] pointer-events-none z-20"></div>
<div class="relative bg-background-light flex flex-row ar-lt-0.6:flex-col w-full h-full overflow-y-auto text-base/loose tracking-wide z-10">
    <div class="ar-gt-0.6:flex-3/5 justify-center content-start p-8">
        <div class="flex flex-col justify-start items-start bg-background-dark mb-8 shadow-[0.4rem_0.4rem_0.4rem_black]">
            <p class="text-3xl/loose sm:text-4xl/loose lg:text-5xl/loose tracking-widest uppercase w-full font-andika italic text-left
                border-l-4 border-solid border-(--background-dark-color)
                bg-linear-to-r from-(--background-dark-color) to-(--background-light-color)">{{ .L.HomePage.Hymn1 }}</p>
            <hr class="w-full border-t-2 border-dotted border-main-hard mb-1">
            <p class="text-xl/loose sm:text-2xl/loose lg:text-3xl/loose -indent-8 ml-12 p-1">{{ .L.HomePage.Hymn2 }}</p>
            <p class="text-xl/loose sm:text-2xl/loose lg:text-3xl/loose -indent-8 ml-12 p-1">{{ .L.HomePage.Hymn3 }}</p>
            <p class="text-xl/loose sm:text-2xl/loose lg:text-3xl/loose -indent-8 ml-12 p-1">{{ .L.HomePage.Hymn4 }}</p>
        </div>

        <div class="flex flex-col justify-center items-center">
            <p class="text-xl sm:text-2xl lg:text-3xl p-1 w-full font-andika italic text-left
                border-l-1.5 border-solid border-(--background-dark-color)
                bg-linear-to-r from-(--background-dark-color) to-(--background-light-color)">{{ .L.HomePage.DidYouKnowThat }}</p>
            <hr class="w-full border-t-2 border-dotted border-main-hard mb-1">
            <ul class="w-full text-left list-[circle]">
                <li class="ml-4 mb-1">{{ index .FunFacts 0 }}</li>
                <li class="ml-4 mb-1">{{ index .FunFacts 1 }}</li>
                <li class="ml-4">{{ index .FunFacts 2 }}</li>
            </ul>
        </div>
    </div>

    <div class="ar-gt-0.6:flex-2/5 justify-center content-start p-8">
        <div class="flex flex-col justify-center items-start mb-4">
            <p class="text-xl sm:text-2xl lg:text-3xl p-1 w-full font-andika italic text-left
                border-l-1.5 border-solid border-(--background-dark-color)
                bg-linear-to-r from-(--background-dark-color) to-(--background-light-color)">{{ .L.HomePage.Contacts }}</p>
            <hr class="w-full border-t-2 border-dotted border-main-hard mb-1">
            <a href="https://t.me/EarlInisMona">
                <i class="fa-brands fa-telegram w-4 h-4 mr-1"></i>
                <span class="font-bold">Telegram:</span>
                <span>@EarlInisMona</span>
            </a>
            <a href="https://discord.com/users/356057270951346176">
                <i class="fa-brands fa-discord w-4 h-4 mr-1"></i>
                <span class="font-bold">Discord:</span>
                <span>montferrat</span>
            </a>
            <a href="mailto:saya.andy@posteo.com">
                <i class="fas fa-envelope w-4 h-4 mr-1"></i>
                <span class="font-bold">E-mail:</span>
                <span>saya.andy@posteo.com</span>
            </a>
        </div>

        <div class="flex relative aspect-square justify-center content-center mb-4">
            {{- range $_ := iterate .FilledHeartCount }}
                <div class="home-page-heart z-50"></div>
            {{- end }}
            {{- range $_ := iterate .OutlineHeartCount }}
                <div class="home-page-heart z-50"></div>
            {{- end }}
            <img src="https://f003.backblazeb2.com/file/sayana-static/home-page-gifs/{{ .GifName }}"
                class="home-page-gif z-49 -rotate-12 max-w-[70%] max-h-[70%] border-4 border-(--background-dark-color) border-inset">
        </div>

        <script>
            function shuffleHearts() {
                vmin = calculateVmin(1);
                document.querySelectorAll('.home-page-heart').forEach((e) => {
                    let top, left;
                    do {
                        top = Math.floor(rand() * 90) + 5;
                        left = Math.floor(rand() * 90) + 5;
                    } while (top > 30 && top < 70 && left > 30 && left < 70);
                    const opacity = rand() * 0.7 + 0.2;
                    const size = rand() * 3.2 + 0.8;
                    e.style["top"] = `calc(${top}% - ${size}vmin / 2)`;
                    e.style["left"] = `calc(${left}% - ${size}vmin / 2)`;
                    e.style["opacity"] = `${opacity}`;
                    e.style["font-size"] = `${size}vmin`;
                });
            }

            let shuffleHeartsResizeTimeout;
            function shuffleHeartsResizeCb() {
                clearTimeout(shuffleHeartsResizeTimeout);
                shuffleHeartsResizeTimeout = setTimeout(shuffleHearts, 300);
            }
            window.addEventListener('resize', shuffleHeartsResizeCb);

            document.addEventListener('popout', (e) => {
                window.removeEventListener('resize', shuffleHeartsResizeCb);
                shuffleHeartsResizeCb = null;
            });
        </script>

        <script>
            document.addEventListener('htmx:afterRequest', (e) => {
                if (e.detail.xhr.status == 404 || e.detail.successful != true) {
                    return console.error(e);
                }
                if (e.detail.target.id == 'general-page-body') {
                    shuffleHearts();
                }
            }, {once: true});
        </script>

        <div class="flex flex-col justify-center items-center">
            <p class="text-xl sm:text-2xl lg:text-3xl p-1 w-full font-andika italic text-left
                border-l-1.5 border-solid border-(--background-dark-color)
                bg-linear-to-r from-(--background-dark-color) to-(--background-light-color)">{{ .L.HomePage.SidebarDescription }}</p>
            <hr class="w-full border-t-2 border-dotted border-main-hard mb-1">
            <div class="w-full grid grid-cols-[1fr_4fr] content-center items-center
                [&>*:nth-child(4n+2)]:bg-(--background-medium-color)/50 [&>*:nth-child(4n+3)]:bg-(--background-medium-color)/50" style="container-type: inline-size;">
                <i class="fas fa-home w-full h-full text-[10cqi] content-center text-center text-main-hard"></i>
                <p class="p-1">{{ .L.HomePage.HomePageDescription }}</p>
                <i class="fas fa-search w-full h-full text-[10cqi] content-center text-center text-main-hard"></i>
                <p class="p-1">{{ .L.HomePage.BlogSearchDescription }}</p>
                <i class="fas fa-map w-full h-full text-[10cqi] content-center text-center text-main-hard"></i>
                <p class="p-1">{{ .L.HomePage.MarkerMapDescription }}</p>
                <i class="fas fa-swatchbook w-full h-full text-[10cqi] content-center text-center text-main-hard"></i>
                <p class="p-1">{{ .L.HomePage.ThemeSwitchDescription }}</p>
            </div>
        </div>
    </div>
</div>
{{ end }}