@open-slide/core 1.18.0 → 1.19.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.
Files changed (61) hide show
  1. package/dist/{build-DaL4Gjn-.js → build-CaV_vhIw.js} +1 -1
  2. package/dist/cli/bin.js +3 -3
  3. package/dist/{config-CYs4WJfL.d.ts → config-CDHB8Oow.d.ts} +2 -1
  4. package/dist/{config-CCHio3pk.js → config-GA6NMgs_.js} +1 -0
  5. package/dist/{dev-DLRQoCkT.js → dev-D57ui2yV.js} +1 -1
  6. package/dist/{format-CxPnpVRu.js → format-74A3B6zu.js} +16 -4
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +1 -1
  9. package/dist/locale/index.d.ts +1 -1
  10. package/dist/locale/index.js +1 -1
  11. package/dist/{preview-D3qVGc0S.js → preview-D40Zw_o0.js} +1 -1
  12. package/dist/{types-Wz88-Fe1.d.ts → types-8HghULIe.d.ts} +3 -0
  13. package/dist/vite/index.d.ts +2 -2
  14. package/dist/vite/index.js +1 -1
  15. package/package.json +2 -2
  16. package/src/app/app.tsx +20 -15
  17. package/src/app/components/asset-view.tsx +38 -23
  18. package/src/app/components/command/command-menu.tsx +5 -1
  19. package/src/app/components/command/command.tsx +4 -2
  20. package/src/app/components/icon-tooltip.tsx +24 -15
  21. package/src/app/components/inspector/asset-picker-dialog.tsx +18 -16
  22. package/src/app/components/inspector/comment-widget.tsx +33 -7
  23. package/src/app/components/inspector/image-crop-dialog.tsx +8 -2
  24. package/src/app/components/inspector/inspect-overlay.tsx +5 -4
  25. package/src/app/components/inspector/inspector-panel.tsx +15 -5
  26. package/src/app/components/language-toggle.tsx +2 -3
  27. package/src/app/components/notes-drawer.tsx +3 -3
  28. package/src/app/components/overview-grid.tsx +10 -4
  29. package/src/app/components/panel/panel-shell.tsx +1 -1
  30. package/src/app/components/panel/save-card.tsx +12 -3
  31. package/src/app/components/pdf-progress-toast.tsx +7 -3
  32. package/src/app/components/player.tsx +8 -1
  33. package/src/app/components/pptx-progress-toast.tsx +7 -3
  34. package/src/app/components/present/blackout-overlay.tsx +16 -3
  35. package/src/app/components/present/control-bar.tsx +17 -9
  36. package/src/app/components/present/jump-input.tsx +24 -3
  37. package/src/app/components/present/laser-pointer.tsx +34 -11
  38. package/src/app/components/present/progress-bar.tsx +1 -1
  39. package/src/app/components/present/use-presenter-channel.ts +2 -1
  40. package/src/app/components/present/use-touch-swipe.ts +9 -2
  41. package/src/app/components/sidebar/folder-item.tsx +9 -5
  42. package/src/app/components/sidebar/icon-picker.tsx +1 -1
  43. package/src/app/components/sidebar/sidebar-footer.tsx +13 -6
  44. package/src/app/components/sidebar/sidebar.tsx +2 -2
  45. package/src/app/components/style-panel/style-panel.tsx +16 -12
  46. package/src/app/components/theme-toggle.tsx +4 -5
  47. package/src/app/components/themes/theme-detail.tsx +8 -5
  48. package/src/app/components/themes/themes-gallery.tsx +3 -3
  49. package/src/app/components/thumbnail-rail.tsx +7 -3
  50. package/src/app/index.html +21 -0
  51. package/src/app/lib/export-html.ts +15 -2
  52. package/src/app/routes/home-shell.tsx +1 -1
  53. package/src/app/routes/home.tsx +10 -7
  54. package/src/app/routes/presenter.tsx +216 -9
  55. package/src/app/routes/slide.tsx +66 -23
  56. package/src/app/styles.css +7 -0
  57. package/src/locale/en.ts +3 -0
  58. package/src/locale/ja.ts +3 -0
  59. package/src/locale/types.ts +3 -0
  60. package/src/locale/zh-cn.ts +3 -0
  61. package/src/locale/zh-tw.ts +3 -0
@@ -158,13 +158,13 @@ export function FolderItem({
158
158
  // biome-ignore lint/a11y/noStaticElementInteractions: drag-and-drop target wraps interactive children
159
159
  <div
160
160
  className={cn(
161
- 'group relative flex items-center gap-2.5 rounded-[5px] px-2 py-[5px] text-[12.5px] transition-colors',
161
+ 'group relative flex items-center gap-2.5 rounded-[5px] px-2 py-[5px] text-[12.5px] transition-[background-color,color,scale] duration-150',
162
162
  selected
163
163
  ? 'bg-muted text-foreground before:absolute before:inset-y-1.5 before:-left-0.5 before:w-[2px] before:rounded-full before:bg-brand'
164
164
  : 'text-foreground/70 hover:bg-muted/60 hover:text-foreground',
165
165
  slideDragActive && acceptsSlideDrop && !dragOver && 'ring-1 ring-foreground/10',
166
166
  dragOver &&
167
- 'bg-brand/10 text-foreground ring-1 ring-brand ring-offset-1 ring-offset-sidebar motion-safe:scale-[1.01] motion-safe:transition-transform',
167
+ 'bg-brand/10 text-foreground ring-1 ring-brand ring-offset-1 ring-offset-sidebar motion-safe:scale-[1.01]',
168
168
  )}
169
169
  onDragEnter={handleDragEnter}
170
170
  onDragOver={handleDragOver}
@@ -177,7 +177,7 @@ export function FolderItem({
177
177
  render={
178
178
  <button
179
179
  type="button"
180
- className="flex size-5 shrink-0 items-center justify-center rounded transition-transform hover:scale-110"
180
+ className="flex size-5 shrink-0 items-center justify-center rounded outline-none motion-safe:transition-transform motion-safe:duration-150 hover:scale-110 active:scale-95 focus-visible:ring-1 focus-visible:ring-brand"
181
181
  aria-label={t.home.changeIcon}
182
182
  onClick={(e) => e.stopPropagation()}
183
183
  >
@@ -217,7 +217,11 @@ export function FolderItem({
217
217
  className="min-w-0 flex-1 rounded-[3px] bg-card px-1 text-[12.5px] outline-none ring-1 ring-foreground/20"
218
218
  />
219
219
  ) : (
220
- <button type="button" onClick={onSelect} className="min-w-0 flex-1 truncate text-left">
220
+ <button
221
+ type="button"
222
+ onClick={onSelect}
223
+ className="min-w-0 flex-1 truncate rounded-[3px] text-left outline-none focus-visible:ring-1 focus-visible:ring-brand"
224
+ >
221
225
  {label}
222
226
  </button>
223
227
  )}
@@ -240,7 +244,7 @@ export function FolderItem({
240
244
  <button
241
245
  type="button"
242
246
  onClick={(e) => e.stopPropagation()}
243
- className="absolute right-2 top-1/2 size-5 -translate-y-1/2 rounded opacity-0 transition-opacity hover:bg-foreground/10 group-hover:opacity-100 aria-expanded:opacity-100"
247
+ className="absolute right-2 top-1/2 size-5 -translate-y-1/2 rounded opacity-0 outline-none transition-opacity duration-150 hover:bg-foreground/10 group-hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-1 focus-visible:ring-brand aria-expanded:opacity-100"
244
248
  aria-label={t.home.folderActions}
245
249
  >
246
250
  <MoreHorizontal className="mx-auto size-3.5" />
@@ -49,7 +49,7 @@ export function IconPicker({
49
49
  key={c}
50
50
  type="button"
51
51
  onClick={() => onChange({ type: 'color', value: c })}
52
- className="size-6 rounded-[4px] ring-1 ring-foreground/10 shadow-[inset_0_1px_0_oklch(1_0_0/0.18)] transition-transform hover:scale-110"
52
+ className="size-6 rounded-[4px] ring-1 ring-foreground/10 shadow-[inset_0_1px_0_oklch(1_0_0/0.18)] outline-none motion-safe:transition-transform motion-safe:duration-100 hover:scale-110 active:scale-95 focus-visible:ring-2 focus-visible:ring-brand"
53
53
  style={{ background: c }}
54
54
  aria-label={c}
55
55
  />
@@ -53,11 +53,18 @@ export function SidebarFooter() {
53
53
  }
54
54
  }
55
55
 
56
- const versionRow = (
57
- <span className="inline-flex cursor-default items-center gap-1.5">
58
- {update?.latest && <span className="size-1.5 rounded-full bg-brand" aria-hidden />}
56
+ const versionRow = update?.latest ? (
57
+ // Real button: the tooltip holds actionable controls, so keyboard users
58
+ // must be able to reach and open it.
59
+ <button
60
+ type="button"
61
+ className="inline-flex cursor-default items-center gap-1.5 rounded-[3px] outline-none focus-visible:ring-1 focus-visible:ring-brand"
62
+ >
63
+ <span className="size-1.5 rounded-full bg-brand" aria-hidden />
59
64
  {label}
60
- </span>
65
+ </button>
66
+ ) : (
67
+ <span className="inline-flex cursor-default items-center gap-1.5">{label}</span>
61
68
  );
62
69
 
63
70
  return (
@@ -93,7 +100,7 @@ export function SidebarFooter() {
93
100
  onClick={restartServer}
94
101
  >
95
102
  {restarting ? (
96
- <Loader2 className="animate-spin" aria-hidden />
103
+ <Loader2 className="animate-spin motion-reduce:animate-none" aria-hidden />
97
104
  ) : (
98
105
  <RotateCw aria-hidden />
99
106
  )}
@@ -115,7 +122,7 @@ export function SidebarFooter() {
115
122
  onClick={updatePackage}
116
123
  >
117
124
  {isUpdating ? (
118
- <Loader2 className="animate-spin" aria-hidden />
125
+ <Loader2 className="animate-spin motion-reduce:animate-none" aria-hidden />
119
126
  ) : (
120
127
  <RefreshCw aria-hidden />
121
128
  )}
@@ -257,7 +257,7 @@ export function Sidebar({
257
257
  render={
258
258
  <button
259
259
  type="button"
260
- className="flex size-5 shrink-0 items-center justify-center rounded transition-transform hover:scale-110"
260
+ className="flex size-5 shrink-0 items-center justify-center rounded outline-none motion-safe:transition-transform motion-safe:duration-150 hover:scale-110 active:scale-95 focus-visible:ring-1 focus-visible:ring-brand"
261
261
  aria-label={t.home.pickIcon}
262
262
  >
263
263
  <FolderIconChip icon={newIcon} />
@@ -286,7 +286,7 @@ export function Sidebar({
286
286
  <button
287
287
  type="button"
288
288
  onClick={startCreating}
289
- className="mt-1 flex w-full items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground"
289
+ className="mt-1 flex w-full items-center gap-2 rounded-[5px] px-2 py-1.5 text-[12px] text-muted-foreground outline-none transition-[background-color,color,scale] duration-100 hover:bg-muted/60 hover:text-foreground active:scale-[0.98] focus-visible:ring-1 focus-visible:ring-brand"
290
290
  >
291
291
  <Plus className="size-3.5" />
292
292
  <span>{t.home.newFolder}</span>
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
3
3
  import { Field, NumberField, Section } from '@/components/panel/panel-fields';
4
4
  import { PanelShell, usePanelMount } from '@/components/panel/panel-shell';
5
5
  import { useLocale } from '@/lib/use-locale';
6
+ import { cn } from '@/lib/utils';
6
7
  import { Button } from '../ui/button';
7
8
  import { Input } from '../ui/input';
8
9
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select';
@@ -29,12 +30,14 @@ type DesignPanelProps = {
29
30
 
30
31
  export function DesignPanel({ open, onClose }: DesignPanelProps) {
31
32
  const { draft, exists, warning, loaded, dirty, update, shuffle } = useDesignPanelState();
32
- const { mounted, animVisible } = usePanelMount(open);
33
+ // Gate the mount on data readiness so the first open still slides in
34
+ // instead of popping fully expanded once loading finishes.
35
+ const ready = loaded && draft != null;
36
+ const { mounted, animVisible } = usePanelMount(open && ready);
33
37
  const t = useLocale();
34
38
 
35
- if (!loaded) return null;
39
+ if (!ready) return null;
36
40
  if (!mounted) return null;
37
- if (!draft) return null;
38
41
 
39
42
  return (
40
43
  <PanelShell
@@ -52,13 +55,14 @@ export function DesignPanel({ open, onClose }: DesignPanelProps) {
52
55
  {t.stylePanel.draftBadge}
53
56
  </span>
54
57
  )}
55
- {dirty && (
56
- <span
57
- className="size-1.5 rounded-full bg-brand"
58
- title={t.stylePanel.unsavedTitle}
59
- aria-hidden
60
- />
61
- )}
58
+ <span
59
+ className={cn(
60
+ 'size-1.5 rounded-full bg-brand transition-opacity duration-150',
61
+ dirty ? 'opacity-100' : 'opacity-0',
62
+ )}
63
+ title={dirty ? t.stylePanel.unsavedTitle : undefined}
64
+ aria-hidden
65
+ />
62
66
  </div>
63
67
  <div className="flex items-center gap-0.5">
64
68
  <Button
@@ -232,7 +236,7 @@ function ColorField({
232
236
 
233
237
  return (
234
238
  <Field label={label}>
235
- <label className="relative inline-flex size-8 shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-md border bg-background shadow-xs">
239
+ <label className="relative inline-flex size-8 shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-md border bg-background shadow-xs transition-[border-color,scale] duration-150 hover:border-foreground/20 active:scale-[0.96] has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/40">
236
240
  <span className="size-5 rounded-sm" style={{ backgroundColor: value }} />
237
241
  <input
238
242
  type="color"
@@ -252,7 +256,7 @@ function ColorField({
252
256
  onBlur={() => {
253
257
  if (!/^#[0-9a-fA-F]{6}$/.test(hexDraft)) setHexDraft(value);
254
258
  }}
255
- className="h-8 flex-1 font-mono text-[11px] uppercase"
259
+ className="nums h-8 flex-1 font-mono text-[11px] uppercase"
256
260
  spellCheck={false}
257
261
  />
258
262
  </Field>
@@ -1,7 +1,7 @@
1
1
  import { Monitor, Moon, Sun } from 'lucide-react';
2
2
  import { useTheme } from 'next-themes';
3
3
  import { useEffect, useState } from 'react';
4
- import { IconTooltip } from '@/components/icon-tooltip';
4
+ import { IconTooltip, MenuTooltipTrigger } from '@/components/icon-tooltip';
5
5
  import { buttonVariants } from '@/components/ui/button';
6
6
  import {
7
7
  DropdownMenu,
@@ -9,7 +9,6 @@ import {
9
9
  DropdownMenuItem,
10
10
  DropdownMenuTrigger,
11
11
  } from '@/components/ui/dropdown-menu';
12
- import { TooltipTrigger } from '@/components/ui/tooltip';
13
12
  import { useLocale } from '@/lib/use-locale';
14
13
  import { cn } from '@/lib/utils';
15
14
 
@@ -27,15 +26,15 @@ export function ThemeToggle() {
27
26
  <IconTooltip label={t.themeToggle.title}>
28
27
  <DropdownMenuTrigger
29
28
  render={
30
- <TooltipTrigger
29
+ <MenuTooltipTrigger
31
30
  type="button"
32
31
  aria-label={t.themeToggle.toggleAria}
33
32
  className={cn(buttonVariants({ variant: 'ghost', size: 'icon-sm' }), 'relative')}
34
33
  />
35
34
  }
36
35
  >
37
- <Sun className="size-3.5 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" />
38
- <Moon className="absolute size-3.5 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" />
36
+ <Sun className="size-3.5 scale-100 rotate-0 opacity-100 ease-swift motion-safe:transition-[opacity,scale,rotate] motion-safe:duration-200 dark:scale-75 dark:-rotate-90 dark:opacity-0" />
37
+ <Moon className="absolute size-3.5 scale-75 rotate-90 opacity-0 ease-swift motion-safe:transition-[opacity,scale,rotate] motion-safe:duration-200 dark:scale-100 dark:rotate-0 dark:opacity-100" />
39
38
  </DropdownMenuTrigger>
40
39
  </IconTooltip>
41
40
  <DropdownMenuContent align="end" className="min-w-[140px]">
@@ -121,7 +121,7 @@ export function ThemeDetail({ themeId, onBack }: { themeId: string; onBack: () =
121
121
  aria-label={t.themes.prevPageAria}
122
122
  disabled={pageIndex === 0}
123
123
  onClick={() => setPageIndex((i) => Math.max(0, i - 1))}
124
- className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground transition-colors hover:bg-muted disabled:opacity-40"
124
+ className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground outline-none transition-[background-color,opacity,scale] duration-100 hover:bg-muted active:scale-95 focus-visible:ring-2 focus-visible:ring-ring/30 disabled:opacity-40"
125
125
  >
126
126
  <ChevronLeft className="size-4" />
127
127
  </button>
@@ -133,7 +133,7 @@ export function ThemeDetail({ themeId, onBack }: { themeId: string; onBack: () =
133
133
  aria-label={t.themes.nextPageAria}
134
134
  disabled={pageIndex === totalPages - 1}
135
135
  onClick={() => setPageIndex((i) => Math.min(totalPages - 1, i + 1))}
136
- className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground transition-colors hover:bg-muted disabled:opacity-40"
136
+ className="flex size-8 items-center justify-center rounded-[6px] border border-border bg-card text-foreground outline-none transition-[background-color,opacity,scale] duration-100 hover:bg-muted active:scale-95 focus-visible:ring-2 focus-visible:ring-ring/30 disabled:opacity-40"
137
137
  >
138
138
  <ChevronRight className="size-4" />
139
139
  </button>
@@ -225,10 +225,13 @@ function ThemeSlideCard({ id }: { id: string }) {
225
225
  const displayTitle = slide?.meta?.title ?? id;
226
226
 
227
227
  return (
228
- <Link to={`/s/${id}`} className="group block focus-visible:outline-none">
229
- <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color] motion-safe:duration-200">
228
+ <Link
229
+ to={`/s/${id}`}
230
+ className="group block rounded-[6px] outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
231
+ >
232
+ <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 group-active:scale-[0.99] motion-safe:transition-[box-shadow,--tw-ring-color,scale] motion-safe:duration-200">
230
233
  {FirstPage ? (
231
- <div className="h-full w-full motion-safe:transition-transform motion-safe:duration-300 motion-safe:group-hover:scale-[1.03]">
234
+ <div className="h-full w-full ease-swift motion-safe:transition-transform motion-safe:duration-200 motion-safe:group-hover:scale-[1.03]">
232
235
  <SlideCanvas flat freezeMotion design={slide?.design}>
233
236
  <SlidePageProvider index={0} total={slide?.default.length ?? 1}>
234
237
  <FirstPage />
@@ -40,9 +40,9 @@ function ThemeCard({
40
40
  type="button"
41
41
  onClick={onOpen}
42
42
  aria-label={ariaLabel}
43
- className="group block w-full text-left focus-visible:outline-none"
43
+ className="group block w-full rounded-[6px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
44
44
  >
45
- <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color] motion-safe:duration-200">
45
+ <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 group-active:scale-[0.99] motion-safe:transition-[box-shadow,--tw-ring-color,scale] motion-safe:duration-200">
46
46
  <ThemePreview theme={theme} />
47
47
  </div>
48
48
  <div className="mt-3">
@@ -77,7 +77,7 @@ function ThemePreview({ theme }: { theme: Theme }) {
77
77
  if (!FirstPage) return <NoDemoState />;
78
78
 
79
79
  return (
80
- <div className="h-full w-full motion-safe:transition-transform motion-safe:duration-300 motion-safe:group-hover:scale-[1.03]">
80
+ <div className="h-full w-full ease-swift motion-safe:transition-transform motion-safe:duration-200 motion-safe:group-hover:scale-[1.03]">
81
81
  <SlideCanvas flat freezeMotion design={demo.design}>
82
82
  <SlidePageProvider index={0} total={demo.default.length}>
83
83
  <FirstPage />
@@ -396,8 +396,8 @@ function CurrentThumbnailButton({
396
396
 
397
397
  function thumbButtonClass(active: boolean): string {
398
398
  return cn(
399
- 'group/thumb flex w-full items-start gap-2.5 rounded-[6px] p-1.5 text-left outline-none motion-safe:transition-colors',
400
- 'hover:bg-muted/60',
399
+ 'group/thumb flex w-full items-start gap-2.5 rounded-[6px] p-1.5 text-left outline-none motion-safe:transition-[background-color,scale] motion-safe:duration-100',
400
+ 'hover:bg-muted/60 active:scale-[0.985]',
401
401
  'focus-visible:ring-1 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-sidebar',
402
402
  active && 'bg-muted',
403
403
  );
@@ -499,7 +499,10 @@ function HorizontalVirtualThumbList({
499
499
  onClick={() => onSelect(i)}
500
500
  aria-label={format(t.thumbnailRail.goToPageAria, { n: i + 1 })}
501
501
  aria-current={active ? 'page' : undefined}
502
- className={cn('group/thumb relative flex shrink-0 flex-col items-center gap-1.5')}
502
+ className={cn(
503
+ 'group/thumb relative flex shrink-0 flex-col items-center gap-1.5 rounded-[6px] outline-none motion-safe:transition-[scale] motion-safe:duration-100 active:scale-[0.985]',
504
+ 'focus-visible:ring-1 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-sidebar',
505
+ )}
503
506
  >
504
507
  <span
505
508
  className={cn(
@@ -939,6 +942,7 @@ function SortableThumb({
939
942
  >) {
940
943
  const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
941
944
  id: index + 1,
945
+ transition: { duration: 180, easing: 'var(--ease-swift)' },
942
946
  });
943
947
 
944
948
  const setRef = (node: HTMLButtonElement | null) => {
@@ -5,6 +5,27 @@
5
5
  <link rel="icon" href="./favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>open-slide</title>
8
+ <style>
9
+ html {
10
+ background-color: oklch(0.99 0 0);
11
+ }
12
+ html.dark {
13
+ background-color: oklch(0.145 0 0);
14
+ }
15
+ </style>
16
+ <script>
17
+ // Apply the stored theme before first paint; next-themes only runs
18
+ // after the bundle loads, which flashes white for dark-mode users.
19
+ let stored = null;
20
+ try {
21
+ stored = localStorage.getItem('theme');
22
+ } catch (_) {}
23
+ const dark =
24
+ stored === 'dark' ||
25
+ (stored !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches);
26
+ document.documentElement.classList.toggle('dark', dark);
27
+ document.documentElement.style.colorScheme = dark ? 'dark' : 'light';
28
+ </script>
8
29
  </head>
9
30
  <body>
10
31
  <div id="root"></div>
@@ -96,6 +96,9 @@ async function renderPagesToHtml(pages: NonNullable<SlideModule['default']>): Pr
96
96
  );
97
97
  await nextPaint();
98
98
  await nextPaint();
99
+ for (const video of host.querySelectorAll('video')) {
100
+ video.defaultMuted = video.muted;
101
+ }
99
102
  result.push(host.innerHTML);
100
103
  root.unmount();
101
104
  container.removeChild(host);
@@ -143,7 +146,7 @@ function collectExternalStylesheetLinks(): string {
143
146
 
144
147
  function findHtmlAssetUrls(html: string): string[] {
145
148
  const out: string[] = [];
146
- const attrRe = /\s(?:src|href)="([^"]+)"/g;
149
+ const attrRe = /\s(?:src|href|poster)="([^"]+)"/g;
147
150
  for (const m of html.matchAll(attrRe)) {
148
151
  if (looksLikeAsset(m[1])) out.push(m[1]);
149
152
  }
@@ -282,7 +285,17 @@ html, body { margin: 0; height: 100%; background: #000; overflow: hidden; font-f
282
285
  }
283
286
  function go(i) {
284
287
  idx = Math.max(0, Math.min(pages.length - 1, i));
285
- pages.forEach(function (p, n) { p.hidden = n !== idx; });
288
+ pages.forEach(function (p, n) {
289
+ p.hidden = n !== idx;
290
+ p.querySelectorAll('video').forEach(function (video) {
291
+ if (p.hidden) {
292
+ video.pause();
293
+ try { video.currentTime = 0; } catch {}
294
+ } else if (video.autoplay) {
295
+ video.play().catch(function () {});
296
+ }
297
+ });
298
+ });
286
299
  cur.textContent = String(idx + 1);
287
300
  }
288
301
  window.addEventListener('resize', fit);
@@ -189,7 +189,7 @@ export function HomeShell() {
189
189
  <button
190
190
  type="button"
191
191
  aria-label={t.home.menu}
192
- className="flex size-8 items-center justify-center rounded-[6px] text-muted-foreground hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground"
192
+ className="flex size-8 items-center justify-center rounded-[6px] text-muted-foreground outline-none transition-[background-color,color,scale] duration-100 hover:bg-muted hover:text-foreground active:scale-95 focus-visible:ring-2 focus-visible:ring-ring/30 aria-expanded:bg-muted aria-expanded:text-foreground"
193
193
  >
194
194
  <Menu className="size-4" />
195
195
  </button>
@@ -266,7 +266,7 @@ function SearchInput({ value, onChange }: { value: string; onChange: (value: str
266
266
  type="button"
267
267
  onClick={() => onChange('')}
268
268
  aria-label={t.home.clearSearch}
269
- className="absolute right-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-[4px] text-muted-foreground hover:bg-muted hover:text-foreground"
269
+ className="absolute right-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-[4px] text-muted-foreground outline-none transition-[background-color,color,scale] duration-100 hover:bg-muted hover:text-foreground active:scale-90 focus-visible:ring-2 focus-visible:ring-ring/30"
270
270
  >
271
271
  <X className="size-3" />
272
272
  </button>
@@ -296,7 +296,7 @@ function SortControl({ value, onChange }: { value: SortKey; onChange: (next: Sor
296
296
  <button
297
297
  type="button"
298
298
  aria-label={`${t.home.sortLabel}: ${labels[value]}`}
299
- className="flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-[6px] border border-border bg-background pl-2 pr-1.5 text-[12.5px] font-medium text-foreground outline-none hover:bg-muted focus-visible:border-foreground/40 focus-visible:ring-2 focus-visible:ring-ring/30"
299
+ className="flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-[6px] border border-border bg-background pl-2 pr-1.5 text-[12.5px] font-medium text-foreground outline-none transition-[background-color,translate] duration-100 hover:bg-muted active:translate-y-px focus-visible:border-foreground/40 focus-visible:ring-2 focus-visible:ring-ring/30"
300
300
  >
301
301
  <FieldIcon k={value} className="size-3.5 text-muted-foreground" />
302
302
  <span>{labels[value]}</span>
@@ -510,11 +510,14 @@ function SlideCard({
510
510
  onDragEnd={() => setDragging(false)}
511
511
  className={cn('group relative motion-safe:transition-opacity', dragging && 'opacity-40')}
512
512
  >
513
- <Link to={`/s/${id}`} className="block focus-visible:outline-none">
513
+ <Link
514
+ to={`/s/${id}`}
515
+ className="block rounded-[6px] outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
516
+ >
514
517
  {/* Slide thumb — tight border, grey baseboard, no shadcn rounded-xl */}
515
- <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color] motion-safe:duration-200">
518
+ <div className="relative aspect-video overflow-hidden rounded-[6px] border border-hairline bg-card shadow-edge ring-1 ring-foreground/[0.04] group-hover:shadow-floating group-hover:ring-foreground/20 motion-safe:transition-[box-shadow,--tw-ring-color,scale] motion-safe:duration-200 group-active:scale-[0.99]">
516
519
  {FirstPage ? (
517
- <div className="h-full w-full motion-safe:transition-transform motion-safe:duration-300 motion-safe:group-hover:scale-[1.03]">
520
+ <div className="h-full w-full ease-swift motion-safe:transition-transform motion-safe:duration-200 motion-safe:group-hover:scale-[1.03]">
518
521
  <SlideCanvas flat freezeMotion design={slide?.design}>
519
522
  <SlidePageProvider index={0} total={slide?.default.length ?? 1}>
520
523
  <FirstPage />
@@ -556,7 +559,7 @@ function SlideCard({
556
559
  e.stopPropagation();
557
560
  e.preventDefault();
558
561
  }}
559
- className="flex size-7 items-center justify-center rounded-[5px] bg-card/90 text-foreground shadow-edge ring-1 ring-border opacity-0 backdrop-blur hover:bg-card group-hover:opacity-100 aria-expanded:opacity-100 motion-safe:transition-opacity"
562
+ className="flex size-7 items-center justify-center rounded-[5px] bg-card/90 text-foreground shadow-edge ring-1 ring-border opacity-0 outline-none backdrop-blur hover:bg-card group-hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-ring/40 aria-expanded:opacity-100 motion-safe:transition-opacity motion-safe:duration-150"
560
563
  aria-label={tCard.home.slideActions}
561
564
  >
562
565
  <MoreHorizontal className="size-3.5" />
@@ -794,7 +797,7 @@ function FolderOption({
794
797
  type="button"
795
798
  onClick={onClick}
796
799
  className={cn(
797
- 'flex w-full items-center gap-2 border-b border-hairline px-3 py-2 text-left text-[13px] transition-colors last:border-b-0',
800
+ 'flex w-full items-center gap-2 border-b border-hairline px-3 py-2 text-left text-[13px] outline-none transition-colors duration-100 last:border-b-0 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-brand active:bg-muted',
798
801
  active ? 'bg-muted text-foreground' : 'hover:bg-muted/60',
799
802
  )}
800
803
  >