all repos — website @ 4943e2e871623e6e03eed00550a901763aea6d42

Unnamed repository; edit this file 'description' to name the repository.

src/layouts/Layout.astro (view raw)

 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
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
---
import Image from "astro/components/Image.astro";
import { PondImage } from "../assets";

import "../css/index.css";

interface Props {
	width?: "narrow" | "wide";
}
const { width = "narrow" } = Astro.props;
---

<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width" />
		<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
		<link rel="icon" href="/favicon.ico" />
		<meta name="generator" content={Astro.generator} />
		<title>viii</title>
	</head>
	<body>
		<div id="background" class="background">
			<div class="background-overlay" id="backgroundOverlay"></div>
			<Image
				class="background-image"
				id="backgroundImage"
				src={PondImage}
				alt="Small pound surrounded by green vegetation, with a wooden bench visible in the backgroud among some trees. The sky and surrounding foliage are reflected in the water"
			/>
		</div>

		<div class={`content ${width}`}>
			<slot />
		</div>
	</body>
</html>

<style is:global>
	.background {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: -1;

		.background-overlay {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;

			@media (prefers-color-scheme: dark) {
				background: hsla(var(--crust) / 0.25);
			}
		}

		img {
			width: 100%;
			height: 100%;
			object-fit: cover;
		}
	}

	.content {
    	--margin: 0.5rem;
		position: relative;
		z-index: 1;
		background: hsla(var(--crust) / 1);
		box-shadow: 0 0.5rem 2rem hsla(var(--shadow) / 0.5);

		width: calc(100% - calc(var(--margin) * 2));
		max-width: 60ch;
		--top: calc(2rem + 2.5rem + 1.25rem + 5rem);
		margin: calc(100vh - var(--top)) var(--margin) 0 var(--margin);
		border-radius: 2rem 2rem 0 0;
		overflow: hidden;

		/* TODO)) maybe we can smoothly transition this */
		transition: none;

		&.wide {
			max-width: 120ch;
		}
	}

	@media (max-width: 60ch) {
		.content {
			--margin: 0;
		}
	}

	header.page-head {
		position: relative;
		padding: 1rem 0.75rem;
		background-color: hsl(var(--accent));
		z-index: 1;

		&::after {
			--height: 0.5rem;
			content: "";
			position: absolute;
			top: calc(100% - 1px);
			left: 0;
			display: block;
			width: 100%;
			height: var(--height);

			background-color: hsl(var(--accent));

			mask-image: url("../assets/line.svg");
			mask-size: calc(var(--height) * 5) 100%;
			mask-repeat: repeat-x;
		}

		.title {
			display: flex;
			align-items: center;
			gap: 1ch;

			h1 {
				font-size: 2.5rem;
				font-weight: 900;
				color: hsl(var(--on-accent));
				line-height: 1;
			}
			.pronouns {
				background: hsl(var(--surface0));
				color: hsl(var(--text));

				font-size: 0.75rem;
				padding: 0.1rem 0.5rem;
				border-radius: 5rem;
				user-select: none;
			}
		}

		p.subtitle {
			font-size: 1.25rem;
			font-weight: 500;
			color: hsl(var(--on-accent));
		}
	}

	section {
		--section-bg: var(--crust);
		--container-bg: var(--mantle);
		background-color: hsl(var(--section-bg));
		position: relative;
		padding: 0.75rem;

		header {
			h2 {
				font-size: 1.5rem;
				font-weight: 700;
			}
			p.subtitle {
				font-size: 1.25rem;
				font-weight: 500;
			}
		}

		&:nth-child(odd) {
			--section-bg: var(--mantle);
			--container-bg: var(--base);
		}

		&::after {
			--height: 0.5rem;
			content: "";
			position: absolute;
			top: calc(100% - 1px);
			left: 0;
			display: block;
			width: 100%;
			height: var(--height);
			z-index: 100;

			background-color: hsl(var(--section-bg));

			mask-image: url("../assets/line.svg");
			mask-size: calc(var(--height) * 5) 100%;
			mask-repeat: repeat-x;
		}
	}

	a.link {
		position: relative;
		padding: 0 0.25rem;
		color: hsl(var(--text));
		text-decoration: none;

		&::after {
			content: "";
			display: block;
			height: 3px;
			left: 0;
			bottom: 0;
			width: 100%;
			position: absolute;
			backdrop-filter: invert(1);
			background: hsla(var(--accent) / 1);
		}

		&:hover,
		&:focus-visible {
			&::after {
				background: hsla(var(--accent) / 0);
				height: 100%;
				z-index: 5;
			}
		}
	}
</style>