@atom63/create 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/README.md +70 -2
- package/package.json +27 -3
- package/src/generate.mjs +281 -0
- package/src/index.mjs +64 -0
- package/starter/app/AGENTS.md +17 -0
- package/starter/app/README.md +40 -0
- package/starter/app/src/app.ts +4 -0
- package/starter/app/src/components/app-layout.tsx +49 -0
- package/starter/app/src/components/appearance-settings.tsx +87 -0
- package/starter/app/src/pages/not-found.tsx +30 -0
- package/starter/app/src/router.tsx +79 -0
- package/starter/app/src/styles.css +31 -0
- package/starter/app/vite.config.ts +10 -0
- package/starter/base/_gitignore +4 -0
- package/starter/base/components.json +21 -0
- package/starter/base/index.html +12 -0
- package/starter/base/src/lib/utils.ts +7 -0
- package/starter/base/src/main.tsx +21 -0
- package/starter/base/src/theme.tsx +89 -0
- package/starter/base/tsconfig.json +21 -0
- package/starter/content/AGENTS.md +16 -0
- package/starter/content/README.md +35 -0
- package/starter/content/src/components/site-footer.tsx +9 -0
- package/starter/content/src/components/site-header.tsx +32 -0
- package/starter/content/src/mdx.d.ts +7 -0
- package/starter/content/src/styles.css +32 -0
- package/starter/content/vite.config.ts +25 -0
- package/starter/docs/src/components/docs-sidebar.tsx +35 -0
- package/starter/docs/src/content/docs/installation.mdx +22 -0
- package/starter/docs/src/content/docs/introduction.mdx +22 -0
- package/starter/docs/src/content/docs/writing-pages.mdx +36 -0
- package/starter/docs/src/content/docs.ts +60 -0
- package/starter/docs/src/pages/doc-page.tsx +57 -0
- package/starter/docs/src/pages/home.tsx +39 -0
- package/starter/docs/src/pages/not-found.tsx +30 -0
- package/starter/docs/src/router.tsx +86 -0
- package/starter/docs/src/site.ts +7 -0
- package/starter/portfolio/AGENTS.md +28 -0
- package/starter/portfolio/README.md +152 -0
- package/starter/portfolio/public/plates/hero.svg +40 -0
- package/starter/portfolio/public/projects/front-desk-scheduling/calendar.svg +30 -0
- package/starter/portfolio/public/projects/front-desk-scheduling/cover.svg +28 -0
- package/starter/portfolio/public/projects/ledger-design-system/cover.svg +13 -0
- package/starter/portfolio/public/projects/night-trip-planner/cover.svg +19 -0
- package/starter/portfolio/public/projects/night-trip-planner/flow.svg +34 -0
- package/starter/portfolio/src/components/mdx-components.tsx +25 -0
- package/starter/portfolio/src/components/project-card.tsx +32 -0
- package/starter/portfolio/src/components/site-footer.tsx +33 -0
- package/starter/portfolio/src/components/site-header.tsx +124 -0
- package/starter/portfolio/src/components/site-layout.tsx +62 -0
- package/starter/portfolio/src/content/projects/front-desk-scheduling.mdx +47 -0
- package/starter/portfolio/src/content/projects/ledger-design-system.mdx +40 -0
- package/starter/portfolio/src/content/projects/night-trip-planner.mdx +51 -0
- package/starter/portfolio/src/content/projects.ts +43 -0
- package/starter/portfolio/src/content/resume.ts +80 -0
- package/starter/portfolio/src/content/timeline.ts +69 -0
- package/starter/portfolio/src/content/writing/a-design-system-for-one.mdx +21 -0
- package/starter/portfolio/src/content/writing/case-studies-that-show-the-work.mdx +24 -0
- package/starter/portfolio/src/content/writing/designing-for-interruptions.mdx +23 -0
- package/starter/portfolio/src/content/writing.ts +37 -0
- package/starter/portfolio/src/modules/assistant/answers.ts +60 -0
- package/starter/portfolio/src/modules/assistant/assistant.tsx +107 -0
- package/starter/portfolio/src/modules/assistant/transport.ts +36 -0
- package/starter/portfolio/src/modules/dock/dock.tsx +141 -0
- package/starter/portfolio/src/modules/slides/decks.ts +49 -0
- package/starter/portfolio/src/modules/slides/slides-pages.tsx +128 -0
- package/starter/portfolio/src/modules/widgets/widget-board.tsx +121 -0
- package/starter/portfolio/src/pages/home.tsx +139 -0
- package/starter/portfolio/src/pages/not-found.tsx +30 -0
- package/starter/portfolio/src/pages/project-page.tsx +102 -0
- package/starter/portfolio/src/pages/projects-index.tsx +39 -0
- package/starter/portfolio/src/pages/resume.tsx +97 -0
- package/starter/portfolio/src/pages/timeline.tsx +89 -0
- package/starter/portfolio/src/pages/writing-index.tsx +64 -0
- package/starter/portfolio/src/pages/writing-post.tsx +43 -0
- package/starter/portfolio/src/portfolio.config.ts +88 -0
- package/starter/portfolio/src/router.tsx +113 -0
- package/starter/portfolio/src/styles.css +38 -0
- package/starter/site/src/content/blog/hello-world.mdx +25 -0
- package/starter/site/src/content/blog/writing-with-mdx.mdx +29 -0
- package/starter/site/src/content/posts.ts +37 -0
- package/starter/site/src/pages/blog-index.tsx +60 -0
- package/starter/site/src/pages/blog-post.tsx +43 -0
- package/starter/site/src/pages/home.tsx +143 -0
- package/starter/site/src/pages/not-found.tsx +30 -0
- package/starter/site/src/router.tsx +82 -0
- package/starter/site/src/site.ts +7 -0
- package/versions.json +27 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Case studies that show the work
|
|
3
|
+
description: A structure for portfolio case studies that hiring managers actually read to the end.
|
|
4
|
+
date: '2025-11-17'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
I review a lot of portfolios. The ones I remember answer four questions in order, and each project on this site follows them.
|
|
8
|
+
|
|
9
|
+
<Steps>
|
|
10
|
+
<Steps.Step title="Problem">Who struggled, with what, and how you knew. One paragraph, one number if you have it.</Steps.Step>
|
|
11
|
+
<Steps.Step title="Role">What you did, and what others did. "We" hides you.</Steps.Step>
|
|
12
|
+
<Steps.Step title="Process">Two or three decisions and why you made them, not every sticky note.</Steps.Step>
|
|
13
|
+
<Steps.Step title="Outcome">What changed for the people from the first step. Numbers, quotes, or an honest "we don't know yet".</Steps.Step>
|
|
14
|
+
</Steps>
|
|
15
|
+
|
|
16
|
+
## Media earns its place
|
|
17
|
+
|
|
18
|
+
Every image should prove something the text claims. A flow that shows the backwards planner is worth more than three hero mockups.
|
|
19
|
+
|
|
20
|
+
| Keep | Cut |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| The one screen that shows the decision | Device mockups on gradients |
|
|
23
|
+
| A before and after | Every iteration |
|
|
24
|
+
| A chart of the outcome | Logos of tools you used |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Designing for interruptions
|
|
3
|
+
description: What eleven clinic front desks taught me about screens that survive being left half-done.
|
|
4
|
+
date: '2026-02-08'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Most interfaces assume the person using them is paying attention. At a clinic front desk, nobody is: the phone rings, someone arrives, a nurse leans over the counter. I timed it once. A receptionist was interrupted every 90 seconds.
|
|
8
|
+
|
|
9
|
+
## Three rules I now start from
|
|
10
|
+
|
|
11
|
+
1. **Nothing is lost when someone looks away.** A half-filled form is a draft, not an error.
|
|
12
|
+
2. **The next action is always obvious.** After an interruption, the screen says where you were.
|
|
13
|
+
3. **No modal owns the screen.** A dialog that blocks the desk turns a phone call into a queue.
|
|
14
|
+
|
|
15
|
+
<Callout type="success">
|
|
16
|
+
None of this is specific to clinics. Support tools, dispatch consoles and kitchens all work this way.
|
|
17
|
+
</Callout>
|
|
18
|
+
|
|
19
|
+
> The best compliment I got was "I forgot it was new".
|
|
20
|
+
|
|
21
|
+
## What it changed
|
|
22
|
+
|
|
23
|
+
Booking time halved, but the number I care about more is the one we stopped hearing: "where was I?".
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ComponentType } from 'react'
|
|
2
|
+
|
|
3
|
+
export type Post = {
|
|
4
|
+
Content: ComponentType
|
|
5
|
+
date: string
|
|
6
|
+
description: string
|
|
7
|
+
slug: string
|
|
8
|
+
title: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type PostModule = {
|
|
12
|
+
default: ComponentType
|
|
13
|
+
frontmatter: { date: string; description: string; title: string }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Every `writing/*.mdx` file is a post; its file name is the slug. */
|
|
17
|
+
const modules = import.meta.glob<PostModule>('./writing/*.mdx', { eager: true })
|
|
18
|
+
|
|
19
|
+
export const posts: Post[] = Object.entries(modules)
|
|
20
|
+
.map(([path, module]) => ({
|
|
21
|
+
Content: module.default,
|
|
22
|
+
...module.frontmatter,
|
|
23
|
+
slug: path.slice(path.lastIndexOf('/') + 1, -'.mdx'.length),
|
|
24
|
+
}))
|
|
25
|
+
.sort((left, right) => right.date.localeCompare(left.date))
|
|
26
|
+
|
|
27
|
+
export function findPost(slug: string): Post | undefined {
|
|
28
|
+
return posts.find(post => post.slug === slug)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function formatDate(date: string): string {
|
|
32
|
+
return new Date(`${date}T00:00:00`).toLocaleDateString('en', {
|
|
33
|
+
day: 'numeric',
|
|
34
|
+
month: 'long',
|
|
35
|
+
year: 'numeric',
|
|
36
|
+
})
|
|
37
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { projects } from '../../content/projects'
|
|
2
|
+
import { resume } from '../../content/resume'
|
|
3
|
+
import { posts } from '../../content/writing'
|
|
4
|
+
import { portfolio } from '../../portfolio.config'
|
|
5
|
+
|
|
6
|
+
const { email, location, name, role } = portfolio.person
|
|
7
|
+
const firstName = name.split(' ')[0]
|
|
8
|
+
|
|
9
|
+
const has = (question: string, ...words: string[]) => words.some(word => question.includes(word))
|
|
10
|
+
|
|
11
|
+
/* Words too common to pick out one project. */
|
|
12
|
+
const common = new Set(['design', 'about', 'which', 'there', 'where', 'their'])
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The offline responder's brain: it answers from the site's own content, with
|
|
16
|
+
* no model and no API key. Replace the transport (see transport.ts) to answer
|
|
17
|
+
* with a real model instead; this file can then go.
|
|
18
|
+
*/
|
|
19
|
+
export function answerFromContent(rawQuestion: string): string {
|
|
20
|
+
const question = rawQuestion.toLowerCase()
|
|
21
|
+
|
|
22
|
+
const project = projects.find(item =>
|
|
23
|
+
item.title
|
|
24
|
+
.toLowerCase()
|
|
25
|
+
.split(/\W+/)
|
|
26
|
+
.some(word => word.length > 4 && !common.has(word) && question.includes(word))
|
|
27
|
+
)
|
|
28
|
+
if (project) {
|
|
29
|
+
return `${project.title} (${project.timeline}). ${project.summary} ${firstName} was ${project.role.toLowerCase()}, with ${project.team}. The case study is at /projects/${project.slug}.`
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (has(question, 'contact', 'email', 'hire', 'reach', 'touch', 'available')) {
|
|
33
|
+
return `The best way to reach ${firstName} is by email: ${email}. ${firstName} is based in ${location}.`
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (has(question, 'project', 'work', 'portfolio', 'case stud', 'built', 'shipped')) {
|
|
37
|
+
const list = projects.map(item => `• ${item.title}: ${item.summary}`).join('\n')
|
|
38
|
+
return `${firstName} has ${projects.length} case studies here:\n${list}\nAsk about any of them for more.`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (has(question, 'experience', 'resume', 'cv', 'job', 'career', 'company', 'role')) {
|
|
42
|
+
const roles = resume.experience.map(item => `• ${item.title} at ${item.company}`).join('\n')
|
|
43
|
+
return `${resume.summary}\n${roles}\nThe full resume is at /resume.`
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (has(question, 'skill', 'tool', 'stack', 'good at')) {
|
|
47
|
+
return `${firstName}'s skills: ${resume.skills.join(', ')}.`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (has(question, 'writ', 'blog', 'post', 'article')) {
|
|
51
|
+
const list = posts.map(post => `• ${post.title}: ${post.description}`).join('\n')
|
|
52
|
+
return `Recent writing:\n${list}\nAll posts are at /writing.`
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (has(question, 'who', 'about', 'yourself', 'hello', 'hi ')) {
|
|
56
|
+
return `${name} is a ${role.toLowerCase()} based in ${location}. ${portfolio.person.intro}`
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return `I answer from this site's content, so I know about ${firstName}'s projects, experience, skills, writing and how to get in touch. Try one of those.`
|
|
60
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { createAgentRuntime, getMessageText } from '@atom63/agent'
|
|
2
|
+
import { useOwnedAgentRuntime } from '@atom63/agent/react'
|
|
3
|
+
import { Sheet, SheetContent } from '@atom63/ui-react'
|
|
4
|
+
import {
|
|
5
|
+
createContext,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
useContext,
|
|
8
|
+
useMemo,
|
|
9
|
+
useState,
|
|
10
|
+
useSyncExternalStore,
|
|
11
|
+
} from 'react'
|
|
12
|
+
|
|
13
|
+
import { portfolio } from '../../portfolio.config'
|
|
14
|
+
import { ChatPanel } from '../../templates/blocks/chat-panel/chat-panel'
|
|
15
|
+
import { transport } from './transport'
|
|
16
|
+
|
|
17
|
+
type AssistantState = { open: () => void }
|
|
18
|
+
|
|
19
|
+
const AssistantContext = createContext<AssistantState | null>(null)
|
|
20
|
+
|
|
21
|
+
/** Opens the assistant; null when the module is off. */
|
|
22
|
+
export function useAssistant(): AssistantState | null {
|
|
23
|
+
return useContext(AssistantContext)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const firstName = portfolio.person.name.split(' ')[0]
|
|
27
|
+
|
|
28
|
+
const suggestions = [
|
|
29
|
+
`What has ${firstName} worked on?`,
|
|
30
|
+
'Tell me about the trip planner',
|
|
31
|
+
'How do I get in touch?',
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* The conversation, on the right edge. The runtime lives in the site layout,
|
|
36
|
+
* so it survives navigation; the chat panel block draws it, and this maps the
|
|
37
|
+
* runtime's state onto the panel's props.
|
|
38
|
+
*/
|
|
39
|
+
function AssistantSheet({
|
|
40
|
+
onOpenChange,
|
|
41
|
+
open,
|
|
42
|
+
runtime,
|
|
43
|
+
}: {
|
|
44
|
+
onOpenChange: (open: boolean) => void
|
|
45
|
+
open: boolean
|
|
46
|
+
runtime: ReturnType<typeof createAgentRuntime>
|
|
47
|
+
}) {
|
|
48
|
+
const state = useSyncExternalStore(runtime.subscribe, runtime.getState)
|
|
49
|
+
const messages = state.messages.flatMap(message =>
|
|
50
|
+
message.role === 'system'
|
|
51
|
+
? []
|
|
52
|
+
: [
|
|
53
|
+
{
|
|
54
|
+
from: message.role,
|
|
55
|
+
id: message.id,
|
|
56
|
+
streaming: message.status === 'streaming',
|
|
57
|
+
text:
|
|
58
|
+
message.status === 'error'
|
|
59
|
+
? (message.error?.message ?? 'Something went wrong.')
|
|
60
|
+
: getMessageText(message),
|
|
61
|
+
},
|
|
62
|
+
]
|
|
63
|
+
)
|
|
64
|
+
const status =
|
|
65
|
+
state.status === 'submitted' || state.status === 'streaming' ? state.status : 'idle'
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Sheet onOpenChange={onOpenChange} open={open}>
|
|
69
|
+
<SheetContent aria-label="Assistant" className="p-0" showCloseButton={false} side="right">
|
|
70
|
+
<ChatPanel
|
|
71
|
+
attach={<></>}
|
|
72
|
+
disclaimer="Answers come from this site's content."
|
|
73
|
+
greeting={`Ask about ${firstName}'s work`}
|
|
74
|
+
messages={messages}
|
|
75
|
+
onClose={() => onOpenChange(false)}
|
|
76
|
+
onNewChat={() => runtime.clear()}
|
|
77
|
+
onSend={text => void runtime.send({ text })}
|
|
78
|
+
onStop={() => runtime.stop()}
|
|
79
|
+
status={status}
|
|
80
|
+
suggestions={suggestions}
|
|
81
|
+
title="Assistant"
|
|
82
|
+
/>
|
|
83
|
+
</SheetContent>
|
|
84
|
+
</Sheet>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** The site assistant: a runtime from @atom63/agent and a sheet to talk to it in. */
|
|
89
|
+
export function AssistantProvider({ children }: { children: ReactNode }) {
|
|
90
|
+
const [open, setOpen] = useState(false)
|
|
91
|
+
const runtime = useOwnedAgentRuntime(() =>
|
|
92
|
+
createAgentRuntime({
|
|
93
|
+
getSystemPrompt: () =>
|
|
94
|
+
`You answer visitors' questions about ${portfolio.person.name}, a ${portfolio.person.role}, from their portfolio.`,
|
|
95
|
+
historyLimit: 12,
|
|
96
|
+
transport,
|
|
97
|
+
})
|
|
98
|
+
)
|
|
99
|
+
const value = useMemo(() => ({ open: () => setOpen(true) }), [])
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<AssistantContext.Provider value={value}>
|
|
103
|
+
{children}
|
|
104
|
+
<AssistantSheet onOpenChange={setOpen} open={open} runtime={runtime} />
|
|
105
|
+
</AssistantContext.Provider>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AgentTransport } from '@atom63/agent'
|
|
2
|
+
|
|
3
|
+
import { answerFromContent } from './answers'
|
|
4
|
+
|
|
5
|
+
const wait = (ms: number, signal: AbortSignal) =>
|
|
6
|
+
new Promise<void>(resolve => {
|
|
7
|
+
const timer = setTimeout(resolve, ms)
|
|
8
|
+
signal.addEventListener('abort', () => {
|
|
9
|
+
clearTimeout(timer)
|
|
10
|
+
resolve()
|
|
11
|
+
})
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The offline transport: it answers from the site's content (answers.ts) and
|
|
16
|
+
* streams the reply word by word, the way a model would. It needs no network
|
|
17
|
+
* and no API key.
|
|
18
|
+
*
|
|
19
|
+
* To use a real model, replace it with a transport that calls your own
|
|
20
|
+
* server (never put an API key in the browser). The README has an example.
|
|
21
|
+
*/
|
|
22
|
+
export const offlineTransport: AgentTransport = {
|
|
23
|
+
async *stream(request, { signal }) {
|
|
24
|
+
const question = request.messages.filter(message => message.role === 'user').at(-1)
|
|
25
|
+
yield { runId: request.runId, type: 'response-start' }
|
|
26
|
+
for (const word of answerFromContent(question?.content ?? '').split(/(?<=\s)/)) {
|
|
27
|
+
if (signal.aborted) return
|
|
28
|
+
await wait(24, signal)
|
|
29
|
+
yield { delta: word, runId: request.runId, type: 'text-delta' }
|
|
30
|
+
}
|
|
31
|
+
yield { runId: request.runId, type: 'finish' }
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The transport the assistant uses. Swap it here. */
|
|
36
|
+
export const transport: AgentTransport = offlineTransport
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Field,
|
|
4
|
+
FieldDescription,
|
|
5
|
+
FieldLabel,
|
|
6
|
+
Popover,
|
|
7
|
+
PopoverContent,
|
|
8
|
+
PopoverHeader,
|
|
9
|
+
PopoverTitle,
|
|
10
|
+
PopoverTrigger,
|
|
11
|
+
Separator,
|
|
12
|
+
Textarea,
|
|
13
|
+
} from '@atom63/ui-react'
|
|
14
|
+
import { Link } from '@tanstack/react-router'
|
|
15
|
+
import { Clock, FileText, FolderOpen, House, NotebookPen, PenLine, Route } from 'lucide-react'
|
|
16
|
+
import { type ReactNode, useEffect, useId, useState } from 'react'
|
|
17
|
+
|
|
18
|
+
import { portfolio } from '../../portfolio.config'
|
|
19
|
+
|
|
20
|
+
const notesKey = 'portfolio-notes'
|
|
21
|
+
|
|
22
|
+
const dockLinks = [
|
|
23
|
+
{ icon: <House aria-hidden />, label: 'Home', to: '/' },
|
|
24
|
+
{ icon: <FolderOpen aria-hidden />, label: 'Projects', to: '/projects' },
|
|
25
|
+
{ icon: <PenLine aria-hidden />, label: 'Writing', to: '/writing' },
|
|
26
|
+
{ icon: <Route aria-hidden />, label: 'Timeline', to: '/timeline' },
|
|
27
|
+
{ icon: <FileText aria-hidden />, label: 'Resume', to: '/resume' },
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
/** A mini app: a dock button that opens a small window above the dock. */
|
|
31
|
+
function MiniApp({
|
|
32
|
+
children,
|
|
33
|
+
icon,
|
|
34
|
+
title,
|
|
35
|
+
}: {
|
|
36
|
+
children: ReactNode
|
|
37
|
+
icon: ReactNode
|
|
38
|
+
title: string
|
|
39
|
+
}) {
|
|
40
|
+
return (
|
|
41
|
+
<Popover>
|
|
42
|
+
<PopoverTrigger
|
|
43
|
+
render={
|
|
44
|
+
<Button aria-label={title} size="icon" tone="muted" variant="ghost">
|
|
45
|
+
{icon}
|
|
46
|
+
</Button>
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
<PopoverContent side="top" sideOffset={12}>
|
|
50
|
+
<PopoverHeader>
|
|
51
|
+
<PopoverTitle>{title}</PopoverTitle>
|
|
52
|
+
</PopoverHeader>
|
|
53
|
+
{children}
|
|
54
|
+
</PopoverContent>
|
|
55
|
+
</Popover>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Mini app: the time where you are and where the visitor is. */
|
|
60
|
+
function ClockApp() {
|
|
61
|
+
const [now, setNow] = useState(() => new Date())
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const timer = setInterval(() => setNow(new Date()), 1000)
|
|
64
|
+
return () => clearInterval(timer)
|
|
65
|
+
}, [])
|
|
66
|
+
const time = (timeZone?: string) =>
|
|
67
|
+
now.toLocaleTimeString('en', { hour: '2-digit', minute: '2-digit', timeZone })
|
|
68
|
+
return (
|
|
69
|
+
<dl className="grid grid-cols-2 gap-4">
|
|
70
|
+
<div>
|
|
71
|
+
<dt className="text-muted-foreground text-xs">{portfolio.person.name.split(' ')[0]}</dt>
|
|
72
|
+
<dd className="text-foreground text-2xl font-semibold tabular-nums">
|
|
73
|
+
{time(portfolio.person.timeZone)}
|
|
74
|
+
</dd>
|
|
75
|
+
</div>
|
|
76
|
+
<div>
|
|
77
|
+
<dt className="text-muted-foreground text-xs">You</dt>
|
|
78
|
+
<dd className="text-foreground text-2xl font-semibold tabular-nums">{time()}</dd>
|
|
79
|
+
</div>
|
|
80
|
+
</dl>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Mini app: a notepad kept in this browser. */
|
|
85
|
+
function NotesApp() {
|
|
86
|
+
const id = useId()
|
|
87
|
+
const [text, setText] = useState(() => {
|
|
88
|
+
try {
|
|
89
|
+
return localStorage.getItem(notesKey) ?? ''
|
|
90
|
+
} catch {
|
|
91
|
+
return ''
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
try {
|
|
96
|
+
localStorage.setItem(notesKey, text)
|
|
97
|
+
} catch {
|
|
98
|
+
// Storage can be blocked; the note then lasts for the visit.
|
|
99
|
+
}
|
|
100
|
+
}, [text])
|
|
101
|
+
return (
|
|
102
|
+
<Field>
|
|
103
|
+
<FieldLabel htmlFor={id}>Notes</FieldLabel>
|
|
104
|
+
<Textarea id={id} onChange={event => setText(event.target.value)} rows={5} value={text} />
|
|
105
|
+
<FieldDescription>Kept in this browser only.</FieldDescription>
|
|
106
|
+
</Field>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The bottom dock: the site's sections and two mini apps, always in reach.
|
|
112
|
+
* Add a mini app with another <MiniApp>.
|
|
113
|
+
*/
|
|
114
|
+
export function Dock() {
|
|
115
|
+
return (
|
|
116
|
+
<nav
|
|
117
|
+
aria-label="Dock"
|
|
118
|
+
className="bg-popover fixed inset-x-0 bottom-4 z-40 mx-auto flex w-fit max-w-[calc(100%-2rem)] items-center gap-1 overflow-x-auto rounded-2xl p-1.5 shadow-lg print:hidden"
|
|
119
|
+
>
|
|
120
|
+
{dockLinks.map(link => (
|
|
121
|
+
<Button
|
|
122
|
+
aria-label={link.label}
|
|
123
|
+
key={link.to}
|
|
124
|
+
render={<Link to={link.to} />}
|
|
125
|
+
size="icon"
|
|
126
|
+
tone="muted"
|
|
127
|
+
variant="ghost"
|
|
128
|
+
>
|
|
129
|
+
{link.icon}
|
|
130
|
+
</Button>
|
|
131
|
+
))}
|
|
132
|
+
<Separator className="mx-1 h-6" orientation="vertical" />
|
|
133
|
+
<MiniApp icon={<Clock aria-hidden />} title="Clock">
|
|
134
|
+
<ClockApp />
|
|
135
|
+
</MiniApp>
|
|
136
|
+
<MiniApp icon={<NotebookPen aria-hidden />} title="Notes">
|
|
137
|
+
<NotesApp />
|
|
138
|
+
</MiniApp>
|
|
139
|
+
</nav>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** A talk or a deck: slides with a title and a few points each. Sample content. */
|
|
2
|
+
export type Deck = {
|
|
3
|
+
date: string
|
|
4
|
+
description: string
|
|
5
|
+
slides: { points: string[]; title: string }[]
|
|
6
|
+
slug: string
|
|
7
|
+
title: string
|
|
8
|
+
venue: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const decks: Deck[] = [
|
|
12
|
+
{
|
|
13
|
+
slug: 'planning-backwards',
|
|
14
|
+
title: 'Planning backwards',
|
|
15
|
+
description: 'How a night trip planner learned to start from "home by".',
|
|
16
|
+
date: '2025-10-14',
|
|
17
|
+
venue: 'Regional transport design meetup',
|
|
18
|
+
slides: [
|
|
19
|
+
{
|
|
20
|
+
title: 'Planning backwards',
|
|
21
|
+
points: ['Designing a trip planner for the night network', 'Rowan Vale'],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: 'The question riders ask',
|
|
25
|
+
points: [
|
|
26
|
+
'Not "when is the next bus?"',
|
|
27
|
+
'But "can I still get home, and when must I leave?"',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'What we learned on eight night shifts',
|
|
32
|
+
points: [
|
|
33
|
+
'Riders plan from the last bus, not the next one',
|
|
34
|
+
'Walking time is the part people get wrong',
|
|
35
|
+
'Drivers know which stops feel unsafe',
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'What changed',
|
|
40
|
+
points: ['Missed connections fell by a third', '48,000 night trips planned a month'],
|
|
41
|
+
},
|
|
42
|
+
{ title: 'Thank you', points: ['hello@rowanvale.example'] },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
export function findDeck(slug: string): Deck | undefined {
|
|
48
|
+
return decks.find(deck => deck.slug === slug)
|
|
49
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardLabel,
|
|
7
|
+
CardTitle,
|
|
8
|
+
cardLinkClassName,
|
|
9
|
+
Progress,
|
|
10
|
+
} from '@atom63/ui-react'
|
|
11
|
+
import { Container, Page, Section, SectionHeader } from '@atom63/ui-react/layout'
|
|
12
|
+
import { Link, useParams } from '@tanstack/react-router'
|
|
13
|
+
import { ArrowLeft, ChevronLeft, ChevronRight } from 'lucide-react'
|
|
14
|
+
import { useEffect, useState } from 'react'
|
|
15
|
+
|
|
16
|
+
import { formatDate } from '../../content/writing'
|
|
17
|
+
import { NotFoundPage } from '../../pages/not-found'
|
|
18
|
+
import { decks, findDeck } from './decks'
|
|
19
|
+
|
|
20
|
+
export function SlidesIndexPage() {
|
|
21
|
+
return (
|
|
22
|
+
<Page>
|
|
23
|
+
<Container maxWidth="default">
|
|
24
|
+
<Section removeTopSpacing>
|
|
25
|
+
<SectionHeader description="Talks and the decks behind them." level={1} title="Slides" />
|
|
26
|
+
<ul className="mt-8 grid gap-4 md:grid-cols-2">
|
|
27
|
+
{decks.map(deck => (
|
|
28
|
+
<li key={deck.slug}>
|
|
29
|
+
<Link className={cardLinkClassName} params={{ slug: deck.slug }} to="/slides/$slug">
|
|
30
|
+
<Card className="h-full" variant="interactive">
|
|
31
|
+
<CardContent>
|
|
32
|
+
<CardLabel className="text-muted-foreground">
|
|
33
|
+
{formatDate(deck.date)} · {deck.venue}
|
|
34
|
+
</CardLabel>
|
|
35
|
+
<CardTitle>{deck.title}</CardTitle>
|
|
36
|
+
<CardDescription>{deck.description}</CardDescription>
|
|
37
|
+
</CardContent>
|
|
38
|
+
</Card>
|
|
39
|
+
</Link>
|
|
40
|
+
</li>
|
|
41
|
+
))}
|
|
42
|
+
</ul>
|
|
43
|
+
</Section>
|
|
44
|
+
</Container>
|
|
45
|
+
</Page>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** One deck, a slide at a time. The arrow keys move between slides. */
|
|
50
|
+
export function SlideDeckPage() {
|
|
51
|
+
const { slug } = useParams({ from: '/site/slides/$slug' })
|
|
52
|
+
const deck = findDeck(slug)
|
|
53
|
+
const [index, setIndex] = useState(0)
|
|
54
|
+
const count = deck?.slides.length ?? 0
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const onKey = (event: KeyboardEvent) => {
|
|
58
|
+
if (event.target instanceof HTMLElement && event.target.closest('input, textarea')) return
|
|
59
|
+
if (event.key === 'ArrowRight') setIndex(current => Math.min(current + 1, count - 1))
|
|
60
|
+
if (event.key === 'ArrowLeft') setIndex(current => Math.max(current - 1, 0))
|
|
61
|
+
}
|
|
62
|
+
window.addEventListener('keydown', onKey)
|
|
63
|
+
return () => window.removeEventListener('keydown', onKey)
|
|
64
|
+
}, [count])
|
|
65
|
+
|
|
66
|
+
if (!deck) return <NotFoundPage />
|
|
67
|
+
const slide = deck.slides[index]
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Page>
|
|
71
|
+
<Container maxWidth="default">
|
|
72
|
+
<Section removeTopSpacing>
|
|
73
|
+
<Button render={<Link to="/slides" />} size="sm" tone="muted" variant="ghost">
|
|
74
|
+
<ArrowLeft aria-hidden />
|
|
75
|
+
All slides
|
|
76
|
+
</Button>
|
|
77
|
+
<SectionHeader className="mt-4" level={1} title={deck.title} variant="secondary" />
|
|
78
|
+
<Card className="mt-6" variant="filled">
|
|
79
|
+
<section
|
|
80
|
+
aria-label={`Slide ${index + 1} of ${count}`}
|
|
81
|
+
aria-live="polite"
|
|
82
|
+
className="flex aspect-video flex-col justify-center gap-6 p-8 md:p-16"
|
|
83
|
+
>
|
|
84
|
+
<h2 className="font-heading text-foreground text-2xl font-semibold text-balance md:text-5xl">
|
|
85
|
+
{slide.title}
|
|
86
|
+
</h2>
|
|
87
|
+
<ul className="text-muted-foreground grid gap-2 text-base md:text-2xl">
|
|
88
|
+
{slide.points.map(point => (
|
|
89
|
+
<li key={point}>{point}</li>
|
|
90
|
+
))}
|
|
91
|
+
</ul>
|
|
92
|
+
</section>
|
|
93
|
+
</Card>
|
|
94
|
+
<div className="mt-4 flex items-center gap-3">
|
|
95
|
+
<Button
|
|
96
|
+
aria-label="Previous slide"
|
|
97
|
+
disabled={index === 0}
|
|
98
|
+
onClick={() => setIndex(index - 1)}
|
|
99
|
+
size="icon-sm"
|
|
100
|
+
variant="outline"
|
|
101
|
+
>
|
|
102
|
+
<ChevronLeft aria-hidden />
|
|
103
|
+
</Button>
|
|
104
|
+
<Button
|
|
105
|
+
aria-label="Next slide"
|
|
106
|
+
disabled={index === count - 1}
|
|
107
|
+
onClick={() => setIndex(index + 1)}
|
|
108
|
+
size="icon-sm"
|
|
109
|
+
variant="outline"
|
|
110
|
+
>
|
|
111
|
+
<ChevronRight aria-hidden />
|
|
112
|
+
</Button>
|
|
113
|
+
<Progress
|
|
114
|
+
aria-label="Slide progress"
|
|
115
|
+
className="flex-1"
|
|
116
|
+
max={count}
|
|
117
|
+
tone="neutral"
|
|
118
|
+
value={index + 1}
|
|
119
|
+
/>
|
|
120
|
+
<span className="text-muted-foreground text-sm tabular-nums">
|
|
121
|
+
{index + 1} / {count}
|
|
122
|
+
</span>
|
|
123
|
+
</div>
|
|
124
|
+
</Section>
|
|
125
|
+
</Container>
|
|
126
|
+
</Page>
|
|
127
|
+
)
|
|
128
|
+
}
|