feat: 优化后台界面与报表样式
This commit is contained in:
1206
.agents/skills/design-taste-frontend/SKILL.md
Normal file
1206
.agents/skills/design-taste-frontend/SKILL.md
Normal file
@@ -0,0 +1,1206 @@
|
||||
---
|
||||
name: design-taste-frontend
|
||||
description: Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.
|
||||
---
|
||||
|
||||
# tasteskill: Anti-Slop Frontend Skill
|
||||
|
||||
> Landing pages, portfolios, and redesigns. Not dashboards, not data tables, not multi-step product UI.
|
||||
> Every rule below is **contextual**. None of it fires automatically. First read the brief, then pull only what fits.
|
||||
|
||||
---
|
||||
|
||||
## 0. BRIEF INFERENCE (Read the Room Before Anything Else)
|
||||
|
||||
Before touching code or tweaking dials, **infer what the user actually wants**. Most LLM design output is bad because the model jumps to a default aesthetic instead of reading the room.
|
||||
|
||||
### 0.A Read these signals first
|
||||
1. **Page kind** - landing (SaaS / consumer / agency / event), portfolio (dev / designer / creative studio), redesign (preserve vs overhaul), editorial / blog.
|
||||
2. **Vibe words** the user used - "minimalist", "calm", "Linear-style", "Awwwards", "brutalist", "premium consumer", "Apple-y", "playful", "serious B2B", "editorial", "agency-y", "glassy", "dark tech".
|
||||
3. **Reference signals** - URLs they linked, screenshots they pasted, products they named, brands they're competing with.
|
||||
4. **Audience** - B2B procurement panel vs. design-conscious consumer vs. recruiter scanning a portfolio. The audience picks the aesthetic, not your taste.
|
||||
5. **Brand assets that already exist** - logo, color, type, photography. For redesigns, these are starting material, not optional input (see Section 11).
|
||||
6. **Quiet constraints** - accessibility-first audiences, public-sector, regulated industries, trust-first commerce, kids' products. These constraints OVERRIDE aesthetic preference.
|
||||
|
||||
### 0.B Output a one-line "Design Read" before generating
|
||||
Before any code, state in one line: **"Reading this as: \<page kind> for \<audience>, with a \<vibe> language, leaning toward \<design system or aesthetic family>."**
|
||||
|
||||
Example reads:
|
||||
- *"Reading this as: B2B SaaS landing for technical buyers, with a Linear-style minimalist language, leaning toward Tailwind utilities + Geist + restrained motion."*
|
||||
- *"Reading this as: solo designer portfolio for hiring managers, with an editorial / kinetic-type language, leaning toward native CSS + scroll-driven animation + custom typography."*
|
||||
- *"Reading this as: redesign of a public-sector service site, with a trust-first language, leaning toward GOV.UK Frontend or USWDS."*
|
||||
|
||||
### 0.C If the brief is ambiguous, ask one question, do not guess
|
||||
Ask exactly **one** clarifying question - never a multi-question dump - and only when the design read genuinely diverges. Example: *"Should this feel closer to Linear-clean or Awwwards-experimental?"*
|
||||
|
||||
If you can confidently infer from context, **do not ask**. Just declare the design read and proceed.
|
||||
|
||||
### 0.D Anti-Default Discipline
|
||||
Do not default to: AI-purple gradients, centered hero over dark mesh, three equal feature cards, generic glassmorphism on everything, infinite-loop micro-animations everywhere, Inter + slate-900. These are the LLM defaults. Reach past them deliberately based on the design read.
|
||||
|
||||
---
|
||||
|
||||
## 1. THE THREE DIALS (Core Configuration)
|
||||
|
||||
After the design read, set three dials. Every layout, motion, and density decision below is gated by these.
|
||||
|
||||
* **`DESIGN_VARIANCE: 8`** - 1 = Perfect Symmetry, 10 = Artsy Chaos
|
||||
* **`MOTION_INTENSITY: 6`** - 1 = Static, 10 = Cinematic / Physics
|
||||
* **`VISUAL_DENSITY: 4`** - 1 = Art Gallery / Airy, 10 = Cockpit / Packed Data
|
||||
|
||||
**Baseline:** `8 / 6 / 4`. Use these unless the design read overrides them. Do not ask the user to edit this file - overrides happen conversationally.
|
||||
|
||||
### 1.A Dial Inference (design read → dial values)
|
||||
| Signal | VARIANCE | MOTION | DENSITY |
|
||||
|---|---|---|---|
|
||||
| "minimalist / clean / calm / editorial / Linear-style" | 5-6 | 3-4 | 2-3 |
|
||||
| "premium consumer / Apple-y / luxury / brand" | 7-8 | 5-7 | 3-4 |
|
||||
| "playful / wild / Dribbble / Awwwards / experimental / agency" | 9-10 | 8-10 | 3-4 |
|
||||
| "landing page / portfolio / marketing site (default)" | 7-9 | 6-8 | 3-5 |
|
||||
| "trust-first / public-sector / regulated / accessibility-critical" | 3-4 | 2-3 | 4-5 |
|
||||
| "redesign - preserve" | match existing | +1 | match existing |
|
||||
| "redesign - overhaul" | +2 | +2 | match existing |
|
||||
|
||||
### 1.B Use-Case Presets
|
||||
| Use case | VARIANCE | MOTION | DENSITY |
|
||||
|---|---|---|---|
|
||||
| Landing (SaaS, mainstream) | 7 | 6 | 4 |
|
||||
| Landing (Agency / creative) | 9 | 8 | 3 |
|
||||
| Landing (Premium consumer) | 7 | 6 | 3 |
|
||||
| Portfolio (Designer / studio) | 8 | 7 | 3 |
|
||||
| Portfolio (Developer) | 6 | 5 | 4 |
|
||||
| Editorial / Blog | 6 | 4 | 3 |
|
||||
| Public-sector service | 3 | 2 | 5 |
|
||||
| Redesign - preserve | match | match+1 | match |
|
||||
| Redesign - overhaul | +2 | +2 | match |
|
||||
|
||||
### 1.C How the Dials Drive Output
|
||||
Use these (or user-overridden values) as global variables. Cross-references throughout this document refer to these exact variable names - never invent aliases like `LAYOUT_VARIANCE` or `ANIM_LEVEL`.
|
||||
|
||||
---
|
||||
|
||||
## 2. BRIEF → DESIGN SYSTEM MAP
|
||||
|
||||
Once you have the design read (Section 0) and dials (Section 1), pick the right foundation. Do not invent CSS for things that have an official package. Do not pretend an aesthetic trend is an official system.
|
||||
|
||||
### 2.A When to reach for a real design system (use official packages)
|
||||
| Brief reads as… | Reach for | Why |
|
||||
|---|---|---|
|
||||
| Microsoft / enterprise SaaS / dashboards | `@fluentui/react-components` or `@fluentui/web-components` | Official Fluent UI, Microsoft tokens, accessibility done |
|
||||
| Google-ish UI, Material-flavored product | `@material/web` + Material 3 tokens | Official, theme-able via Material Theming |
|
||||
| IBM-style B2B / enterprise analytics | `@carbon/react` + `@carbon/styles` | Official Carbon, mature data-density patterns |
|
||||
| Shopify app surfaces | `polaris.js` web components / Polaris React | Required for Shopify admin UI |
|
||||
| Atlassian / Jira-style product | `@atlaskit/*` + `@atlaskit/tokens` | Official Atlassian DS |
|
||||
| GitHub-style devtool / community page | `@primer/css` or `@primer/react-brand` | Official Primer; Brand variant for marketing |
|
||||
| Public-sector UK service | `govuk-frontend` | Legally / regulatorily expected |
|
||||
| US public-sector / trust-first | `uswds` | Same |
|
||||
| Fast local-business / agency MVP | Bootstrap 5.3 | Boring, fast, works |
|
||||
| Modern accessible React foundation | `@radix-ui/themes` | Primitives + polished theme |
|
||||
| Modern SaaS where you own the components | shadcn/ui (`npx shadcn@latest add ...`) | You own the code, easy to customise; never ship default state |
|
||||
| Tailwind-based modern SaaS / AI marketing | Tailwind v4 utilities + `dark:` variant | Default for indie + small team builds |
|
||||
|
||||
**Honesty rule:** if the brief reads as one of the systems above, install and use the **official** package. Do not recreate its CSS by hand. Do not import a system's tokens but then override 90% of them.
|
||||
|
||||
**One system per project.** Do not mix Fluent React with Carbon in the same tree. Do not import shadcn/ui components into a Material 3 app.
|
||||
|
||||
### 2.B When the brief is an aesthetic, not a system
|
||||
For these directions, there is **no single official package**. Build with native CSS + Tailwind + a maintained component library. Be honest in code comments about what is borrowed inspiration vs. official material.
|
||||
|
||||
| Aesthetic | Honest implementation |
|
||||
|---|---|
|
||||
| Glassmorphism / "frosted glass" | `backdrop-filter`, layered borders, highlight overlays. Provide solid-fill fallback for `prefers-reduced-transparency`. |
|
||||
| Bento (Apple-style tile grids) | CSS Grid with mixed cell sizes. No single library owns this. |
|
||||
| Brutalism | Native CSS, monospace, raw borders. No library. |
|
||||
| Editorial / magazine | Serif type, asymmetric grid, generous whitespace. No library. |
|
||||
| Dark tech / hacker | Mono + accent neon, terminal motifs. No library. |
|
||||
| Aurora / mesh gradients | SVG or layered radial gradients. No library. |
|
||||
| Kinetic typography | Native CSS animations, scroll-driven animations, GSAP for hijacks. No library. |
|
||||
| **Apple Liquid Glass** | Apple documents this for Apple platforms only. **There is no official `liquid-glass.css`.** Web implementations are approximations using `backdrop-filter` + layered borders + highlights. Label clearly as approximation. |
|
||||
|
||||
---
|
||||
|
||||
## 3. DEFAULT ARCHITECTURE & CONVENTIONS
|
||||
|
||||
Unless the design read picks a real design system (Section 2.A), these are the defaults:
|
||||
|
||||
### 3.A Stack
|
||||
* **Framework:** React or Next.js. Default to Server Components (RSC).
|
||||
* **RSC SAFETY:** Global state works ONLY in Client Components. In Next.js, wrap providers in a `"use client"` component.
|
||||
* **INTERACTIVITY ISOLATION:** Any component using Motion, scroll listeners, or pointer physics MUST be an isolated leaf with `'use client'` at the top. Server Components render static layouts only.
|
||||
* **Styling:** **Tailwind v4** (default). Tailwind v3 only if the existing project demands it.
|
||||
* For v4: do NOT use `tailwindcss` plugin in `postcss.config.js`. Use `@tailwindcss/postcss` or the Vite plugin.
|
||||
* **Animation:** **Motion** (the library formerly known as Framer Motion). Import from `motion/react` (`import { motion } from "motion/react"`). The `framer-motion` package still works as a legacy alias - prefer `motion/react` in new code.
|
||||
* **Fonts:** Always use `next/font` (Next.js) or self-host with `@font-face` + `font-display: swap`. Never link Google Fonts via `<link>` in production.
|
||||
|
||||
### 3.B State
|
||||
* Local `useState` / `useReducer` for isolated UI.
|
||||
* Global state ONLY for deep prop-drilling avoidance - Zustand, Jotai, or React context.
|
||||
* **NEVER** use `useState` to track continuous values driven by user input (mouse position, scroll progress, pointer physics, magnetic hover). Use Motion's `useMotionValue` / `useTransform` / `useScroll`. `useState` re-renders the React tree on every change and collapses on mobile.
|
||||
|
||||
### 3.C Icons
|
||||
* **Allowed libraries (priority order):** `@phosphor-icons/react`, `hugeicons-react`, `@radix-ui/react-icons`, `@tabler/icons-react`.
|
||||
* **Discouraged:** `lucide-react`. Acceptable only when the user explicitly asks for it or the project already depends on it.
|
||||
* **NEVER hand-roll SVG icons.** If a glyph is missing, install a second library or compose from primitives - do not draw icon paths from scratch.
|
||||
* **One family per project.** Do not mix Phosphor with Lucide in the same component tree.
|
||||
* **Standardize `strokeWidth` globally** (e.g. `1.5` or `2.0`).
|
||||
|
||||
### 3.D Emoji Policy
|
||||
Discouraged by default in code, markup, and visible text. Replace symbols with icon-library glyphs. **Override:** allow emojis only when the user explicitly asks for a playful / chat-style / social-native vibe - and even then use them sparingly with intent.
|
||||
|
||||
### 3.E Responsiveness & Layout Mechanics
|
||||
* Standardize breakpoints (`sm 640`, `md 768`, `lg 1024`, `xl 1280`, `2xl 1536`).
|
||||
* Contain page layouts using `max-w-[1400px] mx-auto` or `max-w-7xl`.
|
||||
* **Viewport Stability:** NEVER use `h-screen` for full-height Hero sections. ALWAYS use `min-h-[100dvh]` to prevent layout jumping on mobile (iOS Safari address bar).
|
||||
* **Grid over Flex-Math:** NEVER use complex flexbox percentage math (`w-[calc(33%-1rem)]`). ALWAYS use CSS Grid (`grid grid-cols-1 md:grid-cols-3 gap-6`).
|
||||
|
||||
### 3.F Dependency Verification (mandatory)
|
||||
Before importing ANY 3rd-party library, check `package.json`. If the package is missing, output the install command first. **Never** assume a library exists.
|
||||
|
||||
---
|
||||
|
||||
## 4. DESIGN ENGINEERING DIRECTIVES (Bias Correction)
|
||||
|
||||
LLMs default to clichés. Override these defaults proactively. Each rule has a context-aware override path.
|
||||
|
||||
### 4.1 Typography
|
||||
* **Display / Headlines:** Default `text-4xl md:text-6xl tracking-tighter leading-none`.
|
||||
* **Body / Paragraphs:** Default `text-base text-gray-600 leading-relaxed max-w-[65ch]`.
|
||||
* **Sans font choice:**
|
||||
* **Discouraged as default:** `Inter`. Pick `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`, or a brand-appropriate serif first.
|
||||
* **Override:** Inter is acceptable when the user explicitly asks for a neutral / standard / Linear-style feel, or when the brief is a public-sector / accessibility-first site.
|
||||
* **Pairings to know:** `Geist` + `Geist Mono`, `Satoshi` + `JetBrains Mono`, `Cabinet Grotesk` + `Inter Tight`, `GT America` + `IBM Plex Mono`.
|
||||
|
||||
* **SERIF DISCIPLINE (VERY DISCOURAGED AS DEFAULT):**
|
||||
* Serif is **very discouraged as the default font for any project.** "It feels creative / premium / editorial" is NOT a reason to reach for serif. The agent's default mental model that "creative brief = serif" is the single most-tested AI tell in production rounds.
|
||||
* **Serif is only acceptable when ONE of these is explicitly true:**
|
||||
- The brand brief literally names a serif font, OR
|
||||
- The aesthetic family is genuinely editorial / luxury / publication / manuscript / heritage / vintage AND you can articulate why this specific serif fits this specific brand
|
||||
* For everything else (creative agency, design studio, modern brand, premium consumer, portfolio, lifestyle), **default sans-serif display** (Geist Display, ABC Diatype, Söhne Breit, Cabinet Grotesk Display, Migra Sans, GT Walsheim, Inter Display, PP Neue Montreal). Sans display fonts are not "boring" — they are the default for the same reason black is the default in fashion.
|
||||
* **EMPHASIS RULE (related):** When you want to emphasize a word within a headline (the kinetic "and `spatial` design" type move), use **italic or bold of the SAME font**. Do NOT inject a random serif word into a sans headline (or vice versa) just to add visual interest. Mixed-family emphasis is amateur. Italic/bold emphasis in the same family is the right move.
|
||||
* **Specifically BANNED as defaults:** `Fraunces` and `Instrument_Serif` (the two LLM-favorite display serifs).
|
||||
* **If a serif is justified** (rare, per the above), rotate from this pool, do NOT reuse the same serif across consecutive projects: PP Editorial New, GT Sectra Display, Cardinal Grotesque, Reckless Neue, Tiempos Headline, Recoleta, Cormorant Garamond, Playfair Display, EB Garamond, IvyPresto, Migra, Editorial Old, Saol Display, Söhne Breit Kursiv, Domaine Display, Canela, Schnyder, Tobias, NB Architekt, ITC Galliard.
|
||||
|
||||
* **ITALIC DESCENDER CLEARANCE (mandatory):** When italic is used in display type and the word contains a descender letter (`y g j p q`), `leading-[1]` or `leading-none` will clip the descender. Use `leading-[1.1]` minimum and add `pb-1` or `mb-1` reserve on the wrapping element. Audit every italic word in display headlines before shipping.
|
||||
|
||||
### 4.2 Color Calibration
|
||||
* Max 1 accent color. Saturation < 80% by default.
|
||||
* **THE LILA RULE:** The "AI Purple / Blue glow" aesthetic is discouraged as a default. No automatic purple button glows, no random neon gradients. Use neutral bases (Zinc / Slate / Stone) with high-contrast singular accents (Emerald, Electric Blue, Deep Rose, Burnt Orange, etc.).
|
||||
* **Override:** if the brand or brief explicitly asks for purple / violet / lila, embrace it. But execute with intent: consistent palette, harmonised neutrals, restrained gradients. Not generic AI gradient slop.
|
||||
* **One palette per project.** Do not fluctuate between warm and cool grays within the same project.
|
||||
* **COLOR CONSISTENCY LOCK (mandatory):** Once an accent color is chosen for a page, it is used on the WHOLE page. A warm-grey site does not suddenly get a blue CTA in section 7. A rose-accented site does not get a teal status badge in the footer. Pick one accent, lock it, audit every component before shipping.
|
||||
|
||||
* **PREMIUM-CONSUMER PALETTE BAN (mandatory, second-most-recurring AI-tell):**
|
||||
* For premium-consumer briefs (cookware, wellness, artisan, luxury, heritage craft, DTC home goods, etc.) the LLM default is **warm beige/cream + brass/clay/oxblood/ochre + espresso/ink dark text**. Concretely banned hex families as default backgrounds and accents:
|
||||
- Backgrounds: `#f5f1ea`, `#f7f5f1`, `#fbf8f1`, `#efeae0`, `#ece6db`, `#faf7f1`, `#e8dfcb` (all "warm paper / cream / chalk / bone")
|
||||
- Accents: `#b08947`, `#b6553a`, `#9a2436`, `#9c6e2a`, `#bc7c3a`, `#7d5621` (all "brass / clay / oxblood / ochre")
|
||||
- Text: `#1a1714`, `#1a1814`, `#1b1814` (all "espresso / warm near-black")
|
||||
* This palette is BANNED as the default reach for premium-consumer briefs. Every premium-consumer site you have ever shipped uses this exact palette. The brand becomes invisible.
|
||||
* **Default alternatives (rotate, do not reuse):**
|
||||
- **Cold Luxury:** silver-grey + chrome + smoke (think Tesla, Apple Watch Hermes-without-the-leather)
|
||||
- **Forest:** deep green + bone + amber accent (think Filson, Patagonia premium)
|
||||
- **Black and Tan:** true off-black + warm tan, sharp contrast, no beige
|
||||
- **Cobalt + Cream:** saturated blue against a single neutral, no brass
|
||||
- **Terracotta + Slate:** warm rust against cool grey, no brass
|
||||
- **Olive + Brick + Paper:** muted olive plus brick-red accent
|
||||
- **Pure monochrome + single saturated pop:** off-white + off-black + one bright accent (electric blue, emerald, hot pink, etc.)
|
||||
* **Palette-rotation rule:** if the previous premium-consumer project you generated used the beige+brass family, this one MUST use a different family. Do not ship the same warm-craft palette twice in a row.
|
||||
* **Override:** the beige+brass+espresso palette is acceptable ONLY when the brand brief explicitly names those colors, or when the brand identity is genuinely vintage / artisan / warm-craft AND you can articulate why this specific palette fits this specific brand. Default-reaching for it because "this is a cookware brief" is banned.
|
||||
|
||||
### 4.3 Layout Diversification
|
||||
* **ANTI-CENTER BIAS:** Centered Hero / H1 sections are avoided when `DESIGN_VARIANCE > 4`. Force "Split Screen" (50/50), "Left-aligned content / right-aligned asset", "Asymmetric white-space", or scroll-pinned structures.
|
||||
* **Override:** centered hero is OK for editorial / manifesto / launch-announcement briefs where the message itself is the design.
|
||||
|
||||
### 4.4 Materiality, Shadows, Cards
|
||||
* Use cards ONLY when elevation communicates real hierarchy. Otherwise group with `border-t`, `divide-y`, or negative space.
|
||||
* When a shadow is used, tint it to the background hue. No pure-black drop shadows on light backgrounds.
|
||||
* For `VISUAL_DENSITY > 7`: generic card containers are banned. Data metrics breathe in plain layout.
|
||||
* **SHAPE CONSISTENCY LOCK (mandatory):** Pick ONE corner-radius scale for the page and stick to it. Options: all-sharp (radius 0), all-soft (radius 12-16px), all-pill (full radius for interactive). Mixed systems are allowed only when there is a documented rule (e.g. "buttons are full-pill, cards are 16px, inputs are 8px") and that rule is followed everywhere. Round buttons in a square layout, or square cards on a pill-button page, is broken design.
|
||||
|
||||
### 4.5 Interactive UI States
|
||||
LLMs default to "static successful state only." Always implement full cycles:
|
||||
* **Loading:** Skeletal loaders matching the final layout's shape. Avoid generic circular spinners.
|
||||
* **Empty States:** Beautifully composed; indicate how to populate.
|
||||
* **Error States:** Clear, inline (forms), or contextual (toasts only for transient).
|
||||
* **Tactile Feedback:** On `:active`, use `-translate-y-[1px]` or `scale-[0.98]` to simulate a physical push.
|
||||
* **BUTTON CONTRAST CHECK (mandatory, a11y):** Before shipping any button, verify the button text is readable against the button background. White button + white text, `bg-white` CTA with `text-white` label, transparent button against the page background with no border → all banned. Audit every CTA: contrast ratio WCAG AA min (4.5:1 for body, 3:1 for large text 18px+). Same rule applies to ghost buttons over photographic backgrounds (use a backdrop, scrim, or stroke).
|
||||
* **CTA BUTTON WRAP BAN (mandatory):** Button text MUST fit on one line at desktop. If a label like "VIEW SELECTED WORK" wraps to 2 or 3 lines, the button is broken. Fix by EITHER shortening the label (3 words max for primary CTAs, ideally 1-2) OR widening the button (do not artificially constrain `max-width` on CTAs). Wrapped CTAs at desktop are a Pre-Flight Fail.
|
||||
* **NO DUPLICATE CTA INTENT (mandatory):** Two CTAs with the same intent on one page is a Pre-Flight Fail. Examples of same intent: "Get in touch" + "Contact us" + "Let's talk" + "Start a project" + "Start something" + "Reach out" = all "contact" intent → pick ONE label and use it everywhere on the page (nav, hero, footer). Same for "Try free" + "Get started" + "Sign up free" (all "signup" intent) and "View work" + "See selected work" + "Browse projects" (all "portfolio" intent). One label per intent.
|
||||
* **FORM CONTRAST CHECK (mandatory, a11y):** Form inputs, placeholder text, focus rings, helper text, and error text all pass WCAG AA contrast against the section background. Light placeholders on a near-white form, white form on white page section, form labels grayer than 4.5:1 contrast → all banned. Audit every form before shipping.
|
||||
|
||||
### 4.6 Data & Form Patterns
|
||||
* Label ABOVE input. Helper text optional but present in markup. Error text BELOW input. Standard `gap-2` for input blocks.
|
||||
* No placeholder-as-label. Ever.
|
||||
|
||||
### 4.7 Layout Discipline (Hard Rules. Failing any of these is shipping broken work)
|
||||
|
||||
* **Hero MUST fit in the initial viewport.** Headline max 2 lines on desktop, subtext max **20 words** AND max 3-4 lines, CTAs visible without scroll. If the copy is too long: reduce font scale OR cut copy. If you cannot describe the value-prop in 20 words of subtext, the value-prop is unclear, not the rule too tight. Never let the hero overflow and force scroll to find the CTA.
|
||||
* **Hero font-scale discipline.** Plan font size and image size *together*. If the hero asset is large and the headline is more than 6 words, do not start at `text-7xl/text-8xl`. Default sensible range: `text-4xl md:text-5xl lg:text-6xl` for most heroes; `text-6xl md:text-7xl` only when the headline is 3-5 words. A 4-line hero headline is always a font-size error, never a copy-length error.
|
||||
* **HERO TOP PADDING CAP (mandatory):** Hero top padding max `pt-24` (≈6rem) at desktop. More than that means the hero content floats halfway down the viewport and reads as a layout bug, not as intentional space. If your hero needs more breathing room, increase font scale or asset size, not top padding.
|
||||
* **HERO STACK DISCIPLINE (max 4 text elements).** The hero is a single moment, not a feature list. Allowed text elements, max 4 in total:
|
||||
1. Eyebrow (small uppercase label) OR brand strip OR neither - pick zero or one
|
||||
2. Headline (max 2 lines, see above)
|
||||
3. Subtext (max 20 words, max 4 lines)
|
||||
4. CTAs (1 primary + max 1 secondary)
|
||||
- **BANNED in the hero:** tiny tagline below CTAs ("Works with GitHub, GitLab, and self-hosted Git"), trust micro-strip ("Used by engineering teams at..."), pricing teaser ("Free for solo, $10/user for teams"), feature bullet list, social-proof avatar row. All of those move to dedicated sections directly below the hero.
|
||||
- If you have an eyebrow AND a tagline below CTAs in the same hero, drop the tagline. If you have a brand strip AND a tagline, drop the tagline. One small text element per hero, max.
|
||||
* **"Used by" / "Trusted by" logo wall belongs UNDER the hero, never inside it.** The hero is for the value prop and primary CTA. The logo wall is a separate section directly below. Do not stuff trust logos into the same flex row as the hero copy.
|
||||
* **Navigation MUST render on a single line on desktop.** If items don't fit at `lg` (1024px), condense labels, drop secondary items, or move to a hamburger. A two-line nav at desktop is broken design.
|
||||
* **Navigation height cap: 80px max desktop, default 64-72px.** No huge "agency" nav bars that eat 15% of the viewport.
|
||||
* **Bento grids MUST have rhythm, not one-sided repetition.** Do not stack 6 left-image / right-text rows. Vary the composition: alternate full-width feature rows, asymmetric tile sizes, vertical breaks.
|
||||
* **BENTO CELL COUNT RULE (mandatory):** A bento grid has EXACTLY as many cells as you have content for. 3 items → 3 cells (1+2 split, or 2+1, or asymmetric trio). 5 items → 5 cells (2+3, 3+2, hero+4, etc.). If your grid has an empty cell in the middle or at the end, you planned wrong. Re-shape the grid; do not paste a blank tile.
|
||||
* **Section-Layout-Repetition Ban.** Once you use a layout family for a section (e.g., 3-column-image-cards, full-width-quote, split-text-image), that family can appear at most ONCE on the page. "Selected commissions" must not look like "What we do." A landing page with 8 sections must use at least 4 different layout families.
|
||||
* **ZIGZAG ALTERNATION CAP (mandatory).** Alternating "left-image + right-text" then "left-text + right-image" zigzag layout = banal. Max 2 sections in a row with this image+text-split pattern. The 3rd consecutive image+text split is a Pre-Flight Fail. Break the pattern with a full-width section, a vertical-stack section, a bento grid, a marquee, or a different layout family.
|
||||
* **EYEBROW RESTRAINT (mandatory, the #1 violated rule in production tests).** An "eyebrow" is the small uppercase wide-tracking label sitting above a section headline (e.g. `FOUR COLORWAYS`, `SELECTED WORK`, `THE HARDWARE`, `Git-native task management`). Typical CSS signature: `text-[11px] uppercase tracking-[0.18em]`, `font-mono text-[10.5px] uppercase tracking-[0.22em]`. Every AI-built site puts an eyebrow above EVERY section header, producing the same templated rhythm. Hard rule:
|
||||
- **Maximum 1 eyebrow per 3 sections.** Hero counts as 1. So a page with 9 sections may use at most 3 eyebrows total.
|
||||
- If section A has an eyebrow, the next 2 sections cannot have one.
|
||||
- **Pre-Flight Check is mechanical:** count instances of `uppercase tracking` (or similar small-caps mono labels above headlines) across all section components. If count > ceil(sectionCount / 3), the output fails.
|
||||
- **What to do instead of an eyebrow:** drop it entirely. The headline alone is enough. If you need to categorize a section, the section's location on the page already categorizes it; no label needed.
|
||||
* **SPLIT-HEADER BAN (mandatory).** The pattern "left big headline + right small explainer paragraph" as a section header (left col-span-7/8, right col-span-4/5 with a small body paragraph floating in the right column) is **banned as default**. Sections should have ONE focused message. If you genuinely need both a headline and an explainer paragraph, stack them vertically (headline on top, body below, max-width 65ch). Reach for the split-header pattern only when there is a real compositional reason (e.g., the right column carries a visual or interactive element, not just filler text).
|
||||
* **Bento Background Diversity (mandatory).** Bento and feature-grid sections cannot be 6 white-on-white cards with text inside. At least 2-3 cells in any multi-cell grid need real visual variation: a real image, a brand-appropriate gradient (not AI-purple), a pattern, a tinted background. A cream-on-cream bento with only typography inside reads as boring AI default, even when the rest of the page is good.
|
||||
* **Mobile collapse must be explicit per section.** For every multi-column layout, declare the `< 768px` fallback in the same component. No "it'll work, Tailwind handles it" assumptions.
|
||||
|
||||
### 4.8 Image & Visual Asset Strategy
|
||||
|
||||
Landing pages and portfolios are **visual products**. Text-only pages with fake-screenshot divs are slop.
|
||||
|
||||
**Priority order for visual assets:**
|
||||
1. **Image-generation tool first.** If ANY image-gen tool is available in the environment (`generate_image`, MCP image tool, IDE-integrated gen, OpenAI image tools, etc.) you MUST use it to create section-specific assets: hero photography, product shots, texture backgrounds, mood images. Generate at the right aspect ratio for the section. Do not skip this step because hand-rolled CSS feels faster.
|
||||
2. **Real web images second.** When no gen tool is available, use real photography sources. Acceptable defaults:
|
||||
* `https://picsum.photos/seed/{descriptive-seed}/{w}/{h}` for placeholder photography (seed should describe the section, e.g. `marrow-cookware-kitchen`)
|
||||
* Actual stock or brand URLs when the brief provides them
|
||||
* Open-license sources (Unsplash via direct URL, Pexels) if explicitly allowed
|
||||
3. **Last resort: tell the user.** If neither is possible, do NOT fill the page with hand-rolled SVG illustrations or div-based "fake screenshots." Instead, leave clearly-labeled placeholder slots (`<!-- TODO: hero product photo, 1600x1200 -->`) and at the end of the response say: *"This page needs real images at: \[list of placements\]. Please generate or provide them."*
|
||||
|
||||
**Even minimalist sites need real images.** A pure-text page is not minimalism. It is incomplete work. Even an editorial Linear-style site needs at least 2-3 real images (hero, one product/lifestyle shot, one supporting image). Generate B&W minimalist photography if the brief is restrained; do not skip images entirely because the dial is low.
|
||||
|
||||
**Real company logos for social proof.** When the brief calls for a "Trusted by / Used by / Customers" logo wall, do NOT default to plain text wordmarks (`<span>Acme Co</span>` styled in a row). Use real SVG logos:
|
||||
* **Source: Simple Icons** (`https://cdn.simpleicons.org/{slug}/ffffff` for any color, or `simple-icons` npm package). Covers most known brands.
|
||||
* **Alternative: devicon** for tech-stack logos (`@svgr/cli` or CDN).
|
||||
* **Make-up the brand name? Then make-up an SVG mark too.** Generate a simple monogram (one letter in a circle, two-letter ligature, abstract glyph) rendered as an inline `<svg>` matching the page style. Plain text wordmarks for invented brand names look generic.
|
||||
* **Always** ensure logos render in both light and dark mode (white-on-dark, black-on-light, or single-color theme variable).
|
||||
* **LOGO-ONLY rule (mandatory):** logo wall = logos and nothing else. Do NOT print industry / category labels below each logo (no `Vercel` + `hosting` underneath, no `Stripe` + `payments`, no `Cloudflare` + `infra`). The logo is the credibility, the label adds nothing the user does not already know. Optional: brand name as alt-text for screen readers, optional link to the brand's site. That is it.
|
||||
|
||||
**Hand-rolled illustrations:**
|
||||
* SVG icons from libraries: fine (see Section 3.C).
|
||||
* Hand-rolled decorative SVGs (custom illustrations, logos, marks): **strongly discouraged**, never as default. Acceptable only when:
|
||||
- The brief explicitly calls for it ("draw me an SVG logo")
|
||||
- It's a single, simple geometric mark (a square, a circle, a wordmark in display type)
|
||||
- You're confident in the output quality
|
||||
|
||||
**Div-based fake screenshots are banned.** A "hand-built product preview" rendered with `<div>` rectangles, fake task lists, fake dashboards, fake terminal windows is a Tell. If you need to show a product:
|
||||
* Use a real screenshot URL if one exists
|
||||
* Generate one via image tool
|
||||
* Use a real component preview (an actual mini-version of the UI inside the page)
|
||||
* Or skip the preview entirely and use editorial photography
|
||||
|
||||
**Hero needs a real visual.** Text + gradient blob is not a hero - it's a placeholder.
|
||||
|
||||
### 4.9 Content Density
|
||||
|
||||
Landing pages live on the **first impression**, not the full read. Cut ruthlessly.
|
||||
|
||||
* **Default content shape per section:** short headline (≤ 8 words) + short sub-paragraph (≤ 25 words) + one visual asset OR one CTA. Anything more must be justified by the section's job.
|
||||
* **No data-dump sections.** A 20-row publication table, a 30-row award list, a giant pricing matrix on a marketing page = wrong layout. Use:
|
||||
- Top 3-5 highlights + "View full list" link
|
||||
- Marquee / carousel for breadth
|
||||
- Different page entirely if the data is the product
|
||||
* **Long lists need a different UI component, not a longer list.** Default `<ul>` with bullets / `divide-y` rows is the lazy choice. If you have > 5 items, reach for one of these instead:
|
||||
- 2-column split with grouped items
|
||||
- Card grid with image + label per item
|
||||
- Tabs / accordion if items are categorisable
|
||||
- Horizontal scroll-snap pills
|
||||
- Carousel for breadth-heavy lists (testimonials, logos, capabilities)
|
||||
- Marquee for "lots-of-things-that-don't-need-individual-attention"
|
||||
A spec sheet with 10 rows + a hairline under every row is the WORST default. Either group rows into 2-3 chunks with sparse dividers, or move to a card-per-spec layout.
|
||||
* **Spec sheets specifically (the Marrow-cookware pattern).** A long product specification table with `border-b` on every row is the AI default for cookware / hardware / apparel / artisan-goods briefs. Banned. Concrete alternatives:
|
||||
- **2-col card grid:** each spec gets its own card with the spec name, the value (large display number), and a one-line "why it matters" body. Cards arranged 2-col on desktop, 1-col mobile.
|
||||
- **Scroll-snap horizontal pills:** each spec is a pill, user can flick through.
|
||||
- **Grouped chunks:** group 10 specs into 3 logical clusters (e.g. "Materials", "Cooking", "Warranty"), each cluster gets ONE soft divider and a cluster heading.
|
||||
- **Featured-vs-rest:** 3-4 hero specs visualised as large display tiles, the rest collapsed under a "View full specifications" disclosure.
|
||||
|
||||
* **COPY SELF-AUDIT (mandatory before ship):** Before declaring any task done, re-read every visible string on the page (headlines, subheads, eyebrows, button labels, body copy, captions, alt text, footer text, error messages). Flag any string that is:
|
||||
- **Grammatically broken** ("free on its past", "two plans but one is honest", "to put it on the table" out of context)
|
||||
- **Has unclear referents** ("we plan to stay that way" without prior context)
|
||||
- **Sounds like AI hallucination** (cute-but-wrong wordplay, forced metaphors that don't track, "elegant nothing" phrases)
|
||||
- **Reads like an LLM trying to sound thoughtful** (passive-aggressive humility, fake-craftsman labels, mock-poetic micro-meta)
|
||||
Rewrite every flagged string. If unsure whether a string makes sense, replace it with a plain functional sentence. AI-generated cute copy is worse than boring copy.
|
||||
* **Fake-precise numbers are flagged.** Numbers like `92%`, `4.1×`, `48k`, `5.8 mm`, `13.4 lb` either:
|
||||
- Come from real data (brief, brand guidelines, public metrics) - fine
|
||||
- Are explicitly labeled as mock (`<!-- mock -->`, "example", "sample data") - fine
|
||||
- Are AI-invented spec aesthetics - banned. Don't fake engineering precision the brand doesn't claim.
|
||||
* **One copy register per page.** Don't mix technical mono ("47 tasks · 0.6 ctx-switches/day"), editorial prose, and marketing punch in the same composition unless the brand voice explicitly calls for it.
|
||||
|
||||
### 4.10 Quotes & Testimonials
|
||||
|
||||
* **Max 3 lines** of quote body. Never 6. If the original quote is longer → cut it. A landing-page quote is a snippet, not the full review.
|
||||
* For very small font sizes (e.g. footer-style testimonials), the line cap can stretch slightly. Spirit: "fits in a glance."
|
||||
* **No em-dashes inside the quote text** as design flourish (long pauses, kinetic em-dashes, em-dash-bullets). See Section 9.G - em-dash is completely banned.
|
||||
* Attribution: name + role + (optionally) company. Never name only ("- Sarah").
|
||||
* Quote marks: use real typographic quotes ( " " ) or none at all. Not straight ASCII ( " ).
|
||||
|
||||
### 4.11 Page Theme Lock (Light / Dark Mode Consistency)
|
||||
|
||||
The page has ONE theme. Sections do not invert.
|
||||
|
||||
* If the page is dark mode, ALL sections are dark mode. No light-mode-warm-paper section sandwiched between dark sections (or vice versa). The user must not feel they walked into a different website mid-scroll.
|
||||
* The exception: if the brief explicitly calls for a "Color Block Story" or "Theme Switch on Scroll" device AND that is a deliberate composition (one full theme switch with a strong transition, not random alternation), it is allowed once per page.
|
||||
* Default behaviour: pick light, dark, or auto (`prefers-color-scheme`) at the page level and lock it. Section-level background tints within the same theme family are fine (`bg-zinc-950` next to `bg-zinc-900`); flipping to `bg-amber-50` in the middle of a `bg-zinc-950` page is broken.
|
||||
* When using a design system with built-in theming (Radix Themes, shadcn/ui with `<Theme>`), set the theme ONCE in `layout.tsx` or the page root. Do not let individual sections override.
|
||||
|
||||
---
|
||||
|
||||
## 5. CONTEXT-AWARE PROACTIVITY
|
||||
|
||||
These are tools, not defaults. Use them when the design read calls for them. **None of these fire automatically.**
|
||||
|
||||
* **Liquid Glass / Glassmorphism:** Appropriate for premium consumer, Apple-adjacent, luxury brand, or media-overlay vibes. Inappropriate for dashboards, public-sector, or "boring B2B." When used, go beyond `backdrop-blur`: add a 1px inner border (`border-white/10`) and a subtle inner shadow (`shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]`) for physical edge refraction. Provide a solid-fill fallback under `prefers-reduced-transparency`.
|
||||
* **Magnetic Micro-physics:** Use when `MOTION_INTENSITY > 5` AND the brief reads premium / playful / agency. Implement EXCLUSIVELY with Motion's `useMotionValue` / `useTransform` outside the React render cycle. Never `useState`. See Section 3.B.
|
||||
* **Perpetual Micro-Interactions** (Pulse, Typewriter, Float, Shimmer, Carousel): Use when `MOTION_INTENSITY > 5` AND the section actively benefits from motion (status indicators, live feeds, AI-feel). **Not every card needs an infinite loop.** If a section is informational, leave it still. Apply Spring Physics (`type: "spring", stiffness: 100, damping: 20`) - no linear easing.
|
||||
* **"Motion claimed, motion shown."** If `MOTION_INTENSITY > 4`, the page must actually move: entry transitions on hero, scroll-reveal on key sections, hover physics on CTAs, at minimum. A static page that claims `MOTION_INTENSITY: 7` is broken. Conversely, if you cannot ship working motion in the available scope, drop the dial to 3 and ship a clean static page. Never half-build motion that breaks (cut-off ScrollTriggers, jumpy enters, missing cleanups).
|
||||
* **MOTION MUST BE MOTIVATED (mandatory).** Before adding any animation, ask: "what does this animation communicate?" Valid answers: hierarchy (drawing attention to the right thing), storytelling (revealing content in sequence that matches a narrative), feedback (acknowledging a user action), state transition (showing something changed). Invalid answer: "it looked cool". GSAP everywhere because GSAP is available is amateur. Each ScrollTrigger, each marquee, each pinned section needs a reason. If you cannot articulate the reason in one sentence, drop the animation.
|
||||
* **MARQUEE MAX-ONE-PER-PAGE (mandatory).** Horizontal scrolling text marquees ("logos endlessly scrolling", "manifesto scrolling sideways", "kinetic word strip") are appropriate at most ONCE per page. Two or more marquees on the same page reads as lazy filler. Pick the one section where the marquee actually serves the content; the others get a different layout.
|
||||
* **GSAP Sticky-Stack Pattern (when scroll-stack is used).** A "card stack on scroll" must be a REAL sticky-stack, not a sequential reveal list. See Section 5.A below for the canonical code skeleton. Common failure: trigger fires halfway through scroll instead of pinning at viewport top. Fix: `start: "top top"` not `start: "top center"` or `"top 80%"`.
|
||||
* **GSAP Horizontal-Pan Pattern (when horizontal scroll-hijack is used).** See Section 5.B below for the canonical skeleton. Common failure: animation starts before the section is pinned, so the user sees half a slide. Same fix: `start: "top top"`, pin the wrapper, scrub the inner track.
|
||||
|
||||
### 5.A Sticky-Stack - Canonical Skeleton
|
||||
|
||||
```tsx
|
||||
"use client";
|
||||
import { useRef, useEffect } from "react";
|
||||
import { gsap } from "gsap";
|
||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||
import { useReducedMotion } from "motion/react";
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
|
||||
export function StickyStack({ cards }: { cards: React.ReactNode[] }) {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const reduce = useReducedMotion();
|
||||
|
||||
useEffect(() => {
|
||||
if (reduce || !ref.current) return;
|
||||
const ctx = gsap.context(() => {
|
||||
const cardEls = gsap.utils.toArray<HTMLElement>(".stack-card");
|
||||
cardEls.forEach((card, i) => {
|
||||
if (i === cardEls.length - 1) return;
|
||||
ScrollTrigger.create({
|
||||
trigger: card,
|
||||
start: "top top", // pin at viewport top
|
||||
endTrigger: cardEls[cardEls.length - 1],
|
||||
end: "top top",
|
||||
pin: true,
|
||||
pinSpacing: false,
|
||||
});
|
||||
gsap.to(card, {
|
||||
scale: 0.92,
|
||||
opacity: 0.55,
|
||||
ease: "none",
|
||||
scrollTrigger: {
|
||||
trigger: cardEls[i + 1],
|
||||
start: "top bottom",
|
||||
end: "top top",
|
||||
scrub: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
}, ref);
|
||||
return () => ctx.revert();
|
||||
}, [reduce]);
|
||||
|
||||
return (
|
||||
<div ref={ref} className="relative">
|
||||
{cards.map((card, i) => (
|
||||
<div
|
||||
key={i}
|
||||
className="stack-card sticky top-0 min-h-[100dvh] flex items-center justify-center"
|
||||
>
|
||||
{card}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Critical points: `start: "top top"`, `pin: true`, every card except the last is pinned, the scale/opacity transform is driven by the NEXT card's scroll trigger (so previous card shrinks as next one arrives).
|
||||
|
||||
### 5.B Horizontal-Pan - Canonical Skeleton
|
||||
|
||||
```tsx
|
||||
"use client";
|
||||
import { useRef, useEffect } from "react";
|
||||
import { gsap } from "gsap";
|
||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||
import { useReducedMotion } from "motion/react";
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger);
|
||||
|
||||
export function HorizontalPan({ children }: { children: React.ReactNode }) {
|
||||
const wrap = useRef<HTMLDivElement>(null);
|
||||
const track = useRef<HTMLDivElement>(null);
|
||||
const reduce = useReducedMotion();
|
||||
|
||||
useEffect(() => {
|
||||
if (reduce || !wrap.current || !track.current) return;
|
||||
const ctx = gsap.context(() => {
|
||||
const distance = track.current!.scrollWidth - window.innerWidth;
|
||||
gsap.to(track.current, {
|
||||
x: -distance,
|
||||
ease: "none",
|
||||
scrollTrigger: {
|
||||
trigger: wrap.current,
|
||||
start: "top top", // pin starts when section top hits viewport top
|
||||
end: () => `+=${distance}`, // scroll distance = track width minus viewport
|
||||
pin: true,
|
||||
scrub: 1,
|
||||
invalidateOnRefresh: true,
|
||||
},
|
||||
});
|
||||
}, wrap);
|
||||
return () => ctx.revert();
|
||||
}, [reduce]);
|
||||
|
||||
return (
|
||||
<section ref={wrap} className="relative overflow-hidden">
|
||||
<div ref={track} className="flex h-[100dvh] items-center">
|
||||
{children}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Critical points: `start: "top top"`, `pin: true`, `end: "+=${distance}"` (scroll length = horizontal travel needed), `scrub: 1`. The wrapper is pinned, the inner track slides horizontally as the user scrolls vertically.
|
||||
|
||||
### 5.C Scroll-Reveal Stagger - Canonical Skeleton (lighter alternative)
|
||||
|
||||
For simple "items appear as they enter viewport" (no pinning), prefer Motion's `whileInView` over GSAP - lighter, no ScrollTrigger needed:
|
||||
|
||||
```tsx
|
||||
"use client";
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
|
||||
export function RevealStagger({ items }: { items: string[] }) {
|
||||
const reduce = useReducedMotion();
|
||||
return (
|
||||
<ul className="grid gap-6">
|
||||
{items.map((item, i) => (
|
||||
<motion.li
|
||||
key={item}
|
||||
initial={reduce ? false : { opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.3 }}
|
||||
transition={{
|
||||
duration: 0.6,
|
||||
delay: i * 0.06,
|
||||
ease: [0.16, 1, 0.3, 1],
|
||||
}}
|
||||
>
|
||||
{item}
|
||||
</motion.li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
Use this for: feature lists, testimonial grids, logo walls, anything that just needs "enter on scroll." Save GSAP for actual pin/scrub work.
|
||||
|
||||
### 5.D Forbidden Animation Patterns
|
||||
|
||||
* **`window.addEventListener("scroll", ...)`** is banned. It runs on every scroll frame, jank-prone, no batching. Use Motion's `useScroll()`, GSAP's `ScrollTrigger`, IntersectionObserver, or CSS `scroll-driven animations` (`animation-timeline: view()`).
|
||||
* **Custom scroll progress calculations using `window.scrollY`** in React state. Same reason. Re-renders on every frame.
|
||||
* **`requestAnimationFrame` loops that touch React state.** Use motion values (`useMotionValue` + `useTransform`) instead.
|
||||
* **Layout Transitions:** Use Motion's `layout` and `layoutId` props for visible state changes (re-ordering lists, expanding modals, shared elements between routes). Do not wrap static content in `layout` props "for safety" - it costs measurement work.
|
||||
* **Staggered Orchestration:** Use `staggerChildren` (Motion) or CSS cascade (`animation-delay: calc(var(--index) * 100ms)`) for reveal moments where sequence matters. For `staggerChildren`, parent (`variants`) and children MUST share the same Client Component tree.
|
||||
|
||||
---
|
||||
|
||||
## 6. PERFORMANCE & ACCESSIBILITY GUARDRAILS
|
||||
|
||||
### 6.A Hardware Acceleration
|
||||
* Animate ONLY `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`.
|
||||
* Use `will-change: transform` sparingly - only on elements that will actually animate.
|
||||
|
||||
### 6.B Reduced Motion (mandatory)
|
||||
* **Any motion above `MOTION_INTENSITY > 3` MUST honor `prefers-reduced-motion`.** This is non-negotiable.
|
||||
* In Motion: wrap with `useReducedMotion()` and degrade to static.
|
||||
* In CSS: gate animations behind `@media (prefers-reduced-motion: no-preference)` or provide an override block under `@media (prefers-reduced-motion: reduce)` that disables.
|
||||
* Infinite loops, parallax, scroll-hijack, and magnetic physics MUST collapse to static / instant under reduced motion.
|
||||
|
||||
### 6.C Dark Mode (mandatory for any consumer-facing page)
|
||||
* Design for **both modes from the start**. Never ship light-only or dark-only without explicit user instruction.
|
||||
* Use Tailwind `dark:` variant OR CSS variables for tokens. Pick one strategy per project.
|
||||
* **Do not prescribe specific dark-mode colors here.** The brief decides. Maintain visual hierarchy, brand identity, and WCAG AA contrast (AAA for body) across both modes.
|
||||
* Respect `prefers-color-scheme: dark`. Default to system preference unless the brand insists on one mode.
|
||||
|
||||
### 6.D Core Web Vitals Targets
|
||||
* **LCP** < 2.5s. Hero image must be `next/image priority` or preloaded.
|
||||
* **INP** < 200ms. Heavy work off main thread.
|
||||
* **CLS** < 0.1. Reserve space for images, fonts, embeds.
|
||||
* Run Lighthouse before declaring a page done.
|
||||
|
||||
### 6.E DOM Cost
|
||||
* Apply grain / noise filters EXCLUSIVELY to fixed, `pointer-events-none` pseudo-elements (e.g., `fixed inset-0 z-[60] pointer-events-none`). NEVER on scrolling containers - continuous GPU repaints destroy mobile FPS.
|
||||
* Be aware of bundle size. Motion is not tiny. Three.js is large. Lazy-load anything that's not above-the-fold.
|
||||
|
||||
### 6.F Z-Index Restraint
|
||||
NEVER spam arbitrary `z-50` or `z-10`. Use z-index strictly for systemic layer contexts (sticky navbars, modals, overlays, grain). Document the z-index scale in a project constants file.
|
||||
|
||||
---
|
||||
|
||||
## 7. DIAL DEFINITIONS (Technical Reference)
|
||||
|
||||
### DESIGN_VARIANCE (Level 1-10)
|
||||
* **1-3 (Predictable):** Symmetrical CSS Grid (12-col, equal fr-units), equal paddings, centered alignment.
|
||||
* **4-7 (Offset):** `margin-top: -2rem` overlaps, varied image aspect ratios (4:3 next to 16:9), left-aligned headers over center-aligned data.
|
||||
* **8-10 (Asymmetric):** Masonry layouts, CSS Grid with fractional units (`grid-template-columns: 2fr 1fr 1fr`), massive empty zones (`padding-left: 20vw`).
|
||||
* **MOBILE OVERRIDE:** For levels 4-10, asymmetric layouts above `md:` MUST collapse to strict single-column (`w-full`, `px-4`, `py-8`) on viewports `< 768px`.
|
||||
|
||||
### MOTION_INTENSITY (Level 1-10)
|
||||
* **1-3 (Static):** No automatic animations. CSS `:hover` and `:active` states only. `prefers-reduced-motion` is the default mode anyway.
|
||||
* **4-7 (Fluid CSS):** `transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1)`. `animation-delay` cascades for load-ins. Focus on `transform` and `opacity`.
|
||||
* **8-10 (Advanced Choreography):** Complex scroll-triggered reveals, parallax, scroll-driven animation (CSS `animation-timeline` or GSAP ScrollTrigger). Use Motion hooks. **NEVER use `window.addEventListener('scroll')`** - it is a hard ban, not a "prefer-not." See Section 5.D for the allowed alternatives.
|
||||
|
||||
### VISUAL_DENSITY (Level 1-10)
|
||||
* **1-3 (Art Gallery):** Lots of white space. Huge section gaps (`py-32` to `py-48`). Expensive, clean.
|
||||
* **4-7 (Daily App):** Standard web app spacing (`py-16` to `py-24`).
|
||||
* **8-10 (Cockpit):** Tight paddings. No card boxes; 1px lines separate data. Mandatory: `font-mono` for all numbers.
|
||||
|
||||
---
|
||||
|
||||
## 8. DARK MODE PROTOCOL
|
||||
|
||||
Dual-mode by default. Never assume light-only unless the brief is print-emulating editorial.
|
||||
|
||||
### 8.A Token Strategy (pick one, stick to it)
|
||||
* **Tailwind `dark:` variant** (default for utility-first projects): every color utility paired with its dark variant (`bg-white dark:bg-zinc-950`, `text-gray-900 dark:text-gray-100`).
|
||||
* **CSS variables** (for shadcn/ui, Radix Themes, or component libraries with theming): define semantic tokens (`--surface`, `--surface-elevated`, `--text-primary`, `--accent`) and swap values under `[data-theme="dark"]` or `@media (prefers-color-scheme: dark)`.
|
||||
|
||||
### 8.B Do Not Prescribe Specific Colors Here
|
||||
The brief and brand decide. This skill enforces only:
|
||||
* **Contrast** - WCAG AA minimum for body text, AAA target for hero copy.
|
||||
* **Hierarchy parity** - visual hierarchy that works in light must work in dark. If a CTA pops in light, it pops in dark.
|
||||
* **Brand fidelity** - primary brand color stays recognisable. Don't desaturate the brand into a dark mode.
|
||||
* **No pure `#000000` and no pure `#ffffff`** - use off-black (zinc-950, near-black warm gray) and off-white. Pure values kill depth.
|
||||
|
||||
### 8.C Default Mode
|
||||
Respect `prefers-color-scheme` unless the brand insists. Add a manual toggle if either mode would lose key brand expression.
|
||||
|
||||
### 8.D Test in Both Modes Before Finishing
|
||||
Open the page in both modes during development. Do not ship a page you've only seen in one mode.
|
||||
|
||||
---
|
||||
|
||||
## 9. AI TELLS (Forbidden Patterns)
|
||||
|
||||
Avoid these signatures unless the brief explicitly asks for them.
|
||||
|
||||
### 9.A Visual & CSS
|
||||
* **NO neon / outer glows** by default. Use inner borders or subtle tinted shadows.
|
||||
* **NO pure black (`#000000`).** Off-black, zinc-950, or charcoal.
|
||||
* **NO oversaturated accents.** Desaturate to blend with neutrals.
|
||||
* **NO excessive gradient text** for large headers.
|
||||
* **NO custom mouse cursors.** Outdated, accessibility-hostile, perf-hostile.
|
||||
|
||||
### 9.B Typography
|
||||
* **AVOID Inter as default.** See Section 4.1. Override path exists.
|
||||
* **NO oversized H1s** that just scream. Control hierarchy with weight + color, not raw scale.
|
||||
* **Serif constraints:** Serif for editorial / luxury / publication. Not for dashboards.
|
||||
|
||||
### 9.C Layout & Spacing
|
||||
* **Mathematically perfect** padding and margins. No floating elements with awkward gaps.
|
||||
* **NO 3-column equal feature cards.** The generic "three identical cards horizontally" feature row is banned. Use 2-column zig-zag, asymmetric grid, scroll-pinned, or horizontal-scroll alternative.
|
||||
|
||||
### 9.D Content & Data ("Jane Doe" Effect)
|
||||
* **NO generic names.** "John Doe", "Sarah Chan", "Jack Su" → use creative, realistic, locale-appropriate names.
|
||||
* **NO generic avatars.** No SVG "egg" or Lucide user icons → use believable photo placeholders or specific styling.
|
||||
* **NO fake-perfect numbers.** Avoid `99.99%`, `50%`, `1234567`. Use organic, messy data (`47.2%`, `+1 (312) 847-1928`).
|
||||
* **NO startup-slop brand names.** "Acme", "Nexus", "SmartFlow", "Cloudly" → invent contextual, premium names that sound real.
|
||||
* **NO filler verbs.** "Elevate", "Seamless", "Unleash", "Next-Gen", "Revolutionize" → concrete verbs only.
|
||||
|
||||
### 9.E External Resources & Components
|
||||
* **NO hand-rolled SVG icons.** Use Phosphor / HugeIcons / Radix / Tabler. Lucide on explicit request only.
|
||||
* **Hand-rolled decorative SVGs strongly discouraged** as default (see Section 4.8).
|
||||
* **NO div-based fake screenshots.** Never build a fake product UI out of `<div>` rectangles to simulate a screenshot. Use real images, generated images, or skip the preview.
|
||||
* **NO broken Unsplash links.** Use `https://picsum.photos/seed/{descriptive-string}/{w}/{h}`, or generated photo placeholders, or actual assets.
|
||||
* **shadcn/ui customization:** Allowed, but NEVER in default state. Customize radii, colors, shadows, typography to the project aesthetic.
|
||||
* **Production-Ready Cleanliness:** Code visually clean, memorable, meticulously refined.
|
||||
|
||||
### 9.F Production-Test Tells (banned outright)
|
||||
|
||||
These patterns came out of real LLM-generated landing-page tests. They are the signatures the model defaults to when it tries to "look designed." Treat them as hard bans unless the brief explicitly calls for one.
|
||||
|
||||
**Hero & top-of-page**
|
||||
* **NO version labels in the hero.** `V0.6`, `v2.0`, `BETA`, `INVITE-ONLY PREVIEW`, `EARLY ACCESS`, `ALPHA` - banned as default eyebrows. Only acceptable when the brief is explicitly about a product launch / preview status.
|
||||
* **NO "Brand · No. 01"-style sub-eyebrows.** "Marrow · No. 01 · The 6-quart" type micro-meta lines. Skip them.
|
||||
|
||||
**Section numbering & micro-labels**
|
||||
* **NO section-number eyebrows.** `00 / INDEX`, `001 · Capabilities`, `002 · Featured commission`, `06 · how it works`, `05 · The honest table` - banned. Eyebrows should name the topic in plain language, not enumerate.
|
||||
* **NO `01 / 4`-style pagination on images or bento tiles.** If the user can count, they don't need the label.
|
||||
* **NO `Scroll · 001 Capabilities`-style scroll cues.** A simple arrow or "Scroll" is enough; no section-number prefix.
|
||||
* **NO "Index of Work, 2018 - 2026"-style range labels** as eyebrows. Just say what the section is.
|
||||
|
||||
**Separators & dots**
|
||||
* **The middle-dot (`·`) is rationed.** Maximum 1 per line in metadata strips. Do NOT use it as the default separator for everything ("foo · bar · baz · qux · quux"). If you need a separator family, prefer line breaks, hairlines, or columns.
|
||||
* **NO decorative colored status dots on every list/nav/badge.** A colored dot before "ONE Q4 SLOT OPEN" or before every nav link, or every task row - banned by default. Acceptable only when the dot conveys actual semantic state (a server status, an availability flag) and is used sparingly.
|
||||
|
||||
**Em-dashes & typography flourishes**
|
||||
* **NO em-dash (`—`) as a design element OR anywhere else.** See Section 9.G below for the complete, non-negotiable ban. The em-dash character is forbidden in headlines, eyebrows, pills, body copy, quotes, attribution, captions, button text, and alt text. Use the regular hyphen (`-`).
|
||||
* **NO `<br>`-broken-and-italicized headlines** as a default "design move." "for thirty\<br\>*years.*" type splits. Headlines should read naturally first, get clever only when the brief demands it.
|
||||
* **NO vertical rotated text** ("INDEX OF WORK, 2018 - 2026" rotated 90°). Agency-portfolio cliché. Use it only when the brief is explicitly agency / Awwwards / experimental AND it serves a real composition purpose.
|
||||
* **NO crosshair / hairline grid lines as decoration.** Vertical and horizontal lines drawn just to make the page "feel designed" - banned. Use them only when they organize real content.
|
||||
|
||||
**Fake product previews**
|
||||
* **NO div-based fake product UI in the hero** (fake task list, fake terminal, fake dashboard built from styled divs). It is the #1 LLM-design Tell. Use a real screenshot, a generated image, a real component preview, or none at all.
|
||||
* **NO fake version footers** ("v0.6.2-rc.1", "last sync 4s ago · main") inside fake screenshots. Adds nothing, screams AI.
|
||||
|
||||
**Marketing-copy Tells**
|
||||
* **NO "Quietly in use at" / "Quietly trusted by"** social-proof headers. Use natural language: "Trusted by", "Used at", "Customers include", or skip the heading entirely if the logos speak.
|
||||
* **NO "From the field" / "Field notes" / "Currently on the bench" / "On our desks" / "Loose plates" style poetic labels** on quote, blog, or sidebar sections. Reads as performative-craftsman. Use plain functional labels ("Testimonials", "Latest writing", "Now working on") or skip the label.
|
||||
* **NO "We respect the French ones"-style** mock-humble industry-references in body copy. Cute and AI-y.
|
||||
* **NO weather / locale strips** ("LIS 14:23 · 18°C") in headers/footers unless the brief is explicitly about a place / time-zone-distributed studio.
|
||||
* **NO micro-meta-sentences under eyebrows.** Sentences like *"Each of these is a feature we ship today, not a roadmap promise. The list will stay short on purpose."* sitting under a section heading are clutter. Eyebrow + Headline + Body is enough.
|
||||
* **NO generic step labels.** "Stage 1 / Stage 2 / Stage 3", "Step 1 / Step 2 / Step 3", "Phase 01 / Phase 02 / Phase 03", "Pass One / Pass Two / Pass Three". Banned. The actual step content is the label. If you must show progression, use the verb-noun directly ("Install", "Configure", "Ship") not "Stage 1: Install".
|
||||
|
||||
**Pills, labels and version stamps**
|
||||
* **NO pills/labels/tags overlaid on images.** No `<span>` overlays on photos with tags like `Brand · 02`, `PLATE · BRAND`, `Field notes - journal`. Either let the image speak alone, or add a caption directly below (outside the image).
|
||||
* **NO photo-credit captions as decoration.** Strings like `Field study no. 12 · Ines Caetano`, `Plate 03 · House archive`, `Frame XII · 35mm` under stock/picsum images are pretentious. Photo credit is allowed ONLY when there is a real photographer being credited for a real photo (with permission). Otherwise: skip the caption or use a one-line functional caption ("The 6-quart, in Sage.").
|
||||
* **NO version footers on marketing pages.** Footer strings like `v1.4.2`, `Build 0048`, `last sync 4s ago · main` are CLI / devtool fixtures, not landing-page content. Banned on marketing/landing/portfolio pages.
|
||||
* **NO "Reservation 412 of 800"-style live-stock counters** as decoration. Only if the brief is explicitly a limited-run waitlist with real data.
|
||||
|
||||
**Decoration text strips**
|
||||
* **NO decoration text strip at hero bottom.** Patterns like `BRAND. MOTION. SPATIAL.`, `TYPE / FORM / MOTION`, `DESIGN · BUILD · SHIP`, `ESTD. 2018 · LISBON · BRAND. MOTION. SPATIAL.` as a small mono-caps strip across the bottom of the hero are an agency-portfolio cliché. Banned by default. Only acceptable when the strip carries real, navigable links (sticky bottom nav) or real status info (cookie banner, build info on a docs site).
|
||||
* **NO floating top-right sub-text in section headings.** Pattern: section has a giant left-aligned headline; in the top-right corner of the same section header there is a small explainer paragraph floating with no clear alignment to anything else. That floater is the Tell. Either put the sub-text directly under the headline, or build a clean 2-column header (left: headline, right: aligned body), but not a tiny corner paragraph.
|
||||
|
||||
**Lists, dividers and scoring**
|
||||
* **NO `border-t` + `border-b` on every row of a long list / spec table.** Pick one (bottom-border between rows OR top-border above the group) and use it sparsely. A 10-row spec table with hairlines under each row is the laziest layout - see Section 4.9 for alternative UI components.
|
||||
* **NO scoring/progress bars with filled background tracks** as comparison visuals. If you need to show "X out of Y" comparisons, prefer a number + small icon, or a tiny inline bar WITHOUT a background track. Big filled `bg-zinc-200` tracks with a partial fill on top are dashboard-UI clutter on a landing page.
|
||||
|
||||
**Locale, time, scroll cues**
|
||||
* **Locale / city-name / time / weather strips are banned for 99% of briefs.** "Lisbon, working with founders" in the hero, "1200-690 Lisbon, Portugal" in the footer, "Lisbon 14:23 · 18°C" in the nav. These are agency-portfolio decoration tells. Allowed ONLY when: the brief explicitly describes a globally-distributed studio with timezone-relevant work, OR a travel-focused brand, OR a real-world physical venue. A single contact-address mention in the footer is fine; an atmospheric locale strip is not.
|
||||
* **Scroll cues are banned.** `Scroll`, `↓ scroll`, `Scroll to explore`, `Scroll to walk through it`, animated mouse-wheel icons. If the user has not scrolled yet, they are looking at the hero. They know what scroll is. The bottom of the viewport does not need a label.
|
||||
* **ZERO decorative status dots by default.** A coloured dot before nav items, before list rows, before badges, before status labels is a Tell. Only acceptable when conveying real semantic state (a live indicator on actual server status, a live availability flag) and limited to one per page section.
|
||||
|
||||
### 9.G EM-DASH BAN (the single most-violated Tell)
|
||||
|
||||
**Em-dash (`—`) is COMPLETELY banned.** It is the LLM's signature stylistic crutch and it is the #1 visual Tell in production tests. There is no "limited use" allowance, no "natural language frequency" allowance, no "in body copy is fine" allowance. None.
|
||||
|
||||
* **Banned in headlines.** Use a period or a comma.
|
||||
* **Banned in eyebrows / labels / pills / button text / image captions / nav items.** Replace with line breaks, columns, or hairlines.
|
||||
* **Banned in body copy.** Restructure the sentence: two sentences with a period, OR a comma, OR parentheses, OR a colon.
|
||||
* **Banned in quote attribution.** Use a normal hyphen with spaces (` - `) or a line break + smaller-weight name.
|
||||
* **Banned in en-dash form too (`–`) when used as a separator.** Date ranges (`2018-2026`) use a hyphen. Number ranges (`€40-80k`) use a hyphen.
|
||||
|
||||
The ONLY permitted dash characters on the page are:
|
||||
* Regular hyphen `-` (for compound words, ranges, line dividers in markup)
|
||||
* Minus sign in math (`-5°C`)
|
||||
|
||||
If your output contains a single `—` or `–` anywhere visible to the user, the output fails the Pre-Flight Check and must be rewritten.
|
||||
|
||||
This rule is non-negotiable. The agent has historically ignored em-dash limits when phrased as "use sparingly." The phrasing here is binary: zero em-dashes.
|
||||
|
||||
---
|
||||
|
||||
## 10. REFERENCE VOCABULARY (Pattern Names the Agent Should Know)
|
||||
|
||||
This is a vocabulary, not a library. The agent should KNOW these pattern names to communicate about them, design with them in mind, and reach for them when the design read calls for them. **Implementations and code sketches live in the Block Library (Section 12), which is populated iteratively.**
|
||||
|
||||
### Hero Paradigms
|
||||
* **Asymmetric Split Hero** - Text on one side, asset on the other, generous white space.
|
||||
* **Editorial Manifesto Hero** - Large type, no asset, almost-poster.
|
||||
* **Video / Media Mask Hero** - Type cut out as mask over video background.
|
||||
* **Kinetic-Type Hero** - Animated typography as the primary visual.
|
||||
* **Curtain-Reveal Hero** - Hero parts on scroll like a curtain.
|
||||
* **Scroll-Pinned Hero** - Hero stays pinned while content scrolls behind.
|
||||
|
||||
### Navigation & Menus
|
||||
* **Mac OS Dock Magnification** - Edge nav, icons scale fluidly on hover.
|
||||
* **Magnetic Button** - Pulls toward cursor.
|
||||
* **Gooey Menu** - Sub-items detach like viscous liquid.
|
||||
* **Dynamic Island** - Morphing pill for status / alerts.
|
||||
* **Contextual Radial Menu** - Circular menu expanding at click point.
|
||||
* **Floating Speed Dial** - FAB springing into curved secondary actions.
|
||||
* **Mega Menu Reveal** - Full-screen dropdown, stagger-fade content.
|
||||
|
||||
### Layout & Grids
|
||||
* **Bento Grid** - Asymmetric tile grouping (Apple Control Center).
|
||||
* **Masonry Layout** - Staggered grid, no fixed row height.
|
||||
* **Chroma Grid** - Borders / tiles with subtle animating gradients.
|
||||
* **Split-Screen Scroll** - Two halves sliding in opposite directions.
|
||||
* **Sticky-Stack Sections** - Sections that pin and stack on scroll.
|
||||
|
||||
### Cards & Containers
|
||||
* **Parallax Tilt Card** - 3D tilt tracking mouse coordinates.
|
||||
* **Spotlight Border Card** - Borders illuminate under cursor.
|
||||
* **Glassmorphism Panel** - Frosted glass with inner refraction.
|
||||
* **Holographic Foil Card** - Iridescent rainbow shift on hover.
|
||||
* **Tinder Swipe Stack** - Physical card stack, swipe-away.
|
||||
* **Morphing Modal** - Button expands into its own dialog.
|
||||
|
||||
### Scroll Animations
|
||||
* **Sticky Scroll Stack** - Cards stick and physically stack.
|
||||
* **Horizontal Scroll Hijack** - Vertical scroll → horizontal pan.
|
||||
* **Locomotive / Sequence Scroll** - Video / 3D sequence tied to scrollbar.
|
||||
* **Zoom Parallax** - Central background image zooming on scroll.
|
||||
* **Scroll Progress Path** - SVG line drawing along scroll.
|
||||
* **Liquid Swipe Transition** - Page transition like viscous liquid.
|
||||
|
||||
### Galleries & Media
|
||||
* **Dome Gallery** - 3D panoramic gallery.
|
||||
* **Coverflow Carousel** - 3D carousel with angled edges.
|
||||
* **Drag-to-Pan Grid** - Boundless draggable canvas.
|
||||
* **Accordion Image Slider** - Narrow strips expanding on hover.
|
||||
* **Hover Image Trail** - Mouse leaves popping image trail.
|
||||
* **Glitch Effect Image** - RGB-channel shift on hover.
|
||||
|
||||
### Typography & Text
|
||||
* **Kinetic Marquee** - Endless text bands reversing on scroll.
|
||||
* **Text Mask Reveal** - Massive type as transparent window to video.
|
||||
* **Text Scramble Effect** - Matrix-style decoding on load / hover.
|
||||
* **Circular Text Path** - Text curving along spinning circle.
|
||||
* **Gradient Stroke Animation** - Outlined text with running gradient.
|
||||
* **Kinetic Typography Grid** - Letters dodging the cursor.
|
||||
|
||||
### Micro-Interactions & Effects
|
||||
* **Particle Explosion Button** - CTA shatters into particles on success.
|
||||
* **Liquid Pull-to-Refresh** - Reload indicator like detaching droplets.
|
||||
* **Skeleton Shimmer** - Shifting light reflection across placeholders.
|
||||
* **Directional Hover-Aware Button** - Fill enters from cursor's exact side.
|
||||
* **Ripple Click Effect** - Wave from click coordinates.
|
||||
* **Animated SVG Line Drawing** - Vectors drawing themselves in real time.
|
||||
* **Mesh Gradient Background** - Organic lava-lamp blobs.
|
||||
* **Lens Blur Depth** - Background UI blurred to focus foreground action.
|
||||
|
||||
### Animation Library Choice
|
||||
* **Motion (`motion/react`)** - default for UI / Bento / state-change motion.
|
||||
* **GSAP + ScrollTrigger** - for full-page scrolltelling and scroll hijacks. Isolate in dedicated leaf components with `useEffect` cleanup.
|
||||
* **Three.js / WebGL** - for canvas backgrounds and 3D scenes. Same isolation rule.
|
||||
* **NEVER mix GSAP / Three.js with Motion in the same component tree.** They fight over the same frames.
|
||||
|
||||
---
|
||||
|
||||
## 11. REDESIGN PROTOCOL
|
||||
|
||||
This skill handles **greenfield builds AND redesigns**. Misclassifying the mode is the single biggest source of bad redesign output.
|
||||
|
||||
### 11.A Detect the Mode (first action)
|
||||
* **Greenfield** - no existing site, or full overhaul approved. Dial baseline from Section 1.
|
||||
* **Redesign - Preserve** - modernise without breaking the brand. Audit first, extract brand tokens, evolve gradually.
|
||||
* **Redesign - Overhaul** - new visual language on top of existing content. Treat as greenfield for visuals; preserve content and IA.
|
||||
|
||||
If ambiguous, ask **once**: *"Should this redesign preserve the existing brand, or are we starting visually from scratch?"*
|
||||
|
||||
### 11.B Audit Before Touching
|
||||
Document the current state before proposing changes:
|
||||
* **Brand tokens** - primary / accent colors, type stack, logo treatment, radii.
|
||||
* **Information architecture** - page tree, primary nav, key conversion paths.
|
||||
* **Content blocks** - what exists, what's doing work, what's filler.
|
||||
* **Patterns to preserve** - signature interactions, recognisable hero, copy voice.
|
||||
* **Patterns to retire** - AI-slop tells, broken layouts, dead links, generic stock imagery, perf traps.
|
||||
* **Dial reading of the existing site** - infer current `DESIGN_VARIANCE` / `MOTION_INTENSITY` / `VISUAL_DENSITY`. That's your starting point, not the baseline.
|
||||
* **SEO baseline** - current ranking pages, meta titles, structured data, OG cards. **SEO migration is the #1 redesign risk.**
|
||||
|
||||
### 11.C Preservation Rules
|
||||
* **Do not change information architecture** unless asked. Keep page slugs, anchor IDs, primary nav labels stable for SEO and muscle memory.
|
||||
* **Extract brand colors before applying Section 4.2.** A brand that is already purple stays purple - apply the LILA RULE's override.
|
||||
* **Preserve copy voice** unless asked for a rewrite. Visual modernisation ≠ content rewrite.
|
||||
* **Honor existing accessibility wins.** Do not regress focus states, alt text, keyboard nav, contrast.
|
||||
* **Respect existing analytics events.** Do not rename buttons, form fields, section IDs that downstream tracking depends on.
|
||||
|
||||
### 11.D Modernisation Levers (priority order)
|
||||
Apply in order - stop when the brief is satisfied:
|
||||
1. **Typography refresh** - biggest visual lift per unit of risk.
|
||||
2. **Spacing & rhythm** - increase section padding, fix vertical rhythm.
|
||||
3. **Color recalibration** - desaturate, unify neutrals, keep brand accent.
|
||||
4. **Motion layer** - add `MOTION_INTENSITY`-appropriate micro-interactions to existing components.
|
||||
5. **Hero & key-section recomposition** - restructure top-of-funnel using Section 10 vocabulary.
|
||||
6. **Full block replacement** - only when the existing block is unsalvageable.
|
||||
|
||||
### 11.E Decision Tree: Targeted Evolution vs Full Redesign
|
||||
* IA, content, and SEO sound → **targeted evolution** (Levers 1-4). ~70% of value at ~40% of risk.
|
||||
* Visual debt is structural (broken IA, no design system, broken mobile) → **full redesign** with strict content preservation.
|
||||
* Brand itself is changing → **greenfield**.
|
||||
|
||||
### 11.F What Never Changes Silently
|
||||
Never modify without explicit user approval:
|
||||
* URL structure / route slugs.
|
||||
* Primary nav labels.
|
||||
* Form field names or order (breaks analytics + autofill).
|
||||
* Brand logo or wordmark.
|
||||
* Existing legal / consent / cookie copy.
|
||||
|
||||
---
|
||||
|
||||
## 12. THE BLOCK LIBRARY (Contract - Implementations Land Here Iteratively)
|
||||
|
||||
The Reference Vocabulary (Section 10) names patterns. The Block Library implements them with real props, real motion specs, and real code sketches.
|
||||
|
||||
**Status:** schema defined here. Blocks will be added iteratively. Do not freelance new blocks without following this schema.
|
||||
|
||||
### 12.A File Location
|
||||
```
|
||||
skills/taste-skill/blocks/
|
||||
hero/
|
||||
asymmetric-split.md
|
||||
editorial-manifesto.md
|
||||
kinetic-type.md
|
||||
...
|
||||
feature/
|
||||
bento-grid.md
|
||||
sticky-scroll-stack.md
|
||||
zig-zag.md
|
||||
...
|
||||
social-proof/
|
||||
pricing/
|
||||
cta/
|
||||
footer/
|
||||
navigation/
|
||||
portfolio/
|
||||
transition/
|
||||
```
|
||||
|
||||
### 12.B Required Frontmatter
|
||||
```yaml
|
||||
---
|
||||
name: asymmetric-split-hero
|
||||
category: hero
|
||||
dial_compatibility:
|
||||
variance: [6, 10]
|
||||
motion: [3, 10]
|
||||
density: [2, 5]
|
||||
when_to_use: "Landing pages with one strong asset and one strong message. Default hero for SaaS, agency, premium consumer."
|
||||
not_for: "Editorial / manifesto launches where the message IS the design."
|
||||
stack: ["react", "next", "tailwind", "motion"]
|
||||
---
|
||||
```
|
||||
|
||||
### 12.C Required Body Sections
|
||||
1. **Visual sketch** - short ASCII or description of the layout.
|
||||
2. **Props API** - the component's interface.
|
||||
3. **Code sketch** - minimal working implementation (Server Component default, Client island for motion).
|
||||
4. **Mobile fallback** - explicit collapse rules for `< 768px`.
|
||||
5. **Motion variants** - one variant per `MOTION_INTENSITY` band (1-3, 4-7, 8-10). Reduced-motion fallback explicit.
|
||||
6. **Dark-mode notes** - token strategy specific to this block.
|
||||
7. **Anti-patterns** - common ways this block goes wrong.
|
||||
8. **References** - links to real examples in production.
|
||||
|
||||
### 12.D Block-Library Discipline
|
||||
* One block per file. No multi-block files.
|
||||
* Every block must work standalone (drop it into a page, it renders).
|
||||
* Every block must pass the Pre-Flight Check (Section 14).
|
||||
* Blocks that depend on a design system from Section 2.A live under `blocks/<category>/<name>--<system>.md` (e.g. `feature/bento-grid--material.md`).
|
||||
|
||||
---
|
||||
|
||||
## 13. OUT OF SCOPE
|
||||
|
||||
This skill is NOT for:
|
||||
* Dashboards / dense product UI / admin panels (use Fluent, Carbon, Atlassian, or Polaris from Section 2.A).
|
||||
* Data tables (use TanStack Table or AG Grid).
|
||||
* Multi-step forms / wizards (use Form-specific patterns; this skill won't make them better).
|
||||
* Code editors (use Monaco / CodeMirror with their official skinning).
|
||||
* Native mobile (use Apple HIG / Material directly).
|
||||
* Realtime collab UIs (presence, cursors, OT-aware - different problem class).
|
||||
|
||||
If the brief is one of the above, **say so explicitly**, point to the right tool, and only apply this skill's marketing-page / about-page / landing-page parts to the surfaces where they apply.
|
||||
|
||||
---
|
||||
|
||||
## 14. FINAL PRE-FLIGHT CHECK
|
||||
|
||||
Run this matrix before outputting code. This is the last filter.
|
||||
|
||||
**THIS IS NOT OPTIONAL. Run every box. If any box fails, the output is not done.**
|
||||
|
||||
- [ ] **Brief inference** declared (Section 0.B one-liner)?
|
||||
- [ ] **Dial values** explicit and reasoned from the brief, not silently using baseline?
|
||||
- [ ] **Design system** chosen from Section 2 if applicable, or aesthetic labeled honestly?
|
||||
- [ ] **Redesign mode** detected and audit performed (if applicable, Section 11)?
|
||||
- [ ] **ZERO em-dashes (`—`) anywhere on the page.** Headlines, eyebrows, pills, body, quotes, attribution, captions, buttons, alt text. Zero. (Section 9.G - non-negotiable.)
|
||||
- [ ] **Page Theme Lock**: ONE theme (light, dark, or auto) for the whole page. No section flips to inverted mode mid-page (Section 4.11)?
|
||||
- [ ] **Color Consistency Lock**: one accent color used identically across all sections (Section 4.2)?
|
||||
- [ ] **Shape Consistency Lock**: one corner-radius system applied consistently (Section 4.4)?
|
||||
- [ ] **Button Contrast Check**: every CTA text is readable against its background (no white-on-white, WCAG AA 4.5:1)?
|
||||
- [ ] **CTA Button Wrap**: no CTA label wraps to 2+ lines at desktop?
|
||||
- [ ] **Form Contrast Check**: form inputs, placeholders, focus rings, labels all pass WCAG AA against the section background?
|
||||
- [ ] **Serif discipline**: if a serif is used, it is NOT Fraunces or Instrument_Serif (or it is, with explicit brand justification)? Different serif from your previous project?
|
||||
- [ ] **Premium-consumer palette check**: if the brief is premium-consumer (cookware / wellness / artisan / luxury), the palette is NOT the AI-default beige+brass+oxblood+espresso family? Different family from your previous premium-consumer project?
|
||||
- [ ] **Italic descender clearance**: every italic word with `y g j p q` has `leading-[1.1]` min + `pb-1` reserve?
|
||||
- [ ] **Hero fits the viewport**: headline ≤ 2 lines, subtext ≤ 20 words AND ≤ 4 lines, CTA visible without scroll, font scale planned around image?
|
||||
- [ ] **Hero top padding**: max `pt-24` at desktop, hero content does not float halfway down the viewport?
|
||||
- [ ] **Hero stack discipline**: max 4 text elements in hero (eyebrow OR brand strip, headline, subtext, CTAs)? No tiny tagline below CTAs, no trust micro-strip in hero?
|
||||
- [ ] **EYEBROW COUNT (mechanical)**: count instances of `uppercase tracking` micro-labels above section headlines across all components. Count ≤ ceil(sectionCount / 3)? Hero counts as 1.
|
||||
- [ ] **Split-Header Ban**: no "left big headline + right small explainer paragraph" pattern as a section header (vertical stack instead)?
|
||||
- [ ] **Zigzag Alternation Cap**: no 3+ consecutive sections with the same image+text-split layout?
|
||||
- [ ] **No Duplicate CTA Intent**: no two CTAs with the same intent ("Get in touch" + "Let's talk" both on page = Fail)?
|
||||
- [ ] **Logo wall = logo only**: no industry / category labels printed below logos?
|
||||
- [ ] **Bento Background Diversity**: at least 2-3 bento cells have real visual variation (image, gradient, pattern), not all white-on-white text cards?
|
||||
- [ ] **"Used by / Trusted by" logo wall** lives UNDER the hero, not inside it, uses REAL SVG logos (Simple Icons / devicon) or generated SVG marks, NOT plain text wordmarks?
|
||||
- [ ] **Copy Self-Audit**: every visible string re-read, no grammatically-broken or AI-hallucinated phrases ("free on its past" type) shipped?
|
||||
- [ ] **Motion motivated**: every animation can be justified in one sentence (hierarchy / storytelling / feedback / state transition), no GSAP-for-show?
|
||||
- [ ] **Marquee max-one-per-page**: no two horizontal marquees on the same page?
|
||||
- [ ] **Navigation on ONE line** at desktop, height ≤ 80px?
|
||||
- [ ] **Section-Layout-Repetition** check: no two sections share the same layout family (at least 4 different families across 8 sections)?
|
||||
- [ ] **Bento has rhythm AND exact cell count** (N items → N cells, no empty cells in middle or at end)?
|
||||
- [ ] **Long lists use the right UI component** (not default `<ul>` with `divide-y` for > 5 items - see Section 4.9 alternatives)?
|
||||
- [ ] **Real images used** (gen-tool first, then Picsum-seed, then explicit placeholder slots) - NO div-based fake screenshots, NO hand-rolled decorative SVGs, NO pure-text minimalism?
|
||||
- [ ] **No pills/labels overlaid on images** (no `Plate · Brand`, no `Field notes - journal`)?
|
||||
- [ ] **No photo-credit captions as decoration** (`Field study no. 12 · Ines Caetano`)?
|
||||
- [ ] **No version footers** (`v1.4.2`, `Build 0048`) on marketing pages?
|
||||
- [ ] **No micro-meta-sentences** under eyebrows ("Each of these is a feature we ship today...")?
|
||||
- [ ] **No decoration text strip at hero bottom** (`BRAND. MOTION. SPATIAL.`)?
|
||||
- [ ] **No floating top-right sub-text** in section headings?
|
||||
- [ ] **No scoring/progress bars with filled background tracks** as comparison visuals?
|
||||
- [ ] **No locale / city-name / time / weather strips** unless brief is genuinely globally-distributed or place-focused?
|
||||
- [ ] **No scroll cues** (`Scroll`, `↓ scroll`, `Scroll to explore`)?
|
||||
- [ ] **No version labels in hero** (V0.6, BETA, INVITE-ONLY) unless the brief is a launch?
|
||||
- [ ] **No section-numbering eyebrows** (`00 / INDEX`, `001 · Capabilities`, `06 · how it works`)?
|
||||
- [ ] **No decorative dots** (zero by default, only for real semantic state)?
|
||||
- [ ] **No `border-t` + `border-b` on every row** of long lists / spec tables?
|
||||
- [ ] **Content density** sane: no 20-row data tables, no fake-precise specs without justification, ≤ 25-word sub-paragraphs by default?
|
||||
- [ ] **Quotes ≤ 3 lines** of body, attribution clean (no em-dash)?
|
||||
- [ ] **Motion claimed = motion shown**: if `MOTION_INTENSITY > 4`, page actually animates, not just claimed?
|
||||
- [ ] **GSAP sticky-stack / horizontal-pan** implemented per Section 5.A / 5.B canonical skeleton (`start: "top top"`, `pin: true`, correct scrub)?
|
||||
- [ ] **No `window.addEventListener('scroll')`** - using Motion `useScroll()` / ScrollTrigger / IntersectionObserver / CSS scroll-driven animations only?
|
||||
- [ ] **Reduced motion** wrapped for everything `MOTION_INTENSITY > 3`?
|
||||
- [ ] **Dark mode** tokens defined and tested in both modes?
|
||||
- [ ] **Mobile collapse** explicit (`w-full`, `px-4`, `max-w-7xl mx-auto`) for high-variance layouts?
|
||||
- [ ] **Viewport stability**: `min-h-[100dvh]`, never `h-screen`?
|
||||
- [ ] **`useEffect` animations** have strict cleanup functions?
|
||||
- [ ] **Empty / loading / error** states provided?
|
||||
- [ ] **Cards omitted** in favor of spacing where possible?
|
||||
- [ ] **Icons** from an allowed library only (Phosphor / HugeIcons / Radix / Tabler), no hand-rolled SVG paths?
|
||||
- [ ] **Motion** isolated in client-leaf components with `'use client'` at the top, memoized?
|
||||
- [ ] **No AI Tells** from Section 9 (Inter as default, AI-purple, three-equal cards, Jane Doe, Acme, "Quietly in use at")?
|
||||
- [ ] **Core Web Vitals** plausibly hit (LCP < 2.5s, INP < 200ms, CLS < 0.1)?
|
||||
- [ ] **One design system** per project (no Material + shadcn mixed)?
|
||||
|
||||
If a single checkbox cannot be honestly ticked, the page is not done. Fix it before delivering.
|
||||
|
||||
---
|
||||
|
||||
# APPENDICES - Real Source-Backed Reference Material
|
||||
|
||||
The sections below are vendored reference content. They give the agent real install commands, real canonical doc links, and real working starter snippets for each design system named in Section 2. Use them to ground decisions in production reality, not training-data fiction.
|
||||
|
||||
## Appendix A - Install Commands per Design System
|
||||
|
||||
```bash
|
||||
# Material Web (Material 3)
|
||||
npm install @material/web
|
||||
|
||||
# Fluent UI React (v9)
|
||||
npm install @fluentui/react-components
|
||||
|
||||
# Fluent UI Web Components (framework-free)
|
||||
npm install @fluentui/web-components @fluentui/tokens
|
||||
|
||||
# IBM Carbon
|
||||
npm install @carbon/react @carbon/styles
|
||||
|
||||
# Radix Themes
|
||||
npm install @radix-ui/themes
|
||||
|
||||
# shadcn/ui (open code, owned components)
|
||||
npx shadcn@latest init
|
||||
npx shadcn@latest add button card badge separator input
|
||||
|
||||
# Primer CSS (GitHub product/devtool UI)
|
||||
npm install --save @primer/css
|
||||
|
||||
# Primer Brand (GitHub marketing UI)
|
||||
npm install @primer/react-brand
|
||||
|
||||
# GOV.UK Frontend
|
||||
npm install govuk-frontend
|
||||
|
||||
# USWDS (US Web Design System)
|
||||
npm install uswds
|
||||
|
||||
# Atlassian Design System (Atlaskit)
|
||||
yarn add @atlaskit/css-reset @atlaskit/tokens @atlaskit/button @atlaskit/badge @atlaskit/section-message @atlaskit/card
|
||||
|
||||
# Bootstrap 5.3
|
||||
npm install bootstrap
|
||||
|
||||
# Shopify Polaris Web Components (Shopify apps only)
|
||||
# Add this to your app HTML head:
|
||||
# <meta name="shopify-api-key" content="%SHOPIFY_API_KEY%" />
|
||||
# <script src="https://cdn.shopify.com/shopifycloud/polaris.js"></script>
|
||||
```
|
||||
|
||||
## Appendix B - Canonical Sources (read these before reinventing)
|
||||
|
||||
### Material Web
|
||||
- https://github.com/material-components/material-web
|
||||
- https://material-web.dev/theming/material-theming/
|
||||
- https://m3.material.io/develop/web
|
||||
|
||||
### Fluent UI
|
||||
- https://fluent2.microsoft.design/get-started/develop
|
||||
- https://fluent2.microsoft.design/components/web/react/
|
||||
- https://github.com/microsoft/fluentui
|
||||
- https://learn.microsoft.com/en-us/fluent-ui/web-components/
|
||||
|
||||
### Carbon
|
||||
- https://carbondesignsystem.com/
|
||||
- https://github.com/carbon-design-system/carbon
|
||||
- https://carbondesignsystem.com/developing/react-tutorial/overview/
|
||||
- https://carbondesignsystem.com/developing/web-components-tutorial/overview/
|
||||
|
||||
### Shopify Polaris
|
||||
- https://shopify.dev/docs/api/app-home/web-components
|
||||
- https://github.com/Shopify/polaris-react
|
||||
- https://polaris-react.shopify.com/components
|
||||
|
||||
### Atlassian
|
||||
- https://atlassian.design/get-started/develop
|
||||
- https://atlassian.design/components/button/examples
|
||||
- https://atlaskit.atlassian.com/packages/design-system/button/example/disabled
|
||||
- https://atlassian.design/tokens/design-tokens
|
||||
|
||||
### Primer
|
||||
- https://primer.style/
|
||||
- https://github.com/primer/css
|
||||
- https://github.com/primer/brand
|
||||
|
||||
### GOV.UK
|
||||
- https://design-system.service.gov.uk/components/button/
|
||||
- https://design-system.service.gov.uk/styles/layout/
|
||||
- https://github.com/alphagov/govuk-frontend
|
||||
|
||||
### USWDS
|
||||
- https://designsystem.digital.gov/documentation/developers/
|
||||
- https://designsystem.digital.gov/components/button/
|
||||
- https://designsystem.digital.gov/components/card/
|
||||
- https://github.com/uswds/uswds
|
||||
|
||||
### Bootstrap
|
||||
- https://getbootstrap.com/docs/5.3/layout/grid/
|
||||
- https://getbootstrap.com/docs/5.3/components/card/
|
||||
|
||||
### Tailwind
|
||||
- https://tailwindcss.com/docs/dark-mode
|
||||
- https://tailwindcss.com/blog/tailwindcss-v4
|
||||
|
||||
### Radix
|
||||
- https://www.radix-ui.com/themes/docs/components/theme
|
||||
- https://www.radix-ui.com/themes/docs/components/card
|
||||
- https://github.com/radix-ui/themes
|
||||
|
||||
### shadcn/ui
|
||||
- https://ui.shadcn.com/docs
|
||||
- https://ui.shadcn.com/docs/components/card
|
||||
- https://github.com/shadcn-ui/ui
|
||||
|
||||
### Native CSS / W3C standards
|
||||
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/backdrop-filter
|
||||
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme
|
||||
- https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion
|
||||
- https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Grid_layout
|
||||
- https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Scroll-driven_animations
|
||||
- https://drafts.csswg.org/scroll-animations-1/
|
||||
|
||||
### Apple Liquid Glass (Apple platforms only)
|
||||
- https://developer.apple.com/design/human-interface-guidelines/materials
|
||||
- https://developer.apple.com/documentation/TechnologyOverviews/liquid-glass
|
||||
- https://developer.apple.com/documentation/TechnologyOverviews/adopting-liquid-glass
|
||||
- https://developer.apple.com/documentation/SwiftUI/Material
|
||||
|
||||
---
|
||||
|
||||
## Appendix C - Apple Liquid Glass: Honest Web Approximation
|
||||
|
||||
Do **not** treat random CSS snippets as official Apple Liquid Glass.
|
||||
|
||||
### What is official
|
||||
Apple documents Liquid Glass inside Apple's Human Interface Guidelines and Developer Documentation for **Apple platforms**. It is a dynamic material used across Apple platform UI. Apple's native implementation belongs to Apple platform APIs and system components, **not a public web CSS package**.
|
||||
|
||||
Relevant official docs:
|
||||
- Apple Human Interface Guidelines → Materials
|
||||
- Apple Developer Documentation → Liquid Glass
|
||||
- Apple Developer Documentation → Adopting Liquid Glass
|
||||
- SwiftUI → Material
|
||||
|
||||
### What is NOT official
|
||||
There is no `liquid-glass.css` from Apple for normal websites.
|
||||
|
||||
A web approximation can use:
|
||||
- `backdrop-filter`
|
||||
- transparent backgrounds
|
||||
- layered borders
|
||||
- highlight overlays
|
||||
- gradients
|
||||
- motion
|
||||
- strong contrast fallbacks
|
||||
|
||||
But that is **web glassmorphism / frosted-glass approximation**, not official Apple Liquid Glass. Label it as such in comments.
|
||||
|
||||
### Safer web approximation skeleton
|
||||
|
||||
```css
|
||||
.liquid-glass-web-approx {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
overflow: hidden;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgb(255 255 255 / .32);
|
||||
background:
|
||||
linear-gradient(135deg, rgb(255 255 255 / .30), rgb(255 255 255 / .08)),
|
||||
rgb(255 255 255 / .12);
|
||||
backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
|
||||
-webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgb(255 255 255 / .48),
|
||||
inset 0 -1px 0 rgb(255 255 255 / .12),
|
||||
0 18px 60px rgb(0 0 0 / .18);
|
||||
}
|
||||
|
||||
.liquid-glass-web-approx::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
border-radius: inherit;
|
||||
background:
|
||||
radial-gradient(circle at 20% 0%, rgb(255 255 255 / .55), transparent 34%),
|
||||
linear-gradient(90deg, rgb(255 255 255 / .18), transparent 42%, rgb(255 255 255 / .14));
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.liquid-glass-web-approx::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 1px;
|
||||
border-radius: inherit;
|
||||
border: 1px solid rgb(255 255 255 / .14);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.liquid-glass-web-approx {
|
||||
border-color: rgb(255 255 255 / .18);
|
||||
background:
|
||||
linear-gradient(135deg, rgb(255 255 255 / .16), rgb(255 255 255 / .04)),
|
||||
rgb(15 23 42 / .42);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgb(255 255 255 / .22),
|
||||
0 18px 60px rgb(0 0 0 / .42);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-transparency: reduce) {
|
||||
.liquid-glass-web-approx {
|
||||
background: rgb(255 255 255 / .96);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Important:** `prefers-reduced-transparency` has uneven browser support; test it. Always provide enough contrast even without blur.
|
||||
|
||||
---
|
||||
|
||||
**End of appendices.** Install commands above are reality anchors. The Apple Liquid Glass skeleton is a labeled approximation, not an Apple-issued package. For canonical docs per design system, consult the system's official docs (links in Section 2 plus Appendix B).
|
||||
74
.agents/skills/gpt-taste/SKILL.md
Normal file
74
.agents/skills/gpt-taste/SKILL.md
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
name: gpt-taste
|
||||
description: Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.
|
||||
---
|
||||
|
||||
# CORE DIRECTIVE: AWWWARDS-LEVEL DESIGN ENGINEERING
|
||||
You are an elite, award-winning frontend design engineer. Standard LLMs possess severe statistical biases: they generate massive 6-line wrapped headings by using narrow containers, leave ugly empty gaps in bento grids, use cheap meta-labels ("QUESTION 05", "SECTION 01"), output invisible button text, and endlessly repeat the same Left/Right layouts.
|
||||
|
||||
Your goal is to aggressively break these defaults. Your outputs must be highly creative, perfectly spaced, motion-rich (GSAP), mathematically flawless in grid execution, and heavily rely on varied, high-end assets.
|
||||
|
||||
DO NOT USE EMOJIS IN YOUR CODE, COMMENTS, OR OUTPUT. Maintain strictly professional formatting.
|
||||
|
||||
## 1. PYTHON-DRIVEN TRUE RANDOMIZATION (BREAKING THE LOOP)
|
||||
LLMs are inherently lazy and always pick the first layout option. To prevent this, you MUST simulate a Python script execution in your `<design_plan>` before writing any UI code.
|
||||
Use a deterministic seed (e.g., character count of the user prompt modulo math) to simulate `random.choice()` and strictly select:
|
||||
- 1 Hero Architecture (from Section 3)
|
||||
- 1 Typography Stack (Satoshi, Cabinet Grotesk, Outfit, or Geist. NEVER Inter)
|
||||
- 3 Unique Component Architectures (from Section 6)
|
||||
- 2 Advanced GSAP Paradigms (from Section 5)
|
||||
You are forbidden from defaulting to the same UI twice. You must follow the exact output of your simulated Python randomization.
|
||||
|
||||
## 2. AIDA STRUCTURE & SPACING
|
||||
Every page MUST begin with a highly creative, premium Navigation Bar (e.g., floating glass pill, or minimal split nav).
|
||||
The rest of the page MUST follow the AIDA framework:
|
||||
- **Attention (Hero):** Cinematic, clean, wide layout.
|
||||
- **Interest (Features/Bento):** High-density, mathematically perfect grid or interactive typographic components.
|
||||
- **Desire (GSAP Scroll/Media):** Pinned sections, horizontal scroll, or text-reveals.
|
||||
- **Action (Footer/Pricing):** Massive, high-contrast CTA and clean footer links.
|
||||
**SPACING RULE:** Add huge vertical padding between all major sections (e.g., `py-32 md:py-48`). Sections must feel like distinct, cinematic chapters. Do not cramp elements together.
|
||||
|
||||
## 3. HERO ARCHITECTURE & THE 2-LINE IRON RULE
|
||||
The Hero must breathe. It must NOT be a narrow, 6-line text wall.
|
||||
- **The Container Width Fix:** You MUST use ultra-wide containers for the H1 (e.g., `max-w-5xl`, `max-w-6xl`, `w-full`). Allow the words to flow horizontally.
|
||||
- **The Line Limit:** The H1 MUST NEVER exceed 2 to 3 lines. 4, 5, or 6 lines is a catastrophic failure. Make the font size smaller (`clamp(3rem, 5vw, 5.5rem)`) and the container wider to ensure this.
|
||||
- **Hero Layout Options (Randomly Assigned via Python):**
|
||||
1. *Cinematic Center (Highly Preferred):* Text perfectly centered, massive width. Below the text, exactly two high-contrast CTAs. Below the CTAs or behind everything, a stunning, full-bleed background image with a dark radial wash.
|
||||
2. *Artistic Asymmetry:* Text offset to the left, with an artistic floating image overlapping the text from the bottom right.
|
||||
3. *Editorial Split:* Text left, image right, but with massive negative space.
|
||||
- **Button Contrast:** Buttons must be perfectly legible. Dark background = white text. Light background = dark text. Invisible text is a failure.
|
||||
- **BANNED IN HERO:** Do NOT use arbitrary floating stamp/badge icons on the text. Do NOT use pill-tags under the hero. Do NOT place raw data/stats in the hero.
|
||||
|
||||
## 4. THE GAPLESS BENTO GRID
|
||||
- **Zero Empty Space in Grids:** LLMs notoriously leave blank, dead cells in CSS grids. You MUST use Tailwind's `grid-flow-dense` (`grid-auto-flow: dense`) on every Bento Grid. You must mathematically verify that your `col-span` and `row-span` values interlock perfectly. No grid shall have a missing corner or empty void.
|
||||
- **Card Restraint:** Do not use too many cards. 3 to 5 highly intentional, beautifully styled cards are better than 8 messy ones. Fill them with a mix of large imagery, dense typography, or CSS effects.
|
||||
|
||||
## 5. ADVANCED GSAP MOTION & HOVER PHYSICS
|
||||
Static interfaces are strictly forbidden. You must write real GSAP (`@gsap/react`, `ScrollTrigger`).
|
||||
- **Hover Physics:** Every clickable card and image must react. Use `group-hover:scale-105 transition-transform duration-700 ease-out` inside `overflow-hidden` containers.
|
||||
- **Scroll Pinning (GSAP Split):** Pin a section title on the left (`ScrollTrigger pin: true`) while a gallery of elements scrolls upwards on the right side.
|
||||
- **Image Scale & Fade Scroll:** Images must start small (`scale: 0.8`). As they scroll into view, they grow to `scale: 1.0`. As they scroll out of view, they smoothly darken and fade out (`opacity: 0.2`).
|
||||
- **Scrubbing Text Reveals:** Opacity of central paragraph words starts at 0.1 and scrubs to 1.0 sequentially as the user scrolls.
|
||||
- **Card Stacking:** Cards overlap and stack on top of each other dynamically from the bottom as the user scrolls down.
|
||||
|
||||
## 6. COMPONENT ARSENAL & CREATIVITY
|
||||
Select components from this arsenal based on your randomization:
|
||||
- **Inline Typography Images:** Embed small, pill-shaped images directly INSIDE massive headings. Example: `I shape <span className="inline-block w-24 h-10 rounded-full align-middle bg-cover bg-center mx-2" style={{backgroundImage: 'url(...)'}}></span> digital spaces.`
|
||||
- **Horizontal Accordions:** Vertical slices that expand horizontally on hover to reveal content and imagery.
|
||||
- **Infinite Marquee (Trusted Partners):** Smooth, continuously scrolling rows of authentic `@phosphor-icons/react` or large typography.
|
||||
- **Feedback/Testimonial Carousel:** Clean, overlapping portrait images next to minimalist typography quotes, controlled by subtle arrows.
|
||||
|
||||
## 7. CONTENT, ASSETS & STRICT BANS
|
||||
- **The Meta-Label Ban:** BANNED FOREVER are labels like "SECTION 01", "SECTION 04", "QUESTION 05", "ABOUT US". Remove them entirely. They look cheap and unprofessional.
|
||||
- **Image Context & Style:** Use `https://picsum.photos/seed/{keyword}/1920/1080` and match the keyword to the vibe. Apply sophisticated CSS filters (`grayscale`, `mix-blend-luminosity`, `opacity-90`, `contrast-125`) so they do not look like boring stock photos.
|
||||
- **Creative Backgrounds:** Inject subtle, professional ambient design. Use deep radial blurs, grainy mesh gradients, or shifting dark overlays. Avoid flat, boring colors.
|
||||
- **Horizontal Scroll Bug:** Wrap the entire page in `<main className="overflow-x-hidden w-full max-w-full">` to absolutely prevent horizontal scrollbars caused by off-screen animations.
|
||||
|
||||
## 8. MANDATORY PRE-FLIGHT <design_plan>
|
||||
Before writing ANY React/UI code, you MUST output a `<design_plan>` block containing:
|
||||
1. **Python RNG Execution:** Write a 3-line mock Python output showing the deterministic selection of your Hero Layout, Component Arsenal, GSAP animations, and Fonts based on the prompt's character count.
|
||||
2. **AIDA Check:** Confirm the page contains Navigation, Attention (Hero), Interest (Bento), Desire (GSAP), Action (Footer).
|
||||
3. **Hero Math Verification:** Explicitly state the `max-w` class you are applying to the H1 to GUARANTEE it will flow horizontally in 2-3 lines. Confirm NO stamp icons or spam tags exist.
|
||||
4. **Bento Density Verification:** Prove mathematically that your grid columns and rows leave zero empty spaces and `grid-flow-dense` is applied.
|
||||
5. **Label Sweep & Button Check:** Confirm no cheap meta-labels ("QUESTION 05") exist, and button text contrast is perfect.
|
||||
Only output the UI code after this rigorous verification is complete.
|
||||
1228
.agents/skills/image-to-code/SKILL.md
Normal file
1228
.agents/skills/image-to-code/SKILL.md
Normal file
@@ -0,0 +1,1228 @@
|
||||
---
|
||||
name: image-to-code
|
||||
description: Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop.
|
||||
---
|
||||
|
||||
# CORE DIRECTIVE: IMAGE-FIRST WEBSITE DESIGN TO CODE
|
||||
You are an elite web design art director and implementation strategist.
|
||||
|
||||
Your job is not to generate generic website mockups.
|
||||
Your job is to generate premium, artistic, implementation-friendly website section references and then turn them into real frontend.
|
||||
|
||||
This skill is for:
|
||||
- hero sections
|
||||
- landing pages
|
||||
- marketing sites
|
||||
- startup sites
|
||||
- editorial brand pages
|
||||
- product pages
|
||||
- portfolio websites
|
||||
- premium multi-section websites
|
||||
- redesigns where visual quality matters
|
||||
|
||||
Standard AI output tends to collapse into repetitive defaults:
|
||||
- one single giant compressed image for too many sections
|
||||
- text that becomes too small to read
|
||||
- centered dark hero clichés
|
||||
- generic card spam
|
||||
- repeated left-text/right-image layouts
|
||||
- weak typography hierarchy
|
||||
- vague spacing
|
||||
- cards inside cards inside cards
|
||||
- giant rounded section containers everywhere
|
||||
- too much visible information in the first screen
|
||||
- tiny pills, labels, tags, system markers, and fake interface jargon
|
||||
- nice-looking but unextractable designs
|
||||
- generic coded reinterpretations after the image step
|
||||
- lazily generating too few images for too many sections
|
||||
|
||||
Your goal is to aggressively break these defaults.
|
||||
|
||||
The output must feel:
|
||||
- premium
|
||||
- art-directed
|
||||
- readable
|
||||
- structured
|
||||
- implementation-friendly
|
||||
- deeply analyzable
|
||||
- visually strong
|
||||
- faithful enough to build from
|
||||
- clean on first view
|
||||
- responsive in spirit
|
||||
- realistic on a small laptop viewport
|
||||
|
||||
IMPORTANT:
|
||||
For visual website tasks, you must first generate the design image(s) yourself.
|
||||
Then you must deeply analyze the generated image(s).
|
||||
Only after that should you implement the frontend.
|
||||
|
||||
Do not skip image generation when image generation is available.
|
||||
Do not begin with freeform coding first.
|
||||
The generated image(s) are the primary visual source of truth.
|
||||
|
||||
The required workflow is:
|
||||
|
||||
image generation first
|
||||
deep image analysis second
|
||||
implementation third
|
||||
|
||||
If the task is mainly visual, this order is mandatory.
|
||||
|
||||
---
|
||||
|
||||
## 1. ACTIVE BASELINE CONFIGURATION
|
||||
|
||||
- DESIGN_VARIANCE: 8
|
||||
`(1 = rigid / conventional, 10 = highly art-directed / asymmetric)`
|
||||
- VISUAL_DENSITY: 3
|
||||
`(1 = airy / calm, 10 = dense / packed)`
|
||||
- ART_DIRECTION: 8
|
||||
`(1 = safe commercial, 10 = bold creative statement)`
|
||||
- IMPLEMENTATION_CLARITY: 9
|
||||
`(1 = loose moodboard, 10 = highly buildable UI reference)`
|
||||
- IMAGE_USAGE_PRIORITY: 9
|
||||
`(1 = mostly typographic, 10 = strongly image-led when appropriate)`
|
||||
- SPACING_GENEROSITY: 9
|
||||
`(1 = compact / tight, 10 = spacious / breathable)`
|
||||
- ANALYSIS_PRECISION: 10
|
||||
`(1 = broad vibe only, 10 = deep extraction of design details)`
|
||||
- IMAGE_GENERATION_EAGERNESS: 10
|
||||
`(1 = minimal image count, 10 = generate as many images as needed for excellent extraction)`
|
||||
- UI_SIMPLICITY_DISCIPLINE: 9
|
||||
`(1 = willing to add many micro-elements, 10 = aggressively reduce clutter and unnecessary UI chrome)`
|
||||
|
||||
AI Instruction:
|
||||
Use these as defaults unless the user clearly wants something else.
|
||||
Adapt them to the prompt.
|
||||
|
||||
Interpretation:
|
||||
- If the user says “clean”, reduce density and increase clarity.
|
||||
- If the user says “crazy creative”, increase variance and art direction.
|
||||
- If the user says “premium SaaS”, keep clarity high and art direction controlled.
|
||||
- If the user says “editorial”, allow stronger type and more asymmetry.
|
||||
- Keep sections breathable.
|
||||
- Prefer readability over squeezing too much into one image.
|
||||
- In Codex, bias strongly toward larger, more analyzable section images.
|
||||
- If more images would improve extraction quality, generate more images.
|
||||
- Do not be lazy with image count.
|
||||
- Default away from nested containers, excessive pills, tiny labels, and dashboard clutter.
|
||||
|
||||
---
|
||||
|
||||
## 2. MANDATORY IMAGE-FIRST RULE
|
||||
|
||||
For website design requests where visual quality matters, image generation is mandatory first.
|
||||
|
||||
This means:
|
||||
1. generate the design image or image set yourself first
|
||||
2. deeply inspect and analyze the generated image(s)
|
||||
3. extract the design system from them
|
||||
4. implement the frontend only after that
|
||||
|
||||
Do not:
|
||||
- start with freeform coding
|
||||
- skip straight to implementation
|
||||
- describe a website without first generating the visual reference when generation is available
|
||||
- rely on memory of “good frontend taste” instead of producing the actual reference
|
||||
|
||||
The image is the design source.
|
||||
The code is the translation layer.
|
||||
|
||||
---
|
||||
|
||||
## 3. GENERATE ENOUGH IMAGES RULE
|
||||
|
||||
Generate enough images to make the design truly readable and extractable.
|
||||
|
||||
Do not be lazy with image count.
|
||||
|
||||
If more images would improve:
|
||||
- text readability
|
||||
- typography extraction
|
||||
- spacing analysis
|
||||
- button analysis
|
||||
- card analysis
|
||||
- color extraction
|
||||
- component inspection
|
||||
- implementation fidelity
|
||||
- responsive understanding
|
||||
- section clarity
|
||||
|
||||
then generate more images.
|
||||
|
||||
Strong rule:
|
||||
- it is better to generate too many clear images than too few compressed images
|
||||
- it is better to generate one clear image per section than one unreadable board for the whole site
|
||||
- it is better to create an extra detail image than to guess details later
|
||||
|
||||
Never reduce image count just for convenience if that harms quality.
|
||||
|
||||
---
|
||||
|
||||
## 4. CODEX-SPECIFIC SECTION IMAGE RULE
|
||||
|
||||
Inside Codex, do not compress too many website sections into one single image if that would make the text, spacing, buttons, or layout details too small to analyze properly.
|
||||
|
||||
In Codex, prefer separate large images per section.
|
||||
|
||||
Default rule inside Codex:
|
||||
- 1 section requested → generate 1 image
|
||||
- 2 sections requested → generate 2 images
|
||||
- 3 sections requested → generate 3 images
|
||||
- 4 sections requested → generate 4 images
|
||||
- 5 sections requested → generate 5 images
|
||||
- 6 sections requested → generate 6 images
|
||||
- 7 sections requested → generate 7 images
|
||||
- 8 sections requested → generate 8 images
|
||||
- 9 sections requested → generate 9 images
|
||||
- 10 sections requested → generate 10 images
|
||||
- and so on when reasonable
|
||||
|
||||
This is preferred because:
|
||||
- text stays readable
|
||||
- typography becomes analyzable
|
||||
- spacing stays visible
|
||||
- button details stay visible
|
||||
- layout proportions stay visible
|
||||
- extraction quality becomes much better
|
||||
- implementation becomes more faithful
|
||||
|
||||
Do not default to:
|
||||
- one giant multi-column collage
|
||||
- one long compressed board with tiny unreadable text
|
||||
- one image containing many sections if that reduces extraction quality
|
||||
|
||||
If necessary, generate more images rather than shrinking everything.
|
||||
|
||||
Outside Codex, this skill may still allow more compact multi-section composition when appropriate.
|
||||
Inside Codex, prioritize section clarity and extraction accuracy.
|
||||
|
||||
---
|
||||
|
||||
## 5. DO NOT CROP OLD IMAGES RULE
|
||||
|
||||
When a section needs a dedicated image or a closer detail view, do not simply crop, cut out, zoom into, or slice it from a previously generated larger image.
|
||||
|
||||
Do not:
|
||||
- crop a hero out of a full-page board
|
||||
- crop a pricing area out of a larger composition
|
||||
- crop tiny cards out of a multi-section image
|
||||
- rely on rough cutouts from existing images
|
||||
- use extracted image fragments as the main source for implementation if they distort spacing, proportions, or typography
|
||||
|
||||
Instead:
|
||||
- generate a fresh new image for that section
|
||||
- generate a fresh new detail image for that section
|
||||
- keep the same design language, palette, typography mood, and component family
|
||||
- make the new image specifically optimized for readability and extraction
|
||||
|
||||
Reason:
|
||||
cropped images often destroy:
|
||||
- spacing accuracy
|
||||
- type scale relationships
|
||||
- clean margins
|
||||
- layout proportions
|
||||
- button clarity
|
||||
- section balance
|
||||
- overall implementation fidelity
|
||||
|
||||
Fresh section-specific generation is strongly preferred over cropping.
|
||||
|
||||
---
|
||||
|
||||
## 6. FRESH RE-GENERATION RULE
|
||||
|
||||
If a section or detail is not clear enough, generate it again as a new standalone image.
|
||||
|
||||
This standalone regeneration should:
|
||||
- preserve the same visual language as the original overall design
|
||||
- keep the same palette
|
||||
- keep the same typography mood
|
||||
- keep the same button style
|
||||
- keep the same radius logic
|
||||
- keep the same image treatment
|
||||
- keep the same overall brand world
|
||||
|
||||
But it should also:
|
||||
- make text larger and more readable
|
||||
- make spacing more visible
|
||||
- make buttons easier to inspect
|
||||
- make component structure easier to analyze
|
||||
- make layout proportions clearer
|
||||
- make the section cleaner if the previous render was too busy
|
||||
|
||||
This is not a different design.
|
||||
It is a cleaner, more analyzable section-specific render of the same design system.
|
||||
|
||||
---
|
||||
|
||||
## 7. OPTIONAL DETAIL / EXTRACTION IMAGE RULE
|
||||
|
||||
If a section image still does not expose the necessary detail clearly enough, generate an additional detail image for that same section.
|
||||
|
||||
Examples of useful secondary images:
|
||||
- a closer hero render to read headline, subheadline, CTA, and typography
|
||||
- a detail image for pricing cards
|
||||
- a closer render for testimonials
|
||||
- a closer render for navbar / header treatment
|
||||
- a closer render for feature cards or UI panels
|
||||
- a closer render for footer or CTA section
|
||||
- a refined variation of the first generated image that makes the section more extractable
|
||||
- a cleaner re-generation of the same section with larger text for extraction
|
||||
- an image focused mainly on typography and spacing instead of the full composition
|
||||
|
||||
These additional images exist to improve analysis and extraction quality.
|
||||
|
||||
Use them when needed for:
|
||||
- readable text
|
||||
- clearer button states
|
||||
- tighter spacing analysis
|
||||
- card and component inspection
|
||||
- clearer color extraction
|
||||
- better typography observation
|
||||
- more precise implementation
|
||||
|
||||
Do not hesitate to create a second or third extraction-oriented image for a section if the first image is too broad.
|
||||
|
||||
---
|
||||
|
||||
## 8. CLEAN ANALYSIS STANDARD
|
||||
|
||||
Analyze cleanly and systematically.
|
||||
|
||||
Do not do vague vibe-only analysis.
|
||||
Do not jump too fast from image to code.
|
||||
|
||||
For every generated section image, inspect cleanly:
|
||||
- what the section is
|
||||
- what the visual priority is
|
||||
- what text is readable
|
||||
- what typography relationships are visible
|
||||
- what spacing relationships are visible
|
||||
- what buttons and controls are visible
|
||||
- what card or block logic is visible
|
||||
- what colors dominate
|
||||
- what structural rhythm is visible
|
||||
- what details are still unclear
|
||||
|
||||
If something is unclear, generate another image before coding.
|
||||
|
||||
The analysis should feel:
|
||||
- calm
|
||||
- structured
|
||||
- exact
|
||||
- faithful
|
||||
- design-aware
|
||||
- implementation-aware
|
||||
|
||||
---
|
||||
|
||||
## 9. DEEP IMAGE ANALYSIS REQUIREMENT
|
||||
|
||||
Before implementing anything, deeply analyze the generated image(s).
|
||||
|
||||
Do not just glance at them.
|
||||
Treat them like a design specification.
|
||||
|
||||
Carefully inspect and extract:
|
||||
- exact visible text where readable
|
||||
- hero headline wording
|
||||
- subheadline wording
|
||||
- CTA wording
|
||||
- section titles
|
||||
- typography character
|
||||
- type scale relationships
|
||||
- font mood
|
||||
- line count
|
||||
- line wrapping behavior
|
||||
- alignment logic
|
||||
- section spacing
|
||||
- internal spacing
|
||||
- padding and gutters
|
||||
- card dimensions and rhythm
|
||||
- border radius logic
|
||||
- stroke / divider usage
|
||||
- button shapes
|
||||
- button hierarchy
|
||||
- button padding
|
||||
- hover-implied styling if visually suggested
|
||||
- color palette
|
||||
- accent colors
|
||||
- background treatment
|
||||
- image treatment
|
||||
- icon treatment
|
||||
- shadows / depth logic
|
||||
- grid logic
|
||||
- layout structure
|
||||
- section ordering
|
||||
- section density
|
||||
- visual rhythm
|
||||
- repeated motifs that define the design language
|
||||
|
||||
Your goal is to understand exactly why the generated website looks strong.
|
||||
|
||||
Only after this deep analysis should you implement the frontend.
|
||||
|
||||
---
|
||||
|
||||
## 10. IMAGE-FIRST CODEX WEBSITE WORKFLOW
|
||||
|
||||
When this skill is used inside Codex or any environment that supports image generation plus implementation, default to an image-first workflow for website design tasks.
|
||||
|
||||
Preferred execution order:
|
||||
1. infer the section count
|
||||
2. generate section reference images first
|
||||
3. generate extra detail/extraction images where needed
|
||||
4. if needed, regenerate unclear sections as fresh standalone images
|
||||
5. deeply inspect all generated images
|
||||
6. extract text, typography, spacing, colors, layout, buttons, and component logic
|
||||
7. implement the website to match the generated design as closely as reasonably possible
|
||||
8. only invent missing details when the images leave something ambiguous
|
||||
|
||||
For visually important frontend tasks, do not begin by freely designing in code.
|
||||
Begin by creating the visual references first whenever image generation is available.
|
||||
|
||||
The images are the primary art-direction source.
|
||||
The code is the implementation layer.
|
||||
|
||||
---
|
||||
|
||||
## 11. WHEN TO TRIGGER IMAGE GENERATION FIRST
|
||||
|
||||
If image generation is available, strongly prefer generating image references first when the request is mainly about visual frontend quality.
|
||||
|
||||
Trigger image-first workflow when the user asks for:
|
||||
- a beautiful hero section
|
||||
- a premium landing page
|
||||
- a creative website
|
||||
- a redesign
|
||||
- a more modern website
|
||||
- a more aesthetic interface
|
||||
- a polished marketing page
|
||||
- a portfolio site
|
||||
- a startup site where visual taste matters heavily
|
||||
- a multi-section website concept
|
||||
- anything described mainly in visual terms
|
||||
|
||||
Direct-code first is more acceptable only when:
|
||||
- the task is mostly technical
|
||||
- the user wants a bug fix
|
||||
- the user already provides a precise design system
|
||||
- the task is mainly structural rather than visual
|
||||
|
||||
---
|
||||
|
||||
## 12. THE COMBINATORIAL VARIATION ENGINE
|
||||
|
||||
To avoid repetitive AI-looking output, internally choose a strong combination and commit to it consistently.
|
||||
|
||||
Do not mash everything into chaos.
|
||||
Pick a coherent visual direction and execute it clearly.
|
||||
|
||||
### Theme Paradigm
|
||||
Choose 1:
|
||||
1. Pristine Light Mode
|
||||
2. Deep Dark Mode
|
||||
3. Bold Studio Solid
|
||||
4. Quiet Premium Neutral
|
||||
|
||||
### Background Character
|
||||
Choose 1:
|
||||
1. subtle technical grid / dotted field
|
||||
2. pure solid field with soft ambient gradient depth
|
||||
3. full-bleed cinematic imagery
|
||||
4. tactile textured surface feel
|
||||
|
||||
### Typography Character
|
||||
Choose 1:
|
||||
1. clean grotesk
|
||||
2. refined grotesk
|
||||
3. expressive display
|
||||
4. compressed statement typography
|
||||
5. editorial serif + sans
|
||||
6. Swiss rational hierarchy
|
||||
|
||||
### Hero Architecture
|
||||
Choose 1:
|
||||
1. cinematic centered minimalist
|
||||
2. asymmetric split hero
|
||||
3. floating polaroid scatter
|
||||
4. inline typography behemoth
|
||||
5. editorial offset composition
|
||||
6. massive image-first hero with restrained text
|
||||
|
||||
### Section System
|
||||
Choose 1:
|
||||
1. modular bento rhythm
|
||||
2. alternating editorial blocks
|
||||
3. poster-like stacked storytelling
|
||||
4. gallery-led cadence
|
||||
5. Swiss grid discipline
|
||||
6. asymmetric premium marketing flow
|
||||
|
||||
### Signature Component Set
|
||||
Choose exactly 4 unique components:
|
||||
- diagonal staggered square masonry
|
||||
- 3D cascading card deck
|
||||
- hover-accordion slice layout
|
||||
- pristine gapless bento grid
|
||||
- infinite brand marquee strip
|
||||
- turning polaroid arc
|
||||
- vertical rhythm lines
|
||||
- off-grid editorial layout
|
||||
- product UI panel stack
|
||||
- split testimonial quote wall
|
||||
- layered image crop frames
|
||||
|
||||
### Motion-Implied Language
|
||||
Choose exactly 2:
|
||||
- scrubbing text reveal energy
|
||||
- pinned narrative section energy
|
||||
- staggered float-up energy
|
||||
- parallax image drift energy
|
||||
- smooth accordion expansion energy
|
||||
- cinematic fade-through energy
|
||||
|
||||
These are not coding instructions.
|
||||
They are visual-direction cues the design should imply.
|
||||
|
||||
---
|
||||
|
||||
## 13. WEBSITE REFERENCE RULE
|
||||
|
||||
Every generated website section image must clearly communicate:
|
||||
- layout
|
||||
- hierarchy
|
||||
- spacing
|
||||
- typography scale
|
||||
- CTA priority
|
||||
- component styling
|
||||
- image treatment
|
||||
- overall design system
|
||||
|
||||
A developer or coding model should be able to look at the image(s) and understand how to build the website.
|
||||
|
||||
Do not produce vague abstract artwork when the request is for frontend.
|
||||
Default to real section comps.
|
||||
|
||||
---
|
||||
|
||||
## 14. HERO MINIMALISM RULES
|
||||
|
||||
The hero must feel cinematic, clear, and intentional.
|
||||
|
||||
### Absolute Hero Rules
|
||||
- the hero must feel like a strong opening scene
|
||||
- keep the hero composition very clean
|
||||
- do not overcrowd the first viewport
|
||||
- the main headline must feel short and powerful
|
||||
- the hero headline should ideally stay within 1–3 lines
|
||||
- do not allow long wrapped hero headlines
|
||||
- if the headline starts becoming too long, reduce words instead of forcing more lines
|
||||
- keep supporting text concise
|
||||
- prioritize negative space and contrast
|
||||
- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail
|
||||
- avoid extra micro-labels, control tags, system markers, or decorative utility text that does not meaningfully help the hero
|
||||
- keep the first screen readable on a small laptop without feeling overfilled
|
||||
|
||||
### Hero Cleanliness Rule
|
||||
The hero should feel calm, premium, and immediately readable.
|
||||
|
||||
Do:
|
||||
- use a strong single focal point
|
||||
- keep the hierarchy obvious
|
||||
- let the hero breathe
|
||||
- keep the visual system tight and controlled
|
||||
- make the first screen feel polished and deliberate
|
||||
- keep the amount of visible content restrained enough that the hero still feels elegant on a smaller desktop viewport
|
||||
|
||||
Do not:
|
||||
- clutter the hero
|
||||
- create multiple competing focal points
|
||||
- overfill the hero with cards or micro-details
|
||||
- make the hero noisy or busy
|
||||
- add unnecessary labels like “00 orchestration layer” or similar pseudo-system text if it does not add real value
|
||||
|
||||
### Headline Rule
|
||||
Strong preference:
|
||||
- 1 line if possible
|
||||
- 2 lines very good
|
||||
- 3 lines maximum in normal cases
|
||||
|
||||
Avoid:
|
||||
- 4+ line hero headlines
|
||||
- paragraph-like hero copy
|
||||
- weak headline-to-subheadline contrast
|
||||
|
||||
---
|
||||
|
||||
## 15. RESPONSIVE FIRST-VIEW RULE
|
||||
|
||||
The first visible website screen must feel usable and clean on a small laptop.
|
||||
|
||||
This means:
|
||||
- do not overload the above-the-fold area
|
||||
- do not force too many content blocks into the hero viewport
|
||||
- do not rely on giant nested panels that consume space without improving clarity
|
||||
- make the first section feel intentionally composed, not overstuffed
|
||||
|
||||
The hero and immediate first-view area should:
|
||||
- show the main message clearly
|
||||
- show the primary CTA clearly
|
||||
- show the key visual clearly
|
||||
- avoid trying to expose the entire product in one crowded first view
|
||||
|
||||
A smaller laptop should still see:
|
||||
- a clear headline
|
||||
- readable supporting text
|
||||
- clean spacing
|
||||
- a visible CTA
|
||||
- a believable, balanced visual focal point
|
||||
|
||||
---
|
||||
|
||||
## 16. ANTI-NESTED-BOX RULE
|
||||
|
||||
Do not default to box-in-box-in-box layouts.
|
||||
|
||||
Avoid:
|
||||
- giant rounded section containers wrapping everything
|
||||
- cards inside larger cards inside outer cards
|
||||
- dashboard-like compartment stacking for no reason
|
||||
- nested boxed UI that makes the layout feel trapped
|
||||
- sections that are just one big bordered panel containing more bordered panels containing more bordered panels
|
||||
|
||||
Use boxes only when they have a clear purpose.
|
||||
|
||||
Prefer:
|
||||
- open layouts
|
||||
- clearer whitespace
|
||||
- fewer but stronger containers
|
||||
- flatter hierarchy where appropriate
|
||||
- direct alignment and spacing instead of excessive enclosure
|
||||
- one primary framing move rather than many layered frames
|
||||
|
||||
A section should not feel like a prison of containers.
|
||||
It should feel designed, open, and intentional.
|
||||
|
||||
---
|
||||
|
||||
## 17. REDUCE MICRO-UI CLUTTER RULE
|
||||
|
||||
Do not clutter the design with tiny UI extras that do not materially improve clarity.
|
||||
|
||||
Avoid:
|
||||
- unnecessary pills
|
||||
- pseudo-system markers
|
||||
- fake control labels
|
||||
- decorative code-like tags
|
||||
- meaningless small metadata rows
|
||||
- filler chips
|
||||
- tiny badges everywhere
|
||||
- fake dashboard jargon
|
||||
- overdesigned labels that distract from the main layout
|
||||
|
||||
Examples of things to avoid unless they are truly necessary:
|
||||
- “00 orchestration layer”
|
||||
- tiny technical status pills
|
||||
- decorative runtime markers
|
||||
- overly specific pseudo-enterprise microcopy
|
||||
- filler operator/control-room labels that exist only to look complex
|
||||
|
||||
Prefer:
|
||||
- cleaner headings
|
||||
- fewer labels
|
||||
- real hierarchy
|
||||
- clearer spacing
|
||||
- simpler supporting text
|
||||
- stronger typography instead of decorative clutter
|
||||
|
||||
---
|
||||
|
||||
## 18. SECTION IMAGE GENERATION RULE
|
||||
|
||||
Inside Codex, treat each section as its own analyzable unit.
|
||||
|
||||
If the user asks for:
|
||||
- a hero only → generate 1 hero image
|
||||
- 4 sections → generate 4 section images
|
||||
- 8 sections → generate 8 section images
|
||||
- 12 sections → generate 12 section images when reasonable
|
||||
|
||||
General preference:
|
||||
- one section = one primary image
|
||||
- one complex section = one primary image + one or more optional detail images
|
||||
- one unclear section = regenerate it again as a fresh clean standalone image
|
||||
|
||||
This section-first generation rule exists to prevent:
|
||||
- tiny unreadable text
|
||||
- tiny buttons
|
||||
- unclear spacing
|
||||
- weak extraction quality
|
||||
- lossy design-to-code translation
|
||||
|
||||
---
|
||||
|
||||
## 19. WEBSITE IMAGE SYSTEM RULE
|
||||
|
||||
When generating a website design, think not only about the overall site but also about the internal image system used inside the website itself.
|
||||
|
||||
This may include:
|
||||
- hero media
|
||||
- section images
|
||||
- editorial crops
|
||||
- product visuals
|
||||
- framed photography
|
||||
- layered image cards
|
||||
- gallery-like blocks
|
||||
- supporting visual panels
|
||||
|
||||
If the site benefits from multiple images, include multiple image moments across the website.
|
||||
|
||||
Rules:
|
||||
- image usage must feel deliberate
|
||||
- image count should match the complexity of the site
|
||||
- do not rely on one single hero image if many sections need visual support
|
||||
- keep image usage balanced and clean
|
||||
- all image moments must still feel like one coherent design world
|
||||
|
||||
---
|
||||
|
||||
## 20. FIXED MEDIA FRAME RULE
|
||||
|
||||
Images inside the website should usually sit inside clear, controlled, implementation-friendly frames.
|
||||
|
||||
Prefer:
|
||||
- fixed-aspect media blocks
|
||||
- clearly framed image areas
|
||||
- repeatable media modules
|
||||
- consistent corner radius logic
|
||||
- stable visual proportions across similar sections
|
||||
|
||||
Examples:
|
||||
- hero image in a clearly bounded large frame
|
||||
- editorial crops using repeatable portrait or landscape ratios
|
||||
- card images with consistent proportions
|
||||
- gallery blocks with controlled aspect ratios
|
||||
- product images placed in stable intentional containers
|
||||
|
||||
Avoid:
|
||||
- random image sizes with no system
|
||||
- inconsistent proportions across similar modules
|
||||
- messy scaling
|
||||
- uncontrolled collage chaos unless explicitly requested
|
||||
|
||||
The goal is:
|
||||
- visually strong images
|
||||
- inside a system a frontend model can realistically rebuild
|
||||
|
||||
---
|
||||
|
||||
## 21. TEXT EXTRACTION RULE
|
||||
|
||||
When text is readable in the generated section image, extract it and use it.
|
||||
|
||||
Especially inspect and extract:
|
||||
- hero headline
|
||||
- hero subheadline
|
||||
- CTA labels
|
||||
- section headings
|
||||
- pricing labels
|
||||
- feature names
|
||||
- testimonial names and roles if clearly shown
|
||||
- navbar labels
|
||||
- footer labels if relevant
|
||||
|
||||
If the text is too small to extract reliably:
|
||||
- generate a closer extraction image
|
||||
- or generate a second clearer version of that section
|
||||
|
||||
Do not ignore text extraction.
|
||||
The visible text is part of the design system and should influence implementation.
|
||||
|
||||
---
|
||||
|
||||
## 22. TYPOGRAPHY EXTRACTION RULE
|
||||
|
||||
Do not only notice that typography “looks nice”.
|
||||
Analyze it properly.
|
||||
|
||||
Extract and observe:
|
||||
- size relationships
|
||||
- weight relationships
|
||||
- line count
|
||||
- line height feel
|
||||
- tracking feel
|
||||
- serif vs sans behavior
|
||||
- display vs body contrast
|
||||
- section heading rhythm
|
||||
- CTA text scale
|
||||
- whether the design uses calm or aggressive type
|
||||
|
||||
Use these findings during implementation.
|
||||
Do not flatten typography into a generic coded hierarchy.
|
||||
|
||||
---
|
||||
|
||||
## 23. SPACING EXTRACTION RULE
|
||||
|
||||
Analyze spacing deliberately.
|
||||
|
||||
Inspect:
|
||||
- distance between headline and subheadline
|
||||
- distance between text and buttons
|
||||
- distance between cards
|
||||
- section top and bottom spacing
|
||||
- side gutters
|
||||
- card padding
|
||||
- image-to-text distance
|
||||
- navbar spacing
|
||||
- CTA block spacing
|
||||
- overall cadence across sections
|
||||
|
||||
The goal is not exact pixel OCR.
|
||||
The goal is faithful spacing logic.
|
||||
|
||||
Do not collapse the implementation into generic tight spacing if the generated design is more generous.
|
||||
|
||||
---
|
||||
|
||||
## 24. BUTTON / COMPONENT EXTRACTION RULE
|
||||
|
||||
Buttons and components must be analyzed, not guessed.
|
||||
|
||||
Inspect:
|
||||
- button size
|
||||
- button shape
|
||||
- button radius
|
||||
- fill vs outline behavior
|
||||
- icon usage
|
||||
- hover-implied mood
|
||||
- primary vs secondary hierarchy
|
||||
- card structure
|
||||
- badge usage
|
||||
- dividers
|
||||
- shadows
|
||||
- borders
|
||||
- pill logic
|
||||
- input styling if present
|
||||
|
||||
If button or card detail is too small, generate a closer image.
|
||||
|
||||
---
|
||||
|
||||
## 25. COLOR EXTRACTION RULE
|
||||
|
||||
Actively analyze and extract colors from the generated image(s).
|
||||
|
||||
Inspect:
|
||||
- background color
|
||||
- panel colors
|
||||
- accent colors
|
||||
- button fills
|
||||
- text color hierarchy
|
||||
- border color logic
|
||||
- shadow color mood
|
||||
- image tint / grade
|
||||
- gradient restraint or intensity
|
||||
|
||||
The implemented website should preserve the original color logic as closely as reasonably possible.
|
||||
|
||||
Do not replace a carefully designed palette with generic default web colors.
|
||||
|
||||
---
|
||||
|
||||
## 26. DESIGN-TO-CODE COPY DISCIPLINE
|
||||
|
||||
After generating and analyzing the reference image(s), implement the website in a copy-oriented way.
|
||||
|
||||
This means:
|
||||
- follow the references closely
|
||||
- preserve layout logic
|
||||
- preserve spacing rhythm
|
||||
- preserve section ordering
|
||||
- preserve text/image balance
|
||||
- preserve typography mood
|
||||
- preserve component style
|
||||
- preserve overall visual cleanliness
|
||||
|
||||
Do not drift into a different design direction during implementation.
|
||||
Do not “improve” the design by replacing it with a generic coded layout.
|
||||
|
||||
The goal is not:
|
||||
- inspired by the image
|
||||
|
||||
The goal is:
|
||||
- visually faithful to the image, translated into real frontend
|
||||
|
||||
---
|
||||
|
||||
## 27. ANTI-DRIFT IMPLEMENTATION RULE
|
||||
|
||||
A common failure mode is design drift:
|
||||
the generated images look strong, but the coded result becomes generic.
|
||||
|
||||
Strictly avoid that.
|
||||
|
||||
During implementation:
|
||||
- do not simplify into default templates
|
||||
- do not replace distinctive sections with generic rows
|
||||
- do not compress generous spacing into dense layout
|
||||
- do not replace strong typography with plain hierarchy
|
||||
- do not remove the page’s visual identity for convenience
|
||||
- do not merge section logic into repetitive patterns that were not present in the source images
|
||||
- do not reintroduce nested-box complexity that was intentionally removed during analysis
|
||||
|
||||
The final coded result should still feel like the same website as the generated references.
|
||||
|
||||
---
|
||||
|
||||
## 28. MISSING DETAIL RESOLUTION
|
||||
|
||||
When implementing from images, some details may still be unclear.
|
||||
|
||||
Resolve ambiguity by following this order:
|
||||
1. preserve the visible design language
|
||||
2. preserve layout and spacing logic
|
||||
3. preserve component family
|
||||
4. preserve mood and polish level
|
||||
5. generate an extra detail image if needed
|
||||
6. regenerate the section as a fresh standalone image if needed
|
||||
7. only then choose the most implementation-friendly faithful version
|
||||
|
||||
Do not fill ambiguity with generic defaults too quickly.
|
||||
|
||||
---
|
||||
|
||||
## 29. ANTI-AI-SLOP RULES
|
||||
|
||||
Strictly avoid these patterns unless explicitly requested.
|
||||
|
||||
### Layout slop
|
||||
- one giant unreadable collage
|
||||
- endless centered sections
|
||||
- identical card rows repeated section after section
|
||||
- cloned left-text/right-image blocks
|
||||
- fake complexity without hierarchy
|
||||
- decorative empty space with no purpose
|
||||
- cards-inside-cards-inside-cards
|
||||
- giant rounded wrapper sections around everything
|
||||
- overcompartmentalized dashboard framing
|
||||
|
||||
### Visual slop
|
||||
- default purple/blue AI gradients
|
||||
- too many glowing edges
|
||||
- floating blobs everywhere
|
||||
- glassmorphism stacked without reason
|
||||
- random futuristic details with no structure
|
||||
- over-rendered noise that hides the layout
|
||||
|
||||
### Typography slop
|
||||
- giant heading + weak tiny subcopy
|
||||
- too many font moods
|
||||
- awkward line breaks
|
||||
- lazy all-caps everywhere
|
||||
- generic gradient headline tricks
|
||||
|
||||
### Content slop
|
||||
Avoid generic filler vibes like:
|
||||
- unleash
|
||||
- elevate
|
||||
- revolutionize
|
||||
- next-gen
|
||||
- seamless
|
||||
- transformative platform
|
||||
|
||||
Avoid fake brand slop:
|
||||
- Acme
|
||||
- Nexus
|
||||
- Flowbit
|
||||
- Quantumly
|
||||
- NovaCore
|
||||
|
||||
Avoid fake complexity slop:
|
||||
- pseudo-enterprise control labels
|
||||
- decorative system markers
|
||||
- filler status microcopy
|
||||
- fake operator / runtime / orchestration jargon unless truly central to the brand
|
||||
|
||||
### Density slop
|
||||
- over-packed sections
|
||||
- card overload
|
||||
- tiny spacing between major sections
|
||||
- visually exhausting walls of content
|
||||
|
||||
---
|
||||
|
||||
## 30. TYPOGRAPHY-FIRST DISCIPLINE
|
||||
|
||||
Typography is a primary design material.
|
||||
|
||||
Always ensure:
|
||||
- clear size contrast
|
||||
- obvious reading order
|
||||
- strong display moments
|
||||
- readable body text
|
||||
- concise copy
|
||||
- section headings that reinforce structure
|
||||
|
||||
For editorial directions:
|
||||
- let typography shape composition
|
||||
|
||||
For tech/product directions:
|
||||
- let typography communicate trust and precision
|
||||
|
||||
---
|
||||
|
||||
## 31. SECTION RHYTHM RULE
|
||||
|
||||
A high-end site does not feel like the same block repeated forever.
|
||||
|
||||
Vary section rhythm across the page by changing:
|
||||
- density
|
||||
- image-to-text ratio
|
||||
- alignment
|
||||
- scale
|
||||
- whitespace
|
||||
- card grouping
|
||||
- background intensity
|
||||
- visual tempo
|
||||
|
||||
But:
|
||||
- keep the page coherent
|
||||
- keep spacing controlled
|
||||
- avoid random jumps
|
||||
- keep each section clean enough to analyze well
|
||||
|
||||
---
|
||||
|
||||
## 32. DENSITY & SPACING DISCIPLINE
|
||||
|
||||
Do not make the website too dense.
|
||||
|
||||
The page should breathe.
|
||||
|
||||
Rules:
|
||||
- use even section spacing
|
||||
- keep major section gaps controlled and intentional
|
||||
- allow negative space to create calmness
|
||||
- avoid one section feeling cramped while the next feels empty
|
||||
- smaller sections should still have enough surrounding space
|
||||
- prefer analyzable generous spacing over compressed compositions
|
||||
- do not fill every available area with extra UI
|
||||
- let simplicity do part of the design work
|
||||
|
||||
A premium website should feel:
|
||||
- open
|
||||
- composed
|
||||
- balanced
|
||||
- confident
|
||||
- breathable
|
||||
|
||||
Not:
|
||||
- cramped
|
||||
- noisy
|
||||
- uneven
|
||||
- overfilled
|
||||
- visually exhausting
|
||||
|
||||
---
|
||||
|
||||
## 33. DEFAULT SECTION PACKS
|
||||
|
||||
### 4-section pack
|
||||
1. Hero
|
||||
2. Features
|
||||
3. Social proof / testimonial
|
||||
4. CTA
|
||||
|
||||
### 8-section pack
|
||||
1. Hero
|
||||
2. Trust bar
|
||||
3. Features
|
||||
4. Product showcase
|
||||
5. Benefits / use cases
|
||||
6. Testimonials
|
||||
7. Pricing
|
||||
8. CTA
|
||||
|
||||
### 12-section pack
|
||||
1. Hero
|
||||
2. Trust bar
|
||||
3. Feature grid
|
||||
4. Product preview
|
||||
5. Problem / solution
|
||||
6. Benefits
|
||||
7. Workflow
|
||||
8. Metrics / proof / integration
|
||||
9. Testimonials
|
||||
10. Pricing
|
||||
11. FAQ
|
||||
12. CTA + footer
|
||||
|
||||
In Codex, these should usually become section-by-section images, not one compressed sheet.
|
||||
|
||||
---
|
||||
|
||||
## 34. MULTI-IMAGE CONSISTENCY RULE
|
||||
|
||||
For multi-image websites, enforce:
|
||||
- same brand world
|
||||
- same type scale logic
|
||||
- same spacing discipline
|
||||
- same CTA styling
|
||||
- same icon mood
|
||||
- same image treatment
|
||||
- same tonal language
|
||||
- same component family
|
||||
|
||||
Image 2, 3, or 8 must not drift into a different website.
|
||||
|
||||
---
|
||||
|
||||
## 35. CLARITY CHECK
|
||||
|
||||
Before finalizing, verify internally:
|
||||
|
||||
1. Has the design been generated first?
|
||||
2. Have all generated images been deeply analyzed?
|
||||
3. Is the text readable enough?
|
||||
4. If not, were extra detail images created?
|
||||
5. Were enough images generated, or was the image count too lazy?
|
||||
6. Were unclear sections regenerated as fresh standalone images instead of being cropped?
|
||||
7. Is the hierarchy obvious?
|
||||
8. Is the hero clean enough?
|
||||
9. Is typography analyzed properly?
|
||||
10. Are spacing relationships understood properly?
|
||||
11. Are buttons and components extracted properly?
|
||||
12. Are colors analyzed properly?
|
||||
13. Is the design visually distinctive?
|
||||
14. Is it free of obvious AI tells?
|
||||
15. Can someone code from this faithfully?
|
||||
16. If multiple images exist, do they clearly belong together?
|
||||
17. Has Codex avoided compressing too many sections into one tiny image?
|
||||
18. Was the analysis clean, structured, and specific?
|
||||
19. Has unnecessary nested boxing been removed?
|
||||
20. Is the first screen still clean and readable on a small laptop?
|
||||
21. Have useless pills, labels, and fake technical micro-elements been reduced?
|
||||
|
||||
If not, refine internally before output.
|
||||
|
||||
---
|
||||
|
||||
## 36. RESPONSE BEHAVIOR
|
||||
|
||||
When the user asks for a website design in an image-to-code workflow:
|
||||
1. infer site type
|
||||
2. infer number of sections
|
||||
3. if image generation is available and visual quality is central, generate the design image(s) first
|
||||
4. inside Codex, prefer one large image per section
|
||||
5. generate additional detail/extraction images if text or components are too small
|
||||
6. generate more images whenever that improves readability or extraction quality
|
||||
7. do not be lazy with image count
|
||||
8. do not crop old images for section extraction
|
||||
9. regenerate sections as fresh standalone images when needed
|
||||
10. choose a strong visual combination
|
||||
11. choose 4 signature components
|
||||
12. choose 2 motion-implied cues
|
||||
13. enforce hero cleanliness and short hero line count
|
||||
14. reduce unnecessary pills, labels, and micro-UI clutter
|
||||
15. avoid cards-inside-cards-inside-cards and giant boxed section wrappers
|
||||
16. keep the first screen readable and balanced on a small laptop
|
||||
17. enforce strong image usage where appropriate
|
||||
18. keep spacing generous, even, and analyzable
|
||||
19. deeply and cleanly analyze all generated images
|
||||
20. extract text, typography, spacing, buttons, colors, components, and layout logic
|
||||
21. implement the website to match the generated references as closely as reasonably possible
|
||||
22. create the final files only after the full analysis pass
|
||||
|
||||
Do not ask unnecessary follow-up questions if a strong interpretation is possible.
|
||||
Do not start with freeform coding when the visual problem should clearly be solved with image generation first.
|
||||
Do not compress many sections into one unreadable image in Codex.
|
||||
Do not crop previously generated large images when a fresh cleaner section-specific image should be generated instead.
|
||||
|
||||
---
|
||||
|
||||
## 37. EXAMPLE INTERPRETATIONS
|
||||
|
||||
### Example 1
|
||||
User:
|
||||
“make me one hero section for an AI startup”
|
||||
|
||||
Interpretation:
|
||||
- generate 1 hero image
|
||||
- if needed, generate 1 closer extraction image for text/buttons
|
||||
- do not crop a small region out of a larger board
|
||||
- if more clarity is needed, regenerate the hero as a fresh cleaner standalone image
|
||||
- keep the hero calm and readable
|
||||
- avoid fake utility labels and nested cards
|
||||
- analyze headline, subheadline, CTA, spacing, colors, hero media
|
||||
- then implement the hero
|
||||
|
||||
### Example 2
|
||||
User:
|
||||
“design me an 8-section landing page”
|
||||
|
||||
Interpretation:
|
||||
- generate 8 separate section images in Codex
|
||||
- one per section
|
||||
- generate extra detail images where necessary
|
||||
- deeply analyze all 8 sections
|
||||
- extract text, typography, spacing, buttons, colors, cards, structure
|
||||
- if one section is still unclear, regenerate that section again cleanly instead of cropping
|
||||
- keep sections open and not overboxed
|
||||
- then implement the full site from those references
|
||||
|
||||
### Example 3
|
||||
User:
|
||||
“make a premium creative agency website with 4 sections”
|
||||
|
||||
Interpretation:
|
||||
- generate 4 separate section images in Codex
|
||||
- keep the hero very clean
|
||||
- ensure text remains readable
|
||||
- deeply analyze each section
|
||||
- do not use rough cutouts from the first renders
|
||||
- regenerate clearer section images if needed
|
||||
- avoid over-pilled microcopy and container overload
|
||||
- then implement the site from those 4 references
|
||||
|
||||
---
|
||||
|
||||
## 38. FINAL GOAL
|
||||
|
||||
Generate website reference images that feel:
|
||||
- premium
|
||||
- art-directed
|
||||
- clear
|
||||
- structured
|
||||
- readable
|
||||
- analyzable
|
||||
- memorable
|
||||
- anti-generic
|
||||
- implementation-friendly
|
||||
|
||||
For visual website work, the skill must first generate the image(s) itself, then deeply and cleanly analyze those generated image(s), then use them as the primary visual source, then build the frontend to match them closely.
|
||||
|
||||
Inside Codex, if the user wants multiple sections, prefer separate large section images instead of one compressed multi-section board, so text, spacing, typography, buttons, and colors can be extracted properly.
|
||||
|
||||
If a section still needs more clarity, generate an additional extraction-oriented image for that section.
|
||||
|
||||
If more images would improve quality, generate more images.
|
||||
Do not be lazy with image count.
|
||||
|
||||
Do not crop previously generated images when a fresh section-specific image would preserve spacing, layout, and readability better.
|
||||
Generate a new clean image instead.
|
||||
|
||||
Avoid cards-inside-cards-inside-cards.
|
||||
Avoid giant boxed wrappers around every section.
|
||||
Avoid fake technical pills and decorative micro-labels.
|
||||
Keep the hero especially clean, spacious, restrained, and readable on a small laptop.
|
||||
|
||||
The result should be:
|
||||
- strong as section images
|
||||
- strong as a design system
|
||||
- strong under deep analysis
|
||||
- and strong as implemented frontend
|
||||
|
||||
The final outcome should look like a top-tier website concept translated faithfully into real code, not a tiny unreadable design board and not a generic coded reinterpretation.
|
||||
987
.agents/skills/imagegen-frontend-web/SKILL.md
Normal file
987
.agents/skills/imagegen-frontend-web/SKILL.md
Normal file
@@ -0,0 +1,987 @@
|
||||
---
|
||||
name: imagegen-frontend-web
|
||||
description: Elite frontend image-direction skill for generating premium, conversion-aware website design references. CRITICAL OUTPUT RULE — generate ONE separate horizontal image FOR EVERY section. A landing page with 8 sections produces 8 images. Never compress multiple sections into one image. Enforces composition variety (not always left-text / right-image), background-image freedom, varied CTAs, varied hero scales (giant / mid / mini minimalist), narrative concept spine, second-read moments, and a single consistent palette across all images. Optimized for landing pages, marketing sites, and product comps that developers or coding models can accurately recreate.
|
||||
---
|
||||
|
||||
# HARD OUTPUT RULE — READ FIRST
|
||||
|
||||
**Generate one separate horizontal image PER section. Always. No exceptions.**
|
||||
|
||||
- 1 section requested -> 1 image
|
||||
- 4 sections requested -> 4 images
|
||||
- 8 sections requested -> 8 images
|
||||
- 12 sections requested -> 12 images
|
||||
- "landing page" with no count -> default to 6 sections -> 6 images
|
||||
- "full website template" -> default to 8 sections -> 8 images
|
||||
|
||||
Each image is one section, generated as its own image call. Never combine multiple sections into one frame. Never return a single tall image that contains the whole page.
|
||||
|
||||
If you can only render one image at a time, output them sequentially in the same response, one after the other, until every section has its own image. Announce each one ("Section 1 of 8: Hero", "Section 2 of 8: Trust bar", etc.).
|
||||
|
||||
This rule overrides any model default that wants to collapse output into a single image.
|
||||
|
||||
---
|
||||
|
||||
# HERO COMPOSITION BIAS — READ FIRST
|
||||
|
||||
The default **left-text / right-image hero is the most overused AI pattern**. It is allowed, but it should not be your first instinct.
|
||||
|
||||
Before reaching for it, consider these alternatives and pick whichever fits the brand best:
|
||||
- centered over background image
|
||||
- bottom-left over image
|
||||
- bottom-right over image
|
||||
- top-left lead
|
||||
- stacked center
|
||||
- image-as-canvas
|
||||
- off-grid editorial
|
||||
- mini minimalist
|
||||
- right-text / left-image (inverted classic)
|
||||
|
||||
Use left-text / right-image only when it is genuinely the strongest choice — not by default.
|
||||
|
||||
---
|
||||
|
||||
# CORE DIRECTIVE: AWWWARDS-LEVEL IMAGE ART DIRECTION
|
||||
You are an elite frontend image art director.
|
||||
|
||||
Your job is not to generate generic AI art.
|
||||
Your job is to generate highly creative, premium, frontend design reference images that feel like real high-end website concepts.
|
||||
|
||||
Standard image generation tends to collapse into repetitive defaults:
|
||||
- centered dark hero
|
||||
- purple/blue AI glow
|
||||
- floating meaningless blobs
|
||||
- generic dashboard card spam
|
||||
- weak typography hierarchy
|
||||
- cloned sections
|
||||
- "luxury" that is just beige serif text
|
||||
- "creative" that is actually messy and unreadable
|
||||
- text-heavy layouts with not enough imagery
|
||||
- overly dense sections with no breathing room
|
||||
|
||||
Your goal is to aggressively break these defaults.
|
||||
|
||||
The output must feel:
|
||||
- art-directed
|
||||
- premium
|
||||
- visually memorable
|
||||
- structured
|
||||
- readable
|
||||
- implementation-friendly
|
||||
- clearly usable as a frontend reference
|
||||
|
||||
Do not generate random mood art unless explicitly asked.
|
||||
Default to website design comps.
|
||||
|
||||
---
|
||||
|
||||
## 1. ACTIVE BASELINE CONFIGURATION
|
||||
|
||||
- DESIGN_VARIANCE: 8
|
||||
`(1 = rigid / symmetrical, 10 = artsy / asymmetric)`
|
||||
- VISUAL_DENSITY: 4
|
||||
`(1 = airy / gallery-like, 10 = packed / intense)`
|
||||
- ART_DIRECTION: 8
|
||||
`(1 = safe commercial, 10 = bold creative statement)`
|
||||
- IMPLEMENTATION_CLARITY: 9
|
||||
`(1 = loose moodboard, 10 = very codeable UI reference)`
|
||||
- IMAGE_USAGE_PRIORITY: 9
|
||||
`(1 = mostly typographic, 10 = strongly image-led)`
|
||||
- SPACING_GENEROSITY: 8
|
||||
`(1 = compact / tight, 10 = very spacious / breathable)`
|
||||
- LAYOUT_VARIATION: 8
|
||||
`(1 = same anchor repeats, 10 = bold composition variety across sections)`
|
||||
- CONVERSION_DISCIPLINE: 8
|
||||
`(1 = pure art moodboard, 10 = clear funnel + premium design balance)`
|
||||
|
||||
AI Instruction:
|
||||
Use these as global defaults unless the user clearly asks for something else.
|
||||
Do not ask the user to edit this file.
|
||||
Adapt these values dynamically from the prompt.
|
||||
|
||||
Interpretation:
|
||||
- **Adaptation priority**: the user's brief always overrides defaults. Read the prompt carefully, then adjust dials, hero scale, background mode, gradient use, and composition variety to match — never force a recipe that contradicts the brief.
|
||||
- If the user says "clean", reduce density and increase clarity.
|
||||
- If the user says "crazy creative", increase variance and art direction.
|
||||
- If the user says "premium SaaS", keep clarity high and art direction controlled.
|
||||
- If the user says "editorial", allow stronger type and more asymmetry.
|
||||
- Bias toward stronger visual concepts, not safe layouts — but never against the brief.
|
||||
- Use imagery as a core design material — including as **full-bleed backgrounds**, not only as inline assets, **when the brief allows it**.
|
||||
- Vary composition: do not default to "text left, image right". Move text to bottom-left, center, top-right, etc. across sections.
|
||||
- Keep sections breathable. Do not over-pack the page.
|
||||
- Prefer slightly more whitespace between sections than default.
|
||||
- Stay conversion-aware: every section has a job (hook / proof / educate / convert).
|
||||
|
||||
### Brief-to-direction mapping
|
||||
Read the brief. Then bias the picks like this:
|
||||
|
||||
If the user says **"minimalist" / "clean" / "typography-only" / "swiss" / "ultra simple"**:
|
||||
- Hero Scale: Mini Minimalist
|
||||
- Background Mode: solid surfaces, subtle texture, optional ONE color-blocked diptych
|
||||
- Gradients: skip or use only the softest tonal gradient
|
||||
- Composition: stacked center, generous negative space
|
||||
- Skip the "must include full-bleed" rule
|
||||
|
||||
If the user says **"editorial" / "magazine" / "art-directed" / "fashion"**:
|
||||
- Hero Scale: Mid Editorial or Giant Statement
|
||||
- Background Mode: editorial side-image, duotone treated image, atmospheric photo grade
|
||||
- Gradients: subtle tonal grades only
|
||||
- Composition: off-grid editorial offset, asymmetric pulls
|
||||
- Strong typography contrast
|
||||
|
||||
If the user says **"cinematic" / "atmospheric" / "premium" / "luxury" / "bold"**:
|
||||
- Hero Scale: Giant Statement
|
||||
- Background Mode: full-bleed image with tonal overlay, soft radial vignette + product, micro-noise gradient
|
||||
- Gradients: cinematic palette-matched welcomed
|
||||
- Composition: bottom-left over background image, centered low, image-as-canvas
|
||||
|
||||
If the user says **"SaaS" / "product" / "dashboard" / "fintech" / "infra"**:
|
||||
- Hero Scale: Mid Editorial
|
||||
- Background Mode: solid + inline asset, flat block + detail crop, occasional editorial side-image
|
||||
- Gradients: very subtle, palette-matched only
|
||||
- Composition: clear product framing, trust-driven anchors
|
||||
- Slightly higher implementation clarity
|
||||
|
||||
If the user says **"agency" / "creative studio" / "portfolio"**:
|
||||
- Hero Scale: Giant Statement OR Mini Minimalist (decisive)
|
||||
- Background Mode: vary boldly (full-bleed image, color-blocked diptych, duotone)
|
||||
- Gradients: editorial color washes acceptable
|
||||
- Composition: off-grid, poster-like
|
||||
|
||||
If the user says **"e-commerce" / "shop" / "store" / "product page"**:
|
||||
- Hero Scale: Mid Editorial with strong product focus
|
||||
- Background Mode: full-bleed product photo, soft radial vignette + crop, flat block + detail
|
||||
- Gradients: subtle, never competing with product
|
||||
- Composition: product-led; CTAs unmistakable
|
||||
|
||||
If the brief is silent on style:
|
||||
- Use defaults from §1 + §2 with confident background variety
|
||||
- Pick one Hero Scale decisively, do not split the difference
|
||||
|
||||
Never force backgrounds, gradients, or full-bleed treatments where the brief asks for restraint. Never strip them out where the brief asks for atmosphere.
|
||||
|
||||
---
|
||||
|
||||
## 2. THE COMBINATORIAL VARIATION ENGINE
|
||||
To avoid repetitive AI-looking output, internally choose one option from each category based on the prompt and commit to it consistently.
|
||||
|
||||
Do not mash everything together into chaos.
|
||||
Pick a strong combination and execute it clearly.
|
||||
|
||||
### Theme Paradigm
|
||||
Choose 1:
|
||||
1. Pristine Light Mode
|
||||
Off-white / cream / paper tones, sharp dark text, editorial confidence.
|
||||
2. Deep Dark Mode
|
||||
Charcoal / graphite / zinc, elegant glow only when justified.
|
||||
3. Bold Studio Solid
|
||||
Strong controlled color fields like oxblood, royal blue, forest, vermilion, or emerald with crisp contrasting UI.
|
||||
4. Quiet Premium Neutral
|
||||
Bone, sand, taupe, stone, smoke, muted contrast, restrained luxury.
|
||||
|
||||
### Background Character
|
||||
Choose 1:
|
||||
1. Subtle technical grid / dotted field
|
||||
2. Pure solid field with soft ambient gradient depth
|
||||
3. Full-bleed cinematic imagery with proper contrast control
|
||||
4. Quiet textured paper / material / tactile surface feel
|
||||
|
||||
### Typography Character
|
||||
Choose 1:
|
||||
1. Satoshi-like clean grotesk
|
||||
2. Neue-Montreal-like refined grotesk
|
||||
3. Cabinet / Clash-like expressive display
|
||||
4. Monument-like compressed statement typography
|
||||
5. Elegant editorial serif + sans pairing
|
||||
6. Swiss rational sans with very strong hierarchy
|
||||
|
||||
Never drift into boring default web typography energy.
|
||||
|
||||
### Hero Architecture
|
||||
Choose 1:
|
||||
1. Cinematic Centered Minimalist
|
||||
2. Asymmetric Split Hero
|
||||
3. Floating Polaroid Scatter
|
||||
4. Inline Typography Behemoth
|
||||
5. Editorial Offset Composition
|
||||
6. Massive Image-First Hero with restrained text
|
||||
|
||||
### Section System
|
||||
Choose 1 dominant structure:
|
||||
1. Strict modular bento rhythm
|
||||
2. Alternating editorial blocks
|
||||
3. Poster-like stacked storytelling
|
||||
4. Gallery-led visual cadence
|
||||
5. Swiss grid discipline
|
||||
6. Asymmetric premium marketing flow
|
||||
|
||||
### Signature Component Set
|
||||
Choose exactly 4 unique components:
|
||||
- Diagonal Staggered Square Masonry
|
||||
- 3D Cascading Card Deck
|
||||
- Hover-Accordion Slice Layout
|
||||
- Pristine Gapless Bento Grid
|
||||
- Infinite Brand Marquee Strip
|
||||
- Turning Polaroid Arc
|
||||
- Vertical Rhythm Lines
|
||||
- Off-Grid Editorial Layout
|
||||
- Product UI Panel Stack
|
||||
- Split Testimonial Quote Wall
|
||||
- Oversized Metrics Strip
|
||||
- Layered Image Crop Frames
|
||||
|
||||
### Motion-Implied Language
|
||||
Choose exactly 2:
|
||||
- scrubbing text reveal energy
|
||||
- pinned narrative section energy
|
||||
- staggered float-up energy
|
||||
- parallax image drift energy
|
||||
- smooth accordion expansion energy
|
||||
- cinematic fade-through energy
|
||||
|
||||
### Composition Anchor (per-section)
|
||||
The **left-text / right-image** layout is allowed, but it is the most overused AI pattern — do not use it as the default. Reach for it only when it is the genuinely best fit.
|
||||
|
||||
Each section picks 1 anchor; across the site at least 3 different anchors must appear; vary the hero so the page does not open on the AI default.
|
||||
- Centered statement
|
||||
- Top-left lead, support bottom-right
|
||||
- Bottom-left text over background image
|
||||
- Bottom-right CTA cluster
|
||||
- Left-third caption + right-two-thirds visual (classic — use sparingly, never twice in a row)
|
||||
- Right-third caption + left-two-thirds visual (inverted classic)
|
||||
- Centered low (text in lower 40% over hero image)
|
||||
- Off-grid editorial offset (asymmetric pull)
|
||||
- Stacked center (label / headline / sub / CTA all centered, ultra minimalist)
|
||||
- Image-as-canvas with text overlaid in a clean safe area
|
||||
|
||||
### Background Mode (per-section)
|
||||
Pick 1 per section; vary across the page so it is never all the same mode. Be **confident** with backgrounds — they are a primary tool, not a risk.
|
||||
- Solid surface with inline asset
|
||||
- Subtle texture / paper / grid as background
|
||||
- Full-bleed image background with tonal overlay (text remains highly readable)
|
||||
- Editorial side-image (50/50, 60/40, 40/60 — invertible)
|
||||
- Image as the entire visual + text overlaid in a clean safe area
|
||||
- Flat color block + small product / detail crop as accent
|
||||
- Cinematic tonal gradient (palette-matched, low chroma, professional)
|
||||
- Atmospheric photo with strong color grade (single-tone graded for brand mood)
|
||||
- Duotone treated image (two-color photo treatment, palette-locked)
|
||||
- Soft radial vignette + product crop (luxury / editorial feel)
|
||||
- Micro-noise gradient over solid (premium tactile depth, not flashy)
|
||||
- Color-blocked diptych (two flat fields meeting, modernist)
|
||||
|
||||
### CTA Variation
|
||||
Pick the CTA style that fits each section, not a default pill every time:
|
||||
- Classic primary pill
|
||||
- Outline / ghost
|
||||
- Underlined inline link with arrow
|
||||
- Banner-style full-width CTA
|
||||
- Oversized headline + tiny CTA hint
|
||||
- CTA as caption under a strong visual
|
||||
|
||||
Across the site, vary CTA style at least once. The page's primary action stays unmistakable.
|
||||
|
||||
### Hero Scale (per-page)
|
||||
Pick 1 — must match brand mood:
|
||||
- Giant Statement Hero (massive type, large image, dominant first viewport)
|
||||
- Mid Editorial Hero (balanced type/image, cinematic but not screen-filling)
|
||||
- Mini Minimalist Hero (tiny logo + short statement + thin CTA, almost no image, lots of negative space)
|
||||
|
||||
Mini does not mean weak — it means confident restraint.
|
||||
|
||||
### Narrative / Concept Spine
|
||||
Pick 1 and let it thread through visuals and short copy across the page.
|
||||
- Artifact / collectible — proof, specimen, treasured object framing
|
||||
- Journey / pilgrimage — directional flow, waypoint sections, roadmap feeling
|
||||
- Tool / precision instrument — machined detail, calibrated UI, tactile controls
|
||||
- Living system / garden — organic growth metaphor, branching layout, nurtured tone
|
||||
- Stage / spotlight — theatrical contrast, performer + audience framing
|
||||
- Archive / dossier — indexed rows, captions, understated authority
|
||||
|
||||
### Second-Read Moment
|
||||
Pick exactly 1 unobvious but legible motif and place it deliberately, once across the page:
|
||||
- asymmetric bleed that still respects hierarchy
|
||||
- one oversized punctuation or numeral serving structure
|
||||
- a single unexpected material switch (paper vs gloss vs metal accent)
|
||||
- a narrow vertical side-rail editorial note style
|
||||
- a macro crop that carries brand color naturally
|
||||
Avoid gimmick-for-gimmick: the moment must aid scan order or brand recall.
|
||||
|
||||
Important:
|
||||
These are not coding instructions.
|
||||
They are visual-direction cues the generated design should imply.
|
||||
|
||||
---
|
||||
|
||||
## 3. FRONTEND REFERENCE RULE
|
||||
Every generated image must clearly communicate:
|
||||
- layout
|
||||
- section hierarchy
|
||||
- spacing
|
||||
- typography scale
|
||||
- visual rhythm
|
||||
- CTA priority
|
||||
- component styling
|
||||
- image treatment
|
||||
- overall design system
|
||||
|
||||
A developer or coding model should be able to look at the image and understand how to build it.
|
||||
|
||||
Do not produce vague abstract artwork when the request is for frontend.
|
||||
|
||||
---
|
||||
|
||||
## 4. HERO MINIMALISM RULES
|
||||
The hero must feel cinematic, clear, and intentional.
|
||||
|
||||
### Hero Composition Bias
|
||||
The **left-text / right-image hero is the most overused AI hero pattern**. It is allowed, but it should not be your default starting point.
|
||||
|
||||
Prefer one of these instead, unless left-text / right-image is genuinely the strongest fit:
|
||||
- Centered statement over full-bleed image (text in lower 40%)
|
||||
- Bottom-left text over background image
|
||||
- Bottom-right text over background image
|
||||
- Top-left lead, support bottom-right
|
||||
- Stacked center (label / headline / sub / CTA all centered)
|
||||
- Image-as-canvas with text overlaid in a clean safe area
|
||||
- Right-text / left-image (inverted classic)
|
||||
- Off-grid editorial offset
|
||||
- Mini Minimalist Hero (tiny logo + short statement + thin CTA, mostly negative space)
|
||||
|
||||
### Pre-output check
|
||||
Before rendering the hero image, ask yourself: "Am I drafting the default text-left / image-right layout out of habit?" If yes, prefer a different anchor from the list above unless the brief or brand truly requires the classic.
|
||||
|
||||
### Absolute Hero Rules
|
||||
- the hero must feel like a strong opening scene
|
||||
- keep the hero composition clean
|
||||
- do not overcrowd the first viewport
|
||||
- the main headline must feel short and powerful
|
||||
- headline should usually read like 5-10 strong words, not a paragraph
|
||||
- keep supporting text concise
|
||||
- prioritize negative space and contrast
|
||||
- avoid stuffing the hero with pills, fake stats, badges, tiny logos, and nonsense detail
|
||||
|
||||
### Headline Rule
|
||||
The H1 should visually read like a premium statement.
|
||||
Do not let it feel long, weak, or overly wrapped.
|
||||
|
||||
### Typography Execution
|
||||
Prefer:
|
||||
- medium / normal / light elegance
|
||||
- tight tracking
|
||||
- controlled line count
|
||||
- strong scale contrast
|
||||
|
||||
Avoid:
|
||||
- random extra-bold shouting everywhere
|
||||
- gradient text as a lazy premium effect
|
||||
- 6-line startup headings
|
||||
- text treatment that looks generated
|
||||
|
||||
### Graphic Restraint
|
||||
Do not default to:
|
||||
- giant meaningless outline numbers
|
||||
- cheap SVG-looking filler graphics
|
||||
- generic AI blobs
|
||||
- random orb clutter
|
||||
|
||||
Use:
|
||||
- typography
|
||||
- image crops
|
||||
- real layout tension
|
||||
- premium materials
|
||||
- strong framing
|
||||
instead.
|
||||
|
||||
---
|
||||
|
||||
## 5. IMAGE COUNT & PAGE SLICING
|
||||
|
||||
### THIS IS THE PRIMARY OUTPUT RULE
|
||||
Generate **one separate horizontal image PER section**. Always.
|
||||
|
||||
- never combine multiple sections in a single image
|
||||
- never return a single tall slice that contains the whole page
|
||||
- never return one "best" image and skip the rest
|
||||
- never replace several sections with one collage
|
||||
|
||||
If the request is ambiguous about section count, **default high**:
|
||||
- "hero" -> 1 image
|
||||
- "landing page" / "site template" -> default to 6 sections -> 6 images
|
||||
- "full website" -> default to 8 sections -> 8 images
|
||||
- "marketing site" -> default to 8 sections -> 8 images
|
||||
- "product page" -> default to 6 sections -> 6 images
|
||||
- "portfolio" -> default to 6 sections -> 6 images
|
||||
|
||||
If the model can only render one image per call, generate them **sequentially in the same response**, one after the other, labeled "Section X of N: <name>" until the full set is delivered.
|
||||
|
||||
### Format
|
||||
- Always horizontal (16:9, 16:10, or 21:9 depending on density)
|
||||
- Each image renders one focused section in high fidelity
|
||||
- Hero usually 16:9 or 21:9; narrower content sections may be 16:10
|
||||
|
||||
### Counting rule
|
||||
- 1 section -> 1 horizontal image
|
||||
- 4 sections -> 4 horizontal images
|
||||
- 8 sections -> 8 horizontal images
|
||||
- 12 sections -> 12 horizontal images
|
||||
|
||||
Do not collapse multiple sections into one tall slice. Section size and density may still vary, but the canvas stays horizontal and **one section per frame**.
|
||||
|
||||
### Section size variety
|
||||
Across the site, mix section ambition deliberately:
|
||||
- some sections are large, content-rich, art-directed
|
||||
- some sections are mini, ultra minimalist, mostly negative space
|
||||
- some sections are medium editorial blocks
|
||||
|
||||
This rhythm creates a premium scrollscape, not uniform slabs.
|
||||
|
||||
### Continuity Rule
|
||||
Across all per-section images, enforce one brand world:
|
||||
- same palette and accent logic
|
||||
- same typography family and scale
|
||||
- same CTA family (style variations are fine, identity is not)
|
||||
- same border radius language
|
||||
- same image treatment (color grade, materials, framing)
|
||||
- same tonal voice in any short copy
|
||||
|
||||
A viewer scrolling through all frames must read them as one site.
|
||||
|
||||
---
|
||||
|
||||
## 6. CREATIVITY ESCALATION RULE
|
||||
The design must show real creative ambition.
|
||||
|
||||
Do not settle for the first obvious layout solution.
|
||||
Push the work beyond generic SaaS patterns.
|
||||
|
||||
Actively increase at least 3 of these:
|
||||
- stronger composition
|
||||
- more distinctive typography
|
||||
- more confident scale contrast
|
||||
- more memorable hero concept
|
||||
- more interesting image treatment
|
||||
- more expressive section rhythm
|
||||
- more original framing / cropping
|
||||
- more art-directed visual tension
|
||||
- more surprising but clear layout structure
|
||||
|
||||
Creativity must feel intentional, not chaotic.
|
||||
|
||||
Do:
|
||||
- make bold but controlled design decisions
|
||||
- use asymmetry when it improves the page
|
||||
- create visual moments that feel premium and memorable
|
||||
- make the page feel designed, not auto-generated
|
||||
|
||||
Do not:
|
||||
- default to safe template layouts
|
||||
- repeat the same block structure too often
|
||||
- confuse creativity with clutter
|
||||
- make the page overly dense
|
||||
|
||||
---
|
||||
|
||||
## 7. IMAGE-FIRST ART DIRECTION
|
||||
This skill must actively use images.
|
||||
|
||||
Images are not optional decoration.
|
||||
Images are a core part of the frontend design language.
|
||||
|
||||
Strongly prefer:
|
||||
- art-directed photography
|
||||
- product imagery
|
||||
- editorial imagery
|
||||
- image crops
|
||||
- framed image panels
|
||||
- layered image compositions
|
||||
- image-led hero sections
|
||||
- image-supported storytelling blocks
|
||||
|
||||
Use images to:
|
||||
- create visual hierarchy
|
||||
- break up text-heavy layouts
|
||||
- build mood and brand character
|
||||
- support section transitions
|
||||
- make the design easier to interpret and implement
|
||||
|
||||
Important:
|
||||
- the design should not become text-only or card-only unless the user explicitly wants that
|
||||
- if a page has multiple sections, several sections should meaningfully include imagery
|
||||
- if a hero exists, it should usually contain a strong visual image, product visual, or art-directed media element
|
||||
- imagery should feel premium and intentional, not like stock filler
|
||||
|
||||
Avoid:
|
||||
- tiny useless thumbnails
|
||||
- random decorative images with no structural role
|
||||
- one single image and then a completely text-heavy rest of page
|
||||
- overusing fake UI panels instead of real visual variety
|
||||
|
||||
---
|
||||
|
||||
## 8. ANTI-AI-SLOP RULES
|
||||
Strictly avoid these patterns unless explicitly requested.
|
||||
|
||||
### Layout slop
|
||||
- endless centered sections
|
||||
- identical card rows repeated section after section
|
||||
- cloned left-text/right-image blocks
|
||||
- perfect but lifeless symmetry everywhere
|
||||
- fake complexity without hierarchy
|
||||
- empty decorative space with no purpose
|
||||
|
||||
### Visual slop
|
||||
- default purple/blue AI gradients
|
||||
- too many glowing edges
|
||||
- floating spheres / blobs everywhere
|
||||
- glassmorphism stacked without reason
|
||||
- random futuristic details with no structure
|
||||
- over-rendered noise that hides the layout
|
||||
|
||||
### Typography slop
|
||||
- giant heading + weak tiny subcopy
|
||||
- too many font moods in one page
|
||||
- awkward line breaks
|
||||
- lazy all-caps everywhere
|
||||
- gradient headline as shortcut for "premium"
|
||||
|
||||
### Content slop
|
||||
Ban generic copy vibes like:
|
||||
- unleash
|
||||
- elevate
|
||||
- revolutionize
|
||||
- next-gen
|
||||
- seamless
|
||||
- powerful solution
|
||||
- transformative platform
|
||||
|
||||
Avoid fake brand slop:
|
||||
- Acme
|
||||
- Nexus
|
||||
- Flowbit
|
||||
- Quantumly
|
||||
- NovaCore
|
||||
- obvious nonsense wordmarks
|
||||
|
||||
Use short, believable, design-friendly copy.
|
||||
|
||||
### Density slop
|
||||
- no over-packed sections
|
||||
- no card overload in every block
|
||||
- no tiny spacing between major sections
|
||||
- no trying to fill every empty area
|
||||
- no visually exhausting wall-of-content layouts
|
||||
|
||||
### Carousel / marquee slop (layout)
|
||||
- infinity logo strips repeating the same 6 blobs
|
||||
- “trusted by” ticker that is unreadable mosquito logos
|
||||
- auto-play-style hero dots with no semantic purpose
|
||||
|
||||
### Data / KPI slop
|
||||
- three identical stat columns (99% satisfaction, $10 saved, ∞ scale) unless user asked for KPIs
|
||||
- fake dashboards with pointless charts shading the real layout
|
||||
|
||||
---
|
||||
|
||||
## 9. TYPOGRAPHY-FIRST DISCIPLINE
|
||||
Typography is not filler.
|
||||
Typography is a primary design material.
|
||||
|
||||
Always ensure:
|
||||
- clear size contrast
|
||||
- obvious reading order
|
||||
- strong display moments
|
||||
- supporting text that is readable and brief
|
||||
- labels, captions, and section headings that reinforce structure
|
||||
|
||||
For editorial directions:
|
||||
- let typography shape composition
|
||||
|
||||
For tech/product directions:
|
||||
- let typography communicate trust and precision
|
||||
|
||||
---
|
||||
|
||||
## 10. SECTION RHYTHM RULE
|
||||
A high-end site does not feel like repeated boxes.
|
||||
|
||||
Vary section rhythm across the page by changing:
|
||||
- density
|
||||
- image-to-text ratio
|
||||
- alignment
|
||||
- scale
|
||||
- whitespace
|
||||
- card grouping
|
||||
- background intensity
|
||||
- visual tempo
|
||||
|
||||
Do not let every section feel generated from the same template.
|
||||
|
||||
Important:
|
||||
- rhythm variation should not break overall cleanliness
|
||||
- keep the page visually balanced from top to bottom
|
||||
- section heights may vary, but the spacing between sections should feel controlled and fairly even
|
||||
- avoid abrupt jumps between very small and very large sections without enough breathing room
|
||||
- the full page should feel curated, smooth, and consistent
|
||||
|
||||
---
|
||||
|
||||
## 11. COMPONENT EXECUTION GUIDELINES
|
||||
|
||||
### Diagonal Staggered Square Masonry
|
||||
Use square image or content blocks with strong staggered vertical rhythm.
|
||||
Should feel curated and graphic, not messy.
|
||||
|
||||
### 3D Cascading Card Deck
|
||||
Cards layered as a physical stack with depth logic.
|
||||
Should feel premium and tactile, not gimmicky.
|
||||
|
||||
### Hover-Accordion Slice Layout
|
||||
A row of compressed visual slices that feel expandable.
|
||||
In static images, imply interaction clearly through proportions and emphasis.
|
||||
|
||||
### Pristine Gapless Bento Grid
|
||||
Mathematically clean grid.
|
||||
No accidental gaps.
|
||||
Mix large visual blocks with smaller dense information panels.
|
||||
|
||||
### Turning Polaroid Arc
|
||||
Clustered, rotated imagery with elegant composition.
|
||||
Should feel styled and intentional, not scrapbook-random.
|
||||
|
||||
### Off-Grid Editorial Layout
|
||||
Use asymmetry and tension with control.
|
||||
Must remain readable and clearly structured.
|
||||
|
||||
### Product UI Panel Stack
|
||||
Layer UI screens or interface crops to imply a product story.
|
||||
Avoid generic fake dashboards.
|
||||
|
||||
### Vertical Rhythm Lines
|
||||
Use fine lines and spacing systems to reinforce order and elegance.
|
||||
Never let them become decorative clutter.
|
||||
|
||||
---
|
||||
|
||||
## 12. DENSITY & SPACING DISCIPLINE
|
||||
Do not make everything too dense.
|
||||
|
||||
The page should breathe.
|
||||
Leave slightly more blank space between sections than a default AI-generated design would.
|
||||
|
||||
Rules:
|
||||
- use more even vertical spacing between major sections
|
||||
- keep section-to-section spacing consistent unless there is a strong design reason not to
|
||||
- avoid one section feeling very cramped while the next feels too empty
|
||||
- prefer a clean, balanced cadence across the page
|
||||
- allow negative space to create rhythm and emphasis
|
||||
- separate denser sections with calmer sections
|
||||
- avoid stacking too many cards, labels, and content blocks too tightly
|
||||
- smaller sections should still receive enough surrounding space so the page feels polished and intentional
|
||||
|
||||
A premium page should feel:
|
||||
- open
|
||||
- composed
|
||||
- balanced
|
||||
- confident
|
||||
- breathable
|
||||
|
||||
Not:
|
||||
- cramped
|
||||
- noisy
|
||||
- uneven
|
||||
- overfilled
|
||||
- visually exhausted
|
||||
|
||||
Section rhythm should alternate with control:
|
||||
- some sections can be more content-rich
|
||||
- some sections can be smaller and calmer
|
||||
- but the overall spacing cadence should still feel even, clean, and deliberate
|
||||
|
||||
Whitespace is a design tool.
|
||||
Use it deliberately.
|
||||
Do not let spacing become random.
|
||||
|
||||
---
|
||||
|
||||
## 13. COLOR & MATERIAL RULES
|
||||
|
||||
### Palette Discipline
|
||||
Use one controlled palette across the entire site:
|
||||
- 1 primary (brand anchor)
|
||||
- 1 secondary (supporting tone)
|
||||
- 1 accent (used sparingly for CTA / highlight)
|
||||
- a neutral scale (background, surface, text, hairline)
|
||||
|
||||
Section-level mood shifts must reuse the same palette — no full theme swap per section.
|
||||
|
||||
### Background-image harmony
|
||||
When using full-bleed image backgrounds:
|
||||
- the image must tonally match the palette (not fight it)
|
||||
- use overlays (dark, light, or color tint) to keep text fully readable
|
||||
- the brand accent stays consistent regardless of background image
|
||||
|
||||
### Gradient Discipline
|
||||
Gradients are **allowed and encouraged** when professional and subtle. They are not the same as AI slop gradients.
|
||||
|
||||
Allowed (use confidently):
|
||||
- low-chroma palette-matched tonal gradients (e.g. ink to graphite, cream to sand, ivory to warm grey)
|
||||
- single-hue atmospheric grades behind hero photography
|
||||
- soft vignettes and radial depth that direct the eye
|
||||
- noise-textured gradients adding tactile depth without color noise
|
||||
- editorial color washes that match brand mood
|
||||
|
||||
Banned (AI gradient slop):
|
||||
- rainbow / mesh blob gradients
|
||||
- purple-to-blue "AI" defaults
|
||||
- pink-to-orange "creator" defaults
|
||||
- neon edges and glow halos with no purpose
|
||||
- gradient text as a shortcut for "premium"
|
||||
- gradients that compete with imagery instead of supporting it
|
||||
|
||||
### Background Confidence Rule
|
||||
Do not retreat to plain white surfaces by default. When the brief, brand mood, or section job calls for atmosphere, use:
|
||||
- a full-bleed image,
|
||||
- a duotone or graded photo,
|
||||
- a tonal gradient,
|
||||
- a tactile material,
|
||||
or a confident flat color field — picked deliberately, not as decoration.
|
||||
|
||||
### Strong guidance
|
||||
- avoid rainbow randomness
|
||||
- avoid over-neon unless requested
|
||||
- keep contrast intentional
|
||||
- match accent colors to the chosen theme paradigm
|
||||
- gradients must always read as professional and intentional, never as visual noise
|
||||
|
||||
### Materiality
|
||||
Where appropriate, add:
|
||||
- paper feel
|
||||
- glass feel
|
||||
- brushed metal feel
|
||||
- soft blur depth
|
||||
- tactile matte surfaces
|
||||
- editorial photo treatment
|
||||
|
||||
But always keep the frontend structure readable.
|
||||
|
||||
---
|
||||
|
||||
## 14. IMAGE / MEDIA DIRECTION
|
||||
If imagery is present, it must support the layout.
|
||||
|
||||
Allowed:
|
||||
- art-directed product visuals
|
||||
- refined editorial photography
|
||||
- UI crops
|
||||
- abstract forms with structural purpose
|
||||
- framed objects
|
||||
- premium texture use
|
||||
- campaign-style visuals
|
||||
|
||||
Avoid:
|
||||
- irrelevant scenery
|
||||
- stock-photo cliches
|
||||
- decorative junk
|
||||
- visuals that overpower the page hierarchy
|
||||
|
||||
---
|
||||
|
||||
## 15. DEFAULT SITE PACKS
|
||||
|
||||
### 4-section pack
|
||||
1. Hero
|
||||
2. Features
|
||||
3. Social proof / testimonial
|
||||
4. CTA
|
||||
|
||||
### 8-section pack
|
||||
1. Hero
|
||||
2. Trust bar
|
||||
3. Features
|
||||
4. Product showcase
|
||||
5. Benefits / use cases
|
||||
6. Testimonials
|
||||
7. Pricing
|
||||
8. CTA
|
||||
|
||||
### 12-section pack
|
||||
1. Hero
|
||||
2. Trust bar
|
||||
3. Feature grid
|
||||
4. Product preview
|
||||
5. Problem / solution
|
||||
6. Benefits
|
||||
7. Workflow
|
||||
8. Metrics / proof / integration
|
||||
9. Testimonials
|
||||
10. Pricing
|
||||
11. FAQ
|
||||
12. CTA + footer
|
||||
|
||||
---
|
||||
|
||||
## 16. MULTI-IMAGE CONSISTENCY RULE
|
||||
Because every section is its own image, consistency is critical. Across all per-section frames enforce:
|
||||
- same brand world
|
||||
- same type scale logic
|
||||
- same spacing discipline
|
||||
- same CTA family (style variations are fine, identity is not)
|
||||
- same icon or illustration mood
|
||||
- same image treatment (grade, framing, material vocabulary)
|
||||
- same tonal language in any copy
|
||||
|
||||
Variation IS allowed in:
|
||||
- composition anchor (per section)
|
||||
- background mode (per section)
|
||||
- section size and density
|
||||
- which "second-read" moment appears
|
||||
|
||||
A viewer flipping through every per-section frame must still recognize one brand. Anything that breaks brand recall is over-variation.
|
||||
|
||||
---
|
||||
|
||||
## 17. CLARITY CHECK
|
||||
Before finalizing, verify internally:
|
||||
|
||||
1. Is the hierarchy obvious?
|
||||
2. Is the hero clean enough?
|
||||
3. Is the design visually distinctive?
|
||||
4. Is it free of obvious AI tells?
|
||||
5. Is it premium rather than template-like?
|
||||
6. Can someone code from this?
|
||||
7. If multiple images exist, do they clearly belong together?
|
||||
8. Is imagery used strongly enough (with variation, not one repeated crop)?
|
||||
9. Does the page breathe, or is it too dense?
|
||||
10. Is there enough spacing between sections?
|
||||
11. Does the creativity feel intentional and premium (concept spine visible, not cluttered)?
|
||||
12. Is the spacing between sections even and controlled?
|
||||
13. Do smaller sections still have enough surrounding space to feel clean?
|
||||
14. Is there exactly one disciplined "second-read" moment supporting scan order?
|
||||
15. Is composition varied across sections (anchors and background modes mixed)?
|
||||
16. Is the hero scale (giant / mid / mini) chosen and executed cleanly?
|
||||
17. Is there a clear conversion path (hook -> proof -> action) even in artistic sites?
|
||||
18. Is the palette consistent across all per-section images?
|
||||
19. Is each image horizontal and one-section-only?
|
||||
20. Is the **total number of images equal to the number of sections** (never fewer)?
|
||||
21. Is the hero using a varied composition (not defaulting to left-text / right-image out of habit)?
|
||||
|
||||
If not, refine internally before output. If the count is wrong, regenerate the missing sections. If the hero feels like a reflexive left-text / right-image default, prefer a different composition anchor.
|
||||
|
||||
---
|
||||
|
||||
## 18. EXTRA CREATIVITY & IMPLEMENTATION EDGE
|
||||
|
||||
Apply unless the user opts out:
|
||||
|
||||
### Cross-section contrast
|
||||
Across the slice, deliberately vary foreground/background intensity at least twice (lighter → richer → calmer) so the scroll feels paced, not monotonous slabs.
|
||||
|
||||
### CTA specificity
|
||||
Prefer one unmistakable primary action per major viewport tier; secondary actions must look secondary (scale, outline, ghost), not clones of primary.
|
||||
|
||||
### Image variety inside one comp
|
||||
Mix at least **two distinct image crops** where multiple sections exist — e.g. macro product + contextual environment, or portrait editorial + widescreen artifact — avoiding one repeated stock silhouette.
|
||||
|
||||
### Data-viz restraint
|
||||
Charts, sparklines, and graphs appear only when the site type logically needs them (analytics, pricing, infra, observability brands). Else keep proof human (quotes, receipts, timelines, screenshots of real workflows).
|
||||
|
||||
### Cultural / tonal alignment
|
||||
When the brief names an industry or region, steer palette and typographic temperament to match — don’t ship default “neutral SF startup” unless the brief is intentionally generic SaaS.
|
||||
|
||||
### Mobile-implied fidelity (even for desktop mocks)
|
||||
Maintain tap-friendly hit sizes and readable caption sizes visually; stacking order should imply a sane single-column narrative.
|
||||
|
||||
### Conversion focus
|
||||
Each section has a job. Even when the design is artistic, the page must read as a real product or brand site:
|
||||
- the hero communicates value in seconds and offers one obvious next action
|
||||
- proof sections (logos, quotes, metrics) feel earned, not stuffed
|
||||
- pricing or CTA sections feel decisive, not buried
|
||||
- the final section closes: a single strong CTA + supporting trust cue
|
||||
Avoid pure mood reels with no funnel logic.
|
||||
|
||||
### Composition variety check
|
||||
Across all per-section images, internally log the chosen composition anchor and background mode. Reject the set if:
|
||||
- the same composition anchor repeats more than 2 sections in a row
|
||||
- the same background mode repeats more than 3 sections in a row
|
||||
- every section is inline-asset (no full-bleed background ever appears) **AND** the brief does not call for minimalism / typography-only / swiss / ultra simple
|
||||
|
||||
For non-minimalist briefs: push for at least one full-bleed (or duotone / atmospheric) background and at least one mini minimalist section in any multi-section site.
|
||||
|
||||
For minimalist briefs: this rule is suspended. Restraint is the design.
|
||||
|
||||
---
|
||||
|
||||
## 19. RESPONSE BEHAVIOR
|
||||
When the user asks for a frontend design:
|
||||
1. infer site type and primary conversion goal
|
||||
2. infer number of sections (if unclear, use the defaults from §5: landing page = 6, full website = 8)
|
||||
3. **commit out loud** to the section count and announce it ("Generating N horizontal images, one per section")
|
||||
4. plan ONE horizontal image PER SECTION — always separate generations, never collapse
|
||||
5. choose Hero Scale for the whole site (giant / mid / mini)
|
||||
5. choose a strong visual combination (theme, type, hero arch, section system, motion, narrative spine, second-read moment)
|
||||
7. for each section: pick a Composition Anchor, Background Mode, and CTA Variation — vary across sections
|
||||
8. choose 4 signature components used appropriately across sections
|
||||
9. enforce hero minimalism + section size variety (some giant, some mini)
|
||||
10. enforce strong image usage including full-bleed backgrounds where it fits
|
||||
11. lock one consistent palette across all images
|
||||
12. apply §18 EXTRA CREATIVITY & IMPLEMENTATION EDGE
|
||||
13. keep spacing generous, even, and clean
|
||||
14. remove AI slop (including marquee / fake KPI clichés unless requested)
|
||||
15. run §17 CLARITY CHECK
|
||||
16. **generate every per-section horizontal image, labeled "Section X of N: <name>"**, until the full set is delivered. Do not stop early. Do not summarize. Do not return only one image.
|
||||
|
||||
Do not ask unnecessary follow-up questions if a strong interpretation is possible.
|
||||
|
||||
---
|
||||
|
||||
## 20. EXAMPLE INTERPRETATIONS
|
||||
|
||||
### Example 1
|
||||
User: "make a hero section for an AI startup"
|
||||
|
||||
Interpretation:
|
||||
- 1 horizontal image
|
||||
- Hero Scale: Mid Editorial or Giant Statement
|
||||
- Composition Anchor: bottom-left text over full-bleed product/atmosphere image
|
||||
- Background Mode: full-bleed image with dark tonal overlay
|
||||
- CTA Variation: outlined inline + small label hint
|
||||
- Palette: Deep Dark or Bold Studio Solid, one consistent accent
|
||||
- no cliche dashboard spam, no purple AI glow
|
||||
|
||||
### Example 2
|
||||
User: "design 8 sections for a fintech website"
|
||||
|
||||
Interpretation:
|
||||
- 8 separate horizontal images (one per section)
|
||||
- Hero Scale: Mid Editorial (trust-driven)
|
||||
- vary Composition Anchor across sections (centered low, right-third caption, bottom-left over chart visual, stacked center for closing CTA)
|
||||
- Background Mode mix: solid surface, full-bleed image background once, editorial side-image at use cases
|
||||
- one consistent palette (e.g. ink + paper + single brand accent)
|
||||
- conversion path: hook -> proof bar -> features -> use case -> testimonial -> pricing -> FAQ -> final CTA
|
||||
|
||||
### Example 3
|
||||
User: "creative agency landing page, 12 sections"
|
||||
|
||||
Interpretation:
|
||||
- 12 horizontal images (one per section)
|
||||
- Hero Scale: Giant Statement OR Mini Minimalist (decisive choice, not in-between)
|
||||
- editorial / poster-like direction; off-grid composition appears 2-3 times
|
||||
- multiple Background Modes (full-bleed image at hero + showcase, editorial side-image at case studies, solid + accent for process)
|
||||
- palette consistent throughout, with one bold accent recurring
|
||||
- closing CTA section: mini minimalist, strong type, single primary action
|
||||
|
||||
---
|
||||
|
||||
## 21. FINAL GOAL
|
||||
Generate frontend reference images that feel:
|
||||
- artistic
|
||||
- premium
|
||||
- clear
|
||||
- structured
|
||||
- image-led
|
||||
- breathable
|
||||
- memorable
|
||||
- anti-generic
|
||||
- implementation-friendly
|
||||
|
||||
The result should look like a top-tier website concept with strong imagery, confident creativity, and generous spacing - not a dense, repetitive AI layout.
|
||||
178
.agents/skills/redesign-existing-projects/SKILL.md
Normal file
178
.agents/skills/redesign-existing-projects/SKILL.md
Normal file
@@ -0,0 +1,178 @@
|
||||
---
|
||||
name: redesign-existing-projects
|
||||
description: Upgrades existing websites and apps to premium quality. Audits current design, identifies generic AI patterns, and applies high-end design standards without breaking functionality. Works with any CSS framework or vanilla CSS.
|
||||
---
|
||||
|
||||
# Redesign Skill
|
||||
|
||||
## How This Works
|
||||
|
||||
When applied to an existing project, follow this sequence:
|
||||
|
||||
1. **Scan** — Read the codebase. Identify the framework, styling method (Tailwind, vanilla CSS, styled-components, etc.), and current design patterns.
|
||||
2. **Diagnose** — Run through the audit below. List every generic pattern, weak point, and missing state you find.
|
||||
3. **Fix** — Apply targeted upgrades working with the existing stack. Do not rewrite from scratch. Improve what's there.
|
||||
|
||||
## Design Audit
|
||||
|
||||
### Typography
|
||||
|
||||
Check for these problems and fix them:
|
||||
|
||||
- **Browser default fonts or Inter everywhere.** Replace with a font that has character. Good options: `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`. For editorial/creative projects, pair a serif header with a sans-serif body.
|
||||
- **Headlines lack presence.** Increase size for display text, tighten letter-spacing, reduce line-height. Headlines should feel heavy and intentional.
|
||||
- **Body text too wide.** Limit paragraph width to roughly 65 characters. Increase line-height for readability.
|
||||
- **Only Regular (400) and Bold (700) weights used.** Introduce Medium (500) and SemiBold (600) for more subtle hierarchy.
|
||||
- **Numbers in proportional font.** Use a monospace font or enable tabular figures (`font-variant-numeric: tabular-nums`) for data-heavy interfaces.
|
||||
- **Missing letter-spacing adjustments.** Use negative tracking for large headers, positive tracking for small caps or labels.
|
||||
- **All-caps subheaders everywhere.** Try lowercase italics, sentence case, or small-caps instead.
|
||||
- **Orphaned words.** Single words sitting alone on the last line. Fix with `text-wrap: balance` or `text-wrap: pretty`.
|
||||
|
||||
### Color and Surfaces
|
||||
|
||||
- **Pure `#000000` background.** Replace with off-black, dark charcoal, or tinted dark (`#0a0a0a`, `#121212`, or a dark navy).
|
||||
- **Oversaturated accent colors.** Keep saturation below 80%. Desaturate accents so they blend with neutrals instead of screaming.
|
||||
- **More than one accent color.** Pick one. Remove the rest. Consistency beats variety.
|
||||
- **Mixing warm and cool grays.** Stick to one gray family. Tint all grays with a consistent hue (warm or cool, not both).
|
||||
- **Purple/blue "AI gradient" aesthetic.** This is the most common AI design fingerprint. Replace with neutral bases and a single, considered accent.
|
||||
- **Generic `box-shadow`.** Tint shadows to match the background hue. Use colored shadows (e.g., dark blue shadow on a blue background) instead of pure black at low opacity.
|
||||
- **Flat design with zero texture.** Add subtle noise, grain, or micro-patterns to backgrounds. Pure flat vectors feel sterile.
|
||||
- **Perfectly even gradients.** Break the uniformity with radial gradients, noise overlays, or mesh gradients instead of standard linear 45-degree fades.
|
||||
- **Inconsistent lighting direction.** Audit all shadows to ensure they suggest a single, consistent light source.
|
||||
- **Random dark sections in a light mode page (or vice versa).** A single dark-background section breaking an otherwise light page looks like a copy-paste accident. Either commit to a full dark mode or keep a consistent background tone throughout. If contrast is needed, use a slightly darker shade of the same palette — not a sudden jump to `#111` in the middle of a cream page.
|
||||
- **Empty, flat sections with no visual depth.** Sections that are just text on a plain background feel unfinished. Add high-quality background imagery (blurred, overlaid, or masked), subtle patterns, or ambient gradients. Use reliable placeholder sources like `https://picsum.photos/seed/{name}/1920/1080` when real assets are not available. Experiment with background images behind hero sections, feature blocks, or CTAs — even a subtle full-width photo at low opacity adds presence.
|
||||
|
||||
### Layout
|
||||
|
||||
- **Everything centered and symmetrical.** Break symmetry with offset margins, mixed aspect ratios, or left-aligned headers over centered content.
|
||||
- **Three equal card columns as feature row.** This is the most generic AI layout. Replace with a 2-column zig-zag, asymmetric grid, horizontal scroll, or masonry layout.
|
||||
- **Using `height: 100vh` for full-screen sections.** Replace with `min-height: 100dvh` to prevent layout jumping on mobile browsers (iOS Safari viewport bug).
|
||||
- **Complex flexbox percentage math.** Replace with CSS Grid for reliable multi-column structures.
|
||||
- **No max-width container.** Add a container constraint (around 1200-1440px) with auto margins so content doesn't stretch edge-to-edge on wide screens.
|
||||
- **Cards of equal height forced by flexbox.** Allow variable heights or use masonry when content varies in length.
|
||||
- **Uniform border-radius on everything.** Vary the radius: tighter on inner elements, softer on containers.
|
||||
- **No overlap or depth.** Elements sit flat next to each other. Use negative margins to create layering and visual depth.
|
||||
- **Symmetrical vertical padding.** Top and bottom padding are always identical. Adjust optically — bottom padding often needs to be slightly larger.
|
||||
- **Dashboard always has a left sidebar.** Try top navigation, a floating command menu, or a collapsible panel instead.
|
||||
- **Missing whitespace.** Double the spacing. Let the design breathe. Dense layouts work for data dashboards, not for marketing pages.
|
||||
- **Buttons not bottom-aligned in card groups.** When cards have different content lengths, CTAs end up at random heights. Pin buttons to the bottom of each card so they form a clean horizontal line regardless of content above.
|
||||
- **Feature lists starting at different vertical positions.** In pricing tables or comparison cards, the list of features should start at the same Y position across all columns. Use consistent spacing above the list or fixed-height title/price blocks.
|
||||
- **Inconsistent vertical rhythm in side-by-side elements.** When placing cards, columns, or panels next to each other, align shared elements (titles, descriptions, prices, buttons) across all items. Misaligned baselines make the layout look broken.
|
||||
- **Mathematical alignment that looks optically wrong.** Centering by the math doesn't always look centered to the eye. Icons next to text, play buttons in circles, or text in buttons often need 1-2px optical adjustments to feel right.
|
||||
|
||||
### Interactivity and States
|
||||
|
||||
- **No hover states on buttons.** Add background shift, slight scale, or translate on hover.
|
||||
- **No active/pressed feedback.** Add a subtle `scale(0.98)` or `translateY(1px)` on press to simulate a physical click.
|
||||
- **Instant transitions with zero duration.** Add smooth transitions (200-300ms) to all interactive elements.
|
||||
- **Missing focus ring.** Ensure visible focus indicators for keyboard navigation. This is an accessibility requirement, not optional.
|
||||
- **No loading states.** Replace generic circular spinners with skeleton loaders that match the layout shape.
|
||||
- **No empty states.** An empty dashboard showing nothing is a missed opportunity. Design a composed "getting started" view.
|
||||
- **No error states.** Add clear, inline error messages for forms. Do not use `window.alert()`.
|
||||
- **Dead links.** Buttons that link to `#`. Either link to real destinations or visually disable them.
|
||||
- **No indication of current page in navigation.** Style the active nav link differently so users know where they are.
|
||||
- **Scroll jumping.** Anchor clicks jump instantly. Add `scroll-behavior: smooth`.
|
||||
- **Animations using `top`, `left`, `width`, `height`.** Switch to `transform` and `opacity` for GPU-accelerated, smooth animation.
|
||||
|
||||
### Content
|
||||
|
||||
- **Generic names like "John Doe" or "Jane Smith".** Use diverse, realistic-sounding names.
|
||||
- **Fake round numbers like `99.99%`, `50%`, `$100.00`.** Use organic, messy data: `47.2%`, `$99.00`, `+1 (312) 847-1928`.
|
||||
- **Placeholder company names like "Acme Corp", "Nexus", "SmartFlow".** Invent contextual, believable brand names.
|
||||
- **AI copywriting cliches.** Never use "Elevate", "Seamless", "Unleash", "Next-Gen", "Game-changer", "Delve", "Tapestry", or "In the world of...". Write plain, specific language.
|
||||
- **Exclamation marks in success messages.** Remove them. Be confident, not loud.
|
||||
- **"Oops!" error messages.** Be direct: "Connection failed. Please try again."
|
||||
- **Passive voice.** Use active voice: "We couldn't save your changes" instead of "Mistakes were made."
|
||||
- **All blog post dates identical.** Randomize dates to appear real.
|
||||
- **Same avatar image for multiple users.** Use unique assets for every distinct person.
|
||||
- **Lorem Ipsum.** Never use placeholder latin text. Write real draft copy.
|
||||
- **Title Case On Every Header.** Use sentence case instead.
|
||||
|
||||
### Component Patterns
|
||||
|
||||
- **Generic card look (border + shadow + white background).** Remove the border, or use only background color, or use only spacing. Cards should exist only when elevation communicates hierarchy.
|
||||
- **Always one filled button + one ghost button.** Add text links or tertiary styles to reduce visual noise.
|
||||
- **Pill-shaped "New" and "Beta" badges.** Try square badges, flags, or plain text labels.
|
||||
- **Accordion FAQ sections.** Use a side-by-side list, searchable help, or inline progressive disclosure.
|
||||
- **3-card carousel testimonials with dots.** Replace with a masonry wall, embedded social posts, or a single rotating quote.
|
||||
- **Pricing table with 3 towers.** Highlight the recommended tier with color and emphasis, not just extra height.
|
||||
- **Modals for everything.** Use inline editing, slide-over panels, or expandable sections instead of popups for simple actions.
|
||||
- **Avatar circles exclusively.** Try squircles or rounded squares for a less generic look.
|
||||
- **Light/dark toggle always a sun/moon switch.** Use a dropdown, system preference detection, or integrate it into settings.
|
||||
- **Footer link farm with 4 columns.** Simplify. Focus on main navigational paths and legally required links.
|
||||
|
||||
### Iconography
|
||||
|
||||
- **Lucide or Feather icons exclusively.** These are the "default" AI icon choice. Use Phosphor, Heroicons, or a custom set for differentiation.
|
||||
- **Rocketship for "Launch", shield for "Security".** Replace cliche metaphors with less obvious icons (bolt, fingerprint, spark, vault).
|
||||
- **Inconsistent stroke widths across icons.** Audit all icons and standardize to one stroke weight.
|
||||
- **Missing favicon.** Always include a branded favicon.
|
||||
- **Stock "diverse team" photos.** Use real team photos, candid shots, or a consistent illustration style instead of uncanny stock imagery.
|
||||
|
||||
### Code Quality
|
||||
|
||||
- **Div soup.** Use semantic HTML: `<nav>`, `<main>`, `<article>`, `<aside>`, `<section>`.
|
||||
- **Inline styles mixed with CSS classes.** Move all styling to the project's styling system.
|
||||
- **Hardcoded pixel widths.** Use relative units (`%`, `rem`, `em`, `max-width`) for flexible layouts.
|
||||
- **Missing alt text on images.** Describe image content for screen readers. Never leave `alt=""` or `alt="image"` on meaningful images.
|
||||
- **Arbitrary z-index values like `9999`.** Establish a clean z-index scale in the theme/variables.
|
||||
- **Commented-out dead code.** Remove all debug artifacts before shipping.
|
||||
- **Import hallucinations.** Check that every import actually exists in `package.json` or the project dependencies.
|
||||
- **Missing meta tags.** Add proper `<title>`, `description`, `og:image`, and social sharing meta tags.
|
||||
|
||||
### Strategic Omissions (What AI Typically Forgets)
|
||||
|
||||
- **No legal links.** Add privacy policy and terms of service links in the footer.
|
||||
- **No "back" navigation.** Dead ends in user flows. Every page needs a way back.
|
||||
- **No custom 404 page.** Design a helpful, branded "page not found" experience.
|
||||
- **No form validation.** Add client-side validation for emails, required fields, and format checks.
|
||||
- **No "skip to content" link.** Essential for keyboard users. Add a hidden skip-link.
|
||||
- **No cookie consent.** If required by jurisdiction, add a compliant consent banner.
|
||||
|
||||
## Upgrade Techniques
|
||||
|
||||
When upgrading a project, pull from these high-impact techniques to replace generic patterns:
|
||||
|
||||
### Typography Upgrades
|
||||
- **Variable font animation.** Interpolate weight or width on scroll or hover for text that feels alive.
|
||||
- **Outlined-to-fill transitions.** Text starts as a stroke outline and fills with color on scroll entry or interaction.
|
||||
- **Text mask reveals.** Large typography acting as a window to video or animated imagery behind it.
|
||||
|
||||
### Layout Upgrades
|
||||
- **Broken grid / asymmetry.** Elements that deliberately ignore column structure — overlapping, bleeding off-screen, or offset with calculated randomness.
|
||||
- **Whitespace maximization.** Aggressive use of negative space to force focus on a single element.
|
||||
- **Parallax card stacks.** Sections that stick and physically stack over each other during scroll.
|
||||
- **Split-screen scroll.** Two halves of the screen sliding in opposite directions.
|
||||
|
||||
### Motion Upgrades
|
||||
- **Smooth scroll with inertia.** Decouple scrolling from browser defaults for a heavier, cinematic feel.
|
||||
- **Staggered entry.** Elements cascade in with slight delays, combining Y-axis translation with opacity fade. Never mount everything at once.
|
||||
- **Spring physics.** Replace linear easing with spring-based motion for a natural, weighty feel on all interactive elements.
|
||||
- **Scroll-driven reveals.** Content entering through expanding masks, wipes, or draw-on SVG paths tied to scroll progress.
|
||||
|
||||
### Surface Upgrades
|
||||
- **True glassmorphism.** Go beyond `backdrop-filter: blur`. Add a 1px inner border and a subtle inner shadow to simulate edge refraction.
|
||||
- **Spotlight borders.** Card borders that illuminate dynamically under the cursor.
|
||||
- **Grain and noise overlays.** A fixed, pointer-events-none overlay with subtle noise to break digital flatness.
|
||||
- **Colored, tinted shadows.** Shadows that carry the hue of the background rather than using generic black.
|
||||
|
||||
## Fix Priority
|
||||
|
||||
Apply changes in this order for maximum visual impact with minimum risk:
|
||||
|
||||
1. **Font swap** — biggest instant improvement, lowest risk
|
||||
2. **Color palette cleanup** — remove clashing or oversaturated colors
|
||||
3. **Hover and active states** — makes the interface feel alive
|
||||
4. **Layout and spacing** — proper grid, max-width, consistent padding
|
||||
5. **Replace generic components** — swap cliche patterns for modern alternatives
|
||||
6. **Add loading, empty, and error states** — makes it feel finished
|
||||
7. **Polish typography scale and spacing** — the premium final touch
|
||||
|
||||
## Rules
|
||||
|
||||
- Work with the existing tech stack. Do not migrate frameworks or styling libraries.
|
||||
- Do not break existing functionality. Test after every change.
|
||||
- Before importing any new library, check the project's dependency file first.
|
||||
- If the project uses Tailwind, check the version (v3 vs v4) before modifying config.
|
||||
- If the project has no framework, use vanilla CSS.
|
||||
- Keep changes reviewable and focused. Small, targeted improvements over big rewrites.
|
||||
35
skills-lock.json
Normal file
35
skills-lock.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"version": 1,
|
||||
"skills": {
|
||||
"design-taste-frontend": {
|
||||
"source": "leonxlnx/taste-skill",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/taste-skill/SKILL.md",
|
||||
"computedHash": "6d838b246d0e35d0b53f4f23f98ba7a1dd561937e64f7d0c7553b0928e376c3e"
|
||||
},
|
||||
"gpt-taste": {
|
||||
"source": "leonxlnx/taste-skill",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/gpt-tasteskill/SKILL.md",
|
||||
"computedHash": "cc8f0c601d8240a124e1d11634351a2be7b8a72fd807c75e5b6bf7afcd5ddee0"
|
||||
},
|
||||
"image-to-code": {
|
||||
"source": "leonxlnx/taste-skill",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/image-to-code-skill/SKILL.md",
|
||||
"computedHash": "58517b03b2a01f4c9ba65861559d03df931400871bbc200978c975b24bb92c73"
|
||||
},
|
||||
"imagegen-frontend-web": {
|
||||
"source": "leonxlnx/taste-skill",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/imagegen-frontend-web/SKILL.md",
|
||||
"computedHash": "65f5ae59fa317567809438310b1c54f78cd133426deb43e4d3d4ca4c8f541628"
|
||||
},
|
||||
"redesign-existing-projects": {
|
||||
"source": "leonxlnx/taste-skill",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/redesign-skill/SKILL.md",
|
||||
"computedHash": "b405eee0e0e80fc243f731d9aa368bca307e356db7e6157d27101d369dac6726"
|
||||
}
|
||||
}
|
||||
}
|
||||
82
test/all-iframes-1888.html
Normal file
82
test/all-iframes-1888.html
Normal file
@@ -0,0 +1,82 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>1XAUD All Iframes - merchant 1888</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
background: #0f1218;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.frame-wrap {
|
||||
position: relative;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto 28px;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
background: #151921;
|
||||
}
|
||||
|
||||
iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window._ = {
|
||||
getVar(name) {
|
||||
return name === "merchantId" ? "1888" : "";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="frame-wrap">
|
||||
<iframe id="partnershipIframe" src="https://1xaud.em7bd7.co/embed/partnership/partnership.asp" style="min-height:600px;"></iframe>
|
||||
</div>
|
||||
|
||||
<div class="frame-wrap">
|
||||
<iframe id="gameRtpIframe" src="https://1xaud.em7bd7.co/embed/game-rtp/game-rtp.asp" style="min-height:900px;"></iframe>
|
||||
</div>
|
||||
|
||||
<div class="frame-wrap">
|
||||
<iframe id="domainstatusIframe" src="https://1xaud.em7bd7.co/embed/domain-status/domain-status.asp" style="min-height:700px;"></iframe>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
const merchantId = (typeof _ !== "undefined" && typeof _.getVar === "function") ? (_.getVar("merchantId") ?? "") : "";
|
||||
if (!merchantId) {
|
||||
console.log("merchantId not found");
|
||||
return;
|
||||
}
|
||||
|
||||
function init(id, heightMessageType, extraHeight) {
|
||||
const iframe = document.getElementById(id);
|
||||
if (!iframe) {
|
||||
console.log(id + " not found");
|
||||
return;
|
||||
}
|
||||
iframe.addEventListener("load", function() {
|
||||
iframe.contentWindow.postMessage({ type: "setIframeData", clientMerchant: merchantId }, "*");
|
||||
});
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data && event.data.type === heightMessageType) {
|
||||
iframe.style.height = event.data.height + extraHeight + "px";
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
init("partnershipIframe", "setPartnershipIframeHeight", 0);
|
||||
init("gameRtpIframe", "setGameRtpIframeHeight", 50);
|
||||
init("domainstatusIframe", "setDomainStatusIframeHeight", 0);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
41
test/domain-status-1888.html
Normal file
41
test/domain-status-1888.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>1XAUD Domain Status - merchant 1888</title>
|
||||
<script>
|
||||
window._ = {
|
||||
getVar(name) {
|
||||
return name === "merchantId" ? "1888" : "";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0;background:#0f1218;">
|
||||
<div style="position: relative;max-width: 1000px;margin: 0 auto;overflow: hidden;border: none;">
|
||||
<iframe id="domainstatusIframe" src="https://1xaud.em7bd7.co/embed/domain-status/domain-status.asp" style="width: 100%;overflow: hidden;border: none;min-height:700px;"></iframe>
|
||||
<script>
|
||||
(() => {
|
||||
const merchantId = (typeof _ !== "undefined" && typeof _.getVar === "function") ? (_.getVar("merchantId") ?? "") : "";
|
||||
if (!merchantId) {
|
||||
console.log("merchantId not found");
|
||||
return;
|
||||
}
|
||||
function init(iframe) {
|
||||
iframe.addEventListener("load", function() {
|
||||
iframe.contentWindow.postMessage({ type: "setIframeData", clientMerchant: merchantId }, "*");
|
||||
});
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data && event.data.type === "setDomainStatusIframeHeight") {
|
||||
iframe.style.height = event.data.height + "px";
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
var el = document.getElementById("domainstatusIframe");
|
||||
if (el) { init(el); return; }
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
41
test/game-rtp-1888.html
Normal file
41
test/game-rtp-1888.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>1XAUD Game RTP - merchant 1888</title>
|
||||
<script>
|
||||
window._ = {
|
||||
getVar(name) {
|
||||
return name === "merchantId" ? "1888" : "";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0;background:#0f1218;">
|
||||
<div style="position: relative;max-width: 1000px;margin: 0 auto;overflow: hidden;border: none;">
|
||||
<iframe id="gameRtpIframe" src="https://1xaud.em7bd7.co/embed/game-rtp/game-rtp.asp" style="width: 100%;overflow: hidden;border: none;min-height:900px;"></iframe>
|
||||
<script>
|
||||
(() => {
|
||||
const merchantId = (typeof _ !== "undefined" && typeof _.getVar === "function") ? (_.getVar("merchantId") ?? "") : "";
|
||||
if (!merchantId) {
|
||||
console.log("merchantId not found");
|
||||
return;
|
||||
}
|
||||
function init(iframe) {
|
||||
iframe.addEventListener("load", function() {
|
||||
iframe.contentWindow.postMessage({ type: "setIframeData", clientMerchant: merchantId }, "*");
|
||||
});
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data && event.data.type === "setGameRtpIframeHeight") {
|
||||
iframe.style.height = event.data.height + 50 + "px";
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
var el = document.getElementById("gameRtpIframe");
|
||||
if (el) { init(el); return; }
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
41
test/partnership-1888.html
Normal file
41
test/partnership-1888.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>1XAUD Partnership - merchant 1888</title>
|
||||
<script>
|
||||
window._ = {
|
||||
getVar(name) {
|
||||
return name === "merchantId" ? "1888" : "";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body style="margin:0;background:#0f1218;">
|
||||
<div style="position: relative;max-width: 1000px;margin: 0 auto;overflow: hidden;border: none;">
|
||||
<iframe id="partnershipIframe" src="https://1xaud.em7bd7.co/embed/partnership/partnership.asp" style="width: 100%;overflow: hidden;border: none;min-height:600px;"></iframe>
|
||||
<script>
|
||||
(() => {
|
||||
const merchantId = (typeof _ !== "undefined" && typeof _.getVar === "function") ? (_.getVar("merchantId") ?? "") : "";
|
||||
if (!merchantId) {
|
||||
console.log("merchantId not found");
|
||||
return;
|
||||
}
|
||||
function init(iframe) {
|
||||
iframe.addEventListener("load", function() {
|
||||
iframe.contentWindow.postMessage({ type: "setIframeData", clientMerchant: merchantId }, "*");
|
||||
});
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data && event.data.type === "setPartnershipIframeHeight") {
|
||||
iframe.style.height = event.data.height + "px";
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
var el = document.getElementById("partnershipIframe");
|
||||
if (el) { init(el); return; }
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
223
test/proxy_server.py
Normal file
223
test/proxy_server.py
Normal file
@@ -0,0 +1,223 @@
|
||||
#!/usr/bin/env python3
|
||||
from http import HTTPStatus
|
||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
from urllib.error import HTTPError, URLError
|
||||
from urllib.parse import urlsplit
|
||||
from urllib.request import HTTPCookieProcessor, Request, build_opener
|
||||
import html
|
||||
|
||||
|
||||
REMOTE_ORIGIN = "https://1xaud.em7bd7.co"
|
||||
|
||||
opener = build_opener(HTTPCookieProcessor())
|
||||
|
||||
|
||||
MODULE_CONFIGS = {
|
||||
"partnership": [
|
||||
("partnershipIframe", "/embed/partnership/partnership.asp", "setPartnershipIframeHeight", 0, 600),
|
||||
],
|
||||
"game-rtp": [
|
||||
("gameRtpIframe", "/embed/game-rtp/game-rtp.asp", "setGameRtpIframeHeight", 50, 900),
|
||||
],
|
||||
"domain-status": [
|
||||
("domainstatusIframe", "/embed/domain-status/domain-status.asp", "setDomainStatusIframeHeight", 0, 700),
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
WRAPPER_TEMPLATE = """<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>__TITLE__</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
background: #0f1218;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.frame-wrap {
|
||||
position: relative;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto 28px;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
background: #151921;
|
||||
}
|
||||
|
||||
.frame-wrap iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window._ = {
|
||||
getVar(name) {
|
||||
return name === "merchantId" ? "1888" : "";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
__IFRAMES__
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
const merchantId = (typeof _ !== "undefined" && typeof _.getVar === "function") ? (_.getVar("merchantId") ?? "") : "";
|
||||
if (!merchantId) {
|
||||
console.log("merchantId not found");
|
||||
return;
|
||||
}
|
||||
|
||||
function init(id, heightMessageType, extraHeight) {
|
||||
const iframe = document.getElementById(id);
|
||||
if (!iframe) {
|
||||
console.log(id + " not found");
|
||||
return;
|
||||
}
|
||||
iframe.addEventListener("load", function() {
|
||||
iframe.contentWindow.postMessage({ type: "setIframeData", clientMerchant: merchantId }, "*");
|
||||
});
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data && event.data.type === heightMessageType) {
|
||||
iframe.style.height = event.data.height + extraHeight + "px";
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
__INIT_CALLS__
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
|
||||
def build_wrapper(selected):
|
||||
modules = []
|
||||
for key in selected:
|
||||
modules.extend(MODULE_CONFIGS[key])
|
||||
|
||||
iframe_html = "\n".join(
|
||||
f' <div class="frame-wrap">\n'
|
||||
f' <iframe id="{iframe_id}" src="{src}" style="min-height: {min_height}px"></iframe>\n'
|
||||
f' </div>'
|
||||
for iframe_id, src, _message_type, _extra_height, min_height in modules
|
||||
)
|
||||
init_calls = "\n".join(
|
||||
f' init("{iframe_id}", "{message_type}", {extra_height});'
|
||||
for iframe_id, _src, message_type, extra_height, _min_height in modules
|
||||
)
|
||||
title = "1XAUD proxied iframe render"
|
||||
return (
|
||||
WRAPPER_TEMPLATE
|
||||
.replace("__TITLE__", title)
|
||||
.replace("__IFRAMES__", iframe_html)
|
||||
.replace("__INIT_CALLS__", init_calls)
|
||||
)
|
||||
|
||||
|
||||
class ProxyHandler(BaseHTTPRequestHandler):
|
||||
protocol_version = "HTTP/1.1"
|
||||
|
||||
def do_GET(self):
|
||||
path = urlsplit(self.path).path
|
||||
if path in {"/", "/render-1888-proxy.html", "/render-1888-all.html"}:
|
||||
body = build_wrapper(["partnership", "game-rtp", "domain-status"]).encode("utf-8")
|
||||
self.send_bytes(body, "text/html; charset=utf-8")
|
||||
return
|
||||
if path == "/render-1888-partnership.html":
|
||||
body = build_wrapper(["partnership"]).encode("utf-8")
|
||||
self.send_bytes(body, "text/html; charset=utf-8")
|
||||
return
|
||||
if path == "/render-1888-game-rtp.html":
|
||||
body = build_wrapper(["game-rtp"]).encode("utf-8")
|
||||
self.send_bytes(body, "text/html; charset=utf-8")
|
||||
return
|
||||
if path == "/render-1888-domain-status.html":
|
||||
body = build_wrapper(["domain-status"]).encode("utf-8")
|
||||
self.send_bytes(body, "text/html; charset=utf-8")
|
||||
return
|
||||
self.proxy()
|
||||
|
||||
def do_POST(self):
|
||||
self.proxy()
|
||||
|
||||
def send_bytes(self, body, content_type, status=HTTPStatus.OK):
|
||||
self.send_response(status)
|
||||
self.send_header("Content-Type", content_type)
|
||||
self.send_header("Content-Length", str(len(body)))
|
||||
self.send_header("Cache-Control", "no-store")
|
||||
self.end_headers()
|
||||
self.wfile.write(body)
|
||||
|
||||
def proxy(self):
|
||||
parsed = urlsplit(self.path)
|
||||
target = REMOTE_ORIGIN + parsed.path
|
||||
if parsed.query:
|
||||
target += "?" + parsed.query
|
||||
|
||||
body = None
|
||||
if self.command == "POST":
|
||||
length = int(self.headers.get("Content-Length", "0") or 0)
|
||||
body = self.rfile.read(length) if length else b""
|
||||
|
||||
headers = {
|
||||
"User-Agent": self.headers.get(
|
||||
"User-Agent",
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0 Safari/537.36",
|
||||
),
|
||||
"Referer": REMOTE_ORIGIN + "/embed/partnership/partnership.asp",
|
||||
"Origin": REMOTE_ORIGIN,
|
||||
}
|
||||
if "Content-Type" in self.headers:
|
||||
headers["Content-Type"] = self.headers["Content-Type"]
|
||||
|
||||
request = Request(target, data=body, headers=headers, method=self.command)
|
||||
try:
|
||||
with opener.open(request, timeout=30) as response:
|
||||
response_body = response.read()
|
||||
self.send_response(response.status)
|
||||
for key, value in response.headers.items():
|
||||
lower = key.lower()
|
||||
if lower in {
|
||||
"content-length",
|
||||
"connection",
|
||||
"transfer-encoding",
|
||||
"content-encoding",
|
||||
"x-frame-options",
|
||||
"content-security-policy",
|
||||
"report-to",
|
||||
"nel",
|
||||
"alt-svc",
|
||||
}:
|
||||
continue
|
||||
self.send_header(key, value)
|
||||
self.send_header("Content-Length", str(len(response_body)))
|
||||
self.send_header("Cache-Control", "no-store")
|
||||
self.end_headers()
|
||||
self.wfile.write(response_body)
|
||||
except HTTPError as exc:
|
||||
response_body = exc.read()
|
||||
self.send_response(exc.code)
|
||||
self.send_header("Content-Type", exc.headers.get("Content-Type", "text/plain"))
|
||||
self.send_header("Content-Length", str(len(response_body)))
|
||||
self.end_headers()
|
||||
self.wfile.write(response_body)
|
||||
except URLError as exc:
|
||||
body = f"Proxy error: {html.escape(str(exc.reason))}".encode("utf-8")
|
||||
self.send_bytes(body, "text/plain; charset=utf-8", HTTPStatus.BAD_GATEWAY)
|
||||
|
||||
def log_message(self, format, *args):
|
||||
print("%s - - [%s] %s" % (self.client_address[0], self.log_date_time_string(), format % args))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
server = ThreadingHTTPServer(("localhost", 8898), ProxyHandler)
|
||||
print("Proxy server listening on http://localhost:8898/render-1888-proxy.html")
|
||||
server.serve_forever()
|
||||
79
test/render-1888.html
Normal file
79
test/render-1888.html
Normal file
@@ -0,0 +1,79 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>1XAUD Partnership iframe render</title>
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
background: #0f1218;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.frame-wrap {
|
||||
position: relative;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
background: #151921;
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
iframe {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-height: 600px;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window._ = {
|
||||
getVar(name) {
|
||||
return name === "merchantId" ? "1888" : "";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="frame-wrap">
|
||||
<iframe id="partnershipIframe" src="https://1xaud.em7bd7.co/embed/partnership/partnership.asp"></iframe>
|
||||
<script>
|
||||
(() => {
|
||||
const merchantId = (typeof _ !== "undefined" && typeof _.getVar === "function") ? (_.getVar("merchantId") ?? "") : "";
|
||||
if (!merchantId) {
|
||||
console.log("merchantId not found");
|
||||
return;
|
||||
}
|
||||
function init(iframe) {
|
||||
iframe.addEventListener("load", function() {
|
||||
iframe.contentWindow.postMessage({ type: "setIframeData", clientMerchant: merchantId }, "*");
|
||||
});
|
||||
window.addEventListener("message", function(event) {
|
||||
if (event.data && event.data.type === "setPartnershipIframeHeight") {
|
||||
iframe.style.height = event.data.height + "px";
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
var el = document.getElementById("partnershipIframe");
|
||||
if (el) { init(el); return; }
|
||||
var attempts = 0;
|
||||
var timer = setInterval(function() {
|
||||
attempts++;
|
||||
var el = document.getElementById("partnershipIframe");
|
||||
if (el) {
|
||||
clearInterval(timer);
|
||||
init(el);
|
||||
} else if (attempts >= 5) {
|
||||
clearInterval(timer);
|
||||
alert("iframe not found");
|
||||
}
|
||||
}, 1000);
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -256,35 +256,41 @@ const getPlaceholder = (placeholder: string | string[] | undefined, key = 0, def
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
background-color: var(--ba-bg-color-overlay);
|
||||
border: 1px solid var(--ba-border-color);
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-bottom: none;
|
||||
padding: 13px 15px;
|
||||
padding: 16px;
|
||||
font-size: 14px;
|
||||
border-radius: var(--ba-radius-panel) var(--ba-radius-panel) 0 0;
|
||||
.com-search-col {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 40px;
|
||||
padding-top: 8px;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 13px;
|
||||
}
|
||||
.com-search-col-label {
|
||||
width: 33.33%;
|
||||
padding: 0 15px;
|
||||
padding: 0 12px;
|
||||
text-align: right;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
.com-search-col-input {
|
||||
padding: 0 15px;
|
||||
padding: 0 12px;
|
||||
width: 66.66%;
|
||||
}
|
||||
.com-search-col-input-range {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 15px;
|
||||
padding: 0 12px;
|
||||
width: 66.66%;
|
||||
.range-separator {
|
||||
padding: 0 5px;
|
||||
padding: 0 8px;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,4 +303,28 @@ const getPlaceholder = (placeholder: string | string[] | undefined, key = 0, def
|
||||
.w83 {
|
||||
width: 83.5% !important;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.table-com-search {
|
||||
padding: 12px;
|
||||
.com-search-col {
|
||||
display: block;
|
||||
}
|
||||
.com-search-col-label,
|
||||
.com-search-col-input,
|
||||
.com-search-col-input-range,
|
||||
.w16,
|
||||
.w83 {
|
||||
width: 100% !important;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
}
|
||||
.com-search-col-label {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
}
|
||||
.pl-20 {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -176,42 +176,51 @@ const onChangeShowColumn = (value: string | number | boolean, field: string) =>
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
background-color: var(--ba-bg-color-overlay);
|
||||
border: 1px solid var(--ba-border-color);
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-bottom: none;
|
||||
padding: 13px 15px;
|
||||
padding: 14px 16px;
|
||||
font-size: 14px;
|
||||
border-radius: var(--ba-radius-panel) var(--ba-radius-panel) 0 0;
|
||||
.table-header-operate-text {
|
||||
margin-left: 6px;
|
||||
}
|
||||
:deep(.el-button) {
|
||||
min-height: 32px;
|
||||
}
|
||||
}
|
||||
.btns-ml-12 + .btns-ml-12 {
|
||||
margin-left: 12px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.table-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-left: auto;
|
||||
.quick-search {
|
||||
width: auto;
|
||||
width: 240px;
|
||||
}
|
||||
}
|
||||
.table-search-button-group {
|
||||
display: flex;
|
||||
margin-left: 12px;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: var(--el-border-radius-base);
|
||||
margin-left: 0;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-control);
|
||||
overflow: hidden;
|
||||
background: var(--ba-bg-color-soft);
|
||||
button:focus,
|
||||
button:active {
|
||||
background-color: var(--ba-bg-color-overlay);
|
||||
}
|
||||
button:hover {
|
||||
background-color: var(--el-color-info-light-7);
|
||||
background-color: var(--el-color-primary-light-9);
|
||||
}
|
||||
.table-search-button-item {
|
||||
height: 30px;
|
||||
height: 32px;
|
||||
width: 34px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
@@ -219,7 +228,7 @@ const onChangeShowColumn = (value: string | number | boolean, field: string) =>
|
||||
margin: 0;
|
||||
}
|
||||
.right-border {
|
||||
border-right: 1px solid var(--el-border-color);
|
||||
border-right: 1px solid var(--ba-border-color-soft);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,4 +249,19 @@ html.dark {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.table-header {
|
||||
flex-wrap: wrap;
|
||||
align-items: stretch;
|
||||
padding: 12px;
|
||||
}
|
||||
.table-search {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
.quick-search {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -230,17 +230,42 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.ba-data-table {
|
||||
border-radius: 0 0 var(--ba-radius-panel) var(--ba-radius-panel);
|
||||
overflow: hidden;
|
||||
}
|
||||
.ba-data-table :deep(.table-header-cell) .cell {
|
||||
color: var(--el-text-color-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-weight: 700;
|
||||
}
|
||||
.ba-data-table :deep(.cell) {
|
||||
line-height: 1.45;
|
||||
}
|
||||
.ba-data-table :deep(.el-table__empty-text) {
|
||||
padding: 18px 0;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
.table-pagination {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
background-color: var(--ba-bg-color-overlay);
|
||||
padding: 13px 15px;
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-top: none;
|
||||
border-radius: 0 0 var(--ba-radius-panel) var(--ba-radius-panel);
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 768px) {
|
||||
.table-pagination {
|
||||
justify-content: center;
|
||||
padding: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -41,6 +41,9 @@ export default {
|
||||
'Current Balance': 'Current Balance',
|
||||
'Transaction Breakdown': 'Transaction Breakdown',
|
||||
'Safe Alert': 'Safe Alert',
|
||||
'Fast Calculation': 'Fast Calculation',
|
||||
'Calculation placeholder': 'e.g. +10+50-20',
|
||||
'Fast Calculation Support': 'Fast Calculation Support',
|
||||
Transfer: 'Transfer',
|
||||
'No Alert': 'No Alert',
|
||||
'No bank data': 'No bank data',
|
||||
|
||||
@@ -41,6 +41,9 @@ export default {
|
||||
'Current Balance': '当前余额',
|
||||
'Transaction Breakdown': '交易明细',
|
||||
'Safe Alert': '安全提醒',
|
||||
'Fast Calculation': '快速计算',
|
||||
'Calculation placeholder': 'e.g. +10+50-20',
|
||||
'Fast Calculation Support': 'Fast Calculation Support',
|
||||
Transfer: '转账',
|
||||
'No Alert': '无提醒',
|
||||
'No bank data': '暂无银行数据',
|
||||
|
||||
@@ -28,12 +28,15 @@ const menuWidth = computed(() => config.menuWidth())
|
||||
<style scoped lang="scss">
|
||||
.layout-aside-Default:not(.shrink) {
|
||||
background: var(--ba-bg-color-overlay);
|
||||
margin: 16px 0 16px 16px;
|
||||
height: calc(100% - 32px);
|
||||
box-shadow: var(--el-box-shadow-light);
|
||||
border-radius: var(--el-border-radius-base);
|
||||
margin: var(--ba-main-space) 0 var(--ba-main-space) var(--ba-main-space);
|
||||
height: calc(100% - (var(--ba-main-space) * 2));
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
overflow: hidden;
|
||||
transition: width 0.3s ease;
|
||||
transition:
|
||||
width 0.26s ease,
|
||||
box-shadow 0.26s ease;
|
||||
width: v-bind(menuWidth);
|
||||
}
|
||||
.layout-aside-Default.shrink,
|
||||
@@ -43,7 +46,8 @@ const menuWidth = computed(() => config.menuWidth())
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
transition: width 0.3s ease;
|
||||
border-right: 1px solid var(--ba-border-color-soft);
|
||||
transition: width 0.26s ease;
|
||||
width: v-bind(menuWidth);
|
||||
}
|
||||
.shrink {
|
||||
|
||||
@@ -49,29 +49,47 @@ const onMenuCollapse = function () {
|
||||
<style scoped lang="scss">
|
||||
.layout-logo {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
height: 56px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
padding: 10px 12px;
|
||||
background: v-bind('config.layout.layoutMode != "Streamline" ? config.getColorVal("menuTopBarBackground"):"transparent"');
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
}
|
||||
.logo-img {
|
||||
width: 28px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
object-fit: contain;
|
||||
}
|
||||
.website-name {
|
||||
display: block;
|
||||
width: 180px;
|
||||
padding-left: 4px;
|
||||
font-size: var(--el-font-size-extra-large);
|
||||
font-weight: 600;
|
||||
padding-left: 8px;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.fold {
|
||||
margin-left: auto;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: var(--ba-radius-control);
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
transform 0.2s ease;
|
||||
&:hover {
|
||||
background: var(--el-color-primary-light-9);
|
||||
transform: translateX(-1px);
|
||||
}
|
||||
}
|
||||
.unfold {
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -53,11 +53,11 @@ const menuTitle = (menu: RouteRecordRaw) => {
|
||||
|
||||
const reportMenuPaths: Record<string, string> = {
|
||||
'Annual Report': '/user/moneyLog/annualReport',
|
||||
'年度报表': '/user/moneyLog/annualReport',
|
||||
年度报表: '/user/moneyLog/annualReport',
|
||||
'Daily Report': '/user/moneyLog/dailyReport',
|
||||
'日报表': '/user/moneyLog/dailyReport',
|
||||
日报表: '/user/moneyLog/dailyReport',
|
||||
'Customer Report': '/user/moneyLog/customerReport',
|
||||
'客户报表': '/user/moneyLog/customerReport',
|
||||
客户报表: '/user/moneyLog/customerReport',
|
||||
}
|
||||
|
||||
const onClickMenuItem = (menu: RouteRecordRaw) => {
|
||||
@@ -96,8 +96,8 @@ const onClickSubMenu = (menu: RouteRecordRaw) => {
|
||||
.el-sub-menu .icon,
|
||||
.el-menu-item .icon {
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
width: 24px;
|
||||
margin-right: 8px;
|
||||
width: 22px;
|
||||
text-align: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -106,5 +106,6 @@ const onClickSubMenu = (menu: RouteRecordRaw) => {
|
||||
}
|
||||
.el-menu-item.is-active {
|
||||
background-color: v-bind('config.getColorVal("menuActiveBackground")');
|
||||
box-shadow: inset 3px 0 0 v-bind('config.getColorVal("menuActiveColor")');
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -71,6 +71,7 @@ onBeforeRouteUpdate((to) => {
|
||||
.vertical-menus-scrollbar {
|
||||
height: v-bind(verticalMenusScrollbarHeight);
|
||||
background-color: v-bind('config.getColorVal("menuBackground")');
|
||||
padding: 4px 0 10px;
|
||||
}
|
||||
.layouts-menu-vertical {
|
||||
border: 0;
|
||||
|
||||
@@ -29,46 +29,63 @@ const onMenuCollapse = () => {
|
||||
<style lang="scss" scoped>
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
height: 50px;
|
||||
margin: 20px var(--ba-main-space) 0 var(--ba-main-space);
|
||||
height: 52px;
|
||||
margin: var(--ba-main-space) var(--ba-main-space) 0 var(--ba-main-space);
|
||||
gap: 12px;
|
||||
:deep(.nav-tabs) {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
.ba-nav-tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 20px;
|
||||
padding: 0 18px;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
user-select: none;
|
||||
opacity: 0.7;
|
||||
opacity: 0.78;
|
||||
color: v-bind('config.getColorVal("headerBarTabColor")');
|
||||
border-radius: var(--ba-radius-control);
|
||||
transition:
|
||||
opacity 0.2s ease,
|
||||
color 0.2s ease,
|
||||
background-color 0.2s ease;
|
||||
.close-icon {
|
||||
padding: 2px;
|
||||
margin: 2px 0 0 4px;
|
||||
}
|
||||
.close-icon:hover {
|
||||
background: var(--ba-color-primary-light);
|
||||
color: var(--el-border-color) !important;
|
||||
background: var(--el-color-primary-light-8);
|
||||
color: var(--el-color-primary) !important;
|
||||
border-radius: 50%;
|
||||
}
|
||||
&.active {
|
||||
color: v-bind('config.getColorVal("headerBarTabActiveColor")');
|
||||
font-weight: 600;
|
||||
}
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
background: v-bind('config.getColorVal("headerBarHoverBackground")');
|
||||
}
|
||||
}
|
||||
.nav-tabs-active-box {
|
||||
position: absolute;
|
||||
height: 40px;
|
||||
border-radius: var(--el-border-radius-base);
|
||||
height: 38px;
|
||||
top: 7px;
|
||||
border-radius: var(--ba-radius-control);
|
||||
background-color: v-bind('config.getColorVal("headerBarTabActiveBackground")');
|
||||
box-shadow: var(--el-box-shadow-light);
|
||||
transition: all 0.2s;
|
||||
-webkit-transition: all 0.2s;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
transition:
|
||||
transform 0.2s ease,
|
||||
width 0.2s ease,
|
||||
left 0.2s ease;
|
||||
-webkit-transition:
|
||||
transform 0.2s ease,
|
||||
width 0.2s ease,
|
||||
left 0.2s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,6 +93,7 @@ const onMenuCollapse = () => {
|
||||
width: 100%;
|
||||
background-color: v-bind('config.getColorVal("headerBarBackground")');
|
||||
margin: 0;
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
.unfold {
|
||||
align-self: center;
|
||||
padding-left: var(--ba-main-space);
|
||||
|
||||
@@ -231,8 +231,9 @@ const onClearCache = (type: string) => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.nav-menus.Default:not(.shrink) {
|
||||
border-radius: var(--el-border-radius-base);
|
||||
box-shadow: var(--el-box-shadow-light);
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
}
|
||||
.reload-hot-server-content {
|
||||
font-size: var(--el-font-size-small);
|
||||
@@ -250,35 +251,52 @@ const onClearCache = (type: string) => {
|
||||
height: 100%;
|
||||
margin-left: auto;
|
||||
background-color: v-bind('configStore.getColorVal("headerBarBackground")');
|
||||
overflow: hidden;
|
||||
.nav-menu-item {
|
||||
height: 100%;
|
||||
width: 40px;
|
||||
width: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
transform 0.18s ease;
|
||||
.nav-menu-icon {
|
||||
box-sizing: content-box;
|
||||
color: v-bind('configStore.getColorVal("headerBarTabColor")');
|
||||
}
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
.icon {
|
||||
animation: twinkle 0.3s ease-in-out;
|
||||
animation: twinkle 0.24s ease-in-out;
|
||||
}
|
||||
}
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
.admin-info {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
padding: 0 10px;
|
||||
padding: 0 14px 0 10px;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
color: v-bind('configStore.getColorVal("headerBarTabColor")');
|
||||
transition: background-color 0.2s ease;
|
||||
:deep(.el-avatar) {
|
||||
border: 2px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-soft);
|
||||
}
|
||||
}
|
||||
.admin-name {
|
||||
padding-left: 6px;
|
||||
max-width: 128px;
|
||||
padding-left: 8px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: 600;
|
||||
}
|
||||
.nav-menu-item:hover,
|
||||
.admin-info:hover,
|
||||
@@ -294,22 +312,34 @@ const onClearCache = (type: string) => {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
padding-top: 10px;
|
||||
padding-top: 12px;
|
||||
:deep(.el-avatar) {
|
||||
border: 3px solid var(--ba-border-color-soft);
|
||||
}
|
||||
.admin-info-other {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 10px 0;
|
||||
padding: 12px 0 8px;
|
||||
.admin-info-name {
|
||||
font-size: var(--el-font-size-large);
|
||||
font-weight: 700;
|
||||
}
|
||||
.admin-info-lasttime {
|
||||
margin-top: 4px;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: var(--el-font-size-small);
|
||||
}
|
||||
}
|
||||
}
|
||||
.admin-info-footer {
|
||||
padding: 10px 0;
|
||||
padding: 12px;
|
||||
margin: 0 -12px -12px -12px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
border-top: 1px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-soft);
|
||||
}
|
||||
.pt2 {
|
||||
padding-top: 2px;
|
||||
|
||||
@@ -101,5 +101,6 @@ watch(
|
||||
width: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 220px), var(--ba-bg-color);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -55,10 +55,15 @@ onUnmounted(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.05), transparent), var(--ba-bg-color-overlay);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
}
|
||||
.loading-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -15,11 +15,11 @@ export const useConfig = defineStore(
|
||||
isDark: false,
|
||||
|
||||
// 侧边栏
|
||||
menuBackground: ['#ffffff', '#1d1e1f'],
|
||||
menuColor: ['#303133', '#CFD3DC'],
|
||||
menuActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||
menuActiveColor: ['#409eff', '#3375b9'],
|
||||
menuTopBarBackground: ['#fcfcfc', '#1d1e1f'],
|
||||
menuBackground: ['#ffffff', '#182131'],
|
||||
menuColor: ['#334155', '#cbd5e1'],
|
||||
menuActiveBackground: ['#eef4ff', '#162846'],
|
||||
menuActiveColor: ['#2563eb', '#8eadf5'],
|
||||
menuTopBarBackground: ['#ffffff', '#182131'],
|
||||
menuWidth: 260,
|
||||
menuDefaultIcon: 'fa fa-circle-o',
|
||||
menuCollapse: false,
|
||||
@@ -27,11 +27,11 @@ export const useConfig = defineStore(
|
||||
menuShowTopBar: true,
|
||||
|
||||
// 顶栏
|
||||
headerBarTabColor: ['#000000', '#CFD3DC'],
|
||||
headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||
headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||
headerBarBackground: ['#ffffff', '#1d1e1f'],
|
||||
headerBarHoverBackground: ['#f5f5f5', '#18222c'],
|
||||
headerBarTabColor: ['#475569', '#cbd5e1'],
|
||||
headerBarTabActiveBackground: ['#ffffff', '#182131'],
|
||||
headerBarTabActiveColor: ['#172033', '#8eadf5'],
|
||||
headerBarBackground: ['#ffffff', '#182131'],
|
||||
headerBarHoverBackground: ['#eef4ff', '#162846'],
|
||||
})
|
||||
|
||||
const lang: Lang = reactive({
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
html,
|
||||
@@ -14,14 +13,17 @@ body,
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-family:
|
||||
Helvetica Neue,
|
||||
Helvetica,
|
||||
ui-sans-serif,
|
||||
system-ui,
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
Segoe UI,
|
||||
PingFang SC,
|
||||
Hiragino Sans GB,
|
||||
Microsoft YaHei,
|
||||
SimSun,
|
||||
sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
background-color: var(--ba-bg-color);
|
||||
@@ -29,6 +31,36 @@ body,
|
||||
font-size: var(--el-font-size-base);
|
||||
}
|
||||
|
||||
html {
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
textarea,
|
||||
select {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid rgba(37, 99, 235, 0.38);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: rgba(37, 99, 235, 0.18);
|
||||
}
|
||||
|
||||
// 阿里 iconfont Symbol引用css
|
||||
.iconfont-icon {
|
||||
width: 1em;
|
||||
@@ -51,7 +83,7 @@ body,
|
||||
}
|
||||
|
||||
.default-main {
|
||||
margin: var(--ba-main-space) var(--ba-main-space) 60px var(--ba-main-space);
|
||||
margin: var(--ba-main-space) var(--ba-main-space) 64px var(--ba-main-space);
|
||||
}
|
||||
.zoom-handle {
|
||||
position: absolute;
|
||||
@@ -64,10 +96,10 @@ body,
|
||||
.block-help {
|
||||
display: block;
|
||||
width: 100%;
|
||||
color: #909399;
|
||||
color: var(--ba-text-muted);
|
||||
font-size: 13px;
|
||||
line-height: 16px;
|
||||
padding-top: 5px;
|
||||
line-height: 1.45;
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
/* 表格顶部菜单-s */
|
||||
@@ -84,7 +116,9 @@ body,
|
||||
|
||||
/* 鼠标置入浮动效果-s */
|
||||
.suspension {
|
||||
transition: all 0.3s ease;
|
||||
transition:
|
||||
transform 0.24s ease,
|
||||
box-shadow 0.24s ease;
|
||||
}
|
||||
.suspension:hover {
|
||||
-webkit-transform: translateY(-4px) scale(1.02);
|
||||
@@ -92,20 +126,23 @@ body,
|
||||
-ms-transform: translateY(-4px) scale(1.02);
|
||||
-o-transform: translateY(-4px) scale(1.02);
|
||||
transform: translateY(-4px) scale(1.02);
|
||||
-webkit-box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
|
||||
-webkit-box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
|
||||
box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
|
||||
z-index: 2147483600;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--ba-radius-panel);
|
||||
}
|
||||
/* 鼠标置入浮动效果-e */
|
||||
|
||||
/* 表格-s */
|
||||
.ba-table-box {
|
||||
border-radius: var(--el-border-radius-round);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
overflow: hidden;
|
||||
background: var(--ba-bg-color-overlay);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
}
|
||||
.ba-table-alert {
|
||||
background-color: var(--el-fill-color-darker) !important;
|
||||
border: 1px solid var(--ba-boder-color);
|
||||
background-color: var(--ba-bg-color-soft) !important;
|
||||
border: 1px solid var(--ba-border-color);
|
||||
border-bottom: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
@@ -115,28 +152,31 @@ body,
|
||||
/* 新增/编辑表单-s */
|
||||
.ba-operate-dialog {
|
||||
overflow: hidden;
|
||||
border-radius: var(--el-border-radius-base);
|
||||
padding-bottom: 52px;
|
||||
border-radius: var(--ba-radius-panel);
|
||||
padding-bottom: 58px;
|
||||
}
|
||||
.ba-operate-dialog .el-dialog__header {
|
||||
border-bottom: 1px solid var(--ba-bg-color);
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
padding: 18px 22px;
|
||||
.el-dialog__headerbtn {
|
||||
top: 4px;
|
||||
top: 8px;
|
||||
}
|
||||
}
|
||||
.ba-operate-dialog .el-dialog__body {
|
||||
height: 58vh;
|
||||
padding: 20px 22px;
|
||||
}
|
||||
.ba-operate-dialog .el-dialog__footer {
|
||||
padding: 10px var(--el-dialog-padding-primary);
|
||||
box-shadow: var(--el-box-shadow);
|
||||
padding: 12px 22px;
|
||||
box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.06);
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: var(--ba-bg-color-overlay);
|
||||
}
|
||||
.ba-operate-form {
|
||||
padding-top: 20px;
|
||||
padding-top: 16px;
|
||||
}
|
||||
/* 新增/编辑表单-e */
|
||||
|
||||
@@ -145,9 +185,10 @@ body,
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
height: 100dvh;
|
||||
width: 100vw;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
background-color: rgba(15, 23, 42, 0.48);
|
||||
backdrop-filter: blur(2px);
|
||||
z-index: 2147483599;
|
||||
}
|
||||
/* 全局遮罩-e */
|
||||
@@ -169,7 +210,9 @@ body,
|
||||
.slide-left-enter-active,
|
||||
.slide-left-leave-active {
|
||||
will-change: transform;
|
||||
transition: all 0.3s ease;
|
||||
transition:
|
||||
transform 0.22s ease,
|
||||
opacity 0.22s ease;
|
||||
}
|
||||
// slide-right
|
||||
.slide-right-enter-from {
|
||||
@@ -194,9 +237,9 @@ body,
|
||||
min-height: calc(100vh - 120px);
|
||||
}
|
||||
.user-views {
|
||||
padding-left: 15px;
|
||||
padding-left: var(--ba-main-space);
|
||||
.user-views-card {
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: var(--ba-main-space);
|
||||
}
|
||||
}
|
||||
.ba-aside-drawer {
|
||||
@@ -226,6 +269,9 @@ body,
|
||||
.xs-hidden {
|
||||
display: none;
|
||||
}
|
||||
.default-main {
|
||||
margin: 12px 12px 48px 12px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1024px) {
|
||||
.ba-operate-dialog {
|
||||
|
||||
@@ -6,8 +6,10 @@
|
||||
$bg-color: () !default;
|
||||
$bg-color: map.merge(
|
||||
(
|
||||
'': #141414,
|
||||
'overlay': #1d1e1f,
|
||||
'': #101722,
|
||||
'overlay': #182131,
|
||||
'soft': #111c2a,
|
||||
'muted': #0d1420,
|
||||
),
|
||||
$bg-color
|
||||
);
|
||||
@@ -16,7 +18,9 @@ $bg-color: map.merge(
|
||||
$border-color: () !default;
|
||||
$border-color: map.merge(
|
||||
(
|
||||
'': #4c4d4f,
|
||||
'': #2d3a4c,
|
||||
'soft': #263244,
|
||||
'strong': #3a4a61,
|
||||
),
|
||||
$border-color
|
||||
);
|
||||
@@ -24,4 +28,22 @@ $border-color: map.merge(
|
||||
html.dark {
|
||||
@include set-component-css-var('bg-color', $bg-color);
|
||||
@include set-component-css-var('border-color', $border-color);
|
||||
|
||||
--ba-surface-soft: #111c2a;
|
||||
--ba-surface-muted: #0d1420;
|
||||
--ba-text-muted: #94a3b8;
|
||||
--ba-shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.34);
|
||||
--ba-shadow-card: 0 12px 30px rgba(0, 0, 0, 0.28);
|
||||
--el-color-primary: #5b86f0;
|
||||
--el-color-primary-light-3: #406fcf;
|
||||
--el-color-primary-light-5: #2e4f93;
|
||||
--el-color-primary-light-7: #203b6f;
|
||||
--el-color-primary-light-8: #1b315a;
|
||||
--el-color-primary-light-9: #162846;
|
||||
--el-color-primary-dark-2: #8eadf5;
|
||||
--el-text-color-primary: #e5edf7;
|
||||
--el-text-color-regular: #cbd5e1;
|
||||
--el-text-color-secondary: #94a3b8;
|
||||
--el-fill-color-light: #111c2a;
|
||||
--el-fill-color-lighter: #0d1420;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,189 @@
|
||||
.el-menu {
|
||||
user-select: none;
|
||||
padding: 8px;
|
||||
background: transparent;
|
||||
.el-sub-menu__title:hover {
|
||||
background-color: var(--el-color-primary-light-9) !important;
|
||||
}
|
||||
.el-menu-item,
|
||||
.el-sub-menu__title {
|
||||
height: 42px;
|
||||
margin: 3px 0;
|
||||
border-radius: var(--ba-radius-control);
|
||||
line-height: 42px;
|
||||
transition:
|
||||
background-color 0.2s ease,
|
||||
color 0.2s ease,
|
||||
transform 0.2s ease;
|
||||
}
|
||||
.el-menu-item:hover,
|
||||
.el-sub-menu__title:hover {
|
||||
transform: translateX(2px);
|
||||
}
|
||||
.el-menu-item.is-active {
|
||||
background: var(--el-color-primary-light-9);
|
||||
color: var(--el-color-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table {
|
||||
--el-table-border-color: var(--ba-border-color);
|
||||
--el-table-header-bg-color: var(--ba-bg-color-soft);
|
||||
--el-table-header-text-color: var(--el-text-color-primary);
|
||||
--el-table-row-hover-bg-color: var(--el-color-primary-light-9);
|
||||
color: var(--el-text-color-regular);
|
||||
font-variant-numeric: tabular-nums;
|
||||
.el-table__cell {
|
||||
padding: 9px 0;
|
||||
}
|
||||
.el-table__header th {
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
.el-table__empty-block {
|
||||
min-height: 180px;
|
||||
}
|
||||
.el-table__empty-text {
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.el-card {
|
||||
border: none;
|
||||
border-radius: var(--ba-radius-panel);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
.el-card__header {
|
||||
border-bottom: 1px solid var(--el-border-color-extra-light);
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
padding: 14px 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.el-card__body {
|
||||
padding: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-button {
|
||||
border-radius: var(--ba-radius-control);
|
||||
font-weight: 600;
|
||||
transition:
|
||||
transform 0.18s ease,
|
||||
box-shadow 0.18s ease,
|
||||
background-color 0.18s ease,
|
||||
border-color 0.18s ease;
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
&:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
&.is-link:hover,
|
||||
&.is-text:hover,
|
||||
&.is-circle:hover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
.el-button--primary:not(.is-link, .is-text, .is-plain) {
|
||||
box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
|
||||
}
|
||||
|
||||
.el-button--danger:not(.is-link, .is-text, .is-plain) {
|
||||
box-shadow: 0 8px 18px rgba(220, 63, 77, 0.14);
|
||||
}
|
||||
|
||||
.el-input__wrapper,
|
||||
.el-textarea__inner,
|
||||
.el-select__wrapper {
|
||||
border-radius: var(--ba-radius-control);
|
||||
box-shadow: 0 0 0 1px var(--ba-border-color-soft) inset;
|
||||
transition:
|
||||
box-shadow 0.2s ease,
|
||||
background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.el-input__wrapper:hover,
|
||||
.el-textarea__inner:hover,
|
||||
.el-select__wrapper:hover {
|
||||
box-shadow: 0 0 0 1px var(--ba-border-color-strong) inset;
|
||||
}
|
||||
|
||||
.el-input__wrapper.is-focus,
|
||||
.el-textarea__inner:focus,
|
||||
.el-select__wrapper.is-focused {
|
||||
box-shadow:
|
||||
0 0 0 1px var(--el-color-primary) inset,
|
||||
0 0 0 3px rgba(37, 99, 235, 0.12);
|
||||
}
|
||||
|
||||
.el-date-editor.el-input__wrapper {
|
||||
border-radius: var(--ba-radius-control);
|
||||
}
|
||||
|
||||
.el-dialog {
|
||||
border-radius: var(--ba-radius-panel);
|
||||
box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-dialog__header {
|
||||
margin-right: 0;
|
||||
padding: 18px 22px;
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
color: var(--el-text-color-primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 20px 22px;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 14px 22px 18px;
|
||||
background: var(--ba-bg-color-soft);
|
||||
border-top: 1px solid var(--ba-border-color-soft);
|
||||
}
|
||||
|
||||
.el-overlay {
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.el-popper,
|
||||
.el-dropdown__popper,
|
||||
.el-popover.el-popper {
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
box-shadow: var(--ba-shadow-soft);
|
||||
}
|
||||
|
||||
.el-dropdown-menu {
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.el-dropdown-menu__item {
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.el-pagination.is-background .el-pager li,
|
||||
.el-pagination.is-background .btn-prev,
|
||||
.el-pagination.is-background .btn-next {
|
||||
border-radius: 7px;
|
||||
}
|
||||
|
||||
.el-tag {
|
||||
border-radius: 6px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.el-alert {
|
||||
border-radius: var(--ba-radius-panel);
|
||||
}
|
||||
|
||||
.el-divider__text.is-center {
|
||||
@@ -38,7 +208,7 @@
|
||||
}
|
||||
}
|
||||
.el-textarea__inner {
|
||||
padding: 5px 11px;
|
||||
padding: 7px 11px;
|
||||
}
|
||||
.datetime-picker {
|
||||
height: 32px;
|
||||
@@ -55,14 +225,14 @@
|
||||
height: 5px;
|
||||
}
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #eaeaea;
|
||||
background: #d5dde8;
|
||||
border-radius: var(--el-border-radius-base);
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
}
|
||||
&:hover {
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: #c8c9cc;
|
||||
background: #aeb9c8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +240,7 @@
|
||||
.el-overlay-dialog,
|
||||
.ba-scroll-style {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #c8c9cc #eaeaea;
|
||||
scrollbar-color: #aeb9c8 #d5dde8;
|
||||
}
|
||||
}
|
||||
/* dialog 滚动条样式优化结束 >>> */
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
@use '/@/styles/element';
|
||||
@use '/@/styles/var';
|
||||
@use '/@/styles/dark';
|
||||
@use '/@/styles/report-table';
|
||||
@use '/@/styles/markdown';
|
||||
|
||||
276
web/src/styles/report-table.scss
Normal file
276
web/src/styles/report-table.scss
Normal file
@@ -0,0 +1,276 @@
|
||||
.admin-report-page {
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 14px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.admin-report-tabs {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
gap: 4px;
|
||||
margin-bottom: var(--ba-main-space);
|
||||
padding: 4px;
|
||||
overflow-x: auto;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
background: var(--ba-bg-color-overlay);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
|
||||
button {
|
||||
min-height: 34px;
|
||||
padding: 0 18px;
|
||||
border: 0;
|
||||
border-radius: var(--ba-radius-control);
|
||||
background: transparent;
|
||||
color: var(--el-text-color-regular);
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
color 0.18s ease,
|
||||
background-color 0.18s ease,
|
||||
box-shadow 0.18s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--el-color-primary-light-9);
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: var(--el-color-primary);
|
||||
color: var(--el-color-white);
|
||||
box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.admin-report-filter {
|
||||
margin-bottom: var(--ba-main-space);
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
background: var(--ba-bg-color-overlay);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
}
|
||||
|
||||
.admin-report-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
min-height: 46px;
|
||||
padding: 13px 16px;
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-soft);
|
||||
color: var(--el-text-color-primary);
|
||||
font-weight: 700;
|
||||
|
||||
strong {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 24px;
|
||||
padding: 0 10px;
|
||||
border-radius: 999px;
|
||||
background: var(--el-color-success-light-9);
|
||||
color: var(--el-color-success);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.admin-report-filter-content {
|
||||
padding: 16px;
|
||||
background: var(--ba-bg-color-overlay);
|
||||
}
|
||||
|
||||
.admin-report-filter-content .filter-item,
|
||||
.admin-report-filter-content .date-fields {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.admin-report-filter-content label {
|
||||
color: var(--el-text-color-secondary);
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.admin-report-filter-content .el-date-editor,
|
||||
.admin-report-filter-content .el-input,
|
||||
.admin-report-filter-content .el-select {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.admin-report-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
.el-button {
|
||||
min-width: 92px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.admin-report-summary {
|
||||
margin: 0 0 10px;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 13px;
|
||||
|
||||
strong {
|
||||
color: var(--el-text-color-primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.admin-report-table-wrap {
|
||||
overflow-x: auto;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
background: var(--ba-bg-color-overlay);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
}
|
||||
|
||||
.admin-report-table {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
th,
|
||||
td {
|
||||
height: 42px;
|
||||
padding: 10px 12px;
|
||||
border-right: 1px solid var(--ba-border-color-soft);
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-overlay);
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th:last-child,
|
||||
td:last-child {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
thead th {
|
||||
border-bottom-color: var(--ba-border-color-strong);
|
||||
background: var(--ba-bg-color-soft);
|
||||
color: var(--el-text-color-primary);
|
||||
font-weight: 700;
|
||||
|
||||
small {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
tbody tr:last-child td {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
tbody tr:hover td {
|
||||
background: var(--el-color-primary-light-9);
|
||||
}
|
||||
|
||||
.date-cell,
|
||||
.reward-cell {
|
||||
background: var(--ba-bg-color-soft);
|
||||
}
|
||||
|
||||
.deposit-value,
|
||||
.positive-value {
|
||||
color: var(--el-color-success);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.withdraw-value,
|
||||
.negative-value {
|
||||
color: var(--el-color-danger);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.unclaim-value {
|
||||
color: var(--el-color-primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.empty-row {
|
||||
height: 150px;
|
||||
color: var(--el-text-color-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.admin-report-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-top: 12px;
|
||||
padding: 12px 16px;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
background: var(--ba-bg-color-overlay);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.admin-report-page-size {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
.el-select {
|
||||
width: 96px;
|
||||
}
|
||||
}
|
||||
|
||||
html.dark {
|
||||
.admin-report-heading strong {
|
||||
background: rgba(22, 138, 91, 0.18);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.admin-report-tabs {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.admin-report-filter-content {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.admin-report-filter-content .filter-item,
|
||||
.admin-report-filter-content .date-fields {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.admin-report-filter-content .el-date-editor,
|
||||
.admin-report-filter-content .el-input,
|
||||
.admin-report-filter-content .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.admin-report-actions,
|
||||
.admin-report-footer {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.admin-report-actions .el-button,
|
||||
.admin-report-footer .el-pagination {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,24 @@
|
||||
@use 'mixins' as *;
|
||||
|
||||
// 后台主体窗口左右间距
|
||||
$main-space: 16px;
|
||||
$primary-light: #3f6ad8;
|
||||
$main-space: 18px;
|
||||
$primary-light: #2563eb;
|
||||
$surface-soft: #eef3f8;
|
||||
$surface-muted: #f7f9fc;
|
||||
$text-muted: #64748b;
|
||||
$shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.08);
|
||||
$shadow-card: 0 10px 24px rgba(15, 23, 42, 0.06);
|
||||
$radius-panel: 10px;
|
||||
$radius-control: 7px;
|
||||
|
||||
// --ba-background
|
||||
$bg-color: () !default;
|
||||
$bg-color: map.merge(
|
||||
(
|
||||
'': #f5f5f5,
|
||||
'': #eef3f8,
|
||||
'overlay': #ffffff,
|
||||
'soft': $surface-muted,
|
||||
'muted': $surface-soft,
|
||||
),
|
||||
$bg-color
|
||||
);
|
||||
@@ -19,7 +28,9 @@ $bg-color: map.merge(
|
||||
$border-color: () !default;
|
||||
$border-color: map.merge(
|
||||
(
|
||||
'': #f6f6f6,
|
||||
'': #d8e0ea,
|
||||
'soft': #e8eef5,
|
||||
'strong': #c7d2de,
|
||||
),
|
||||
$border-color
|
||||
);
|
||||
@@ -27,6 +38,38 @@ $border-color: map.merge(
|
||||
:root {
|
||||
@include set-css-var-value('main-space', $main-space);
|
||||
@include set-css-var-value('color-primary-light', $primary-light);
|
||||
@include set-css-var-value('surface-soft', $surface-soft);
|
||||
@include set-css-var-value('surface-muted', $surface-muted);
|
||||
@include set-css-var-value('text-muted', $text-muted);
|
||||
@include set-css-var-value('shadow-soft', $shadow-soft);
|
||||
@include set-css-var-value('shadow-card', $shadow-card);
|
||||
@include set-css-var-value('radius-panel', $radius-panel);
|
||||
@include set-css-var-value('radius-control', $radius-control);
|
||||
@include set-component-css-var('bg-color', $bg-color);
|
||||
@include set-component-css-var('border-color', $border-color);
|
||||
|
||||
--el-color-primary: #2563eb;
|
||||
--el-color-primary-light-3: #5b86f0;
|
||||
--el-color-primary-light-5: #8eadf5;
|
||||
--el-color-primary-light-7: #c7d7fb;
|
||||
--el-color-primary-light-8: #dbe6fd;
|
||||
--el-color-primary-light-9: #eef4ff;
|
||||
--el-color-primary-dark-2: #1d4ed8;
|
||||
--el-color-success: #168a5b;
|
||||
--el-color-success-light-9: #ecfdf5;
|
||||
--el-color-warning: #b7791f;
|
||||
--el-color-warning-light-9: #fff7ed;
|
||||
--el-color-danger: #dc3f4d;
|
||||
--el-color-danger-light-9: #fff1f2;
|
||||
--el-color-info: #64748b;
|
||||
--el-border-radius-base: #{$radius-control};
|
||||
--el-border-radius-small: 5px;
|
||||
--el-border-radius-round: #{$radius-panel};
|
||||
--el-box-shadow-light: #{$shadow-card};
|
||||
--el-box-shadow: #{$shadow-soft};
|
||||
--el-text-color-primary: #172033;
|
||||
--el-text-color-regular: #334155;
|
||||
--el-text-color-secondary: #64748b;
|
||||
--el-fill-color-light: #f7f9fc;
|
||||
--el-fill-color-lighter: #fbfcfe;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,12 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="bank in visibleBanks" :key="bank.id" :class="bank.rowClass" :style="{ backgroundColor: bank.labelColor }">
|
||||
<tr
|
||||
v-for="bank in visibleBanks"
|
||||
:key="bank.id"
|
||||
:class="[bank.rowClass, { 'bank-colored': bank.labelColor }]"
|
||||
:style="bankRowStyle(bank)"
|
||||
>
|
||||
<td>
|
||||
<strong>{{ bank.name }}</strong>
|
||||
<small>{{ bank.account }}</small>
|
||||
@@ -22,11 +27,50 @@
|
||||
<td class="balance">AUD {{ money(bank.balance) }}</td>
|
||||
<td>
|
||||
<div class="bank-operate">
|
||||
<el-button size="small" :icon="Coin" circle />
|
||||
<el-button size="small" :icon="Switch" @click="openTransfer(bank)">{{ t('dashboard.Transfer') }}</el-button>
|
||||
<div class="breakdown">
|
||||
<span><i class="dot income">↓</i> ({{ bank.depositCount }}) {{ money(bank.deposit) }}</span>
|
||||
<span><i class="dot outcome">↑</i> ({{ bank.withdrawCount }}) {{ money(bank.withdraw) }}</span>
|
||||
<input :id="calculatorToggleId(bank)" class="calculator-toggle" type="checkbox" />
|
||||
<div class="bank-operate-main">
|
||||
<label
|
||||
class="calculator-button"
|
||||
:for="calculatorToggleId(bank)"
|
||||
:aria-label="t('dashboard.Fast Calculation')"
|
||||
:title="t('dashboard.Fast Calculation')"
|
||||
>
|
||||
<Icon name="fa fa-calculator" size="13" color="currentColor" />
|
||||
</label>
|
||||
<el-button size="small" :icon="Switch" @click="openTransfer(bank)">
|
||||
{{ t('dashboard.Transfer') }}
|
||||
</el-button>
|
||||
<div class="breakdown">
|
||||
<div class="breakdown-row breakdown-in">
|
||||
<span class="breakdown-label">入</span>
|
||||
<span class="breakdown-count">({{ bank.depositCount }})</span>
|
||||
<strong>{{ money(bank.deposit) }}</strong>
|
||||
</div>
|
||||
<div class="breakdown-row breakdown-out">
|
||||
<span class="breakdown-label">出</span>
|
||||
<span class="breakdown-count">({{ bank.withdrawCount }})</span>
|
||||
<strong>{{ money(bank.withdraw) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bank-calculator">
|
||||
<div class="calculator-formula">
|
||||
<el-input
|
||||
v-model="calculatorFormulas[calculatorKey(bank)]"
|
||||
class="calculator-input"
|
||||
size="small"
|
||||
:placeholder="t('dashboard.Calculation placeholder')"
|
||||
clearable
|
||||
/>
|
||||
<span class="calculator-equals">=</span>
|
||||
<strong class="calculator-result" :class="{ 'is-invalid': isCalculatorInvalid(bank) }">
|
||||
{{ calculatorResultText(bank) }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="calculator-hint">
|
||||
{{ t('dashboard.Fast Calculation Support') }}
|
||||
<span>+ − × ÷</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -240,7 +284,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Coin, Switch } from '@element-plus/icons-vue'
|
||||
import { Switch } from '@element-plus/icons-vue'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { bankTransact, delTransact, editTransact, index as getDashboard, logHistory, newTransact } from '/@/api/backend/dashboard'
|
||||
@@ -357,6 +401,11 @@ interface HistoryRow {
|
||||
bankAfter: string
|
||||
}
|
||||
|
||||
interface CalculationResult {
|
||||
valid: boolean
|
||||
value: number
|
||||
}
|
||||
|
||||
const today = () => {
|
||||
const date = new Date()
|
||||
const pad = (value: number) => value.toString().padStart(2, '0')
|
||||
@@ -374,6 +423,249 @@ const toNumber = (value: unknown) => {
|
||||
return Number.isFinite(number) ? number : 0
|
||||
}
|
||||
|
||||
const normalizeCalculationFormula = (value: string) =>
|
||||
value
|
||||
.replace(/,/g, '')
|
||||
.replace(/乘以/g, '*')
|
||||
.replace(/除以/g, '/')
|
||||
.replace(/加/g, '+')
|
||||
.replace(/减/g, '-')
|
||||
.replace(/[+]/g, '+')
|
||||
.replace(/[-–—]/g, '-')
|
||||
.replace(/[×*xX]/g, '*')
|
||||
.replace(/[÷/]/g, '/')
|
||||
.replace(/\s+/g, '')
|
||||
.replace(/^=/, '')
|
||||
|
||||
const evaluateExpression = (expression: string) => {
|
||||
let index = 0
|
||||
|
||||
const parseNumber = () => {
|
||||
const matched = expression.slice(index).match(/^(?:\d+(?:\.\d*)?|\.\d+)/)
|
||||
if (!matched) return null
|
||||
|
||||
index += matched[0].length
|
||||
return Number(matched[0])
|
||||
}
|
||||
|
||||
const parseFactor = (): number | null => {
|
||||
const char = expression[index]
|
||||
|
||||
if (char === '+') {
|
||||
index += 1
|
||||
return parseFactor()
|
||||
}
|
||||
|
||||
if (char === '-') {
|
||||
index += 1
|
||||
const value = parseFactor()
|
||||
return value === null ? null : -value
|
||||
}
|
||||
|
||||
if (char === '(') {
|
||||
index += 1
|
||||
const value = parseExpression()
|
||||
|
||||
if (value === null || expression[index] !== ')') return null
|
||||
|
||||
index += 1
|
||||
return value
|
||||
}
|
||||
|
||||
return parseNumber()
|
||||
}
|
||||
|
||||
const parseTerm = (): number | null => {
|
||||
let value = parseFactor()
|
||||
if (value === null) return null
|
||||
|
||||
while (expression[index] === '*' || expression[index] === '/') {
|
||||
const operator = expression[index]
|
||||
index += 1
|
||||
const right = parseFactor()
|
||||
|
||||
if (right === null) return null
|
||||
|
||||
value = operator === '*' ? value * right : right === 0 ? Number.NaN : value / right
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
function parseExpression(): number | null {
|
||||
let value = parseTerm()
|
||||
if (value === null) return null
|
||||
|
||||
while (expression[index] === '+' || expression[index] === '-') {
|
||||
const operator = expression[index]
|
||||
index += 1
|
||||
const right = parseTerm()
|
||||
|
||||
if (right === null) return null
|
||||
|
||||
value = operator === '+' ? value + right : value - right
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
const result = parseExpression()
|
||||
|
||||
return result !== null && index === expression.length && Number.isFinite(result) ? result : null
|
||||
}
|
||||
|
||||
const calculateBalancePreview = (balance: number, formula: string): CalculationResult => {
|
||||
const normalized = normalizeCalculationFormula(formula)
|
||||
|
||||
if (!normalized) {
|
||||
return { valid: true, value: balance }
|
||||
}
|
||||
|
||||
if (!/^[\d+\-*/().]+$/.test(normalized)) {
|
||||
return { valid: false, value: balance }
|
||||
}
|
||||
|
||||
const expression = /^[+\-*/]/.test(normalized) ? `${balance}${normalized}` : `${balance}+${normalized}`
|
||||
const value = evaluateExpression(expression)
|
||||
|
||||
return value === null ? { valid: false, value: balance } : { valid: true, value }
|
||||
}
|
||||
|
||||
const clampRgbChannel = (value: number) => Math.min(255, Math.max(0, Math.round(value)))
|
||||
|
||||
const parseColorChannel = (value: string) => {
|
||||
const number = Number(value)
|
||||
return Number.isFinite(number) ? clampRgbChannel(number) : 0
|
||||
}
|
||||
|
||||
const parseAlphaChannel = (value?: string) => {
|
||||
if (value === undefined) return 1
|
||||
|
||||
const number = Number(value)
|
||||
return Number.isFinite(number) ? Math.min(1, Math.max(0, number)) : 1
|
||||
}
|
||||
|
||||
const parseColorToRgb = (value: string) => {
|
||||
const color = value.trim()
|
||||
const hex = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i)
|
||||
|
||||
if (hex) {
|
||||
const raw = hex[1]
|
||||
const full =
|
||||
raw.length === 3
|
||||
? raw
|
||||
.split('')
|
||||
.map((char) => char + char)
|
||||
.join('')
|
||||
: raw
|
||||
|
||||
return {
|
||||
r: Number.parseInt(full.slice(0, 2), 16),
|
||||
g: Number.parseInt(full.slice(2, 4), 16),
|
||||
b: Number.parseInt(full.slice(4, 6), 16),
|
||||
a: full.length === 8 ? Number.parseInt(full.slice(6, 8), 16) / 255 : 1,
|
||||
}
|
||||
}
|
||||
|
||||
const rgb = color.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)$/i)
|
||||
|
||||
if (!rgb) return null
|
||||
|
||||
return {
|
||||
r: parseColorChannel(rgb[1]),
|
||||
g: parseColorChannel(rgb[2]),
|
||||
b: parseColorChannel(rgb[3]),
|
||||
a: parseAlphaChannel(rgb[4]),
|
||||
}
|
||||
}
|
||||
|
||||
const rgbToCss = (rgb: { r: number; g: number; b: number }) => `rgb(${clampRgbChannel(rgb.r)}, ${clampRgbChannel(rgb.g)}, ${clampRgbChannel(rgb.b)})`
|
||||
|
||||
const mixRgb = (source: { r: number; g: number; b: number }, target: { r: number; g: number; b: number }, targetWeight: number) => ({
|
||||
r: source.r * (1 - targetWeight) + target.r * targetWeight,
|
||||
g: source.g * (1 - targetWeight) + target.g * targetWeight,
|
||||
b: source.b * (1 - targetWeight) + target.b * targetWeight,
|
||||
})
|
||||
|
||||
const polishedBankRowColor = (backgroundColor: string) => {
|
||||
const rgb = parseColorToRgb(backgroundColor)
|
||||
if (!rgb) return backgroundColor
|
||||
|
||||
const blended = {
|
||||
r: rgb.r * rgb.a + 255 * (1 - rgb.a),
|
||||
g: rgb.g * rgb.a + 255 * (1 - rgb.a),
|
||||
b: rgb.b * rgb.a + 255 * (1 - rgb.a),
|
||||
}
|
||||
const max = Math.max(blended.r, blended.g, blended.b)
|
||||
const min = Math.min(blended.r, blended.g, blended.b)
|
||||
|
||||
if (max - min < 18) {
|
||||
return rgbToCss(mixRgb(blended, { r: 241, g: 245, b: 249 }, 0.72))
|
||||
}
|
||||
|
||||
if (blended.g >= blended.r && blended.g >= blended.b) {
|
||||
return '#d9f3e5'
|
||||
}
|
||||
|
||||
if (blended.r >= blended.g && blended.r >= blended.b) {
|
||||
return '#f8dde2'
|
||||
}
|
||||
|
||||
return '#dbeafe'
|
||||
}
|
||||
|
||||
const srgbToLinear = (channel: number) => {
|
||||
const value = channel / 255
|
||||
return value <= 0.03928 ? value / 12.92 : Math.pow((value + 0.055) / 1.055, 2.4)
|
||||
}
|
||||
|
||||
const relativeLuminance = (rgb: { r: number; g: number; b: number }) =>
|
||||
0.2126 * srgbToLinear(rgb.r) + 0.7152 * srgbToLinear(rgb.g) + 0.0722 * srgbToLinear(rgb.b)
|
||||
|
||||
const contrastRatio = (first: number, second: number) => {
|
||||
const lighter = Math.max(first, second)
|
||||
const darker = Math.min(first, second)
|
||||
return (lighter + 0.05) / (darker + 0.05)
|
||||
}
|
||||
|
||||
const readableTextColor = (backgroundColor: string) => {
|
||||
const rgb = parseColorToRgb(backgroundColor)
|
||||
if (!rgb) return '#172033'
|
||||
|
||||
const blended = {
|
||||
r: rgb.r * rgb.a + 255 * (1 - rgb.a),
|
||||
g: rgb.g * rgb.a + 255 * (1 - rgb.a),
|
||||
b: rgb.b * rgb.a + 255 * (1 - rgb.a),
|
||||
}
|
||||
const luminance = relativeLuminance(blended)
|
||||
const slateContrast = contrastRatio(luminance, relativeLuminance({ r: 23, g: 32, b: 51 }))
|
||||
const whiteContrast = contrastRatio(luminance, 1)
|
||||
const darkContrast = contrastRatio(luminance, 0)
|
||||
|
||||
if (slateContrast >= 4.5 || slateContrast >= whiteContrast) {
|
||||
return '#172033'
|
||||
}
|
||||
|
||||
return whiteContrast >= darkContrast ? '#ffffff' : '#000000'
|
||||
}
|
||||
|
||||
const bankRowStyle = (bank: Bank): Record<string, string> => {
|
||||
if (!bank.labelColor) return {}
|
||||
|
||||
const backgroundColor = polishedBankRowColor(bank.labelColor)
|
||||
const textColor = readableTextColor(backgroundColor)
|
||||
const isLightText = textColor === '#ffffff'
|
||||
|
||||
return {
|
||||
backgroundColor,
|
||||
'--bank-row-text-color': textColor,
|
||||
'--bank-row-muted-color': isLightText ? 'rgba(255, 255, 255, 0.82)' : 'rgba(0, 0, 0, 0.72)',
|
||||
'--bank-row-border-color': isLightText ? 'rgba(255, 255, 255, 0.24)' : 'rgba(0, 0, 0, 0.16)',
|
||||
'--bank-row-control-bg': isLightText ? 'rgba(255, 255, 255, 0.16)' : 'rgba(255, 255, 255, 0.72)',
|
||||
'--bank-row-control-hover-bg': isLightText ? 'rgba(255, 255, 255, 0.26)' : 'rgba(255, 255, 255, 0.88)',
|
||||
}
|
||||
}
|
||||
|
||||
const formatDateTime = (value: unknown) => {
|
||||
if (typeof value === 'string' && value.trim() && !Number.isFinite(Number(value))) {
|
||||
return value
|
||||
@@ -435,6 +727,7 @@ const transactionPage = reactive({
|
||||
pageSize: 10,
|
||||
})
|
||||
const showAllBanks = ref(false)
|
||||
const calculatorFormulas = reactive<Record<string, string>>({})
|
||||
const visibleBanks = computed(() => (showAllBanks.value ? banks.value : banks.value.slice(0, 4)))
|
||||
const totalDeposit = computed(() => transactionTotals.totalDeposit)
|
||||
const totalWithdraw = computed(() => transactionTotals.totalWithdraw)
|
||||
@@ -460,6 +753,19 @@ const summary = computed(() => [
|
||||
{ label: t('dashboard.Unclaimed Receipt'), value: customerSummary.unclaimReceipt },
|
||||
])
|
||||
|
||||
const calculatorKey = (bank: Bank) => String(bank.id)
|
||||
|
||||
const calculatorToggleId = (bank: Bank) => `bank-calculator-${calculatorKey(bank).replace(/[^a-zA-Z0-9_-]/g, '-')}`
|
||||
|
||||
const calculatorResult = (bank: Bank) => calculateBalancePreview(bank.balance, calculatorFormulas[calculatorKey(bank)] || '')
|
||||
|
||||
const isCalculatorInvalid = (bank: Bank) => !calculatorResult(bank).valid
|
||||
|
||||
const calculatorResultText = (bank: Bank) => {
|
||||
const result = calculatorResult(bank)
|
||||
return result.valid ? `AUD ${money(result.value)}` : 'AUD --'
|
||||
}
|
||||
|
||||
const transactionDialog = reactive<{ visible: boolean; loading: boolean; mode: 'create' | 'edit'; editId: number | string | '' }>({
|
||||
visible: false,
|
||||
loading: false,
|
||||
@@ -753,25 +1059,29 @@ onMounted(() => {
|
||||
.bookkeeping-dashboard {
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 13px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.dashboard-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 310px;
|
||||
gap: 16px;
|
||||
gap: var(--ba-main-space);
|
||||
}
|
||||
.dashboard-panel,
|
||||
.transaction-section {
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 4px;
|
||||
background: var(--el-bg-color);
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
background: var(--ba-bg-color-overlay);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
overflow: hidden;
|
||||
}
|
||||
.panel-title {
|
||||
padding: 11px 14px;
|
||||
border-bottom: 1px solid var(--el-border-color);
|
||||
background: var(--el-fill-color-light);
|
||||
padding: 13px 16px;
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-soft);
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.table-scroll {
|
||||
overflow-x: auto;
|
||||
@@ -781,16 +1091,68 @@ onMounted(() => {
|
||||
border-collapse: collapse;
|
||||
th,
|
||||
td {
|
||||
padding: 9px 12px;
|
||||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||
padding: 11px 14px;
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
th {
|
||||
color: var(--el-text-color-secondary);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
background: var(--ba-bg-color-soft);
|
||||
white-space: nowrap;
|
||||
}
|
||||
tbody tr {
|
||||
transition: background-color 0.18s ease;
|
||||
}
|
||||
tbody tr:hover:not(.bank-colored) {
|
||||
background: var(--el-color-primary-light-9);
|
||||
}
|
||||
tbody tr.bank-colored {
|
||||
color: var(--bank-row-text-color);
|
||||
text-shadow: none;
|
||||
|
||||
td {
|
||||
border-bottom-color: var(--bank-row-border-color);
|
||||
}
|
||||
|
||||
small {
|
||||
color: var(--bank-row-muted-color);
|
||||
}
|
||||
|
||||
.balance {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
:deep(.el-button) {
|
||||
--el-button-text-color: var(--bank-row-text-color);
|
||||
--el-button-bg-color: var(--bank-row-control-bg);
|
||||
--el-button-border-color: var(--bank-row-border-color);
|
||||
--el-button-hover-text-color: var(--bank-row-text-color);
|
||||
--el-button-hover-bg-color: var(--bank-row-control-hover-bg);
|
||||
--el-button-hover-border-color: var(--bank-row-border-color);
|
||||
--el-button-active-text-color: var(--bank-row-text-color);
|
||||
--el-button-active-bg-color: var(--bank-row-control-hover-bg);
|
||||
--el-button-active-border-color: var(--bank-row-border-color);
|
||||
}
|
||||
|
||||
.calculator-button {
|
||||
color: var(--bank-row-text-color);
|
||||
border-color: var(--bank-row-border-color);
|
||||
background: var(--bank-row-control-bg);
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
background: var(--bank-row-control-hover-bg);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tag) {
|
||||
color: var(--bank-row-text-color);
|
||||
border-color: var(--bank-row-border-color);
|
||||
background: var(--bank-row-control-bg);
|
||||
}
|
||||
}
|
||||
strong,
|
||||
small {
|
||||
display: block;
|
||||
@@ -815,15 +1177,164 @@ onMounted(() => {
|
||||
}
|
||||
.bank-operate {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
:deep(.el-button.is-circle) {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
.breakdown {
|
||||
.bank-operate-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.calculator-toggle {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
.calculator-toggle:not(:checked) ~ .bank-calculator {
|
||||
display: none;
|
||||
}
|
||||
.calculator-toggle:checked + .bank-operate-main .calculator-button {
|
||||
border-color: var(--el-color-primary);
|
||||
background: var(--el-color-primary-light-9);
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
.calculator-toggle:focus-visible + .bank-operate-main .calculator-button {
|
||||
outline: 2px solid var(--el-color-primary-light-5);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.calculator-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 50%;
|
||||
background: var(--el-bg-color);
|
||||
color: var(--el-text-color-regular);
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
transition:
|
||||
background-color 0.18s ease,
|
||||
border-color 0.18s ease,
|
||||
color 0.18s ease;
|
||||
&:hover,
|
||||
&:focus-visible {
|
||||
border-color: var(--el-color-primary);
|
||||
color: var(--el-color-primary);
|
||||
background: var(--el-color-primary-light-9);
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
.bank-calculator {
|
||||
width: min(300px, 100%);
|
||||
padding: 6px 8px 5px;
|
||||
border: 1px solid var(--ba-border-color-soft);
|
||||
border-radius: 2px;
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
.calculator-formula {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
}
|
||||
.calculator-input {
|
||||
flex: 1 1 125px;
|
||||
min-width: 112px;
|
||||
:deep(.el-input__wrapper) {
|
||||
min-height: 28px;
|
||||
border-radius: 0;
|
||||
box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.72) inset;
|
||||
}
|
||||
}
|
||||
.calculator-equals {
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
.calculator-result {
|
||||
min-width: 92px;
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
&.is-invalid {
|
||||
color: var(--el-color-danger);
|
||||
}
|
||||
}
|
||||
.calculator-hint {
|
||||
margin-top: 3px;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 11px;
|
||||
line-height: 1.2;
|
||||
span {
|
||||
margin-left: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
}
|
||||
.breakdown {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
min-width: 118px;
|
||||
padding: 5px 8px;
|
||||
border: 1px solid rgba(148, 163, 184, 0.28);
|
||||
border-radius: 4px;
|
||||
background: rgba(248, 250, 252, 0.94);
|
||||
color: var(--el-text-color-regular);
|
||||
box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
|
||||
}
|
||||
.breakdown-row {
|
||||
display: grid;
|
||||
grid-template-columns: 18px auto minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 1.15;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.breakdown-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 3px;
|
||||
color: #ffffff;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.breakdown-count {
|
||||
color: var(--el-text-color-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
.breakdown-in {
|
||||
color: var(--el-color-success);
|
||||
.breakdown-label {
|
||||
background: var(--el-color-success);
|
||||
}
|
||||
}
|
||||
.breakdown-out {
|
||||
color: var(--el-color-danger);
|
||||
.breakdown-label {
|
||||
background: var(--el-color-danger);
|
||||
}
|
||||
}
|
||||
.dot {
|
||||
font-style: normal;
|
||||
@@ -840,16 +1351,22 @@ onMounted(() => {
|
||||
.more-info {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 9px;
|
||||
padding: 11px;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
border-top: 1px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-soft);
|
||||
color: var(--el-color-primary);
|
||||
cursor: pointer;
|
||||
font-weight: 700;
|
||||
transition: background-color 0.18s ease;
|
||||
&:hover {
|
||||
background: var(--el-color-primary-light-9);
|
||||
}
|
||||
}
|
||||
.summary-side {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
gap: var(--ba-main-space);
|
||||
}
|
||||
.summary-panel dl {
|
||||
display: grid;
|
||||
@@ -860,8 +1377,12 @@ onMounted(() => {
|
||||
.summary-panel dt,
|
||||
.summary-panel dd {
|
||||
margin: 0;
|
||||
padding: 8px 12px;
|
||||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||
padding: 10px 14px;
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
}
|
||||
.summary-panel dt {
|
||||
color: var(--el-text-color-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
.summary-panel dd {
|
||||
color: var(--el-color-primary);
|
||||
@@ -870,11 +1391,12 @@ onMounted(() => {
|
||||
}
|
||||
.create-button {
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
min-height: 46px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.webhook-alert {
|
||||
margin: 16px 0;
|
||||
margin: var(--ba-main-space) 0;
|
||||
border: 1px solid rgba(183, 121, 31, 0.24);
|
||||
p {
|
||||
margin: 6px 0 0;
|
||||
line-height: 1.5;
|
||||
@@ -883,9 +1405,10 @@ onMounted(() => {
|
||||
.filter-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding: 12px;
|
||||
border-bottom: 1px solid var(--el-border-color);
|
||||
gap: 14px;
|
||||
padding: 14px 16px;
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-soft);
|
||||
}
|
||||
.date-filter,
|
||||
.totals {
|
||||
@@ -895,10 +1418,18 @@ onMounted(() => {
|
||||
gap: 8px;
|
||||
}
|
||||
.date-filter :deep(.el-date-editor) {
|
||||
width: 145px;
|
||||
width: 150px;
|
||||
}
|
||||
.date-filter label {
|
||||
color: var(--el-text-color-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
.totals {
|
||||
justify-content: flex-end;
|
||||
color: var(--el-text-color-regular);
|
||||
b {
|
||||
font-weight: 700;
|
||||
}
|
||||
em {
|
||||
color: var(--el-color-primary);
|
||||
font-style: normal;
|
||||
@@ -913,7 +1444,9 @@ onMounted(() => {
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 12px;
|
||||
padding: 14px 16px;
|
||||
border-top: 1px solid var(--ba-border-color-soft);
|
||||
background: var(--ba-bg-color-soft);
|
||||
}
|
||||
.inline-mode {
|
||||
margin-left: 12px;
|
||||
@@ -923,7 +1456,7 @@ onMounted(() => {
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
:deep(.el-dialog__body) {
|
||||
padding-top: 12px;
|
||||
padding-top: 16px;
|
||||
}
|
||||
:deep(.el-form-item .el-select),
|
||||
:deep(.el-form-item .el-input) {
|
||||
@@ -938,11 +1471,24 @@ onMounted(() => {
|
||||
.filter-row {
|
||||
flex-direction: column;
|
||||
}
|
||||
.date-filter {
|
||||
align-items: stretch;
|
||||
label {
|
||||
width: 100%;
|
||||
}
|
||||
:deep(.el-date-editor),
|
||||
:deep(.el-button) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.totals {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.bank-table {
|
||||
min-width: 760px;
|
||||
}
|
||||
.pagination {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<div class="login">
|
||||
<div class="login-box">
|
||||
<div class="head">
|
||||
<img src="~assets/login-header.png" alt="" />
|
||||
<img src="~assets/login-header.png" alt="login" />
|
||||
</div>
|
||||
<div class="form">
|
||||
<img class="profile-avatar" :src="fullUrl('/static/images/avatar.png')" alt="" />
|
||||
<img class="profile-avatar" :src="fullUrl('/static/images/avatar.png')" alt="avatar" />
|
||||
<div class="content">
|
||||
<el-form @keyup.enter="onSubmitPre()" ref="formRef" :rules="rules" size="large" :model="form">
|
||||
<el-form-item prop="username">
|
||||
@@ -52,14 +52,7 @@
|
||||
</el-form-item>
|
||||
<el-checkbox v-model="form.keep" :label="t('login.Hold session')" size="default"></el-checkbox>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
:loading="state.submitLoading"
|
||||
class="submit-button"
|
||||
round
|
||||
type="primary"
|
||||
size="large"
|
||||
@click="onSubmitPre()"
|
||||
>
|
||||
<el-button :loading="state.submitLoading" class="submit-button" type="primary" size="large" @click="onSubmitPre()">
|
||||
{{ t('login.Sign in') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@@ -173,13 +166,26 @@ const onSubmit = (captchaInfo = '') => {
|
||||
<style scoped lang="scss">
|
||||
.switch-language {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
z-index: 1;
|
||||
top: 22px;
|
||||
right: 22px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border: 1px solid rgba(148, 163, 184, 0.28);
|
||||
border-radius: var(--ba-radius-panel);
|
||||
background: rgba(255, 255, 255, 0.76);
|
||||
box-shadow: var(--ba-shadow-card);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
.bubble {
|
||||
overflow: hidden;
|
||||
background: url(/@/assets/bg.jpg) repeat;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(238, 243, 248, 0.94), rgba(226, 232, 240, 0.9)),
|
||||
url(/@/assets/bg.jpg) repeat;
|
||||
background-blend-mode: screen;
|
||||
}
|
||||
.form-item-icon {
|
||||
height: auto;
|
||||
@@ -189,21 +195,25 @@ const onSubmit = (captchaInfo = '') => {
|
||||
top: 0;
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
min-height: 100dvh;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.login-box {
|
||||
overflow: hidden;
|
||||
width: 430px;
|
||||
width: min(430px, calc(100vw - 32px));
|
||||
padding: 0;
|
||||
background: var(--ba-bg-color-overlay);
|
||||
margin-bottom: 80px;
|
||||
margin-bottom: 64px;
|
||||
border: 1px solid rgba(216, 224, 234, 0.8);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 26px 72px rgba(15, 23, 42, 0.18);
|
||||
}
|
||||
.head {
|
||||
background: #ccccff;
|
||||
background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.02)), var(--ba-bg-color-soft);
|
||||
border-bottom: 1px solid var(--ba-border-color-soft);
|
||||
img {
|
||||
display: block;
|
||||
width: 430px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
user-select: none;
|
||||
}
|
||||
@@ -213,22 +223,27 @@ const onSubmit = (captchaInfo = '') => {
|
||||
.profile-avatar {
|
||||
display: block;
|
||||
position: absolute;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
border-radius: 50%;
|
||||
border: 4px solid var(--ba-bg-color-overlay);
|
||||
top: -50px;
|
||||
right: calc(50% - 50px);
|
||||
height: 92px;
|
||||
width: 92px;
|
||||
border-radius: 18px;
|
||||
border: 5px solid var(--ba-bg-color-overlay);
|
||||
top: -46px;
|
||||
right: calc(50% - 46px);
|
||||
z-index: 2;
|
||||
user-select: none;
|
||||
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
|
||||
}
|
||||
.content {
|
||||
padding: 100px 40px 40px 40px;
|
||||
padding: 92px 40px 40px 40px;
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
.submit-button {
|
||||
width: 100%;
|
||||
letter-spacing: 2px;
|
||||
font-weight: 300;
|
||||
min-height: 44px;
|
||||
letter-spacing: 0;
|
||||
font-weight: 700;
|
||||
margin-top: 15px;
|
||||
--el-button-bg-color: var(--el-color-primary);
|
||||
}
|
||||
@@ -241,9 +256,17 @@ const onSubmit = (captchaInfo = '') => {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.login-box {
|
||||
width: 340px;
|
||||
width: calc(100vw - 28px);
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.form .content {
|
||||
padding: 86px 24px 28px 24px;
|
||||
}
|
||||
}
|
||||
.switch-language {
|
||||
top: 14px;
|
||||
right: 14px;
|
||||
}
|
||||
}
|
||||
.chang-lang :deep(.el-dropdown-menu__item) {
|
||||
@@ -257,15 +280,24 @@ const onSubmit = (captchaInfo = '') => {
|
||||
// 暗黑样式
|
||||
@at-root .dark {
|
||||
.bubble {
|
||||
background: url(/@/assets/bg-dark.jpg) repeat;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(16, 23, 34, 0.92), rgba(24, 33, 49, 0.88)),
|
||||
url(/@/assets/bg-dark.jpg) repeat;
|
||||
background-blend-mode: multiply;
|
||||
}
|
||||
.switch-language {
|
||||
background: rgba(24, 33, 49, 0.76);
|
||||
border-color: rgba(58, 74, 97, 0.85);
|
||||
}
|
||||
.login {
|
||||
.login-box {
|
||||
background: #161b22;
|
||||
background: #182131;
|
||||
border-color: rgba(58, 74, 97, 0.86);
|
||||
}
|
||||
.head {
|
||||
background: linear-gradient(135deg, rgba(91, 134, 240, 0.14), rgba(13, 20, 32, 0.18)), #111c2a;
|
||||
img {
|
||||
filter: brightness(61%);
|
||||
filter: brightness(72%);
|
||||
}
|
||||
}
|
||||
.form {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="default-main customer-report">
|
||||
<section class="report-filter">
|
||||
<header>{{ t('user.moneyLog.customerReport.title') }}</header>
|
||||
<div class="filter-content">
|
||||
<div class="default-main admin-report-page customer-report">
|
||||
<section class="admin-report-filter report-filter">
|
||||
<header class="admin-report-heading">{{ t('user.moneyLog.customerReport.title') }}</header>
|
||||
<div class="admin-report-filter-content filter-content">
|
||||
<div class="filter-item">
|
||||
<label>{{ t('user.moneyLog.customerReport.startDate') }}:</label>
|
||||
<el-date-picker v-model="filters.start" type="date" value-format="YYYY-MM-DD" clearable />
|
||||
@@ -17,26 +17,22 @@
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>{{ t('user.moneyLog.customerReport.loseRebate') }}:</label>
|
||||
<el-input
|
||||
v-model="filters.loseRebate"
|
||||
:placeholder="t('user.moneyLog.customerReport.rebatePlaceholder')"
|
||||
clearable
|
||||
/>
|
||||
<el-input v-model="filters.loseRebate" :placeholder="t('user.moneyLog.customerReport.rebatePlaceholder')" clearable />
|
||||
</div>
|
||||
<div class="filter-actions">
|
||||
<div class="admin-report-actions filter-actions">
|
||||
<el-button type="primary" @click="search">{{ t('user.moneyLog.customerReport.search') }}</el-button>
|
||||
<el-button @click="clear">{{ t('user.moneyLog.customerReport.clear') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="date-summary">
|
||||
<div class="admin-report-summary date-summary">
|
||||
<strong>{{ t('user.moneyLog.customerReport.dateOfData') }}:</strong>
|
||||
{{ dateSummary }}
|
||||
</div>
|
||||
|
||||
<div v-loading="loading" class="report-table-wrap">
|
||||
<table class="report-table" :style="{ minWidth: `${tableMinWidth}px` }">
|
||||
<div v-loading="loading" class="admin-report-table-wrap report-table-wrap">
|
||||
<table class="admin-report-table report-table" :style="{ minWidth: `${tableMinWidth}px` }">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" class="date-column">{{ t('user.moneyLog.customerReport.registerDate') }} ↓</th>
|
||||
@@ -83,7 +79,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="table-footer">
|
||||
<div class="admin-report-footer table-footer">
|
||||
<div>{{ t('user.moneyLog.customerReport.totalRecords', { total }) }}</div>
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
@@ -94,7 +90,7 @@
|
||||
:page-count="lastPage"
|
||||
@current-change="loadReport"
|
||||
/>
|
||||
<div class="page-size">
|
||||
<div class="admin-report-page-size page-size">
|
||||
<span>{{ t('user.moneyLog.customerReport.show') }}</span>
|
||||
<el-select v-model="pageSize" @change="changePageSize">
|
||||
<el-option v-for="size in pageSizes" :key="size" :label="size" :value="size" />
|
||||
@@ -269,48 +265,20 @@ onMounted(loadReport)
|
||||
|
||||
<style scoped lang="scss">
|
||||
.customer-report {
|
||||
--report-dark: #333;
|
||||
--report-border: #d8d8d8;
|
||||
--report-reward: #e5e5e5;
|
||||
--report-surface: var(--el-bg-color);
|
||||
padding: 20px;
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.report-filter {
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid var(--report-border);
|
||||
background: var(--report-surface);
|
||||
|
||||
header {
|
||||
min-height: 37px;
|
||||
padding: 9px 8px;
|
||||
background: var(--report-dark);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
padding: var(--ba-main-space);
|
||||
}
|
||||
|
||||
.filter-content {
|
||||
display: grid;
|
||||
grid-template-columns: 335px 335px;
|
||||
gap: 6px 18px;
|
||||
min-height: 120px;
|
||||
padding: 13px 20px;
|
||||
grid-template-columns: repeat(2, minmax(280px, 350px));
|
||||
gap: 12px 18px;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
label {
|
||||
width: 115px;
|
||||
width: 118px;
|
||||
flex-shrink: 0;
|
||||
font-weight: 700;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:deep(.el-date-editor),
|
||||
@@ -321,53 +289,11 @@ onMounted(loadReport)
|
||||
|
||||
.filter-actions {
|
||||
grid-column: 2;
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
|
||||
.el-button {
|
||||
width: 160px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.date-summary {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.report-table-wrap {
|
||||
overflow-x: auto;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.report-table {
|
||||
width: 100%;
|
||||
min-width: 2500px;
|
||||
border-collapse: collapse;
|
||||
|
||||
th,
|
||||
td {
|
||||
height: 38px;
|
||||
padding: 8px;
|
||||
border: 1px solid var(--report-border);
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
thead th {
|
||||
border-color: #eee;
|
||||
background: var(--report-dark);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
vertical-align: middle;
|
||||
|
||||
small {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
tbody td {
|
||||
background: var(--report-surface);
|
||||
}
|
||||
|
||||
.date-column {
|
||||
width: 225px;
|
||||
@@ -381,10 +307,6 @@ onMounted(loadReport)
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
.reward-cell {
|
||||
background: var(--report-reward);
|
||||
}
|
||||
|
||||
.username-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -392,55 +314,19 @@ onMounted(loadReport)
|
||||
}
|
||||
|
||||
.user-icon {
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.deposit-value,
|
||||
.positive-value {
|
||||
color: #35ad78;
|
||||
}
|
||||
|
||||
.withdraw-value,
|
||||
.negative-value {
|
||||
color: #e05a55;
|
||||
}
|
||||
|
||||
.empty-row {
|
||||
height: 150px;
|
||||
color: var(--el-text-color-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.table-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.page-size {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
.el-select {
|
||||
width: 90px;
|
||||
}
|
||||
}
|
||||
|
||||
@at-root html.dark {
|
||||
.customer-report {
|
||||
--report-dark: #2b2b2b;
|
||||
--report-border: var(--el-border-color);
|
||||
--report-reward: #333;
|
||||
:deep(.el-pagination) {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.customer-report {
|
||||
padding: 14px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.filter-content {
|
||||
@@ -449,8 +335,7 @@ onMounted(loadReport)
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
|
||||
label {
|
||||
width: auto;
|
||||
@@ -459,6 +344,7 @@ onMounted(loadReport)
|
||||
}
|
||||
|
||||
.filter-actions {
|
||||
grid-column: auto;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,15 @@
|
||||
<template>
|
||||
<div class="default-main daily-report">
|
||||
<section class="report-filter">
|
||||
<header>{{ t('user.moneyLog.dailyReport.title') }}</header>
|
||||
<div class="filter-content">
|
||||
<div class="default-main admin-report-page daily-report">
|
||||
<section class="admin-report-filter report-filter">
|
||||
<header class="admin-report-heading">{{ t('user.moneyLog.dailyReport.title') }}</header>
|
||||
<div class="admin-report-filter-content filter-content">
|
||||
<div class="date-fields">
|
||||
<label>{{ t('user.moneyLog.dailyReport.startDate') }}:</label>
|
||||
<el-date-picker
|
||||
v-model="filters.start"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
:clearable="false"
|
||||
@change="loadReport"
|
||||
/>
|
||||
<el-date-picker v-model="filters.start" type="date" value-format="YYYY-MM-DD" :clearable="false" @change="loadReport" />
|
||||
<label>{{ t('user.moneyLog.dailyReport.endDate') }}:</label>
|
||||
<el-date-picker
|
||||
v-model="filters.end"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
:clearable="false"
|
||||
@change="loadReport"
|
||||
/>
|
||||
<el-date-picker v-model="filters.end" type="date" value-format="YYYY-MM-DD" :clearable="false" @change="loadReport" />
|
||||
</div>
|
||||
<div class="period-tabs">
|
||||
<div class="admin-report-tabs period-tabs">
|
||||
<button
|
||||
v-for="period in periods"
|
||||
:key="period.value"
|
||||
@@ -35,8 +23,8 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div v-loading="loading" class="report-table-wrap">
|
||||
<table class="report-table" :style="{ minWidth: `${tableMinWidth}px` }">
|
||||
<div v-loading="loading" class="admin-report-table-wrap report-table-wrap">
|
||||
<table class="admin-report-table report-table" :style="{ minWidth: `${tableMinWidth}px` }">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" class="date-column">{{ t('user.moneyLog.dailyReport.date') }}</th>
|
||||
@@ -233,117 +221,33 @@ onMounted(loadReport)
|
||||
|
||||
<style scoped lang="scss">
|
||||
.daily-report {
|
||||
--report-dark: #333;
|
||||
--report-border: #ddd;
|
||||
--report-strong-border: #999;
|
||||
--report-muted: #ddd;
|
||||
--report-surface: var(--el-bg-color);
|
||||
padding: 20px;
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.report-filter {
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid var(--report-border);
|
||||
background: var(--report-surface);
|
||||
|
||||
header {
|
||||
min-height: 37px;
|
||||
padding: 9px 8px;
|
||||
background: var(--report-dark);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
padding: var(--ba-main-space);
|
||||
}
|
||||
|
||||
.filter-content {
|
||||
min-height: 92px;
|
||||
padding: 13px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.date-fields {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 5px;
|
||||
|
||||
label {
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:deep(.el-date-editor) {
|
||||
width: 200px;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.period-tabs {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
overflow: hidden;
|
||||
border: 1px solid #999;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 0;
|
||||
box-shadow: none;
|
||||
|
||||
button {
|
||||
width: 100px;
|
||||
height: 32px;
|
||||
border: 0;
|
||||
border-right: 1px solid #999;
|
||||
background: var(--el-fill-color-light);
|
||||
color: var(--el-text-color-primary);
|
||||
cursor: pointer;
|
||||
|
||||
&:last-child {
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--el-fill-color);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #bbb;
|
||||
color: #000;
|
||||
}
|
||||
min-width: 96px;
|
||||
}
|
||||
}
|
||||
|
||||
.report-table-wrap {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.report-table {
|
||||
width: 100%;
|
||||
min-width: 2516px;
|
||||
border-collapse: collapse;
|
||||
|
||||
th,
|
||||
td {
|
||||
height: 38px;
|
||||
padding: 8px;
|
||||
border: 1px solid var(--report-border);
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
thead {
|
||||
background: var(--report-dark);
|
||||
color: #fff;
|
||||
|
||||
th {
|
||||
border-color: #eee;
|
||||
background: var(--report-dark);
|
||||
font-weight: 700;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
tbody td {
|
||||
background: var(--report-surface);
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.date-column,
|
||||
.date-cell {
|
||||
@@ -352,9 +256,7 @@ onMounted(loadReport)
|
||||
|
||||
.date-cell,
|
||||
.reward-cell {
|
||||
border-color: var(--report-strong-border);
|
||||
background: var(--report-muted);
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.single-column {
|
||||
@@ -372,56 +274,15 @@ onMounted(loadReport)
|
||||
.reward-heading {
|
||||
min-width: 230px;
|
||||
}
|
||||
|
||||
.deposit-value,
|
||||
.positive-value {
|
||||
color: #3cb371;
|
||||
}
|
||||
|
||||
.withdraw-value,
|
||||
.negative-value {
|
||||
color: #ff5349;
|
||||
}
|
||||
|
||||
.unclaim-value {
|
||||
color: #9457c5;
|
||||
}
|
||||
|
||||
.empty-row {
|
||||
height: 150px;
|
||||
background: var(--report-surface);
|
||||
color: var(--el-text-color-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
@at-root html.dark {
|
||||
.daily-report {
|
||||
--report-dark: #2b2b2b;
|
||||
--report-border: var(--el-border-color);
|
||||
--report-strong-border: #606266;
|
||||
--report-muted: #333;
|
||||
}
|
||||
|
||||
.period-tabs button.active {
|
||||
background: #555;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.report-table .date-cell,
|
||||
.report-table .reward-cell {
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.daily-report {
|
||||
padding: 14px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.date-fields {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="default-main submitted-rewards">
|
||||
<nav class="reward-tabs" :aria-label="t('user.submittedReward.Promotion type')">
|
||||
<div class="default-main admin-report-page submitted-rewards">
|
||||
<nav class="admin-report-tabs reward-tabs" :aria-label="t('user.submittedReward.Promotion type')">
|
||||
<button
|
||||
v-for="tab in promotionTabs"
|
||||
:key="tab.value"
|
||||
@@ -12,13 +12,13 @@
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<section class="reward-panel">
|
||||
<header class="panel-heading">
|
||||
<section class="admin-report-filter reward-panel">
|
||||
<header class="admin-report-heading panel-heading">
|
||||
<span>{{ t('user.submittedReward.Submitted Rewards') }} ({{ activePromotionLabel }})</span>
|
||||
<strong>{{ t('user.submittedReward.Running') }}</strong>
|
||||
</header>
|
||||
|
||||
<div class="filter-panel">
|
||||
<div class="admin-report-filter-content filter-panel">
|
||||
<div class="filter-item">
|
||||
<label>{{ t('user.submittedReward.Start Date') }}:</label>
|
||||
<el-date-picker v-model="filters.start" type="date" value-format="YYYY-MM-DD" :clearable="false" />
|
||||
@@ -45,20 +45,20 @@
|
||||
@keyup.enter="search"
|
||||
/>
|
||||
</div>
|
||||
<div class="filter-actions">
|
||||
<el-button @click="search">{{ t('Search') }}</el-button>
|
||||
<div class="admin-report-actions filter-actions">
|
||||
<el-button type="primary" @click="search">{{ t('Search') }}</el-button>
|
||||
<el-button @click="clearFilters">{{ t('user.submittedReward.Clear') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="date-summary">
|
||||
<div class="admin-report-summary date-summary">
|
||||
<strong>{{ t('user.submittedReward.Date of data') }}:</strong>
|
||||
{{ dateRangeText }}
|
||||
</div>
|
||||
|
||||
<div v-loading="loading" class="reward-table-wrap">
|
||||
<table class="reward-table">
|
||||
<div v-loading="loading" class="admin-report-table-wrap reward-table-wrap">
|
||||
<table class="admin-report-table reward-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="submitted-time">{{ t('user.submittedReward.Submitted Time') }}</th>
|
||||
@@ -76,20 +76,10 @@
|
||||
<td>{{ row.status }}</td>
|
||||
<td>
|
||||
<div v-if="row.statusCode === 0" class="action-buttons">
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
:loading="actionLoadingId === row.id"
|
||||
@click="confirmReward(row, 1)"
|
||||
>
|
||||
<el-button type="success" size="small" :loading="actionLoadingId === row.id" @click="confirmReward(row, 1)">
|
||||
{{ t('user.submittedReward.Agree') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
:loading="actionLoadingId === row.id"
|
||||
@click="confirmReward(row, 2)"
|
||||
>
|
||||
<el-button type="danger" size="small" :loading="actionLoadingId === row.id" @click="confirmReward(row, 2)">
|
||||
{{ t('user.submittedReward.Reject') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -102,7 +92,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="table-footer">
|
||||
<div class="admin-report-footer table-footer">
|
||||
<span>{{ t('user.submittedReward.Total records', { total: pagination.total }) }}</span>
|
||||
<el-pagination
|
||||
v-if="pagination.total > 0"
|
||||
@@ -295,87 +285,38 @@ onMounted(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.submitted-rewards {
|
||||
--reward-dark: #333;
|
||||
--reward-border: #ddd;
|
||||
--reward-approved: #dcfbc9;
|
||||
padding: 20px;
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 14px;
|
||||
padding: var(--ba-main-space);
|
||||
}
|
||||
|
||||
.reward-tabs {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
margin-bottom: 20px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #999;
|
||||
border-radius: 4px;
|
||||
|
||||
button {
|
||||
min-width: 136px;
|
||||
height: 31px;
|
||||
padding: 5px 30px;
|
||||
border: 0;
|
||||
border-right: 1px solid #999;
|
||||
background: var(--el-fill-color-light);
|
||||
color: var(--el-text-color-primary);
|
||||
cursor: pointer;
|
||||
|
||||
&:last-child {
|
||||
min-width: 99px;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--el-fill-color);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #bbb;
|
||||
color: #000;
|
||||
min-width: 112px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward-panel {
|
||||
border: 1px solid var(--reward-border);
|
||||
}
|
||||
|
||||
.panel-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
min-height: 40px;
|
||||
padding: 10px;
|
||||
background: var(--reward-dark);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
justify-content: flex-start;
|
||||
|
||||
strong {
|
||||
color: #57e31a;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.filter-panel {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px 28px;
|
||||
min-height: 88px;
|
||||
padding: 14px 40px;
|
||||
background: var(--el-bg-color);
|
||||
flex-wrap: wrap;
|
||||
gap: 12px 24px;
|
||||
}
|
||||
|
||||
.filter-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
label {
|
||||
min-width: 76px;
|
||||
text-align: right;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:deep(.el-date-editor),
|
||||
@@ -386,48 +327,13 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.filter-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
|
||||
.el-button {
|
||||
width: 100px;
|
||||
margin: 0;
|
||||
min-width: 92px;
|
||||
}
|
||||
}
|
||||
|
||||
.date-summary {
|
||||
margin: 20px 0 8px;
|
||||
}
|
||||
|
||||
.reward-table-wrap {
|
||||
min-height: 120px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.reward-table {
|
||||
width: 100%;
|
||||
min-width: 850px;
|
||||
border-collapse: collapse;
|
||||
|
||||
th,
|
||||
td {
|
||||
height: 37px;
|
||||
padding: 8px;
|
||||
border: 1px solid var(--reward-border);
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th {
|
||||
background: var(--reward-dark);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
tbody tr {
|
||||
background: var(--reward-approved);
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.submitted-time {
|
||||
width: 150px;
|
||||
@@ -444,13 +350,6 @@ onMounted(() => {
|
||||
.action {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.empty-row {
|
||||
height: 90px;
|
||||
background: var(--el-bg-color);
|
||||
color: var(--el-text-color-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
@@ -462,34 +361,9 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.table-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
@at-root html.dark {
|
||||
.submitted-rewards {
|
||||
--reward-dark: #2b2b2b;
|
||||
--reward-border: var(--el-border-color);
|
||||
--reward-approved: #29482b;
|
||||
}
|
||||
|
||||
.reward-tabs button.active {
|
||||
background: #555;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.reward-table tbody tr {
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.submitted-rewards {
|
||||
padding: 14px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.reward-tabs {
|
||||
@@ -502,7 +376,8 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.filter-panel {
|
||||
padding: 14px;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user