This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Default.astro
91 lines (81 loc) · 3.32 KB
/
Default.astro
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
---
import { Document, Body } from 'astro-base-document';
// import Resets from '@julian_cataldo/astro-resets/Resets.astro';
// import LightBox from '@julian_cataldo/astro-lightbox/LightBox.astro';
import { Breakpoints } from 'astro-breakpoints';
import { PageTransition } from 'astro-page-transition';
/* ·········································································· */
import Landing from 'src/modules/Landing/Landing.astro';
import NavigationBar from 'src/components/NavigationBar/NavigationBar.astro';
import Footer from './Footer.astro';
import Head from './Head.astro';
/* ·········································································· */
// FIXME: FOUT
import '@fontsource/exo-2/variable.css';
import '@fontsource/exo-2/variable-italic.css';
/* ·········································································· */
// TODO: importing globally here for HMR smoothness
import './Default.global.scss';
/* —————————————————————————————————————————————————————————————————————————— */
export interface Props {
titles: { main: string; sub?: string };
description?: string;
actions?: { title: string; href: string }[];
}
const props = { ...Astro.props } as Props;
/* ············································ Typeguards + Fallbacks ······ */
if (typeof props?.titles?.main !== 'string') {
props.titles = { main: '' };
}
/* —————————————————————————————————————————————————————————————————————————— */
---
<Document
id="test-base-rootDoc"
data-theme="default"
data-color-mode={'light' /* FIXME: repair mixin for no JS support (themes/selector.scss) */}
data-is-top="true"
lang="en"
class:list={[
`mode-${import.meta.env.MODE}`,
'test-base-rootDoc-1',
'test-base-rootDoc-2',
]}
data-test="scrollObserver-rootDoc base-rootDoc"
>
<Fragment slot="head">
<Head titles={props.titles} />
</Fragment>
<Body
id="test-base-body"
slot={'body' /* NOTE: investigate why this works */}
class:list={['test-base-body-1', 'test-base-body-2']}
data-test="base-body"
>
<Breakpoints />
<PageTransition
speed={500}
zIndex={99}
background={'var(--app-overlay-color)'}
/>
<!--—————————————————————————————————————————————————————————————————————-->
<NavigationBar />
<header>
<Landing
title={props.titles.main}
description={props.titles.sub}
actions={props.actions}
/>
</header>
<main>
<slot />
</main>
<Footer />
</Body>
</Document>
<!-- Disabled here because HMR issues -->
<!-- <style lang="scss" is:global>
@import './Default.global';
</style> -->
<script>
import './Default.client.ts';
</script>