diff --git a/app/about/[name]/page.tsx b/app/about/[name]/page.tsx index afdbe29..9176572 100644 --- a/app/about/[name]/page.tsx +++ b/app/about/[name]/page.tsx @@ -19,7 +19,7 @@ export default function MemberPage({ params: { name } }) { return ( <> -
+
{member.bioShort} {member.bioContinued} diff --git a/app/contact/page.tsx b/app/contact/page.tsx index 6af8ad1..e75ab1f 100644 --- a/app/contact/page.tsx +++ b/app/contact/page.tsx @@ -8,7 +8,7 @@ export default function Contact() {

Contact

-
+
Be nice. Please don't make us regret putting this here diff --git a/app/not-found.tsx b/app/not-found.tsx index b3a0fd4..35861b5 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -4,7 +4,7 @@ export default function NotFound() { return ( <>

Not Found (404)

-
+
Error:  Unable to find the requested resource diff --git a/app/page.tsx b/app/page.tsx index 507f1d7..229a803 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,43 +1,140 @@ +import fs from 'node:fs/promises' +import path from 'node:path' + import Link from 'next/link' import styles from '~/styles/index.module.css' +import sharp from 'sharp' + +const mimes = { + jpg: 'image/jpeg', + jpeg: 'image/jpeg', + png: 'image/png', + bmp: 'image/bmp', + gif: 'image/gif' +} + +export default async function Index() { + const buttonDir = 'images/buttons/' + const buttonFiles = (await fs.readdir(path.join(process.cwd(), buttonDir)).catch(() => {}) || []) + .filter(buttonName => buttonName.match(/\.(png|gif|jpg|jpeg)$/)) + + const buttonLinks = (await fs.readFile(path.join(process.cwd(), 'images/buttons/urls.txt'), {encoding: 'utf8'}).catch(() => {}) || '') + .split('\n').filter(line => !!line) + .map(line => line.match(/^([^:]+):\s+(.*)$/)) + .filter(match => !!match) + .reduce((acc,[_, name, url]) => ({...acc, [name]: url}), {}) + + const buttons = await Promise.all(buttonFiles.map(async buttonFile => { + const origImageData = await fs.readFile(path.join(process.cwd(), buttonDir, buttonFile)) + let preview = null + + const metadata = await sharp(origImageData, {pages: -1}).metadata() + + // Generate preview if there's more than one frame + if(metadata.pages > 1) { + preview = await sharp(origImageData, {pages: 1}) + .png({quality: 80, force: true}) + .toBuffer() + } + + return { + name: buttonFile.split('.').slice(0, -1).join('.'), + mime: mimes[buttonFile.split('.').at(-1)] || 'image/*', + url: buttonLinks[buttonFile], + data: origImageData.toString('base64'), + preview: preview?.toString('base64') + } + })) + + const friendButtons = buttons.filter(button => button.name !== 'tempest') + const ourButton = buttons.filter(button => button.name === 'tempest')[0] -export default function Index() { return ( -
-

- Hi, we're tempest! We're a median plural - system of six members, but most of the time you'll probably see us - operating as one -

+ <> +
+

+ Hi, we're tempest! We're a median plural + system of six members, but most of the time you'll probably see us + operating as one +

+ +

We like coding, VR, and making CG art

+ +

At a glance

+
+ Pronouns: + they/it + + Cohort: + millenial -

We like coding, VR, and making CG art

+ Orientation: + ace . . . ish -

At a glance

-
- Pronouns: - they/it + Partners: + several - Cohort: - millenial + Children: + two - Orientation: - ace . . . ish + Capitalize name: + not unless we're at work +
- Partners: - several +

+ Note: This is the information for our system in aggregate, + for individual info see our about page +

+
+ {friendButtons.length > 0 && ( +
+

Friends and other neighbors: + {ourButton && + + } +

+
+ {friendButtons.map(button => { + const image = {button.name} - Children: - two + const preview = button.preview ? {button.name} : null - Capitalize name: - not unless we're at work -
+ if(button.url) + return ( + {image}{preview} + ) + else + return ( + {image}{preview} + ) + })} +