diff --git a/src/app.html b/src/app.html index adf8bd8..dd400e6 100644 --- a/src/app.html +++ b/src/app.html @@ -1,11 +1,11 @@ - - + + %sveltekit.head% -
%sveltekit.body%
+ %sveltekit.body% diff --git a/src/css/base/global.css b/src/css/base/global.css new file mode 100644 index 0000000..6a5186f --- /dev/null +++ b/src/css/base/global.css @@ -0,0 +1,58 @@ +html { + background: wheat; + color: black; +} + +body { + font-family: sans-serif; + font-size: 1.125rem; + font-weight: 400; + font-synthesis: none; + line-height: 1.5; + min-block-size: 100svb; +} + +attic-app { + display: flex; + flex-direction: column; + justify-content: start; + min-block-size: 100svb; + + & > :is(header, footer, main) { + display: grid; + grid-template-columns: + [full-start] + 1fr + [margin-start] + minmax(20px, min(5vi, 100px)) + [main-start] + minmax(260px, 800px) + [main-end] + minmax(20px, min(5vi, 100px)) + [margin-end] + 1fr + [full-end]; + + & > * { + grid-column: main; + } + } + + & > header { + padding-block: 30px; + } + + & > footer { + padding-block: 30px; + margin-block-start: auto; + } + + & > main { + row-gap: 30px; + } +} + +:focus-visible { + outline: 2px solid magenta; + outline-offset: 2px; +} diff --git a/src/css/base/typography.css b/src/css/base/typography.css new file mode 100644 index 0000000..cbc08e1 --- /dev/null +++ b/src/css/base/typography.css @@ -0,0 +1,13 @@ +h1 { + font-size: 2rem; + font-weight: 700; +} + +:is(h2, h3, h4, h5, h6) { + font-size: 1.5rem; + font-weight: 700; +} + +p:has(small:read-only) { + font-size: 1rem; +} diff --git a/src/css/components/button.css b/src/css/components/button.css new file mode 100644 index 0000000..b831be7 --- /dev/null +++ b/src/css/components/button.css @@ -0,0 +1,7 @@ +button { + border: 2px solid currentColor; + font-weight: 700; + inline-size: fit-content; + line-height: 1.5; + padding: 5px 10px; +} diff --git a/src/css/components/form.css b/src/css/components/form.css new file mode 100644 index 0000000..7c74746 --- /dev/null +++ b/src/css/components/form.css @@ -0,0 +1,15 @@ +form { + background: white; + display: grid; + gap: 10px; + justify-items: start; + padding: 20px; + + & label { + display: block; + font-size: 1rem; + font-weight: 700; + inline-size: fit-content; + line-height: 1.5; + } +} diff --git a/src/css/components/input.css b/src/css/components/input.css new file mode 100644 index 0000000..caa647a --- /dev/null +++ b/src/css/components/input.css @@ -0,0 +1,8 @@ +input[type="text"] { + background: white; + border: 2px solid currentColor; + font-weight: 400; + inline-size: min(100%, 300px); + line-height: 1.5; + padding: 5px 10px; +} diff --git a/src/css/main.css b/src/css/main.css index 61068f5..06cf919 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -1,3 +1,31 @@ @layer base, components, utility; @import "base/reset.css" layer(base); +@import "base/global.css" layer(base); +@import "base/typography.css" layer(base); + +@import "components/button.css" layer(base); +@import "components/input.css" layer(base); +@import "components/form.css" layer(base); + +.error { + color: #dd2244; + font-weight: 700; +} + +.avatar { + align-items: center; + display: grid; + grid-template-columns: 50px auto; + gap: 10px; + + & img { + border-radius: calc(1px * infinity); + block-size: 50px; + inline-size: 50px; + } + + & p { + font-weight: 700; + } +} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 0845b4a..bc0fbf9 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,4 +4,22 @@ let { children } = $props(); -{@render children()} +
+
+

attic.social

+

Attic is a cozy space with lofty ambitions.

+
+
+ +
+ {@render children()} +
+ + diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 86635eb..406d89b 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -15,7 +15,7 @@ export const actions = { url = await startSession(event, String(handle ?? "")); } catch (err) { console.log(err); - return fail(400, { handle, invalid: true }); + return fail(400, { handle, action: "login", error: "Invalid handle." }); } redirect(303, url); }, diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 7e46703..9288310 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,25 +1,40 @@ {#if data.user} - avatar -

Hello, {data.user.displayName}!

+

Signed in as:

+
+ avatar +

{data.user.displayName}

+
+ +
+

Attic settings

+ + + +
+
- +

Bye!

+
{:else}

Connect

Connect with your Bluesky / Atmosphere account.

- {#if form?.invalid} -

Invalid handle

+ {#if form?.action === "login" && form?.error} +

{form.error}

{/if} - - + +
{/if}