AI Character Landing Page
Create a showcase single-page landing site for any AI assistant / virtual character: GitHub Pages deployable, strong animations, native chat integration, face or video hero. This skill is a universal recipe, not tied to any specific brand or repository.
When to Use
- User says: make a character landing page / AI personality site / virtual human showcase / single page with a face as hero / GitHub Pages demo with chat
- Requires: Vite SPA + animations + (optional) Three / video loop + native chat + Pages deployment
- Do not use for: generic corporate website templates, pure documentation sites, multi-route dashboards, or directly modifying a repository the user has marked as "backup, do not touch"
Hard Rules (Non-Negotiable)
-
New repository, never overwrite a backup
- Each new character / version → create a new public repository (e.g.,
character-landing,character-landing-face). - If the user specifies a repository as "backup / do not touch", forbid pushing, modifying workflows, Pages settings, or secrets.
- Old repository Actions secrets will not automatically copy to the new repository; they must be re-added after creation.
- Each new character / version → create a new public repository (e.g.,
-
Design first
- Start with a one-page design brief (mood, color palette, section pacing, Hero format: static face / video loop / 3D), then write code.
- Adjacent sections must have different layout rhythms (close-up / two-column / horizontal scroll / full-width narrative / spec sheet / closing… rotate).
-
Generic, keyless, no private paths
- The recipe and example code must not contain real API keys, absolute local paths, or personal email addresses.
- Keys go only into
.env.local(gitignored) or GitHub Actions secrets; public Pages will expose allVITE_*variables, which is acceptable for assignment demos but must be noted in the README with a recommendation to rotate.
-
Single page
- Only one route:
/. Details via drawers, overlays, or anchor-scroll; no secondary pages.
- Only one route:
Tech Stack (Default)
| Layer | Choice |
|---|---|
| Build | Vite + TypeScript (strict) |
| Animation | GSAP + ScrollTrigger + Lenis |
| 3D (optional) | Three.js (image rig / simple plate preferred over heavy models) |
| Styling | CSS variables + minimal modules; frosted glass must control contrast |
| Deployment | GitHub Pages (base: './' or base: '/<repo>/') |
| Chat | Native UI (forbidden to embed official chat via iframe) → Dify app-key → (optional) Vendor API → fakeBrain |
Node ≥ 20. Always use pnpm view / npm view to confirm the stable version; do not hardcode version numbers from memory.
Workflow
Phase 0 — Clarification & Repository
- Character name, personality, compliance (adult virtual character; no reproduction of real people's likeness; no sexualization).
- Hero format: static face / Jimeng (Jimeng) video loop / lightweight 3D.
- Whether to connect real chat (Dify app-key / vendor Ark-like API / only fake intelligence).
gh repo create <owner>/<new-name> --public --clone(or equivalent); confirm it is not pointing to a backup repository.- Write
.gitignore:node_modules/,dist/,.env.local,.preview-out/.
Phase 1 — Skeleton
<repo>/
index.html
package.json
vite.config.ts # base adapted for Pages
.env.example # placeholder names only, no real values
public/img/… # character assets
src/main.ts
src/sections/…
src/ui/askbar.ts # native chat bar
src/lib/difyClient.ts
src/lib/fakeBrain.ts
src/three/… # optional
src/styles/
.github/workflows/deploy.yml
README.md
- Lenis + single scroll progress
p ∈ [0,1](or section anchors) drives animations; follow elements use springs, not cheap lerp. - Character layer
position: fixed(or equivalent); content layer transparently wraps around.
Phase 2 — Hero: Face Forbidden Zone + Gaze
Face Forbidden Zone
- Center of the first screen is reserved for the face / video; forbid placing dual dialog boxes, heavy HUDs, or large titles over facial features.
- Text and CTAs in safe margins (top/bottom/corners); ability bubbles can float at the edges, but must not cover eyes or mouth.
- Face interaction / pointer feedback only in the face proxy area; lock conflict during scrolling (single pointer, single logic).
Scroll-freeze gaze
- Pointer movement → eye tracking (spring + deadzone + occasional saccade).
- Freeze gaze target when the user scrolls (or heavily reduce weight) to prevent eyeball jitter during scrolling.
- Speaking / listening / thinking states can override gaze; return to center when released.
prefers-reduced-motion: disable tracking and large animations.
Phase 3 — Video Loop (Jimeng)
- Use Jimeng (or similar) to generate a short loop: same character, stable composition, prefer watermarked-free; export and convert to webp/mp4.
<video muted playsinline loop autoplay>; include a static poster frame.- On mobile, may degrade to static image; be mindful of file size and LCP.
- In the recipe, only write "use video generation tool to create idle loop"; do not include specific account details or local paths.
Phase 4 — Native Chat (No iframe)
Forbidden to embed official web chat via iframe. Build native askbar:
- Input field + message list + streaming typing.
- Recommended chain order: Dify (app-key) → optional vendor API → fakeBrain.
- Without a key, fakeBrain must be fully playable (intent library + product knowledge + multi-turn memory).
- When speaking, dispatch custom events (e.g.,
character:speaking) to drive mouth / halo; reset upon completion.
Dify app-key path
- Environment variable example names:
VITE_DIFY_API_KEY,VITE_DIFY_BASE_URL(default officialhttps://api.dify.ai/v1). - Local:
.env.local; Pages: Actions secret injected at build time. - Use app type key for chat-messages SSE; handle
conversation_idfor continuing conversations. - On failure, automatically fall back to fakeBrain; CORS / network errors must not cause a blank screen.
Phase 5 — Visual Quality
Frosted contrast
- Cards with
backdrop-filter: blur(...)must ensure text contrast (light text on sufficiently dark semi-transparent background, or vice versa). - Meta / title bars in ability areas tend to "float and become unreadable" — use solid colors or higher opacity backing, not pure transparent blur.
- Avoid high-frequency flashing animations (infinite back-and-forth color/opacity/shadow); looping animation cycles should be ≥ 4s.
Dual-dialog bug
- Common accident: Hero retains one set of chat UI, and the scrolling stage has another → face blocked, two input fields, state mismatch.
- Keep only one chat root node on the entire page; Hero should only use short greeting bubbles (read-only) or no bubbles at all.
- When migrating the askbar, delete the old mount point and search for duplicate
id/ duplicate listeners.
Phase 6 — GitHub Pages
// vite.config.ts
export default defineConfig({
base: './', // or '/<repo-name>/'
})
- All resource URLs must use
import.meta.env.BASE_URL + 'img/...'; never hardcode/img/...(sub-paths will 404). - Workflow:
actions/configure-pages+upload-pages-artifact+deploy-pages;permissions: pages: write, id-token: write. - First time: in repository Settings → Pages, allow Actions deployment (or use
enablementwithin workflow). - Never modify backup repository's Pages settings or secrets.
Phase 7 — Verification & Delivery
Go through each item in examples/checklist.md. Deliverables: repository URL, Pages URL, README (installation, face/video swap guide, environment variables, degradation notes), known issues table.
Verification Checklist (Summary)
Full details in examples/checklist.md. Minimum requirements:
- Character face/video visible within 0.5s on the first screen; no dialog blocks the face in the forbidden zone.
- Gaze does not jitter during scrolling; face interaction / follow-up feels correct.
- Only one chat entry on the entire page; fake intelligence provides a complete experience.
- Dify/API failure automatically degrades; no blank screen without a key.
- Text in frosted glass areas is readable.
-
pnpm build/npm run buildsucceeds; Pages resources have no 404 errors (BASE_URL). - No modifications to any "backup, do not touch" repository.
- No keys or private paths committed to git.
Common Failures Table
| Symptom | Cause | Action |
|---|---|---|
| Images/video 404 on Pages | Hardcoded absolute path /img/... | Use import.meta.env.BASE_URL; check base |
| Two input fields on the first screen | Dual dialog residue | Delete old mount point; keep only one askbar root |
| Face blocked by bubbles/HUD | Face Forbidden Zone not set | Move UI to safe margins; shorten greeting or move to chatStage |
| Eyeball twitch during scrolling | Scroll did not freeze gaze | Freeze / reduce gaze target weight during scroll |
| Frosted glass text gray and unreadable | Insufficient contrast | Increase background alpha or add solid color backing |
| Real chat works locally but fails on Pages | Secret not injected or CORS issue | Inject VITE_* via Actions; production should use backend proxy |
| Connected Dify but still getting fake responses | Wrong key type or BASE_URL | Use app key; verify /v1/chat-messages |
| Broke old demo while editing | Pushed to backup repository | Stop; restore from backup; work on a new repository |
| Video not looping / not playing on iOS | Missing muted playsinline | Add attributes; include a static poster frame |
| Chinese title scrambled in animation | Scramble-type effect on Chinese text | Disable scramble for Chinese characters |
Chat & Compliance Reminder
- The character must be an original adult virtual character; no reproduction of identifiable features of real people.
- No sexualization, sexual innuendo, or close-ups of private areas.
- Tribute pages must include a prominent disclaimer: unofficial, not affiliated with the original company.
- Do not commit production keys to public repositories;
VITE_Demo keys for assignments must note the risk in the README and recommend rotation after submission.
Trigger Example
When a user says "Make a landing page for AI bot X with a face as hero, with chat, and deploy on GitHub Pages" → activate this skill, starting from Phase 0.