Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm run build

## Content that changes at a release

All of it lives in `src/data/site.ts`:
Release metadata and the original showcase live in `src/data/site.ts`:

- `VERSION` and `downloads`: installer names are exactly what `.github/workflows/package.yml` produces
(`animathio_<version>_x64-setup.exe`, `AniMathIO_<version>_aarch64.dmg`, `animathio_<version>_x86_64.AppImage`,
Expand All @@ -25,3 +25,20 @@ All of it lives in `src/data/site.ts`:
Media is not committed until then.
- `benchmarks`: `TODO(benchmarks)`. Fill from `docs/benchmarks.md` in the main repository. The Benchmarks
section is hidden in production while the list is empty and shows a marked placeholder in `npm run dev`.


## Feature gallery

[All features](https://animathio.com/examples#all-features) uses editable source
projects from [the main repository](https://github.com/AniMathIO/AniMathIO/tree/main/examples/feature-gallery).
Render the complete gallery with its release CLI and enabled Code Snippets
bundle, then copy the outputs into this checkout:

```bash
cp /path/to/feature-gallery/manifest.json src/data/feature-gallery.json
cp /path/to/feature-gallery/videos/*.{mp4,webm} public/videos/gallery/
cp /path/to/feature-gallery/img/*.webp public/img/gallery/
```

Each card loads its video on play. Keep the gallery media under 40 MB.
Upcoming community plugins are listed in `src/components/FeatureGallery.tsx`.
Binary file added public/img/gallery/audio-compressor.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/audio-denoise.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/audio-eq3.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/audio-gain.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/audio-gate.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/audio-highpass.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/audio-voice-cleanup.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/captions-playful.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/captions.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/character-slide-in.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/character-slide-out.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/code-snippets-morph.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/code-snippets-reveal.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-blur.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-brightness.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-contrast.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-grayscale.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-invert.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-opacity.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-saturate.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-sepia.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/effect-slide.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/graph-tick-labels.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/latex-inline-color.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/manim-import.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/gallery/mp4-chapters.webp
Binary file added public/img/gallery/preset-bounce-in.webp
Binary file added public/img/gallery/preset-bounce-out.webp
Binary file added public/img/gallery/preset-breathe.webp
Binary file added public/img/gallery/preset-clipped-slide-in.webp
Binary file added public/img/gallery/preset-clipped-slide-out.webp
Binary file added public/img/gallery/preset-fade-in.webp
Binary file added public/img/gallery/preset-fade-out.webp
Binary file added public/img/gallery/preset-flash.webp
Binary file added public/img/gallery/preset-hop.webp
Binary file added public/img/gallery/preset-pop-in.webp
Binary file added public/img/gallery/preset-pop-out.webp
Binary file added public/img/gallery/preset-shake.webp
Binary file added public/img/gallery/preset-slide-in.webp
Binary file added public/img/gallery/preset-slide-out.webp
Binary file added public/img/gallery/preset-spin-in.webp
Binary file added public/img/gallery/preset-spin-out.webp
Binary file added public/img/gallery/preset-spin.webp
Binary file added public/img/gallery/preset-typewriter-in.webp
Binary file added public/img/gallery/preset-typewriter-out.webp
Binary file added public/img/gallery/preset-wipe-in.webp
Binary file added public/img/gallery/preset-wipe-out.webp
Binary file added public/img/gallery/preset-zoom-in.webp
Binary file added public/img/gallery/preset-zoom-out.webp
Binary file added public/img/gallery/shapes-stroke-fill.webp
Binary file added public/img/gallery/text-styling.webp
Binary file added public/img/gallery/webm-export.webp
Binary file added public/videos/gallery/audio-compressor.mp4
Binary file not shown.
Binary file added public/videos/gallery/audio-compressor.webm
Binary file not shown.
Binary file added public/videos/gallery/audio-denoise.mp4
Binary file not shown.
Binary file added public/videos/gallery/audio-denoise.webm
Binary file not shown.
Binary file added public/videos/gallery/audio-eq3.mp4
Binary file not shown.
Binary file added public/videos/gallery/audio-eq3.webm
Binary file not shown.
Binary file added public/videos/gallery/audio-gain.mp4
Binary file not shown.
Binary file added public/videos/gallery/audio-gain.webm
Binary file not shown.
Binary file added public/videos/gallery/audio-gate.mp4
Binary file not shown.
Binary file added public/videos/gallery/audio-gate.webm
Binary file not shown.
Binary file added public/videos/gallery/audio-highpass.mp4
Binary file not shown.
Binary file added public/videos/gallery/audio-highpass.webm
Binary file not shown.
Binary file added public/videos/gallery/audio-voice-cleanup.mp4
Binary file not shown.
Binary file added public/videos/gallery/audio-voice-cleanup.webm
Binary file not shown.
Binary file added public/videos/gallery/captions-playful.mp4
Binary file not shown.
Binary file added public/videos/gallery/captions-playful.webm
Binary file not shown.
Binary file added public/videos/gallery/captions.mp4
Binary file not shown.
Binary file added public/videos/gallery/captions.webm
Binary file not shown.
Binary file added public/videos/gallery/character-slide-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/character-slide-in.webm
Binary file not shown.
Binary file added public/videos/gallery/character-slide-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/character-slide-out.webm
Binary file not shown.
Binary file added public/videos/gallery/code-snippets-morph.mp4
Binary file not shown.
Binary file added public/videos/gallery/code-snippets-morph.webm
Binary file not shown.
Binary file added public/videos/gallery/code-snippets-reveal.mp4
Binary file not shown.
Binary file added public/videos/gallery/code-snippets-reveal.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-blur.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-blur.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-brightness.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-brightness.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-contrast.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-contrast.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-grayscale.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-grayscale.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-invert.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-invert.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-opacity.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-opacity.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-saturate.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-saturate.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-sepia.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-sepia.webm
Binary file not shown.
Binary file added public/videos/gallery/effect-slide.mp4
Binary file not shown.
Binary file added public/videos/gallery/effect-slide.webm
Binary file not shown.
Binary file added public/videos/gallery/graph-tick-labels.mp4
Binary file not shown.
Binary file added public/videos/gallery/graph-tick-labels.webm
Binary file not shown.
Binary file added public/videos/gallery/latex-inline-color.mp4
Binary file not shown.
Binary file added public/videos/gallery/latex-inline-color.webm
Binary file not shown.
Binary file added public/videos/gallery/manim-import.mp4
Binary file not shown.
Binary file added public/videos/gallery/manim-import.webm
Binary file not shown.
Binary file added public/videos/gallery/mp4-chapters.mp4
Binary file not shown.
Binary file added public/videos/gallery/mp4-chapters.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-bounce-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-bounce-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-bounce-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-bounce-out.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-breathe.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-breathe.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-clipped-slide-in.mp4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added public/videos/gallery/preset-fade-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-fade-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-fade-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-fade-out.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-flash.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-flash.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-hop.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-hop.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-pop-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-pop-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-pop-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-pop-out.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-shake.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-shake.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-slide-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-slide-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-slide-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-slide-out.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-spin-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-spin-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-spin-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-spin-out.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-spin.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-spin.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-typewriter-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-typewriter-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-typewriter-out.mp4
Binary file not shown.
Binary file not shown.
Binary file added public/videos/gallery/preset-wipe-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-wipe-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-wipe-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-wipe-out.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-zoom-in.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-zoom-in.webm
Binary file not shown.
Binary file added public/videos/gallery/preset-zoom-out.mp4
Binary file not shown.
Binary file added public/videos/gallery/preset-zoom-out.webm
Binary file not shown.
Binary file added public/videos/gallery/shapes-stroke-fill.mp4
Binary file not shown.
Binary file added public/videos/gallery/shapes-stroke-fill.webm
Binary file not shown.
Binary file added public/videos/gallery/text-styling.mp4
Binary file not shown.
Binary file added public/videos/gallery/text-styling.webm
Binary file not shown.
Binary file added public/videos/gallery/webm-export.mp4
Binary file not shown.
Binary file added public/videos/gallery/webm-export.webm
Binary file not shown.
149 changes: 149 additions & 0 deletions src/components/FeatureGallery.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import { useEffect, useRef, useState } from 'react'
import { ArrowUpRight, Play, Puzzle } from 'lucide-react'
import clips from '../data/feature-gallery.json'

const filters = [
['all', 'All'],
['math', 'Math'],
['text', 'Text'],
['effects', 'Effects'],
['animations', 'Animations'],
['audio', 'Audio'],
['editing', 'Export'],
['community', 'Community'],
] as const

type Filter = typeof filters[number][0]
type Clip = typeof clips[number]

const upcoming = [
{ title: 'Molecule', summary: 'Molecular structures and chemical reactions.' },
{ title: 'Physics', summary: 'Collisions, projectiles and domino simulations.' },
{ title: 'Network', summary: 'Network topology and animated packet paths.' },
{ title: 'Optics', summary: 'Light rays, reflection and refraction.' },
]

const ClipPlayer = ({ clip }: { clip: Clip }) => {
const [playing, setPlaying] = useState(false)
const poster = clip.poster.replace('img/', '/img/gallery/')

if (playing) {
const mp4 = <source src={clip.mp4.replace('videos/', '/videos/gallery/')} type="video/mp4" />
const webm = <source src={clip.webm.replace('videos/', '/videos/gallery/')} type="video/webm" />
return (
<video
ref={(video) => video?.focus()}
controls
autoPlay
playsInline
muted={!clip.kinds.includes('audio')}
preload="none"
poster={poster}
aria-label={clip.title}
className="block aspect-video w-full bg-stage"
>
{clip.slug === 'webm-export' ? <>{webm}{mp4}</> : <>{mp4}{webm}</>}
</video>
)
}

return (
<button
type="button"
aria-label={`Play ${clip.title}`}
onClick={() => setPlaying(true)}
className="group relative block w-full bg-stage text-fg focus-visible:outline-offset-[-3px]"
>
<img src={poster} alt="" width={800} height={450} loading="lazy" decoding="async"
className="block aspect-video w-full" />
<span className="absolute bottom-3 left-3 grid h-9 w-9 place-items-center rounded-control border border-line-strong bg-raised shadow-sm group-hover:border-accent group-hover:text-accent">
<Play size={16} fill="currentColor" aria-hidden="true" />
</span>
<span className="absolute right-3 bottom-3 rounded-control bg-bg px-1.5 py-0.5 font-mono text-xs text-fg-2">
{clip.seconds.toLocaleString('en', { maximumFractionDigits: 1 })} s
</span>
</button>
)
}

const GalleryCard = ({ clip }: { clip: Clip }) => (
<article className="panel flex min-w-0 flex-col overflow-hidden">
<ClipPlayer clip={clip} />
<div className="flex flex-1 flex-col border-t border-line p-4">
<h3 className="text-base font-semibold">{clip.title}</h3>
<p className="mt-1 text-sm text-fg-2">{clip.summary}</p>
<a
href={clip.docs}
aria-label={`Documentation for ${clip.plugin}`}
className="mt-auto block w-fit max-w-full pt-3 font-mono text-xs text-accent wrap-anywhere hover:underline"
>
{clip.plugin} <ArrowUpRight size={12} aria-hidden="true" className="inline" />
</a>
</div>
</article>
)

export const FeatureGallery = () => {
const section = useRef<HTMLElement>(null)
const [filter, setFilter] = useState<Filter>('all')
useEffect(() => {
if (window.location.hash !== '#all-features') return
const frame = requestAnimationFrame(() => section.current?.scrollIntoView({ behavior: 'instant' }))
return () => cancelAnimationFrame(frame)
}, [])
const visible = filter === 'all' ? clips : clips.filter((clip) => clip.kinds.includes(filter))

return (
<section ref={section} id="all-features" aria-labelledby="feature-gallery-heading" className="mt-24">
<h2 id="feature-gallery-heading" className="text-3xl font-semibold tracking-tight sm:text-4xl">All features</h2>
<p className="mt-3 max-w-2xl text-fg-2">
Play short examples of math, text, effects and more. Each clip comes from an editable AniMathIO project.{' '}
<a href="https://github.com/AniMathIO/AniMathIO/tree/main/examples/feature-gallery"
className="text-accent hover:underline">Get the source projects</a>.
</p>
<div className="mt-6 flex flex-wrap items-center justify-between gap-3 border-y border-line py-3">
<div role="group" aria-label="Filter by feature kind" className="flex flex-wrap gap-1.5">
{filters.map(([kind, label]) => (
<button
key={kind}
type="button"
aria-pressed={filter === kind}
onClick={() => setFilter(kind)}
className={`rounded-control border px-3 py-1.5 text-sm font-medium transition-colors ${
filter === kind
? 'border-accent/40 bg-accent/16 text-accent'
: 'border-line bg-panel text-fg-2 hover:bg-hover hover:text-fg'
}`}
>
{label}
</button>
))}
</div>
<p aria-live="polite" className="text-sm tabular-nums text-fg-3">
{visible.length} {visible.length === 1 ? 'clip' : 'clips'}
</p>
</div>

<div className="mt-5 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{visible.map((clip) => <GalleryCard key={clip.slug} clip={clip} />)}
</div>

{(filter === 'all' || filter === 'community') && (
<section aria-labelledby="upcoming-plugins-heading" className="mt-8">
<h3 id="upcoming-plugins-heading" className="text-lg font-semibold">Upcoming community plugins</h3>
<div className="mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
{upcoming.map(({ title, summary }) => (
<article key={title} className="panel p-4">
<h4 className="flex items-center gap-2 font-medium">
<Puzzle size={16} aria-hidden="true" className="text-fg-3" /> {title}
</h4>
<p className="mt-1 text-sm text-fg-2">{summary}</p>
<p className="mt-2 text-xs text-fg-3">Demo pending release</p>
</article>
))}
</div>
</section>
)}
</section>
)
}
Loading
Loading