sisyo 1.6.8 → 1.8.0
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 +16 -16
- package/README.md +167 -162
- package/bin/known-hashes.json +100 -7
- package/package.json +1 -1
- package/templates/.claude/rules/agents-and-tests.md +32 -0
- package/templates/.claude/rules/docs.md +19 -19
- package/templates/.claude/skills/fastapi-best-practices/ASYNC-PATTERNS.md +121 -121
- package/templates/.claude/skills/fastapi-best-practices/DATABASE.md +153 -153
- package/templates/.claude/skills/fastapi-best-practices/DEPENDENCIES.md +140 -140
- package/templates/.claude/skills/fastapi-best-practices/PROJECT-STRUCTURE.md +90 -90
- package/templates/.claude/skills/fastapi-best-practices/PYDANTIC-GUIDE.md +155 -155
- package/templates/.claude/skills/fastapi-best-practices/SKILL.md +123 -123
- package/templates/.claude/skills/g6-style/SKILL.md +125 -0
- package/templates/.claude/skills/g6-style/references/checks.md +58 -0
- package/templates/.claude/skills/g6-style/references/imagery.md +103 -0
- package/templates/.claude/skills/g6-style/references/motion.md +121 -0
- package/templates/.claude/skills/g6-style/references/sections.md +263 -0
- package/templates/.claude/skills/g6-style/references/tokens.md +197 -0
- package/templates/.claude/skills/hindsight/SKILL.md +175 -172
- package/templates/.claude/skills/hoang-auth/SKILL.md +188 -0
- package/templates/.claude/skills/html-docs/SKILL.md +207 -207
- package/templates/.claude/skills/i18n-multilang/SKILL.md +153 -0
- package/templates/.claude/skills/i18n-multilang/assets/languages.json +47 -0
- package/templates/.claude/skills/i18n-multilang/assets/plural-vectors.json +46 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/README.md +17 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/gitattributes.txt +6 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/gitignore.txt +4 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/glossary.json +6 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/i18n.config.json +22 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/locales/__source__/common.json +10 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/notes/common.json +5 -0
- package/templates/.claude/skills/i18n-multilang/assets/project/style.md +20 -0
- package/templates/.claude/skills/i18n-multilang/references/format.md +100 -0
- package/templates/.claude/skills/i18n-multilang/references/languages.md +97 -0
- package/templates/.claude/skills/i18n-multilang/references/layout-and-versioning.md +256 -0
- package/templates/.claude/skills/i18n-multilang/references/numbers.md +161 -0
- package/templates/.claude/skills/i18n-multilang/references/platform-unity.md +142 -0
- package/templates/.claude/skills/i18n-multilang/references/platform-web.md +107 -0
- package/templates/.claude/skills/i18n-multilang/references/translation.md +143 -0
- package/templates/.claude/skills/i18n-multilang/references/voice.md +271 -0
- package/templates/.claude/skills/i18n-multilang/scripts/i18n.py +1041 -0
- package/templates/.claude/skills/i18n-multilang/scripts/numwords.py +1013 -0
- package/templates/.claude/skills/i18n-multilang/scripts/voice.py +478 -0
- package/templates/.claude/skills/react-page-oriented/SKILL.md +407 -407
- package/templates/.claude/skills/react-page-oriented/triggers.md +12 -12
- package/templates/.claude/skills/terraform-best-practices/SKILL.md +341 -341
- package/templates/.claude/skills/typesafe-jev/SKILL.md +148 -148
- package/templates/.claude/skills/vibe-docs/SKILL.md +242 -242
- package/templates/SISYO.md +37 -37
- package/templates/docs/99_progress/features.md +7 -7
- package/templates/docs/99_progress/handoff.md +19 -19
- package/templates/docs/99_progress/todo.md +15 -15
- package/templates/docs/MAP.md +26 -26
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: g6-style
|
|
3
|
+
description: >-
|
|
4
|
+
The "G6" homepage style: champagne / metallic gold "light LED" on warm ivory (light mode) and warm black (dark
|
|
5
|
+
mode), after the lit atrium of a Ginza department store, with its motion system: CSS-first entrances, a triangle
|
|
6
|
+
lattice of light behind the page, LED strips, a 3D phone stack hero with real screens, animated "how it works"
|
|
7
|
+
tiles (QR scan, NFC tap, wallet pass, URL typing) whose lines of light meet at one card, a click-to-play product
|
|
8
|
+
tour, a black-and-gold plan, a products row, a photo closing CTA. Guidance only, no source files: exact token
|
|
9
|
+
values (light + dark), keyframes, section anatomy for React + Tailwind v4 + framer-motion, codex exec image
|
|
10
|
+
prompts, how to fit a real screen into a generated photo, a button-overflow audit method. Use this skill whenever
|
|
11
|
+
the user wants a homepage, landing page, product page or marketing site that looks premium, luxurious, gold,
|
|
12
|
+
"sang trọng", "pro, animation hơn", like Ginza Six / G6 / the Hokidon homepage, or asks to restyle an existing
|
|
13
|
+
site into gold light-and-dark with motion, even if they only say "make the homepage more professional and
|
|
14
|
+
animated".
|
|
15
|
+
license: MIT
|
|
16
|
+
metadata:
|
|
17
|
+
author: HoangThang
|
|
18
|
+
version: '1.0.0'
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# g6-style
|
|
22
|
+
|
|
23
|
+
A premium product homepage: quiet ivory (or warm black) surfaces, gold used like light rather than like paint, and
|
|
24
|
+
motion that explains the product instead of decorating it. It was built for the Hokidon digital-business-card site
|
|
25
|
+
(Next.js 15 static export, Tailwind CSS v4, framer-motion) and reads well for any app with a phone UI to show.
|
|
26
|
+
|
|
27
|
+
This skill is **guidance only**. It contains no source files: the project writes its own tokens, components and
|
|
28
|
+
scripts from the values, anatomy and methods in the reference files. The numbers there are the system (contrast was
|
|
29
|
+
checked on exactly these values); use them as written, do not approximate them.
|
|
30
|
+
|
|
31
|
+
What makes it look expensive, so keep these when adapting:
|
|
32
|
+
- **Few colours, one meaning each.** Gold = action / selected / done, champagne = links and focus, bronze = identity,
|
|
33
|
+
rose = rare highlight. Everything else is warm neutrals. Glow marks only the one thing that matters on screen.
|
|
34
|
+
- **Light, not paint.** Gold appears as LED strips (`.led-line`), a lattice of light behind the page, a skylight at
|
|
35
|
+
the top of the hero, a ring of light turning around the one card a section points at (`.g6-sweep`), metallic
|
|
36
|
+
gradients with a light band travelling through them (the hero CTA, the headline's second line).
|
|
37
|
+
- **Real product, real photos.** Real screen captures in phones; generated photos only for mood and the human
|
|
38
|
+
moment, in the same warm gold light; tiny CSS scenes for "how it works".
|
|
39
|
+
- **Motion tells the story** (a card taps a phone, a pass rises, an address types itself, lines of light meet at
|
|
40
|
+
"your page") and every loop ends on a readable picture.
|
|
41
|
+
|
|
42
|
+
## Reference files: load only what the task needs
|
|
43
|
+
|
|
44
|
+
| File | Read it when |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `references/tokens.md` | Always: colour tokens (light + dark), the theme mechanism, the Tailwind v4 mapping, gradients, the backdrop, LED line, card, sweep and tone scopes. |
|
|
47
|
+
| `references/motion.md` | Any animation: easings, the animation tokens, every keyframe (entrance, ambient loops, the story loops of the tiles, form fill), reduced motion, JavaScript loops. |
|
|
48
|
+
| `references/sections.md` | Planning or building any section: page order, section shell, hero, strip, animated tiles, "more than X", product tour, plans, products row, closing CTA, phone frame, buttons, switch, a form filled by an API. |
|
|
49
|
+
| `references/imagery.md` | Making pictures: codex exec photo prompts, fitting a real screen into a generated photo, video encoding and click-to-play, QR codes in images, image sizes. |
|
|
50
|
+
| `references/checks.md` | Before shipping: screenshots, reduced motion, horizontal scroll, the button-overflow audit, languages, network. |
|
|
51
|
+
|
|
52
|
+
## Workflow
|
|
53
|
+
|
|
54
|
+
1. **Read the project first.** Stack (Tailwind v4? v3? plain CSS?), its design tokens, i18n, image pipeline, how it
|
|
55
|
+
builds and deploys, its checks. Keep its conventions (file layout, copy rules, analytics hooks, test ids); this
|
|
56
|
+
skill brings the look and the motion, not a new architecture. If the project already has a palette with tone
|
|
57
|
+
names, map the G6 values onto those names (the Hokidon site did: lime → gold, aqua → champagne, iris → bronze,
|
|
58
|
+
flare → rose) instead of renaming every class.
|
|
59
|
+
2. **Write the tokens.** Put the values of `references/tokens.md` and the keyframes of `references/motion.md` into the
|
|
60
|
+
global CSS (after `@import "tailwindcss";` on Tailwind v4, or into the project's own variables), render one
|
|
61
|
+
fixed `.g6-backdrop` (`aria-hidden`) in the page shell, and give the header a translucent ivory / black glass
|
|
62
|
+
(`bg-surface-base/75 backdrop-blur-xl`).
|
|
63
|
+
3. **Plan the page with the user's content.** Use the order in `references/sections.md` as the default and keep only
|
|
64
|
+
the sections the product needs. Facts in the copy must be true today (no feature that is not live, prices from
|
|
65
|
+
the product catalogue, never typed twice). Ask the user for anything that is a business decision (prices on the
|
|
66
|
+
page or not, which video goes where).
|
|
67
|
+
4. **Build top-down**, one section at a time, from its anatomy. After each section, screenshot it at 390 px and
|
|
68
|
+
1440 px in light AND dark (headless Chrome with `prefers-color-scheme` emulated) and look at the pictures; fix
|
|
69
|
+
before moving on.
|
|
70
|
+
5. **Media.** Real screens first (capture the actual app), generated photos where a human moment helps
|
|
71
|
+
(`references/imagery.md`). Encode videos small; every video waits for a click.
|
|
72
|
+
6. **Verify** (`references/checks.md`), then ship through the project's normal gate (PR, CI).
|
|
73
|
+
|
|
74
|
+
## Motion rules (why the page feels smooth and stays fast)
|
|
75
|
+
|
|
76
|
+
- **Entrance on first paint is CSS** (`animate-rise` with a stagger), never framer-motion `initial` on the hero:
|
|
77
|
+
server-rendered `opacity: 0` would wait for JavaScript and delay the largest paint.
|
|
78
|
+
- **Below the fold**, `whileInView` reveals once (16 px rise, 0.5 s, glide ease, ≤ 0.1 s stagger).
|
|
79
|
+
- **Ambient loops are CSS keyframes** on transform / opacity only (aurora, drift, marquee, scan, tap, toast, the
|
|
80
|
+
story loops). No `filter: blur()` on big layers: use radial gradients for soft light.
|
|
81
|
+
- **JavaScript loops run only while visible** (`useInView`), e.g. the typing address, the tour.
|
|
82
|
+
- **Story loops end on the meaning**: give each animated element a static style equal to its end state (card on the
|
|
83
|
+
phone, page open, pass up). With `prefers-reduced-motion` the global rule plays one 1 ms pass with no fill, so the
|
|
84
|
+
static state is what stays, still explaining the step.
|
|
85
|
+
- **One transform per element.** Tailwind v4's `translate-*` / `rotate-*` use the separate `translate` / `rotate`
|
|
86
|
+
properties, so they combine with a keyframe on `transform`; framer-motion `style={{ x, rotateX }}` writes
|
|
87
|
+
`transform`, so nest: motion wrapper → CSS-animated wrapper → rotated wrapper → content.
|
|
88
|
+
- **Pointer tilt only for a mouse** (`pointerType === 'mouse'`), springy (stiffness ~110, damping ~18), off with
|
|
89
|
+
reduced motion.
|
|
90
|
+
- **Videos never autoplay.** A dialog with `preload="none"` for intros; a tour that starts on ▶ or a step and runs one
|
|
91
|
+
pass. Autoplay costs every visitor data and battery for something most do not watch.
|
|
92
|
+
|
|
93
|
+
## Colour rules that are easy to get wrong
|
|
94
|
+
|
|
95
|
+
- **Light effects must be redesigned for the light page.** A pale cream LED line or travelling light that glows on
|
|
96
|
+
black is invisible on ivory: give each light its own per-theme variables (`--c-way-light` is `#b07a1c` deep gold
|
|
97
|
+
with a glow on ivory, `#fff3d1` on black) and use the `ink-*` tones for rings and scan lines that must read in both.
|
|
98
|
+
- **Coloured text uses `ink-*`, never the raw tone** (raw gold on ivory is ~1.5:1). Text on a gold fill is `on-gold`
|
|
99
|
+
(near black), never white.
|
|
100
|
+
- **Per-theme values live in `--c-*` variables**, read with `bg-(image:--c-…)` or `var()`. The `theme-dark` custom
|
|
101
|
+
variant is for `:root` only; on an element it misses a theme picked with a toggle.
|
|
102
|
+
- **A dark card inside the light page** (the premium plan): `data-theme="dark"` on it so the dark tokens apply inside.
|
|
103
|
+
Likewise `data-theme="light"` on a drawn phone screen, which stays light in both themes like a real one.
|
|
104
|
+
|
|
105
|
+
## Layout rules
|
|
106
|
+
|
|
107
|
+
- Sections `overflow-x-clip`; anything wider than the screen on purpose (marquee, sideways rows) carries
|
|
108
|
+
`data-scroll-x` and clips or scrolls itself.
|
|
109
|
+
- Buttons `max-w-full`; tiles in narrow columns get `min-w-0` and a truncating label.
|
|
110
|
+
- Columns that depend on the room a component has (an editor between a menu and a preview) use container queries
|
|
111
|
+
(`@container` + `@md:grid-cols-5`), not screen breakpoints: the screen can be wide while the column is narrow.
|
|
112
|
+
- Japanese text: headings in phrase blocks (each part up to 、/。 an inline-block); body text in narrow columns with
|
|
113
|
+
`[word-break:auto-phrase]` + `text-pretty`.
|
|
114
|
+
- Phones 320–414 px: no horizontal scroll, chips that would cover the phone move under it.
|
|
115
|
+
|
|
116
|
+
## Pitfalls met while building it
|
|
117
|
+
|
|
118
|
+
- Headless Chrome's user agent says "HeadlessChrome": APIs that block bots refuse it. Set a phone user agent when
|
|
119
|
+
testing a flow that calls such an API.
|
|
120
|
+
- Running `next build` while `next dev` serves the same checkout breaks the dev server (both write `.next`): stop dev
|
|
121
|
+
first, or build in another worktree.
|
|
122
|
+
- A JSON 404 from an API behind a CDN with custom error pages may come back as the site's HTML 404 page: check the
|
|
123
|
+
status, not only the body.
|
|
124
|
+
- Generated images: ask for blank screens and blank cards, then put the real product on them; never ship generated
|
|
125
|
+
text or logos.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# g6-style checks before shipping
|
|
2
|
+
|
|
3
|
+
Run these once at the end of a batch of sections (and the per-section screenshots while building, SKILL.md step 4).
|
|
4
|
+
Use the project's own checks where it has them; the audit below is for projects that have none.
|
|
5
|
+
|
|
6
|
+
## Checklist
|
|
7
|
+
|
|
8
|
+
- [ ] Light and dark screenshots of every section at 390 px and 1440 px, looked at, especially light effects in
|
|
9
|
+
light mode (LED lines, lines of light, scan lines, rings).
|
|
10
|
+
- [ ] `prefers-reduced-motion: reduce`: hero text visible at once, every story loop shows its end state, no video
|
|
11
|
+
starts, no tilt.
|
|
12
|
+
- [ ] No horizontal scroll at 320 / 360 / 375 px (the project's mobile check, or `scrollWidth - innerWidth` in the
|
|
13
|
+
page; elements in `[data-scroll-x]` are wide on purpose).
|
|
14
|
+
- [ ] The button-overflow audit (below) on the changed pages, every language; look at each finding.
|
|
15
|
+
- [ ] Every language: the longest labels (English, Vietnamese…) wrap inside their buttons; Japanese headings break
|
|
16
|
+
between phrases; fonts have the glyphs of every language (a font without Vietnamese or Japanese glyphs falls
|
|
17
|
+
back mid-word and looks broken).
|
|
18
|
+
- [ ] Network panel on load: no video bytes before a click; images WebP and sized for 2x.
|
|
19
|
+
- [ ] Every QR on the page or in a picture opens a page that exists.
|
|
20
|
+
- [ ] The project's own gate (lint, typecheck, build, tests, e2e) is green; screenshots of the result shown to the
|
|
21
|
+
user.
|
|
22
|
+
|
|
23
|
+
## Button-overflow audit
|
|
24
|
+
|
|
25
|
+
A headless-browser script (puppeteer-core or Playwright with the installed Chrome) that opens each page at several
|
|
26
|
+
widths and languages and reports buttons whose label spills out, that stick out of their frame, or that pass the
|
|
27
|
+
screen edge. Write it once per project (scripts/ or the e2e folder).
|
|
28
|
+
|
|
29
|
+
**Inputs** (env or arguments): `BASE` (required), `ROUTES` (default `/`), `WIDTHS` (default
|
|
30
|
+
`320,360,375,390,414,768,1024,1280`), `LOCALES` and how the site picks its language (e.g. a localStorage key written
|
|
31
|
+
before the page loads with `evaluateOnNewDocument`, or a URL prefix), `COOKIE` for signed-in pages.
|
|
32
|
+
|
|
33
|
+
**Per page**: viewport `width × 900` at device scale 1; `goto` with `networkidle2`; scroll through the page once
|
|
34
|
+
(600 px steps, ~60 ms apart) so scroll-revealed content is there, back to the top, wait ~600 ms; then in the page:
|
|
35
|
+
|
|
36
|
+
1. Candidates: `button, a, [role="button"], [role="switch"], input[type="submit"]`. Skip anything inside
|
|
37
|
+
`[data-scroll-x]`, `.table-scroll`, `[aria-hidden="true"]` or `.sr-only`, anything hidden (`display: none`,
|
|
38
|
+
`visibility: hidden`, opacity 0) or smaller than 4 × 4 px. Keep only what looks like a button: a `<button>`, a
|
|
39
|
+
button or switch role, or a non-transparent background, a border, or a box shadow (plain text links are not
|
|
40
|
+
audited).
|
|
41
|
+
2. **Content vs box**: the bounding box of a Range over the element's contents. Problem when it passes the
|
|
42
|
+
element's box by more than 1.5 px left or right ("content wider than box"), else top or bottom ("content taller"),
|
|
43
|
+
else when `scrollWidth − clientWidth > 1` without `text-overflow: ellipsis`.
|
|
44
|
+
3. **Out of frame**: walk up the ancestors to the first one that is drawn (background, border or shadow) or clips
|
|
45
|
+
(`overflow-x` not visible) and is narrower than the viewport; problem when the button passes it by more than
|
|
46
|
+
1.5 px on either side. Stop at the first such frame.
|
|
47
|
+
4. **Off screen**: the button's box past `0` or the viewport width by more than 1 px.
|
|
48
|
+
|
|
49
|
+
**Report**: group identical findings (route + label + problems with the numbers masked) and list the widths and
|
|
50
|
+
languages where each occurs, with the element's classes; print the count and exit non-zero when there are findings.
|
|
51
|
+
|
|
52
|
+
**Known false positives** (look at each, do not "fix" blindly): a collapsed panel inside an `overflow-hidden` button
|
|
53
|
+
(its hidden text counts as content), `sr-only` text inside a step label, a fixed sheet compared with the card under
|
|
54
|
+
it.
|
|
55
|
+
|
|
56
|
+
Fixes, in order of preference: `max-w-full` on the button (every button of the style has it), `min-w-0` and a
|
|
57
|
+
truncating label in narrow tiles, shorter copy agreed with the user, a container query where the column is narrow on
|
|
58
|
+
a wide screen.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# g6-style imagery: photos, real screens, video
|
|
2
|
+
|
|
3
|
+
The style mixes three kinds of picture. Use each where it is strongest:
|
|
4
|
+
|
|
5
|
+
| Kind | Where | Why |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| Real screen captures of the product, in CSS phones | hero stack, "more than X", product tour | proof: the visitor sees the actual product, not an illustration |
|
|
8
|
+
| Generated photos in the gold light | "N ways" (a hand tapping a card), closing CTA (an atrium) | mood and the human moment; same warm gold as the UI |
|
|
9
|
+
| CSS-drawn mini scenes | the animated tiles (QR, NFC, wallet, URL) | crisp at any size, theme-aware, cost no download |
|
|
10
|
+
|
|
11
|
+
## Generating photos with `codex exec`
|
|
12
|
+
|
|
13
|
+
Work in a folder outside the repo (e.g. `<project>/videos/landing-gold/`), put reference images in `ref/`, write
|
|
14
|
+
the brief to `prompt.md`, then run (codex's built-in `image_gen` tool, no API key needed):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cd <work-folder>
|
|
18
|
+
codex exec -s workspace-write --skip-git-repo-check \
|
|
19
|
+
-i ref/mood.png -i ref/layout.png -o last-message.md - < prompt.md > codex.log 2>&1
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Ask in the brief for: the exact file names, the aspect (`wide landscape 16:9, at least 1600 px` / `vertical 9:16
|
|
23
|
+
about 941x1672`), "check each result yourself and regenerate if it breaks a rule", and an `image-prompts.md` with
|
|
24
|
+
the final prompts. A mood photo the user gives (e.g. a real department-store atrium) is a MOOD reference only:
|
|
25
|
+
"do NOT copy this building, invent an original space, no recognisable real building, no store names".
|
|
26
|
+
|
|
27
|
+
Prompts that worked (adapt the subject):
|
|
28
|
+
|
|
29
|
+
- **Atrium (closing CTA)**: *photorealistic architectural interior, wide 16:9: an original luxurious multi-storey
|
|
30
|
+
atrium in Tokyo at evening, ivory and cream stone, slim champagne-gold metal fins and balustrades, a luminous
|
|
31
|
+
skylight made of a fine triangular lattice glowing warm white, thin warm gold LED light lines along each floor
|
|
32
|
+
edge, criss-crossing escalators in the middle distance, polished light floor with soft reflections. Symmetric,
|
|
33
|
+
calm, premium. The centre of the frame must be quiet enough for white headline text over a dark overlay. A few
|
|
34
|
+
people far away, small and motion-blurred, no faces. No text, no letters, no logos, no shop signs.*
|
|
35
|
+
- **Hand + device (a "tap" moment)**: *photorealistic, vertical 9:16: one hand holds a matte black card with a very
|
|
36
|
+
thin champagne-gold edge against the upper BACK of another person's smartphone; the phone's FRONT SCREEN FACES THE
|
|
37
|
+
CAMERA, slightly angled; physically plausible (the card touches the rear upper edge, never through the screen). The
|
|
38
|
+
phone screen is completely blank, uniform, flat very light grey, no UI, no reflections, all four screen corners
|
|
39
|
+
clearly visible and not covered by fingers. A soft warm champagne-gold glow at the contact point. Warm evening
|
|
40
|
+
interior, cream and gold, blurred gold bokeh. Realistic hands. No text, no logos.*
|
|
41
|
+
|
|
42
|
+
Always: "No text, no letters, no logos, no watermarks" (generated text is garbage and logos are a legal risk), and
|
|
43
|
+
blank screens / blank cards so the real product goes on them.
|
|
44
|
+
|
|
45
|
+
## A real screen into a generated phone
|
|
46
|
+
|
|
47
|
+
1. **Capture** the app at phone width (e.g. 390 px at 3x → 1170×2532, or 900×1948 stills from a recording).
|
|
48
|
+
2. **Find the screen in the photo** with a small script (Node or Python; read the pixels with ffmpeg as raw RGB24,
|
|
49
|
+
or with any image library). Input: the photo, a seed pixel inside the blank screen (look at the photo), the
|
|
50
|
+
capture's width and height, a tolerance (default 48). Method:
|
|
51
|
+
1. The screen's colour = the average of a 9×9 window around the seed.
|
|
52
|
+
2. Flood fill (4-neighbour) from the seed over pixels whose `|ΔR| + |ΔG| + |ΔB|` to that colour is below the
|
|
53
|
+
tolerance. Fewer than ~1000 pixels means a bad seed: stop and say so.
|
|
54
|
+
3. Boundary pixels = filled pixels with a non-filled neighbour.
|
|
55
|
+
4. First guess of the four corners (a phone held roughly upright, tilts up to ~40°): the boundary points with the
|
|
56
|
+
smallest `x + y` (top left), `−x + y` (top right), `−x − y` (bottom right), `x − y` (bottom left).
|
|
57
|
+
5. For each side, fit a line (total least squares, angle `½·atan2(2·Sxy, Sxx − Syy)` through the mean) to the
|
|
58
|
+
boundary points between 20 % and 80 % of the way from one corner to the next and within 25 px of that segment:
|
|
59
|
+
the rounded corners are left out. The four line intersections are the sharp corners. Repeat this step 3 times.
|
|
60
|
+
6. Homography from the capture rectangle `(0,0) (w,0) (w,h) (0,h)` to the corners `tl tr br bl`: the usual
|
|
61
|
+
8 × 8 linear system (Gaussian elimination with pivoting), then the CSS `matrix3d` in column-major order:
|
|
62
|
+
`h0, h3, 0, h6, h1, h4, 0, h7, 0, 0, 1, 0, h2, h5, 0, 1`.
|
|
63
|
+
7. Print JSON `{ width, height, corners, matrix3d }`.
|
|
64
|
+
3. **Composite** in a small HTML page rendered by headless Chrome at the photo's size (`--headless=new
|
|
65
|
+
--disable-gpu --hide-scrollbars --force-device-scale-factor=1 --window-size=W,H --screenshot=out.png
|
|
66
|
+
file://…/composite.html`), body `margin: 0; overflow: hidden` at exactly the photo's size:
|
|
67
|
+
- the photo as an absolute image filling the page;
|
|
68
|
+
- optionally a glow where a card meets the phone: a 300 px circle centred on that point,
|
|
69
|
+
`radial-gradient(circle, rgba(255,226,160,.95) 0%, rgba(242,199,110,.55) 26%, rgba(184,134,44,.18) 52%,
|
|
70
|
+
rgba(184,134,44,0) 70%)`, `mix-blend-mode: screen; opacity: .55`;
|
|
71
|
+
- the screen: a div of the capture's size at `left: 0; top: 0`, `transform-origin: 0 0; transform:
|
|
72
|
+
matrix3d(…)`, `overflow: hidden; border-radius: ~12 % of the capture's width; background: #fff`, holding the
|
|
73
|
+
capture, a warm wash `linear-gradient(160deg, rgba(255,236,200,.1), rgba(255,214,150,.06) 55%,
|
|
74
|
+
rgba(60,40,10,.08))` and a soft sheen `linear-gradient(120deg, transparent 30%, rgba(255,255,255,.16) 42%,
|
|
75
|
+
transparent 54%)` so the screen sits in the room's light; a dynamic island (`#0b0906`, 210 × 62 px pill,
|
|
76
|
+
34 px from the top) when the capture has no status bar of its own.
|
|
77
|
+
Then `cwebp -q 78`.
|
|
78
|
+
4. **Look at the result zoomed in**: the screen must sit exactly in the bezel; if it leaks, lower the tolerance or
|
|
79
|
+
move the seed (raise the tolerance for a screen with a soft gradient).
|
|
80
|
+
|
|
81
|
+
## Video (when the page has any)
|
|
82
|
+
|
|
83
|
+
- Every video plays only when the visitor presses play: `preload="none"` + a poster, a dialog (sections.md, Video
|
|
84
|
+
dialog) or an inline player with controls. A looping product tour starts on ▶, not on scroll.
|
|
85
|
+
- Re-encode: `ffmpeg -i in.mp4 -vf scale=720:1280:flags=lanczos -c:v libx264 -profile:v high -preset slow -crf 27
|
|
86
|
+
-pix_fmt yuv420p -movflags +faststart -c:a aac -b:a 96k out.mp4` (a 45 s vertical promo ≈ 2.5–3 MB). Silent screen
|
|
87
|
+
clips: `-vf scale=540:-2 -an -crf 29` (≈ 100–300 KB each). Poster: one frame, `-c:v libwebp -quality 76`.
|
|
88
|
+
- Captions burned in, so it reads with the sound off; say on the page what the video contains (length, narration).
|
|
89
|
+
- Serve every byte from the site's own origin.
|
|
90
|
+
|
|
91
|
+
## QR codes in pictures
|
|
92
|
+
|
|
93
|
+
A QR in a screenshot points wherever the capture was made (often a demo account that does not exist on the live
|
|
94
|
+
site): a visitor who scans it lands on a 404. Replace it before publishing: generate a QR of the real home page
|
|
95
|
+
(`qrcode` npm, `toFile(…, { width, margin: 0 })`), measure the old code's box (dark-pixel bounds), overlay with
|
|
96
|
+
ffmpeg (`overlay=x:y`, `scale=…:flags=neighbor`). QRs drawn by the page itself: generate them from the site's own
|
|
97
|
+
origin at runtime, lazily (`import('qrcode')` when the element comes near).
|
|
98
|
+
|
|
99
|
+
## Images on the page
|
|
100
|
+
|
|
101
|
+
WebP, sized to what they show at 2x (screens 600 px wide, photos ~940 px or 1600 px wide for full-width bands);
|
|
102
|
+
`next/image` with `fill` + `sizes`; one map file for every image with its alt text per language; "写真はイメージです"
|
|
103
|
+
/ "photo for illustration" on generated photos, "画面はデモ用サンプルです" / "demo data" on screens with made-up data.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# g6-style motion
|
|
2
|
+
|
|
3
|
+
Easings, every animation and its keyframes, the reduced-motion rule and the few JavaScript loops. The rules for when
|
|
4
|
+
to use which are in `SKILL.md` (Motion rules); this file holds the numbers.
|
|
5
|
+
|
|
6
|
+
## 1. Easings and the reveal
|
|
7
|
+
|
|
8
|
+
| Token | Value | Use |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| `--ease-glide` | `cubic-bezier(0.22, 1, 0.36, 1)` | Entrances, hovers, list and tour transitions |
|
|
11
|
+
| `--ease-pop` | `cubic-bezier(0.34, 1.56, 0.64, 1)` | Things that land with a small overshoot: toast, pass, switch knob, icon tile hover scale |
|
|
12
|
+
|
|
13
|
+
Hover on cards: `transition-[transform,box-shadow] duration-300 ease-glide hover:-translate-y-1 hover:shadow-float`
|
|
14
|
+
(benefit cards `-translate-y-0.5`); the icon tile inside scales to 110 % with `ease-pop`.
|
|
15
|
+
|
|
16
|
+
**Reveal** (below the fold, framer-motion): `initial={{ opacity: 0, y: 16 }}`, `whileInView={{ opacity: 1, y: 0 }}`,
|
|
17
|
+
`viewport={{ once: true }}`, 0.5 s, glide ease, optional `delay` (tile `index × 0.08`, a 2-column grid
|
|
18
|
+
`(index % 2) × 0.06 + floor(index / 2) × 0.05`). With reduced motion: no delay. About ten lines; never
|
|
19
|
+
use it on the hero (see §2).
|
|
20
|
+
|
|
21
|
+
## 2. Animation tokens (`@theme`)
|
|
22
|
+
|
|
23
|
+
| Utility | Value | What it does |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `animate-rise` | `rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both` | First-paint entrance: from `opacity 0, translateY(18px)` to none. Stagger with an inline `animationDelay` of `0.08 s + 0.09 s × step`. |
|
|
26
|
+
| `animate-flow` | `flow 5s ease-in-out infinite` | `background-position` 0 % 0 % → 100 % 100 % → back; with `bg-[length:200%_200%]` a light band travels through a metallic gradient |
|
|
27
|
+
| `animate-shimmer` | `shimmer 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite` | A band crossing: `translateX(-120%)` → `translateX(260%)` |
|
|
28
|
+
| `animate-glow-pulse` | `glow-pulse 2.4s ease-in-out infinite` | Opacity .5 → 1 → .5 with scale 1 → 1.1 → 1: the halo behind a logo or a play button |
|
|
29
|
+
| `animate-pop-in` | `pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both` | 0 % `opacity 0, scale(.6)`, 60 % `opacity 1, scale(1.08)`, 100 % `scale(1)`: dialogs (`open:animate-pop-in`) |
|
|
30
|
+
| `animate-aurora` | `aurora 16s ease-in-out infinite alternate` | 0 % `translate3d(0,0,0) scale(1)`, 50 % `translate3d(5%,-4%,0) scale(1.08)`, 100 % `translate3d(-4%,5%,0) scale(.95)`: soft pools of light |
|
|
31
|
+
| `animate-drift` | `drift 6s ease-in-out infinite` | `translateY` 0 → -10px → 0: floating chips and phones (offset the phase with a negative `animation-delay`) |
|
|
32
|
+
| `animate-marquee` | `marquee 40s linear infinite` | `translateX(0)` → `translateX(-50%)` over a row duplicated twice |
|
|
33
|
+
| `animate-tap` | `tap 5s ease-out infinite` | A finger tap: 0–28 % `opacity 0, scale(.4)`; 32 % `opacity .85, scale(.6)`; 48–100 % `opacity 0, scale(1.9)` |
|
|
34
|
+
| `animate-toast` | `toast 5s cubic-bezier(0.34, 1.56, 0.64, 1) infinite` | 0–36 % `opacity 0, translateY(14px) scale(.92)`; 44–86 % visible, no transform; 94–100 % `opacity 0, translateY(-6px)`. Same 5 s clock as `tap`, so it answers the tap. |
|
|
35
|
+
| `animate-scan` | `scan 2.6s ease-in-out infinite` | `translateY(0)` → `translateY(var(--scan-travel, 100%))` → back. Set `--scan-travel` to the height the line runs over (e.g. `[--scan-travel:5.9rem]` over a 104 px QR). |
|
|
36
|
+
|
|
37
|
+
Large soft light is always a radial gradient (`bg-[radial-gradient(closest-side,rgb(242_199_110/.32),transparent)]`)
|
|
38
|
+
on a rounded div with `animate-aurora`, never `filter: blur()`: blur on big layers is what makes phones stutter.
|
|
39
|
+
|
|
40
|
+
## 3. Story loops of the "N ways" tiles
|
|
41
|
+
|
|
42
|
+
Each loops on its own clock. Their **static style is the end state** (the card on the phone, the page open, the pass
|
|
43
|
+
up): with reduced motion only that static style stays (§6). Design every new loop that way.
|
|
44
|
+
|
|
45
|
+
**NFC** (4.8 s; card on a glide ease, rings ease-out, banner on the pop ease, page ease-in-out):
|
|
46
|
+
|
|
47
|
+
| Class | Static style | Keyframes |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| `.nfc-card` | `transform: rotate(-10deg)` | 0 % `opacity 0, translate(-75%, 35%) rotate(-22deg)`; 12 % `opacity 1`; 32–72 % `opacity 1, rotate(-10deg)`; 92–100 % back to the 0 % state |
|
|
50
|
+
| `.nfc-ring` | `opacity: 0` | 0–31 % `opacity 0, scale(.3)`; 36 % `opacity .9, scale(.5)`; 58–100 % `opacity 0, scale(1.9)`. Two rings, the second `animation-delay: .18s`, thinner border |
|
|
51
|
+
| `.nfc-banner` | (visible) | 0–36 % `opacity 0, translateY(-140%)`; 44–88 % visible; 96–100 % hidden again |
|
|
52
|
+
| `.nfc-page` | (visible) | 0–52 % `opacity 0`; 62–90 % `opacity 1`; 100 % `opacity 0` |
|
|
53
|
+
|
|
54
|
+
**Wallet** (5.2 s; pass on a glide ease, QR ease-in-out, tap ease-out):
|
|
55
|
+
|
|
56
|
+
| Class | Static style | Keyframes |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `.wallet-pass` | (risen) | 0–24 % `translateY(var(--stack-y, 58%))`; 38–84 % `none`; 96–100 % back in the stack |
|
|
59
|
+
| `.wallet-qr` | (visible) | 0–34 % `opacity 0, scale(.8)`; 44–84 % visible; 92–100 % `opacity 0` |
|
|
60
|
+
| `.wallet-tap` | `opacity: 0` | 0–12 % `opacity 0, scale(.4)`; 16 % `opacity .85, scale(.6)`; 30–100 % `opacity 0, scale(1.8)` |
|
|
61
|
+
|
|
62
|
+
**Value flip** (6 s, glide ease; a title that changed, static = the new one):
|
|
63
|
+
`.swap-out` static `opacity 0`; 0 % `opacity 0`, 6–38 % visible, 46–100 % `opacity 0, translateY(-110%)`.
|
|
64
|
+
`.swap-in` 0–38 % `opacity 0, translateY(110%)`, 46–92 % visible, 100 % `opacity 0`.
|
|
65
|
+
|
|
66
|
+
**An edit going live** (3.6 s): `.fill-bar` (glide) 0 % `scaleX(0)`, 45–88 % `scaleX(1)` opacity 1, 100 % opacity 0
|
|
67
|
+
(`origin-left`); `.fill-tick` (pop) 0–42 % `opacity 0, scale(.7)`, 52–90 % visible, 100 % `opacity 0`.
|
|
68
|
+
|
|
69
|
+
## 4. Lines of light meeting at one card
|
|
70
|
+
|
|
71
|
+
SVG under the tile row (desktop only), `viewBox="0 0 1000 120"`, one path per tile from its centre to the middle:
|
|
72
|
+
`M{x} 0 C {x} 80, 500 30, 500 120` with `x` = 125, 375, 625, 875 for four columns. Each path is drawn twice with
|
|
73
|
+
`pathLength="100"`:
|
|
74
|
+
|
|
75
|
+
- `.way-line`: `fill: none; stroke: var(--c-way-line); stroke-width: 1.5; stroke-dasharray: 1 2.2` (dotted).
|
|
76
|
+
- `.way-light`: `fill: none; stroke: var(--c-way-light); stroke-width: 3; stroke-linecap: round;
|
|
77
|
+
stroke-dasharray: 14 200; stroke-dashoffset: 14; filter: drop-shadow(0 0 6px var(--c-way-glow));
|
|
78
|
+
animation: way-light 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite` with `stroke-dashoffset` 14 → -100, and a
|
|
79
|
+
delay of `i × 0.35 s` per path so the lights arrive one after the other.
|
|
80
|
+
|
|
81
|
+
## 5. A field filled by the app (OCR, autofill)
|
|
82
|
+
|
|
83
|
+
- `.fill-in`: `animation: fill-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) both`. 0 %: `color: transparent;
|
|
84
|
+
text-shadow: 0 0 10px var(--c-gold-ink); background-color: rgb(242 199 110 / .16); box-shadow: 0 0 0 3px
|
|
85
|
+
rgb(242 199 110 / .55), 0 0 22px rgb(242 199 110 / .4)`. 45 %: `color: transparent; text-shadow: 0 0 3px
|
|
86
|
+
var(--c-title)`. 100 %: `text-shadow: 0 0 0 transparent`. The text comes in from a blur and the field glows gold
|
|
87
|
+
once.
|
|
88
|
+
- `.scan-down`: a line running down over a photo while it is read (absolute, `h-0.5`, in a relative box).
|
|
89
|
+
`top: 0; animation: scan-down 1.4s ease-in-out infinite alternate`, `top` 0 → `calc(100% - 2px)`.
|
|
90
|
+
|
|
91
|
+
The behaviour around it is in `sections.md` (Small controls).
|
|
92
|
+
|
|
93
|
+
## 6. Reduced motion
|
|
94
|
+
|
|
95
|
+
```css
|
|
96
|
+
@media (prefers-reduced-motion: reduce) {
|
|
97
|
+
*, *::before, *::after {
|
|
98
|
+
animation-duration: 1ms !important; animation-iteration-count: 1 !important;
|
|
99
|
+
transition-duration: 1ms !important; scroll-behavior: auto !important;
|
|
100
|
+
}
|
|
101
|
+
.animate-rise { animation-delay: 0s !important; }
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
1 ms, not `animation: none`: end states with `both` fill still apply (the hero text is visible at once), and story
|
|
106
|
+
loops (no fill) fall back to their static end state. Only the entrance loses its delay: a real delay elsewhere may be
|
|
107
|
+
a fallback timer. In JavaScript, `useReducedMotion()` turns off the pointer tilt, the scroll spread and the typing
|
|
108
|
+
loop, and the Reveal delay.
|
|
109
|
+
|
|
110
|
+
## 7. JavaScript loops (only while visible)
|
|
111
|
+
|
|
112
|
+
- **Typing address** (URL tile): `useInView(ref, { amount: 0.6 })` and not reduced motion → type one character every
|
|
113
|
+
90 ms with a 1 px blinking caret, then "loading" (a `bg-cta` bar `h-0.5` scaling 0 → 1 over 700 ms, `origin-left`),
|
|
114
|
+
after 800 ms "done" (bar fades, the mini page fades in over 500 ms), next round 3.6 s after typing ended. Off screen
|
|
115
|
+
or reduced: the full address and the page, still. Clear every interval and timeout in the effect's cleanup.
|
|
116
|
+
- **Product tour**: plays only after a press (▶ or a step) and only while `useInView(ref, { amount: 0.4 })`; see
|
|
117
|
+
`sections.md` §5.
|
|
118
|
+
- **Pointer tilt / scroll spread** (hero): framer-motion `useMotionValue` + `useSpring` and `useScroll` +
|
|
119
|
+
`useTransform`; numbers in `sections.md` §1.
|
|
120
|
+
- **Lazy libraries**: anything heavy for a decorative stage (the QR generator) loads with `import()` when the element
|
|
121
|
+
comes near (`useInView(ref, { once: true, margin: '200px' })`), never with the page.
|