diff --git a/README.md b/README.md index 6d33686..32537b1 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Published images are resized copies without EXIF. The build deletes the original ## Development -The avatar ring is [@mtps/waves](https://git.app.ygg/mtps/waves), installed from the Gitea npm registry; `.npmrc` points `@mtps` there. +The page background is [@mtps/waves](https://git.app.ygg/mtps/waves) (light or dark with the OS), installed from the Gitea npm registry; `.npmrc` points `@mtps` there. ```sh pnpm install diff --git a/package.json b/package.json index 819ee98..9f28c14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "folio", - "version": "0.3.0", + "version": "0.4.0", "private": true, "type": "module", "packageManager": "pnpm@11.28.5", @@ -12,7 +12,7 @@ "check:metadata": "node scripts/check-metadata.mjs" }, "dependencies": { - "@mtps/waves": "0.1.0", + "@mtps/waves": "0.2.0", "astro": "7.3.8", "exifr": "7.1.3", "sharp": "0.35.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89c0c63..a733395 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@mtps/waves': - specifier: 0.1.0 - version: 0.1.0 + specifier: 0.2.0 + version: 0.2.0 astro: specifier: 7.3.8 version: 7.3.8(@types/node@24.19.2)(yaml@2.9.1) @@ -428,8 +428,8 @@ packages: '@jridgewell/sourcemap-codec@1.6.0': resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} - '@mtps/waves@0.1.0': - resolution: {integrity: sha512-RldMNcssY4TZ/KJYqg1lhdVn6bfvtHXR/On5qeED/lSDUaxUFf65L8P4CjduIQHi7sDGSJLYW3SboCR0HgFbTA==, tarball: https://git.app.ygg/api/packages/mtps/npm/@mtps%2Fwaves/-/0.1.0/waves-0.1.0.tgz} + '@mtps/waves@0.2.0': + resolution: {integrity: sha512-Js5mhFB+sgab7YsFQ46LjkuyxExU9Ly95BQueJucSK0q08rx6O2Nx7AEtLEUZlM5rmexJ73+zPgK5RDT6YD70A==, tarball: https://git.app.ygg/api/packages/mtps/npm/@mtps%2Fwaves/-/0.2.0/waves-0.2.0.tgz} '@napi-rs/wasm-runtime@1.2.4': resolution: {integrity: sha512-AJxoUD2/15ESHbvpcyjU274nsAPLuOtPHCk0vKJM5pj//Fg/B1FXNWjPnXTT9PymCYYiHo4zPj0ZomXBKhoy7g==} @@ -1947,7 +1947,7 @@ snapshots: '@jridgewell/sourcemap-codec@1.6.0': {} - '@mtps/waves@0.1.0': {} + '@mtps/waves@0.2.0': {} '@napi-rs/wasm-runtime@1.2.4(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)': dependencies: diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index b1d2abe..5a85d86 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -1,5 +1,6 @@ --- import { profile } from '../lib/profile'; +import '@mtps/waves/waves.css'; import '../styles/detail.css'; interface Props { @@ -18,7 +19,7 @@ const { title, description = profile.bio } = Astro.props; {description && } - + @@ -32,6 +33,12 @@ const { title, description = profile.bio } = Astro.props; --tile: #efefef; --link: #00376b; --backdrop: rgb(0 0 0 / 0.85); + /* text and lines straight on the waves background (header, grid); + --bg/--fg/… are for the panels on top of it (photo detail) */ + --page-fg: hsl(0 0% 98%); + --page-muted: hsl(0 0% 98% / 0.75); + --page-line: hsl(0 0% 98% / 0.35); + --page-tile: hsl(0 0% 98% / 0.12); color-scheme: light dark; } @media (prefers-color-scheme: dark) { @@ -49,10 +56,11 @@ const { title, description = profile.bio } = Astro.props; *::after { box-sizing: border-box; } + /* the background is @mtps/waves (class="waves"), light or dark with the OS */ body { margin: 0; - background: var(--bg); - color: var(--fg); + min-height: 100vh; + color: var(--page-fg); font: 15px/1.45 system-ui, -apple-system, diff --git a/src/pages/index.astro b/src/pages/index.astro index 758bc8f..e5dd110 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,5 @@ --- import { Image, Picture } from 'astro:assets'; -import '@mtps/waves/waves.css'; import Base from '../layouts/Base.astro'; import { getPhotos } from '../lib/photos'; import { profile } from '../lib/profile'; @@ -10,17 +9,15 @@ const photos = await getPhotos();
-
- { - profile.avatar ? ( - - ) : ( - - ) - } -
+ { + profile.avatar ? ( + + ) : ( + + ) + }

{profile.name}

{photos.length} {photos.length === 1 ? 'photo' : 'photos'}

@@ -73,30 +70,18 @@ const photos = await getPhotos(); margin: 0 auto; padding: 32px 20px 40px; } - /* @mtps/waves as the ring around the avatar, with a gap in the page colour */ - .ring { - flex: none; - padding: 3px; - border-radius: 50%; - } .avatar { + flex: none; width: clamp(77px, 20vw, 150px); /* override the img's height="300" so aspect-ratio keeps it round */ height: auto; aspect-ratio: 1; - border: 3px solid var(--bg); border-radius: 50%; object-fit: cover; - background: var(--tile); - } - /* no avatar: the waves show through behind the initial */ - .initial { + background: var(--page-tile); display: grid; place-items: center; - border-color: transparent; - background: none; font-size: clamp(32px, 8vw, 64px); - color: #fff; } h1 { margin: 0; @@ -111,7 +96,6 @@ const photos = await getPhotos(); white-space: pre-line; } .link { - color: var(--link); font-weight: 600; text-decoration: none; } @@ -129,7 +113,7 @@ const photos = await getPhotos(); max-width: 1280px; margin: 0 auto; padding: 0 0 48px; - border-top: 1px solid var(--line); + border-top: 1px solid var(--page-line); padding-top: 3px; } /* soaks up the leftover width so the last row isn't stretched */ @@ -140,7 +124,7 @@ const photos = await getPhotos(); .tile { width: calc(var(--r) * var(--row)); aspect-ratio: var(--r); - background: var(--tile); + background: var(--page-tile); } .tile :global(img) { width: 100%;