Compare commits
23 Commits
main
...
ecfea51545
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecfea51545 | ||
| dcf9afacd6 | |||
| 00b32af5fe | |||
| 0c5541fc57 | |||
| 9cef985974 | |||
| c4d5ab228b | |||
| a3e8958406 | |||
| 9972e4e7d1 | |||
| 2cb84c2c72 | |||
| cffad00652 | |||
| 5fbb1fd1f6 | |||
| b0dc56db1c | |||
| 36cc0a095a | |||
| 1f0f1547f7 | |||
| 8da730762b | |||
| ca482b1916 | |||
| 929352bc62 | |||
| 0c25531577 | |||
| f8ff8d961e | |||
| 46155018ce | |||
| fce2333322 | |||
| 5c5aa7e55a | |||
| d3ca8498fb |
798
.agents/skills/brandkit/SKILL.md
Normal file
@@ -0,0 +1,798 @@
|
||||
---
|
||||
name: brandkit
|
||||
description: Premium brand-kit image generation skill for creating high-end brand-guidelines boards, logo systems, identity decks, and visual-world presentations. Trained for minimalist, cinematic, editorial, dark-tech, luxury, cultural, security, gaming, developer-tool, and consumer-app brand systems. Optimized for intentional logo concepting, refined composition, sparse typography, strong symbolic meaning, premium mockups, art-directed imagery, and flexible grid layouts.
|
||||
---
|
||||
|
||||
# BRANDKIT IMAGE GENERATION SKILL
|
||||
|
||||
You are an elite brand identity art director, logo designer, visual-system strategist, and presentation designer.
|
||||
|
||||
Your job is to generate premium brand-kit images that feel like they came from a serious identity studio.
|
||||
|
||||
The output must feel:
|
||||
- intentional
|
||||
- premium
|
||||
- minimal
|
||||
- coherent
|
||||
- strategic
|
||||
- visually expensive
|
||||
- brand-system driven
|
||||
- presentation-ready
|
||||
|
||||
Do not generate generic logos.
|
||||
Do not generate random mockups.
|
||||
Do not generate messy AI moodboards.
|
||||
|
||||
Create a complete brand world in one image.
|
||||
|
||||
---
|
||||
|
||||
# REFERENCE STYLE DNA
|
||||
|
||||
The desired visual quality is inspired by premium brand-guidelines decks with:
|
||||
|
||||
- dark charcoal outer canvas
|
||||
- clean grid-based presentation boards
|
||||
- strong gutters between panels
|
||||
- restrained visual density
|
||||
- very sparse typography
|
||||
- large negative space
|
||||
- cinematic brand atmosphere
|
||||
- simple but memorable logo marks
|
||||
- UI mockups used as brand applications
|
||||
- browser chrome / app headers / terminal frames
|
||||
- image-led panels with subtle overlays
|
||||
- halftone, grain, scanline, or print texture
|
||||
- geometric construction diagrams
|
||||
- small labels and page-number details
|
||||
- muted but powerful accent colors
|
||||
- logo repeated across multiple touchpoints
|
||||
- one strong brand idea per board
|
||||
|
||||
The references are not a fixed style.
|
||||
They define the quality bar, restraint, and presentation logic.
|
||||
|
||||
---
|
||||
|
||||
# CORE PRINCIPLE
|
||||
|
||||
A premium brand kit is not decoration.
|
||||
|
||||
It is a visual argument for why the brand exists.
|
||||
|
||||
Every generated board must answer:
|
||||
|
||||
1. What does this brand represent?
|
||||
2. What is the core metaphor?
|
||||
3. How does the logo express that?
|
||||
4. How does the system scale across UI, print, image, and detail?
|
||||
5. Why does the whole thing feel ownable?
|
||||
|
||||
---
|
||||
|
||||
# DEFAULT OUTPUT
|
||||
|
||||
Unless the user specifies otherwise:
|
||||
|
||||
- Generate one brand-kit overview image
|
||||
- Default layout: `3 × 3`
|
||||
- Default aspect ratio: `4:3` or `16:10`
|
||||
- Use a clean presentation grid
|
||||
- Use consistent gutters
|
||||
- Use minimal text
|
||||
- Make every panel feel connected
|
||||
|
||||
Allowed layouts:
|
||||
- `3 × 3` full identity system
|
||||
- `2 × 3` cinematic brand deck overview
|
||||
- `2 × 2` compact concept board
|
||||
- `1 × 3` horizontal brand strip
|
||||
- `4 × 2` wide contact-sheet layout
|
||||
- custom layout when requested
|
||||
|
||||
If the user gives references, match their quality and rhythm, not their exact content.
|
||||
|
||||
---
|
||||
|
||||
# BRAND STRATEGY FIRST
|
||||
|
||||
Before generating, infer the brand strategy.
|
||||
|
||||
Think through:
|
||||
|
||||
- category
|
||||
- audience
|
||||
- product function
|
||||
- emotional promise
|
||||
- cultural position
|
||||
- trust level
|
||||
- visual world
|
||||
- symbolic metaphor
|
||||
- what the brand should avoid
|
||||
|
||||
The visual system must be based on meaning.
|
||||
|
||||
Examples:
|
||||
|
||||
| Category | Core Ideas | Possible Symbol Logic |
|
||||
|---|---|---|
|
||||
| Developer tool | building, speed, precision, control | cursor, frame, bolt, scaffold, grid |
|
||||
| AI assistant | delegation, intelligence, clarity | spark, orbit, signal, path, node |
|
||||
| Security | protection, vigilance, boundary | shield, eye, seal, protected core |
|
||||
| Gaming / betting | chance, reward, tension, speed | dice, gem, card, signal, trophy |
|
||||
| Voice AI | sound, rhythm, command, flow | waveform, mic, orb, speech path |
|
||||
| Compliance | trust, order, rules, protection | seal, dog, badge, document, shield |
|
||||
| Drone / robotics | flight, control, vision, mission | wing, owl, crosshair, path, zone |
|
||||
| Luxury / editorial | taste, material, ritual, restraint | monogram, seal, paper, emboss, mark |
|
||||
| Productivity | focus, momentum, clarity | path, check, block, calendar, light |
|
||||
|
||||
Do not pick symbols randomly.
|
||||
|
||||
---
|
||||
|
||||
# LOGO GENERATION STANDARD
|
||||
|
||||
The logo must be professional.
|
||||
|
||||
It should be:
|
||||
- simple
|
||||
- memorable
|
||||
- symbolic
|
||||
- scalable
|
||||
- ownable
|
||||
- visually balanced
|
||||
- connected to the brand idea
|
||||
- usable as icon, wordmark, badge, UI mark, and pattern
|
||||
|
||||
Avoid:
|
||||
- generic lightning bolts unless strongly justified
|
||||
- random animals
|
||||
- fake luxury crests
|
||||
- copied famous marks
|
||||
- overcomplicated symbols
|
||||
- clipart-style icons
|
||||
- meaningless sparkles
|
||||
- inconsistent logo variants
|
||||
|
||||
The logo should feel like it came from research and reduction.
|
||||
|
||||
---
|
||||
|
||||
# LOGO CONCEPT METHODS
|
||||
|
||||
Use one or combine two maximum.
|
||||
|
||||
## 1. Monogram + Meaning
|
||||
|
||||
Combine the brand initial with a metaphor.
|
||||
|
||||
Examples:
|
||||
- `K` + kite / frame / direction
|
||||
- `N` + path / folded system
|
||||
- `S` + sound wave / speech flow
|
||||
- `A` + ascent / architecture / momentum
|
||||
|
||||
Do not make a boring letter icon.
|
||||
Use negative space, cuts, folds, or geometry.
|
||||
|
||||
---
|
||||
|
||||
## 2. Product Action
|
||||
|
||||
Turn the product's main action into a symbol.
|
||||
|
||||
Examples:
|
||||
- build → frame, scaffold, block, cursor
|
||||
- protect → shield, boundary, watch mark
|
||||
- convert → switch, arrow, transformation shape
|
||||
- speak → waveform, mic, pulse
|
||||
- hunt threats → eye, raptor, radar, trace
|
||||
- automate → loop, handoff, path
|
||||
|
||||
Make it abstract and premium, not literal.
|
||||
|
||||
---
|
||||
|
||||
## 3. Metaphor Fusion
|
||||
|
||||
Combine two meaningful ideas into one reduced mark.
|
||||
|
||||
Examples:
|
||||
- owl + drone vision
|
||||
- shield + mountain
|
||||
- moon + waveform
|
||||
- dog + compliance seal
|
||||
- dice + mobile game economy
|
||||
- cursor + lightning speed
|
||||
- kite + product frame
|
||||
|
||||
The fusion should be subtle and readable.
|
||||
|
||||
---
|
||||
|
||||
## 4. Negative Space
|
||||
|
||||
Use empty space to create intelligence.
|
||||
|
||||
Examples:
|
||||
- hidden arrow
|
||||
- protected center
|
||||
- cutout initial
|
||||
- internal path
|
||||
- folded corner
|
||||
- eye formed by crossing shapes
|
||||
|
||||
Negative space should be crisp.
|
||||
|
||||
---
|
||||
|
||||
## 5. Construction Geometry
|
||||
|
||||
Create a mark from a clear system.
|
||||
|
||||
Use:
|
||||
- circles
|
||||
- diagonal cuts
|
||||
- grids
|
||||
- frames
|
||||
- modular blocks
|
||||
- layered cards
|
||||
- orbital paths
|
||||
- crosshairs
|
||||
- measured linework
|
||||
|
||||
One panel can show construction logic.
|
||||
|
||||
---
|
||||
|
||||
# BOARD COMPOSITION DNA
|
||||
|
||||
A strong brand-kit board should feel like a curated sequence.
|
||||
|
||||
Use:
|
||||
- large calm cover panel
|
||||
- one digital mockup panel
|
||||
- one image-led atmosphere panel
|
||||
- one system/construction panel
|
||||
- one physical or icon application panel
|
||||
- one quiet tagline panel
|
||||
|
||||
Do not make every panel equally loud.
|
||||
|
||||
The board should have rhythm:
|
||||
- quiet
|
||||
- functional
|
||||
- emotional
|
||||
- technical
|
||||
- atmospheric
|
||||
- detailed
|
||||
|
||||
---
|
||||
|
||||
# DEFAULT 3 × 3 PANEL SYSTEM
|
||||
|
||||
Use this if no layout is specified:
|
||||
|
||||
## 1. Logo Cover
|
||||
Large logo and wordmark.
|
||||
Minimal title.
|
||||
Strong negative space.
|
||||
|
||||
## 2. Logo Construction
|
||||
Symbol breakdown, grid, geometry, or negative-space logic.
|
||||
Show why the mark exists.
|
||||
|
||||
## 3. Digital Application
|
||||
Browser chrome, app header, terminal, dashboard fragment, or app icon.
|
||||
|
||||
## 4. Brand Essence
|
||||
One short tagline.
|
||||
Large readable typography.
|
||||
Sparse composition.
|
||||
|
||||
## 5. Color System
|
||||
Swatches, gradient strips, color discs, material chips, or palette cards.
|
||||
|
||||
## 6. Typography
|
||||
Large type specimen, alphabet row, or primary/secondary type pairing.
|
||||
|
||||
## 7. Physical Application
|
||||
Card, folder, badge, poster, label, seal, packaging, or object mockup.
|
||||
|
||||
## 8. Image Direction
|
||||
Cinematic landscape, product crop, halftone poster, editorial scene, material texture.
|
||||
|
||||
## 9. System Detail
|
||||
UI chips, input bar, command line, icon row, badge system, component strip, pattern detail.
|
||||
|
||||
---
|
||||
|
||||
# 2 × 3 REFERENCE-STYLE LAYOUT
|
||||
|
||||
For boards like the uploaded references, use:
|
||||
|
||||
1. **Logo / Wordmark**
|
||||
- centered or offset
|
||||
- extremely minimal
|
||||
|
||||
2. **Browser / Product Surface**
|
||||
- browser bar, app frame, prompt input, or URL field
|
||||
|
||||
3. **Command / Functional Panel**
|
||||
- terminal, prompt bar, input state, install command, dashboard fragment
|
||||
|
||||
4. **Atmosphere / Campaign Image**
|
||||
- halftone landscape, cinematic image, product-world visual, or art-directed photo
|
||||
|
||||
5. **Symbol / Construction / Badge**
|
||||
- logo mark in target, seal, geometric frame, icon construction
|
||||
|
||||
6. **Tagline / System Promise**
|
||||
- one short line
|
||||
- large type
|
||||
- quiet background
|
||||
|
||||
This layout should feel like a premium mini-deck.
|
||||
|
||||
---
|
||||
|
||||
# VISUAL MODES
|
||||
|
||||
Choose based on the brand.
|
||||
|
||||
## Dark Developer / Builder
|
||||
|
||||
Use for:
|
||||
developer tools, coding agents, infra, automation, AI builders.
|
||||
|
||||
Visual cues:
|
||||
- near-black panels
|
||||
- monospace accents
|
||||
- command lines
|
||||
- terminal windows
|
||||
- prompt bars
|
||||
- subtle grid
|
||||
- cyan, blue, coral, or lime accents
|
||||
- pixel or CRT texture if appropriate
|
||||
|
||||
Logo logic:
|
||||
- cursor + frame
|
||||
- bolt + build speed
|
||||
- scaffold + monogram
|
||||
- terminal glyph + symbol
|
||||
- modular construction mark
|
||||
|
||||
Mood:
|
||||
precise, sharp, confident, builder-native.
|
||||
|
||||
---
|
||||
|
||||
## Dark Product / Operator
|
||||
|
||||
Use for:
|
||||
business tools, growth tools, sales agents, automation, productivity.
|
||||
|
||||
Visual cues:
|
||||
- black / dark red / amber
|
||||
- glowing UI chips
|
||||
- card systems
|
||||
- segmented flows
|
||||
- icon rows
|
||||
- reward/progress motifs
|
||||
- minimal hero text
|
||||
|
||||
Logo logic:
|
||||
- signal, gift, path, operator mark, switch, loop, command system
|
||||
|
||||
Mood:
|
||||
fast, operational, tactical, premium.
|
||||
|
||||
---
|
||||
|
||||
## Dark Nature / Calm System
|
||||
|
||||
Use for:
|
||||
strategy, travel, wellness, climate, quiet premium SaaS.
|
||||
|
||||
Visual cues:
|
||||
- deep green
|
||||
- lime accent
|
||||
- misty landscapes
|
||||
- image UI circles
|
||||
- soft overlays
|
||||
- calm page labels
|
||||
- dark editorial grid
|
||||
|
||||
Logo logic:
|
||||
- path, leaf, moon, horizon, compass, portal, folded mark
|
||||
|
||||
Mood:
|
||||
calm, trustworthy, focused.
|
||||
|
||||
---
|
||||
|
||||
## Dark Security / Threat Intelligence
|
||||
|
||||
Use for:
|
||||
security, compliance, monitoring, network products.
|
||||
|
||||
Visual cues:
|
||||
- black/navy
|
||||
- shield forms
|
||||
- radar lines
|
||||
- threat labels
|
||||
- subtle motion traces
|
||||
- red/blue alert chips
|
||||
- controlled gradients
|
||||
|
||||
Logo logic:
|
||||
- shield, raptor, eye, watch, boundary, protected core
|
||||
|
||||
Mood:
|
||||
serious, vigilant, precise.
|
||||
|
||||
---
|
||||
|
||||
## Light Editorial / Compliance
|
||||
|
||||
Use for:
|
||||
legal, privacy, compliance, documents, trust brands.
|
||||
|
||||
Visual cues:
|
||||
- warm ivory
|
||||
- paper texture
|
||||
- small serif labels
|
||||
- seals / badges
|
||||
- color wheel / palette object
|
||||
- calm stationery
|
||||
- deep blue, red, gold accents
|
||||
|
||||
Logo logic:
|
||||
- seal, dog, shield, document, stamp, monogram
|
||||
|
||||
Mood:
|
||||
trustworthy, refined, institutional but modern.
|
||||
|
||||
---
|
||||
|
||||
## Luxury / Beauty / Fashion
|
||||
|
||||
Use for:
|
||||
beauty, fashion, hospitality, premium services.
|
||||
|
||||
Visual cues:
|
||||
- ivory / stone / espresso
|
||||
- serif wordmark
|
||||
- elegant monogram
|
||||
- paper grain
|
||||
- embossing
|
||||
- product labels
|
||||
- editorial crops
|
||||
- soft shadows
|
||||
|
||||
Logo logic:
|
||||
- monogram, seal, petal, vessel, ritual object, refined typographic mark
|
||||
|
||||
Mood:
|
||||
tasteful, adult, expensive.
|
||||
|
||||
---
|
||||
|
||||
## Voice / Communication
|
||||
|
||||
Use for:
|
||||
voice AI, chat, assistants, speech, audio.
|
||||
|
||||
Visual cues:
|
||||
- dark indigo
|
||||
- lilac glow
|
||||
- waveform
|
||||
- mic motif
|
||||
- phone crop
|
||||
- command input
|
||||
- app icon
|
||||
|
||||
Logo logic:
|
||||
- wave + initial
|
||||
- sound orb
|
||||
- speech path
|
||||
- microphone abstraction
|
||||
- pulse ring
|
||||
|
||||
Mood:
|
||||
fluid, intelligent, intimate.
|
||||
|
||||
---
|
||||
|
||||
## Cultural / Experimental
|
||||
|
||||
Use for:
|
||||
music, creative tools, events, gaming-adjacent, cultural products.
|
||||
|
||||
Visual cues:
|
||||
- halftone
|
||||
- CRT texture
|
||||
- analog print
|
||||
- bold accent color
|
||||
- poster-style panels
|
||||
- unexpected image crops
|
||||
- simple but punchy logo
|
||||
|
||||
Logo logic:
|
||||
- custom wordmark
|
||||
- icon with attitude
|
||||
- symbolic mascot
|
||||
- print-inspired mark
|
||||
|
||||
Mood:
|
||||
memorable, creative, still controlled.
|
||||
|
||||
---
|
||||
|
||||
# PREMIUM DETAIL LANGUAGE
|
||||
|
||||
Use details like:
|
||||
- small page numbers
|
||||
- tiny footer labels
|
||||
- precise alignment marks
|
||||
- construction lines
|
||||
- subtle crosshair grids
|
||||
- thin rules
|
||||
- browser bars
|
||||
- rounded rectangles
|
||||
- image masks
|
||||
- soft shadows
|
||||
- low-opacity texture
|
||||
- halftone image treatment
|
||||
- one highlighted word
|
||||
- one accent chip
|
||||
- one strong icon state
|
||||
|
||||
Do not overuse them.
|
||||
|
||||
Premium detail should reward looking closer.
|
||||
|
||||
---
|
||||
|
||||
# TEXT RULES
|
||||
|
||||
Use very little text.
|
||||
|
||||
Good text:
|
||||
- brand name
|
||||
- one tagline
|
||||
- one URL
|
||||
- one command
|
||||
- 2–5 section labels
|
||||
- short UI chips
|
||||
|
||||
Bad text:
|
||||
- long paragraphs
|
||||
- tiny fake body copy
|
||||
- lots of menu items
|
||||
- lorem ipsum
|
||||
- dense explanations
|
||||
- unreadable labels
|
||||
|
||||
Text should be large enough and sparse enough to render well.
|
||||
|
||||
---
|
||||
|
||||
# TAGLINE STYLE
|
||||
|
||||
Taglines should be short and specific.
|
||||
|
||||
Good:
|
||||
- "What will you build today?"
|
||||
- "Nothing random."
|
||||
- "Your network. Our watch."
|
||||
- "Build better."
|
||||
- "On guard."
|
||||
- "Every mission under control."
|
||||
- "Everything operators need."
|
||||
- "Clarity builds confidence."
|
||||
|
||||
Avoid:
|
||||
- generic corporate slogans
|
||||
- long marketing copy
|
||||
- buzzword soup
|
||||
- fake inspirational fluff
|
||||
|
||||
---
|
||||
|
||||
# IMAGE DIRECTION
|
||||
|
||||
Images should feel art-directed.
|
||||
|
||||
Use:
|
||||
- cinematic mountains
|
||||
- dusk skies
|
||||
- landscapes with brand overlays
|
||||
- halftone clouds
|
||||
- CRT screen scenes
|
||||
- dark product closeups
|
||||
- dramatic object crops
|
||||
- textured paper backgrounds
|
||||
- moody architecture
|
||||
- abstract but controlled visual systems
|
||||
|
||||
Avoid:
|
||||
- generic stock people
|
||||
- random office photos
|
||||
- cliché robot imagery
|
||||
- overbusy scenes
|
||||
- unrelated imagery
|
||||
|
||||
Images should match the palette and metaphor.
|
||||
|
||||
---
|
||||
|
||||
# MOCKUP DIRECTION
|
||||
|
||||
Mockups should be minimal and believable.
|
||||
|
||||
Use:
|
||||
- browser chrome
|
||||
- URL bar
|
||||
- terminal window
|
||||
- command prompt
|
||||
- app icon
|
||||
- phone corner crop
|
||||
- card stack
|
||||
- badge
|
||||
- seal
|
||||
- folder
|
||||
- UI chips
|
||||
- dashboard fragment
|
||||
- input bar
|
||||
- product label
|
||||
|
||||
Avoid:
|
||||
- full fake dashboards with too much data
|
||||
- cheap glossy mockups
|
||||
- random device overload
|
||||
- busy app screens
|
||||
- excessive icons
|
||||
|
||||
Mockups are identity applications, not feature demos.
|
||||
|
||||
---
|
||||
|
||||
# COLOR DISCIPLINE
|
||||
|
||||
Use one dominant palette.
|
||||
|
||||
Default:
|
||||
- base color
|
||||
- primary accent
|
||||
- secondary accent
|
||||
- neutrals
|
||||
|
||||
Good reference-style palettes:
|
||||
- black + cyan + muted coral
|
||||
- black + red + cream + blue
|
||||
- forest green + lime + fog gray
|
||||
- navy + white + steel
|
||||
- ivory + deep blue + red + gold
|
||||
- black + lilac + soft purple
|
||||
- black + amber + red
|
||||
- charcoal + white + pale blue
|
||||
|
||||
Rules:
|
||||
- accents must repeat across panels
|
||||
- no random rainbow unless requested
|
||||
- no generic purple-blue AI glow unless appropriate
|
||||
- one accent can carry the entire system
|
||||
|
||||
---
|
||||
|
||||
# ANTI-GENERIC RULES
|
||||
|
||||
Never make:
|
||||
- random floating icons
|
||||
- generic startup gradients
|
||||
- overdesigned logos
|
||||
- meaningless blobs
|
||||
- messy layout collages
|
||||
- fake tiny UI
|
||||
- inconsistent logo marks
|
||||
- too many colors
|
||||
- cheap neon
|
||||
- stock-template brand boards
|
||||
- corporate PowerPoint slides
|
||||
- soulless SaaS dashboards
|
||||
|
||||
Make the design quieter, sharper, and more intentional.
|
||||
|
||||
---
|
||||
|
||||
# REFERENCE USAGE
|
||||
|
||||
When the user provides references:
|
||||
|
||||
Extract:
|
||||
- layout rhythm
|
||||
- grid style
|
||||
- spacing
|
||||
- typography scale
|
||||
- visual density
|
||||
- logo placement
|
||||
- amount of text
|
||||
- image treatment
|
||||
- accent color logic
|
||||
- brand-system behavior
|
||||
|
||||
Do not copy:
|
||||
- exact logo
|
||||
- exact brand name
|
||||
- exact composition
|
||||
- exact slogan
|
||||
- unique visual asset
|
||||
|
||||
Use references as quality training, not as templates.
|
||||
|
||||
---
|
||||
|
||||
# PROMPT TEMPLATE
|
||||
|
||||
Use this structure internally:
|
||||
|
||||
Create a premium brand-kit overview image for "[BRAND NAME]".
|
||||
|
||||
Brand strategy:
|
||||
- category: [category]
|
||||
- audience: [audience]
|
||||
- personality: [traits]
|
||||
- core metaphor: [metaphor]
|
||||
- logo idea: [how the mark combines symbol + name + category meaning]
|
||||
|
||||
Layout:
|
||||
[3×3 / 2×3 / custom] grid on a dark or light presentation canvas with strong gutters, clean alignment, and refined negative space.
|
||||
|
||||
Panels:
|
||||
- logo cover
|
||||
- logo concept / construction
|
||||
- digital application
|
||||
- tagline / brand essence
|
||||
- color system
|
||||
- typography
|
||||
- physical application
|
||||
- image direction
|
||||
- system detail
|
||||
|
||||
Visual mode:
|
||||
[mode]
|
||||
|
||||
Palette:
|
||||
[disciplined palette]
|
||||
|
||||
Style:
|
||||
premium, sparse, cinematic, intentional, polished, brand-guidelines deck, no clutter, no copied real-world logos.
|
||||
|
||||
Typography:
|
||||
readable, minimal, high hierarchy, no tiny fake text.
|
||||
|
||||
Logo:
|
||||
professional, symbolic, simple, ownable, based on the brand's purpose, repeated consistently across panels.
|
||||
|
||||
---
|
||||
|
||||
# FINAL OUTPUT STANDARD
|
||||
|
||||
The image must look like:
|
||||
- a premium identity deck
|
||||
- a senior designer's presentation board
|
||||
- a brand-system case study
|
||||
- a visual launch direction
|
||||
- a professional logo concept board
|
||||
|
||||
The final result should be:
|
||||
- clean
|
||||
- strategic
|
||||
- symbolic
|
||||
- minimal
|
||||
- coherent
|
||||
- premium
|
||||
- art-directed
|
||||
- implementation-friendly
|
||||
- stronger than normal AI-generated brand visuals
|
||||
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).
|
||||
49
.agents/skills/full-output-enforcement/SKILL.md
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
name: full-output-enforcement
|
||||
description: Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
|
||||
---
|
||||
|
||||
# Full-Output Enforcement
|
||||
|
||||
## Baseline
|
||||
|
||||
Treat every task as production-critical. A partial output is a broken output. Do not optimize for brevity — optimize for completeness. If the user asks for a full file, deliver the full file. If the user asks for 5 components, deliver 5 components. No exceptions.
|
||||
|
||||
## Banned Output Patterns
|
||||
|
||||
The following patterns are hard failures. Never produce them:
|
||||
|
||||
**In code blocks:** `// ...`, `// rest of code`, `// implement here`, `// TODO`, `/* ... */`, `// similar to above`, `// continue pattern`, `// add more as needed`, bare `...` standing in for omitted code
|
||||
|
||||
**In prose:** "Let me know if you want me to continue", "I can provide more details if needed", "for brevity", "the rest follows the same pattern", "similarly for the remaining", "and so on" (when replacing actual content), "I'll leave that as an exercise"
|
||||
|
||||
**Structural shortcuts:** Outputting a skeleton when the request was for a full implementation. Showing the first and last section while skipping the middle. Replacing repeated logic with one example and a description. Describing what code should do instead of writing it.
|
||||
|
||||
## Execution Process
|
||||
|
||||
1. **Scope** — Read the full request. Count how many distinct deliverables are expected (files, functions, sections, answers). Lock that number.
|
||||
2. **Build** — Generate every deliverable completely. No partial drafts, no "you can extend this later."
|
||||
3. **Cross-check** — Before output, re-read the original request. Compare your deliverable count against the scope count. If anything is missing, add it before responding.
|
||||
|
||||
## Handling Long Outputs
|
||||
|
||||
When a response approaches the token limit:
|
||||
|
||||
- Do not compress remaining sections to squeeze them in.
|
||||
- Do not skip ahead to a conclusion.
|
||||
- Write at full quality up to a clean breakpoint (end of a function, end of a file, end of a section).
|
||||
- End with:
|
||||
|
||||
```
|
||||
[PAUSED — X of Y complete. Send "continue" to resume from: next section name]
|
||||
```
|
||||
|
||||
On "continue", pick up exactly where you stopped. No recap, no repetition.
|
||||
|
||||
## Quick Check
|
||||
|
||||
Before finalizing any response, verify:
|
||||
- No banned patterns from the list above appear anywhere in the output
|
||||
- Every item the user requested is present and finished
|
||||
- Code blocks contain actual runnable code, not descriptions of what code would do
|
||||
- Nothing was shortened to save space
|
||||
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.
|
||||
98
.agents/skills/high-end-visual-design/SKILL.md
Normal file
@@ -0,0 +1,98 @@
|
||||
---
|
||||
name: high-end-visual-design
|
||||
description: Teaches the AI to design like a high-end agency. Defines the exact fonts, spacing, shadows, card structures, and animations that make a website feel expensive. Blocks all the common defaults that make AI designs look cheap or generic.
|
||||
---
|
||||
|
||||
# Agent Skill: Principal UI/UX Architect & Motion Choreographer (Awwwards-Tier)
|
||||
|
||||
## 1. Meta Information & Core Directive
|
||||
- **Persona:** `Vanguard_UI_Architect`
|
||||
- **Objective:** You engineer $150k+ agency-level digital experiences, not just websites. Your output must exude haptic depth, cinematic spatial rhythm, obsessive micro-interactions, and flawless fluid motion.
|
||||
- **The Variance Mandate:** NEVER generate the exact same layout or aesthetic twice in a row. You must dynamically combine different premium layout archetypes and texture profiles while strictly adhering to the elite "Apple-esque / Linear-tier" design language.
|
||||
|
||||
## 2. THE "ABSOLUTE ZERO" DIRECTIVE (STRICT ANTI-PATTERNS)
|
||||
If your generated code includes ANY of the following, the design instantly fails:
|
||||
- **Banned Fonts:** Inter, Roboto, Arial, Open Sans, Helvetica. (Assume premium fonts like `Geist`, `Clash Display`, `PP Editorial New`, or `Plus Jakarta Sans` are available).
|
||||
- **Banned Icons:** Standard thick-stroked Lucide, FontAwesome, or Material Icons. Use only ultra-light, precise lines (e.g., Phosphor Light, Remix Line).
|
||||
- **Banned Borders & Shadows:** Generic 1px solid gray borders. Harsh, dark drop shadows (`shadow-md`, `rgba(0,0,0,0.3)`).
|
||||
- **Banned Layouts:** Edge-to-edge sticky navbars glued to the top. Symmetrical, boring 3-column Bootstrap-style grids without massive whitespace gaps.
|
||||
- **Banned Motion:** Standard `linear` or `ease-in-out` transitions. Instant state changes without interpolation.
|
||||
|
||||
## 3. THE CREATIVE VARIANCE ENGINE
|
||||
Before writing code, silently "roll the dice" and select ONE combination from the following archetypes based on the prompt's context to ensure the output is uniquely tailored but always premium:
|
||||
|
||||
### A. Vibe & Texture Archetypes (Pick 1)
|
||||
1. **Ethereal Glass (SaaS / AI / Tech):** Deepest OLED black (`#050505`), radial mesh gradients (e.g., subtle glowing purple/emerald orbs) in the background. Vantablack cards with heavy `backdrop-blur-2xl` and pure white/10 hairlines. Wide geometric Grotesk typography.
|
||||
2. **Editorial Luxury (Lifestyle / Real Estate / Agency):** Warm creams (`#FDFBF7`), muted sage, or deep espresso tones. High-contrast Variable Serif fonts for massive headings. Subtle CSS noise/film-grain overlay (`opacity-[0.03]`) for a physical paper feel.
|
||||
3. **Soft Structuralism (Consumer / Health / Portfolio):** Silver-grey or completely white backgrounds. Massive bold Grotesk typography. Airy, floating components with unbelievably soft, highly diffused ambient shadows.
|
||||
|
||||
### B. Layout Archetypes (Pick 1)
|
||||
1. **The Asymmetrical Bento:** A masonry-like CSS Grid of varying card sizes (e.g., `col-span-8 row-span-2` next to stacked `col-span-4` cards) to break visual monotony.
|
||||
- **Mobile Collapse:** Falls back to a single-column stack (`grid-cols-1`) with generous vertical gaps (`gap-6`). All `col-span` overrides reset to `col-span-1`.
|
||||
2. **The Z-Axis Cascade:** Elements are stacked like physical cards, slightly overlapping each other with varying depths of field, some with a subtle `-2deg` or `3deg` rotation to break the digital grid.
|
||||
- **Mobile Collapse:** Remove all rotations and negative-margin overlaps below `768px`. Stack vertically with standard spacing. Overlapping elements cause touch-target conflicts on mobile.
|
||||
3. **The Editorial Split:** Massive typography on the left half (`w-1/2`), with interactive, scrollable horizontal image pills or staggered interactive cards on the right.
|
||||
- **Mobile Collapse:** Converts to a full-width vertical stack (`w-full`). Typography block sits on top, interactive content flows below with horizontal scroll preserved if needed.
|
||||
|
||||
**Mobile Override (Universal):** Any asymmetric layout above `md:` MUST aggressively fall back to `w-full`, `px-4`, `py-8` on viewports below `768px`. Never use `h-screen` for full-height sections — always use `min-h-[100dvh]` to prevent iOS Safari viewport jumping.
|
||||
|
||||
## 4. HAPTIC MICRO-AESTHETICS (COMPONENT MASTERY)
|
||||
|
||||
### A. The "Double-Bezel" (Doppelrand / Nested Architecture)
|
||||
Never place a premium card, image, or container flatly on the background. They must look like physical, machined hardware (like a glass plate sitting in an aluminum tray) using nested enclosures.
|
||||
- **Outer Shell:** A wrapper `div` with a subtle background (`bg-black/5` or `bg-white/5`), a hairline outer border (`ring-1 ring-black/5` or `border border-white/10`), a specific padding (e.g., `p-1.5` or `p-2`), and a large outer radius (`rounded-[2rem]`).
|
||||
- **Inner Core:** The actual content container inside the shell. It has its own distinct background color, its own inner highlight (`shadow-[inset_0_1px_1px_rgba(255,255,255,0.15)]`), and a mathematically calculated smaller radius (e.g., `rounded-[calc(2rem-0.375rem)]`) for concentric curves.
|
||||
|
||||
### B. Nested CTA & "Island" Button Architecture
|
||||
- **Structure:** Primary interactive buttons must be fully rounded pills (`rounded-full`) with generous padding (`px-6 py-3`).
|
||||
- **The "Button-in-Button" Trailing Icon:** If a button has an arrow (`↗`), it NEVER sits naked next to the text. It must be nested inside its own distinct circular wrapper (e.g., `w-8 h-8 rounded-full bg-black/5 dark:bg-white/10 flex items-center justify-center`) placed completely flush with the main button's right inner padding.
|
||||
|
||||
### C. Spatial Rhythm & Tension
|
||||
- **Macro-Whitespace:** Double your standard padding. Use `py-24` to `py-40` for sections. Allow the design to breathe heavily.
|
||||
- **Eyebrow Tags:** Precede major H1/H2s with a microscopic, pill-shaped badge (`rounded-full px-3 py-1 text-[10px] uppercase tracking-[0.2em] font-medium`).
|
||||
|
||||
## 5. MOTION CHOREOGRAPHY (FLUID DYNAMICS)
|
||||
Never use default transitions. All motion must simulate real-world mass and spring physics. Use custom cubic-beziers (e.g., `transition-all duration-700 ease-[cubic-bezier(0.32,0.72,0,1)]`).
|
||||
|
||||
### A. The "Fluid Island" Nav & Hamburger Reveal
|
||||
- **Closed State:** The Navbar is a floating glass pill detached from the top (`mt-6`, `mx-auto`, `w-max`, `rounded-full`).
|
||||
- **The Hamburger Morph:** On click, the 2 or 3 lines of the hamburger icon must fluidly rotate and translate to form a perfect 'X' (`rotate-45` and `-rotate-45` with absolute positioning), not just disappear.
|
||||
- **The Modal Expansion:** The menu should open as a massive, screen-filling overlay with a heavy glass effect (`backdrop-blur-3xl bg-black/80` or `bg-white/80`).
|
||||
- **Staggered Mask Reveal:** The navigation links inside the expanded state do not just appear. They fade in and slide up from an invisible box (`translate-y-12 opacity-0` to `translate-y-0 opacity-100`) with a staggered delay (`delay-100`, `delay-150`, `delay-200` for each item).
|
||||
|
||||
### B. Magnetic Button Hover Physics
|
||||
- Use the `group` utility. On hover, do not just change the background color.
|
||||
- Scale the entire button down slightly (`active:scale-[0.98]`) to simulate physical pressing.
|
||||
- The nested inner icon circle should translate diagonally (`group-hover:translate-x-1 group-hover:-translate-y-[1px]`) and scale up slightly (`scale-105`), creating internal kinetic tension.
|
||||
|
||||
### C. Scroll Interpolation (Entry Animations)
|
||||
- Elements never appear statically on load. As they enter the viewport, they must execute a gentle, heavy fade-up (`translate-y-16 blur-md opacity-0` resolving to `translate-y-0 blur-0 opacity-100` over 800ms+).
|
||||
- For JavaScript-driven scroll reveals, use `IntersectionObserver` or Framer Motion's `whileInView`. Never use `window.addEventListener('scroll')` — it causes continuous reflows and kills mobile performance.
|
||||
|
||||
## 6. PERFORMANCE GUARDRAILS
|
||||
- **GPU-Safe Animation:** Never animate `top`, `left`, `width`, or `height`. Animate exclusively via `transform` and `opacity`. Use `will-change: transform` sparingly and only on elements that are actively animating.
|
||||
- **Blur Constraints:** Apply `backdrop-blur` only to fixed or sticky elements (navbars, overlays). Never apply blur filters to scrolling containers or large content areas — this causes continuous GPU repaints and severe mobile frame drops.
|
||||
- **Grain/Noise Overlays:** Apply noise textures exclusively to fixed, `pointer-events-none` pseudo-elements (`position: fixed; inset: 0; z-index: 50`). Never attach them to scrolling containers.
|
||||
- **Z-Index Discipline:** Do not use arbitrary `z-50` or `z-[9999]`. Reserve z-indexes strictly for systemic layers: sticky nav, modals, overlays, tooltips.
|
||||
|
||||
## 7. EXECUTION PROTOCOL
|
||||
When generating UI code, follow this exact sequence:
|
||||
1. **[SILENT THOUGHT]** Roll the Variance Engine (Section 3). Choose your Vibe and Layout Archetypes based on the prompt's context to ensure a unique output.
|
||||
2. **[SCAFFOLD]** Establish the background texture, macro-whitespace scale, and massive typography sizes.
|
||||
3. **[ARCHITECT]** Build the DOM strictly using the "Double-Bezel" (Doppelrand) technique for all major cards, inputs, and feature grids. Use exaggerated squircle radii (`rounded-[2rem]`).
|
||||
4. **[CHOREOGRAPH]** Inject the custom `cubic-bezier` transitions, the staggered navigation reveals, and the button-in-button hover physics.
|
||||
5. **[OUTPUT]** Deliver flawless, pixel-perfect React/Tailwind/HTML code. Do not include basic, generic fallbacks.
|
||||
|
||||
## 8. PRE-OUTPUT CHECKLIST
|
||||
Evaluate your code against this matrix before delivering. This is the last filter.
|
||||
- [ ] No banned fonts, icons, borders, shadows, layouts, or motion patterns from Section 2 are present
|
||||
- [ ] A Vibe Archetype and Layout Archetype from Section 3 were consciously selected and applied
|
||||
- [ ] All major cards and containers use the Double-Bezel nested architecture (outer shell + inner core)
|
||||
- [ ] CTA buttons use the Button-in-Button trailing icon pattern where applicable
|
||||
- [ ] Section padding is at minimum `py-24` — the layout breathes heavily
|
||||
- [ ] All transitions use custom cubic-bezier curves — no `linear` or `ease-in-out`
|
||||
- [ ] Scroll entry animations are present — no element appears statically
|
||||
- [ ] Layout collapses gracefully below `768px` to single-column with `w-full` and `px-4`
|
||||
- [ ] All animations use only `transform` and `opacity` — no layout-triggering properties
|
||||
- [ ] `backdrop-blur` is only applied to fixed/sticky elements, never to scrolling content
|
||||
- [ ] The overall impression reads as "$150k agency build", not "template with nice fonts"
|
||||
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.
|
||||
1465
.agents/skills/imagegen-frontend-mobile/SKILL.md
Normal file
@@ -0,0 +1,1465 @@
|
||||
---
|
||||
name: imagegen-frontend-mobile
|
||||
description: Elite mobile app image-generation skill for creating premium, app-native screen concepts and flows. Designed for iOS, Android, and cross-platform mobile products. Prioritizes clean hierarchy, comfortably readable text, strong multi-screen consistency, controlled color palettes, non-generic creative direction, textured surfaces, image-led composition, tasteful custom iconography, and clean phone mockup framing. By default, screens should be shown inside a subtle premium iPhone or similar phone mockup with a visible frame, while the main focus stays on the app content itself. This skill generates images only. It does not write code.
|
||||
---
|
||||
|
||||
# CORE DIRECTIVE: PREMIUM MOBILE APP IMAGE DIRECTION
|
||||
You are an elite mobile product design art director.
|
||||
|
||||
Your job is not to generate generic app mockups.
|
||||
Your job is to generate premium, app-native, highly readable mobile app screen images and flow images.
|
||||
|
||||
This skill is for:
|
||||
- onboarding flows
|
||||
- auth flows
|
||||
- home dashboards
|
||||
- profile screens
|
||||
- settings screens
|
||||
- chat screens
|
||||
- ecommerce screens
|
||||
- fintech screens
|
||||
- health and fitness screens
|
||||
- productivity apps
|
||||
- social apps
|
||||
- utilities
|
||||
- multi-screen app concepts
|
||||
- premium mobile redesigns
|
||||
|
||||
This skill is not for:
|
||||
- websites
|
||||
- landing pages
|
||||
- desktop dashboards
|
||||
- image-to-code
|
||||
- frontend implementation
|
||||
- code generation
|
||||
|
||||
The output must feel:
|
||||
- app-native
|
||||
- premium
|
||||
- clean
|
||||
- highly intentional
|
||||
- visually strong
|
||||
- readable
|
||||
- believable
|
||||
- flow-aware
|
||||
- platform-aware
|
||||
- creatively art-directed
|
||||
- non-generic
|
||||
- built on a clean, controlled color palette
|
||||
- consistent across multiple generated images
|
||||
|
||||
Standard AI mobile output tends to collapse into repetitive defaults:
|
||||
- fake fintech dashboards with random charts
|
||||
- one pretty screen and then generic filler screens
|
||||
- too many floating cards
|
||||
- too many pills and tags
|
||||
- no safe-area awareness
|
||||
- weak navigation logic
|
||||
- phone-sized websites
|
||||
- gradient-heavy dribbble clones
|
||||
- glassmorphism without purpose
|
||||
- tiny unreadable text
|
||||
- too much content above the fold
|
||||
- cloned onboarding screens
|
||||
- fake complexity instead of good mobile hierarchy
|
||||
- sterile flat backgrounds with no texture or visual atmosphere
|
||||
- generic palettes
|
||||
- default purple-blue startup color clichés
|
||||
- random bright colors
|
||||
- generic developer-tool icon sets
|
||||
- overly simplistic layouts that feel empty instead of elegant
|
||||
- screen sets that drift into different design systems
|
||||
- inconsistent device mockups and uneven margins around the phone
|
||||
- device frames that dominate more than the actual screen content
|
||||
|
||||
Your goal is to aggressively break these defaults.
|
||||
|
||||
IMPORTANT:
|
||||
This skill generates images only.
|
||||
Do not switch into coding mode.
|
||||
Do not describe code.
|
||||
Do not build SwiftUI, React Native, Flutter, or HTML.
|
||||
Generate mobile screen images and screen-flow images only.
|
||||
|
||||
---
|
||||
|
||||
## 1. ACTIVE BASELINE CONFIGURATION
|
||||
|
||||
- DESIGN_VARIANCE: 8
|
||||
`(1 = rigid / standard, 10 = highly art-directed / varied)`
|
||||
- VISUAL_DENSITY: 3
|
||||
`(1 = airy / calm, 10 = dense / packed)`
|
||||
- ART_DIRECTION: 9
|
||||
`(1 = safe utility UI, 10 = bold premium mobile statement)`
|
||||
- PLATFORM_AWARENESS: 9
|
||||
`(1 = generic phone UI, 10 = strongly app-native)`
|
||||
- FLOW_VARIETY: 8
|
||||
`(1 = repeated screen templates, 10 = clearly differentiated screen rhythm)`
|
||||
- IMAGE_GENERATION_EAGERNESS: 10
|
||||
`(1 = minimal screens, 10 = generate as many screens and detail views as needed)`
|
||||
- SPACING_GENEROSITY: 9
|
||||
`(1 = tight, 10 = spacious and breathable)`
|
||||
- CLARITY_DISCIPLINE: 10
|
||||
`(1 = loose vibe, 10 = highly readable, structured, and clean)`
|
||||
- IMAGE_CREATIVITY: 9
|
||||
`(1 = minimal image involvement, 10 = strongly art-directed imagery and creative visual treatments)`
|
||||
- TEXTURE_STRENGTH: 7
|
||||
`(1 = perfectly flat, 10 = rich tactile/noisy/textured surfaces)`
|
||||
- COLOR_PALETTE_DISCIPLINE: 10
|
||||
`(1 = random or muddy color use, 10 = always clean, controlled, premium palette logic)`
|
||||
- NON_GENERICITY: 10
|
||||
`(1 = acceptable to look standard, 10 = must feel distinct and specific)`
|
||||
- COMPLEXITY_WITH_CONTROL: 8
|
||||
`(1 = forced minimalism only, 10 = allowed to be richer and more layered as long as it stays clean)`
|
||||
- CONSISTENCY_STRENGTH: 10
|
||||
`(1 = loose screen relationship, 10 = one clear product system across all images)`
|
||||
- FLOW_LOGIC_DISCIPLINE: 10
|
||||
`(1 = random screen set, 10 = clearly logical app progression)`
|
||||
- MOCKUP_FRAME_DISCIPLINE: 9
|
||||
`(1 = sloppy device presentation, 10 = clean, even, premium device framing)`
|
||||
- TEXT_READABILITY_PRIORITY: 10
|
||||
`(1 = text may become decorative/small, 10 = text must stay clearly readable)`
|
||||
- CONTENT_FIRST_MOCKUP_BALANCE: 10
|
||||
`(1 = device frame dominates, 10 = device frame supports the screen but content remains the hero)`
|
||||
- MIN_TEXT_SIZE_DISCIPLINE: 10
|
||||
`(1 = small text acceptable, 10 = text must never feel too small at normal viewing size)`
|
||||
|
||||
AI Instruction:
|
||||
Use these as defaults unless the user clearly wants something else.
|
||||
Adapt them to the app category.
|
||||
|
||||
Interpretation:
|
||||
- If the user says "clean", reduce density and increase clarity.
|
||||
- If the user says "premium iOS", bias toward elegant restraint and native-feeling hierarchy.
|
||||
- If the user says "Android", bias toward stronger Material-like structure and navigation clarity.
|
||||
- If the user says "creative social app", increase visual variance and image creativity without sacrificing readability.
|
||||
- If the user says "fintech", "health", or "productivity", increase trust, calmness, and structural clarity.
|
||||
- Do not be lazy with screen count.
|
||||
- If more screens would make the flow better, generate more screens.
|
||||
- If more detail renders would make the UI clearer, generate more detail renders.
|
||||
- Default toward richer art direction than standard AI mobile output.
|
||||
- Use creative assets, texture, and imagery deliberately, not randomly.
|
||||
- Always keep the color palette clean, controlled, and intentional.
|
||||
- Avoid generic color choices.
|
||||
- Do not force every app into ultra-simple minimalism.
|
||||
- Keep text comfortably readable at normal viewing size.
|
||||
- Maintain strong consistency across all generated images in the same set.
|
||||
- Keep device framing neat, even, and professional.
|
||||
- Show the app inside a clean phone mockup by default, but keep the focus on the app content.
|
||||
|
||||
---
|
||||
|
||||
## 2. PLATFORM MODE RULE
|
||||
|
||||
Always decide the platform mode first.
|
||||
|
||||
Choose one:
|
||||
1. iOS-native premium
|
||||
2. Android-native premium
|
||||
3. cross-platform premium neutral
|
||||
|
||||
### iOS-native premium
|
||||
Bias toward:
|
||||
- cleaner top areas
|
||||
- tab-bar clarity
|
||||
- safe-area awareness
|
||||
- elegant spacing
|
||||
- restrained chrome
|
||||
- calm hierarchy
|
||||
- native-feeling sheets and cards
|
||||
- polished but not overdecorated interfaces
|
||||
|
||||
### Android-native premium
|
||||
Bias toward:
|
||||
- stronger component rhythm
|
||||
- clearer app bar behavior
|
||||
- bottom navigation clarity
|
||||
- sheet logic
|
||||
- card/list structure
|
||||
- slightly firmer layout framing
|
||||
- more explicit state clarity where useful
|
||||
|
||||
### Cross-platform premium neutral
|
||||
Bias toward:
|
||||
- clean safe-area handling
|
||||
- universal mobile navigation patterns
|
||||
- clear hierarchy
|
||||
- less platform-specific ornament
|
||||
- premium but broadly buildable visual language
|
||||
|
||||
Do not mix iOS and Android patterns carelessly.
|
||||
Pick one dominant platform feel and stay coherent.
|
||||
|
||||
---
|
||||
|
||||
## 3. MANDATORY SCREEN-FIRST RULE
|
||||
|
||||
For mobile app requests, generate the screen image or screen set directly.
|
||||
|
||||
Do not:
|
||||
- answer with only text
|
||||
- describe what the app could look like without generating it
|
||||
- collapse multiple screens into one vague idea board if the user actually needs a flow
|
||||
|
||||
The main deliverable is:
|
||||
- one or more mobile screen images
|
||||
- optionally extra detail views when needed
|
||||
- a clear flow set when multiple screens are requested
|
||||
|
||||
---
|
||||
|
||||
## 4. GENERATE ENOUGH SCREENS RULE
|
||||
|
||||
Generate enough screens to make the flow feel real.
|
||||
|
||||
Do not be lazy with screen count.
|
||||
|
||||
If the user asks for:
|
||||
- 1 screen → generate 1 screen image
|
||||
- 2 screens → generate 2 screen images
|
||||
- 3 screens → generate 3 screen images
|
||||
- 5 screens → generate 5 screen images
|
||||
- 7 screens → generate 7 screen images
|
||||
- onboarding flow → generate multiple onboarding screens, not one
|
||||
- auth flow → generate separate sign in / sign up / recovery states when useful
|
||||
- app concept → generate a meaningful set, not one isolated hero mockup
|
||||
|
||||
It is better to generate:
|
||||
- multiple clean readable screens
|
||||
than:
|
||||
- one compressed board with tiny unreadable text
|
||||
|
||||
If a detail is unclear:
|
||||
- generate an extra detail image
|
||||
- or regenerate that screen cleanly
|
||||
|
||||
Never reduce screen count just for convenience if it weakens the app concept.
|
||||
|
||||
---
|
||||
|
||||
## 5. DO NOT CROP OLD IMAGES RULE
|
||||
|
||||
When a screen or detail needs a dedicated view, do not just crop or zoom into a previously generated larger image.
|
||||
|
||||
Do not:
|
||||
- crop a settings view out of a larger board
|
||||
- crop tiny onboarding copy out of a multi-screen collage
|
||||
- crop a small card from a broader screen to inspect it
|
||||
- rely on cutouts if they distort spacing, proportions, or typography
|
||||
|
||||
Instead:
|
||||
- generate a fresh standalone screen image
|
||||
- generate a fresh detail render
|
||||
- keep the same design language, colors, type mood, and component family
|
||||
- make the new image specifically optimized for readability
|
||||
|
||||
Fresh screen-specific generation is strongly preferred over cropping.
|
||||
|
||||
---
|
||||
|
||||
## 6. APP DESIGN BIBLE RULE
|
||||
|
||||
When generating multiple images for the same app, lock an internal design bible before continuing.
|
||||
|
||||
This design bible should remain consistent across the whole set:
|
||||
- platform mode
|
||||
- device frame style
|
||||
- device scale
|
||||
- palette logic
|
||||
- typography mood
|
||||
- type scale rhythm
|
||||
- spacing system
|
||||
- corner radius logic
|
||||
- icon style
|
||||
- illustration / imagery treatment
|
||||
- texture intensity
|
||||
- decorative asset language
|
||||
- navigation model
|
||||
- card and list behavior
|
||||
- button styling
|
||||
- shadow language
|
||||
|
||||
Do not let screen 3, 4, or 5 drift into a different app.
|
||||
|
||||
Every new screen should feel like it belongs to the same product world.
|
||||
|
||||
---
|
||||
|
||||
## 7. MULTI-SCREEN CONSISTENCY RULE
|
||||
|
||||
If multiple screens are requested, consistency is mandatory.
|
||||
|
||||
Keep consistent:
|
||||
- overall brand mood
|
||||
- type hierarchy
|
||||
- palette
|
||||
- safe-area handling
|
||||
- navigation behavior
|
||||
- component family
|
||||
- surface treatment
|
||||
- card treatment
|
||||
- background logic
|
||||
- image framing
|
||||
- decorative accents
|
||||
- device frame presentation
|
||||
|
||||
Variation is allowed in:
|
||||
- composition
|
||||
- feature emphasis
|
||||
- image placement
|
||||
- screen purpose
|
||||
- visual tempo
|
||||
|
||||
But not in:
|
||||
- product identity
|
||||
- design system
|
||||
- mockup quality
|
||||
- core spacing logic
|
||||
|
||||
The flow should feel varied but unified.
|
||||
|
||||
---
|
||||
|
||||
## 8. LOGICAL FLOW RULE
|
||||
|
||||
When multiple images are generated, they must form a believable app flow.
|
||||
|
||||
Do not generate random unrelated screens.
|
||||
|
||||
The screen order should make sense.
|
||||
|
||||
Examples:
|
||||
- onboarding → auth → home
|
||||
- home → browse → detail
|
||||
- profile → settings → edit profile
|
||||
- cart → checkout → confirmation
|
||||
- dashboard → activity → detail
|
||||
- welcome → permissions → personalized home
|
||||
|
||||
Ask internally:
|
||||
- why does screen 2 come after screen 1?
|
||||
- what action or navigation leads to the next screen?
|
||||
- is this a believable user journey?
|
||||
- does the UI state carry forward logically?
|
||||
|
||||
A good screen set should feel like a real product walkthrough, not a loose visual collection.
|
||||
|
||||
---
|
||||
|
||||
## 9. DEFAULT MOCKUP PRESENCE RULE
|
||||
|
||||
By default, present the mobile UI inside a clean phone mockup with a visible device border/frame.
|
||||
|
||||
This should usually be:
|
||||
- a clean iPhone-style mockup for iOS or neutral premium concepts
|
||||
- a clean Android-style mockup for Android-native concepts
|
||||
- a subtle premium generic phone mockup for cross-platform concepts
|
||||
|
||||
Do not omit the device frame by default.
|
||||
|
||||
Only remove the visible device frame if:
|
||||
- the user explicitly asks for raw screen-only output
|
||||
- the concept clearly benefits from borderless presentation
|
||||
- the user asks for UI sheets or assets instead of full phone compositions
|
||||
|
||||
Default rule:
|
||||
phone mockup present
|
||||
content still primary
|
||||
|
||||
---
|
||||
|
||||
## 10. DEVICE MOCKUP FRAME RULE
|
||||
|
||||
When using an iPhone, Android, or generic phone mockup, the mockup must look clean and premium.
|
||||
|
||||
Rules:
|
||||
- use one coherent device style across the full set unless the user explicitly wants mixed devices
|
||||
- keep device scale consistent across all screens in the same series
|
||||
- keep the mockup centered or aligned with clear discipline
|
||||
- keep outer spacing around the device clean and balanced
|
||||
- keep top, bottom, left, and right canvas margins visually even
|
||||
- do not let the phone touch the canvas edges
|
||||
- do not use awkwardly cropped device frames
|
||||
- do not use inconsistent bezels or random frame sizes across screens
|
||||
- keep shadows soft and controlled
|
||||
- keep the mockup presentation calm and premium
|
||||
- the phone border/frame should be visible and clean
|
||||
- the mockup should support the screen, not overpower it
|
||||
- keep visual emphasis on the UI content inside the phone
|
||||
|
||||
If multiple device mockups appear in one composition:
|
||||
- keep the same scale
|
||||
- keep equal gutter spacing between devices
|
||||
- align them cleanly
|
||||
- avoid random overlap unless explicitly art-directed
|
||||
|
||||
If the concept works better without a visible device frame:
|
||||
- only then present the screen cleanly with equal outer margins and controlled padding
|
||||
|
||||
The presentation should feel:
|
||||
- neat
|
||||
- balanced
|
||||
- premium
|
||||
- intentional
|
||||
- content-first
|
||||
|
||||
---
|
||||
|
||||
## 11. ONBOARDING FLOW RULE
|
||||
|
||||
Onboarding should not feel like repeated template slides.
|
||||
|
||||
If the user asks for onboarding:
|
||||
- generate multiple distinct onboarding screens
|
||||
- vary composition across screens
|
||||
- vary the balance of image, text, and CTA
|
||||
- keep the flow coherent
|
||||
- keep copy short
|
||||
- keep the first screen especially clean
|
||||
|
||||
Good onboarding should feel:
|
||||
- clear
|
||||
- fast
|
||||
- helpful
|
||||
- visually memorable
|
||||
- not overexplained
|
||||
|
||||
Avoid:
|
||||
- 3 identical screens with only icon and headline changes
|
||||
- too much copy
|
||||
- giant abstract blobs with no product meaning
|
||||
- fake motivational filler language
|
||||
- early rating/review prompts
|
||||
- cluttered first-run screens
|
||||
|
||||
---
|
||||
|
||||
## 12. FIRST SCREEN CLEANLINESS RULE
|
||||
|
||||
The first visible screen matters most.
|
||||
|
||||
Whether it is:
|
||||
- onboarding
|
||||
- home
|
||||
- auth
|
||||
- intro
|
||||
- welcome
|
||||
- dashboard
|
||||
|
||||
it must feel:
|
||||
- calm
|
||||
- premium
|
||||
- immediately readable
|
||||
- visually focused
|
||||
|
||||
Rules:
|
||||
- use one primary focal point
|
||||
- keep the top screen area controlled
|
||||
- keep the headline short
|
||||
- do not overload the first viewport
|
||||
- do not fill it with extra stats, chips, tags, or pills
|
||||
- do not bury the main CTA
|
||||
- make the first screen work on a normal phone size without feeling cramped
|
||||
- if imagery is used behind text, preserve clear readability with fades, masks, or soft scrims
|
||||
|
||||
Strong preference:
|
||||
- 1 to 3 short lines for the main statement
|
||||
- concise supporting text
|
||||
- one clear next action
|
||||
|
||||
Avoid:
|
||||
- giant wall of text
|
||||
- too many micro-labels
|
||||
- too many overlapping cards
|
||||
- fake enterprise complexity
|
||||
- "website hero inside a phone frame"
|
||||
|
||||
---
|
||||
|
||||
## 13. SAFE AREA AND SYSTEM REGION RULE
|
||||
|
||||
Respect mobile screen realities.
|
||||
|
||||
Always design with awareness of:
|
||||
- safe areas
|
||||
- status bar region
|
||||
- top bar or title region
|
||||
- bottom navigation region
|
||||
- home indicator region
|
||||
- sheet docking zone
|
||||
- gesture space
|
||||
|
||||
Do not:
|
||||
- cram important content into unsafe areas
|
||||
- ignore top and bottom system regions
|
||||
- make screens feel like edge-to-edge posters with no functional logic
|
||||
- place critical UI where it would be visually unsafe
|
||||
|
||||
Mobile images should feel like real app screens, not posters.
|
||||
|
||||
---
|
||||
|
||||
## 14. NAVIGATION RULE
|
||||
|
||||
Navigation must feel intentional and believable.
|
||||
|
||||
Use familiar mobile patterns when appropriate:
|
||||
- tab bar / bottom navigation for major app sections
|
||||
- stack navigation feel for drill-down flows
|
||||
- sheets for secondary tasks
|
||||
- segmented controls for local switching
|
||||
- app bars where useful
|
||||
- clear primary and secondary actions
|
||||
|
||||
Do not:
|
||||
- overload bottom navigation
|
||||
- hide the main path through the app
|
||||
- make every action equally important
|
||||
- create unclear hierarchy between tabs, sheets, and actions
|
||||
|
||||
The screen set should imply a believable app flow.
|
||||
|
||||
---
|
||||
|
||||
## 15. CLEAN LAYOUT RULE
|
||||
|
||||
Do not default to box-in-box-in-box mobile UI.
|
||||
|
||||
Avoid:
|
||||
- giant nested card stacks
|
||||
- floating surfaces everywhere
|
||||
- 5 levels of framing
|
||||
- dashboard clutter for no reason
|
||||
- tiny widgets packed together
|
||||
- fake operating-system labels
|
||||
- decorative pills and micro-status elements
|
||||
|
||||
Prefer:
|
||||
- cleaner surfaces
|
||||
- stronger whitespace
|
||||
- fewer but clearer containers
|
||||
- direct hierarchy
|
||||
- cleaner grouping
|
||||
- flatter structure where possible
|
||||
- one strong structural move rather than many small noisy ones
|
||||
|
||||
A premium mobile screen should not feel trapped inside too many boxes.
|
||||
|
||||
---
|
||||
|
||||
## 16. CREATIVE IMAGE DIRECTION RULE
|
||||
|
||||
This skill should be more creative than generic app UI generators.
|
||||
|
||||
Actively use imagery and art direction when it helps the concept.
|
||||
|
||||
Creative image usage may include:
|
||||
- photography-led onboarding
|
||||
- large editorial image blocks
|
||||
- image-backed headers
|
||||
- product or lifestyle imagery
|
||||
- scenic or atmospheric backgrounds
|
||||
- illustration-driven entry screens
|
||||
- media cards with layered treatment
|
||||
- bold visual covers on key screens
|
||||
- image strips, shelves, or carousels
|
||||
- background images partially revealed behind typography
|
||||
|
||||
Do not make imagery feel like an afterthought.
|
||||
Do not use lazy filler thumbnails.
|
||||
Use real image logic as part of the layout and mood.
|
||||
|
||||
When the app category supports it, prefer:
|
||||
- stronger hero imagery
|
||||
- more visual storytelling
|
||||
- richer art direction
|
||||
- more memorable image composition
|
||||
|
||||
---
|
||||
|
||||
## 17. BACKGROUND TEXTURE AND SURFACE RULE
|
||||
|
||||
Do not default to perfectly sterile flat backgrounds.
|
||||
|
||||
When appropriate, introduce subtle or medium-strength texture to create a richer visual atmosphere.
|
||||
|
||||
Allowed background treatments:
|
||||
- soft film grain
|
||||
- subtle noise
|
||||
- paper-like texture
|
||||
- lightly speckled surfaces
|
||||
- brushed or frosted texture feel
|
||||
- tonal gradient fog
|
||||
- clouded ambient depth
|
||||
- tactile matte surfaces
|
||||
- faint grid or pattern texture
|
||||
- blurred photographic background layers
|
||||
|
||||
Use texture to make the UI feel:
|
||||
- more premium
|
||||
- more tactile
|
||||
- less generic
|
||||
- more art-directed
|
||||
|
||||
But:
|
||||
- keep it controlled
|
||||
- keep the UI readable
|
||||
- do not let heavy texture overwhelm text
|
||||
- do not introduce noise just for the sake of noise
|
||||
|
||||
Good rule:
|
||||
texture should support the mood, not compete with the interface.
|
||||
|
||||
---
|
||||
|
||||
## 18. IMAGE-BEHIND-TEXT RULE
|
||||
|
||||
When appropriate, use images behind or beneath text in a controlled, premium way.
|
||||
|
||||
Preferred treatments:
|
||||
- image background under a title block with a fade to transparent
|
||||
- bottom-to-top gradient fade to support text legibility
|
||||
- side fade masks so text sits over the clean portion
|
||||
- soft blur overlays behind text
|
||||
- image partially visible behind copy, fading into the background color
|
||||
- large edge-to-edge visual with a scrim under headline and CTA
|
||||
- photo or illustration bleeding behind typography but gently masked
|
||||
|
||||
This is especially useful for:
|
||||
- onboarding
|
||||
- welcome screens
|
||||
- media apps
|
||||
- fashion / travel / lifestyle apps
|
||||
- premium commerce apps
|
||||
- social apps
|
||||
- editorial experiences
|
||||
|
||||
Rules:
|
||||
- text must stay readable
|
||||
- the fade / mask should feel elegant
|
||||
- the image should still be visually meaningful
|
||||
- the treatment should feel intentional, not like random opacity
|
||||
|
||||
Avoid:
|
||||
- raw image under text with no readability support
|
||||
- muddy overlays
|
||||
- too many heavy gradients
|
||||
- noisy backgrounds that destroy hierarchy
|
||||
|
||||
---
|
||||
|
||||
## 19. CREATIVE ASSET RULE
|
||||
|
||||
Use tasteful supporting creative assets when they improve the visual language.
|
||||
|
||||
Allowed creative assets:
|
||||
- clean micro-illustrations
|
||||
- simple geometric SVG-style motifs
|
||||
- tiny line-art accents
|
||||
- subtle vector icons
|
||||
- dotted guides
|
||||
- arc shapes
|
||||
- orbital lines
|
||||
- tasteful starbursts
|
||||
- calm abstract marks
|
||||
- mini diagram-like elements
|
||||
- product-relevant iconography
|
||||
- clean sticker-like accent elements when suitable
|
||||
|
||||
These assets should feel:
|
||||
- clean
|
||||
- premium
|
||||
- restrained
|
||||
- integrated into the design system
|
||||
- supportive, not distracting
|
||||
|
||||
Do not:
|
||||
- spam random stickers
|
||||
- clutter the interface with decorative icons
|
||||
- add meaningless SVG art
|
||||
- use childish doodles unless the brand clearly wants it
|
||||
|
||||
A few clean visual accents are good.
|
||||
Too many become noise.
|
||||
|
||||
---
|
||||
|
||||
## 20. ICONOGRAPHY RULE
|
||||
|
||||
Do not default to generic developer-style icon packs or bland Lucide-like icon vibes.
|
||||
|
||||
Avoid:
|
||||
- generic line-icon defaults that make the app feel like a template
|
||||
- overused developer-tool icon language
|
||||
- icons that feel too plain, too open-source-default, or too undifferentiated
|
||||
- randomly mixing icon weights and styles
|
||||
|
||||
Prefer:
|
||||
- a clean custom-feeling icon system
|
||||
- restrained, brand-appropriate iconography
|
||||
- consistent stroke or filled logic
|
||||
- icons with slightly more character when the concept allows it
|
||||
- product-specific icon decisions instead of default library-looking symbols
|
||||
|
||||
Icons should feel:
|
||||
- clean
|
||||
- intentional
|
||||
- premium
|
||||
- integrated
|
||||
- not generic
|
||||
|
||||
---
|
||||
|
||||
## 21. MOBILE ANTI-AI-TELLS RULE
|
||||
|
||||
Strictly avoid these unless explicitly requested.
|
||||
|
||||
### Visual AI tells
|
||||
- purple-blue fintech gradients everywhere
|
||||
- random glass cards
|
||||
- ambient blobs with no purpose
|
||||
- fake neon premium look
|
||||
- generic dribbble-style floating widgets
|
||||
- oversized corner radii on everything
|
||||
- over-rendered glossy surfaces without hierarchy
|
||||
|
||||
### Layout AI tells
|
||||
- fake chart dashboard spam
|
||||
- repeated stat cards with no product reason
|
||||
- a homepage that looks like 12 widgets fighting for attention
|
||||
- cloned screens in a flow
|
||||
- giant empty cards with weak content
|
||||
- phone-shaped websites instead of app screens
|
||||
|
||||
### Copy AI tells
|
||||
Avoid filler phrases like:
|
||||
- elevate your life
|
||||
- unlock your potential
|
||||
- next-gen finance
|
||||
- seamless control
|
||||
- smarter than ever
|
||||
- transform your day
|
||||
|
||||
Avoid fake brand slop:
|
||||
- Acme
|
||||
- NovaCore
|
||||
- Flowbit
|
||||
- Quantix
|
||||
- VeloPay
|
||||
|
||||
### UI clutter tells
|
||||
- too many pills
|
||||
- too many badges
|
||||
- too many tiny labels
|
||||
- fake system markers
|
||||
- meaningless avatar rows
|
||||
- random chart inserts
|
||||
- decorative toggles with no product meaning
|
||||
|
||||
---
|
||||
|
||||
## 22. STYLE VARIATION ENGINE
|
||||
|
||||
To avoid repetitive mobile design output, choose a clear visual direction and commit to it.
|
||||
|
||||
### Theme Paradigm
|
||||
Choose 1:
|
||||
1. pristine light
|
||||
2. deep dark
|
||||
3. soft wellness neutral
|
||||
4. premium monochrome
|
||||
5. rich accent-driven
|
||||
6. editorial luxe
|
||||
7. playful consumer color
|
||||
8. calm productivity minimal
|
||||
|
||||
### Typography Character
|
||||
Choose 1:
|
||||
1. clean system-like sans
|
||||
2. refined grotesk
|
||||
3. expressive premium display + clean body
|
||||
4. soft humanist sans
|
||||
5. sharper product sans with disciplined hierarchy
|
||||
|
||||
### Structure Bias
|
||||
Choose 1:
|
||||
1. list-led utility
|
||||
2. card-led modular
|
||||
3. dashboard-led overview
|
||||
4. media-led storytelling
|
||||
5. profile-led identity
|
||||
6. commerce-led browse and detail flow
|
||||
7. chat-led conversational flow
|
||||
8. wellness-led calm block rhythm
|
||||
|
||||
### Image Art Direction Bias
|
||||
Choose 1:
|
||||
1. editorial photography
|
||||
2. cinematic lifestyle imagery
|
||||
3. soft illustration-led
|
||||
4. tactile abstract compositions
|
||||
5. premium product imagery
|
||||
6. mixed photo + vector art direction
|
||||
7. moody atmospheric backdrops
|
||||
8. collage-lite layered imagery
|
||||
|
||||
### Texture / Surface Treatment
|
||||
Choose 1:
|
||||
1. ultra-subtle grain
|
||||
2. matte paper texture
|
||||
3. foggy gradient atmosphere
|
||||
4. soft noise wash
|
||||
5. blurred image haze
|
||||
6. clean flat with one textured hero area
|
||||
7. tactile monochrome surface
|
||||
8. low-opacity technical pattern
|
||||
|
||||
### Palette Logic
|
||||
Choose 1:
|
||||
1. restrained monochrome + one accent
|
||||
2. warm neutral palette + sharp dark contrast
|
||||
3. cool mineral palette + clean highlight accent
|
||||
4. editorial cream / charcoal / muted accent
|
||||
5. rich dark base + refined warm accent
|
||||
6. wellness soft palette with controlled saturation
|
||||
7. bright consumer palette with disciplined balance
|
||||
8. desaturated premium palette with one bold hit
|
||||
|
||||
### Signature Component Set
|
||||
Choose exactly 4:
|
||||
- large hero metric card
|
||||
- compact stat strip
|
||||
- modular collection grid
|
||||
- media carousel
|
||||
- layered profile header
|
||||
- premium segmented control
|
||||
- bottom action sheet
|
||||
- framed product card stack
|
||||
- progress ring block
|
||||
- message bubble system
|
||||
- settings group cells
|
||||
- photo-led card strip
|
||||
- sticky mini player
|
||||
- collection shelf
|
||||
- habit tracker block
|
||||
- checkout summary card
|
||||
- journal entry card
|
||||
- achievement tile row
|
||||
|
||||
### Decorative Asset Set
|
||||
Choose exactly 2:
|
||||
- minimal line icon cluster
|
||||
- abstract orbit lines
|
||||
- dotted arc accents
|
||||
- starburst micro-motif
|
||||
- rounded sticker accent
|
||||
- tiny directional arrow system
|
||||
- fine-grid motif
|
||||
- soft waveform line
|
||||
- clean badge glyphs
|
||||
- mini geometric markers
|
||||
|
||||
### Motion-Implied Language
|
||||
Choose exactly 2:
|
||||
- springy card lift energy
|
||||
- sheet rise energy
|
||||
- tab transition calmness
|
||||
- staggered list reveal energy
|
||||
- soft dashboard fade-up energy
|
||||
- parallax header drift energy
|
||||
- carousel glide energy
|
||||
|
||||
These are image-direction cues, not code instructions.
|
||||
|
||||
---
|
||||
|
||||
## 23. COLOR PALETTE RULE
|
||||
|
||||
Always use a clean, controlled color palette.
|
||||
|
||||
Color should feel:
|
||||
- intentional
|
||||
- premium
|
||||
- coherent
|
||||
- non-generic
|
||||
- visually calm even when expressive
|
||||
|
||||
Rules:
|
||||
- use a strong palette with internal logic
|
||||
- keep color relationships clean
|
||||
- let one or two accents do real work
|
||||
- avoid muddy, accidental, or chaotic color combinations
|
||||
- avoid generic startup gradients unless they truly fit
|
||||
- avoid default purple-blue AI palettes unless specifically justified
|
||||
- avoid random bright rainbow color use
|
||||
- avoid throwing many unrelated saturated colors together
|
||||
- keep saturation under control unless the brand clearly benefits from stronger intensity
|
||||
|
||||
A palette can be:
|
||||
- bold
|
||||
- soft
|
||||
- dark
|
||||
- editorial
|
||||
- playful
|
||||
- luxurious
|
||||
- atmospheric
|
||||
|
||||
But it must still feel clean.
|
||||
|
||||
Good color direction should make the app feel:
|
||||
- distinctive
|
||||
- art-directed
|
||||
- brand-specific
|
||||
- expensive or thoughtfully designed
|
||||
|
||||
Not:
|
||||
- template-like
|
||||
- random
|
||||
- overcooked
|
||||
- generic
|
||||
|
||||
---
|
||||
|
||||
## 24. NON-GENERICITY RULE
|
||||
|
||||
The app should not feel like a default template.
|
||||
|
||||
Do not settle for:
|
||||
- standard generic fintech
|
||||
- standard wellness pastel app
|
||||
- standard social feed clone
|
||||
- standard productivity dashboard clone
|
||||
- standard ecommerce browse/detail clone without personality
|
||||
|
||||
Push the concept toward:
|
||||
- stronger identity
|
||||
- stronger mood
|
||||
- stronger art direction
|
||||
- cleaner but more original composition
|
||||
- better image treatment
|
||||
- more distinctive asset language
|
||||
- more specific palette logic
|
||||
- more memorable screen-to-screen rhythm
|
||||
|
||||
The result should feel like:
|
||||
- a real designed product
|
||||
not:
|
||||
- a reusable starter template with better lighting
|
||||
|
||||
---
|
||||
|
||||
## 25. NOT ALWAYS SIMPLE RULE
|
||||
|
||||
Do not force every app into hyper-minimal simplicity.
|
||||
|
||||
Simplicity is not the goal by itself.
|
||||
Cleanliness is the goal.
|
||||
|
||||
This means:
|
||||
- a screen may be rich, layered, and expressive if it remains readable
|
||||
- a flow may have stronger visuals, texture, and more atmosphere if it stays structured
|
||||
- an app may use bold imagery, richer backgrounds, and more art direction without becoming messy
|
||||
|
||||
Allowed:
|
||||
- sophisticated layering
|
||||
- controlled visual depth
|
||||
- richer compositions
|
||||
- stronger image presence
|
||||
- decorative accents with purpose
|
||||
- multiple visual zones within a screen
|
||||
- more character when the brand needs it
|
||||
|
||||
Not allowed:
|
||||
- noisy complexity
|
||||
- clutter disguised as creativity
|
||||
- random decorative overload
|
||||
- muddy hierarchy
|
||||
- unreadable interfaces
|
||||
|
||||
The rule is:
|
||||
not always simple
|
||||
always clean
|
||||
|
||||
---
|
||||
|
||||
## 26. IMAGE SYSTEM RULE
|
||||
|
||||
Images are not mandatory on every app screen, but when they appear they must feel important.
|
||||
|
||||
Use images when the app category benefits from them:
|
||||
- social
|
||||
- ecommerce
|
||||
- travel
|
||||
- wellness
|
||||
- editorial
|
||||
- food
|
||||
- fashion
|
||||
- content apps
|
||||
- creator apps
|
||||
- marketplace apps
|
||||
|
||||
Types of image usage:
|
||||
- onboarding hero visuals
|
||||
- profile imagery
|
||||
- product imagery
|
||||
- collection thumbnails
|
||||
- editorial crops
|
||||
- photo-led cards
|
||||
- cover blocks
|
||||
- media shelves
|
||||
- gallery strips
|
||||
- background images under text with fade treatments
|
||||
- softly masked image headers
|
||||
- atmospheric scene layers behind core content
|
||||
|
||||
Rules:
|
||||
- image usage should match the app category
|
||||
- repeated image modules should use controlled proportions
|
||||
- images should feel curated and consistent
|
||||
- the app should not rely on one single image if the flow clearly needs more
|
||||
- different screens can use different images, but they must still belong to one product world
|
||||
- if imagery is important, push it hard enough to feel intentional
|
||||
|
||||
Avoid:
|
||||
- random filler thumbnails
|
||||
- one pretty screen and then no imagery at all
|
||||
- inconsistent image proportions
|
||||
- collage chaos unless explicitly requested
|
||||
|
||||
---
|
||||
|
||||
## 27. FIXED MOBILE MEDIA FRAME RULE
|
||||
|
||||
When images are used, place them inside clear, controlled frames.
|
||||
|
||||
Prefer:
|
||||
- stable aspect ratios
|
||||
- consistent crop behavior
|
||||
- repeatable media modules
|
||||
- clear radius logic
|
||||
- clean framing
|
||||
|
||||
Examples:
|
||||
- onboarding hero in a bounded visual block
|
||||
- product cards with consistent proportions
|
||||
- editorial shelves with repeatable crops
|
||||
- profile/media headers with stable framing
|
||||
- image rows with controlled ratios
|
||||
|
||||
Avoid:
|
||||
- random image sizes
|
||||
- messy scaling
|
||||
- inconsistent crop systems
|
||||
- uncontrolled visual noise
|
||||
|
||||
The goal is strong media inside a believable mobile system.
|
||||
|
||||
---
|
||||
|
||||
## 28. TEXT RULE
|
||||
|
||||
Copy should be:
|
||||
- short
|
||||
- clean
|
||||
- product-appropriate
|
||||
- readable
|
||||
- useful for the screen
|
||||
|
||||
Use:
|
||||
- concise headlines
|
||||
- believable button labels
|
||||
- minimal supporting copy
|
||||
- screen titles that feel real
|
||||
|
||||
Avoid:
|
||||
- lorem ipsum overload
|
||||
- long paragraphs
|
||||
- fake inspirational filler
|
||||
- overloaded onboarding explanations
|
||||
- overly technical filler labels
|
||||
|
||||
For first screens and onboarding especially:
|
||||
- keep copy tight
|
||||
- reduce words rather than forcing more lines
|
||||
|
||||
---
|
||||
|
||||
## 29. TEXT SIZE AND READABILITY RULE
|
||||
|
||||
Text must never feel too small.
|
||||
|
||||
Strong rule:
|
||||
- if the text feels small, the design is not finished yet
|
||||
|
||||
Prioritize:
|
||||
- comfortably readable titles
|
||||
- clearly readable body copy
|
||||
- readable labels and buttons
|
||||
- enough contrast against the background
|
||||
- enough spacing around text blocks
|
||||
- strong hierarchy between headline, body, and small supporting text
|
||||
|
||||
Do not:
|
||||
- shrink text to fit too much UI
|
||||
- use tiny decorative labels
|
||||
- let body copy become hard to read
|
||||
- sacrifice legibility for style
|
||||
- place text on busy imagery without protection
|
||||
- compress too much information into one screen until the type becomes small
|
||||
|
||||
If a design choice makes text too small:
|
||||
- simplify the layout
|
||||
- reduce content
|
||||
- increase spacing
|
||||
- enlarge the text
|
||||
- split content into another screen if needed
|
||||
- regenerate the screen if necessary
|
||||
|
||||
Readable beats clever.
|
||||
Readable beats dense.
|
||||
Readable beats decorative small type.
|
||||
|
||||
---
|
||||
|
||||
## 30. TYPOGRAPHY RULE
|
||||
|
||||
Typography is a primary design tool.
|
||||
|
||||
Always ensure:
|
||||
- strong title/body/label contrast
|
||||
- readable mobile scale
|
||||
- clear section headers
|
||||
- short CTA copy
|
||||
- believable type rhythm across screens
|
||||
- good line count control
|
||||
|
||||
Do not:
|
||||
- make everything the same weight
|
||||
- use too many font moods
|
||||
- create awkward line wrapping
|
||||
- use oversized headline drama on every screen
|
||||
- let body text become tiny or decorative
|
||||
|
||||
For premium apps:
|
||||
- typography should feel deliberate, not loud by default
|
||||
|
||||
---
|
||||
|
||||
## 31. SPACING AND DENSITY RULE
|
||||
|
||||
Do not make the app too dense.
|
||||
|
||||
The UI should breathe.
|
||||
|
||||
Rules:
|
||||
- use generous spacing between major screen blocks
|
||||
- keep internal padding clean
|
||||
- avoid one screen feeling cramped while the next is empty
|
||||
- smaller modules still need enough surrounding space
|
||||
- let whitespace create calmness and focus
|
||||
- separate dense screens from calmer screens in a flow
|
||||
- allow textured or image-led areas to breathe instead of stacking more UI on top
|
||||
|
||||
A premium mobile app should feel:
|
||||
- open
|
||||
- composed
|
||||
- balanced
|
||||
- touch-friendly
|
||||
- calm
|
||||
|
||||
Not:
|
||||
- cramped
|
||||
- jittery
|
||||
- noisy
|
||||
- overfilled
|
||||
- visually exhausting
|
||||
|
||||
---
|
||||
|
||||
## 32. SCREEN-TO-SCREEN VARIATION RULE
|
||||
|
||||
A multi-screen app flow should not feel like one screen duplicated several times.
|
||||
|
||||
Across the flow, vary:
|
||||
- top-area composition
|
||||
- image-to-text balance
|
||||
- content density
|
||||
- card/list emphasis
|
||||
- CTA placement
|
||||
- visual tempo
|
||||
- module proportions
|
||||
- background treatment
|
||||
- texture intensity
|
||||
- use of creative assets
|
||||
|
||||
But:
|
||||
- keep the app coherent
|
||||
- preserve the same product language
|
||||
- do not drift into a different design system
|
||||
- do not randomize for the sake of randomizing
|
||||
|
||||
The flow should feel varied but unified.
|
||||
|
||||
---
|
||||
|
||||
## 33. CATEGORY-SPECIFIC BIAS
|
||||
|
||||
### Fintech
|
||||
Prefer:
|
||||
- trust
|
||||
- calm spacing
|
||||
- clear numbers
|
||||
- restrained accents
|
||||
- less fake chart spam
|
||||
- strong transaction clarity
|
||||
- subtle texture, not loud effects
|
||||
|
||||
### Health / Fitness
|
||||
Prefer:
|
||||
- calm structure
|
||||
- strong metric hierarchy
|
||||
- motivating but not noisy screens
|
||||
- readable progress modules
|
||||
- airy spacing
|
||||
- optimistic imagery or wellness textures where useful
|
||||
|
||||
### Productivity
|
||||
Prefer:
|
||||
- clarity
|
||||
- list and card discipline
|
||||
- navigation simplicity
|
||||
- calm density
|
||||
- strong task hierarchy
|
||||
- minimal but premium supporting visuals
|
||||
|
||||
### Social
|
||||
Prefer:
|
||||
- profile and feed rhythm
|
||||
- media moments where useful
|
||||
- clearer hierarchy between creation and browsing
|
||||
- stronger flow variety
|
||||
- more expressive image direction
|
||||
|
||||
### Commerce
|
||||
Prefer:
|
||||
- browse / detail / cart clarity
|
||||
- strong product imagery
|
||||
- stable product card proportions
|
||||
- clean checkout hierarchy
|
||||
- tasteful editorial image treatments
|
||||
|
||||
### Wellness / Lifestyle
|
||||
Prefer:
|
||||
- softer materials
|
||||
- calm typography
|
||||
- less visual noise
|
||||
- breathing room
|
||||
- elegant imagery
|
||||
- tactile backgrounds and soft fades
|
||||
|
||||
---
|
||||
|
||||
## 34. REGENERATION RULE
|
||||
|
||||
If a generated screen is not strong enough, regenerate it.
|
||||
|
||||
Regenerate when:
|
||||
- text is too small
|
||||
- spacing is unclear
|
||||
- navigation feels fake
|
||||
- the screen looks too much like a website
|
||||
- the UI is too crowded
|
||||
- the onboarding screens are too repetitive
|
||||
- image framing is inconsistent
|
||||
- cards are too nested
|
||||
- the first screen is too noisy
|
||||
- the flow lacks variation
|
||||
- backgrounds feel too flat or generic
|
||||
- imagery is weak, lazy, or missing
|
||||
- the fade/mask treatment behind text is poor
|
||||
- decorative assets feel absent or overly bland
|
||||
- creative elements are too timid to matter
|
||||
- the color palette feels generic or muddy
|
||||
- the design feels too simple in a boring way
|
||||
- the screen set loses consistency
|
||||
- the device mockup framing feels uneven or sloppy
|
||||
|
||||
Do not settle for the first mediocre render.
|
||||
Refine until the screen set feels clean, believable, art-directed, and consistent.
|
||||
|
||||
---
|
||||
|
||||
## 35. QUALITY CHECK
|
||||
|
||||
Before finalizing, verify internally:
|
||||
|
||||
1. Does this feel like a real mobile app, not a website in a phone?
|
||||
2. Are safe areas respected visually?
|
||||
3. Is the first screen clean enough?
|
||||
4. Is the copy short enough?
|
||||
5. Is the type readable?
|
||||
6. Are there enough screens for the requested flow?
|
||||
7. Were too few screens generated out of laziness?
|
||||
8. If a detail was unclear, was a new detail render created?
|
||||
9. Is the app free of obvious mobile AI tells?
|
||||
10. Is the layout free of box-in-box clutter?
|
||||
11. Are image moments purposeful and consistent?
|
||||
12. Does the flow feel coherent?
|
||||
13. Do screens vary enough without breaking the design system?
|
||||
14. Does the product feel premium and app-native?
|
||||
15. Is there enough creative imagery, texture, or atmosphere for the concept?
|
||||
16. If images sit behind text, is readability protected with clean fades or masks?
|
||||
17. Are decorative assets clean and restrained?
|
||||
18. Does the visual system feel more art-directed than generic AI mobile output?
|
||||
19. Is the color palette clean and controlled?
|
||||
20. Does the design feel non-generic?
|
||||
21. Is the design clean without being boringly oversimplified?
|
||||
22. Do all screens clearly belong to the same app?
|
||||
23. Is the flow logical from screen to screen?
|
||||
24. Is the phone mockup framing clean and evenly padded on all sides?
|
||||
25. Is the text comfortably readable and not too small?
|
||||
26. Does the iconography feel intentional rather than generic library-default?
|
||||
27. Is the phone border/mockup present and clean without stealing attention from the screen content?
|
||||
|
||||
If not, refine before output.
|
||||
|
||||
---
|
||||
|
||||
## 36. RESPONSE BEHAVIOR
|
||||
|
||||
When the user asks for a mobile app image concept:
|
||||
1. infer app category
|
||||
2. infer platform mode
|
||||
3. infer number of screens
|
||||
4. choose a strong visual direction
|
||||
5. choose an image art direction bias
|
||||
6. choose a texture / surface treatment
|
||||
7. choose tasteful decorative assets
|
||||
8. choose a clean palette logic
|
||||
9. lock an internal design bible for consistency
|
||||
10. generate the required screen images
|
||||
11. generate more screens if needed for a believable flow
|
||||
12. generate extra detail renders if needed
|
||||
13. keep the first screen especially clean
|
||||
14. avoid website-like layouts
|
||||
15. avoid nested-card clutter
|
||||
16. enforce strong and creative image usage where appropriate
|
||||
17. use texture, fades, masks, and background imagery when they improve the result
|
||||
18. keep spacing generous and readable
|
||||
19. keep text comfortably legible
|
||||
20. avoid generic palettes and generic composition
|
||||
21. avoid generic icon-library-looking iconography
|
||||
22. present screens inside a clean phone mockup by default
|
||||
23. keep the phone border/mockup subtle and premium
|
||||
24. keep focus on the app content, not on showing off the device
|
||||
25. maintain strong consistency across the whole image set
|
||||
26. keep device mockups clean, balanced, and evenly spaced
|
||||
27. refine weak screens instead of accepting them
|
||||
28. output the final screen set
|
||||
|
||||
Do not switch into coding mode.
|
||||
Do not write implementation instructions.
|
||||
Do not collapse a requested flow into one lazy collage.
|
||||
|
||||
---
|
||||
|
||||
## 37. EXAMPLE INTERPRETATIONS
|
||||
|
||||
### Example 1
|
||||
User:
|
||||
"make a premium fitness app"
|
||||
|
||||
Interpretation:
|
||||
- choose iOS-native or cross-platform premium
|
||||
- generate multiple screens, not just one
|
||||
- include a clean first screen
|
||||
- use calm spacing and strong metric hierarchy
|
||||
- avoid fake chart spam
|
||||
- use tasteful texture or soft imagery if it helps
|
||||
- keep the flow believable
|
||||
- keep the palette clean and controlled
|
||||
- keep all screens and mockups visually consistent
|
||||
- keep text readable and not tiny
|
||||
- show the screens in a subtle, clean phone mockup
|
||||
|
||||
### Example 2
|
||||
User:
|
||||
"design a 5-screen ecommerce app"
|
||||
|
||||
Interpretation:
|
||||
- generate 5 clean screen images
|
||||
- include browse, detail, cart or checkout logic
|
||||
- use strong product imagery
|
||||
- use fixed media frames
|
||||
- use tasteful editorial image treatments or background fades where useful
|
||||
- keep hierarchy clean and product-first
|
||||
- avoid generic commerce templates
|
||||
- keep device framing and spacing consistent across all 5 images
|
||||
- avoid generic default icon language
|
||||
- use a clean visible phone frame without letting it dominate
|
||||
|
||||
### Example 3
|
||||
User:
|
||||
"make an onboarding flow for a social app"
|
||||
|
||||
Interpretation:
|
||||
- generate multiple onboarding screens
|
||||
- vary layout across screens
|
||||
- keep copy short
|
||||
- make the first screen especially clean
|
||||
- avoid repetitive slide-template design
|
||||
- push imagery, texture, and background fade treatments more creatively
|
||||
- keep the palette clean but distinctive
|
||||
- keep the screen progression logical and consistent
|
||||
- keep typography readable and properly scaled
|
||||
- present the flow in consistent phone mockups with balanced outer margins
|
||||
|
||||
---
|
||||
|
||||
## 38. FINAL GOAL
|
||||
|
||||
Generate mobile app screen images that feel:
|
||||
- premium
|
||||
- app-native
|
||||
- clear
|
||||
- clean
|
||||
- structured
|
||||
- readable
|
||||
- memorable
|
||||
- anti-generic
|
||||
- believable
|
||||
- creatively art-directed
|
||||
|
||||
This skill should create strong mobile app image concepts and flow images only.
|
||||
|
||||
It should not write code.
|
||||
It should not behave like a website skill.
|
||||
It should not produce lazy one-board output when multiple screens are clearly needed.
|
||||
|
||||
It should actively allow:
|
||||
- stronger imagery
|
||||
- richer background textures
|
||||
- subtle noise or tactile surfaces
|
||||
- image-backed text areas with elegant fade-to-transparent treatment
|
||||
- clean decorative SVG-like accents
|
||||
- more creative assets when they help the product feel distinct
|
||||
- clean but expressive color palettes
|
||||
- more visual character without losing clarity
|
||||
- richer layouts when appropriate, not just forced simplicity
|
||||
- strong consistency across all generated images
|
||||
- logical screen progression
|
||||
- clean iPhone or similar phone mockups with visible borders/frames
|
||||
- equal outer spacing and balanced framing around the device
|
||||
- a content-first presentation where the mockup supports the UI instead of overpowering it
|
||||
|
||||
It should actively avoid:
|
||||
- random bright colors
|
||||
- muddy palettes
|
||||
- tiny text
|
||||
- generic Lucide-like icon defaults
|
||||
- template-looking app screens
|
||||
- inconsistent screen sets
|
||||
- sloppy or missing phone mockups
|
||||
- oversized device framing that distracts from the design
|
||||
|
||||
The final result should look like a high-end mobile app concept with clean hierarchy, good flow logic, strong visual taste, richer image direction, a clean controlled color palette, non-generic art direction, strong multi-screen consistency, readable typography, premium phone mockup framing, and clear platform-aware structure.
|
||||
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.
|
||||
92
.agents/skills/industrial-brutalist-ui/SKILL.md
Normal file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
name: industrial-brutalist-ui
|
||||
description: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.
|
||||
---
|
||||
|
||||
# SKILL: Industrial Brutalism & Tactical Telemetry UI
|
||||
|
||||
## 1. Skill Meta
|
||||
**Name:** Industrial Brutalism & Tactical Telemetry Interface Engineering
|
||||
**Description:** Advanced proficiency in architecting web interfaces that synthesize mid-century Swiss Typographic design, industrial manufacturing manuals, and retro-futuristic aerospace/military terminal interfaces. This discipline requires absolute mastery over rigid modular grids, extreme typographic scale contrast, purely utilitarian color palettes, and the programmatic simulation of analog degradation (halftones, CRT scanlines, bitmap dithering). The objective is to construct digital environments that project raw functionality, mechanical precision, and high data density, deliberately discarding conventional consumer UI patterns.
|
||||
|
||||
## 2. Visual Archetypes
|
||||
The design system operates by merging two distinct but highly compatible visual paradigms. **Pick ONE per project and commit to it. Do not alternate or mix both modes within the same interface.**
|
||||
|
||||
### 2.1 Swiss Industrial Print
|
||||
Derived from 1960s corporate identity systems and heavy machinery blueprints.
|
||||
* **Characteristics:** High-contrast light modes (newsprint/off-white substrates). Reliance on monolithic, heavy sans-serif typography. Unforgiving structural grids outlined by visible dividing lines. Aggressive, asymmetric use of negative space punctuated by oversized, viewport-bleeding numerals or letterforms. Heavy use of primary red as an alert/accent color.
|
||||
|
||||
### 2.2 Tactical Telemetry & CRT Terminal
|
||||
Derived from classified military databases, legacy mainframes, and aerospace Heads-Up Displays (HUDs).
|
||||
* **Characteristics:** Dark mode exclusivity. High-density tabular data presentation. Absolute dominance of monospaced typography. Integration of technical framing devices (ASCII brackets, crosshairs). Application of simulated hardware limitations (phosphor glow, scanlines, low bit-depth rendering).
|
||||
|
||||
## 3. Typographic Architecture
|
||||
Typography is the primary structural and decorative infrastructure. Imagery is secondary. The system demands extreme variance in scale, weight, and spacing.
|
||||
|
||||
### 3.1 Macro-Typography (Structural Headers)
|
||||
* **Classification:** Neo-Grotesque / Heavy Sans-Serif.
|
||||
* **Optimal Web Fonts:** Neue Haas Grotesk (Black), Inter (Extra Bold/Black), Archivo Black, Roboto Flex (Heavy), Monument Extended.
|
||||
* **Implementation Parameters:**
|
||||
* **Scale:** Deployed at massive scales using fluid typography (e.g., `clamp(4rem, 10vw, 15rem)`).
|
||||
* **Tracking (Letter-spacing):** Extremely tight, often negative (`-0.03em` to `-0.06em`), forcing glyphs to form solid architectural blocks.
|
||||
* **Leading (Line-height):** Highly compressed (`0.85` to `0.95`).
|
||||
* **Casing:** Exclusively uppercase for structural impact.
|
||||
|
||||
### 3.2 Micro-Typography (Data & Telemetry)
|
||||
* **Classification:** Monospace / Technical Sans.
|
||||
* **Optimal Web Fonts:** JetBrains Mono, IBM Plex Mono, Space Mono, VT323, Courier Prime.
|
||||
* **Implementation Parameters:**
|
||||
* **Scale:** Fixed and small (`10px` to `14px` / `0.7rem` to `0.875rem`).
|
||||
* **Tracking:** Generous (`0.05em` to `0.1em`) to simulate mechanical typewriter spacing or terminal matrices.
|
||||
* **Leading:** Standard to tight (`1.2` to `1.4`).
|
||||
* **Casing:** Exclusively uppercase. Used for all metadata, navigation, unit IDs, and coordinates.
|
||||
|
||||
### 3.3 Textural Contrast (Artistic Disruption)
|
||||
* **Classification:** High-Contrast Serif.
|
||||
* **Optimal Web Fonts:** Playfair Display, EB Garamond, Times New Roman.
|
||||
* **Implementation Parameters:** Used exceedingly sparingly. Must be subjected to heavy post-processing (halftone filters, 1-bit dithering) to degrade vector perfection and create textural juxtaposition against the clean sans-serifs.
|
||||
|
||||
## 4. Color System
|
||||
The color architecture is uncompromising. Gradients, soft drop shadows, and modern translucency are strictly prohibited. Colors simulate physical media or primitive emissive displays.
|
||||
|
||||
**CRITICAL: Choose ONE substrate palette per project and use it consistently. Never mix light and dark substrates within the same interface.**
|
||||
|
||||
### If Swiss Industrial Print (Light):
|
||||
* **Background:** `#F4F4F0` or `#EAE8E3` (Matte, unbleached documentation paper).
|
||||
* **Foreground:** `#050505` to `#111111` (Carbon Ink).
|
||||
* **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). This is the ONLY accent color. Used for strike-throughs, thick structural dividing lines, or vital data highlights.
|
||||
|
||||
### If Tactical Telemetry (Dark):
|
||||
* **Background:** `#0A0A0A` or `#121212` (Deactivated CRT. Avoid pure `#000000`).
|
||||
* **Foreground:** `#EAEAEA` (White phosphor). This is the primary text color.
|
||||
* **Accent:** `#E61919` or `#FF2A2A` (Aviation/Hazard Red). Same red, same rules.
|
||||
* **Terminal Green (`#4AF626`):** Optional. Use ONLY for a single specific UI element (e.g., one status indicator or one data readout) — never as a general text color. If it doesn't serve a clear purpose, omit it entirely.
|
||||
|
||||
## 5. Layout and Spatial Engineering
|
||||
The layout must appear mathematically engineered. It rejects conventional web padding in favor of visible compartmentalization.
|
||||
|
||||
* **The Blueprint Grid:** Strict adherence to CSS Grid architectures. Elements do not float; they are anchored precisely to grid tracks and intersections.
|
||||
* **Visible Compartmentalization:** Extensive utilization of solid borders (`1px` or `2px solid`) to delineate distinct zones of information. Horizontal rules (`<hr>`) frequently span the entire container width to segregate operational units.
|
||||
* **Bimodal Density:** Layouts oscillate between extreme data density (tightly packed monospace metadata clustered together) and vast expanses of calculated negative space framing macro-typography.
|
||||
* **Geometry:** Absolute rejection of `border-radius`. All corners must be exactly 90 degrees to enforce mechanical rigidity.
|
||||
|
||||
## 6. UI Components and Symbology
|
||||
Standard web UI conventions are replaced with utilitarian, industrial graphic elements.
|
||||
|
||||
* **Syntax Decoration:** Utilization of ASCII characters to frame data points.
|
||||
* *Framing:* `[ DELIVERY SYSTEMS ]`, `< RE-IND >`
|
||||
* *Directional:* `>>>`, `///`, `\\\\`
|
||||
* **Industrial Markers:** Prominent integration of registration (`®`), copyright (`©`), and trademark (`™`) symbols functioning as structural geometric elements rather than legal text.
|
||||
* **Technical Assets:** Integration of crosshairs (`+`) at grid intersections, repeating vertical lines (barcodes), thick horizontal warning stripes, and randomized string data (e.g., `REV 2.6`, `UNIT / D-01`) to simulate active mechanical processes.
|
||||
|
||||
## 7. Textural and Post-Processing Effects
|
||||
To prevent the design from appearing purely digital, simulated analog degradation is engineered into the frontend via CSS and SVG filters.
|
||||
|
||||
* **Halftone and 1-Bit Dithering:** Transforming continuous-tone images or large serif typography into dot-matrix patterns. Achieved via pre-processing or CSS `mix-blend-mode: multiply` overlays combined with SVG radial dot patterns.
|
||||
* **CRT Scanlines:** For terminal interfaces, applying a `repeating-linear-gradient` to the background to simulate horizontal electron beam sweeps (e.g., `repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px)`).
|
||||
* **Mechanical Noise:** A global, low-opacity SVG static/noise filter applied to the DOM root to introduce a unified physical grain across both dark and light modes.
|
||||
|
||||
## 8. Web Engineering Directives
|
||||
1. **Grid Determinism:** Utilize `display: grid; gap: 1px;` with contrasting parent/child background colors to generate mathematically perfect, razor-thin dividing lines without complex border declarations.
|
||||
2. **Semantic Rigidity:** Construct the DOM using precise semantic tags (`<data>`, `<samp>`, `<kbd>`, `<output>`, `<dl>`) to accurately reflect the technical nature of the telemetry.
|
||||
3. **Typography Clamping:** Implement CSS `clamp()` functions exclusively for macro-typography to ensure massive text scales aggressively while maintaining structural integrity across viewports.
|
||||
85
.agents/skills/minimalist-ui/SKILL.md
Normal file
@@ -0,0 +1,85 @@
|
||||
---
|
||||
name: minimalist-ui
|
||||
description: Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.
|
||||
---
|
||||
|
||||
# Protocol: Premium Utilitarian Minimalism UI Architect
|
||||
|
||||
## 1. Protocol Overview
|
||||
Name: Premium Utilitarian Minimalism & Editorial UI
|
||||
Description: An advanced frontend engineering directive for generating highly refined, ultra-minimalist, "document-style" web interfaces analogous to top-tier workspace platforms. This protocol strictly enforces a high-contrast warm monochrome palette, bespoke typographic hierarchies, meticulous structural macro-whitespace, bento-grid layouts, and an ultra-flat component architecture with deliberate muted pastel accents. It actively rejects standard generic SaaS design trends.
|
||||
|
||||
## 2. Absolute Negative Constraints (Banned Elements)
|
||||
The AI must strictly avoid the following generic web development defaults:
|
||||
- DO NOT use the "Inter", "Roboto", or "Open Sans" typefaces.
|
||||
- DO NOT use generic, thin-line icon libraries like "Lucide", "Feather", or standard "Heroicons".
|
||||
- DO NOT use Tailwind's default heavy drop shadows (e.g., `shadow-md`, `shadow-lg`, `shadow-xl`). Shadows must be practically non-existent or heavily customized to be ultra-diffuse and low opacity (< 0.05).
|
||||
- DO NOT use primary colored backgrounds for large elements or sections (e.g., no bright blue, green, or red hero sections).
|
||||
- DO NOT use gradients, neon colors, or 3D glassmorphism (beyond subtle navbar blurs).
|
||||
- DO NOT use `rounded-full` (pill shapes) for large containers, cards, or primary buttons.
|
||||
- DO NOT use emojis anywhere in code, markup, text content, headings, or alt text. Replace with proper icons or clean SVG primitives.
|
||||
- DO NOT use generic placeholder names like "John Doe", "Acme Corp", or "Lorem Ipsum". Use realistic, contextual content.
|
||||
- DO NOT use AI copywriting clichés: "Elevate", "Seamless", "Unleash", "Next-Gen", "Game-changer", "Delve". Write plain, specific language.
|
||||
|
||||
## 3. Typographic Architecture
|
||||
The interface must rely on extreme typographic contrast and premium font selection to establish an editorial feel.
|
||||
- Primary Sans-Serif (Body, UI, Buttons): Use clean, geometric, or system-native fonts with character. Target: `font-family: 'SF Pro Display', 'Geist Sans', 'Helvetica Neue', 'Switzer', sans-serif`.
|
||||
- Editorial Serif (Hero Headings & Quotes): Target: `font-family: 'Lyon Text', 'Newsreader', 'Playfair Display', 'Instrument Serif', serif`. Apply tight tracking (`letter-spacing: -0.02em` to `-0.04em`) and tight line-height (`1.1`).
|
||||
- Monospace (Code, Keystrokes, Meta-data): Target: `font-family: 'Geist Mono', 'SF Mono', 'JetBrains Mono', monospace`.
|
||||
- Text Colors: Body text must never be absolute black (`#000000`). Use off-black/charcoal (`#111111` or `#2F3437`) with a generous `line-height` of `1.6` for legibility. Secondary text should be muted gray (`#787774`).
|
||||
|
||||
## 4. Color Palette (Warm Monochrome + Spot Pastels)
|
||||
Color is a scarce resource, utilized only for semantic meaning or subtle accents.
|
||||
- Canvas / Background: Pure White `#FFFFFF` or Warm Bone/Off-White `#F7F6F3` / `#FBFBFA`.
|
||||
- Primary Surface (Cards): `#FFFFFF` or `#F9F9F8`.
|
||||
- Structural Borders / Dividers: Ultra-light gray `#EAEAEA` or `rgba(0,0,0,0.06)`.
|
||||
- Accent Colors: Exclusively use highly desaturated, washed-out pastels for tags, inline code backgrounds, or subtle icon backgrounds.
|
||||
- Pale Red: `#FDEBEC` (Text: `#9F2F2D`)
|
||||
- Pale Blue: `#E1F3FE` (Text: `#1F6C9F`)
|
||||
- Pale Green: `#EDF3EC` (Text: `#346538`)
|
||||
- Pale Yellow: `#FBF3DB` (Text: `#956400`)
|
||||
|
||||
## 5. Component Specifications
|
||||
- Bento Box Feature Grids:
|
||||
- Utilize asymmetrical CSS Grid layouts.
|
||||
- Cards must have exactly `border: 1px solid #EAEAEA`.
|
||||
- Border-radius must be crisp: `8px` or `12px` maximum.
|
||||
- Internal padding must be generous (e.g., `24px` to `40px`).
|
||||
- Primary Call-To-Action (Buttons):
|
||||
- Solid background `#111111`, text `#FFFFFF`.
|
||||
- Slight border-radius (`4px` to `6px`). No box-shadow.
|
||||
- Hover state should be a subtle color shift to `#333333` or a micro-scale `transform: scale(0.98)`.
|
||||
- Tags & Status Badges:
|
||||
- Pill-shaped (`border-radius: 9999px`), very small typography (`text-xs`), uppercase with wide tracking (`letter-spacing: 0.05em`).
|
||||
- Background must use the defined Muted Pastels.
|
||||
- Accordions (FAQ):
|
||||
- Strip all container boxes. Separate items only with a `border-bottom: 1px solid #EAEAEA`.
|
||||
- Use a clean, sharp `+` and `-` icon for the toggle state.
|
||||
- Keystroke Micro-UIs:
|
||||
- Render shortcuts as physical keys using `<kbd>` tags: `border: 1px solid #EAEAEA`, `border-radius: 4px`, `background: #F7F6F3`, using the Monospace font.
|
||||
- Faux-OS Window Chrome:
|
||||
- When mocking up software, wrap it in a minimalist container with a white top bar containing three small, light gray circles (replicating macOS window controls).
|
||||
|
||||
## 6. Iconography & Imagery Directives
|
||||
- System Icons: Use "Phosphor Icons (Bold or Fill weights)" or "Radix UI Icons" for a technical, slightly thicker-stroke aesthetic. Standardize stroke width across all icons.
|
||||
- Illustrations: Monochromatic, rough continuous-line ink sketches on a white background, featuring a single offset geometric shape filled with a muted pastel color.
|
||||
- Photography: Use high-quality, desaturated images with a warm tone. Apply subtle overlays (`opacity: 0.04` warm grain) to blend photos into the monochrome palette. Never use oversaturated stock photos. Use reliable placeholders like `https://picsum.photos/seed/{context}/1200/800` when real assets are unavailable.
|
||||
- Hero & Section Backgrounds: Sections should not feel empty and flat. Use subtle full-width background imagery at very low opacity, soft radial light spots (`radial-gradient` with warm tones at `opacity: 0.03`), or minimal geometric line patterns to add depth without breaking the clean aesthetic.
|
||||
|
||||
## 7. Subtle Motion & Micro-Animations
|
||||
Motion should feel invisible — present but never distracting. The goal is quiet sophistication, not spectacle.
|
||||
- Scroll Entry: Elements fade in gently as they enter the viewport. Use `translateY(12px)` + `opacity: 0` resolving over `600ms` with `cubic-bezier(0.16, 1, 0.3, 1)`. Use `IntersectionObserver`, never `window.addEventListener('scroll')`.
|
||||
- Hover States: Cards lift with an ultra-subtle shadow shift (`box-shadow` transitioning from `0 0 0` to `0 2px 8px rgba(0,0,0,0.04)` over `200ms`). Buttons respond with `scale(0.98)` on `:active`.
|
||||
- Staggered Reveals: Lists and grid items enter with a cascade delay (`animation-delay: calc(var(--index) * 80ms)`). Never mount everything at once.
|
||||
- Background Ambient Motion: Optional. A single, very slow-moving radial gradient blob (`animation-duration: 20s+`, `opacity: 0.02-0.04`) drifting behind hero sections. Must be applied to a `position: fixed; pointer-events: none` layer. Never on scrolling containers.
|
||||
- Performance: Animate exclusively via `transform` and `opacity`. No layout-triggering properties (`top`, `left`, `width`, `height`). Use `will-change: transform` sparingly and only on actively animating elements.
|
||||
|
||||
## 8. Execution Protocol
|
||||
When tasked with writing frontend code (HTML, React, Tailwind, Vue) or designing a layout:
|
||||
1. Establish the macro-whitespace first. Use massive vertical padding between sections (e.g., `py-24` or `py-32` in Tailwind).
|
||||
2. Constrain the main typography content width to `max-w-4xl` or `max-w-5xl`.
|
||||
3. Apply the custom typographic hierarchy and monochromatic color variables immediately.
|
||||
4. Ensure every card, divider, and border adheres strictly to the `1px solid #EAEAEA` rule.
|
||||
5. Add scroll-entry animations to all major content blocks.
|
||||
6. Ensure sections have visual depth through imagery, ambient gradients, or subtle textures — no empty flat backgrounds.
|
||||
7. Provide code that reflects this high-end, uncluttered, editorial aesthetic natively without requiring manual adjustments.
|
||||
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.
|
||||
121
.agents/skills/stitch-design-taste/DESIGN.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# Design System: Taste Standard
|
||||
**Skill:** stitch-design-taste
|
||||
|
||||
---
|
||||
|
||||
## Configuration — Set Your Style
|
||||
Adjust these dials before using this design system. They control how creative, dense, and animated the output should be. Pick the level that fits your project.
|
||||
|
||||
| Dial | Level | Description |
|
||||
|------|-------|-------------|
|
||||
| **Creativity** | `8` | `1` = Ultra-minimal, Swiss, silent, monochrome. `5` = Balanced, clean but with personality. `10` = Expressive, editorial, bold typography experiments, inline images in headlines, strong asymmetry. Default: `8` |
|
||||
| **Density** | `4` | `1` = Gallery-airy, massive whitespace. `5` = Balanced sections. `10` = Cockpit-dense, data-heavy. Default: `4` |
|
||||
| **Variance** | `8` | `1` = Predictable, symmetric grids. `5` = Subtle offsets. `10` = Artsy chaotic, no two sections alike. Default: `8` |
|
||||
| **Motion Intent** | `6` | `1` = Static, no animation noted. `5` = Subtle hover/entrance cues. `10` = Cinematic orchestration noted in every component. Default: `6` |
|
||||
|
||||
> **How to use:** Change the numbers above to match your project's vibe. At **Creativity 1–3**, the system produces clean, quiet, Notion-like interfaces. At **Creativity 7–10**, expect inline image typography, dramatic scale contrast, and strong editorial layouts. The rest of the rules below adapt to your chosen levels.
|
||||
|
||||
---
|
||||
|
||||
## 1. Visual Theme & Atmosphere
|
||||
A restrained, gallery-airy interface with confident asymmetric layouts and fluid spring-physics motion. The atmosphere is clinical yet warm — like a well-lit architecture studio where every element earns its place through function. Density is balanced (Level 4), variance runs high (Level 8) to prevent symmetrical boredom, and motion is fluid but never theatrical (Level 6). The overall impression: expensive, intentional, alive.
|
||||
|
||||
## 2. Color Palette & Roles
|
||||
- **Canvas White** (#F9FAFB) — Primary background surface. Warm-neutral, never clinical blue-white
|
||||
- **Pure Surface** (#FFFFFF) — Card and container fill. Used with whisper shadow for elevation
|
||||
- **Charcoal Ink** (#18181B) — Primary text. Zinc-950 depth — never pure black
|
||||
- **Steel Secondary** (#71717A) — Body text, descriptions, metadata. Zinc-500 warmth
|
||||
- **Muted Slate** (#94A3B8) — Tertiary text, timestamps, disabled states
|
||||
- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, structural 1px lines. Semi-transparent for depth
|
||||
- **Diffused Shadow** (rgba(0,0,0,0.05)) — Card elevation. Wide-spreading, 40px blur, -15px offset. Never harsh
|
||||
|
||||
### Accent Selection (Pick ONE per project)
|
||||
- **Emerald Signal** (#10B981) — For growth, success, positive data dashboards
|
||||
- **Electric Blue** (#3B82F6) — For productivity, SaaS, developer tools
|
||||
- **Deep Rose** (#E11D48) — For creative, editorial, fashion-adjacent projects
|
||||
- **Amber Warmth** (#F59E0B) — For community, social, warm-toned products
|
||||
|
||||
### Banned Colors
|
||||
- Purple/Violet neon gradients — the "AI Purple" aesthetic
|
||||
- Pure Black (#000000) — always Off-Black or Zinc-950
|
||||
- Oversaturated accents above 80% saturation
|
||||
- Mixed warm/cool gray systems within one project
|
||||
|
||||
## 3. Typography Rules
|
||||
- **Display:** `Geist`, `Satoshi`, `Cabinet Grotesk`, or `Outfit` — Track-tight (`-0.025em`), controlled fluid scale, weight-driven hierarchy (700–900). Not screaming. Leading compressed (`1.1`). Alternatives forced — `Inter` is BANNED for premium contexts
|
||||
- **Body:** Same family at weight 400 — Relaxed leading (`1.65`), 65ch max-width, Steel Secondary color (#71717A)
|
||||
- **Mono:** `Geist Mono` or `JetBrains Mono` — For code blocks, metadata, timestamps. When density exceeds Level 7, all numbers switch to monospace
|
||||
- **Scale:** Display at `clamp(2.25rem, 5vw, 3.75rem)`. Body at `1rem/1.125rem`. Mono metadata at `0.8125rem`
|
||||
|
||||
### Banned Fonts
|
||||
- `Inter` — banned everywhere in premium/creative contexts
|
||||
- Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) — BANNED. If serif is needed for editorial/creative, use only distinctive modern serifs like `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Never use default browser serif stacks. Serif is always BANNED in dashboards or software UIs regardless
|
||||
|
||||
## 4. Component Stylings
|
||||
* **Buttons:** Flat surface, no outer glow. Primary: accent fill with white text. Secondary: ghost/outline. Active state: `-1px translateY` or `scale(0.98)` for tactile push. Hover: subtle background shift, never glow
|
||||
* **Cards/Containers:** Generously rounded corners (`2.5rem`). Pure white fill. Whisper border (`1px`, semi-transparent). Diffused shadow (`0 20px 40px -15px rgba(0,0,0,0.05)`). Internal padding `2rem–2.5rem`. Used ONLY when elevation communicates hierarchy — high-density layouts replace cards with `border-top` dividers or negative space
|
||||
* **Inputs/Forms:** Label positioned above input. Helper text optional. Error text below in Deep Rose. Focus ring in accent color, `2px` offset. No floating labels. Standard `0.5rem` gap between label-input-error stack
|
||||
* **Navigation:** Sleek, sticky. Icons scale on hover (Dock Magnification optional). No hamburger on desktop. Clean horizontal with generous spacing
|
||||
* **Loaders:** Skeletal shimmer matching exact layout dimensions and rounded corners. Shifting light reflection across placeholder shapes. Never circular spinners
|
||||
* **Empty States:** Composed illustration or icon composition with guidance text. Never just "No data found"
|
||||
* **Error States:** Inline, contextual. Red accent underline or border. Clear recovery action
|
||||
|
||||
## 5. Hero Section
|
||||
The Hero is the first impression — it must be striking, creative, and never generic.
|
||||
- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Example: "We build [photo of hands typing] digital [photo of screen] products" — images sit inline at type-height, rounded, acting as visual punctuation between words. This is the signature creative technique
|
||||
- **No Overlapping Elements:** Text must never overlap images or other text. Every element has its own clear spatial zone. No z-index stacking of content layers, no absolute-positioned headlines over images. Clean separation always
|
||||
- **No Filler Text:** "Scroll to explore", "Swipe down", scroll arrow icons, bouncing chevrons, and any instructional UI chrome are BANNED. The user knows how to scroll. Let the content pull them in naturally
|
||||
- **Asymmetric Structure:** Centered Hero layouts are BANNED at this variance level. Use Split Screen (50/50), Left-Aligned text / Right visual, or Asymmetric Whitespace with large empty zones
|
||||
- **CTA Restraint:** Maximum one primary CTA button. No secondary "Learn more" links. No redundant micro-copy below the headline
|
||||
|
||||
## 6. Layout Principles
|
||||
- **Grid-First:** CSS Grid for all structural layouts. Never flexbox percentage math (`calc(33% - 1rem)` is BANNED)
|
||||
- **No Overlapping:** Elements must never overlap each other. No absolute-positioned layers stacking content on content. Every element occupies its own grid cell or flow position. Clean, separated spatial zones
|
||||
- **Feature Sections:** The "3 equal cards in a row" pattern is BANNED. Use 2-column Zig-Zag, asymmetric Bento grids (2fr 1fr 1fr), or horizontal scroll galleries
|
||||
- **Containment:** All content within `max-width: 1400px`, centered. Generous horizontal padding (`1rem` mobile, `2rem` tablet, `4rem` desktop)
|
||||
- **Full-Height:** Use `min-height: 100dvh` — never `height: 100vh` (iOS Safari address bar jump)
|
||||
- **Bento Architecture:** For feature grids, use Row 1: 3 columns | Row 2: 2 columns (70/30 split). Each tile contains a perpetual micro-animation
|
||||
|
||||
## 7. Responsive Rules
|
||||
Every screen must work flawlessly across all viewports. **Responsive is not optional — it is a hard requirement. Every single element must be tested at 375px, 768px, and 1440px.**
|
||||
- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to a strict single column. `width: 100%`, `padding: 1rem`, `gap: 1.5rem`. No exceptions
|
||||
- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure. All elements must fit within viewport width. If any element causes horizontal scroll, the design is broken
|
||||
- **Typography Scaling:** Headlines scale down gracefully via `clamp()`. Body text stays `1rem` minimum. Never shrink body below `14px`. Headlines must remain readable on 375px screens
|
||||
- **Touch Targets:** All interactive elements minimum `44px` tap target. Generous spacing between clickable items. Buttons must be full-width on mobile
|
||||
- **Image Behavior:** Hero and inline images scale proportionally. Inline typography images (photos between words) stack below the headline on mobile instead of inline
|
||||
- **Navigation:** Desktop horizontal nav collapses to a clean mobile menu (slide-in or full-screen overlay). No tiny hamburger icons without labels
|
||||
- **Cards & Grids:** Bento grids and asymmetric layouts revert to stacked single-column cards with full-width. Maintain internal padding (`1rem`)
|
||||
- **Spacing Consistency:** Vertical section gaps reduce proportionally on mobile (`clamp(3rem, 8vw, 6rem)`). Never cramped, never excessively airy
|
||||
- **Testing Viewports:** Designs must be verified at: `375px` (iPhone SE), `390px` (iPhone 14), `768px` (iPad), `1024px` (small laptop), `1440px` (desktop)
|
||||
|
||||
## 8. Motion & Interaction (Code-Phase Intent)
|
||||
> **Note:** Stitch generates static screens — it does not animate. This section documents the **intended motion behavior** so that the coding agent (Antigravity, Cursor, etc.) knows exactly how to implement animations when building the exported design into a live product.
|
||||
|
||||
- **Physics Engine:** Spring-based exclusively. `stiffness: 100, damping: 20`. No linear easing anywhere. Premium, weighty feel on all interactive elements
|
||||
- **Perpetual Micro-Loops:** Every active dashboard component has an infinite-loop state — Pulse on status dots, Typewriter on search bars, Float on feature icons, Shimmer on loading states
|
||||
- **Staggered Orchestration:** Lists and grids mount with cascaded delays (`animation-delay: calc(var(--index) * 100ms)`). Waterfall reveals, never instant mount
|
||||
- **Layout Transitions:** Smooth re-ordering via shared element IDs. Items swap positions with physics, simulating real-time intelligence
|
||||
- **Hardware Rules:** Animate ONLY `transform` and `opacity`. Never `top`, `left`, `width`, `height`. Grain/noise filters on fixed, pointer-events-none pseudo-elements only
|
||||
- **Performance:** CPU-heavy perpetual animations isolated in microscopic leaf components. Never trigger parent re-renders. Target 60fps minimum
|
||||
|
||||
## 9. Anti-Patterns (Banned)
|
||||
- No emojis — anywhere in UI, code, or alt text
|
||||
- No `Inter` font — use `Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`
|
||||
- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — if serif is needed, use distinctive modern serifs only (`Fraunces`, `Instrument Serif`)
|
||||
- No pure black (`#000000`) — Off-Black or Zinc-950 only
|
||||
- No neon outer glows or default box-shadow glows
|
||||
- No oversaturated accent colors above 80%
|
||||
- No excessive gradient text on large headers
|
||||
- No custom mouse cursors
|
||||
- No overlapping elements — text never overlaps images or other content. Clean spatial separation always
|
||||
- No 3-column equal card layouts for features
|
||||
- No centered Hero sections (at this variance level)
|
||||
- No filler UI text: "Scroll to explore", "Swipe down", "Discover more below", scroll arrows, bouncing chevrons — all BANNED
|
||||
- No generic names: "John Doe", "Sarah Chan", "Acme", "Nexus", "SmartFlow"
|
||||
- No fake round numbers: `99.99%`, `50%`, `1234567` — use organic data: `47.2%`, `+1 (312) 847-1928`
|
||||
- No AI copywriting clichés: "Elevate", "Seamless", "Unleash", "Next-Gen", "Revolutionize"
|
||||
- No broken Unsplash links — use `picsum.photos/seed/{id}/800/600` or SVG UI Avatars
|
||||
- No generic `shadcn/ui` defaults — customize radii, colors, shadows to match this system
|
||||
- No `z-index` spam — use only for Navbar, Modal, Overlay layer contexts
|
||||
- No `h-screen` — always `min-h-[100dvh]`
|
||||
- No circular loading spinners — skeletal shimmer only
|
||||
184
.agents/skills/stitch-design-taste/SKILL.md
Normal file
@@ -0,0 +1,184 @@
|
||||
---
|
||||
name: stitch-design-taste
|
||||
description: Semantic Design System Skill for Google Stitch. Generates agent-friendly DESIGN.md files that enforce premium, anti-generic UI standards — strict typography, calibrated color, asymmetric layouts, perpetual micro-motion, and hardware-accelerated performance.
|
||||
---
|
||||
|
||||
# Stitch Design Taste — Semantic Design System Skill
|
||||
|
||||
## Overview
|
||||
This skill generates `DESIGN.md` files optimized for Google Stitch screen generation. It translates the battle-tested anti-slop frontend engineering directives into Stitch's native semantic design language — descriptive, natural-language rules paired with precise values that Stitch's AI agent can interpret to produce premium, non-generic interfaces.
|
||||
|
||||
The generated `DESIGN.md` serves as the **single source of truth** for prompting Stitch to generate new screens that align with a curated, high-agency design language. Stitch interprets design through **"Visual Descriptions"** supported by specific color values, typography specs, and component behaviors.
|
||||
|
||||
## Prerequisites
|
||||
- Access to Google Stitch via [labs.google/stitch](https://labs.google/stitch)
|
||||
- Optionally: Stitch MCP Server for programmatic integration with Cursor, Antigravity, or Gemini CLI
|
||||
|
||||
## The Goal
|
||||
Generate a `DESIGN.md` file that encodes:
|
||||
1. **Visual atmosphere** — the mood, density, and design philosophy
|
||||
2. **Color calibration** — neutrals, accents, and banned patterns with hex codes
|
||||
3. **Typographic architecture** — font stacks, scale hierarchy, and anti-patterns
|
||||
4. **Component behaviors** — buttons, cards, inputs with interaction states
|
||||
5. **Layout principles** — grid systems, spacing philosophy, responsive strategy
|
||||
6. **Motion philosophy** — animation engine specs, spring physics, perpetual micro-interactions
|
||||
7. **Anti-patterns** — explicit list of banned AI design clichés
|
||||
|
||||
## Analysis & Synthesis Instructions
|
||||
|
||||
### 1. Define the Atmosphere
|
||||
Evaluate the target project's intent. Use evocative adjectives from the taste spectrum:
|
||||
- **Density:** "Art Gallery Airy" (1–3) → "Daily App Balanced" (4–7) → "Cockpit Dense" (8–10)
|
||||
- **Variance:** "Predictable Symmetric" (1–3) → "Offset Asymmetric" (4–7) → "Artsy Chaotic" (8–10)
|
||||
- **Motion:** "Static Restrained" (1–3) → "Fluid CSS" (4–7) → "Cinematic Choreography" (8–10)
|
||||
|
||||
Default baseline: Variance 8, Motion 6, Density 4. Adapt dynamically based on user's vibe description.
|
||||
|
||||
### 2. Map the Color Palette
|
||||
For each color provide: **Descriptive Name** + **Hex Code** + **Functional Role**.
|
||||
|
||||
**Mandatory constraints:**
|
||||
- Maximum 1 accent color. Saturation below 80%
|
||||
- The "AI Purple/Blue Neon" aesthetic is strictly BANNED — no purple button glows, no neon gradients
|
||||
- Use absolute neutral bases (Zinc/Slate) with high-contrast singular accents
|
||||
- Stick to one palette for the entire output — no warm/cool gray fluctuation
|
||||
- Never use pure black (`#000000`) — use Off-Black, Zinc-950, or Charcoal
|
||||
|
||||
### 3. Establish Typography Rules
|
||||
- **Display/Headlines:** Track-tight, controlled scale. Not screaming. Hierarchy through weight and color, not just massive size
|
||||
- **Body:** Relaxed leading, max 65 characters per line
|
||||
- **Font Selection:** `Inter` is BANNED for premium/creative contexts. Force unique character: `Geist`, `Outfit`, `Cabinet Grotesk`, or `Satoshi`
|
||||
- **Serif Ban:** Generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`, `Palatino`) are BANNED. If serif is needed for editorial/creative contexts, use only distinctive modern serifs: `Fraunces`, `Gambarino`, `Editorial New`, or `Instrument Serif`. Serif is always BANNED in dashboards or software UIs
|
||||
- **Dashboard Constraint:** Use Sans-Serif pairings exclusively (`Geist` + `Geist Mono` or `Satoshi` + `JetBrains Mono`)
|
||||
- **High-Density Override:** When density exceeds 7, all numbers must use Monospace
|
||||
|
||||
### 4. Define the Hero Section
|
||||
The Hero is the first impression and must be creative, striking, and never generic:
|
||||
- **Inline Image Typography:** Embed small, contextual photos or visuals directly between words or letters in the headline. Images sit inline at type-height, rounded, acting as visual punctuation. This is the signature creative technique
|
||||
- **No Overlapping:** Text must never overlap images or other text. Every element occupies its own clean spatial zone
|
||||
- **No Filler Text:** "Scroll to explore", "Swipe down", scroll arrow icons, bouncing chevrons are BANNED. The content should pull users in naturally
|
||||
- **Asymmetric Structure:** Centered Hero layouts BANNED when variance exceeds 4
|
||||
- **CTA Restraint:** Maximum one primary CTA. No secondary "Learn more" links
|
||||
|
||||
### 5. Describe Component Stylings
|
||||
For each component type, describe shape, color, shadow depth, and interaction behavior:
|
||||
- **Buttons:** Tactile push feedback on active state. No neon outer glows. No custom mouse cursors
|
||||
- **Cards:** Use ONLY when elevation communicates hierarchy. Tint shadows to background hue. For high-density layouts, replace cards with border-top dividers or negative space
|
||||
- **Inputs/Forms:** Label above input, helper text optional, error text below. Standard gap spacing
|
||||
- **Loading States:** Skeletal loaders matching layout dimensions — no generic circular spinners
|
||||
- **Empty States:** Composed compositions indicating how to populate data
|
||||
- **Error States:** Clear, inline error reporting
|
||||
|
||||
### 6. Define Layout Principles
|
||||
- No overlapping elements — every element occupies its own clear spatial zone. No absolute-positioned content stacking
|
||||
- Centered Hero sections are BANNED when variance exceeds 4 — force Split Screen, Left-Aligned, or Asymmetric Whitespace
|
||||
- The generic "3 equal cards horizontally" feature row is BANNED — use 2-column Zig-Zag, asymmetric grid, or horizontal scroll
|
||||
- CSS Grid over Flexbox math — never use `calc()` percentage hacks
|
||||
- Contain layouts using max-width constraints (e.g., 1400px centered)
|
||||
- Full-height sections must use `min-h-[100dvh]` — never `h-screen` (iOS Safari catastrophic jump)
|
||||
|
||||
### 7. Define Responsive Rules
|
||||
Every design must work across all viewports:
|
||||
- **Mobile-First Collapse (< 768px):** All multi-column layouts collapse to single column. No exceptions
|
||||
- **No Horizontal Scroll:** Horizontal overflow on mobile is a critical failure
|
||||
- **Typography Scaling:** Headlines scale via `clamp()`. Body text minimum `1rem`/`14px`
|
||||
- **Touch Targets:** All interactive elements minimum `44px` tap target
|
||||
- **Image Behavior:** Inline typography images (photos between words) stack below headline on mobile
|
||||
- **Navigation:** Desktop horizontal nav collapses to clean mobile menu
|
||||
- **Spacing:** Vertical section gaps reduce proportionally (`clamp(3rem, 8vw, 6rem)`)
|
||||
|
||||
### 8. Encode Motion Philosophy
|
||||
- **Spring Physics default:** `stiffness: 100, damping: 20` — premium, weighty feel. No linear easing
|
||||
- **Perpetual Micro-Interactions:** Every active component should have an infinite loop state (Pulse, Typewriter, Float, Shimmer)
|
||||
- **Staggered Orchestration:** Never mount lists instantly — use cascade delays for waterfall reveals
|
||||
- **Performance:** Animate exclusively via `transform` and `opacity`. Never animate `top`, `left`, `width`, `height`. Grain/noise filters on fixed pseudo-elements only
|
||||
|
||||
### 9. List Anti-Patterns (AI Tells)
|
||||
Encode these as explicit "NEVER DO" rules in the DESIGN.md:
|
||||
- No emojis anywhere
|
||||
- No `Inter` font
|
||||
- No generic serif fonts (`Times New Roman`, `Georgia`, `Garamond`) — distinctive modern serifs only if needed
|
||||
- No pure black (`#000000`)
|
||||
- No neon/outer glow shadows
|
||||
- No oversaturated accents
|
||||
- No excessive gradient text on large headers
|
||||
- No custom mouse cursors
|
||||
- No overlapping elements — clean spatial separation always
|
||||
- No 3-column equal card layouts
|
||||
- No generic names ("John Doe", "Acme", "Nexus")
|
||||
- No fake round numbers (`99.99%`, `50%`)
|
||||
- No AI copywriting clichés ("Elevate", "Seamless", "Unleash", "Next-Gen")
|
||||
- No filler UI text: "Scroll to explore", "Swipe down", scroll arrows, bouncing chevrons
|
||||
- No broken Unsplash links — use `picsum.photos` or SVG avatars
|
||||
- No centered Hero sections (for high-variance projects)
|
||||
|
||||
## Output Format (DESIGN.md Structure)
|
||||
|
||||
```markdown
|
||||
# Design System: [Project Title]
|
||||
|
||||
## 1. Visual Theme & Atmosphere
|
||||
(Evocative description of the mood, density, variance, and motion intensity.
|
||||
Example: "A restrained, gallery-airy interface with confident asymmetric layouts
|
||||
and fluid spring-physics motion. The atmosphere is clinical yet warm — like a
|
||||
well-lit architecture studio.")
|
||||
|
||||
## 2. Color Palette & Roles
|
||||
- **Canvas White** (#F9FAFB) — Primary background surface
|
||||
- **Pure Surface** (#FFFFFF) — Card and container fill
|
||||
- **Charcoal Ink** (#18181B) — Primary text, Zinc-950 depth
|
||||
- **Muted Steel** (#71717A) — Secondary text, descriptions, metadata
|
||||
- **Whisper Border** (rgba(226,232,240,0.5)) — Card borders, 1px structural lines
|
||||
- **[Accent Name]** (#XXXXXX) — Single accent for CTAs, active states, focus rings
|
||||
(Max 1 accent. Saturation < 80%. No purple/neon.)
|
||||
|
||||
## 3. Typography Rules
|
||||
- **Display:** [Font Name] — Track-tight, controlled scale, weight-driven hierarchy
|
||||
- **Body:** [Font Name] — Relaxed leading, 65ch max-width, neutral secondary color
|
||||
- **Mono:** [Font Name] — For code, metadata, timestamps, high-density numbers
|
||||
- **Banned:** Inter, generic system fonts for premium contexts. Serif fonts banned in dashboards.
|
||||
|
||||
## 4. Component Stylings
|
||||
* **Buttons:** Flat, no outer glow. Tactile -1px translate on active. Accent fill for primary, ghost/outline for secondary.
|
||||
* **Cards:** Generously rounded corners (2.5rem). Diffused whisper shadow. Used only when elevation serves hierarchy. High-density: replace with border-top dividers.
|
||||
* **Inputs:** Label above, error below. Focus ring in accent color. No floating labels.
|
||||
* **Loaders:** Skeletal shimmer matching exact layout dimensions. No circular spinners.
|
||||
* **Empty States:** Composed, illustrated compositions — not just "No data" text.
|
||||
|
||||
## 5. Layout Principles
|
||||
(Grid-first responsive architecture. Asymmetric splits for Hero sections.
|
||||
Strict single-column collapse below 768px. Max-width containment.
|
||||
No flexbox percentage math. Generous internal padding.)
|
||||
|
||||
## 6. Motion & Interaction
|
||||
(Spring physics for all interactive elements. Staggered cascade reveals.
|
||||
Perpetual micro-loops on active dashboard components. Hardware-accelerated
|
||||
transforms only. Isolated Client Components for CPU-heavy animations.)
|
||||
|
||||
## 7. Anti-Patterns (Banned)
|
||||
(Explicit list of forbidden patterns: no emojis, no Inter, no pure black,
|
||||
no neon glows, no 3-column equal grids, no AI copywriting clichés,
|
||||
no generic placeholder names, no broken image links.)
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
- **Be Descriptive:** "Deep Charcoal Ink (#18181B)" — not just "dark text"
|
||||
- **Be Functional:** Explain what each element is used for
|
||||
- **Be Consistent:** Same terminology throughout the document
|
||||
- **Be Precise:** Include exact hex codes, rem values, pixel values in parentheses
|
||||
- **Be Opinionated:** This is not a neutral template — it enforces a specific, premium aesthetic
|
||||
|
||||
## Tips for Success
|
||||
1. Start with the atmosphere — understand the vibe before detailing tokens
|
||||
2. Look for patterns — identify consistent spacing, sizing, and styling
|
||||
3. Think semantically — name colors by purpose, not just appearance
|
||||
4. Consider hierarchy — document how visual weight communicates importance
|
||||
5. Encode the bans — anti-patterns are as important as the rules themselves
|
||||
|
||||
## Common Pitfalls to Avoid
|
||||
- Using technical jargon without translation ("rounded-xl" instead of "generously rounded corners")
|
||||
- Omitting hex codes or using only descriptive names
|
||||
- Forgetting functional roles of design elements
|
||||
- Being too vague in atmosphere descriptions
|
||||
- Ignoring the anti-pattern list — these are what make the output premium
|
||||
- Defaulting to generic "safe" designs instead of enforcing the curated aesthetic
|
||||
@@ -22,7 +22,4 @@ apps/api/dist
|
||||
mcps
|
||||
assets
|
||||
agent-transcripts
|
||||
.agents
|
||||
.cursor
|
||||
.ui-ux-pro-max-skill
|
||||
**/.vite
|
||||
|
||||
@@ -22,27 +22,8 @@ RUN_MIGRATIONS_ON_START=false
|
||||
|
||||
# 对外端口(宝塔/Nginx 反代推荐只暴露前端,API 经反向代理访问)
|
||||
BIND_ADDR=127.0.0.1
|
||||
ADMIN_PORT=8081
|
||||
|
||||
# ── 四套 player 镜像 tag 与宿主机端口 ──────────────────────────
|
||||
# main(暗金主站)
|
||||
PLAYER_IMAGE_TAG=main
|
||||
PLAYER_PORT=8082
|
||||
|
||||
# theme-2(Pinnacle 蓝白)
|
||||
PLAYER2_IMAGE_TAG=theme-2
|
||||
PLAYER2_PORT=8083
|
||||
|
||||
# theme-3(统一移动端视觉)
|
||||
PLAYER3_IMAGE_TAG=theme-3
|
||||
PLAYER3_PORT=8084
|
||||
|
||||
# theme-4(海军蓝暗色极简)
|
||||
PLAYER4_IMAGE_TAG=theme-4
|
||||
PLAYER4_PORT=8085
|
||||
|
||||
# CORS 白名单:四个玩家站域名 + 管理后台(逗号分隔,勿含空格,勿带末尾 /)
|
||||
# CORS_ORIGINS=https://www.example.com,https://theme2.example.com,https://theme3.example.com,https://theme4.example.com,https://admin.example.com
|
||||
ADMIN_PORT=8081
|
||||
|
||||
# 管理端构建时注入:生成邀请注册链接的玩家端公网地址(勿带末尾 /)
|
||||
VITE_PLAYER_URL=https://www.thebet365.net
|
||||
|
||||
@@ -5,7 +5,6 @@ JWT_PLAYER_EXPIRES=24h
|
||||
JWT_ADMIN_EXPIRES=2h
|
||||
JWT_AGENT_EXPIRES=8h
|
||||
PORT=3000
|
||||
# Windows + Hyper-V/WSL 若 3000 报 EACCES,可改为 3100(apps/api/.env 本地配置,勿提交)
|
||||
NODE_ENV=development
|
||||
UPLOAD_DIR=
|
||||
|
||||
|
||||
6
.gitignore
vendored
@@ -8,12 +8,6 @@ docker-build.log
|
||||
thebet365-images.tar
|
||||
thebet365-images-*.tar
|
||||
thebet365-images-*.manifest.txt
|
||||
thebet365-full-themes-*.tar
|
||||
thebet365-full-themes-*.manifest.txt
|
||||
thebet365-player-*.tar
|
||||
thebet365-player-*.manifest.txt
|
||||
thebet365-admin-latest.tar
|
||||
thebet365-admin-latest.manifest.txt
|
||||
.claude/
|
||||
*.log
|
||||
.DS_Store
|
||||
|
||||
28
AGENTS.md
@@ -1,5 +1,12 @@
|
||||
# AGENTS.md
|
||||
|
||||
> 给 AI 编程助手(Cursor 等)看的项目速查手册,浓缩开发约定与易错点。
|
||||
> 人类日常开发请优先看 `README.md` 与 `docs/`。
|
||||
|
||||
如果你是AI请每次读了这个文件就在已有的次数上+1
|
||||
|
||||
当前被读次数: 3
|
||||
|
||||
## 目录
|
||||
|
||||
|
||||
@@ -53,7 +60,7 @@
|
||||
|
||||
## API 领域结构
|
||||
|
||||
业务规则放在 `apps/api/src/domains/`*,应用层只做编排:
|
||||
业务规则放在 `apps/api/src/domains/*`,应用层只做编排:
|
||||
|
||||
|
||||
| 领域 | 路径 | 职责 |
|
||||
@@ -90,14 +97,6 @@
|
||||
- 管理端切页慢的分析与优化任务见 `docs/admin-page-switch-performance.md`。
|
||||
- **不要**把 `apps/player/dist/` 提交进 Git;生产由 Docker 构建生成静态资源。
|
||||
|
||||
### 玩家端主题生图约束
|
||||
|
||||
- 生成 `apps/player` 主题图片资源时,必须先查看并参考现有同场景资源,优先保持当前暗金足球主题一致,不要另起一套风格。
|
||||
- PC 首页/赛事详情/弹窗类赛事面板应优先对齐 `apps/player/src/assets/images/generated/pc-featured-match-bg-v1.webp`:暗金球场、中央 V 型光线、薄金色边框、低亮度背景、内容区域干净。
|
||||
- 弹窗资源必须是“带完整边框的面板图”,不能只是普通背景图;四边边框要在图片内完整可见,中心区域要足够暗且简洁,保证文字可读。
|
||||
- 避免生成过度写实、照片质感过重、厚重金属、强眩光、烟雾、人物、旗帜、logo、文字、数字;也不要生成与主题不一致的纯矢量科幻线框风。
|
||||
- 生成资源默认输出 WebP,控制体积,文件放在 `apps/player/src/assets/images/generated/`,命名带清晰场景和版本号(如 `modal-gold-frame-v4.webp`)。
|
||||
|
||||
## i18n 改文案流程
|
||||
|
||||
支持语言均为 **zh-CN / en-US / ms-MY**(马来语)。改文案须**三语同步**,不要只改中文。
|
||||
@@ -137,7 +136,7 @@
|
||||
|
||||
**改文案步骤:**
|
||||
|
||||
1. 确定 key 命名:导航 `nav.`*、通用 `common.`*、页面 `user.*` / `match.*` / `deposit.*` 等,与现有前缀保持一致。
|
||||
1. 确定 key 命名:导航 `nav.`*、通用 `common.*`、页面 `user.*` / `match.*` / `deposit.*` 等,与现有前缀保持一致。
|
||||
2. 在 `admin-messages.ts` 的 **zh / en / ms 三个对象**里各加同名 key(核心短文案)。
|
||||
3. 若属于某列表页/弹窗长文案,优先加到 `admin-pages.ts`(中/英)与 `admin-pages-ms.ts`(马来)的对应 export,它们会 spread 进 `admin-messages`。
|
||||
4. 表单校验错误:throw `FormValidationError('err.xxx')` 并在三语里定义 `err.xxx`。
|
||||
@@ -198,9 +197,15 @@
|
||||
| `docs/短信调试与日志说明.md` | 创蓝短信排错 |
|
||||
| `docs/UAT_CHECKLIST.md` | 上线前回归清单 |
|
||||
| `docs/player-mobile-performance.md` | 玩家端性能验收 |
|
||||
| | |
|
||||
| `docs/admin-page-switch-performance.md` | 管理端切页优化任务 |
|
||||
|
||||
|
||||
## 测试与冒烟
|
||||
|
||||
- Jest 用例在 `apps/api/src/**/*.spec.ts`,`rootDir: src`;文档中的单元/规则测试一般不依赖真实数据库。
|
||||
- 管理端「冒烟测试」页调用 DB 相关检查;`SmokeTestService` 非生产默认可用,生产需 `ALLOW_SMOKE_TESTS=true`。
|
||||
- UAT 回归流程见 `docs/UAT_CHECKLIST.md`(含管理端 UI 冒烟与钱包/代理额度手工检查)。
|
||||
|
||||
## 部署注意
|
||||
|
||||
- 生产 compose 使用 `.env.docker`:`docker compose -f docker-compose.prod.yml --env-file .env.docker up -d --build`,或配置好后 `pnpm docker:up`。
|
||||
@@ -217,3 +222,4 @@
|
||||
- 不要提交 `.env`、`.env.docker`、镜像 tar、`apps/*/dist/`。
|
||||
- 改 player 主题相关文件时,先确认当前分支是 `main` 还是 `theme-`*,避免用错 CSS 变量(如 theme-2 无 `--gold`)。
|
||||
- 管理端改列表页性能时,参考 `docs/admin-page-switch-performance.md` 任务清单,优先 KeepAlive + 缓存而非盲目减 API 字段。
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" type="image/png" href="/logo.png" />
|
||||
<link rel="apple-touch-icon" href="/logo.png" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
|
||||
@@ -50,22 +50,6 @@ button { cursor: pointer; font-family: inherit; }
|
||||
html, body {
|
||||
scrollbar-width: none;
|
||||
-ms-overflow-style: none;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
input,
|
||||
select,
|
||||
textarea,
|
||||
.el-input__inner,
|
||||
.el-textarea__inner {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
}
|
||||
html::-webkit-scrollbar,
|
||||
body::-webkit-scrollbar {
|
||||
|
||||
@@ -112,11 +112,7 @@ type SubAgentLevelState = {
|
||||
|
||||
const subAgentLevelState = reactive<Record<number, SubAgentLevelState>>({});
|
||||
const agentLevelCounts = ref<Record<number, number>>({});
|
||||
const hierarchySettings = ref({ maxAgentLevel: 0, defaultSubAgentCreditRatio: 50 });
|
||||
const agentSuspendDefaults = ref({
|
||||
suspendFreezeDirectPlayers: false,
|
||||
suspendBlockPlayerLogin: false,
|
||||
});
|
||||
const hierarchySettings = ref({ maxAgentLevel: 0 });
|
||||
|
||||
function ensureSubAgentState(level: number): SubAgentLevelState {
|
||||
if (!subAgentLevelState[level]) {
|
||||
@@ -224,9 +220,7 @@ const creditContextLoading = ref(false);
|
||||
/* ─── Init ─── */
|
||||
let pageInitPromise: Promise<void> | null = null;
|
||||
const pageInitLoaded = ref(false);
|
||||
const DEFAULT_SUB_AGENT_CREDIT_RATIO = computed(
|
||||
() => hierarchySettings.value.defaultSubAgentCreditRatio || 50,
|
||||
);
|
||||
const DEFAULT_SUB_AGENT_CREDIT_RATIO = 50;
|
||||
const freezeAgentVisible = ref(false);
|
||||
const freezeAgentLoading = ref(false);
|
||||
const freezeAgentTarget = ref<AgentRow | null>(null);
|
||||
@@ -329,7 +323,7 @@ function computeSubAgentCreditByRatio(available: number, ratioPercent: number):
|
||||
const creditQuickRatios = [10, 15, 20, 30] as const;
|
||||
|
||||
function computeDefaultSubAgentCreditLimit(available: number): number {
|
||||
return computeSubAgentCreditByRatio(available, DEFAULT_SUB_AGENT_CREDIT_RATIO.value);
|
||||
return computeSubAgentCreditByRatio(available, DEFAULT_SUB_AGENT_CREDIT_RATIO);
|
||||
}
|
||||
|
||||
function applyCreateSubAgentCreditRatio(ratioPercent: number) {
|
||||
@@ -445,33 +439,16 @@ onActivated(() => {
|
||||
}
|
||||
});
|
||||
|
||||
async function loadAgentSuspendDefaults() {
|
||||
try {
|
||||
const { data } = await api.get('/admin/agents/settings/suspend');
|
||||
agentSuspendDefaults.value = {
|
||||
suspendFreezeDirectPlayers: Boolean(data.data?.suspendFreezeDirectPlayers),
|
||||
suspendBlockPlayerLogin: Boolean(data.data?.suspendBlockPlayerLogin),
|
||||
};
|
||||
} catch {
|
||||
/* keep defaults */
|
||||
}
|
||||
}
|
||||
|
||||
async function loadUsersPageInit() {
|
||||
try {
|
||||
const [pageInitRes] = await Promise.all([
|
||||
api.get('/admin/users/page-init'),
|
||||
loadAgentSuspendDefaults(),
|
||||
]);
|
||||
const { data } = pageInitRes;
|
||||
const { data } = await api.get('/admin/users/page-init');
|
||||
const payload = data.data as {
|
||||
hierarchySettings?: { maxAgentLevel: number; defaultSubAgentCreditRatio?: number };
|
||||
hierarchySettings?: { maxAgentLevel: number };
|
||||
agentLevelCounts?: Record<number, number>;
|
||||
};
|
||||
if (payload.hierarchySettings) {
|
||||
hierarchySettings.value = {
|
||||
maxAgentLevel: payload.hierarchySettings.maxAgentLevel ?? 0,
|
||||
defaultSubAgentCreditRatio: payload.hierarchySettings.defaultSubAgentCreditRatio ?? 50,
|
||||
};
|
||||
}
|
||||
if (payload.agentLevelCounts) {
|
||||
@@ -1131,8 +1108,8 @@ const freezeAgentIsSuspend = computed(() => {
|
||||
function toggleFreezeAgent(row: AgentRow) {
|
||||
freezeAgentTarget.value = row;
|
||||
freezeAgentForm.value = {
|
||||
freezeDirectPlayers: agentSuspendDefaults.value.suspendFreezeDirectPlayers,
|
||||
blockDirectPlayerLogin: agentSuspendDefaults.value.suspendBlockPlayerLogin,
|
||||
freezeDirectPlayers: false,
|
||||
blockDirectPlayerLogin: false,
|
||||
unfreezeDirectPlayers: false,
|
||||
};
|
||||
freezeAgentVisible.value = true;
|
||||
|
||||
@@ -75,8 +75,6 @@ const notifyInbox = ref(false);
|
||||
interface InboxNotifySettings {
|
||||
inboxEnabled: boolean;
|
||||
deposit: boolean;
|
||||
banner: boolean;
|
||||
announcement: boolean;
|
||||
}
|
||||
|
||||
interface MessageBroadcastItem {
|
||||
@@ -102,8 +100,6 @@ interface BroadcastTranslationForm {
|
||||
const inboxNotifySettings = ref<InboxNotifySettings>({
|
||||
inboxEnabled: true,
|
||||
deposit: true,
|
||||
banner: true,
|
||||
announcement: true,
|
||||
});
|
||||
const inboxNotifySaving = ref(false);
|
||||
|
||||
@@ -222,8 +218,6 @@ async function loadInboxNotifySettings() {
|
||||
inboxNotifySettings.value = {
|
||||
inboxEnabled: data.data?.inboxEnabled !== false,
|
||||
deposit: Boolean(data.data?.deposit),
|
||||
banner: data.data?.banner !== false,
|
||||
announcement: data.data?.announcement !== false,
|
||||
};
|
||||
} catch (e: unknown) {
|
||||
const err = e as { response?: { data?: { error?: string } } };
|
||||
@@ -238,14 +232,10 @@ async function saveInboxNotifySettings() {
|
||||
const { data } = await api.put('/admin/contents/inbox-notify-settings', {
|
||||
inboxEnabled: inboxNotifySettings.value.inboxEnabled,
|
||||
deposit: inboxNotifySettings.value.deposit,
|
||||
banner: inboxNotifySettings.value.banner,
|
||||
announcement: inboxNotifySettings.value.announcement,
|
||||
});
|
||||
inboxNotifySettings.value = {
|
||||
inboxEnabled: data.data?.inboxEnabled !== false,
|
||||
deposit: Boolean(data.data?.deposit),
|
||||
banner: data.data?.banner !== false,
|
||||
announcement: data.data?.announcement !== false,
|
||||
};
|
||||
ElMessage.success(t('msg.saved'));
|
||||
} catch (e: unknown) {
|
||||
@@ -795,30 +785,6 @@ void load();
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-show="inboxNotifySettings.inboxEnabled" class="inbox-notify-row">
|
||||
<div class="inbox-notify-row-text">
|
||||
<span class="inbox-notify-label">{{ t('content.inbox_notify.banner') }}</span>
|
||||
<span class="inbox-notify-hint">{{ t('content.inbox_notify.banner_hint') }}</span>
|
||||
</div>
|
||||
<el-switch
|
||||
v-model="inboxNotifySettings.banner"
|
||||
:disabled="!canManageContent || inboxNotifySaving"
|
||||
@change="saveInboxNotifySettings"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-show="inboxNotifySettings.inboxEnabled" class="inbox-notify-row">
|
||||
<div class="inbox-notify-row-text">
|
||||
<span class="inbox-notify-label">{{ t('content.inbox_notify.announcement') }}</span>
|
||||
<span class="inbox-notify-hint">{{ t('content.inbox_notify.announcement_hint') }}</span>
|
||||
</div>
|
||||
<el-switch
|
||||
v-model="inboxNotifySettings.announcement"
|
||||
:disabled="!canManageContent || inboxNotifySaving"
|
||||
@change="saveInboxNotifySettings"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p v-show="inboxNotifySettings.inboxEnabled" class="inbox-notify-notes-title">{{ t('content.inbox_notify.manual_title') }}</p>
|
||||
<ul v-show="inboxNotifySettings.inboxEnabled" class="inbox-notify-notes">
|
||||
<li>{{ t('content.inbox_notify.banner_note') }}</li>
|
||||
|
||||
@@ -27,11 +27,7 @@ const bettingLimits = ref({
|
||||
maxPayoutParlay: 1000000,
|
||||
dailyStakeLimit: 200000,
|
||||
});
|
||||
const hierarchySettings = ref({ maxAgentLevel: 0, defaultSubAgentCreditRatio: 50 });
|
||||
const agentSuspendSettings = ref({
|
||||
suspendFreezeDirectPlayers: false,
|
||||
suspendBlockPlayerLogin: false,
|
||||
});
|
||||
const hierarchySettings = ref({ maxAgentLevel: 0 });
|
||||
const platformDirectRate = ref(0);
|
||||
const adminInviteRate = ref(0);
|
||||
const resetAllowed = ref(false);
|
||||
@@ -40,7 +36,6 @@ const resetConfirmPhrase = ref('');
|
||||
const settingsSaving = ref(false);
|
||||
const limitsSaving = ref(false);
|
||||
const hierarchySaving = ref(false);
|
||||
const suspendSaving = ref(false);
|
||||
const platformDirectSaving = ref(false);
|
||||
const resetLoading = ref(false);
|
||||
const loading = ref(false);
|
||||
@@ -52,7 +47,7 @@ async function loadSettings() {
|
||||
const payload = data.data as {
|
||||
playerSettings?: typeof playerSettings.value;
|
||||
bettingLimits?: typeof bettingLimits.value;
|
||||
hierarchySettings?: { maxAgentLevel: number; defaultSubAgentCreditRatio?: number };
|
||||
hierarchySettings?: { maxAgentLevel: number };
|
||||
platformDirect?: { platformDirectRate?: number | string; adminInviteRate?: number | string };
|
||||
};
|
||||
if (payload.playerSettings) playerSettings.value = payload.playerSettings;
|
||||
@@ -60,7 +55,6 @@ async function loadSettings() {
|
||||
if (payload.hierarchySettings) {
|
||||
hierarchySettings.value = {
|
||||
maxAgentLevel: payload.hierarchySettings.maxAgentLevel ?? 0,
|
||||
defaultSubAgentCreditRatio: payload.hierarchySettings.defaultSubAgentCreditRatio ?? 50,
|
||||
};
|
||||
}
|
||||
if (payload.platformDirect) {
|
||||
@@ -99,27 +93,11 @@ async function savePlayerSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
async function loadAgentSuspendSettings() {
|
||||
try {
|
||||
const { data } = await api.get('/admin/agents/settings/suspend');
|
||||
agentSuspendSettings.value = {
|
||||
suspendFreezeDirectPlayers: Boolean(data.data?.suspendFreezeDirectPlayers),
|
||||
suspendBlockPlayerLogin: Boolean(data.data?.suspendBlockPlayerLogin),
|
||||
};
|
||||
} catch {
|
||||
/* keep defaults */
|
||||
}
|
||||
}
|
||||
|
||||
async function saveHierarchySettings() {
|
||||
hierarchySaving.value = true;
|
||||
try {
|
||||
const { data } = await api.put('/admin/agents/settings/hierarchy', hierarchySettings.value);
|
||||
hierarchySettings.value = {
|
||||
maxAgentLevel: data.data?.maxAgentLevel ?? hierarchySettings.value.maxAgentLevel,
|
||||
defaultSubAgentCreditRatio:
|
||||
data.data?.defaultSubAgentCreditRatio ?? hierarchySettings.value.defaultSubAgentCreditRatio,
|
||||
};
|
||||
hierarchySettings.value = { maxAgentLevel: data.data?.maxAgentLevel ?? hierarchySettings.value.maxAgentLevel };
|
||||
ElMessage.success(t('msg.saved'));
|
||||
} catch (e: unknown) {
|
||||
const err = e as { response?: { data?: { error?: string } } };
|
||||
@@ -129,23 +107,6 @@ async function saveHierarchySettings() {
|
||||
}
|
||||
}
|
||||
|
||||
async function saveAgentSuspendSettings() {
|
||||
suspendSaving.value = true;
|
||||
try {
|
||||
const { data } = await api.put('/admin/agents/settings/suspend', agentSuspendSettings.value);
|
||||
agentSuspendSettings.value = {
|
||||
suspendFreezeDirectPlayers: Boolean(data.data?.suspendFreezeDirectPlayers),
|
||||
suspendBlockPlayerLogin: Boolean(data.data?.suspendBlockPlayerLogin),
|
||||
};
|
||||
ElMessage.success(t('msg.saved'));
|
||||
} catch (e: unknown) {
|
||||
const err = e as { response?: { data?: { error?: string } } };
|
||||
ElMessage.error(err.response?.data?.error ?? t('msg.save_failed'));
|
||||
} finally {
|
||||
suspendSaving.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function savePlatformDirectSettings() {
|
||||
platformDirectSaving.value = true;
|
||||
try {
|
||||
@@ -216,7 +177,7 @@ onMounted(() => {
|
||||
void router.replace('/users');
|
||||
return;
|
||||
}
|
||||
void Promise.all([loadSettings(), loadAgentSuspendSettings(), loadResetDatabaseStatus()]);
|
||||
void Promise.all([loadSettings(), loadResetDatabaseStatus()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -250,17 +211,6 @@ onMounted(() => {
|
||||
:disabled="hierarchySaving"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('agent.hierarchy.default_sub_credit_ratio')">
|
||||
<el-input-number
|
||||
v-model="hierarchySettings.defaultSubAgentCreditRatio"
|
||||
:min="1"
|
||||
:max="100"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
:disabled="hierarchySaving"
|
||||
/>
|
||||
</el-form-item>
|
||||
<p class="list-settings-hint block-hint">{{ t('agent.hierarchy.default_sub_credit_ratio_hint') }}</p>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="hierarchySaving" @click="saveHierarchySettings">
|
||||
{{ t('common.save') }}
|
||||
@@ -269,27 +219,6 @@ onMounted(() => {
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-settings-block">
|
||||
<p class="list-settings-title">{{ t('agent.suspend.settings_title') }}</p>
|
||||
<p class="list-settings-hint">{{ t('agent.suspend.settings_hint') }}</p>
|
||||
<el-form inline size="small" class="settings-form">
|
||||
<el-form-item :label="t('agent.freeze.opt_freeze_direct_players')">
|
||||
<el-switch
|
||||
v-model="agentSuspendSettings.suspendFreezeDirectPlayers"
|
||||
:loading="suspendSaving"
|
||||
@change="saveAgentSuspendSettings"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('agent.freeze.opt_block_player_login')">
|
||||
<el-switch
|
||||
v-model="agentSuspendSettings.suspendBlockPlayerLogin"
|
||||
:loading="suspendSaving"
|
||||
@change="saveAgentSuspendSettings"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-settings-block">
|
||||
<p class="list-settings-title">{{ t('cashback.settings_title') }}</p>
|
||||
<el-form inline size="small" class="settings-form">
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { resolve } from 'path';
|
||||
import { resolveApiDevTarget } from '../../scripts/dev-api-target.mjs';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
|
||||
import { resolveDevApiTarget } from '../../scripts/resolve-dev-api-target.mjs';
|
||||
|
||||
const devApiTarget = resolveDevApiTarget();
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const analyze = process.env.ANALYZE === '1' || mode === 'analyze';
|
||||
const apiTarget = resolveApiDevTarget();
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
@@ -76,11 +75,10 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
publicDir: resolve(__dirname, '../../packages/shared/public'),
|
||||
server: {
|
||||
host: true,
|
||||
port: 5174,
|
||||
proxy: {
|
||||
'/api': { target: devApiTarget, changeOrigin: true },
|
||||
'/uploads': { target: devApiTarget, changeOrigin: true },
|
||||
'/api': { target: apiTarget, changeOrigin: true },
|
||||
'/uploads': { target: apiTarget, changeOrigin: true },
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "nest build",
|
||||
"dev": "node ../../scripts/ensure-port-free.mjs && nest start --watch",
|
||||
"dev": "node ../../scripts/ensure-port-free.mjs 3000 && nest start --watch",
|
||||
"start": "node dist/main",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
|
||||
@@ -85,28 +85,6 @@ describe('Admin RBAC (SEC010–SEC012)', () => {
|
||||
expect(guardAllows(user, 'settlement.resettle')).toBe(false);
|
||||
});
|
||||
|
||||
it('FINANCE_ADMIN has deposit and cashback permissions but not reset database', () => {
|
||||
const user = userWithRole('FINANCE_ADMIN');
|
||||
expect(guardAllows(user, 'deposit.manage')).toBe(true);
|
||||
expect(guardAllows(user, 'deposit.review')).toBe(true);
|
||||
expect(guardAllows(user, 'cashback.confirm')).toBe(true);
|
||||
expect(guardAllows(user, 'settings.reset_database')).toBe(false);
|
||||
});
|
||||
|
||||
it('MATCH_ADMIN cannot manage deposits or confirm cashback', () => {
|
||||
const user = userWithRole('MATCH_ADMIN');
|
||||
expect(guardAllows(user, 'deposit.manage')).toBe(false);
|
||||
expect(guardAllows(user, 'deposit.review')).toBe(false);
|
||||
expect(guardAllows(user, 'cashback.confirm')).toBe(false);
|
||||
});
|
||||
|
||||
it('SUPPORT cannot confirm cashback or manage deposits', () => {
|
||||
const user = userWithRole('SUPPORT');
|
||||
expect(guardAllows(user, 'cashback.confirm')).toBe(false);
|
||||
expect(guardAllows(user, 'deposit.manage')).toBe(false);
|
||||
expect(guardAllows(user, 'deposit.review')).toBe(false);
|
||||
});
|
||||
|
||||
it('SUPER_ADMIN bypasses permission checks', () => {
|
||||
const user = userWithRole('SUPER_ADMIN');
|
||||
expect(guardAllows(user, 'wallet.deposit')).toBe(true);
|
||||
|
||||
@@ -1,255 +0,0 @@
|
||||
import { Decimal } from '@prisma/client/runtime/library';
|
||||
import { AdminController } from './admin.controller';
|
||||
import { AgentsService } from '../../domains/agent/agents.service';
|
||||
import { createPrismaMock } from '../../testing/prisma-mock';
|
||||
|
||||
function stubDeps() {
|
||||
return {
|
||||
users: {},
|
||||
agents: { updateAgentAdmin: jest.fn() } as AgentsService | { updateAgentAdmin: jest.Mock },
|
||||
wallet: {},
|
||||
matches: {},
|
||||
catalogArchive: {},
|
||||
outright: {},
|
||||
markets: {},
|
||||
settlement: {},
|
||||
cashback: {},
|
||||
content: { create: jest.fn() },
|
||||
i18n: {},
|
||||
audit: { log: jest.fn().mockResolvedValue(undefined) },
|
||||
bets: {},
|
||||
prisma: {},
|
||||
dashboardService: {},
|
||||
systemConfig: { getInboxNotifySettings: jest.fn() },
|
||||
bettingLimits: {},
|
||||
databaseReset: {},
|
||||
smokeTests: {},
|
||||
depositService: {},
|
||||
playerMessages: {
|
||||
broadcastBannerPromotion: jest.fn(),
|
||||
broadcastAnnouncementPromotion: jest.fn(),
|
||||
},
|
||||
staff: {},
|
||||
presence: {},
|
||||
depositCleanup: {},
|
||||
};
|
||||
}
|
||||
|
||||
function buildController(deps: ReturnType<typeof stubDeps>) {
|
||||
return new AdminController(
|
||||
deps.users as never,
|
||||
deps.agents as never,
|
||||
deps.wallet as never,
|
||||
deps.matches as never,
|
||||
deps.catalogArchive as never,
|
||||
deps.outright as never,
|
||||
deps.markets as never,
|
||||
deps.settlement as never,
|
||||
deps.cashback as never,
|
||||
deps.content as never,
|
||||
deps.i18n as never,
|
||||
deps.audit as never,
|
||||
deps.bets as never,
|
||||
deps.prisma as never,
|
||||
deps.dashboardService as never,
|
||||
deps.systemConfig as never,
|
||||
deps.bettingLimits as never,
|
||||
deps.databaseReset as never,
|
||||
deps.smokeTests as never,
|
||||
deps.depositService as never,
|
||||
deps.playerMessages as never,
|
||||
deps.staff as never,
|
||||
deps.presence as never,
|
||||
deps.depositCleanup as never,
|
||||
);
|
||||
}
|
||||
|
||||
describe('AdminController createContent inbox notify gating', () => {
|
||||
const deps = stubDeps();
|
||||
const controller = buildController(deps);
|
||||
|
||||
const baseDto = {
|
||||
contentType: 'BANNER' as const,
|
||||
status: 'ACTIVE' as const,
|
||||
notifyInbox: true,
|
||||
translations: [{ locale: 'zh-CN', title: 'Promo', body: 'Body' }],
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
deps.content.create.mockResolvedValue({ id: '88' });
|
||||
deps.playerMessages.broadcastBannerPromotion.mockResolvedValue(3);
|
||||
deps.playerMessages.broadcastAnnouncementPromotion.mockResolvedValue(5);
|
||||
});
|
||||
|
||||
it('does not broadcast banner when inbox.notify.banner is false', async () => {
|
||||
deps.systemConfig.getInboxNotifySettings.mockResolvedValue({
|
||||
inboxEnabled: true,
|
||||
deposit: true,
|
||||
banner: false,
|
||||
announcement: true,
|
||||
});
|
||||
|
||||
const res = await controller.createContent(baseDto);
|
||||
|
||||
expect(deps.playerMessages.broadcastBannerPromotion).not.toHaveBeenCalled();
|
||||
expect((res.data as { notifiedCount?: number }).notifiedCount).toBeUndefined();
|
||||
});
|
||||
|
||||
it('broadcasts banner when inbox.notify.banner is true', async () => {
|
||||
deps.systemConfig.getInboxNotifySettings.mockResolvedValue({
|
||||
inboxEnabled: true,
|
||||
deposit: true,
|
||||
banner: true,
|
||||
announcement: false,
|
||||
});
|
||||
|
||||
const res = await controller.createContent(baseDto);
|
||||
|
||||
expect(deps.playerMessages.broadcastBannerPromotion).toHaveBeenCalledWith({
|
||||
contentId: 88n,
|
||||
translations: [{ locale: 'zh-CN', title: 'Promo', body: 'Body' }],
|
||||
});
|
||||
expect((res.data as { notifiedCount?: number }).notifiedCount).toBe(3);
|
||||
});
|
||||
|
||||
it('does not broadcast announcement when inbox.notify.announcement is false', async () => {
|
||||
deps.systemConfig.getInboxNotifySettings.mockResolvedValue({
|
||||
inboxEnabled: true,
|
||||
deposit: true,
|
||||
banner: true,
|
||||
announcement: false,
|
||||
});
|
||||
|
||||
await controller.createContent({
|
||||
...baseDto,
|
||||
contentType: 'NOTICE',
|
||||
});
|
||||
|
||||
expect(deps.playerMessages.broadcastAnnouncementPromotion).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('skips notify when inbox feature is disabled even if notifyInbox is checked', async () => {
|
||||
deps.systemConfig.getInboxNotifySettings.mockResolvedValue({
|
||||
inboxEnabled: false,
|
||||
deposit: true,
|
||||
banner: true,
|
||||
announcement: true,
|
||||
});
|
||||
|
||||
await controller.createContent(baseDto);
|
||||
|
||||
expect(deps.playerMessages.broadcastBannerPromotion).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('AdminController updateAgent suspend wiring', () => {
|
||||
const agentId = 10n;
|
||||
const operatorId = 1n;
|
||||
|
||||
const tx = {
|
||||
user: {
|
||||
create: jest.fn(),
|
||||
findUnique: jest.fn(),
|
||||
update: jest.fn(),
|
||||
},
|
||||
userAuth: { create: jest.fn() },
|
||||
userPreference: { create: jest.fn() },
|
||||
userInvite: { create: jest.fn(), findUnique: jest.fn() },
|
||||
agentProfile: { create: jest.fn(), findUnique: jest.fn() },
|
||||
agentClosure: { create: jest.fn(), findMany: jest.fn() },
|
||||
};
|
||||
|
||||
const prismaBase = {
|
||||
...tx,
|
||||
agentProfile: { ...tx.agentProfile, update: jest.fn() },
|
||||
user: { ...tx.user, updateMany: jest.fn() },
|
||||
};
|
||||
const prisma = createPrismaMock(prismaBase) as typeof prismaBase & { $transaction: jest.Mock };
|
||||
|
||||
const systemConfig = {
|
||||
getAgentHierarchySettings: jest.fn(),
|
||||
getAgentSuspendSettings: jest.fn(),
|
||||
};
|
||||
const audit = { log: jest.fn().mockResolvedValue(undefined) };
|
||||
|
||||
let agentsService: AgentsService;
|
||||
let controller: AdminController;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
prisma.$transaction.mockImplementation(async (arg: unknown) => {
|
||||
if (Array.isArray(arg)) return Promise.all(arg);
|
||||
return (arg as (client: typeof tx) => Promise<unknown>)(tx);
|
||||
});
|
||||
|
||||
systemConfig.getAgentSuspendSettings.mockResolvedValue({
|
||||
suspendFreezeDirectPlayers: true,
|
||||
suspendBlockPlayerLogin: true,
|
||||
});
|
||||
|
||||
agentsService = new AgentsService(
|
||||
prisma as never,
|
||||
{ hashPassword: jest.fn() } as never,
|
||||
systemConfig as never,
|
||||
{} as never,
|
||||
{ recalculateUsedCredit: jest.fn() } as never,
|
||||
);
|
||||
jest.spyOn(agentsService, 'getAgentAdminDetail').mockResolvedValue({ userId: '10' } as never);
|
||||
|
||||
prisma.agentProfile.findUnique.mockResolvedValue({
|
||||
userId: agentId,
|
||||
user: { username: 'agent-a', locale: 'zh-CN' },
|
||||
parentAgentId: null,
|
||||
});
|
||||
prisma.user.updateMany.mockResolvedValue({ count: 2 });
|
||||
prisma.agentProfile.update.mockResolvedValue({});
|
||||
prisma.user.update.mockResolvedValue({});
|
||||
|
||||
const deps = stubDeps();
|
||||
deps.agents = agentsService as never;
|
||||
deps.audit = audit;
|
||||
controller = buildController(deps);
|
||||
});
|
||||
|
||||
it('forwards bare SUSPENDED body to AgentsService and applies global defaults', async () => {
|
||||
await controller.updateAgent(operatorId, agentId.toString(), { status: 'SUSPENDED' });
|
||||
|
||||
expect(systemConfig.getAgentSuspendSettings).toHaveBeenCalled();
|
||||
expect(prisma.user.updateMany).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: expect.objectContaining({ parentId: agentId, userType: 'PLAYER' }),
|
||||
data: { status: 'SUSPENDED' },
|
||||
}),
|
||||
);
|
||||
expect(prisma.agentProfile.update).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
data: expect.objectContaining({ blockDirectPlayerLogin: true }),
|
||||
}),
|
||||
);
|
||||
expect(audit.log).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
operatorId,
|
||||
action: 'UPDATE_AGENT',
|
||||
module: 'AGENTS',
|
||||
targetId: agentId.toString(),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('does not freeze players when global default is false and body omits flag', async () => {
|
||||
systemConfig.getAgentSuspendSettings.mockResolvedValue({
|
||||
suspendFreezeDirectPlayers: false,
|
||||
suspendBlockPlayerLogin: false,
|
||||
});
|
||||
|
||||
await controller.updateAgent(operatorId, agentId.toString(), { status: 'SUSPENDED' });
|
||||
|
||||
expect(prisma.user.updateMany).not.toHaveBeenCalled();
|
||||
expect(prisma.agentProfile.update).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
data: expect.objectContaining({ blockDirectPlayerLogin: false }),
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1110,14 +1110,6 @@ class InboxNotifySettingsDto {
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
deposit?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
banner?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
announcement?: boolean;
|
||||
}
|
||||
|
||||
class BroadcastTranslationDto {
|
||||
@@ -3452,21 +3444,21 @@ export class AdminController {
|
||||
const item = await this.content.create(createDto);
|
||||
let notifiedCount: number | undefined;
|
||||
if (notifyInbox && (createDto.status ?? 'DRAFT') === 'ACTIVE') {
|
||||
const inboxNotify = await this.systemConfig.getInboxNotifySettings();
|
||||
if (inboxNotify.inboxEnabled) {
|
||||
const inboxEnabled = await this.systemConfig.getInboxFeatureEnabled();
|
||||
if (inboxEnabled) {
|
||||
const translations = createDto.translations.map((tr) => ({
|
||||
locale: tr.locale,
|
||||
title: tr.title,
|
||||
body: tr.body,
|
||||
}));
|
||||
if (createDto.contentType === 'BANNER' && inboxNotify.banner) {
|
||||
if (createDto.contentType === 'BANNER') {
|
||||
notifiedCount = await this.playerMessages.broadcastBannerPromotion({
|
||||
contentId: BigInt(item.id),
|
||||
translations,
|
||||
});
|
||||
} else if (
|
||||
(createDto.contentType === 'NOTICE' || createDto.contentType === 'TICKER') &&
|
||||
inboxNotify.announcement
|
||||
createDto.contentType === 'NOTICE' ||
|
||||
createDto.contentType === 'TICKER'
|
||||
) {
|
||||
notifiedCount = await this.playerMessages.broadcastAnnouncementPromotion({
|
||||
contentId: BigInt(item.id),
|
||||
|
||||
@@ -306,14 +306,13 @@ export class PlayerController {
|
||||
@CurrentUser('locale') locale: string,
|
||||
@Query('status') status?: string,
|
||||
@Query('page') page?: string,
|
||||
@Query('pageSize') pageSize?: string,
|
||||
@Query('matchId') matchId?: string,
|
||||
) {
|
||||
const result = await this.bets.getUserBets(
|
||||
userId,
|
||||
status,
|
||||
page ? parseInt(page, 10) : 1,
|
||||
pageSize ? parseInt(pageSize, 10) : 20,
|
||||
20,
|
||||
matchId ? BigInt(matchId) : undefined,
|
||||
);
|
||||
const items = await this.matches.enrichBetsForHistory(result.items, locale);
|
||||
@@ -348,10 +347,9 @@ export class PlayerController {
|
||||
async transactions(
|
||||
@CurrentUser('id') userId: bigint,
|
||||
@Query('page') page?: string,
|
||||
@Query('pageSize') pageSize?: string,
|
||||
@Query('type') type?: string,
|
||||
) {
|
||||
const result = await this.wallet.getTransactions(userId, page ? parseInt(page) : 1, pageSize ? parseInt(pageSize) : 20, type);
|
||||
const result = await this.wallet.getTransactions(userId, page ? parseInt(page) : 1, 20, type);
|
||||
return jsonResponse(result);
|
||||
}
|
||||
|
||||
@@ -426,25 +424,14 @@ export class PlayerController {
|
||||
async myDepositOrders(
|
||||
@CurrentUser('id') userId: bigint,
|
||||
@Query('page') page?: string,
|
||||
@Query('pageSize') pageSize?: string,
|
||||
) {
|
||||
const result = await this.deposit.getPlayerDepositOrders(
|
||||
userId,
|
||||
page ? parseInt(page, 10) : 1,
|
||||
pageSize ? parseInt(pageSize, 10) : 20,
|
||||
);
|
||||
return jsonResponse(result);
|
||||
}
|
||||
|
||||
@Get('deposit-orders/:id')
|
||||
async myDepositOrder(
|
||||
@CurrentUser('id') userId: bigint,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
const order = await this.deposit.getPlayerDepositOrder(userId, BigInt(id));
|
||||
return jsonResponse(order);
|
||||
}
|
||||
|
||||
@Get('deposit-orders/:id/audit-logs')
|
||||
async myDepositOrderAuditLogs(
|
||||
@CurrentUser('id') userId: bigint,
|
||||
|
||||
@@ -32,30 +32,12 @@ describe('AgentsService', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const prismaBase = {
|
||||
...tx,
|
||||
agentProfile: {
|
||||
...tx.agentProfile,
|
||||
update: jest.fn(),
|
||||
},
|
||||
user: {
|
||||
...tx.user,
|
||||
updateMany: jest.fn(),
|
||||
},
|
||||
};
|
||||
const prisma = createPrismaMock(prismaBase) as typeof prismaBase & { $transaction: jest.Mock };
|
||||
prisma.$transaction.mockImplementation(async (arg: unknown) => {
|
||||
if (Array.isArray(arg)) {
|
||||
return Promise.all(arg);
|
||||
}
|
||||
return (arg as (client: typeof tx) => Promise<unknown>)(tx);
|
||||
});
|
||||
const prisma = createPrismaMock(tx);
|
||||
const auth = {
|
||||
hashPassword: jest.fn(),
|
||||
};
|
||||
const systemConfig = {
|
||||
getAgentHierarchySettings: jest.fn(),
|
||||
getAgentSuspendSettings: jest.fn(),
|
||||
};
|
||||
const network = {};
|
||||
const credit = {
|
||||
@@ -74,20 +56,13 @@ describe('AgentsService', () => {
|
||||
credit as never,
|
||||
);
|
||||
|
||||
systemConfig.getAgentHierarchySettings.mockResolvedValue({
|
||||
maxAgentLevel: 3,
|
||||
defaultSubAgentCreditRatio: 50,
|
||||
});
|
||||
systemConfig.getAgentSuspendSettings.mockResolvedValue({
|
||||
suspendFreezeDirectPlayers: true,
|
||||
suspendBlockPlayerLogin: true,
|
||||
});
|
||||
systemConfig.getAgentHierarchySettings.mockResolvedValue({ maxAgentLevel: 3 });
|
||||
auth.hashPassword.mockResolvedValue('hashed-password');
|
||||
prisma.agentProfile.findUnique.mockResolvedValue({
|
||||
tx.agentProfile.findUnique.mockResolvedValue({
|
||||
userId: parentAgentId,
|
||||
level: 1,
|
||||
creditLimit: new Decimal(10000),
|
||||
usedCredit: new Decimal(2000),
|
||||
creditLimit: new Decimal(1000),
|
||||
usedCredit: new Decimal(0),
|
||||
cashbackRate: new Decimal(10),
|
||||
maxSingleDeposit: null,
|
||||
maxDailyDeposit: null,
|
||||
@@ -116,41 +91,10 @@ describe('AgentsService', () => {
|
||||
password: 'secret',
|
||||
level: 2,
|
||||
parentAgentId,
|
||||
creditLimit: 300,
|
||||
});
|
||||
|
||||
expect(tx.agentProfile.create).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
data: expect.objectContaining({ creditLimit: 4000 }),
|
||||
}),
|
||||
);
|
||||
expect(credit.recalculateUsedCredit).toHaveBeenCalledWith(parentAgentId);
|
||||
expect(credit.recalculateUsedCredit).not.toHaveBeenCalledWith(createdAgentId);
|
||||
});
|
||||
|
||||
it('applies global suspend defaults when suspending without explicit flags', async () => {
|
||||
jest.spyOn(service, 'getAgentAdminDetail').mockResolvedValue({ userId: '10' } as never);
|
||||
prisma.agentProfile.findUnique.mockResolvedValue({
|
||||
userId: 10n,
|
||||
user: { username: 'agent-a', locale: 'zh-CN' },
|
||||
parentAgentId: null,
|
||||
});
|
||||
prisma.user.updateMany.mockResolvedValue({ count: 2 });
|
||||
prisma.agentProfile.update.mockResolvedValue({});
|
||||
prisma.user.update.mockResolvedValue({});
|
||||
|
||||
await service.updateAgentAdmin(10n, { status: 'SUSPENDED' });
|
||||
|
||||
expect(systemConfig.getAgentSuspendSettings).toHaveBeenCalled();
|
||||
expect(prisma.user.updateMany).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: expect.objectContaining({ parentId: 10n, userType: 'PLAYER' }),
|
||||
data: { status: 'SUSPENDED' },
|
||||
}),
|
||||
);
|
||||
expect(prisma.agentProfile.update).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
data: expect.objectContaining({ blockDirectPlayerLogin: true }),
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,15 +40,6 @@ export class AgentsService {
|
||||
return agentLevel < maxLevel;
|
||||
}
|
||||
|
||||
/** 与 Admin 创建下级代理预填逻辑一致:可用授信 × 比例(%),非 100% 时向下取整到百位 */
|
||||
computeDefaultSubAgentCredit(availableCredit: number, ratioPercent: number): number {
|
||||
if (availableCredit <= 0) return 0;
|
||||
const pct = Math.min(100, Math.max(1, ratioPercent)) / 100;
|
||||
const raw = availableCredit * pct;
|
||||
const rounded = pct >= 1 ? availableCredit : Math.floor(raw / 100) * 100;
|
||||
return Math.min(availableCredit, Math.max(0, rounded));
|
||||
}
|
||||
|
||||
private async buildAgentAncestorChainMap(parentAgentIds: (bigint | null | undefined)[]) {
|
||||
return this.network.buildAgentAncestorChainMap(parentAgentIds);
|
||||
}
|
||||
@@ -932,17 +923,11 @@ export class AgentsService {
|
||||
});
|
||||
}
|
||||
|
||||
// Handle status change (per-action cascade freeze / login block; 未传参时用全局默认)
|
||||
// Handle status change (per-action cascade freeze / login block)
|
||||
if (data.status) {
|
||||
const profilePatch: Prisma.AgentProfileUpdateInput = { status: data.status };
|
||||
let freezeDirectPlayers = false;
|
||||
if (data.status === 'SUSPENDED') {
|
||||
const suspendDefaults = await this.systemConfig.getAgentSuspendSettings();
|
||||
const blockDirectPlayerLogin =
|
||||
data.blockDirectPlayerLogin ?? suspendDefaults.suspendBlockPlayerLogin;
|
||||
freezeDirectPlayers =
|
||||
data.freezeDirectPlayers ?? suspendDefaults.suspendFreezeDirectPlayers;
|
||||
profilePatch.blockDirectPlayerLogin = blockDirectPlayerLogin === true;
|
||||
profilePatch.blockDirectPlayerLogin = data.blockDirectPlayerLogin === true;
|
||||
} else if (data.status === 'ACTIVE') {
|
||||
profilePatch.blockDirectPlayerLogin = false;
|
||||
}
|
||||
@@ -958,7 +943,7 @@ export class AgentsService {
|
||||
}),
|
||||
]);
|
||||
|
||||
if (data.status === 'SUSPENDED' && freezeDirectPlayers) {
|
||||
if (data.status === 'SUSPENDED' && data.freezeDirectPlayers) {
|
||||
await this.prisma.user.updateMany({
|
||||
where: { parentId: agentId, userType: 'PLAYER', deletedAt: null },
|
||||
data: { status: 'SUSPENDED' },
|
||||
@@ -1171,31 +1156,20 @@ export class AgentsService {
|
||||
) {
|
||||
await this.validateAgentLevel(data.level, data.parentAgentId);
|
||||
|
||||
let resolvedCreditLimit = data.creditLimit;
|
||||
let resolvedCashbackRate = data.cashbackRate ?? 0;
|
||||
if (data.parentAgentId) {
|
||||
const parentProfile = await this.prisma.agentProfile.findUnique({
|
||||
where: { userId: data.parentAgentId },
|
||||
select: { cashbackRate: true, creditLimit: true, usedCredit: true },
|
||||
select: { cashbackRate: true },
|
||||
});
|
||||
resolvedCashbackRate =
|
||||
data.cashbackRate ?? (parentProfile ? Number(parentProfile.cashbackRate) : 0);
|
||||
if (resolvedCreditLimit === undefined && parentProfile) {
|
||||
const hierarchy = await this.systemConfig.getAgentHierarchySettings();
|
||||
const available = new Decimal(parentProfile.creditLimit).sub(parentProfile.usedCredit);
|
||||
resolvedCreditLimit = this.computeDefaultSubAgentCredit(
|
||||
available.toNumber(),
|
||||
hierarchy.defaultSubAgentCreditRatio,
|
||||
);
|
||||
}
|
||||
await this.assertChildAgentWithinParent(data.parentAgentId, {
|
||||
creditLimit: resolvedCreditLimit ?? 0,
|
||||
creditLimit: data.creditLimit ?? 0,
|
||||
cashbackRate: resolvedCashbackRate,
|
||||
maxSingleDeposit: data.maxSingleDeposit,
|
||||
maxDailyDeposit: data.maxDailyDeposit,
|
||||
});
|
||||
} else if (resolvedCreditLimit === undefined) {
|
||||
resolvedCreditLimit = 0;
|
||||
}
|
||||
|
||||
const maxSingleDeposit = this.normalizeOptionalLimit(data.maxSingleDeposit);
|
||||
@@ -1234,7 +1208,7 @@ export class AgentsService {
|
||||
userId: user.id,
|
||||
level: data.level,
|
||||
parentAgentId: data.parentAgentId,
|
||||
creditLimit: resolvedCreditLimit ?? 0,
|
||||
creditLimit: data.creditLimit ?? 0,
|
||||
cashbackRate: resolvedCashbackRate,
|
||||
maxSingleDeposit,
|
||||
maxDailyDeposit,
|
||||
|
||||
@@ -1592,13 +1592,6 @@ export class MatchesService {
|
||||
);
|
||||
}
|
||||
|
||||
/** 首页卡片快速下注所需的核心玩法类型 */
|
||||
private static readonly HOME_CARD_MARKET_TYPES = [
|
||||
'FT_1X2',
|
||||
'FT_HANDICAP',
|
||||
'FT_OVER_UNDER',
|
||||
] as const;
|
||||
|
||||
/** 未来 N 天内开赛的已发布赛事(按开赛时间升序,不限 isHot) */
|
||||
async listUpcomingPublished(
|
||||
locale = 'en-US',
|
||||
@@ -1611,23 +1604,6 @@ export class MatchesService {
|
||||
const end = new Date(now);
|
||||
end.setDate(end.getDate() + days);
|
||||
|
||||
const marketsRelation = includeMarkets
|
||||
? {
|
||||
where: {
|
||||
status: { in: ['OPEN', 'SUSPENDED', 'CLOSED'] },
|
||||
showOnPlayer: true,
|
||||
marketType: { in: [...MatchesService.HOME_CARD_MARKET_TYPES] },
|
||||
},
|
||||
include: {
|
||||
selections: {
|
||||
where: { status: { in: ['OPEN', 'SUSPENDED', 'CLOSED'] } },
|
||||
orderBy: { sortOrder: 'asc' as const },
|
||||
},
|
||||
},
|
||||
orderBy: { sortOrder: 'asc' as const },
|
||||
}
|
||||
: this.playerMarketStatusInclude;
|
||||
|
||||
const matches = await this.prisma.match.findMany({
|
||||
where: {
|
||||
status: { in: ['PUBLISHED', 'CLOSED', 'PENDING_SETTLEMENT'] },
|
||||
@@ -1650,7 +1626,7 @@ export class MatchesService {
|
||||
homeTeam: true,
|
||||
awayTeam: true,
|
||||
score: true,
|
||||
markets: marketsRelation,
|
||||
markets: includeMarkets ? this.playerMarketInclude : this.playerMarketStatusInclude,
|
||||
},
|
||||
orderBy: [{ startTime: 'asc' }, { displayOrder: 'asc' }],
|
||||
take: limit,
|
||||
|
||||
@@ -47,8 +47,6 @@ describe('DepositService', () => {
|
||||
getInboxNotifySettings: jest.fn().mockResolvedValue({
|
||||
inboxEnabled: true,
|
||||
deposit: true,
|
||||
banner: true,
|
||||
announcement: true,
|
||||
}),
|
||||
};
|
||||
|
||||
|
||||
@@ -416,85 +416,6 @@ export class DepositService {
|
||||
return map;
|
||||
}
|
||||
|
||||
private formatPlayerDepositOrder(
|
||||
o: {
|
||||
id: bigint;
|
||||
orderNo: string;
|
||||
paymentMethodId: bigint;
|
||||
methodType: string;
|
||||
amount: Decimal;
|
||||
screenshotUrl: string;
|
||||
status: string;
|
||||
approvedAmount: Decimal | null;
|
||||
rejectReason: string | null;
|
||||
remark: string | null;
|
||||
createdAt: Date;
|
||||
reviewedAt: Date | null;
|
||||
paymentMethod: {
|
||||
bankName: string | null;
|
||||
usdtAddress: string | null;
|
||||
displayName: string | null;
|
||||
methodType: string;
|
||||
} | null;
|
||||
},
|
||||
auditLogs: Array<{
|
||||
id: string;
|
||||
action: string;
|
||||
actorType: string;
|
||||
statusBefore: string | null;
|
||||
statusAfter: string;
|
||||
amount: string | null;
|
||||
approvedAmount: string | null;
|
||||
remark: string | null;
|
||||
createdAt: string;
|
||||
}>,
|
||||
) {
|
||||
return {
|
||||
id: o.id.toString(),
|
||||
orderNo: o.orderNo,
|
||||
paymentMethodId: o.paymentMethodId.toString(),
|
||||
methodType: o.methodType,
|
||||
amount: o.amount.toString(),
|
||||
screenshotUrl: o.screenshotUrl,
|
||||
status: o.status,
|
||||
approvedAmount: o.approvedAmount?.toString() ?? null,
|
||||
rejectReason: o.rejectReason,
|
||||
remark: o.remark,
|
||||
createdAt: o.createdAt,
|
||||
reviewedAt: o.reviewedAt,
|
||||
paymentMethodName:
|
||||
o.paymentMethod?.displayName ?? o.paymentMethod?.bankName ?? o.paymentMethod?.usdtAddress ?? null,
|
||||
auditLogs,
|
||||
};
|
||||
}
|
||||
|
||||
async getPlayerDepositOrder(playerId: bigint, orderId: bigint) {
|
||||
const order = await this.prisma.depositOrder.findFirst({
|
||||
where: { id: orderId, playerId },
|
||||
include: {
|
||||
paymentMethod: {
|
||||
select: { bankName: true, usdtAddress: true, displayName: true, methodType: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
if (!order) throw appBadRequest('ORDER_NOT_FOUND');
|
||||
|
||||
const auditMap = await this.attachPlayerAuditLogs([order]);
|
||||
const auditLogs = (auditMap.get(order.id.toString()) ?? []).map((log) => ({
|
||||
id: log.id,
|
||||
action: log.action,
|
||||
actorType: log.actorType,
|
||||
statusBefore: log.statusBefore,
|
||||
statusAfter: log.statusAfter,
|
||||
amount: log.amount,
|
||||
approvedAmount: log.approvedAmount,
|
||||
remark: log.remark,
|
||||
createdAt: log.createdAt,
|
||||
}));
|
||||
|
||||
return this.formatPlayerDepositOrder(order, auditLogs);
|
||||
}
|
||||
|
||||
async createDepositOrder(
|
||||
playerId: bigint,
|
||||
paymentMethodId: bigint,
|
||||
@@ -622,10 +543,21 @@ export class DepositService {
|
||||
const auditMap = await this.attachPlayerAuditLogs(items);
|
||||
|
||||
return {
|
||||
items: items.map((o) =>
|
||||
this.formatPlayerDepositOrder(
|
||||
o,
|
||||
(auditMap.get(o.id.toString()) ?? []).map((log) => ({
|
||||
items: items.map((o) => ({
|
||||
id: o.id.toString(),
|
||||
orderNo: o.orderNo,
|
||||
paymentMethodId: o.paymentMethodId.toString(),
|
||||
methodType: o.methodType,
|
||||
amount: o.amount.toString(),
|
||||
screenshotUrl: o.screenshotUrl,
|
||||
status: o.status,
|
||||
approvedAmount: o.approvedAmount?.toString() ?? null,
|
||||
rejectReason: o.rejectReason,
|
||||
remark: o.remark,
|
||||
createdAt: o.createdAt,
|
||||
reviewedAt: o.reviewedAt,
|
||||
paymentMethodName: o.paymentMethod?.displayName ?? o.paymentMethod?.bankName ?? o.paymentMethod?.usdtAddress ?? null,
|
||||
auditLogs: (auditMap.get(o.id.toString()) ?? []).map((log) => ({
|
||||
id: log.id,
|
||||
action: log.action,
|
||||
actorType: log.actorType,
|
||||
@@ -636,8 +568,7 @@ export class DepositService {
|
||||
remark: log.remark,
|
||||
createdAt: log.createdAt,
|
||||
})),
|
||||
),
|
||||
),
|
||||
})),
|
||||
total,
|
||||
page,
|
||||
pageSize,
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
import { AuthService } from './auth.service';
|
||||
import { expectAppError } from '../../testing/prisma-mock';
|
||||
|
||||
describe('AuthService player login', () => {
|
||||
const prisma = {
|
||||
user: {
|
||||
findUnique: jest.fn(),
|
||||
},
|
||||
userAuth: {
|
||||
update: jest.fn(),
|
||||
},
|
||||
};
|
||||
const jwt = { sign: jest.fn().mockReturnValue('token') };
|
||||
const config = { get: jest.fn().mockReturnValue('1h') };
|
||||
const systemConfig = {};
|
||||
const invites = {};
|
||||
const sms = {};
|
||||
const audit = { log: jest.fn() };
|
||||
|
||||
let service: AuthService;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
service = new AuthService(
|
||||
prisma as never,
|
||||
jwt as never,
|
||||
config as never,
|
||||
systemConfig as never,
|
||||
invites as never,
|
||||
sms as never,
|
||||
audit as never,
|
||||
);
|
||||
});
|
||||
|
||||
it('blocks player login when parent agent is suspended with blockDirectPlayerLogin', async () => {
|
||||
const passwordHash = await bcrypt.hash('Player@123', 4);
|
||||
prisma.user.findUnique
|
||||
.mockResolvedValueOnce({
|
||||
id: 10n,
|
||||
username: 'player1',
|
||||
userType: 'PLAYER',
|
||||
status: 'ACTIVE',
|
||||
parentId: 20n,
|
||||
auth: { passwordHash, loginFailCount: 0, lockedUntil: null },
|
||||
adminRole: null,
|
||||
})
|
||||
.mockResolvedValueOnce({
|
||||
userType: 'AGENT',
|
||||
status: 'SUSPENDED',
|
||||
agentProfile: { blockDirectPlayerLogin: true },
|
||||
});
|
||||
|
||||
await expect(service.login('player1', 'Player@123', 'player')).rejects.toMatchObject(
|
||||
expectAppError('PARENT_AGENT_SUSPENDED'),
|
||||
);
|
||||
expect(jwt.sign).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('allows player login when parent agent suspended without blockDirectPlayerLogin', async () => {
|
||||
const passwordHash = await bcrypt.hash('Player@123', 4);
|
||||
prisma.user.findUnique
|
||||
.mockResolvedValueOnce({
|
||||
id: 10n,
|
||||
username: 'player1',
|
||||
userType: 'PLAYER',
|
||||
status: 'ACTIVE',
|
||||
parentId: 20n,
|
||||
locale: 'zh-CN',
|
||||
auth: { passwordHash, loginFailCount: 0, lockedUntil: null },
|
||||
adminRole: null,
|
||||
})
|
||||
.mockResolvedValueOnce({
|
||||
userType: 'AGENT',
|
||||
status: 'SUSPENDED',
|
||||
agentProfile: { blockDirectPlayerLogin: false },
|
||||
});
|
||||
prisma.userAuth.update.mockResolvedValue({});
|
||||
|
||||
const result = await service.login('player1', 'Player@123', 'player');
|
||||
expect(result.token).toBe('token');
|
||||
});
|
||||
});
|
||||
@@ -1,126 +0,0 @@
|
||||
import { Decimal } from '@prisma/client/runtime/library';
|
||||
import { CashbackService } from './cashback.service';
|
||||
|
||||
describe('CashbackService previewBatch', () => {
|
||||
const tx = {
|
||||
cashbackBatch: {
|
||||
findMany: jest.fn(),
|
||||
create: jest.fn(),
|
||||
},
|
||||
cashbackItem: {
|
||||
create: jest.fn(),
|
||||
},
|
||||
cashbackBet: {
|
||||
create: jest.fn(),
|
||||
},
|
||||
};
|
||||
const prisma = {
|
||||
cashbackBatch: {
|
||||
findFirst: jest.fn(),
|
||||
},
|
||||
cashbackBet: {
|
||||
findMany: jest.fn(),
|
||||
},
|
||||
bet: {
|
||||
findMany: jest.fn(),
|
||||
},
|
||||
cashbackRule: {
|
||||
findMany: jest.fn(),
|
||||
},
|
||||
agentProfile: {
|
||||
findMany: jest.fn(),
|
||||
},
|
||||
user: {
|
||||
findMany: jest.fn(),
|
||||
},
|
||||
wallet: {
|
||||
findMany: jest.fn(),
|
||||
},
|
||||
$transaction: jest.fn(async (fn: (client: typeof tx) => Promise<unknown>) => fn(tx)),
|
||||
};
|
||||
const funds = {};
|
||||
const systemConfig = {
|
||||
getPlatformDirectCashbackSettings: jest.fn(),
|
||||
};
|
||||
|
||||
let service: CashbackService;
|
||||
|
||||
const platformPlayerId = 100n;
|
||||
const adminInvitePlayerId = 101n;
|
||||
const adminSponsorId = 200n;
|
||||
const periodStart = new Date('2026-06-01T00:00:00.000Z');
|
||||
const periodEnd = new Date('2026-06-01T23:59:59.999Z');
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
service = new CashbackService(prisma as never, funds as never, systemConfig as never);
|
||||
systemConfig.getPlatformDirectCashbackSettings.mockResolvedValue({
|
||||
platformDirectRate: 0.02,
|
||||
adminInviteRate: 0.05,
|
||||
});
|
||||
prisma.cashbackBatch.findFirst.mockResolvedValue(null);
|
||||
prisma.cashbackBet.findMany.mockResolvedValue([]);
|
||||
prisma.cashbackRule.findMany.mockResolvedValue([]);
|
||||
prisma.agentProfile.findMany.mockResolvedValue([]);
|
||||
tx.cashbackBatch.findMany.mockResolvedValue([]);
|
||||
tx.cashbackItem.create.mockResolvedValue({});
|
||||
tx.cashbackBet.create.mockResolvedValue({});
|
||||
tx.cashbackBatch.create.mockImplementation(({ data }: { data: Record<string, unknown> }) =>
|
||||
Promise.resolve({ id: 1n, batchNo: 'CB-TEST', ...data }),
|
||||
);
|
||||
});
|
||||
|
||||
it('uses platformDirectRate for platform-direct players', async () => {
|
||||
prisma.bet.findMany.mockResolvedValue([
|
||||
{
|
||||
id: 1n,
|
||||
userId: platformPlayerId,
|
||||
stake: new Decimal(1000),
|
||||
status: 'WON',
|
||||
settledAt: new Date('2026-06-01T12:00:00.000Z'),
|
||||
user: { id: platformPlayerId, parentId: null, inviteSponsorId: null },
|
||||
selections: [{ marketType: 'FT_1X2' }],
|
||||
},
|
||||
]);
|
||||
prisma.user.findMany.mockResolvedValue([
|
||||
{ id: platformPlayerId, username: 'pd1', parent: null },
|
||||
]);
|
||||
prisma.wallet.findMany.mockResolvedValue([
|
||||
{ userId: platformPlayerId, availableBalance: new Decimal(0) },
|
||||
]);
|
||||
|
||||
const result = await service.previewBatch(periodStart, periodEnd);
|
||||
expect(result.items).toHaveLength(1);
|
||||
expect(result.items[0].amount.toString()).toBe('20');
|
||||
expect(result.totalAmount.toString()).toBe('20');
|
||||
});
|
||||
|
||||
it('uses adminInviteRate for admin-invited platform-direct players', async () => {
|
||||
prisma.bet.findMany.mockResolvedValue([
|
||||
{
|
||||
id: 2n,
|
||||
userId: adminInvitePlayerId,
|
||||
stake: new Decimal(1000),
|
||||
status: 'LOST',
|
||||
settledAt: new Date('2026-06-01T12:00:00.000Z'),
|
||||
user: {
|
||||
id: adminInvitePlayerId,
|
||||
parentId: null,
|
||||
inviteSponsorId: adminSponsorId,
|
||||
},
|
||||
selections: [{ marketType: 'FT_1X2' }],
|
||||
},
|
||||
]);
|
||||
prisma.user.findMany
|
||||
.mockResolvedValueOnce([{ id: adminSponsorId, userType: 'ADMIN' }])
|
||||
.mockResolvedValueOnce([{ id: adminInvitePlayerId, username: 'inv1', parent: null }]);
|
||||
prisma.wallet.findMany.mockResolvedValue([
|
||||
{ userId: adminInvitePlayerId, availableBalance: new Decimal(0) },
|
||||
]);
|
||||
|
||||
const result = await service.previewBatch(periodStart, periodEnd);
|
||||
expect(result.items).toHaveLength(1);
|
||||
expect(result.items[0].amount.toString()).toBe('50');
|
||||
expect(result.totalAmount.toString()).toBe('50');
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Decimal } from '@prisma/client/runtime/library';
|
||||
import { BET_LIMIT_KEYS } from '../../betting/betting-limits.service';
|
||||
import type { AgentsService } from '../../agent/agents.service';
|
||||
import type { BetsService } from '../../betting/bets.service';
|
||||
import type { SettlementService } from '../../settlement/settlement.service';
|
||||
@@ -13,7 +12,7 @@ import {
|
||||
teardownBetFlowFixture,
|
||||
} from './smoke-test.bet-flow.fixture';
|
||||
|
||||
export const BET_FLOW_PROBE_COUNT = 13;
|
||||
export const BET_FLOW_PROBE_COUNT = 5;
|
||||
|
||||
export type BetFlowProbeDeps = {
|
||||
prisma: PrismaService;
|
||||
@@ -23,38 +22,6 @@ export type BetFlowProbeDeps = {
|
||||
agents: AgentsService;
|
||||
};
|
||||
|
||||
async function upsertSystemConfig(
|
||||
prisma: PrismaService,
|
||||
key: string,
|
||||
value: string,
|
||||
snapshots: Array<{ key: string; value: string | null }>,
|
||||
) {
|
||||
const row = await prisma.systemConfig.findUnique({ where: { configKey: key } });
|
||||
snapshots.push({ key, value: row?.configValue ?? null });
|
||||
await prisma.systemConfig.upsert({
|
||||
where: { configKey: key },
|
||||
create: { configKey: key, configValue: value, description: 'smoke test' },
|
||||
update: { configValue: value },
|
||||
});
|
||||
}
|
||||
|
||||
async function restoreSystemConfigs(
|
||||
prisma: PrismaService,
|
||||
snapshots: Array<{ key: string; value: string | null }>,
|
||||
) {
|
||||
for (const snap of snapshots) {
|
||||
if (snap.value === null) {
|
||||
await prisma.systemConfig.deleteMany({ where: { configKey: snap.key } });
|
||||
} else {
|
||||
await prisma.systemConfig.upsert({
|
||||
where: { configKey: snap.key },
|
||||
create: { configKey: snap.key, configValue: snap.value, description: 'smoke test restore' },
|
||||
update: { configValue: snap.value },
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function confirmMatchSettlement(
|
||||
deps: BetFlowProbeDeps,
|
||||
fx: BetFlowFixtureIds,
|
||||
@@ -234,401 +201,6 @@ export function createBetFlowProbes(deps: BetFlowProbeDeps): SmokeTestCaseDef[]
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF006',
|
||||
suite: 'bet-flow',
|
||||
name: '录分校验:半场比分不能大于全场',
|
||||
description: 'HT>FT 时 recordScore 返回 SETTLEMENT_SCORE_INVALID',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet);
|
||||
try {
|
||||
await deps.prisma.match.update({
|
||||
where: { id: fx.matchId },
|
||||
data: { status: 'CLOSED', closeTime: new Date() },
|
||||
});
|
||||
await expectAppErrorThrows(
|
||||
'recordScore invalid HT>FT',
|
||||
async () => {
|
||||
await deps.settlement.recordScore(fx.matchId, 2, 0, 1, 0, fx.operatorId);
|
||||
},
|
||||
'SETTLEMENT_SCORE_INVALID',
|
||||
);
|
||||
} finally {
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF007',
|
||||
suite: 'bet-flow',
|
||||
name: '确认结算:拒绝已作废的旧 PREVIEW 批次',
|
||||
description: '新 preview 后旧 batch 变为 CANCELLED,confirm 旧 batchId 失败',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet);
|
||||
try {
|
||||
await deps.prisma.match.update({
|
||||
where: { id: fx.matchId },
|
||||
data: { status: 'CLOSED', closeTime: new Date() },
|
||||
});
|
||||
const previewA = await deps.settlement.previewSettlement(fx.matchId, fx.operatorId, {
|
||||
htHome: 0,
|
||||
htAway: 0,
|
||||
ftHome: 1,
|
||||
ftAway: 0,
|
||||
});
|
||||
await deps.settlement.previewSettlement(fx.matchId, fx.operatorId, {
|
||||
htHome: 0,
|
||||
htAway: 0,
|
||||
ftHome: 2,
|
||||
ftAway: 1,
|
||||
});
|
||||
const stale = await deps.prisma.settlementBatch.findUnique({
|
||||
where: { id: previewA.batch.id },
|
||||
});
|
||||
expectEqual('old batch cancelled', stale?.status, 'CANCELLED');
|
||||
await expectAppErrorThrows(
|
||||
'confirm cancelled batch',
|
||||
async () => {
|
||||
await deps.settlement.confirmSettlement(previewA.batch.id, fx.operatorId);
|
||||
},
|
||||
'SETTLEMENT_BATCH_ALREADY_CONFIRMED',
|
||||
);
|
||||
} finally {
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF008',
|
||||
suite: 'bet-flow',
|
||||
name: '串动作废:VOID 腿续算,已有 LOSE 腿不退本',
|
||||
description: '跨场串关一场 LOSE 后另一场取消,payout=0 而非退 stake',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet, { initialBalance: 1000 });
|
||||
const matchB = await deps.prisma.match.create({
|
||||
data: {
|
||||
sportType: 'FOOTBALL',
|
||||
leagueId: fx.leagueId,
|
||||
homeTeamId: fx.homeTeamId,
|
||||
awayTeamId: fx.awayTeamId,
|
||||
startTime: new Date(Date.now() + 48 * 60 * 60 * 1000),
|
||||
status: 'PUBLISHED',
|
||||
publishTime: new Date(),
|
||||
},
|
||||
});
|
||||
const marketB = await deps.prisma.market.create({
|
||||
data: {
|
||||
matchId: matchB.id,
|
||||
marketType: 'FT_1X2',
|
||||
period: 'FT',
|
||||
status: 'OPEN',
|
||||
selections: {
|
||||
create: [
|
||||
{
|
||||
selectionCode: 'HOME',
|
||||
selectionName: 'Home B',
|
||||
odds: new Decimal('2.00'),
|
||||
oddsVersion: BigInt(1),
|
||||
status: 'OPEN',
|
||||
sortOrder: 0,
|
||||
},
|
||||
{
|
||||
selectionCode: 'AWAY',
|
||||
selectionName: 'Away B',
|
||||
odds: new Decimal('2.00'),
|
||||
oddsVersion: BigInt(1),
|
||||
status: 'OPEN',
|
||||
sortOrder: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
include: { selections: true },
|
||||
});
|
||||
const awayB = marketB.selections.find((s) => s.selectionCode === 'AWAY')!;
|
||||
|
||||
try {
|
||||
const parlay = await deps.bets.placeParlayBet(
|
||||
fx.playerId,
|
||||
null,
|
||||
[
|
||||
{ selectionId: fx.homeSelectionId, oddsVersion: fx.homeOddsVersion },
|
||||
{ selectionId: awayB.id, oddsVersion: awayB.oddsVersion },
|
||||
],
|
||||
100,
|
||||
`smoke-parlay-void-${fx.runId}`,
|
||||
);
|
||||
|
||||
await deps.prisma.match.update({
|
||||
where: { id: matchB.id },
|
||||
data: { status: 'CLOSED', closeTime: new Date() },
|
||||
});
|
||||
const previewB = await deps.settlement.previewSettlement(matchB.id, fx.operatorId, {
|
||||
htHome: 1,
|
||||
htAway: 0,
|
||||
ftHome: 2,
|
||||
ftAway: 1,
|
||||
});
|
||||
await deps.settlement.confirmSettlement(previewB.batch.id, fx.operatorId);
|
||||
|
||||
let w = await deps.wallet.getWallet(fx.playerId);
|
||||
expectEqual('frozen while pending', w.frozenBalance.toString(), '100');
|
||||
|
||||
await deps.settlement.voidMatchBets(fx.matchId);
|
||||
|
||||
const settled = await deps.prisma.bet.findUnique({ where: { id: parlay.id } });
|
||||
expectEqual('settled status', settled?.status, 'LOST');
|
||||
expectEqual('actualReturn', settled?.actualReturn.toString(), '0');
|
||||
|
||||
w = await deps.wallet.getWallet(fx.playerId);
|
||||
expectEqual('available after void parlay', w.availableBalance.toString(), '900');
|
||||
expectEqual('frozen after void parlay', w.frozenBalance.toString(), '0');
|
||||
} finally {
|
||||
const bets = await deps.prisma.bet.findMany({
|
||||
where: { userId: fx.playerId },
|
||||
select: { id: true },
|
||||
});
|
||||
const betIds = bets.map((b) => b.id);
|
||||
if (betIds.length) {
|
||||
await deps.prisma.betSelection.deleteMany({ where: { betId: { in: betIds } } });
|
||||
await deps.prisma.bet.deleteMany({ where: { id: { in: betIds } } });
|
||||
}
|
||||
const batchIds = (
|
||||
await deps.prisma.settlementBatch.findMany({
|
||||
where: { matchId: { in: [fx.matchId, matchB.id] } },
|
||||
select: { id: true },
|
||||
})
|
||||
).map((b) => b.id);
|
||||
if (batchIds.length) {
|
||||
await deps.prisma.settlementItem.deleteMany({ where: { batchId: { in: batchIds } } });
|
||||
await deps.prisma.settlementBatch.deleteMany({ where: { id: { in: batchIds } } });
|
||||
}
|
||||
await deps.prisma.matchScore.deleteMany({
|
||||
where: { matchId: { in: [fx.matchId, matchB.id] } },
|
||||
});
|
||||
const marketIds = (
|
||||
await deps.prisma.market.findMany({
|
||||
where: { matchId: matchB.id },
|
||||
select: { id: true },
|
||||
})
|
||||
).map((m) => m.id);
|
||||
if (marketIds.length) {
|
||||
await deps.prisma.marketSelection.deleteMany({ where: { marketId: { in: marketIds } } });
|
||||
await deps.prisma.market.deleteMany({ where: { id: { in: marketIds } } });
|
||||
}
|
||||
await deps.prisma.match.deleteMany({ where: { id: matchB.id } });
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF009',
|
||||
suite: 'bet-flow',
|
||||
name: '赔率版本不一致:BetsService 拒绝下注',
|
||||
uatRef: 'B003',
|
||||
description: '提交旧 oddsVersion 应返回 ODDS_CHANGED',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet, { initialBalance: 500 });
|
||||
try {
|
||||
await deps.prisma.marketSelection.update({
|
||||
where: { id: fx.homeSelectionId },
|
||||
data: { oddsVersion: { increment: 1 } },
|
||||
});
|
||||
await expectAppErrorThrows(
|
||||
'placeSingleBet odds changed',
|
||||
async () => {
|
||||
await deps.bets.placeSingleBet(
|
||||
fx.playerId,
|
||||
null,
|
||||
fx.homeSelectionId,
|
||||
fx.homeOddsVersion,
|
||||
50,
|
||||
`smoke-odds-${fx.runId}`,
|
||||
);
|
||||
},
|
||||
'ODDS_CHANGED',
|
||||
);
|
||||
const count = await deps.prisma.bet.count({ where: { userId: fx.playerId } });
|
||||
expectEqual('bet count', count, 0);
|
||||
} finally {
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF010',
|
||||
suite: 'bet-flow',
|
||||
name: '赛前限制:开赛后拒绝下注',
|
||||
description: 'startTime 已过后 placeSingleBet 返回 PRE_MATCH_ONLY',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet, { initialBalance: 500 });
|
||||
try {
|
||||
await deps.prisma.match.update({
|
||||
where: { id: fx.matchId },
|
||||
data: { startTime: new Date(Date.now() - 60_000) },
|
||||
});
|
||||
await expectAppErrorThrows(
|
||||
'placeSingleBet after kickoff',
|
||||
async () => {
|
||||
await deps.bets.placeSingleBet(
|
||||
fx.playerId,
|
||||
null,
|
||||
fx.homeSelectionId,
|
||||
fx.homeOddsVersion,
|
||||
50,
|
||||
`smoke-prematch-${fx.runId}`,
|
||||
);
|
||||
},
|
||||
'PRE_MATCH_ONLY',
|
||||
);
|
||||
} finally {
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF011',
|
||||
suite: 'bet-flow',
|
||||
name: '每日投注上限:超额拒单',
|
||||
description: 'dailyStakeLimit=150 时第二笔 100 注单失败',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet, { initialBalance: 1000 });
|
||||
const snapshots: Array<{ key: string; value: string | null }> = [];
|
||||
try {
|
||||
await upsertSystemConfig(deps.prisma, BET_LIMIT_KEYS.dailyStakeLimit, '150', snapshots);
|
||||
await deps.bets.placeSingleBet(
|
||||
fx.playerId,
|
||||
null,
|
||||
fx.homeSelectionId,
|
||||
fx.homeOddsVersion,
|
||||
100,
|
||||
`smoke-daily-1-${fx.runId}`,
|
||||
);
|
||||
await expectAppErrorThrows(
|
||||
'placeSingleBet daily limit',
|
||||
async () => {
|
||||
await deps.bets.placeSingleBet(
|
||||
fx.playerId,
|
||||
null,
|
||||
fx.drawSelectionId,
|
||||
fx.drawOddsVersion,
|
||||
100,
|
||||
`smoke-daily-2-${fx.runId}`,
|
||||
);
|
||||
},
|
||||
'DAILY_STAKE_LIMIT',
|
||||
);
|
||||
} finally {
|
||||
await restoreSystemConfigs(deps.prisma, snapshots);
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF012',
|
||||
suite: 'bet-flow',
|
||||
name: '串关限额:超 maxStakeParlay 拒单',
|
||||
description: 'maxStakeParlay=80 时下 100 串关失败',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet, { initialBalance: 1000 });
|
||||
const matchB = await deps.prisma.match.create({
|
||||
data: {
|
||||
sportType: 'FOOTBALL',
|
||||
leagueId: fx.leagueId,
|
||||
homeTeamId: fx.homeTeamId,
|
||||
awayTeamId: fx.awayTeamId,
|
||||
startTime: new Date(Date.now() + 48 * 60 * 60 * 1000),
|
||||
status: 'PUBLISHED',
|
||||
publishTime: new Date(),
|
||||
},
|
||||
});
|
||||
const marketB = await deps.prisma.market.create({
|
||||
data: {
|
||||
matchId: matchB.id,
|
||||
marketType: 'FT_1X2',
|
||||
period: 'FT',
|
||||
status: 'OPEN',
|
||||
selections: {
|
||||
create: [
|
||||
{
|
||||
selectionCode: 'AWAY',
|
||||
selectionName: 'Away B',
|
||||
odds: new Decimal('2.00'),
|
||||
oddsVersion: BigInt(1),
|
||||
status: 'OPEN',
|
||||
sortOrder: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
include: { selections: true },
|
||||
});
|
||||
const awayB = marketB.selections[0]!;
|
||||
const snapshots: Array<{ key: string; value: string | null }> = [];
|
||||
try {
|
||||
await upsertSystemConfig(deps.prisma, BET_LIMIT_KEYS.maxStakeParlay, '80', snapshots);
|
||||
await expectAppErrorThrows(
|
||||
'placeParlayBet max stake',
|
||||
async () => {
|
||||
await deps.bets.placeParlayBet(
|
||||
fx.playerId,
|
||||
null,
|
||||
[
|
||||
{ selectionId: fx.homeSelectionId, oddsVersion: fx.homeOddsVersion },
|
||||
{ selectionId: awayB.id, oddsVersion: awayB.oddsVersion },
|
||||
],
|
||||
100,
|
||||
`smoke-parlay-max-${fx.runId}`,
|
||||
);
|
||||
},
|
||||
'MAX_STAKE',
|
||||
);
|
||||
} finally {
|
||||
await restoreSystemConfigs(deps.prisma, snapshots);
|
||||
const markets = await deps.prisma.market.findMany({
|
||||
where: { matchId: matchB.id },
|
||||
select: { id: true },
|
||||
});
|
||||
const marketIds = markets.map((m) => m.id);
|
||||
if (marketIds.length) {
|
||||
await deps.prisma.marketSelection.deleteMany({ where: { marketId: { in: marketIds } } });
|
||||
await deps.prisma.market.deleteMany({ where: { id: { in: marketIds } } });
|
||||
}
|
||||
await deps.prisma.match.deleteMany({ where: { id: matchB.id } });
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF013',
|
||||
suite: 'bet-flow',
|
||||
name: '改 SystemConfig 后拒单:minStake',
|
||||
description: 'minStake=200 时下 100 单关返回 MIN_STAKE',
|
||||
run: async () => {
|
||||
const fx = await createBetFlowFixture(deps.prisma, deps.wallet, { initialBalance: 1000 });
|
||||
const snapshots: Array<{ key: string; value: string | null }> = [];
|
||||
try {
|
||||
await upsertSystemConfig(deps.prisma, BET_LIMIT_KEYS.minStake, '200', snapshots);
|
||||
await expectAppErrorThrows(
|
||||
'placeSingleBet min stake',
|
||||
async () => {
|
||||
await deps.bets.placeSingleBet(
|
||||
fx.playerId,
|
||||
null,
|
||||
fx.homeSelectionId,
|
||||
fx.homeOddsVersion,
|
||||
100,
|
||||
`smoke-min-${fx.runId}`,
|
||||
);
|
||||
},
|
||||
'MIN_STAKE',
|
||||
);
|
||||
} finally {
|
||||
await restoreSystemConfigs(deps.prisma, snapshots);
|
||||
await teardownBetFlowFixture(deps.prisma, fx);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'BF005',
|
||||
suite: 'bet-flow',
|
||||
|
||||
@@ -380,36 +380,6 @@ export const SMOKE_TEST_CASES: SmokeTestCaseDef[] = [
|
||||
expectEqual('payout', payout.toNumber(), 100, { stake: 100, legs });
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'S020',
|
||||
suite: 'settlement',
|
||||
name: '串关 VOID 腿 + LOSE 腿:整单全输',
|
||||
description: '比赛取消腿按 odds=1.0 续算,已有 LOSE 腿时 payout=0',
|
||||
run: () => {
|
||||
const legs = [
|
||||
{ odds: 2.0, result: 'VOID' as const },
|
||||
{ odds: 2.0, result: 'LOSE' as const },
|
||||
];
|
||||
const { betResult, payout } = calculateParlayPayout(100, legs);
|
||||
expectEqual('betResult', betResult, 'LOST', { stake: 100, legs });
|
||||
expectEqual('payout', payout.toNumber(), 0, { stake: 100, legs });
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'S021',
|
||||
suite: 'settlement',
|
||||
name: '串关 VOID 腿 + WIN 腿:按 WIN 腿赔率结算',
|
||||
description: '作废腿不参与升赔,其余 WIN 腿正常连乘',
|
||||
run: () => {
|
||||
const legs = [
|
||||
{ odds: 2.0, result: 'VOID' as const },
|
||||
{ odds: 1.5, result: 'WIN' as const },
|
||||
];
|
||||
const { betResult, payout } = calculateParlayPayout(100, legs);
|
||||
expectEqual('betResult', betResult, 'WON', { stake: 100, legs });
|
||||
expectEqual('payout', payout.toNumber(), 150, { stake: 100, legs });
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'OUT001',
|
||||
suite: 'settlement',
|
||||
@@ -461,6 +431,17 @@ export const SMOKE_TEST_CASES: SmokeTestCaseDef[] = [
|
||||
},
|
||||
|
||||
// —— Betting rules ——
|
||||
{
|
||||
id: 'B003',
|
||||
suite: 'betting',
|
||||
name: '赔率版本不一致应拒绝',
|
||||
uatRef: 'B003',
|
||||
run: () => {
|
||||
const submitted = BigInt(1);
|
||||
const current = BigInt(2);
|
||||
expectTrue('version mismatch', submitted !== current, { submitted: '1', current: '2' });
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'B006',
|
||||
suite: 'betting',
|
||||
@@ -779,10 +760,7 @@ export const SMOKE_TEST_CASES: SmokeTestCaseDef[] = [
|
||||
];
|
||||
|
||||
export const SMOKE_SUITE_META: Record<string, { name: string; description: string }> = {
|
||||
settlement: {
|
||||
name: '结算引擎',
|
||||
description: '独赢、波胆、让球、大小、串关、冠军盘、作废腿续算',
|
||||
},
|
||||
settlement: { name: '结算引擎', description: '独赢、波胆、让球、大小、串关、冠军盘' },
|
||||
settlement_helpers: { name: '结算辅助', description: '选项代码与中文快照名映射' },
|
||||
betting: { name: '下注规则', description: '串关限制、赔率版本、四分之一盘' },
|
||||
betting_limits: { name: '投注限额', description: '最小/最大投注与派彩上限校验' },
|
||||
@@ -793,8 +771,4 @@ export const SMOKE_SUITE_META: Record<string, { name: string; description: strin
|
||||
name: '下注结算链路',
|
||||
description: '真实 DB:下注→冻结→录分→结算→钱包/代理额度(临时数据自动清理)',
|
||||
},
|
||||
config: {
|
||||
name: '系统配置',
|
||||
description: '真实 DB:SystemConfig 接线后 AgentsService 行为(临时数据自动清理)',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
import { Decimal } from '@prisma/client/runtime/library';
|
||||
import {
|
||||
AGENT_SUSPEND_BLOCK_PLAYER_LOGIN,
|
||||
AGENT_SUSPEND_FREEZE_DIRECT_PLAYERS,
|
||||
} from '../../../shared/config/system-config.service';
|
||||
import type { AgentsService } from '../../agent/agents.service';
|
||||
import type { PrismaService } from '../../../shared/prisma/prisma.service';
|
||||
import { expectEqual, expectTrue } from './smoke-test.helpers';
|
||||
import type { SmokeTestCaseDef } from './smoke-test.cases';
|
||||
|
||||
export const CONFIG_PROBE_COUNT = 2;
|
||||
|
||||
export type ConfigProbeDeps = {
|
||||
prisma: PrismaService;
|
||||
agents: AgentsService;
|
||||
};
|
||||
|
||||
async function upsertBooleanConfig(
|
||||
prisma: PrismaService,
|
||||
key: string,
|
||||
value: boolean,
|
||||
snapshots: Array<{ key: string; value: string | null }>,
|
||||
) {
|
||||
const row = await prisma.systemConfig.findUnique({ where: { configKey: key } });
|
||||
snapshots.push({ key, value: row?.configValue ?? null });
|
||||
await prisma.systemConfig.upsert({
|
||||
where: { configKey: key },
|
||||
create: {
|
||||
configKey: key,
|
||||
configValue: value ? 'true' : 'false',
|
||||
description: 'smoke config probe',
|
||||
},
|
||||
update: { configValue: value ? 'true' : 'false' },
|
||||
});
|
||||
}
|
||||
|
||||
async function restoreConfigs(
|
||||
prisma: PrismaService,
|
||||
snapshots: Array<{ key: string; value: string | null }>,
|
||||
) {
|
||||
for (const snap of snapshots) {
|
||||
if (snap.value === null) {
|
||||
await prisma.systemConfig.deleteMany({ where: { configKey: snap.key } });
|
||||
} else {
|
||||
await prisma.systemConfig.upsert({
|
||||
where: { configKey: snap.key },
|
||||
create: {
|
||||
configKey: snap.key,
|
||||
configValue: snap.value,
|
||||
description: 'smoke config restore',
|
||||
},
|
||||
update: { configValue: snap.value },
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function createConfigProbes(deps: ConfigProbeDeps): SmokeTestCaseDef[] {
|
||||
return [
|
||||
{
|
||||
id: 'CFG001',
|
||||
suite: 'config',
|
||||
name: '代理停用默认:全局 freeze 级联冻结直属玩家',
|
||||
description: 'AgentsService.updateAgentAdmin 未传 flag 时读取 agent.suspend_freeze_direct_players',
|
||||
run: async () => {
|
||||
const runId = `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
||||
const snapshots: Array<{ key: string; value: string | null }> = [];
|
||||
let agentId: bigint | undefined;
|
||||
let playerId: bigint | undefined;
|
||||
|
||||
try {
|
||||
await upsertBooleanConfig(
|
||||
deps.prisma,
|
||||
AGENT_SUSPEND_FREEZE_DIRECT_PLAYERS,
|
||||
true,
|
||||
snapshots,
|
||||
);
|
||||
await upsertBooleanConfig(
|
||||
deps.prisma,
|
||||
AGENT_SUSPEND_BLOCK_PLAYER_LOGIN,
|
||||
false,
|
||||
snapshots,
|
||||
);
|
||||
|
||||
const agent = await deps.prisma.user.create({
|
||||
data: {
|
||||
username: `smoke_cfg_ag_${runId}`,
|
||||
userType: 'AGENT',
|
||||
status: 'ACTIVE',
|
||||
auth: { create: { passwordHash: 'smoke' } },
|
||||
agentProfile: {
|
||||
create: { level: 1, creditLimit: new Decimal(10000) },
|
||||
},
|
||||
},
|
||||
});
|
||||
agentId = agent.id;
|
||||
await deps.prisma.agentClosure.create({
|
||||
data: { ancestorId: agent.id, descendantId: agent.id, depth: 0 },
|
||||
});
|
||||
|
||||
const player = await deps.prisma.user.create({
|
||||
data: {
|
||||
username: `smoke_cfg_pl_${runId}`,
|
||||
userType: 'PLAYER',
|
||||
status: 'ACTIVE',
|
||||
parentId: agent.id,
|
||||
auth: { create: { passwordHash: 'smoke' } },
|
||||
},
|
||||
});
|
||||
playerId = player.id;
|
||||
|
||||
await deps.agents.updateAgentAdmin(agent.id, { status: 'SUSPENDED' });
|
||||
|
||||
const frozen = await deps.prisma.user.findUnique({ where: { id: player.id } });
|
||||
expectEqual('player status after suspend', frozen?.status, 'SUSPENDED');
|
||||
} finally {
|
||||
if (playerId) {
|
||||
await deps.prisma.userAuth.deleteMany({ where: { userId: playerId } });
|
||||
await deps.prisma.user.deleteMany({ where: { id: playerId } });
|
||||
}
|
||||
if (agentId) {
|
||||
await deps.prisma.agentClosure.deleteMany({
|
||||
where: { OR: [{ ancestorId: agentId }, { descendantId: agentId }] },
|
||||
});
|
||||
await deps.prisma.agentProfile.deleteMany({ where: { userId: agentId } });
|
||||
await deps.prisma.userAuth.deleteMany({ where: { userId: agentId } });
|
||||
await deps.prisma.user.deleteMany({ where: { id: agentId } });
|
||||
}
|
||||
await restoreConfigs(deps.prisma, snapshots);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'CFG002',
|
||||
suite: 'config',
|
||||
name: '代理停用默认:全局 block 禁止直属玩家登录',
|
||||
description: 'AgentsService.updateAgentAdmin 未传 flag 时写入 blockDirectPlayerLogin',
|
||||
run: async () => {
|
||||
const runId = `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
||||
const snapshots: Array<{ key: string; value: string | null }> = [];
|
||||
let agentId: bigint | undefined;
|
||||
|
||||
try {
|
||||
await upsertBooleanConfig(
|
||||
deps.prisma,
|
||||
AGENT_SUSPEND_FREEZE_DIRECT_PLAYERS,
|
||||
false,
|
||||
snapshots,
|
||||
);
|
||||
await upsertBooleanConfig(
|
||||
deps.prisma,
|
||||
AGENT_SUSPEND_BLOCK_PLAYER_LOGIN,
|
||||
true,
|
||||
snapshots,
|
||||
);
|
||||
|
||||
const agent = await deps.prisma.user.create({
|
||||
data: {
|
||||
username: `smoke_cfg2_ag_${runId}`,
|
||||
userType: 'AGENT',
|
||||
status: 'ACTIVE',
|
||||
auth: { create: { passwordHash: 'smoke' } },
|
||||
agentProfile: {
|
||||
create: { level: 1, creditLimit: new Decimal(10000) },
|
||||
},
|
||||
},
|
||||
});
|
||||
agentId = agent.id;
|
||||
await deps.prisma.agentClosure.create({
|
||||
data: { ancestorId: agent.id, descendantId: agent.id, depth: 0 },
|
||||
});
|
||||
|
||||
await deps.agents.updateAgentAdmin(agent.id, { status: 'SUSPENDED' });
|
||||
|
||||
const profile = await deps.prisma.agentProfile.findUnique({
|
||||
where: { userId: agent.id },
|
||||
});
|
||||
expectTrue(
|
||||
'blockDirectPlayerLogin persisted',
|
||||
profile?.blockDirectPlayerLogin === true,
|
||||
{ value: profile?.blockDirectPlayerLogin },
|
||||
);
|
||||
} finally {
|
||||
if (agentId) {
|
||||
await deps.prisma.agentClosure.deleteMany({
|
||||
where: { OR: [{ ancestorId: agentId }, { descendantId: agentId }] },
|
||||
});
|
||||
await deps.prisma.agentProfile.deleteMany({ where: { userId: agentId } });
|
||||
await deps.prisma.userAuth.deleteMany({ where: { userId: agentId } });
|
||||
await deps.prisma.user.deleteMany({ where: { id: agentId } });
|
||||
}
|
||||
await restoreConfigs(deps.prisma, snapshots);
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import { SettlementService } from '../../settlement/settlement.service';
|
||||
import { WalletService } from '../../ledger/wallet.service';
|
||||
import { SMOKE_SUITE_META, SMOKE_TEST_CASES, type SmokeTestCaseDef } from './smoke-test.cases';
|
||||
import { BET_FLOW_PROBE_COUNT, createBetFlowProbes } from './smoke-test.bet-flow-probes';
|
||||
import { CONFIG_PROBE_COUNT, createConfigProbes } from './smoke-test.config-probes';
|
||||
import { createDatabaseProbes, DATABASE_PROBE_COUNT } from './smoke-test.db-probes';
|
||||
import {
|
||||
beginSmokeSteps,
|
||||
@@ -50,7 +49,6 @@ export class SmokeTestService {
|
||||
}
|
||||
counts.set('database', DATABASE_PROBE_COUNT);
|
||||
counts.set('bet-flow', BET_FLOW_PROBE_COUNT);
|
||||
counts.set('config', CONFIG_PROBE_COUNT);
|
||||
|
||||
return [...counts.entries()].map(([id, caseCount]) => ({
|
||||
id,
|
||||
@@ -79,7 +77,6 @@ export class SmokeTestService {
|
||||
const staticCases = SMOKE_TEST_CASES.filter((c) => !allow || allow.has(c.suite));
|
||||
const runDb = !allow || allow.has('database');
|
||||
const runBetFlow = !allow || allow.has('bet-flow');
|
||||
const runConfig = !allow || allow.has('config');
|
||||
|
||||
const results: SmokeTestCaseResult[] = [];
|
||||
|
||||
@@ -105,15 +102,6 @@ export class SmokeTestService {
|
||||
}
|
||||
}
|
||||
|
||||
if (runConfig) {
|
||||
for (const probe of createConfigProbes({
|
||||
prisma: this.prisma,
|
||||
agents: this.agents,
|
||||
})) {
|
||||
results.push(await this.executeCase(probe));
|
||||
}
|
||||
}
|
||||
|
||||
const finished = Date.now();
|
||||
const passed = results.filter((r) => r.status === 'PASS').length;
|
||||
const failed = results.filter((r) => r.status === 'FAIL').length;
|
||||
|
||||
@@ -118,8 +118,8 @@ function settleOverUnder(
|
||||
|
||||
if (winCount === 2) return 'WIN';
|
||||
if (loseCount === 2) return 'LOSE';
|
||||
if (winCount === 1 && loseCount === 0) return 'HALF_WIN';
|
||||
if (loseCount === 1 && winCount === 0) return 'HALF_LOSE';
|
||||
if (winCount === 1) return 'HALF_WIN';
|
||||
if (loseCount === 1) return 'HALF_LOSE';
|
||||
return 'PUSH';
|
||||
}
|
||||
|
||||
|
||||
@@ -148,9 +148,7 @@ describe('SettlementService outright winner flow', () => {
|
||||
settlementBatch: {
|
||||
create: settlementBatchCreate,
|
||||
findUnique: settlementBatchFindUnique,
|
||||
findFirst: jest.fn().mockResolvedValue(null),
|
||||
update: jest.fn().mockResolvedValue({}),
|
||||
updateMany: jest.fn().mockResolvedValue({ count: 0 }),
|
||||
},
|
||||
bet: { findMany: betFindMany },
|
||||
$transaction: transaction,
|
||||
@@ -249,7 +247,7 @@ describe('SettlementService outright winner flow', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('shows parlay as lost when this match leg loses even if other legs are pending', async () => {
|
||||
it('keeps a parlay pending until every match in the ticket is settled', async () => {
|
||||
matchFindFirst.mockResolvedValue({
|
||||
id: matchId,
|
||||
isOutright: false,
|
||||
@@ -306,13 +304,14 @@ describe('SettlementService outright winner flow', () => {
|
||||
ftAway: 1,
|
||||
});
|
||||
|
||||
expect(preview.pendingOtherMatches).toBe(0);
|
||||
expect(preview.lostOnThisMatch).toBe(1);
|
||||
expect(preview.pendingOtherMatches).toBe(1);
|
||||
expect(preview.lostOnThisMatch).toBe(0);
|
||||
expect(preview.items.items).toEqual([
|
||||
expect.objectContaining({
|
||||
betNo: 'PARLAY-PENDING',
|
||||
result: 'LOST',
|
||||
result: 'PENDING_OTHER_MATCHES',
|
||||
payout: '0',
|
||||
note: '本场腿已出结果,待其他场次结算后统一结算',
|
||||
}),
|
||||
]);
|
||||
});
|
||||
@@ -405,7 +404,6 @@ describe('SettlementService outright winner flow', () => {
|
||||
findUnique: settlementBatchFindUnique,
|
||||
update: jest.fn().mockResolvedValue({}),
|
||||
updateMany: jest.fn().mockResolvedValue({ count: 1 }),
|
||||
findFirst: jest.fn().mockResolvedValue({ id: batchId }),
|
||||
},
|
||||
match: { update: txMatchUpdate },
|
||||
});
|
||||
@@ -476,442 +474,3 @@ describe('SettlementService outright winner flow', () => {
|
||||
expect(result).toEqual({ success: true, batchId: batchId.toString() });
|
||||
});
|
||||
});
|
||||
|
||||
describe('SettlementService hardening', () => {
|
||||
const matchId = BigInt(200);
|
||||
const operatorId = BigInt(1);
|
||||
const batchId = BigInt(900);
|
||||
const otherBatchId = BigInt(901);
|
||||
|
||||
const fixtureMatch = {
|
||||
id: matchId,
|
||||
isOutright: false,
|
||||
status: 'PENDING_SETTLEMENT',
|
||||
deletedAt: null,
|
||||
};
|
||||
|
||||
const pendingSingleBet = {
|
||||
id: BigInt(3001),
|
||||
betNo: 'BET-SINGLE',
|
||||
betType: 'SINGLE',
|
||||
status: 'PENDING',
|
||||
stake: new Decimal(100),
|
||||
agentId: null,
|
||||
userId: BigInt(70),
|
||||
user: { id: BigInt(70) },
|
||||
selections: [
|
||||
{
|
||||
id: BigInt(4001),
|
||||
matchId,
|
||||
marketType: 'FT_1X2',
|
||||
selectionId: BigInt(501),
|
||||
selectionNameSnapshot: 'Home',
|
||||
handicapLine: null,
|
||||
totalLine: null,
|
||||
odds: new Decimal(2),
|
||||
resultStatus: null,
|
||||
sortOrder: 0,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
function buildService(overrides: {
|
||||
prisma?: Record<string, unknown>;
|
||||
wallet?: Record<string, jest.Mock>;
|
||||
transactionClient?: Record<string, unknown>;
|
||||
} = {}) {
|
||||
const wallet = {
|
||||
settleBet: jest.fn().mockResolvedValue(undefined),
|
||||
voidBet: jest.fn().mockResolvedValue(undefined),
|
||||
...(overrides.wallet ?? {}),
|
||||
};
|
||||
const agents = { recalculateUsedCredit: jest.fn().mockResolvedValue(undefined) };
|
||||
const transaction = jest.fn(async (fn: (client: unknown) => Promise<void>) => {
|
||||
const defaultClient = {
|
||||
team: { findUnique: jest.fn().mockResolvedValue(null) },
|
||||
market: { findMany: jest.fn().mockResolvedValue([]) },
|
||||
marketSelection: { findMany: jest.fn().mockResolvedValue([{ id: BigInt(501), selectionCode: 'HOME' }]) },
|
||||
matchScore: {
|
||||
upsert: jest.fn().mockResolvedValue({}),
|
||||
findUnique: jest.fn().mockResolvedValue({
|
||||
matchId,
|
||||
htHomeScore: 0,
|
||||
htAwayScore: 0,
|
||||
ftHomeScore: 1,
|
||||
ftAwayScore: 0,
|
||||
winnerTeamId: null,
|
||||
}),
|
||||
},
|
||||
bet: {
|
||||
findMany: jest.fn().mockResolvedValue([pendingSingleBet]),
|
||||
updateMany: jest.fn().mockResolvedValue({ count: 1 }),
|
||||
},
|
||||
betSelection: { update: jest.fn().mockResolvedValue({}), findMany: jest.fn().mockResolvedValue([]) },
|
||||
settlementItem: { create: jest.fn().mockResolvedValue({}) },
|
||||
settlementBatch: {
|
||||
findUnique: jest.fn().mockResolvedValue({
|
||||
id: batchId,
|
||||
batchNo: 'STL-001',
|
||||
matchId,
|
||||
status: 'PREVIEW',
|
||||
htHomeScore: 0,
|
||||
htAwayScore: 0,
|
||||
ftHomeScore: 1,
|
||||
ftAwayScore: 0,
|
||||
match: fixtureMatch,
|
||||
}),
|
||||
update: jest.fn().mockResolvedValue({}),
|
||||
updateMany: jest.fn().mockResolvedValue({ count: 1 }),
|
||||
findFirst: jest.fn().mockResolvedValue({ id: batchId }),
|
||||
},
|
||||
match: { update: jest.fn().mockResolvedValue({}) },
|
||||
...(overrides.transactionClient ?? {}),
|
||||
};
|
||||
await fn(defaultClient);
|
||||
});
|
||||
|
||||
const prisma = {
|
||||
match: {
|
||||
count: jest.fn().mockResolvedValue(0),
|
||||
findFirst: jest.fn().mockResolvedValue({ ...fixtureMatch, status: 'CLOSED' }),
|
||||
update: jest.fn().mockResolvedValue({}),
|
||||
},
|
||||
team: { findUnique: jest.fn().mockResolvedValue(null) },
|
||||
market: { findMany: jest.fn().mockResolvedValue([]) },
|
||||
marketSelection: {
|
||||
findFirst: jest.fn().mockResolvedValue(null),
|
||||
findMany: jest.fn().mockResolvedValue([{ id: BigInt(501), selectionCode: 'HOME' }]),
|
||||
},
|
||||
matchScore: {
|
||||
findUnique: jest.fn().mockResolvedValue(null),
|
||||
upsert: jest.fn().mockResolvedValue({}),
|
||||
},
|
||||
settlementBatch: {
|
||||
create: jest.fn().mockResolvedValue({ id: batchId, matchId, status: 'PREVIEW' }),
|
||||
findUnique: jest.fn(),
|
||||
findFirst: jest.fn().mockResolvedValue(null),
|
||||
updateMany: jest.fn().mockResolvedValue({ count: 0 }),
|
||||
},
|
||||
bet: { findMany: jest.fn().mockResolvedValue([]) },
|
||||
$transaction: transaction,
|
||||
...(overrides.prisma ?? {}),
|
||||
};
|
||||
|
||||
return {
|
||||
service: new SettlementService(prisma as never, wallet as never, agents as never),
|
||||
prisma,
|
||||
wallet,
|
||||
transaction,
|
||||
};
|
||||
}
|
||||
|
||||
it('recordScore rejects half-time scores greater than full-time', async () => {
|
||||
const { service } = buildService();
|
||||
try {
|
||||
await service.recordScore(matchId, 2, 0, 1, 0, operatorId);
|
||||
throw new Error('Expected recordScore to reject');
|
||||
} catch (err) {
|
||||
const response = (err as { getResponse?: () => unknown }).getResponse?.();
|
||||
expect(response).toEqual(
|
||||
expect.objectContaining({ code: 'SETTLEMENT_SCORE_INVALID' }),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it('previewSettlement cancels older preview batches before creating a new one', async () => {
|
||||
const updateMany = jest.fn().mockResolvedValue({ count: 1 });
|
||||
const { service } = buildService({
|
||||
prisma: {
|
||||
bet: { findMany: jest.fn().mockResolvedValue([]) },
|
||||
settlementBatch: {
|
||||
create: jest.fn().mockResolvedValue({ id: batchId, matchId, status: 'PREVIEW' }),
|
||||
updateMany,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await service.previewSettlement(matchId, operatorId, {
|
||||
htHome: 0,
|
||||
htAway: 0,
|
||||
ftHome: 1,
|
||||
ftAway: 0,
|
||||
});
|
||||
|
||||
expect(updateMany).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
where: { matchId, status: 'PREVIEW', isResettle: false },
|
||||
data: { status: 'CANCELLED' },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('confirmSettlement rejects stale preview batches', async () => {
|
||||
const staleBatch = {
|
||||
id: otherBatchId,
|
||||
batchNo: 'STL-OLD',
|
||||
matchId,
|
||||
status: 'PREVIEW',
|
||||
htHomeScore: 0,
|
||||
htAwayScore: 0,
|
||||
ftHomeScore: 1,
|
||||
ftAwayScore: 0,
|
||||
match: fixtureMatch,
|
||||
};
|
||||
const { service } = buildService({
|
||||
prisma: {
|
||||
settlementBatch: {
|
||||
findUnique: jest.fn().mockResolvedValue(staleBatch),
|
||||
},
|
||||
},
|
||||
transactionClient: {
|
||||
settlementBatch: {
|
||||
findUnique: jest.fn().mockResolvedValue(staleBatch),
|
||||
update: jest.fn().mockResolvedValue({}),
|
||||
updateMany: jest.fn().mockResolvedValue({ count: 1 }),
|
||||
findFirst: jest.fn().mockResolvedValue({ id: batchId }),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
await service.confirmSettlement(otherBatchId, operatorId);
|
||||
throw new Error('Expected confirmSettlement to reject');
|
||||
} catch (err) {
|
||||
const response = (err as { getResponse?: () => unknown }).getResponse?.();
|
||||
expect(response).toEqual(
|
||||
expect.objectContaining({ code: 'SETTLEMENT_BATCH_STALE' }),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it('confirmSettlement throws when bet status update fails', async () => {
|
||||
const { service } = buildService({
|
||||
prisma: {
|
||||
settlementBatch: {
|
||||
findUnique: jest.fn().mockResolvedValue({
|
||||
id: batchId,
|
||||
batchNo: 'STL-001',
|
||||
matchId,
|
||||
status: 'PREVIEW',
|
||||
htHomeScore: 0,
|
||||
htAwayScore: 0,
|
||||
ftHomeScore: 1,
|
||||
ftAwayScore: 0,
|
||||
match: fixtureMatch,
|
||||
}),
|
||||
},
|
||||
},
|
||||
transactionClient: {
|
||||
bet: {
|
||||
findMany: jest.fn().mockResolvedValue([pendingSingleBet]),
|
||||
updateMany: jest.fn().mockResolvedValue({ count: 0 }),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
await service.confirmSettlement(batchId, operatorId);
|
||||
throw new Error('Expected confirmSettlement to reject');
|
||||
} catch (err) {
|
||||
const response = (err as { getResponse?: () => unknown }).getResponse?.();
|
||||
expect(response).toEqual(
|
||||
expect.objectContaining({
|
||||
code: 'SETTLEMENT_BET_UPDATE_FAILED',
|
||||
params: expect.objectContaining({ betNo: 'BET-SINGLE' }),
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it('voidMatchBets settles cross-match parlay as lost when voided leg joins an existing losing leg', async () => {
|
||||
const parlayBet = {
|
||||
id: BigInt(5001),
|
||||
betNo: 'PARLAY-VOID',
|
||||
betType: 'PARLAY',
|
||||
status: 'PENDING',
|
||||
stake: new Decimal(100),
|
||||
agentId: null,
|
||||
userId: BigInt(80),
|
||||
selections: [
|
||||
{
|
||||
id: BigInt(6001),
|
||||
matchId,
|
||||
marketType: 'FT_1X2',
|
||||
selectionId: BigInt(501),
|
||||
selectionNameSnapshot: 'Home',
|
||||
handicapLine: null,
|
||||
totalLine: null,
|
||||
odds: new Decimal(2),
|
||||
resultStatus: null,
|
||||
sortOrder: 0,
|
||||
},
|
||||
{
|
||||
id: BigInt(6002),
|
||||
matchId: BigInt(201),
|
||||
marketType: 'FT_1X2',
|
||||
selectionId: BigInt(502),
|
||||
selectionNameSnapshot: 'Away',
|
||||
handicapLine: null,
|
||||
totalLine: null,
|
||||
odds: new Decimal(2),
|
||||
resultStatus: 'LOSE',
|
||||
sortOrder: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const betSelectionUpdate = jest.fn().mockResolvedValue({});
|
||||
const betSelectionFindMany = jest
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{ ...parlayBet.selections[0], resultStatus: 'VOID', odds: new Decimal(2) },
|
||||
{ ...parlayBet.selections[1], resultStatus: 'LOSE', odds: new Decimal(2) },
|
||||
]);
|
||||
const betUpdateMany = jest.fn().mockResolvedValue({ count: 1 });
|
||||
const funds = { settleBet: jest.fn().mockResolvedValue(undefined), voidBet: jest.fn() };
|
||||
|
||||
const transaction = jest.fn(async (fn: (client: unknown) => Promise<unknown>) =>
|
||||
fn({
|
||||
match: { update: jest.fn().mockResolvedValue({}) },
|
||||
bet: {
|
||||
findMany: jest.fn().mockResolvedValue([parlayBet]),
|
||||
updateMany: betUpdateMany,
|
||||
},
|
||||
betSelection: {
|
||||
update: betSelectionUpdate,
|
||||
findMany: betSelectionFindMany,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
const service = new SettlementService(
|
||||
{ $transaction: transaction } as never,
|
||||
funds as never,
|
||||
{ recalculateUsedCredit: jest.fn() } as never,
|
||||
);
|
||||
|
||||
const result = await service.voidMatchBets(matchId);
|
||||
|
||||
expect(result.voidedCount).toBe(1);
|
||||
expect(funds.voidBet).not.toHaveBeenCalled();
|
||||
expect(funds.settleBet).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
betNo: 'PARLAY-VOID',
|
||||
result: 'LOSE',
|
||||
batchNo: `void:${matchId}`,
|
||||
}),
|
||||
);
|
||||
expect(funds.settleBet.mock.calls[0][0].payout.toString()).toBe('0');
|
||||
});
|
||||
|
||||
it('previewResettlement treats single multi-leg tickets like parlays', async () => {
|
||||
const multiLegSingle = {
|
||||
id: BigInt(7001),
|
||||
betNo: 'SINGLE-MULTI',
|
||||
betType: 'SINGLE',
|
||||
status: 'WON',
|
||||
stake: new Decimal(100),
|
||||
actualReturn: new Decimal(360),
|
||||
agentId: null,
|
||||
userId: BigInt(90),
|
||||
selections: [
|
||||
{
|
||||
id: BigInt(8001),
|
||||
matchId,
|
||||
marketType: 'FT_1X2',
|
||||
selectionId: BigInt(501),
|
||||
selectionNameSnapshot: 'Home',
|
||||
handicapLine: null,
|
||||
totalLine: null,
|
||||
odds: new Decimal(2),
|
||||
resultStatus: 'WIN',
|
||||
sortOrder: 0,
|
||||
},
|
||||
{
|
||||
id: BigInt(8002),
|
||||
matchId,
|
||||
marketType: 'FT_1X2',
|
||||
selectionId: BigInt(502),
|
||||
selectionNameSnapshot: 'Away',
|
||||
handicapLine: null,
|
||||
totalLine: null,
|
||||
odds: new Decimal(2),
|
||||
resultStatus: 'WIN',
|
||||
sortOrder: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const { service } = buildService({
|
||||
prisma: {
|
||||
match: {
|
||||
count: jest.fn().mockResolvedValue(0),
|
||||
findFirst: jest.fn().mockResolvedValue({ ...fixtureMatch, status: 'SETTLED' }),
|
||||
update: jest.fn().mockResolvedValue({}),
|
||||
},
|
||||
bet: { findMany: jest.fn().mockResolvedValue([multiLegSingle]) },
|
||||
settlementBatch: {
|
||||
create: jest.fn().mockImplementation(({ data }) =>
|
||||
Promise.resolve({ id: batchId, ...data }),
|
||||
),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const preview = await service.previewResettlement(
|
||||
matchId,
|
||||
{
|
||||
htHome: 0,
|
||||
htAway: 0,
|
||||
ftHome: 0,
|
||||
ftAway: 1,
|
||||
},
|
||||
operatorId,
|
||||
);
|
||||
|
||||
expect(preview.items).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
betNo: 'SINGLE-MULTI',
|
||||
newStatus: 'LOST',
|
||||
}),
|
||||
]),
|
||||
);
|
||||
expect(preview.items[0].newPayout.toString()).toBe('0');
|
||||
});
|
||||
|
||||
it('previewSettlement rejects unsupported market types on pending bets', async () => {
|
||||
const { service } = buildService({
|
||||
prisma: {
|
||||
bet: {
|
||||
findMany: jest.fn().mockResolvedValue([
|
||||
{
|
||||
...pendingSingleBet,
|
||||
selections: [
|
||||
{
|
||||
...pendingSingleBet.selections[0],
|
||||
marketType: 'UNKNOWN_MARKET',
|
||||
},
|
||||
],
|
||||
},
|
||||
]),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
try {
|
||||
await service.previewSettlement(matchId, operatorId, {
|
||||
htHome: 0,
|
||||
htAway: 0,
|
||||
ftHome: 1,
|
||||
ftAway: 0,
|
||||
});
|
||||
throw new Error('Expected previewSettlement to reject');
|
||||
} catch (err) {
|
||||
const response = (err as { getResponse?: () => unknown }).getResponse?.();
|
||||
expect(response).toEqual(
|
||||
expect.objectContaining({ code: 'SETTLEMENT_MARKET_UNSUPPORTED' }),
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
resolveSelectionCode,
|
||||
templateScoresForMarket,
|
||||
} from './domain/settlement-helpers';
|
||||
import { isSettlementSupportedMarketType } from '@thebet365/shared';
|
||||
|
||||
const SETTLEMENT_ENTRY_STATUSES = new Set(['CLOSED', 'PENDING_SETTLEMENT', 'SETTLED']);
|
||||
const STAT_MARKET_REQUIREMENTS = {
|
||||
@@ -190,95 +189,6 @@ export class SettlementService {
|
||||
}
|
||||
}
|
||||
|
||||
private assertScoreConsistency(score: ScoreInput, isOutright: boolean) {
|
||||
if (isOutright) return;
|
||||
if (
|
||||
score.htHome < 0 ||
|
||||
score.htAway < 0 ||
|
||||
score.ftHome < 0 ||
|
||||
score.ftAway < 0 ||
|
||||
score.htHome > score.ftHome ||
|
||||
score.htAway > score.ftAway
|
||||
) {
|
||||
throw appBadRequest('SETTLEMENT_SCORE_INVALID');
|
||||
}
|
||||
}
|
||||
|
||||
private assertSupportedMarketTypes(
|
||||
bets: Array<{ selections: Array<{ marketType: string }> }>,
|
||||
) {
|
||||
for (const bet of bets) {
|
||||
for (const sel of bet.selections) {
|
||||
if (!isSettlementSupportedMarketType(sel.marketType)) {
|
||||
throw appBadRequest('SETTLEMENT_MARKET_UNSUPPORTED', {
|
||||
marketType: sel.marketType,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private assertOutrightWinnerForBets(
|
||||
bets: Array<{ selections: Array<{ marketType: string }> }>,
|
||||
winnerTeamCode: string | null,
|
||||
isOutright: boolean,
|
||||
) {
|
||||
const hasOutrightLeg =
|
||||
isOutright ||
|
||||
bets.some((bet) =>
|
||||
bet.selections.some((sel) => sel.marketType === 'OUTRIGHT_WINNER'),
|
||||
);
|
||||
if (hasOutrightLeg && !winnerTeamCode) {
|
||||
throw appBadRequest('SETTLEMENT_WINNER_REQUIRED');
|
||||
}
|
||||
}
|
||||
|
||||
private requireBetUpdate(updated: { count: number }, betNo: string) {
|
||||
if (updated.count !== 1) {
|
||||
throw appBadRequest('SETTLEMENT_BET_UPDATE_FAILED', { betNo });
|
||||
}
|
||||
}
|
||||
|
||||
private async assertLatestPreviewBatch(
|
||||
batchId: bigint,
|
||||
matchId: bigint,
|
||||
tx?: TxClient,
|
||||
) {
|
||||
const client: PrismaClientLike = tx ?? this.prisma;
|
||||
const latest = await client.settlementBatch.findFirst({
|
||||
where: { matchId, status: 'PREVIEW', isResettle: false },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
select: { id: true },
|
||||
});
|
||||
if (latest && latest.id !== batchId) {
|
||||
throw appBadRequest('SETTLEMENT_BATCH_STALE', { batchId: batchId.toString() });
|
||||
}
|
||||
}
|
||||
|
||||
private async cancelStalePreviewBatches(matchId: bigint, tx?: TxClient) {
|
||||
const client: PrismaClientLike = tx ?? this.prisma;
|
||||
await client.settlementBatch.updateMany({
|
||||
where: { matchId, status: 'PREVIEW', isResettle: false },
|
||||
data: { status: 'CANCELLED' },
|
||||
});
|
||||
}
|
||||
|
||||
private parlayBetStatusFromResult(
|
||||
parlayResult: ReturnType<typeof calculateParlayPayout>,
|
||||
): 'LOST' | 'PUSH' | 'WON' {
|
||||
if (parlayResult.betResult === 'LOST') return 'LOST';
|
||||
if (parlayResult.betResult === 'PUSH') return 'PUSH';
|
||||
return 'WON';
|
||||
}
|
||||
|
||||
private walletResultFromParlayBetResult(
|
||||
betResult: 'WON' | 'LOST' | 'PUSH',
|
||||
): 'WIN' | 'LOSE' | 'PUSH' {
|
||||
if (betResult === 'LOST') return 'LOSE';
|
||||
if (betResult === 'PUSH') return 'PUSH';
|
||||
return 'WIN';
|
||||
}
|
||||
|
||||
async recordScore(
|
||||
matchId: bigint,
|
||||
htHome: number,
|
||||
@@ -316,13 +226,6 @@ export class SettlementService {
|
||||
}
|
||||
}
|
||||
|
||||
if (!match.isOutright) {
|
||||
this.assertScoreConsistency(
|
||||
{ htHome, htAway, ftHome, ftAway },
|
||||
match.isOutright,
|
||||
);
|
||||
}
|
||||
|
||||
const stats = this.statsInputFromSource(statsInput);
|
||||
await this.prisma.matchScore.upsert({
|
||||
where: { matchId },
|
||||
@@ -409,19 +312,7 @@ export class SettlementService {
|
||||
}
|
||||
|
||||
const scoreSource = await this.resolvePreviewScoreSource(matchId, match.isOutright, opts);
|
||||
if (!match.isOutright) {
|
||||
this.assertScoreConsistency(
|
||||
{
|
||||
htHome: scoreSource.htHome,
|
||||
htAway: scoreSource.htAway,
|
||||
ftHome: scoreSource.ftHome,
|
||||
ftAway: scoreSource.ftAway,
|
||||
},
|
||||
match.isOutright,
|
||||
);
|
||||
}
|
||||
const computation = await this.computePreviewComputation(matchId, scoreSource);
|
||||
await this.cancelStalePreviewBatches(matchId);
|
||||
const batch = await this.prisma.settlementBatch.create({
|
||||
data: {
|
||||
matchId,
|
||||
@@ -842,8 +733,6 @@ export class SettlementService {
|
||||
statsInput,
|
||||
pendingBets.flatMap((bet) => bet.selections.map((sel) => sel.marketType)),
|
||||
);
|
||||
this.assertSupportedMarketTypes(pendingBets);
|
||||
this.assertOutrightWinnerForBets(pendingBets, winnerTeamCode, false);
|
||||
|
||||
let totalPayout = new Decimal(0);
|
||||
let totalRefund = new Decimal(0);
|
||||
@@ -869,7 +758,6 @@ export class SettlementService {
|
||||
const result = this.settleLegResult(sel, code, scoreInput, statsInput, winnerTeamCode);
|
||||
const payout = calculatePayout(bet.stake, sel.odds, result);
|
||||
if (result === 'WIN' || result === 'HALF_WIN') wonLegsOnMatch += 1;
|
||||
if (result === 'LOSE') lostOnThisMatch += 1;
|
||||
items.push({ betId: bet.id, betNo: bet.betNo, betType: 'SINGLE', result, payout });
|
||||
if (result === 'PUSH' || result === 'VOID') {
|
||||
totalRefund = totalRefund.add(bet.stake);
|
||||
@@ -888,7 +776,6 @@ export class SettlementService {
|
||||
};
|
||||
});
|
||||
const parlay = calculateParlayPayout(bet.stake, legResults);
|
||||
if (parlay.betResult === 'LOST') lostOnThisMatch += 1;
|
||||
items.push({
|
||||
betId: bet.id,
|
||||
betNo: bet.betNo,
|
||||
@@ -922,7 +809,6 @@ export class SettlementService {
|
||||
selectionCodes,
|
||||
);
|
||||
if (preview.kind === 'SETTLED') {
|
||||
if (preview.betResult === 'LOST') lostOnThisMatch += 1;
|
||||
items.push({
|
||||
betId: bet.id,
|
||||
betNo: bet.betNo,
|
||||
@@ -979,18 +865,11 @@ export class SettlementService {
|
||||
selectionCodes.get(sel.selectionId.toString()),
|
||||
sel.selectionNameSnapshot,
|
||||
);
|
||||
const legResult = this.settleLegResult(sel, code, scoreInput, statsInput, winnerTeamCode);
|
||||
if (legResult === 'LOSE') {
|
||||
return { kind: 'SETTLED', betResult: 'LOST', payout: new Decimal(0) };
|
||||
}
|
||||
legResults.push({
|
||||
odds: sel.odds,
|
||||
result: legResult,
|
||||
result: this.settleLegResult(sel, code, scoreInput, statsInput, winnerTeamCode),
|
||||
});
|
||||
} else if (sel.resultStatus) {
|
||||
if (sel.resultStatus === 'LOSE') {
|
||||
return { kind: 'SETTLED', betResult: 'LOST', payout: new Decimal(0) };
|
||||
}
|
||||
legResults.push({
|
||||
odds: sel.odds,
|
||||
result: sel.resultStatus as SelectionResult,
|
||||
@@ -1087,13 +966,6 @@ export class SettlementService {
|
||||
pendingBets.flatMap((bet) => bet.selections.map((sel) => sel.marketType)),
|
||||
tx,
|
||||
);
|
||||
this.assertSupportedMarketTypes(pendingBets);
|
||||
this.assertOutrightWinnerForBets(
|
||||
pendingBets,
|
||||
winnerTeamCode,
|
||||
currentBatch.match.isOutright,
|
||||
);
|
||||
await this.assertLatestPreviewBatch(batchId, currentBatch.matchId, tx);
|
||||
let settledCount = 0;
|
||||
|
||||
await this.upsertMatchScoreRecord(
|
||||
@@ -1129,7 +1001,7 @@ export class SettlementService {
|
||||
settledAt: new Date(),
|
||||
},
|
||||
});
|
||||
this.requireBetUpdate(updatedBet, bet.betNo);
|
||||
if (updatedBet.count !== 1) continue;
|
||||
|
||||
await tx.betSelection.update({
|
||||
where: { id: sel.id },
|
||||
@@ -1173,7 +1045,12 @@ export class SettlementService {
|
||||
});
|
||||
}
|
||||
const parlayResult = calculateParlayPayout(bet.stake, legResults);
|
||||
const betStatus = this.parlayBetStatusFromResult(parlayResult);
|
||||
const betStatus =
|
||||
parlayResult.betResult === 'LOST'
|
||||
? 'LOST'
|
||||
: parlayResult.betResult === 'PUSH'
|
||||
? 'PUSH'
|
||||
: 'WON';
|
||||
|
||||
const updatedBet = await tx.bet.updateMany({
|
||||
where: { id: bet.id, status: 'PENDING' },
|
||||
@@ -1183,7 +1060,7 @@ export class SettlementService {
|
||||
settledAt: new Date(),
|
||||
},
|
||||
});
|
||||
this.requireBetUpdate(updatedBet, bet.betNo);
|
||||
if (updatedBet.count !== 1) continue;
|
||||
|
||||
await this.funds.settleBet({
|
||||
userId: bet.userId,
|
||||
@@ -1191,7 +1068,12 @@ export class SettlementService {
|
||||
payout: parlayResult.payout,
|
||||
betNo: bet.betNo,
|
||||
batchNo: batch.batchNo,
|
||||
result: this.walletResultFromParlayBetResult(parlayResult.betResult),
|
||||
result:
|
||||
parlayResult.betResult === 'LOST'
|
||||
? 'LOSE'
|
||||
: parlayResult.betResult === 'PUSH'
|
||||
? 'PUSH'
|
||||
: 'WIN',
|
||||
tx,
|
||||
});
|
||||
|
||||
@@ -1234,7 +1116,12 @@ export class SettlementService {
|
||||
result: s.resultStatus as SelectionResult,
|
||||
}));
|
||||
const parlayResult = calculateParlayPayout(bet.stake, legResults);
|
||||
const betStatus = this.parlayBetStatusFromResult(parlayResult);
|
||||
const betStatus =
|
||||
parlayResult.betResult === 'LOST'
|
||||
? 'LOST'
|
||||
: parlayResult.betResult === 'PUSH'
|
||||
? 'PUSH'
|
||||
: 'WON';
|
||||
|
||||
const updatedBet = await tx.bet.updateMany({
|
||||
where: { id: bet.id, status: 'PENDING' },
|
||||
@@ -1244,7 +1131,7 @@ export class SettlementService {
|
||||
settledAt: new Date(),
|
||||
},
|
||||
});
|
||||
this.requireBetUpdate(updatedBet, bet.betNo);
|
||||
if (updatedBet.count !== 1) continue;
|
||||
|
||||
await this.funds.settleBet({
|
||||
userId: bet.userId,
|
||||
@@ -1252,7 +1139,12 @@ export class SettlementService {
|
||||
payout: parlayResult.payout,
|
||||
betNo: bet.betNo,
|
||||
batchNo: batch.batchNo,
|
||||
result: this.walletResultFromParlayBetResult(parlayResult.betResult),
|
||||
result:
|
||||
parlayResult.betResult === 'LOST'
|
||||
? 'LOSE'
|
||||
: parlayResult.betResult === 'PUSH'
|
||||
? 'PUSH'
|
||||
: 'WIN',
|
||||
tx,
|
||||
});
|
||||
|
||||
@@ -1494,7 +1386,7 @@ export class SettlementService {
|
||||
winnerTeamCode: string | null,
|
||||
selectionCodes: Map<string, string | null>,
|
||||
) {
|
||||
if (bet.betType === 'SINGLE' && bet.selections.length === 1) {
|
||||
if (bet.betType === 'SINGLE') {
|
||||
const sel = bet.selections[0];
|
||||
const code = resolveSelectionCode(
|
||||
selectionCodes.get(sel.selectionId.toString()),
|
||||
@@ -1509,26 +1401,6 @@ export class SettlementService {
|
||||
};
|
||||
}
|
||||
|
||||
if (bet.betType === 'SINGLE' && bet.selections.length > 1) {
|
||||
const legResults: Array<{ odds: Decimal; result: SelectionResult }> = [];
|
||||
const legUpdates = new Map<string, SelectionResult>();
|
||||
for (const sel of bet.selections) {
|
||||
const code = resolveSelectionCode(
|
||||
selectionCodes.get(sel.selectionId.toString()),
|
||||
sel.selectionNameSnapshot,
|
||||
);
|
||||
const result = this.settleLegResult(sel, code, scoreInput, statsInput, winnerTeamCode);
|
||||
legResults.push({ odds: sel.odds, result });
|
||||
legUpdates.set(sel.id.toString(), result);
|
||||
}
|
||||
const parlayResult = calculateParlayPayout(bet.stake, legResults);
|
||||
return {
|
||||
payout: parlayResult.payout,
|
||||
betStatus: this.parlayBetStatusFromResult(parlayResult),
|
||||
legUpdates,
|
||||
};
|
||||
}
|
||||
|
||||
const legResults: Array<{ odds: Decimal; result: SelectionResult }> = [];
|
||||
const legUpdates = new Map<string, SelectionResult>();
|
||||
|
||||
@@ -1551,11 +1423,14 @@ export class SettlementService {
|
||||
}
|
||||
|
||||
const parlayResult = calculateParlayPayout(bet.stake, legResults);
|
||||
return {
|
||||
payout: parlayResult.payout,
|
||||
betStatus: this.parlayBetStatusFromResult(parlayResult),
|
||||
legUpdates,
|
||||
};
|
||||
const betStatus =
|
||||
parlayResult.betResult === 'LOST'
|
||||
? 'LOST'
|
||||
: parlayResult.betResult === 'PUSH'
|
||||
? 'PUSH'
|
||||
: 'WON';
|
||||
|
||||
return { payout: parlayResult.payout, betStatus, legUpdates };
|
||||
}
|
||||
|
||||
async previewResettlement(
|
||||
@@ -1573,18 +1448,6 @@ export class SettlementService {
|
||||
throw appBadRequest('RESETTLE_SETTLED_ONLY');
|
||||
}
|
||||
|
||||
if (!match.isOutright) {
|
||||
this.assertScoreConsistency(
|
||||
{
|
||||
htHome: scoreInput.htHome,
|
||||
htAway: scoreInput.htAway,
|
||||
ftHome: scoreInput.ftHome,
|
||||
ftAway: scoreInput.ftAway,
|
||||
},
|
||||
match.isOutright,
|
||||
);
|
||||
}
|
||||
|
||||
const winnerTeamCode = winnerTeamId
|
||||
? await this.resolveWinnerTeamCode(winnerTeamId)
|
||||
: null;
|
||||
@@ -1604,8 +1467,6 @@ export class SettlementService {
|
||||
statsInput,
|
||||
settledBets.flatMap((bet) => bet.selections.map((sel) => sel.marketType)),
|
||||
);
|
||||
this.assertSupportedMarketTypes(settledBets);
|
||||
this.assertOutrightWinnerForBets(settledBets, winnerTeamCode, match.isOutright);
|
||||
const items: Array<{
|
||||
betId: bigint;
|
||||
betNo: string;
|
||||
@@ -1751,12 +1612,6 @@ export class SettlementService {
|
||||
settledBets.flatMap((bet) => bet.selections.map((sel) => sel.marketType)),
|
||||
tx,
|
||||
);
|
||||
this.assertSupportedMarketTypes(settledBets);
|
||||
this.assertOutrightWinnerForBets(
|
||||
settledBets,
|
||||
winnerTeamCode,
|
||||
currentBatch.match.isOutright,
|
||||
);
|
||||
let affectedCount = 0;
|
||||
|
||||
await this.upsertMatchScoreRecord(
|
||||
@@ -1860,7 +1715,6 @@ export class SettlementService {
|
||||
options: { cancelMatch?: boolean } = {},
|
||||
) {
|
||||
const agentIds = new Set<bigint>();
|
||||
const voidBatchNo = `void:${matchId}`;
|
||||
|
||||
const voidedCount = await this.prisma.$transaction(async (tx) => {
|
||||
if (options.cancelMatch) {
|
||||
@@ -1872,26 +1726,16 @@ export class SettlementService {
|
||||
|
||||
const bets = await tx.bet.findMany({
|
||||
where: { status: 'PENDING', selections: { some: { matchId } } },
|
||||
include: { selections: { orderBy: { sortOrder: 'asc' } } },
|
||||
});
|
||||
|
||||
let count = 0;
|
||||
for (const bet of bets) {
|
||||
const isSingleOneLeg = bet.betType === 'SINGLE' && bet.selections.length === 1;
|
||||
|
||||
if (isSingleOneLeg) {
|
||||
const sel = bet.selections[0];
|
||||
const updated = await tx.bet.updateMany({
|
||||
where: { id: bet.id, status: 'PENDING' },
|
||||
data: { status: 'VOID', actualReturn: bet.stake, settledAt: new Date() },
|
||||
});
|
||||
if (updated.count !== 1) continue;
|
||||
|
||||
await tx.betSelection.update({
|
||||
where: { id: sel.id },
|
||||
data: { resultStatus: 'VOID' },
|
||||
});
|
||||
|
||||
await this.funds.voidBet({
|
||||
userId: bet.userId,
|
||||
stake: bet.stake,
|
||||
@@ -1901,57 +1745,6 @@ export class SettlementService {
|
||||
});
|
||||
if (bet.agentId) agentIds.add(bet.agentId);
|
||||
count += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
const legsOnMatch = bet.selections.filter(
|
||||
(sel) => sel.matchId?.toString() === matchId.toString(),
|
||||
);
|
||||
if (!legsOnMatch.length) continue;
|
||||
|
||||
for (const sel of legsOnMatch) {
|
||||
await tx.betSelection.update({
|
||||
where: { id: sel.id },
|
||||
data: { resultStatus: 'VOID' },
|
||||
});
|
||||
}
|
||||
|
||||
const updatedLegs = await tx.betSelection.findMany({
|
||||
where: { betId: bet.id },
|
||||
orderBy: { sortOrder: 'asc' },
|
||||
});
|
||||
if (!updatedLegs.every((sel) => sel.resultStatus != null)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const legResults = updatedLegs.map((sel) => ({
|
||||
odds: sel.odds,
|
||||
result: sel.resultStatus as SelectionResult,
|
||||
}));
|
||||
const parlayResult = calculateParlayPayout(bet.stake, legResults);
|
||||
const betStatus = this.parlayBetStatusFromResult(parlayResult);
|
||||
|
||||
const updatedBet = await tx.bet.updateMany({
|
||||
where: { id: bet.id, status: 'PENDING' },
|
||||
data: {
|
||||
status: betStatus,
|
||||
actualReturn: parlayResult.payout,
|
||||
settledAt: new Date(),
|
||||
},
|
||||
});
|
||||
if (updatedBet.count !== 1) continue;
|
||||
|
||||
await this.funds.settleBet({
|
||||
userId: bet.userId,
|
||||
stake: bet.stake,
|
||||
payout: parlayResult.payout,
|
||||
betNo: bet.betNo,
|
||||
batchNo: voidBatchNo,
|
||||
result: this.walletResultFromParlayBetResult(parlayResult.betResult),
|
||||
tx,
|
||||
});
|
||||
if (bet.agentId) agentIds.add(bet.agentId);
|
||||
count += 1;
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
@@ -19,10 +19,6 @@ export type InboxNotifySettings = {
|
||||
inboxEnabled: boolean;
|
||||
/** 充值审核通过/拒绝时发送站内信 */
|
||||
deposit: boolean;
|
||||
/** 发布 Banner 内容时发送站内信推广 */
|
||||
banner: boolean;
|
||||
/** 发布公告/滚动条内容时发送站内信推广 */
|
||||
announcement: boolean;
|
||||
};
|
||||
|
||||
export type PlatformDirectCashbackSettings = {
|
||||
@@ -45,9 +41,9 @@ export type PlayerAccountSettings = {
|
||||
};
|
||||
|
||||
export type AgentSuspendSettings = {
|
||||
/** 停用代理时默认级联冻结直属玩家(单次操作仍可覆盖) */
|
||||
/** 停用代理时是否允许级联冻结其直属玩家(需管理员显式勾选) */
|
||||
suspendFreezeDirectPlayers: boolean;
|
||||
/** 停用代理时默认禁止直属玩家登录(单次操作仍可覆盖) */
|
||||
/** 上级代理停用时是否禁止其直属玩家登录 */
|
||||
suspendBlockPlayerLogin: boolean;
|
||||
};
|
||||
|
||||
@@ -243,13 +239,11 @@ export class SystemConfigService {
|
||||
}
|
||||
|
||||
async getInboxNotifySettings(): Promise<InboxNotifySettings> {
|
||||
const [inboxEnabled, deposit, banner, announcement] = await Promise.all([
|
||||
const [inboxEnabled, deposit] = await Promise.all([
|
||||
this.getBoolean(INBOX_FEATURE_ENABLED, true),
|
||||
this.getBoolean(INBOX_NOTIFY_DEPOSIT, true),
|
||||
this.getBoolean(INBOX_NOTIFY_BANNER, true),
|
||||
this.getBoolean(INBOX_NOTIFY_ANNOUNCEMENT, true),
|
||||
]);
|
||||
return { inboxEnabled, deposit, banner, announcement };
|
||||
return { inboxEnabled, deposit };
|
||||
}
|
||||
|
||||
async updateInboxNotifySettings(data: Partial<InboxNotifySettings>) {
|
||||
@@ -267,20 +261,6 @@ export class SystemConfigService {
|
||||
'充值审核结果是否通过站内邮箱通知玩家',
|
||||
);
|
||||
}
|
||||
if (data.banner !== undefined) {
|
||||
await this.setBoolean(
|
||||
INBOX_NOTIFY_BANNER,
|
||||
data.banner,
|
||||
'发布 Banner 内容时是否发送站内信推广',
|
||||
);
|
||||
}
|
||||
if (data.announcement !== undefined) {
|
||||
await this.setBoolean(
|
||||
INBOX_NOTIFY_ANNOUNCEMENT,
|
||||
data.announcement,
|
||||
'发布公告/滚动条内容时是否发送站内信推广',
|
||||
);
|
||||
}
|
||||
return this.getInboxNotifySettings();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="TheBet365" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="theme-color" content="#001A33" />
|
||||
<link rel="icon" type="image/png" href="/logo.png" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="apple-touch-icon" href="/logo.png" />
|
||||
<link rel="manifest" href="/site.webmanifest" />
|
||||
<title>TheBet365</title>
|
||||
<style>
|
||||
html, body { margin: 0; padding: 0; height: 100%; background: #000; }
|
||||
html, body { margin: 0; padding: 0; height: 100%; background: #001A33; }
|
||||
#app-loading {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
@@ -22,7 +18,7 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #000;
|
||||
background: #001A33;
|
||||
z-index: 9999;
|
||||
}
|
||||
#app-loading svg {
|
||||
@@ -38,37 +34,8 @@
|
||||
<body>
|
||||
<div id="app-loading">
|
||||
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="gs-track" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#D4AF37" stop-opacity="0.18" />
|
||||
<stop offset="50%" stop-color="#F0D875" stop-opacity="0.25" />
|
||||
<stop offset="100%" stop-color="#D4AF37" stop-opacity="0.18" />
|
||||
</linearGradient>
|
||||
<linearGradient id="gs-arc" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#FFF4C8" />
|
||||
<stop offset="22%" stop-color="#F0D875" />
|
||||
<stop offset="50%" stop-color="#D4AF37" />
|
||||
<stop offset="78%" stop-color="#B8942B" />
|
||||
<stop offset="100%" stop-color="#8B6914" />
|
||||
</linearGradient>
|
||||
<filter id="gs-glow">
|
||||
<feGaussianBlur stdDeviation="1.2" result="blur" />
|
||||
<feMerge>
|
||||
<feMergeNode in="blur" />
|
||||
<feMergeNode in="SourceGraphic" />
|
||||
</feMerge>
|
||||
</filter>
|
||||
<radialGradient id="gs-dot" cx="50%" cy="50%" r="50%">
|
||||
<stop offset="0%" stop-color="#FFF4C8" />
|
||||
<stop offset="60%" stop-color="#F0D875" />
|
||||
<stop offset="100%" stop-color="#D4AF37" />
|
||||
</radialGradient>
|
||||
</defs>
|
||||
<circle cx="24" cy="24" r="20" stroke="url(#gs-track)" stroke-width="3" fill="none" />
|
||||
<circle cx="24" cy="24" r="20" stroke="url(#gs-arc)" stroke-width="3" fill="none" stroke-linecap="round" stroke-dasharray="31.4 94.2" filter="url(#gs-glow)" />
|
||||
<circle cx="24" cy="4" r="2.5" fill="url(#gs-dot)" filter="url(#gs-glow)">
|
||||
<animate attributeName="r" values="2.5;3.2;2.5" dur="1.2s" repeatCount="indefinite" />
|
||||
</circle>
|
||||
<circle cx="24" cy="24" r="20" stroke="rgba(255,255,255,0.14)" stroke-width="3" fill="none" />
|
||||
<circle cx="24" cy="24" r="20" stroke="rgba(255,255,255,0.72)" stroke-width="3" fill="none" stroke-linecap="round" stroke-dasharray="31.4 94.2" />
|
||||
</svg>
|
||||
</div>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const root = path.join(__dirname, '..');
|
||||
|
||||
function flatten(obj, prefix = '') {
|
||||
const out = {};
|
||||
for (const [k, v] of Object.entries(obj)) {
|
||||
const key = prefix ? `${prefix}.${k}` : k;
|
||||
if (v && typeof v === 'object' && !Array.isArray(v)) Object.assign(out, flatten(v, key));
|
||||
else out[key] = v;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function extractKeysFromDir(dir) {
|
||||
const keys = new Set();
|
||||
const re = /\bt\s*\(\s*['"`]([^'"`]+)['"`]/g;
|
||||
function walk(d) {
|
||||
for (const ent of fs.readdirSync(d, { withFileTypes: true })) {
|
||||
const p = path.join(d, ent.name);
|
||||
if (ent.isDirectory()) walk(p);
|
||||
else if (ent.name.endsWith('.vue')) {
|
||||
const src = fs.readFileSync(p, 'utf8');
|
||||
let m;
|
||||
while ((m = re.exec(src))) keys.add(m[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
walk(dir);
|
||||
return keys;
|
||||
}
|
||||
|
||||
const zhMod = await import('../src/i18n/zh-CN.ts');
|
||||
const zh = flatten(zhMod.default);
|
||||
const dirs = ['src/views/desktop', 'src/components/desktop'].map((d) => path.join(root, d));
|
||||
const used = new Set();
|
||||
for (const d of dirs) extractKeysFromDir(d).forEach((k) => used.add(k));
|
||||
|
||||
const missing = [...used].filter((k) => !(k in zh)).sort();
|
||||
console.log(`Missing keys (${missing.length}):`);
|
||||
missing.forEach((k) => console.log(` ${k}`));
|
||||
@@ -6,14 +6,14 @@
|
||||
<stop offset="1" stop-color="#000000"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="gold" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop stop-color="#E8C96A"/>
|
||||
<stop offset="1" stop-color="#D4AF37"/>
|
||||
<stop stop-color="#FFFFFF"/>
|
||||
<stop offset="1" stop-color="rgba(255,255,255,0.72)"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="750" height="280" fill="url(#bg)"/>
|
||||
<circle cx="620" cy="80" r="120" fill="#D4AF37" opacity="0.06"/>
|
||||
<circle cx="680" cy="200" r="80" fill="#D4AF37" opacity="0.08"/>
|
||||
<circle cx="620" cy="80" r="120" fill="#FFFFFF" opacity="0.06"/>
|
||||
<circle cx="680" cy="200" r="80" fill="#FFFFFF" opacity="0.08"/>
|
||||
<text x="40" y="110" font-family="Arial, sans-serif" font-size="42" font-weight="800" fill="url(#gold)">TheBet365</text>
|
||||
<text x="40" y="160" font-family="Arial, sans-serif" font-size="22" fill="#8E8E93">足球赛事火热进行中</text>
|
||||
<rect x="40" y="190" width="140" height="4" fill="#D4AF37" opacity="0.5" rx="2"/>
|
||||
<rect x="40" y="190" width="140" height="4" fill="#FFFFFF" opacity="0.5" rx="2"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1018 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 221 KiB |
@@ -1,8 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" fill="none" aria-hidden="true">
|
||||
<circle cx="60" cy="60" r="48" stroke="#D4AF37" stroke-width="4" opacity="0.5"/>
|
||||
<circle cx="60" cy="60" r="22" stroke="#F0D875" stroke-width="4"/>
|
||||
<path d="M60 8 L68 32 L60 44 L52 32 Z" fill="#D4AF37"/>
|
||||
<path d="M60 112 L68 88 L60 76 L52 88 Z" fill="#D4AF37"/>
|
||||
<path d="M8 60 L32 52 L44 60 L32 68 Z" fill="#D4AF37"/>
|
||||
<path d="M112 60 L88 68 L76 60 L88 52 Z" fill="#D4AF37"/>
|
||||
<circle cx="60" cy="60" r="48" stroke="#FFFFFF" stroke-width="4" opacity="0.5"/>
|
||||
<circle cx="60" cy="60" r="22" stroke="rgba(255,255,255,0.72)" stroke-width="4"/>
|
||||
<path d="M60 8 L68 32 L60 44 L52 32 Z" fill="#FFFFFF"/>
|
||||
<path d="M60 112 L68 88 L60 76 L52 88 Z" fill="#FFFFFF"/>
|
||||
<path d="M8 60 L32 52 L44 60 L32 68 Z" fill="#FFFFFF"/>
|
||||
<path d="M112 60 L88 68 L76 60 L88 52 Z" fill="#FFFFFF"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 504 B |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 38 KiB |
@@ -52,7 +52,7 @@ function goDetail() {
|
||||
gap: 10px;
|
||||
margin: -4px -2px 14px;
|
||||
padding: 10px 12px;
|
||||
background: #141414;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
overflow: hidden;
|
||||
@@ -65,9 +65,11 @@ function goDetail() {
|
||||
|
||||
.marquee-bar.embedded {
|
||||
margin: 0;
|
||||
padding: 8px 12px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent; /* inherit parent strip's gold gradient */
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--bg-elevated);
|
||||
}
|
||||
|
||||
.marquee-bar.embedded .marquee-badge {
|
||||
@@ -85,9 +87,9 @@ function goDetail() {
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.12em;
|
||||
color: #1A1000;
|
||||
background: var(--gradient-gold);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
background: var(--surface-active);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@@ -110,7 +112,7 @@ function goDetail() {
|
||||
padding-right: 80px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--primary-light);
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,20 +44,20 @@ const { visible, scrollToTop } = useBackToTop(toRef(props, 'scrollEl'));
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--border-gold-soft, rgba(200, 168, 78, 0.35));
|
||||
background: rgba(17, 17, 17, 0.92);
|
||||
color: var(--primary-light, #c8a84e);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: var(--bg-body);
|
||||
color: var(--primary-light);
|
||||
box-shadow: var(--shadow);
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
.back-top-btn.above-nav {
|
||||
bottom: calc(var(--player-bottom-nav-h, 54px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 12px);
|
||||
bottom: calc(68px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
|
||||
.back-top-btn:active {
|
||||
background: rgba(200, 168, 78, 0.16);
|
||||
background: var(--surface-accent);
|
||||
transform: scale(0.96);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,23 +125,14 @@ onUnmounted(stopAutoPlay);
|
||||
class="slide"
|
||||
@click="onBannerClick(banner)"
|
||||
>
|
||||
<template v-if="imageUrl(banner)">
|
||||
<img
|
||||
:src="imageUrl(banner)"
|
||||
alt=""
|
||||
class="slide-backdrop"
|
||||
aria-hidden="true"
|
||||
:loading="i === 0 ? 'eager' : 'lazy'"
|
||||
@error="onImgError"
|
||||
/>
|
||||
<img
|
||||
v-if="imageUrl(banner)"
|
||||
:src="imageUrl(banner)"
|
||||
:alt="title(banner)"
|
||||
class="slide-img"
|
||||
:loading="i === 0 ? 'eager' : 'lazy'"
|
||||
@error="onImgError"
|
||||
/>
|
||||
</template>
|
||||
<div v-else class="slide-fallback">{{ title(banner) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -168,83 +159,40 @@ onUnmounted(stopAutoPlay);
|
||||
<style scoped>
|
||||
.carousel {
|
||||
position: relative;
|
||||
margin: -12px -16px 14px;
|
||||
margin: 0 -16px 14px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.media {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #05080d;
|
||||
}
|
||||
|
||||
.viewport {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height: clamp(148px, 41.86vw, 180px);
|
||||
}
|
||||
|
||||
.track {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.slide {
|
||||
position: relative;
|
||||
flex: 0 0 100%;
|
||||
min-width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(7, 18, 31, 0.94), rgba(6, 8, 12, 0.98)),
|
||||
#070d15;
|
||||
cursor: pointer;
|
||||
touch-action: manipulation;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.slide::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 1;
|
||||
background:
|
||||
linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.03) 48%, rgba(0, 0, 0, 0.18));
|
||||
box-shadow: inset 0 -1px 0 rgba(212, 175, 55, 0.16);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.slide-backdrop {
|
||||
position: absolute;
|
||||
inset: -18px;
|
||||
width: calc(100% + 36px);
|
||||
height: calc(100% + 36px);
|
||||
object-fit: cover;
|
||||
filter: blur(16px);
|
||||
opacity: 0.42;
|
||||
transform: scale(1.04);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.slide-img {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
object-position: center;
|
||||
height: 180px;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.slide-fallback {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 180px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -264,7 +212,6 @@ onUnmounted(stopAutoPlay);
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
color: var(--primary-light);
|
||||
border: 1px solid var(--border);
|
||||
padding-bottom: 5px;
|
||||
font-size: 22px;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
|
||||
@@ -66,7 +66,7 @@ function close() {
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: var(--bg-card);
|
||||
color: var(--primary-light);
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
@@ -93,28 +93,23 @@ function close() {
|
||||
max-width: 340px;
|
||||
max-height: 85vh;
|
||||
overflow-y: auto;
|
||||
background: linear-gradient(165deg, #1a1810 0%, #121212 45%, #0a0a0a 100%);
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px 14px 14px;
|
||||
box-shadow: var(--shadow), 0 0 24px rgba(212, 175, 55, 0.08);
|
||||
box-shadow: var(--shadow), var(--glow-gold);
|
||||
}
|
||||
|
||||
.close-x {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../assets/images/generated/modal-close-gold-v1.webp') center / contain no-repeat;
|
||||
color: transparent;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.close-x:active {
|
||||
background-image: url('../assets/images/generated/modal-close-gold-pressed-v1.webp');
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
background: var(--bg-elevated);
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.title {
|
||||
|
||||
@@ -178,9 +178,9 @@ function goDetail() {
|
||||
.cashback-tag {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: #f0b90b;
|
||||
background: rgba(240, 185, 11, 0.1);
|
||||
border: 1px solid rgba(240, 185, 11, 0.25);
|
||||
color: var(--primary-light);
|
||||
background: var(--surface-accent);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: 4px;
|
||||
padding: 1px 6px;
|
||||
}
|
||||
@@ -188,9 +188,9 @@ function goDetail() {
|
||||
.bet-type-tag {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-light, #c8a84e);
|
||||
background: rgba(200, 168, 78, 0.12);
|
||||
border: 1px solid rgba(200, 168, 78, 0.25);
|
||||
color: var(--primary-light);
|
||||
background: var(--surface-accent);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: 4px;
|
||||
padding: 1px 6px;
|
||||
letter-spacing: 0.02em;
|
||||
@@ -198,16 +198,17 @@ function goDetail() {
|
||||
|
||||
.card-date {
|
||||
font-size: 10px;
|
||||
color: #555;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
flex-shrink: 0;
|
||||
margin-left: auto;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
color: #e8e8e8;
|
||||
color: var(--text);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -221,7 +222,7 @@ function goDetail() {
|
||||
|
||||
.pick-label {
|
||||
font-size: 11px;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -233,8 +234,8 @@ function goDetail() {
|
||||
.odds-badge {
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
color: #c8a84e;
|
||||
background: rgba(200, 168, 78, 0.1);
|
||||
color: var(--primary-light);
|
||||
background: var(--surface-accent);
|
||||
border-radius: 4px;
|
||||
padding: 1px 6px;
|
||||
flex-shrink: 0;
|
||||
@@ -250,24 +251,24 @@ function goDetail() {
|
||||
|
||||
.stake-amt {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.return-amt {
|
||||
font-size: 15px;
|
||||
font-weight: 900;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.return-amt.highlight { color: #3db865; }
|
||||
.return-amt.pending { color: #e8c84a; }
|
||||
.return-amt.lost { color: #e05050; }
|
||||
.return-amt.highlight { color: var(--success); }
|
||||
.return-amt.pending { color: var(--primary-light); }
|
||||
.return-amt.lost { color: var(--danger); }
|
||||
|
||||
.chevron {
|
||||
flex-shrink: 0;
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
color: var(--neutral);
|
||||
margin-left: 2px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -11,10 +11,8 @@ import {
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { formatMoney, parseAmount } from '../utils/localeDisplay';
|
||||
import BetSuccessOverlay from './BetSuccessOverlay.vue';
|
||||
import ConfirmDialog from './ConfirmDialog.vue';
|
||||
import api from '../api';
|
||||
import { usePlayerProfile } from '../composables/usePlayerProfile';
|
||||
import { buildBetPlaceConfirmMessage } from '../utils/betPlaceConfirmMessage';
|
||||
|
||||
const props = defineProps<{ modelValue: boolean }>();
|
||||
const emit = defineEmits<{ 'update:modelValue': [boolean] }>();
|
||||
@@ -35,8 +33,6 @@ const balance = ref<number | null>(null);
|
||||
const error = ref('');
|
||||
const success = ref('');
|
||||
const showSuccess = ref(false);
|
||||
const showPlaceConfirm = ref(false);
|
||||
const placeConfirmMessage = ref('');
|
||||
const MIN_STAKE = 5;
|
||||
const MAX_STAKE_INTEGER_LENGTH = 9;
|
||||
const stakeInput = ref('');
|
||||
@@ -349,54 +345,34 @@ function oddsTrendClass(delta: OddsDelta) {
|
||||
return delta.newOdds >= delta.oldOdds ? 'odds-up' : 'odds-down';
|
||||
}
|
||||
|
||||
function validatePlaceBet(): boolean {
|
||||
if (!activeItems.value.length) return false;
|
||||
async function placeBet() {
|
||||
if (!activeItems.value.length) return;
|
||||
if (!auth.token) {
|
||||
auth.showLoginPrompt();
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
if (slip.stake < MIN_STAKE) {
|
||||
error.value = t('bet.slip_min_error', { amount: MIN_STAKE });
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
if (balance.value != null && slip.stake > balance.value) {
|
||||
error.value = t('bet.outright_insufficient');
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
if (activeTab.value === 'parlay' && !canSubmitActive.value) {
|
||||
error.value = slip.parlayItems.length > PARLAY_MAX_LEGS
|
||||
? t('bet.parlay_max_legs')
|
||||
: t('bet.parlay_need_more');
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
if (hasSuspendedSelections.value) {
|
||||
error.value = t('bet.odds_suspended');
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function onPlaceBetClick() {
|
||||
error.value = '';
|
||||
if (!validatePlaceBet()) return;
|
||||
if (hasPendingOddsChanges.value) {
|
||||
acceptPendingOdds();
|
||||
}
|
||||
const items = activeTab.value === 'parlay' ? [...slip.parlayItems] : activeItems.value;
|
||||
placeConfirmMessage.value = buildBetPlaceConfirmMessage(t, {
|
||||
mode: activeTab.value,
|
||||
items,
|
||||
totalStake: Number(slip.stake) || 0,
|
||||
totalReturn: activeEstimatedReturn.value,
|
||||
totalOdds: activeTab.value === 'parlay' ? activeTotalOdds.value : undefined,
|
||||
formatMoney: (amount) => formatMoney(amount, locale.value),
|
||||
getStake: () => Number(slip.stake) || 0,
|
||||
getOdds: (item) => effectiveOdds(item),
|
||||
});
|
||||
showPlaceConfirm.value = true;
|
||||
}
|
||||
|
||||
async function executePlaceBet() {
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
success.value = '';
|
||||
@@ -438,11 +414,6 @@ async function executePlaceBet() {
|
||||
}
|
||||
}
|
||||
|
||||
async function confirmPlaceBet() {
|
||||
showPlaceConfirm.value = false;
|
||||
await executePlaceBet();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(open) => {
|
||||
@@ -651,7 +622,7 @@ watch(
|
||||
type="button"
|
||||
class="btn-primary"
|
||||
:disabled="loading || !canSubmitWithOdds"
|
||||
@click="onPlaceBetClick"
|
||||
@click="placeBet"
|
||||
>
|
||||
{{ submitButtonLabel }}
|
||||
</button>
|
||||
@@ -659,16 +630,6 @@ watch(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ConfirmDialog
|
||||
v-model:visible="showPlaceConfirm"
|
||||
:title="t('bet.place_confirm_title')"
|
||||
:message="placeConfirmMessage"
|
||||
:confirm-text="t('bet.place_bet')"
|
||||
:cancel-text="t('common.cancel')"
|
||||
:loading="loading"
|
||||
@confirm="confirmPlaceBet"
|
||||
/>
|
||||
|
||||
<BetSuccessOverlay :show="showSuccess" @done="onSuccessDone" />
|
||||
</template>
|
||||
|
||||
@@ -685,15 +646,13 @@ watch(
|
||||
.drawer {
|
||||
width: 100%;
|
||||
max-height: 88vh;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent 22%),
|
||||
rgba(14, 14, 12, 0.98);
|
||||
background: var(--bg-body);
|
||||
border-radius: 16px 16px 0 0;
|
||||
border-top: 1px solid rgba(255, 226, 156, 0.22);
|
||||
border-top: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 -20px 44px rgba(0, 0, 0, 0.48);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.drawer-head {
|
||||
@@ -705,14 +664,14 @@ watch(
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
padding: 14px 14px 10px;
|
||||
background: rgba(12, 12, 11, 0.72);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.drawer-kicker {
|
||||
margin: 0 0 3px;
|
||||
font-size: 11px;
|
||||
color: var(--primary-light);
|
||||
color: var(--primary);
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
@@ -730,7 +689,7 @@ watch(
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
background: var(--bg-elevated);
|
||||
color: var(--text-muted);
|
||||
font-size: 18px;
|
||||
padding: 0;
|
||||
@@ -744,15 +703,15 @@ watch(
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 14px;
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
border-bottom: 1px solid rgba(212, 175, 55, 0.18);
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.balance-bar strong {
|
||||
justify-self: end;
|
||||
color: var(--primary-light);
|
||||
color: var(--text);
|
||||
font-size: 16px;
|
||||
font-weight: 900;
|
||||
}
|
||||
@@ -761,7 +720,7 @@ watch(
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
background: var(--bg-elevated);
|
||||
color: var(--text-muted);
|
||||
padding: 0;
|
||||
}
|
||||
@@ -771,23 +730,23 @@ watch(
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
padding: 8px 12px 0;
|
||||
gap: 6px;
|
||||
background: transparent;
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.slip-tab {
|
||||
min-height: 38px;
|
||||
border-radius: 6px 6px 0 0;
|
||||
border: 1px solid var(--border);
|
||||
background: #171717;
|
||||
background: var(--bg-input);
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.slip-tab.active {
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.13);
|
||||
color: var(--primary-light);
|
||||
border-color: var(--primary);
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.tab-count {
|
||||
@@ -799,7 +758,7 @@ watch(
|
||||
margin-left: 6px;
|
||||
border-radius: 9px;
|
||||
background: var(--primary);
|
||||
color: #111;
|
||||
color: var(--on-primary);
|
||||
font-size: 11px;
|
||||
font-weight: 900;
|
||||
}
|
||||
@@ -824,15 +783,15 @@ watch(
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
padding: 11px 12px;
|
||||
background: #151515;
|
||||
border: 1px solid #292929;
|
||||
border-radius: 7px;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.slip-item--single {
|
||||
border-color: var(--border-gold-soft);
|
||||
background: linear-gradient(180deg, rgba(212, 175, 55, 0.12), rgba(18, 18, 18, 0.94));
|
||||
border-color: var(--primary);
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.item-main {
|
||||
@@ -852,7 +811,7 @@ watch(
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.item-pick {
|
||||
@@ -864,7 +823,7 @@ watch(
|
||||
|
||||
.item-odds,
|
||||
.item-side strong {
|
||||
color: var(--primary-light);
|
||||
color: var(--primary);
|
||||
font-size: 22px;
|
||||
font-weight: 900;
|
||||
}
|
||||
@@ -893,14 +852,12 @@ watch(
|
||||
min-height: 48px;
|
||||
padding: 0 14px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(180deg, #4b370d 0%, #241905 100%);
|
||||
border: 1px solid var(--primary-light);
|
||||
color: #ffe892;
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-strong);
|
||||
color: var(--text);
|
||||
font-size: 14px;
|
||||
font-weight: 900;
|
||||
box-shadow:
|
||||
0 0 0 1px rgba(255, 232, 146, 0.18) inset,
|
||||
0 6px 18px rgba(212, 175, 55, 0.18);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btn-add-parlay span {
|
||||
@@ -910,8 +867,8 @@ watch(
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 50%;
|
||||
background: var(--primary-light);
|
||||
color: #191100;
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -922,7 +879,7 @@ watch(
|
||||
border-radius: 8px;
|
||||
background: rgba(244, 162, 97, 0.12);
|
||||
border: 1px solid rgba(244, 162, 97, 0.28);
|
||||
color: var(--primary-light);
|
||||
color: var(--primary);
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
@@ -948,16 +905,16 @@ watch(
|
||||
margin: 0 0 10px;
|
||||
padding: 10px 11px;
|
||||
border-radius: 6px;
|
||||
background: rgba(255, 77, 79, 0.12);
|
||||
border: 1px solid rgba(255, 77, 79, 0.25);
|
||||
color: #ff8b8b;
|
||||
background: rgba(239, 68, 68, 0.12);
|
||||
border: 1px solid rgba(239, 68, 68, 0.25);
|
||||
color: rgba(239, 68, 68, 0.95);
|
||||
font-size: 12px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.parlay-meta {
|
||||
margin: 8px 2px 10px;
|
||||
color: var(--primary-light);
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
}
|
||||
@@ -965,8 +922,8 @@ watch(
|
||||
.stake-area {
|
||||
margin: 12px 0 12px;
|
||||
padding: 12px;
|
||||
background: #151515;
|
||||
border: 1px solid #292929;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
@@ -982,7 +939,7 @@ watch(
|
||||
|
||||
.stake-head strong,
|
||||
.return strong {
|
||||
color: var(--primary-light);
|
||||
color: var(--text);
|
||||
font-size: 16px;
|
||||
font-weight: 900;
|
||||
}
|
||||
@@ -992,17 +949,17 @@ watch(
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: #0c0c0c;
|
||||
background: var(--bg-input);
|
||||
}
|
||||
|
||||
.currency {
|
||||
padding: 0 10px;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
border-right: 1px solid #2d2d2d;
|
||||
border-right: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.stake-input-row input {
|
||||
@@ -1052,10 +1009,10 @@ watch(
|
||||
.number-key,
|
||||
.quick-stakes button {
|
||||
min-height: 52px;
|
||||
border-radius: 5px;
|
||||
background: #f4f1f6;
|
||||
color: #221f26;
|
||||
border: 1px solid rgba(255, 255, 255, 0.16);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-elevated);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
font-size: 26px;
|
||||
font-weight: 500;
|
||||
}
|
||||
@@ -1067,7 +1024,7 @@ watch(
|
||||
|
||||
.quick-stakes button {
|
||||
min-height: 50px;
|
||||
background: #7b787d;
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
@@ -1078,7 +1035,7 @@ watch(
|
||||
}
|
||||
|
||||
.success {
|
||||
color: var(--primary-light);
|
||||
color: var(--success);
|
||||
font-size: 13px;
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
@@ -1089,9 +1046,9 @@ watch(
|
||||
grid-template-columns: 1fr;
|
||||
gap: 10px;
|
||||
padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
|
||||
background: rgba(10, 10, 9, 0.84);
|
||||
border-top: 1px solid var(--border-gold-soft);
|
||||
box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.45);
|
||||
background: var(--bg-body);
|
||||
border-top: 1px solid var(--border);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.drawer-foot--split {
|
||||
@@ -1101,9 +1058,9 @@ watch(
|
||||
.btn-primary {
|
||||
width: 100%;
|
||||
min-height: 48px;
|
||||
border-radius: 7px;
|
||||
background: linear-gradient(180deg, var(--primary-light), var(--primary));
|
||||
color: #111;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
font-size: 16px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
@@ -34,27 +34,27 @@ const stats = computed(() => {
|
||||
|
||||
<template>
|
||||
<div class="stats-panel">
|
||||
<div class="stats-row">
|
||||
<div class="stat-item">
|
||||
<div class="stats-row main">
|
||||
<div class="stat-cell">
|
||||
<span class="stat-val">{{ stats.total }}</span>
|
||||
<span class="stat-label">{{ t('history.stats_total') }}</span>
|
||||
</div>
|
||||
<div class="stat-item won">
|
||||
<div class="stat-cell won">
|
||||
<span class="stat-val">{{ stats.won }}</span>
|
||||
<span class="stat-label">{{ t('history.stats_won') }}</span>
|
||||
</div>
|
||||
<div class="stat-item lost">
|
||||
<div class="stat-cell lost">
|
||||
<span class="stat-val">{{ stats.lost }}</span>
|
||||
<span class="stat-label">{{ t('history.stats_lost') }}</span>
|
||||
</div>
|
||||
<div class="stat-item pending">
|
||||
<div class="stat-cell pending">
|
||||
<span class="stat-val">{{ stats.pending }}</span>
|
||||
<span class="stat-label">{{ t('history.stats_pending') }}</span>
|
||||
</div>
|
||||
<div class="stat-item push">
|
||||
<span class="stat-val">{{ stats.push }}</span>
|
||||
<span class="stat-label">{{ t('history.stats_push') }}</span>
|
||||
</div>
|
||||
<div v-if="stats.push > 0" class="push-row">
|
||||
<span class="stat-label">{{ t('history.stats_push') }}</span>
|
||||
<span class="stat-val push">{{ stats.push }}</span>
|
||||
</div>
|
||||
<div class="stats-bar" :class="{ empty: stats.total === 0 }" aria-hidden="true">
|
||||
<template v-if="stats.total > 0">
|
||||
@@ -64,14 +64,14 @@ const stats = computed(() => {
|
||||
<div v-if="stats.push > 0" class="bar-seg push" :style="{ flex: stats.push }" />
|
||||
</template>
|
||||
</div>
|
||||
<div class="stats-row secondary">
|
||||
<div class="stat-item">
|
||||
<span class="stat-val small">{{ formatMoney(stats.totalStake, locale) }}</span>
|
||||
<div class="stats-row money">
|
||||
<div class="money-cell">
|
||||
<span class="stat-label">{{ t('history.stats_stake') }}</span>
|
||||
<span class="stat-val small">{{ formatMoney(stats.totalStake, locale) }}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-val small gold">{{ formatMoney(stats.totalReturn, locale) }}</span>
|
||||
<div class="money-cell accent">
|
||||
<span class="stat-label">{{ t('history.stats_return') }}</span>
|
||||
<span class="stat-val small gold">{{ formatMoney(stats.totalReturn, locale) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,41 +79,84 @@ const stats = computed(() => {
|
||||
|
||||
<style scoped>
|
||||
.stats-panel {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
position: relative;
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: var(--radius);
|
||||
padding: 14px 12px 10px;
|
||||
margin-bottom: 12px;
|
||||
backdrop-filter: blur(10px);
|
||||
padding: 8px 10px;
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stats-panel::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.stats-row {
|
||||
display: flex;
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.stats-row.secondary {
|
||||
margin-bottom: 0;
|
||||
margin-top: 8px;
|
||||
justify-content: space-around;
|
||||
.stats-row.main {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
.stats-row.money {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
margin-top: 6px;
|
||||
padding-top: 6px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.stat-cell,
|
||||
.money-cell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 1px;
|
||||
min-width: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.money-cell {
|
||||
align-items: flex-start;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.money-cell.accent {
|
||||
align-items: flex-end;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.push-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.stat-val {
|
||||
display: block;
|
||||
font-size: 18px;
|
||||
font-weight: 900;
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: var(--text);
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
.stat-val.small {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
@@ -121,26 +164,35 @@ const stats = computed(() => {
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.stat-item.won .stat-val { color: #3db865; }
|
||||
.stat-item.lost .stat-val { color: #e05050; }
|
||||
.stat-item.pending .stat-val { color: #e8c84a; }
|
||||
.stat-item.push .stat-val { color: #888; }
|
||||
.stat-val.push {
|
||||
font-size: 13px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.stat-cell.won .stat-val { color: var(--success); }
|
||||
.stat-cell.lost .stat-val { color: var(--danger); }
|
||||
.stat-cell.pending .stat-val { color: var(--primary-light); }
|
||||
|
||||
.stat-label {
|
||||
display: block;
|
||||
font-size: 10px;
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.04em;
|
||||
margin-top: 2px;
|
||||
letter-spacing: 0.03em;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.stats-bar {
|
||||
display: flex;
|
||||
height: 4px;
|
||||
height: 3px;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
gap: 2px;
|
||||
gap: 1px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.stats-bar.empty {
|
||||
@@ -148,12 +200,12 @@ const stats = computed(() => {
|
||||
}
|
||||
|
||||
.bar-seg {
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
transition: flex 0.3s ease;
|
||||
}
|
||||
|
||||
.bar-seg.won { background: #3db865; }
|
||||
.bar-seg.lost { background: #e05050; }
|
||||
.bar-seg.pending { background: #e8c84a; }
|
||||
.bar-seg.push { background: #444; }
|
||||
.bar-seg.won { background: var(--success); }
|
||||
.bar-seg.lost { background: var(--danger); }
|
||||
.bar-seg.pending { background: var(--primary-light); }
|
||||
.bar-seg.push { background: var(--neutral); }
|
||||
</style>
|
||||
|
||||
@@ -16,7 +16,7 @@ interface Particle {
|
||||
color: string; shape: number;
|
||||
}
|
||||
|
||||
const COLORS = ['#D4AF37', '#FFD700', '#F0C040', '#C8A02E', '#E6C84C', '#B8960C'];
|
||||
const COLORS = ['#FFFFFF', '#FFD700', '#F0C040', '#C8A02E', '#E6C84C', '#B8960C'];
|
||||
let w = 0;
|
||||
let h = 0;
|
||||
|
||||
@@ -111,8 +111,8 @@ onUnmounted(stop);
|
||||
<canvas ref="canvasRef" class="confetti-canvas" />
|
||||
<div class="success-card">
|
||||
<svg class="check" viewBox="0 0 52 52" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle class="check-circle" cx="26" cy="26" r="24" fill="none" stroke="#D4AF37" stroke-width="3" />
|
||||
<path class="check-mark" d="M14 27l7 7 16-16" fill="none" stroke="#D4AF37" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<circle class="check-circle" cx="26" cy="26" r="24" fill="none" stroke="currentColor" stroke-width="3" />
|
||||
<path class="check-mark" d="M14 27l7 7 16-16" fill="none" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<p class="success-text">{{ t('bet.place_success') }}</p>
|
||||
</div>
|
||||
@@ -151,6 +151,7 @@ onUnmounted(stop);
|
||||
.check {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.check-circle {
|
||||
|
||||
@@ -2,18 +2,28 @@
|
||||
import { ref, onMounted, onUnmounted, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { playerAvatarUrl, randomAvatarKey } from '@thebet365/shared';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { formatMoney } from '../utils/localeDisplay';
|
||||
import { usePlayerProfile } from '../composables/usePlayerProfile';
|
||||
import { useHoverDropdown } from '../composables/useHoverDropdown';
|
||||
|
||||
const props = withDefaults(defineProps<{ hideAvatar?: boolean }>(), { hideAvatar: false });
|
||||
|
||||
const { locale, t } = useI18n();
|
||||
const { profileRaw, refreshProfile } = usePlayerProfile();
|
||||
const { profileRaw, refreshProfile, avatarUrl } = usePlayerProfile();
|
||||
const auth = useAuthStore();
|
||||
const router = useRouter();
|
||||
const { open, openHover, scheduleClose, closeNow } = useHoverDropdown();
|
||||
const open = ref(false);
|
||||
const root = ref<HTMLElement | null>(null);
|
||||
|
||||
const wallet = computed(() => profileRaw.value?.wallet ?? null);
|
||||
|
||||
const displayAvatarUrl = computed(() => {
|
||||
if (avatarUrl.value) return avatarUrl.value;
|
||||
const seed = auth.user?.username;
|
||||
return seed ? playerAvatarUrl(randomAvatarKey(seed)) : null;
|
||||
});
|
||||
|
||||
function amountValue(value: unknown): number {
|
||||
if (value == null) return 0;
|
||||
if (typeof value === 'number') return Number.isFinite(value) ? value : 0;
|
||||
@@ -45,12 +55,7 @@ function toggle() {
|
||||
}
|
||||
|
||||
function close() {
|
||||
closeNow();
|
||||
}
|
||||
|
||||
function onMouseEnter() {
|
||||
openHover();
|
||||
void refreshProfile();
|
||||
open.value = false;
|
||||
}
|
||||
|
||||
function goRecharge() {
|
||||
@@ -59,7 +64,7 @@ function goRecharge() {
|
||||
}
|
||||
|
||||
function onOutsideClick(e: Event) {
|
||||
if (!root.value?.contains(e.target as Node)) closeNow();
|
||||
if (!root.value?.contains(e.target as Node)) open.value = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -74,21 +79,17 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
ref="root"
|
||||
class="cash-chip-wrap"
|
||||
@mouseenter="onMouseEnter"
|
||||
@mouseleave="scheduleClose"
|
||||
>
|
||||
<div ref="root" class="cash-chip-wrap">
|
||||
<button type="button" class="cash-chip" @click="toggle">
|
||||
<span class="chip-body">
|
||||
<span class="chip-label">{{ t('wallet.cash_balance') }}</span>
|
||||
<span class="chip-amount">{{ available }}</span>
|
||||
</span>
|
||||
<span class="chevron" :class="{ open }">▾</span>
|
||||
</button>
|
||||
<button type="button" class="direct-recharge-btn" @click="goRecharge">
|
||||
{{ t('recharge.title') }}
|
||||
|
||||
<!-- Integrated Avatar image (hidden when hideAvatar is set, e.g. desktop top nav) -->
|
||||
<span v-if="!props.hideAvatar" class="chip-avatar-wrap">
|
||||
<img v-if="displayAvatarUrl" :src="displayAvatarUrl" alt="" class="chip-avatar-img" />
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<div v-if="open" class="cash-panel">
|
||||
@@ -110,6 +111,8 @@ onUnmounted(() => {
|
||||
{{ t('recharge.title') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="open" class="backdrop" @click="close" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -117,55 +120,19 @@ onUnmounted(() => {
|
||||
.cash-chip-wrap {
|
||||
position: relative;
|
||||
z-index: 120;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
--dropdown-gap: 8px;
|
||||
}
|
||||
|
||||
.cash-chip-wrap::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: var(--dropdown-gap);
|
||||
}
|
||||
|
||||
.direct-recharge-btn {
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
border-radius: 6px;
|
||||
background: var(--primary);
|
||||
color: var(--tertiary);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.direct-recharge-btn:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.direct-recharge-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.cash-chip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
gap: 10px;
|
||||
height: 36px;
|
||||
padding: 0 8px 0 8px;
|
||||
padding: 0 6px 0 10px;
|
||||
min-width: 0;
|
||||
cursor: pointer;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #141414;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-card);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -178,8 +145,8 @@ onUnmounted(() => {
|
||||
|
||||
.chip-label {
|
||||
font-size: 8px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
color: var(--text-dim);
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.02em;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -190,33 +157,46 @@ onUnmounted(() => {
|
||||
|
||||
.chip-amount {
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
white-space: nowrap;
|
||||
line-height: 1.15;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.chevron {
|
||||
font-size: 10px;
|
||||
color: var(--primary-light);
|
||||
transition: transform 0.2s;
|
||||
margin-left: 0;
|
||||
/* Integrated Avatar Styling */
|
||||
.chip-avatar-wrap {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
flex-shrink: 0;
|
||||
background: var(--bg-body);
|
||||
}
|
||||
|
||||
.chevron.open {
|
||||
transform: rotate(180deg);
|
||||
.chip-avatar-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
}
|
||||
|
||||
.cash-panel {
|
||||
position: absolute;
|
||||
top: calc(100% + var(--dropdown-gap));
|
||||
top: calc(100% + 8px);
|
||||
right: 0;
|
||||
width: min(260px, 78vw);
|
||||
padding: 12px 14px;
|
||||
z-index: 130;
|
||||
border: 1px solid var(--border);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-sm);
|
||||
background: #141414;
|
||||
background: var(--dropdown-bg);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
@@ -229,8 +209,9 @@ onUnmounted(() => {
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
padding: 6px 0;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.panel-row.muted {
|
||||
@@ -238,14 +219,14 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.panel-row.highlight {
|
||||
color: var(--primary-light);
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.panel-divider {
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, var(--border-gold-soft), transparent);
|
||||
background: var(--border);
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
@@ -253,18 +234,18 @@ onUnmounted(() => {
|
||||
width: 100%;
|
||||
padding: 8px 0;
|
||||
margin-top: 4px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--primary, #c8a84e);
|
||||
background: rgba(200, 168, 78, 0.12);
|
||||
color: var(--primary-light, #c8a84e);
|
||||
border-radius: var(--radius-sm);
|
||||
border: none;
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.panel-recharge-btn:active {
|
||||
background: rgba(200, 168, 78, 0.24);
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
.backdrop {
|
||||
|
||||
@@ -89,7 +89,7 @@ function onConfirm() {
|
||||
.confirm-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1100;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -101,61 +101,45 @@ function onConfirm() {
|
||||
}
|
||||
|
||||
.confirm-modal {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 374px;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent 38%),
|
||||
rgba(14, 14, 12, 0.96);
|
||||
border: 1px solid rgba(212, 175, 55, 0.34);
|
||||
border-radius: 8px;
|
||||
padding: 31px 28px 25px;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.confirm-modal::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 24px;
|
||||
right: 24px;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, rgba(232, 200, 74, 0.65), transparent);
|
||||
pointer-events: none;
|
||||
max-width: 340px;
|
||||
background: var(--dropdown-bg, #0A2540);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 12px;
|
||||
padding: 22px 18px 16px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.confirm-title {
|
||||
margin: 0 0 12px;
|
||||
font-size: 18px;
|
||||
margin: 0 0 10px;
|
||||
font-size: 17px;
|
||||
font-weight: 800;
|
||||
color: var(--gold, #c8a84e);
|
||||
color: var(--text);
|
||||
text-align: center;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.confirm-message {
|
||||
margin: 0 0 26px;
|
||||
margin: 0 0 20px;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
color: #c8c8c8;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.confirm-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
flex: 1;
|
||||
min-height: 49px;
|
||||
border-radius: 0;
|
||||
min-height: 44px;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s, filter 0.15s;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
|
||||
.confirm-btn:disabled {
|
||||
@@ -164,30 +148,20 @@ function onConfirm() {
|
||||
}
|
||||
|
||||
.confirm-btn.cancel {
|
||||
border: 0;
|
||||
background: url('../assets/images/generated/pc-betslip-btn-secondary-v1.webp') center / 100% 100% no-repeat;
|
||||
color: #9f9273;
|
||||
border: 1px solid var(--border);
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.confirm-btn.confirm {
|
||||
border: none;
|
||||
background: url('../assets/images/generated/pc-betslip-btn-primary-v1.webp') center / 100% 100% no-repeat;
|
||||
color: #1b1200;
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
}
|
||||
|
||||
.confirm-btn.cancel:not(:disabled):hover,
|
||||
.confirm-btn.confirm:not(:disabled):hover {
|
||||
filter: brightness(1.06);
|
||||
}
|
||||
|
||||
.confirm-btn.cancel:not(:disabled):active {
|
||||
background-image: url('../assets/images/generated/pc-betslip-btn-secondary-pressed-v1.webp');
|
||||
filter: brightness(0.96);
|
||||
}
|
||||
|
||||
.confirm-btn.confirm:not(:disabled):active {
|
||||
background-image: url('../assets/images/generated/pc-betslip-btn-primary-pressed-v1.webp');
|
||||
filter: brightness(0.98);
|
||||
.confirm-btn.confirm.danger {
|
||||
background: rgba(239, 68, 68, 0.85);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.confirm-fade-enter-active,
|
||||
|
||||
@@ -46,8 +46,7 @@ const iframeSrc = computed(() => {
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0 -16px;
|
||||
background: #0d0d0d;
|
||||
background: var(--bg-body);
|
||||
}
|
||||
|
||||
.cs-frame {
|
||||
@@ -55,6 +54,6 @@ const iframeSrc = computed(() => {
|
||||
width: 100%;
|
||||
min-height: calc(100dvh - 140px);
|
||||
border: 0;
|
||||
background: #fff;
|
||||
background: var(--bg-body);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -216,10 +216,10 @@ onMounted(() => {
|
||||
position: absolute;
|
||||
bottom: 64px;
|
||||
right: 0;
|
||||
background: rgba(22, 22, 22, 0.95);
|
||||
background: var(--dropdown-bg);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(212, 175, 55, 0.25);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: 8px;
|
||||
padding: 4px;
|
||||
display: flex;
|
||||
@@ -244,7 +244,7 @@ onMounted(() => {
|
||||
bottom: -6px;
|
||||
right: 22px;
|
||||
border-width: 6px 6px 0 6px;
|
||||
border-color: rgba(22, 22, 22, 0.95) transparent transparent transparent;
|
||||
border-color: var(--dropdown-bg) transparent transparent transparent;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ onMounted(() => {
|
||||
bottom: -7px;
|
||||
right: 21px;
|
||||
border-width: 7px 7px 0 7px;
|
||||
border-color: rgba(212, 175, 55, 0.25) transparent transparent transparent;
|
||||
border-color: var(--border-gold-soft) transparent transparent transparent;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -274,8 +274,8 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.menu-item:hover {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
color: var(--text);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.menu-icon {
|
||||
@@ -317,61 +317,47 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.fab-btn {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 50%;
|
||||
background: url('../assets/images/generated/floating-mailbox-fab-v1.webp') center / cover no-repeat;
|
||||
color: var(--primary-light);
|
||||
border: 0;
|
||||
box-shadow:
|
||||
0 8px 22px rgba(0, 0, 0, 0.42),
|
||||
0 0 16px rgba(212, 175, 55, 0.12);
|
||||
background: var(--primary);
|
||||
color: #fff;
|
||||
border: none;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s, box-shadow 0.2s, color 0.2s, filter 0.2s;
|
||||
transition: transform 0.2s, background 0.2s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fab-btn:hover {
|
||||
transform: translateY(-1px);
|
||||
color: #fff1a8;
|
||||
filter: brightness(1.08);
|
||||
box-shadow:
|
||||
0 10px 26px rgba(0, 0, 0, 0.5),
|
||||
0 0 20px rgba(212, 175, 55, 0.18);
|
||||
transform: scale(1.05);
|
||||
background: var(--primary-light);
|
||||
}
|
||||
|
||||
.fab-active {
|
||||
transform: scale(0.96);
|
||||
color: #fff1a8;
|
||||
filter: brightness(0.94);
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
.fab-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background: var(--danger, #ff4d4f);
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
min-width: 18px;
|
||||
height: 18px;
|
||||
padding: 0 5px;
|
||||
padding: 2px 6px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.9);
|
||||
border: 2px solid var(--bg-card);
|
||||
line-height: 1;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2px 8px rgba(255, 69, 58, 0.42);
|
||||
}
|
||||
|
||||
.popup-panel {
|
||||
@@ -381,8 +367,8 @@ onMounted(() => {
|
||||
width: 380px;
|
||||
height: 600px;
|
||||
max-height: calc(100vh - 120px);
|
||||
background: var(--bg-card, #141414);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--dropdown-bg);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
||||
display: flex;
|
||||
@@ -413,7 +399,7 @@ onMounted(() => {
|
||||
|
||||
.popup-title .tab-badge {
|
||||
background: var(--primary);
|
||||
color: #141414;
|
||||
color: var(--on-primary);
|
||||
font-size: 11px;
|
||||
padding: 2px 6px;
|
||||
border-radius: 10px;
|
||||
@@ -456,7 +442,7 @@ onMounted(() => {
|
||||
.popup-body {
|
||||
height: calc(100% - 48px);
|
||||
position: relative;
|
||||
background: #0f0f0f;
|
||||
background: var(--bg-body);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,102 +1,114 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
size?: number;
|
||||
|
||||
progress?: number;
|
||||
|
||||
active?: boolean;
|
||||
|
||||
}>();
|
||||
|
||||
|
||||
|
||||
const rotation = computed(() => (props.progress ?? 0) * 360);
|
||||
|
||||
const wrapperStyle = computed(() => {
|
||||
|
||||
if (props.active) return {};
|
||||
|
||||
return {
|
||||
|
||||
transform: `rotate(${rotation.value}deg)`,
|
||||
|
||||
transition: 'transform 0.05s linear',
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
|
||||
<svg
|
||||
|
||||
:class="['gold-spinner', { 'is-active': active }]"
|
||||
|
||||
:width="size ?? 48"
|
||||
|
||||
:height="size ?? 48"
|
||||
|
||||
viewBox="0 0 48 48"
|
||||
|
||||
fill="none"
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
:style="!active ? wrapperStyle : undefined"
|
||||
|
||||
>
|
||||
<defs>
|
||||
<linearGradient id="gs-track" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#D4AF37" stop-opacity="0.18" />
|
||||
<stop offset="50%" stop-color="#F0D875" stop-opacity="0.25" />
|
||||
<stop offset="100%" stop-color="#D4AF37" stop-opacity="0.18" />
|
||||
</linearGradient>
|
||||
<linearGradient id="gs-arc" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#FFF4C8" />
|
||||
<stop offset="22%" stop-color="#F0D875" />
|
||||
<stop offset="50%" stop-color="#D4AF37" />
|
||||
<stop offset="78%" stop-color="#B8942B" />
|
||||
<stop offset="100%" stop-color="#8B6914" />
|
||||
</linearGradient>
|
||||
<filter id="gs-glow">
|
||||
<feGaussianBlur stdDeviation="1.2" result="blur" />
|
||||
<feMerge>
|
||||
<feMergeNode in="blur" />
|
||||
<feMergeNode in="SourceGraphic" />
|
||||
</feMerge>
|
||||
</filter>
|
||||
<radialGradient id="gs-dot" cx="50%" cy="50%" r="50%">
|
||||
<stop offset="0%" stop-color="#FFF4C8" />
|
||||
<stop offset="60%" stop-color="#F0D875" />
|
||||
<stop offset="100%" stop-color="#D4AF37" />
|
||||
</radialGradient>
|
||||
</defs>
|
||||
<circle cx="24" cy="24" r="20" stroke="url(#gs-track)" stroke-width="3" fill="none" />
|
||||
|
||||
<circle cx="24" cy="24" r="20" stroke="rgba(255,255,255,0.14)" stroke-width="3" fill="none" />
|
||||
|
||||
<circle
|
||||
|
||||
cx="24"
|
||||
|
||||
cy="24"
|
||||
|
||||
r="20"
|
||||
stroke="url(#gs-arc)"
|
||||
|
||||
stroke="rgba(255,255,255,0.72)"
|
||||
|
||||
stroke-width="3"
|
||||
|
||||
fill="none"
|
||||
|
||||
stroke-linecap="round"
|
||||
|
||||
stroke-dasharray="31.4 94.2"
|
||||
filter="url(#gs-glow)"
|
||||
|
||||
/>
|
||||
<circle cx="24" cy="4" r="2.5" fill="url(#gs-dot)" filter="url(#gs-glow)">
|
||||
<animate
|
||||
v-if="active"
|
||||
attributeName="r"
|
||||
values="2.5;3.2;2.5"
|
||||
dur="1.2s"
|
||||
repeatCount="indefinite"
|
||||
/>
|
||||
</circle>
|
||||
<circle v-if="active" cx="36" cy="13.5" r="1.8" fill="#F0D875" opacity="0.6">
|
||||
<animate attributeName="opacity" values="0.6;0.15;0.6" dur="0.9s" repeatCount="indefinite" begin="0.15s" />
|
||||
</circle>
|
||||
<circle v-if="active" cx="34" cy="34" r="1.5" fill="#D4AF37" opacity="0.4">
|
||||
<animate attributeName="opacity" values="0.4;0.1;0.4" dur="1.1s" repeatCount="indefinite" begin="0.35s" />
|
||||
</circle>
|
||||
<circle v-if="active" cx="14" cy="34" r="1.5" fill="#D4AF37" opacity="0.4">
|
||||
<animate attributeName="opacity" values="0.4;0.1;0.4" dur="1s" repeatCount="indefinite" begin="0.55s" />
|
||||
</circle>
|
||||
|
||||
</svg>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
.gold-spinner {
|
||||
|
||||
display: block;
|
||||
|
||||
will-change: transform;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.gold-spinner.is-active {
|
||||
|
||||
animation: gs-spin 0.8s linear infinite;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@keyframes gs-spin {
|
||||
|
||||
to { transform: rotate(360deg); }
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ watch(totalPages, () => {
|
||||
justify-content: space-between;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: rgba(201, 162, 39, 0.05);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.header-title {
|
||||
@@ -158,8 +158,8 @@ watch(totalPages, () => {
|
||||
height: 24px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border);
|
||||
background: #1a1a1a;
|
||||
color: var(--gold);
|
||||
background: var(--bg-hover);
|
||||
color: var(--primary-light);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -228,7 +228,7 @@ watch(totalPages, () => {
|
||||
}
|
||||
|
||||
.chevron {
|
||||
color: var(--gold);
|
||||
color: var(--primary-light);
|
||||
font-size: 18px;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import MatchBetCard from './MatchBetCard.vue';
|
||||
import saishiImg from '../assets/images/generated/saishi-gold-trophy-v1.webp';
|
||||
import cardBg from '../assets/images/generated/pc-match-list-card-bg-v1.webp';
|
||||
import saishiImg from '../assets/images/saishi.webp';
|
||||
import cardBg from '../assets/images/card-bg.webp';
|
||||
|
||||
const matchCardBg = `url(${cardBg})`;
|
||||
|
||||
@@ -49,7 +49,7 @@ const openCount = computed(() => props.matches.filter(m => m.matchPhase === 'ope
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="league-block">
|
||||
<section class="league-block" :class="{ expanded }">
|
||||
<button type="button" class="league-row" :aria-expanded="expanded" @click="emit('toggle')">
|
||||
<span class="toggle-icon" :class="{ open: expanded }" aria-hidden="true">
|
||||
<span class="toggle-mark">{{ expanded ? '−' : '+' }}</span>
|
||||
@@ -89,12 +89,25 @@ const openCount = computed(() => props.matches.filter(m => m.matchPhase === 'ope
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
margin-bottom: 12px;
|
||||
border: 1px solid var(--border);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: var(--radius);
|
||||
background: var(--bg-card);
|
||||
background: var(--gradient-card);
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.league-block::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 8%;
|
||||
right: 8%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.league-row {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
@@ -103,7 +116,7 @@ const openCount = computed(() => props.matches.filter(m => m.matchPhase === 'ope
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 12px 16px;
|
||||
background: none;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
text-align: left;
|
||||
@@ -129,17 +142,17 @@ const openCount = computed(() => props.matches.filter(m => m.matchPhase === 'ope
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 50%;
|
||||
background: #141414;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.toggle-mark {
|
||||
color: var(--primary-light);
|
||||
font-size: 17px;
|
||||
font-weight: 900;
|
||||
color: var(--text-muted);
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
margin-top: -1px;
|
||||
}
|
||||
@@ -154,8 +167,8 @@ const openCount = computed(() => props.matches.filter(m => m.matchPhase === 'ope
|
||||
|
||||
.league-title {
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
line-height: 1.35;
|
||||
min-width: 0;
|
||||
}
|
||||
@@ -165,16 +178,16 @@ const openCount = computed(() => props.matches.filter(m => m.matchPhase === 'ope
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 11px;
|
||||
color: #ccc;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.stat-live {
|
||||
color: #3db865;
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.stat-open {
|
||||
color: #c8a84e;
|
||||
color: #6ee78a;
|
||||
}
|
||||
|
||||
.league-saishi {
|
||||
@@ -185,17 +198,18 @@ const openCount = computed(() => props.matches.filter(m => m.matchPhase === 'ope
|
||||
object-fit: contain;
|
||||
margin-left: 4px;
|
||||
padding-left: 10px;
|
||||
border-left: 1px solid #2a2a2a;
|
||||
border-left: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.match-panel {
|
||||
padding: 10px 0 4px;
|
||||
background: linear-gradient(180deg, rgba(0, 20, 40, 0.35) 0%, rgba(0, 26, 51, 0.2) 100%);
|
||||
padding: 12px 8px 8px;
|
||||
}
|
||||
|
||||
.match-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
gap: 10px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,6 +27,6 @@ const src = computed(() => `/flags/${countryCode.value}.svg`);
|
||||
flex-shrink: 0;
|
||||
border-radius: 2px;
|
||||
object-fit: cover;
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
|
||||
box-shadow: 0 0 0 1px var(--border);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,6 @@ import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import LocaleFlag from './LocaleFlag.vue';
|
||||
import { useAppLocale } from '../composables/useAppLocale';
|
||||
import { useHoverDropdown } from '../composables/useHoverDropdown';
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
@@ -15,7 +14,7 @@ withDefaults(
|
||||
const { locale } = useI18n();
|
||||
const { locales, setLocale } = useAppLocale();
|
||||
|
||||
const { open, openHover, scheduleClose, closeNow } = useHoverDropdown();
|
||||
const open = ref(false);
|
||||
const root = ref<HTMLElement | null>(null);
|
||||
|
||||
const currentLabel = computed(
|
||||
@@ -23,7 +22,7 @@ const currentLabel = computed(
|
||||
);
|
||||
|
||||
async function pick(code: string) {
|
||||
closeNow();
|
||||
open.value = false;
|
||||
await setLocale(code);
|
||||
}
|
||||
|
||||
@@ -32,7 +31,7 @@ function toggle() {
|
||||
}
|
||||
|
||||
function onOutsideClick(e: Event) {
|
||||
if (!root.value?.contains(e.target as Node)) closeNow();
|
||||
if (!root.value?.contains(e.target as Node)) open.value = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -46,13 +45,7 @@ onUnmounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
ref="root"
|
||||
class="locale-switch"
|
||||
:class="{ compact, open }"
|
||||
@mouseenter="openHover"
|
||||
@mouseleave="scheduleClose"
|
||||
>
|
||||
<div ref="root" class="locale-switch" :class="{ compact, open }">
|
||||
<button type="button" class="locale-trigger" :aria-expanded="open" aria-haspopup="listbox" @click.stop="toggle">
|
||||
<LocaleFlag :locale="locale" :size="compact ? 16 : 18" />
|
||||
</button> <ul v-show="open" class="locale-menu" role="listbox" :aria-label="compact ? 'Language' : undefined">
|
||||
@@ -75,19 +68,8 @@ onUnmounted(() => {
|
||||
<style scoped>
|
||||
.locale-switch {
|
||||
position: relative;
|
||||
z-index: 120;
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
--dropdown-gap: 4px;
|
||||
}
|
||||
|
||||
.locale-switch::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: var(--dropdown-gap);
|
||||
}
|
||||
|
||||
.locale-trigger {
|
||||
@@ -99,7 +81,7 @@ onUnmounted(() => {
|
||||
padding: 0;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #0d0d0d;
|
||||
background: var(--bg-body);
|
||||
color: var(--primary-light);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
@@ -116,15 +98,17 @@ onUnmounted(() => {
|
||||
|
||||
.locale-menu {
|
||||
position: absolute;
|
||||
top: calc(100% + var(--dropdown-gap));
|
||||
top: calc(100% + 4px);
|
||||
right: 0;
|
||||
z-index: 130;
|
||||
z-index: 50;
|
||||
min-width: 100%;
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
list-style: none;
|
||||
background: #141414;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: var(--dropdown-bg);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 8px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
@@ -144,7 +128,7 @@ onUnmounted(() => {
|
||||
|
||||
.locale-option:hover,
|
||||
.locale-option.active {
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
@@ -28,7 +28,8 @@ function continueBrowsing() {
|
||||
<div v-if="auth.loginPromptVisible" class="login-overlay" @click.self="continueBrowsing">
|
||||
<div class="login-modal">
|
||||
<button type="button" class="close-btn" :aria-label="t('auth.continue_browsing')" @click="continueBrowsing">
|
||||
×</button>
|
||||
✕
|
||||
</button>
|
||||
<h2 class="login-title">{{ t('auth.login_required') }}</h2>
|
||||
<p class="login-hint">{{ t('auth.login_hint') }}</p>
|
||||
|
||||
@@ -63,13 +64,10 @@ function continueBrowsing() {
|
||||
position: relative;
|
||||
width: 90%;
|
||||
max-width: 360px;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent 36%),
|
||||
rgba(14, 14, 12, 0.96);
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
border-radius: 10px;
|
||||
padding: 36px 30px 30px;
|
||||
box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: var(--radius);
|
||||
padding: 28px 24px 24px;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
@@ -78,7 +76,7 @@ function continueBrowsing() {
|
||||
right: 14px;
|
||||
background: none;
|
||||
border: none;
|
||||
color: #666;
|
||||
color: var(--text-muted);
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
padding: 4px;
|
||||
@@ -86,20 +84,20 @@ function continueBrowsing() {
|
||||
}
|
||||
|
||||
.close-btn:hover {
|
||||
color: #aaa;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.login-title {
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light, #c8a84e);
|
||||
color: var(--primary-light);
|
||||
margin: 0 0 6px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.login-hint {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
margin: 0 0 24px;
|
||||
}
|
||||
@@ -112,15 +110,16 @@ function continueBrowsing() {
|
||||
|
||||
.login-submit {
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
border-radius: var(--radius-sm);
|
||||
border: none;
|
||||
background: linear-gradient(135deg, #d4a017, #e8c84a);
|
||||
color: #1a1a1a;
|
||||
background: var(--gradient-accent);
|
||||
color: var(--text);
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
cursor: pointer;
|
||||
min-height: 44px;
|
||||
transition: opacity 0.2s;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.login-submit:active {
|
||||
@@ -129,10 +128,10 @@ function continueBrowsing() {
|
||||
|
||||
.login-secondary {
|
||||
padding: 10px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #333;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border);
|
||||
background: transparent;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
@@ -141,8 +140,8 @@ function continueBrowsing() {
|
||||
}
|
||||
|
||||
.login-secondary:active {
|
||||
color: #aaa;
|
||||
border-color: #444;
|
||||
color: var(--text);
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.fade-enter-active,
|
||||
|
||||
@@ -9,10 +9,6 @@ import { useBetSlipStore } from '../stores/betSlip';
|
||||
import { useDesktopBetPopover } from '../composables/useDesktopBetPopover';
|
||||
import { resolveSelectionLabel } from '../utils/selectionLabel';
|
||||
import MarketSelectionsPanel from './match-detail/MarketSelectionsPanel.vue';
|
||||
import vsImg from '../assets/images/generated/vs-gold-alpha-v1.webp';
|
||||
import matchListCardBg from '../assets/images/generated/pc-match-list-card-bg-v1.webp';
|
||||
|
||||
const matchCardBg = `url(${matchListCardBg})`;
|
||||
|
||||
const props = defineProps<{
|
||||
match: {
|
||||
@@ -96,7 +92,6 @@ function getHoveredSide() {
|
||||
if (String(pendingItem.value.matchId) !== String(props.match.id)) return '';
|
||||
|
||||
const selId = pendingItem.value.selectionId;
|
||||
// Scan all markets to find the selection and get its code
|
||||
for (const market of props.match.markets ?? []) {
|
||||
const sel = market.selections?.find((s: any) => s.id === selId);
|
||||
if (!sel) continue;
|
||||
@@ -104,12 +99,9 @@ function getHoveredSide() {
|
||||
if (code === 'HOME') return 'home';
|
||||
if (code === 'AWAY') return 'away';
|
||||
if (code === 'DRAW') return 'draw';
|
||||
// Over/Under: over = home side, under = away side (for visual cue)
|
||||
if (code === 'OVER') return 'home';
|
||||
if (code === 'UNDER') return 'away';
|
||||
// Odd/Even: highlight both
|
||||
if (code === 'ODD' || code === 'EVEN') return 'draw';
|
||||
// Fallback: use selection index
|
||||
const selIndex = market.selections?.findIndex((s: any) => s.id === selId) ?? -1;
|
||||
if (selIndex === -1) continue;
|
||||
if (market.marketType === 'FT_1X2') {
|
||||
@@ -214,7 +206,6 @@ function goMatchDetail() {
|
||||
>
|
||||
<span v-if="phase === 'open'" class="status-tag status-tag--open">{{ t('bet.status_open') }}</span>
|
||||
<span v-else-if="phase === 'settled'" class="status-tag status-tag--settled">{{ phaseLabel }}</span>
|
||||
<span v-else class="status-tag status-tag--pending">{{ phaseLabel }}</span>
|
||||
|
||||
<div class="teams-row" :class="getHoveredSide()">
|
||||
<div class="team">
|
||||
@@ -233,9 +224,7 @@ function goMatchDetail() {
|
||||
<div class="center-col">
|
||||
<span class="kickoff">{{ kickoffText }}</span>
|
||||
<span v-if="phase !== 'open' && liveScoreText" class="live-score">{{ liveScoreText }}</span>
|
||||
<span v-else class="vs">
|
||||
<img :src="vsImg" alt="VS" class="vs-img" />
|
||||
</span>
|
||||
<span v-else class="vs">VS</span>
|
||||
</div>
|
||||
|
||||
<div class="team">
|
||||
@@ -300,31 +289,40 @@ function goMatchDetail() {
|
||||
<style scoped>
|
||||
.match-card {
|
||||
position: relative;
|
||||
background: v-bind(matchCardBg) center / 100% 100% no-repeat;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
padding: 10px 8px 10px;
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 12px 10px 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
min-height: 130px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
}
|
||||
|
||||
.match-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2));
|
||||
top: 0;
|
||||
left: 12%;
|
||||
right: 12%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.match-card--phase {
|
||||
/* inherits base dark style */
|
||||
background: linear-gradient(
|
||||
165deg,
|
||||
rgba(255, 255, 255, 0.07) 0%,
|
||||
rgba(255, 255, 255, 0.03) 30%,
|
||||
rgba(0, 20, 40, 0.55) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.teams-row {
|
||||
@@ -353,20 +351,20 @@ function goMatchDetail() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 17px;
|
||||
font-weight: 900;
|
||||
color: #fff;
|
||||
line-height: 1.2;
|
||||
text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
line-height: 1.3;
|
||||
word-break: break-word;
|
||||
text-align: center;
|
||||
padding: 0 6px;
|
||||
align-self: stretch;
|
||||
letter-spacing: -0.02em;
|
||||
transition: font-size 0.25s ease;
|
||||
}
|
||||
|
||||
.match-card--phase .team-name {
|
||||
color: #d8d8d8;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.team-flag {
|
||||
@@ -391,48 +389,38 @@ function goMatchDetail() {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
gap: 5px;
|
||||
min-width: 56px;
|
||||
}
|
||||
|
||||
.kickoff {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
line-height: 1.15;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.2;
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
max-width: 96px;
|
||||
overflow-wrap: anywhere;
|
||||
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
|
||||
transition: opacity 0.2s ease, height 0.2s ease, margin 0.2s ease;
|
||||
}
|
||||
|
||||
.live-score {
|
||||
font-size: 20px;
|
||||
font-weight: 900;
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
line-height: 1;
|
||||
letter-spacing: 0.04em;
|
||||
letter-spacing: 0.02em;
|
||||
transition: font-size 0.25s ease;
|
||||
}
|
||||
|
||||
.vs {
|
||||
width: 48px;
|
||||
height: 28px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22px;
|
||||
font-weight: 900;
|
||||
color: var(--text);
|
||||
letter-spacing: 0.08em;
|
||||
line-height: 1;
|
||||
transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
|
||||
}
|
||||
|
||||
.vs-img {
|
||||
width: 46px;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.9));
|
||||
transition: font-size 0.25s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
@@ -441,7 +429,7 @@ function goMatchDetail() {
|
||||
right: 0;
|
||||
z-index: 3;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
font-weight: 700;
|
||||
padding: 3px 10px;
|
||||
border-radius: 0 6px 0 8px;
|
||||
line-height: 1.3;
|
||||
@@ -450,23 +438,16 @@ function goMatchDetail() {
|
||||
}
|
||||
|
||||
.status-tag--open {
|
||||
background: linear-gradient(135deg, #e8c84a, #d4a017);
|
||||
color: #1a1a1a;
|
||||
box-shadow: 0 2px 6px rgba(212, 160, 23, 0.4);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
color: var(--primary-light);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.status-tag--settled {
|
||||
background: linear-gradient(180deg, #2a2a3a 0%, #1a1a28 100%);
|
||||
color: #8a9ab8;
|
||||
border-bottom: 1px solid rgba(120, 140, 180, 0.3);
|
||||
border-left: 1px solid rgba(120, 140, 180, 0.3);
|
||||
}
|
||||
|
||||
.status-tag--pending {
|
||||
background: linear-gradient(180deg, #3a3a2a 0%, #28251a 100%);
|
||||
color: #c8a84e;
|
||||
border-bottom: 1px solid rgba(200, 168, 78, 0.3);
|
||||
border-left: 1px solid rgba(200, 168, 78, 0.3);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: var(--text-muted);
|
||||
border-bottom: 1px solid var(--border);
|
||||
border-left: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.bet-btn {
|
||||
@@ -484,9 +465,9 @@ function goMatchDetail() {
|
||||
}
|
||||
|
||||
.bet-btn--view {
|
||||
background: #1a1a1a;
|
||||
border: 1px solid #444;
|
||||
color: #aaa;
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* --- Morphing Quick Bet panel --- */
|
||||
@@ -508,22 +489,19 @@ function goMatchDetail() {
|
||||
@media (hover: hover) {
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) {
|
||||
border-color: var(--border-gold);
|
||||
box-shadow: var(--shadow-gold);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
/* 整行保持原位,间距自然 */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .teams-row {
|
||||
transform: translateY(0);
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
/* .team 取消自身 translateY */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .team {
|
||||
transform: translateY(0);
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
/* 旗帜缩小到 40×28 */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .team-flag {
|
||||
width: 40px;
|
||||
height: 28px;
|
||||
@@ -534,7 +512,6 @@ function goMatchDetail() {
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
/* 队名缩小并禁止换行 */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .team-name {
|
||||
font-size: 10px;
|
||||
white-space: nowrap;
|
||||
@@ -543,7 +520,6 @@ function goMatchDetail() {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* 隐藏开赛时间 */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .kickoff {
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
@@ -552,29 +528,25 @@ function goMatchDetail() {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* VS / 比分 */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .vs,
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .live-score {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* 下注按钮淡出(保留布局空间避免高度抖动) */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .bet-btn {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* 快速下注面板淡入 */
|
||||
.match-card:not(.no-quick-bet):is(:hover, .match-card--engaged) .card-quick-bet {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
/* sidebar 模式:hover 仍有金边,但不做复杂动画 */
|
||||
.match-card.no-quick-bet:hover {
|
||||
border-color: var(--border-gold);
|
||||
box-shadow: var(--shadow-gold);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -618,7 +590,7 @@ function goMatchDetail() {
|
||||
}
|
||||
|
||||
.quick-bet-all-link:hover {
|
||||
text-shadow: 0 0 4px rgba(212, 175, 55, 0.6);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.quick-bet-odds {
|
||||
@@ -647,7 +619,7 @@ function goMatchDetail() {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* --- VS Selection Highlight: scale selected team, no VS animation --- */
|
||||
/* --- VS Selection Highlight: scale selected team --- */
|
||||
.teams-row .team {
|
||||
transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, filter 0.3s ease;
|
||||
}
|
||||
|
||||
@@ -6,16 +6,12 @@ import { formatLocalMatchDateTime } from '@thebet365/shared';
|
||||
import GoldSpinner from './GoldSpinner.vue';
|
||||
import ConfirmDialog from './ConfirmDialog.vue';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { usePlayerMessages, type DepositMessagePayload, type PlayerMessage } from '../composables/usePlayerMessages';
|
||||
import { stripHtml } from '../utils/html';
|
||||
import emptyInboxImg from '../assets/images/generated/empty-inbox-envelope-v1.webp';
|
||||
import { usePlayerMessages, type DepositMessagePayload, type PlayerMessage } from '../composables/usePlayerMessages';
|
||||
|
||||
const router = useRouter();
|
||||
const { t, locale } = useI18n();
|
||||
const auth = useAuthStore();
|
||||
const emit = defineEmits<{
|
||||
(e: 'click-message', id: string): void;
|
||||
}>();
|
||||
const {
|
||||
messages,
|
||||
loading,
|
||||
@@ -54,7 +50,7 @@ function messagePreview(item: PlayerMessage) {
|
||||
}
|
||||
|
||||
function openDetail(id: string) {
|
||||
emit('click-message', id);
|
||||
router.push(`/messages/${id}`);
|
||||
}
|
||||
|
||||
async function fetchPage(nextPage: number, append = false) {
|
||||
@@ -117,7 +113,6 @@ onActivated(tryLoad);
|
||||
</div>
|
||||
|
||||
<div v-else-if="!messages.length" class="empty">
|
||||
<img :src="emptyInboxImg" alt="" class="empty-img" />
|
||||
<p>{{ t('messages.empty') }}</p>
|
||||
</div>
|
||||
|
||||
@@ -129,7 +124,6 @@ onActivated(tryLoad);
|
||||
:class="{ unread: !item.isRead }"
|
||||
>
|
||||
<button type="button" class="row-body" @click="openDetail(item.id)">
|
||||
<span class="row-dot" aria-hidden="true" />
|
||||
<span class="row-main">
|
||||
<span class="title-row">
|
||||
<span class="title">{{ messageTitle(item) }}</span>
|
||||
@@ -183,6 +177,8 @@ onActivated(tryLoad);
|
||||
|
||||
<style scoped>
|
||||
.message-list-panel {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.guest-hint,
|
||||
@@ -196,23 +192,12 @@ onActivated(tryLoad);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.empty-img {
|
||||
width: min(320px, 86vw);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
opacity: 0.9;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
}
|
||||
|
||||
.login-link {
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
padding: 8px 14px;
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
color: var(--gold);
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -247,19 +232,6 @@ onActivated(tryLoad);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.row-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: transparent;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.list-row.unread .row-dot {
|
||||
background: var(--gold);
|
||||
box-shadow: 0 0 8px rgba(212, 175, 55, 0.45);
|
||||
}
|
||||
|
||||
.row-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@@ -279,7 +251,7 @@ onActivated(tryLoad);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 15px;
|
||||
color: #d8d8d8;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.35;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -292,13 +264,13 @@ onActivated(tryLoad);
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.status-badge.unread {
|
||||
color: var(--gold);
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
color: var(--text);
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.preview {
|
||||
@@ -311,7 +283,7 @@ onActivated(tryLoad);
|
||||
|
||||
.date {
|
||||
font-size: 12px;
|
||||
color: #777;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.chevron {
|
||||
@@ -329,13 +301,13 @@ onActivated(tryLoad);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: #666;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.delete-btn:active:not(:disabled) {
|
||||
background: rgba(255, 80, 80, 0.12);
|
||||
color: #f66;
|
||||
background: rgba(239, 68, 68, 0.12);
|
||||
color: rgba(239, 68, 68, 0.95);
|
||||
}
|
||||
|
||||
.delete-btn svg {
|
||||
@@ -354,8 +326,8 @@ onActivated(tryLoad);
|
||||
padding: 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: #141414;
|
||||
color: var(--gold);
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -203,7 +203,7 @@ function frame() {
|
||||
const n = grid[row][col + 1];
|
||||
if (n.o > 0.008) {
|
||||
const lo = Math.min(p.o, n.o) * 0.55;
|
||||
ctx.strokeStyle = `rgba(212,175,55,${lo})`;
|
||||
ctx.strokeStyle = `rgba(255,255,255,${lo})`;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(p.x, p.y);
|
||||
ctx.lineTo(n.x, n.y);
|
||||
@@ -216,7 +216,7 @@ function frame() {
|
||||
const n = grid[row + 1][col];
|
||||
if (n.o > 0.008) {
|
||||
const lo = Math.min(p.o, n.o) * 0.55;
|
||||
ctx.strokeStyle = `rgba(212,175,55,${lo})`;
|
||||
ctx.strokeStyle = `rgba(255,255,255,${lo})`;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(p.x, p.y);
|
||||
ctx.lineTo(n.x, n.y);
|
||||
@@ -231,7 +231,7 @@ function frame() {
|
||||
for (let col = 0; col < cols; col++) {
|
||||
const p = grid[row][col];
|
||||
if (p.o < 0.008) continue;
|
||||
ctx.fillStyle = `rgba(240,216,117,${p.o})`;
|
||||
ctx.fillStyle = `rgba(255,255,255,${p.o})`;
|
||||
ctx.beginPath();
|
||||
ctx.arc(p.x, p.y, 1.3, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
|
||||
@@ -131,7 +131,7 @@ onUnmounted(() => {
|
||||
padding: 0 8px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #0d0d0d;
|
||||
background: var(--bg-body);
|
||||
color: var(--text);
|
||||
font-family: inherit;
|
||||
font-size: 12px;
|
||||
@@ -166,8 +166,10 @@ onUnmounted(() => {
|
||||
z-index: 60;
|
||||
width: min(260px, calc(100vw - 48px));
|
||||
padding: 4px;
|
||||
background: #141414;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--dropdown-bg);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 6px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
@@ -178,19 +180,19 @@ onUnmounted(() => {
|
||||
padding: 6px 8px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
background: #0d0d0d;
|
||||
background: var(--bg-body);
|
||||
color: var(--text);
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.country-search::placeholder {
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
color: var(--neutral);
|
||||
}
|
||||
|
||||
.country-search:focus {
|
||||
outline: none;
|
||||
border-color: #555;
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.country-menu {
|
||||
@@ -213,7 +215,7 @@ onUnmounted(() => {
|
||||
|
||||
.country-option:hover,
|
||||
.country-option.active {
|
||||
background: var(--bg-hover);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.country-option .country-iso {
|
||||
|
||||
@@ -36,12 +36,12 @@ function confirm() {
|
||||
<Teleport to="body">
|
||||
<div v-if="open" class="overlay" @click.self="close">
|
||||
<div class="modal" role="dialog" aria-modal="true" :aria-label="t('profile.avatar')">
|
||||
<button type="button" class="close-x" :aria-label="t('bet.cancel')" @click="close">✕</button>
|
||||
<button type="button" class="close-x" :aria-label="t('bet.cancel')" @click="close">✕</button>
|
||||
<h3 class="title">{{ t('profile.avatar') }}</h3>
|
||||
<PlayerAvatarPicker v-model="draft" />
|
||||
<div class="actions">
|
||||
<button type="button" class="btn-cancel" @click="close">{{ t('bet.cancel') }}</button>
|
||||
<button type="button" class="btn-confirm" @click="confirm">
|
||||
<button type="button" class="btn-confirm btn-gold-outline" @click="confirm">
|
||||
{{ t('profile.avatar_confirm') }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -69,34 +69,28 @@ function confirm() {
|
||||
max-width: 360px;
|
||||
max-height: 85vh;
|
||||
overflow-y: auto;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent 36%),
|
||||
rgba(14, 14, 12, 0.96);
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
border-radius: 10px;
|
||||
padding: 26px 24px 22px;
|
||||
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58);
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px 14px 14px;
|
||||
box-shadow: var(--shadow), var(--glow-gold);
|
||||
}
|
||||
|
||||
.close-x {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../assets/images/generated/modal-close-gold-v1.webp') center / contain no-repeat;
|
||||
color: transparent;
|
||||
font-size: 0;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-body);
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.close-x:active {
|
||||
background-image: url('../assets/images/generated/modal-close-gold-pressed-v1.webp');
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0 28px 12px 0;
|
||||
font-size: 15px;
|
||||
@@ -114,31 +108,18 @@ function confirm() {
|
||||
.btn-confirm {
|
||||
flex: 1;
|
||||
min-height: 40px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
background-color: transparent;
|
||||
background-position: center;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
background-image: url('../assets/images/generated/pc-betslip-btn-secondary-v1.webp');
|
||||
color: #f3e7c5;
|
||||
}
|
||||
|
||||
.btn-cancel:active {
|
||||
background-image: url('../assets/images/generated/pc-betslip-btn-secondary-pressed-v1.webp');
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-body);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
background-image: url('../assets/images/generated/pc-betslip-btn-primary-v1.webp');
|
||||
color: #1d1300;
|
||||
}
|
||||
|
||||
.btn-confirm:active {
|
||||
background-image: url('../assets/images/generated/pc-betslip-btn-primary-pressed-v1.webp');
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -88,7 +88,7 @@ function select(key: string) {
|
||||
padding: 8px 10px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border);
|
||||
background: #0a0a0a;
|
||||
background: var(--bg-body);
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
}
|
||||
@@ -115,15 +115,15 @@ function select(key: string) {
|
||||
padding: 8px 4px 6px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border);
|
||||
background: #0a0a0a;
|
||||
background: var(--bg-body);
|
||||
cursor: pointer;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.picker-item.active {
|
||||
border-color: var(--border-gold-soft);
|
||||
box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.18);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
|
||||
background: var(--surface-accent);
|
||||
}
|
||||
|
||||
.picker-photo {
|
||||
|
||||
@@ -15,6 +15,23 @@ const CHARS = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
|
||||
const CANVAS_W = 96;
|
||||
const CANVAS_H = 36;
|
||||
|
||||
function cssVar(name: string, fallback: string): string {
|
||||
const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
||||
return value || fallback;
|
||||
}
|
||||
|
||||
function withAlpha(color: string, alpha: number): string {
|
||||
const c = color.trim();
|
||||
const rgb = c.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/);
|
||||
if (rgb) return `rgba(${rgb[1]}, ${rgb[2]}, ${rgb[3]}, ${alpha})`;
|
||||
const hex = c.match(/^#([0-9a-f]{6})$/i);
|
||||
if (hex) {
|
||||
const n = parseInt(hex[1], 16);
|
||||
return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
function generateCode() {
|
||||
let result = '';
|
||||
for (let i = 0; i < 4; i++) {
|
||||
@@ -31,18 +48,22 @@ function drawCaptcha() {
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx) return;
|
||||
|
||||
ctx.fillStyle = '#0d0d0d';
|
||||
const bg = cssVar('--captcha-canvas-bg', '#0d0d0d');
|
||||
const charBase = cssVar('--captcha-char', '#f0d875');
|
||||
const noiseRgb = cssVar('--captcha-noise-rgb', '255, 255, 255');
|
||||
|
||||
ctx.fillStyle = bg;
|
||||
ctx.fillRect(0, 0, CANVAS_W, CANVAS_H);
|
||||
|
||||
for (let i = 0; i < 20; i++) {
|
||||
ctx.fillStyle = `rgba(255, 255, 255, ${0.03 + Math.random() * 0.06})`;
|
||||
ctx.fillStyle = `rgba(${noiseRgb}, ${0.03 + Math.random() * 0.06})`;
|
||||
ctx.beginPath();
|
||||
ctx.arc(Math.random() * CANVAS_W, Math.random() * CANVAS_H, Math.random() * 1.8, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
}
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
ctx.strokeStyle = `rgba(255, 255, 255, ${0.06 + Math.random() * 0.08})`;
|
||||
ctx.strokeStyle = `rgba(${noiseRgb}, ${0.06 + Math.random() * 0.08})`;
|
||||
ctx.lineWidth = 1;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(Math.random() * CANVAS_W, Math.random() * CANVAS_H);
|
||||
@@ -58,7 +79,7 @@ function drawCaptcha() {
|
||||
ctx.translate(x, y);
|
||||
ctx.rotate((Math.random() - 0.5) * 0.35);
|
||||
ctx.font = `bold ${15 + Math.random() * 4}px 'Courier New', monospace`;
|
||||
ctx.fillStyle = `rgba(240, 216, 117, ${0.85 + Math.random() * 0.15})`;
|
||||
ctx.fillStyle = withAlpha(charBase, 0.85 + Math.random() * 0.15);
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(code.value[i], 0, 0);
|
||||
@@ -141,12 +162,12 @@ defineExpose({ validate, refresh });
|
||||
height: 36px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #0d0d0d;
|
||||
background: var(--bg-body);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.captcha-row:focus-within {
|
||||
border-color: #555;
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.hp-field {
|
||||
@@ -174,7 +195,7 @@ defineExpose({ validate, refresh });
|
||||
}
|
||||
|
||||
.captcha-input::placeholder {
|
||||
color: rgba(255, 255, 255, 0.32);
|
||||
color: var(--neutral);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: none;
|
||||
|
||||
517
apps/player/src/components/SettingsDrawer.vue
Normal file
@@ -0,0 +1,517 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onUnmounted, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { useAppLocale } from '../composables/useAppLocale';
|
||||
import LocaleFlag from './LocaleFlag.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', value: boolean): void;
|
||||
}>();
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const router = useRouter();
|
||||
const auth = useAuthStore();
|
||||
const { locales, setLocale } = useAppLocale();
|
||||
|
||||
const showRulesModal = ref(false);
|
||||
const showLanguageModal = ref(false);
|
||||
|
||||
function close() {
|
||||
emit('update:modelValue', false);
|
||||
}
|
||||
|
||||
async function changeLocale(code: string) {
|
||||
await setLocale(code);
|
||||
showLanguageModal.value = false;
|
||||
}
|
||||
|
||||
function goEdit() {
|
||||
close();
|
||||
router.push('/profile/edit');
|
||||
}
|
||||
|
||||
function logout() {
|
||||
close();
|
||||
auth.logout();
|
||||
router.push('/');
|
||||
}
|
||||
|
||||
const isAnyOpen = computed(() => props.modelValue || showRulesModal.value || showLanguageModal.value);
|
||||
|
||||
watch(
|
||||
isAnyOpen,
|
||||
(isOpen) => {
|
||||
if (isOpen) {
|
||||
document.body.style.overflow = 'hidden';
|
||||
} else {
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
document.body.style.overflow = '';
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="settings-drawer-wrapper" :class="{ open: modelValue }">
|
||||
<div class="settings-drawer-backdrop" @click="close" />
|
||||
|
||||
<div class="settings-drawer-panel">
|
||||
<!-- Header -->
|
||||
<div class="drawer-header">
|
||||
<h2 class="drawer-title">{{ t('profile.settings') }}</h2>
|
||||
<button type="button" class="drawer-close-btn" @click="close" :aria-label="t('common.cancel')">
|
||||
<svg class="close-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M18 6L6 18M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="drawer-content">
|
||||
<section class="settings-group">
|
||||
<!-- Modify Profile -->
|
||||
<button type="button" class="settings-cell" @click="goEdit">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<circle cx="12" cy="8" r="3.5" />
|
||||
<path d="M5 20c0-3.5 3.1-6 7-6s7 2.5 7 6" />
|
||||
</svg>
|
||||
<span class="cell-label">{{ t('profile.edit') }}</span>
|
||||
</span>
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</button>
|
||||
|
||||
<!-- Betting Rules -->
|
||||
<button type="button" class="settings-cell" @click="showRulesModal = true">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<path d="M7 4h10v16H7z" />
|
||||
<path d="M10 8h6M10 12h6M10 16h4" />
|
||||
</svg>
|
||||
<span class="cell-label">{{ t('profile.rules_title') }}</span>
|
||||
</span>
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</button>
|
||||
|
||||
<!-- Language Selector -->
|
||||
<button type="button" class="settings-cell" @click="showLanguageModal = true">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
<path d="M3 12h18M12 3c2.5 2.8 4 6 4 9s-1.5 6.2-4 9M12 3c-2.5 2.8-4 6-4 9s1.5 6.2 4 9" />
|
||||
</svg>
|
||||
<span class="cell-label">{{ t('profile.language') }}</span>
|
||||
</span>
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<!-- Logout Button -->
|
||||
<button type="button" class="logout-btn" @click="logout">
|
||||
{{ t('auth.logout') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Betting Rules Modal -->
|
||||
<Teleport to="body">
|
||||
<Transition name="modal-fade">
|
||||
<div v-if="showRulesModal" class="modal-overlay" @click.self="showRulesModal = false">
|
||||
<div class="modal-card">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">{{ t('profile.rules_title') }}</h3>
|
||||
<button type="button" class="modal-close-btn" @click="showRulesModal = false" :aria-label="t('common.cancel')">
|
||||
<svg class="close-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M18 6L6 18M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body rules-modal-body">
|
||||
<p>{{ t('profile.rules_p1') }}</p>
|
||||
<p>{{ t('profile.rules_p2') }}</p>
|
||||
<p>{{ t('profile.rules_p3') }}</p>
|
||||
<p>{{ t('profile.rules_p4') }}</p>
|
||||
<p>{{ t('profile.rules_p5') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
|
||||
<!-- Language Selector Modal -->
|
||||
<Teleport to="body">
|
||||
<Transition name="modal-fade">
|
||||
<div v-if="showLanguageModal" class="modal-overlay" @click.self="showLanguageModal = false">
|
||||
<div class="modal-card modal-card--small">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">{{ t('profile.language') }}</h3>
|
||||
<button type="button" class="modal-close-btn" @click="showLanguageModal = false" :aria-label="t('common.cancel')">
|
||||
<svg class="close-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M18 6L6 18M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="lang-list">
|
||||
<button
|
||||
v-for="item in locales"
|
||||
:key="item.code"
|
||||
type="button"
|
||||
class="lang-item"
|
||||
:class="{ active: locale === item.code }"
|
||||
@click="changeLocale(item.code)"
|
||||
>
|
||||
<div class="lang-item-main">
|
||||
<LocaleFlag :locale="item.code" :size="16" />
|
||||
<span>{{ item.label }}</span>
|
||||
</div>
|
||||
<svg v-if="locale === item.code" class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<polyline points="20 6 9 17 4 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.settings-drawer-wrapper {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 150;
|
||||
pointer-events: none;
|
||||
visibility: hidden;
|
||||
transition: visibility 0.3s ease;
|
||||
}
|
||||
|
||||
.settings-drawer-wrapper.open {
|
||||
pointer-events: auto;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.settings-drawer-backdrop {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
backdrop-filter: blur(4px);
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.settings-drawer-wrapper.open .settings-drawer-backdrop {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.settings-drawer-panel {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 70%;
|
||||
background: #001a33;
|
||||
border-left: 1px solid var(--border);
|
||||
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
transform: translateX(100%);
|
||||
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.settings-drawer-wrapper.open .settings-drawer-panel {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.drawer-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16px 20px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--dropdown-bg);
|
||||
}
|
||||
|
||||
.drawer-title {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.drawer-close-btn {
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
transition: background 0.2s, color 0.2s;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.drawer-close-btn:active {
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.drawer-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.settings-group {
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.settings-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
min-height: 48px;
|
||||
padding: 0 16px;
|
||||
background: none;
|
||||
color: var(--text);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.settings-cell:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.settings-cell:active {
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.cell-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cell-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
flex-shrink: 0;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.cell-label {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.cell-chevron {
|
||||
color: var(--text-muted);
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
font-weight: 300;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
padding: 0 16px;
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-card);
|
||||
color: var(--danger);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
transition: background 0.2s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.logout-btn:active {
|
||||
background: rgba(255, 69, 58, 0.08);
|
||||
}
|
||||
|
||||
/* Modal Overlays & Cards */
|
||||
.modal-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
|
||||
background: rgba(0, 0, 0, 0.72);
|
||||
backdrop-filter: blur(4px);
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.modal-card {
|
||||
width: 100%;
|
||||
max-width: 340px;
|
||||
background: var(--dropdown-bg, #0A2540);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 12px;
|
||||
padding: 20px 18px 22px;
|
||||
box-shadow: var(--shadow);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modal-card--small {
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.modal-close-btn {
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
padding: 0;
|
||||
transition: background 0.2s, color 0.2s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal-close-btn:active {
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.rules-modal-body {
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
color: var(--text-muted);
|
||||
overflow-y: auto;
|
||||
max-height: 50vh;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.rules-modal-body p {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.rules-modal-body p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Language List inside Modal */
|
||||
.lang-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.lang-item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 12px 14px;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s, color 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
.lang-item:active {
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.lang-item.active {
|
||||
border-color: var(--primary);
|
||||
color: var(--text);
|
||||
background: var(--surface-accent);
|
||||
}
|
||||
|
||||
.lang-item-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.check-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--success, #34C759);
|
||||
}
|
||||
|
||||
/* Modal Transitions */
|
||||
.modal-fade-enter-active,
|
||||
.modal-fade-leave-active {
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.modal-fade-enter-active .modal-card,
|
||||
.modal-fade-leave-active .modal-card {
|
||||
transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
.modal-fade-enter-from,
|
||||
.modal-fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.modal-fade-enter-from .modal-card,
|
||||
.modal-fade-leave-to .modal-card {
|
||||
transform: scale(0.96);
|
||||
}
|
||||
</style>
|
||||
@@ -43,26 +43,26 @@ withDefaults(
|
||||
}
|
||||
|
||||
.status-watermark.won {
|
||||
color: #3db865;
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.status-watermark.lost {
|
||||
color: #e05050;
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.status-watermark.push {
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.status-watermark.pending {
|
||||
color: #e8c84a;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.status-watermark.closed {
|
||||
color: #c9a84a;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.status-watermark.settled {
|
||||
color: #7a9ab8;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,13 +5,12 @@ import { useI18n } from 'vue-i18n';
|
||||
import { playerAvatarUrl, randomAvatarKey } from '@thebet365/shared';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { usePlayerProfile } from '../composables/usePlayerProfile';
|
||||
import { useHoverDropdown } from '../composables/useHoverDropdown';
|
||||
|
||||
const { t } = useI18n();
|
||||
const auth = useAuthStore();
|
||||
const router = useRouter();
|
||||
const { avatarUrl } = usePlayerProfile();
|
||||
const { open, openHover, scheduleClose, closeNow } = useHoverDropdown();
|
||||
const open = ref(false);
|
||||
const root = ref<HTMLElement | null>(null);
|
||||
|
||||
const displayAvatarUrl = computed(() => {
|
||||
@@ -25,11 +24,11 @@ function toggle() {
|
||||
}
|
||||
|
||||
function close() {
|
||||
closeNow();
|
||||
open.value = false;
|
||||
}
|
||||
|
||||
function onOutsideClick(e: Event) {
|
||||
if (!root.value?.contains(e.target as Node)) closeNow();
|
||||
if (!root.value?.contains(e.target as Node)) open.value = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -59,12 +58,7 @@ function logout() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
ref="root"
|
||||
class="avatar-wrap"
|
||||
@mouseenter="openHover"
|
||||
@mouseleave="scheduleClose"
|
||||
>
|
||||
<div ref="root" class="avatar-wrap">
|
||||
<button type="button" class="avatar-btn" :aria-expanded="open" @click="toggle">
|
||||
<img v-if="displayAvatarUrl" :src="displayAvatarUrl" alt="" class="avatar-img" />
|
||||
</button>
|
||||
@@ -75,6 +69,8 @@ function logout() {
|
||||
<button type="button" class="menu-item" @click="goEdit">{{ t('profile.edit') }}</button>
|
||||
<button type="button" class="menu-item danger" @click="logout">{{ t('auth.logout') }}</button>
|
||||
</div>
|
||||
|
||||
<div v-if="open" class="backdrop" @click="close" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -82,16 +78,6 @@ function logout() {
|
||||
.avatar-wrap {
|
||||
position: relative;
|
||||
z-index: 130;
|
||||
--dropdown-gap: 8px;
|
||||
}
|
||||
|
||||
.avatar-wrap::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: var(--dropdown-gap);
|
||||
}
|
||||
|
||||
.avatar-btn {
|
||||
@@ -100,7 +86,7 @@ function logout() {
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: linear-gradient(145deg, #2a2210, #141008);
|
||||
background: var(--bg-card);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -125,13 +111,15 @@ function logout() {
|
||||
|
||||
.avatar-menu {
|
||||
position: absolute;
|
||||
top: calc(100% + var(--dropdown-gap));
|
||||
top: calc(100% + 8px);
|
||||
right: 0;
|
||||
min-width: 168px;
|
||||
padding: 8px 0;
|
||||
border: 1px solid var(--border);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-sm);
|
||||
background: #141414;
|
||||
background: var(--dropdown-bg);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
box-shadow: var(--shadow);
|
||||
z-index: 140;
|
||||
}
|
||||
@@ -156,7 +144,7 @@ function logout() {
|
||||
}
|
||||
|
||||
.menu-item:hover {
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.menu-item.recharge {
|
||||
|
||||
56
apps/player/src/components/VsBadge.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
}>(),
|
||||
{
|
||||
size: 'md',
|
||||
},
|
||||
);
|
||||
|
||||
const sizeClass = computed(() => `vs-badge--${props.size}`);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
class="vs-badge"
|
||||
:class="sizeClass"
|
||||
role="img"
|
||||
aria-label="VS"
|
||||
>
|
||||
VS
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.vs-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
|
||||
font-weight: 700;
|
||||
font-variant: small-caps;
|
||||
letter-spacing: 0.1em;
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
line-height: 1;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.vs-badge--sm {
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.11em;
|
||||
}
|
||||
|
||||
.vs-badge--md {
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.12em;
|
||||
}
|
||||
|
||||
.vs-badge--lg {
|
||||
font-size: 22px;
|
||||
letter-spacing: 0.14em;
|
||||
}
|
||||
</style>
|
||||
171
apps/player/src/components/WalletBalanceCard.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { RouterLink } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { formatMoney } from '../utils/localeDisplay';
|
||||
|
||||
const props = defineProps<{
|
||||
availableBalance: unknown;
|
||||
cashbackTotal?: string;
|
||||
frozenBalance?: unknown;
|
||||
compact?: boolean;
|
||||
}>();
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const balanceDisplay = computed(() => formatMoney(props.availableBalance, locale.value));
|
||||
|
||||
const balanceSizeClass = computed(() => {
|
||||
const len = balanceDisplay.value.length;
|
||||
if (len <= 10) return 'wallet-balance--xl';
|
||||
if (len <= 13) return 'wallet-balance--lg';
|
||||
if (len <= 16) return 'wallet-balance--md';
|
||||
if (len <= 19) return 'wallet-balance--sm';
|
||||
return 'wallet-balance--xs';
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="wallet-card" :class="{ 'wallet-card--compact': compact }">
|
||||
<div class="wallet-card-head">
|
||||
<span class="wallet-kicker">{{ t('wallet.cash_balance') }}</span>
|
||||
<RouterLink to="/wallet/recharge" class="wallet-recharge">
|
||||
{{ t('recharge.title') }}
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
<p class="wallet-balance" :class="balanceSizeClass">{{ balanceDisplay }}</p>
|
||||
|
||||
<div class="wallet-metrics">
|
||||
<div class="wallet-metric">
|
||||
<span class="wallet-metric-label">{{ t('wallet.stats_cashback') }}</span>
|
||||
<span class="wallet-metric-value">{{ formatMoney(cashbackTotal ?? '0', locale) }}</span>
|
||||
</div>
|
||||
<div class="wallet-metric">
|
||||
<span class="wallet-metric-label">{{ t('wallet.unsettled') }}</span>
|
||||
<span class="wallet-metric-value">{{ formatMoney(frozenBalance, locale) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.wallet-card {
|
||||
position: relative;
|
||||
margin-bottom: var(--space-section);
|
||||
padding: 14px 16px;
|
||||
border-radius: var(--radius);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
background: var(--gradient-card);
|
||||
box-shadow: var(--shadow-card);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wallet-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.wallet-card--compact {
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
.wallet-card-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.wallet-kicker {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.wallet-recharge {
|
||||
flex-shrink: 0;
|
||||
padding: 6px 12px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.wallet-recharge:active {
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
.wallet-balance {
|
||||
margin: 0 0 10px;
|
||||
font-size: 34px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.03em;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: var(--text);
|
||||
line-height: 1.08;
|
||||
}
|
||||
|
||||
.wallet-balance--xl { font-size: 34px; }
|
||||
.wallet-balance--lg { font-size: 30px; }
|
||||
.wallet-balance--md { font-size: 26px; }
|
||||
.wallet-balance--sm { font-size: 22px; }
|
||||
.wallet-balance--xs { font-size: 19px; }
|
||||
|
||||
.wallet-metrics {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 0;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.wallet-metric {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
padding: 0 6px;
|
||||
}
|
||||
|
||||
.wallet-metric:not(:first-child) {
|
||||
border-left: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.wallet-metric:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.wallet-metric:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.wallet-metric-label {
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--text-dim);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.wallet-metric-value {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
font-variant-numeric: tabular-nums;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
</style>
|
||||
@@ -1,128 +1,264 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { parseAmount, formatMoneyCompact } from '../utils/localeDisplay';
|
||||
|
||||
import { formatMoneyCompact, parseAmount } from '../utils/localeDisplay';
|
||||
|
||||
|
||||
|
||||
interface Transaction {
|
||||
|
||||
transactionType: string;
|
||||
|
||||
amount: string;
|
||||
|
||||
frozenBefore?: string;
|
||||
|
||||
frozenAfter?: string;
|
||||
|
||||
createdAt: string;
|
||||
|
||||
transactionId?: string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
|
||||
items: Transaction[];
|
||||
|
||||
cashbackTotal?: string;
|
||||
|
||||
}>(), {
|
||||
|
||||
cashbackTotal: '0',
|
||||
|
||||
});
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
|
||||
|
||||
const CASHBACK_TYPES = new Set(['CASHBACK', 'CASHBACK_DEPOSIT']);
|
||||
|
||||
|
||||
|
||||
const stats = computed(() => {
|
||||
|
||||
let income = 0;
|
||||
|
||||
let expense = 0;
|
||||
|
||||
let cashback = 0;
|
||||
|
||||
|
||||
|
||||
for (const tx of props.items) {
|
||||
|
||||
const amt = parseAmount(tx.amount);
|
||||
|
||||
const isCb = CASHBACK_TYPES.has(tx.transactionType.toUpperCase());
|
||||
|
||||
if (isCb) {
|
||||
|
||||
cashback += Math.abs(amt);
|
||||
}
|
||||
if (amt >= 0) income += amt;
|
||||
else expense += Math.abs(amt);
|
||||
|
||||
}
|
||||
|
||||
// Use server-side cashback total if provided (more accurate across all pages)
|
||||
if (props.cashbackTotal !== '0') {
|
||||
cashback = Math.abs(parseAmount(props.cashbackTotal));
|
||||
if (amt >= 0) income += amt;
|
||||
|
||||
else expense += Math.abs(amt);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (props.cashbackTotal !== '0') {
|
||||
|
||||
cashback = Math.abs(parseAmount(props.cashbackTotal));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const net = income - expense;
|
||||
|
||||
|
||||
|
||||
return { income, expense, net, cashback };
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
|
||||
<div class="wallet-stats-panel">
|
||||
<div class="stats-row">
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stats-grid">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_income') }}</span>
|
||||
|
||||
<span class="stat-val income">{{ formatMoneyCompact(stats.income, locale) }}</span>
|
||||
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_expense') }}</span>
|
||||
|
||||
<span class="stat-val expense">{{ formatMoneyCompact(stats.expense, locale) }}</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats-divider" />
|
||||
<div class="stats-row">
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_net') }}</span>
|
||||
<span class="stat-val" :class="stats.net >= 0 ? 'income' : 'expense'">
|
||||
|
||||
<span class="stat-val" :class="stats.net >= 0 ? 'income' : 'muted'">
|
||||
|
||||
{{ formatMoneyCompact(stats.net, locale) }}
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_cashback') }}</span>
|
||||
<span class="stat-val cashback">{{ formatMoneyCompact(stats.cashback, locale) }}</span>
|
||||
|
||||
<span class="stat-val">{{ formatMoneyCompact(stats.cashback, locale) }}</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
.wallet-stats-panel {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
|
||||
position: relative;
|
||||
|
||||
background: var(--gradient-card);
|
||||
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
|
||||
border-radius: var(--radius);
|
||||
padding: 12px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
padding: 14px 16px;
|
||||
|
||||
margin-bottom: var(--space-section);
|
||||
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.stats-row {
|
||||
|
||||
|
||||
.wallet-stats-panel::before {
|
||||
|
||||
content: '';
|
||||
|
||||
position: absolute;
|
||||
|
||||
top: 0;
|
||||
|
||||
left: 10%;
|
||||
|
||||
right: 10%;
|
||||
|
||||
height: 1px;
|
||||
|
||||
background: var(--gradient-card-shine);
|
||||
|
||||
pointer-events: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stats-grid {
|
||||
|
||||
display: grid;
|
||||
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
|
||||
gap: 12px 16px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stat-cell {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
gap: 4px;
|
||||
|
||||
min-width: 0;
|
||||
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
min-width: 0;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
|
||||
.stat-label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.03em;
|
||||
margin-bottom: 2px;
|
||||
|
||||
font-size: 12px;
|
||||
|
||||
font-weight: 500;
|
||||
|
||||
color: var(--text-dim);
|
||||
|
||||
letter-spacing: 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stat-val {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
|
||||
font-size: 15px;
|
||||
|
||||
font-weight: 600;
|
||||
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
|
||||
color: var(--text);
|
||||
|
||||
letter-spacing: -0.02em;
|
||||
|
||||
}
|
||||
|
||||
.stat-val.income { color: #3db865; }
|
||||
.stat-val.expense { color: #e05050; }
|
||||
.stat-val.cashback { color: #f0b90b; }
|
||||
|
||||
.stats-divider {
|
||||
height: 1px;
|
||||
margin: 6px 8px;
|
||||
background: linear-gradient(90deg, transparent, var(--border), transparent);
|
||||
}
|
||||
|
||||
.stat-val.income { color: var(--success); }
|
||||
|
||||
.stat-val.expense { color: var(--text-muted); }
|
||||
|
||||
.stat-val.muted { color: var(--text-muted); }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ const menuItems = computed(() => {
|
||||
|
||||
.nav-item.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.nav-item.active .dot {
|
||||
@@ -111,7 +111,7 @@ const menuItems = computed(() => {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #333;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
|
||||
@@ -1181,9 +1181,7 @@ onUnmounted(() => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
background:
|
||||
linear-gradient(rgba(14, 12, 9, 0.58), rgba(14, 12, 9, 0.68)),
|
||||
url('../../assets/images/generated/pc-betslip-sidebar-bg-v1.webp') no-repeat center / cover;
|
||||
background: var(--desktop-sidebar-panel-bg);
|
||||
}
|
||||
|
||||
.panel-head {
|
||||
@@ -1235,22 +1233,14 @@ onUnmounted(() => {
|
||||
flex: 0 0 20%;
|
||||
min-width: 0;
|
||||
padding: 10px 4px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/pc-betslip-btn-secondary-v1.webp') center / 100% 100% no-repeat;
|
||||
color: var(--primary-light);
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.clear-slip-btn:hover {
|
||||
color: #fff0a8;
|
||||
filter: brightness(1.08);
|
||||
}
|
||||
|
||||
.clear-slip-btn.foot-clear:active {
|
||||
background-image: url('../../assets/images/generated/pc-betslip-btn-secondary-pressed-v1.webp');
|
||||
filter: brightness(0.96);
|
||||
color: var(--primary-light);
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.balance-info {
|
||||
@@ -1308,7 +1298,7 @@ onUnmounted(() => {
|
||||
|
||||
.badge {
|
||||
background: var(--primary);
|
||||
color: #111;
|
||||
color: #001A33;
|
||||
font-size: 9px;
|
||||
font-weight: 800;
|
||||
padding: 1px 4px;
|
||||
@@ -1317,7 +1307,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.odds-warning {
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-bottom: 1px solid var(--border-gold-soft);
|
||||
color: var(--primary-light);
|
||||
font-size: 11px;
|
||||
@@ -1360,7 +1350,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.slip-card {
|
||||
background: #1e1e1e;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
padding: 7px 8px;
|
||||
@@ -1508,7 +1498,7 @@ onUnmounted(() => {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #0d0d0d;
|
||||
background: #002244;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 3px;
|
||||
padding: 0 6px;
|
||||
@@ -1573,32 +1563,32 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.card-single-btn {
|
||||
border: 1px solid rgba(212, 175, 55, 0.55);
|
||||
background: rgba(212, 175, 55, 0.14);
|
||||
border: 1px solid rgba(255, 255, 255, 0.55);
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.card-single-btn:hover:not(:disabled) {
|
||||
background: rgba(212, 175, 55, 0.22);
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
border-color: var(--border-gold);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.card-parlay-btn {
|
||||
border: 1px dashed rgba(212, 175, 55, 0.45);
|
||||
background: rgba(212, 175, 55, 0.04);
|
||||
border: 1px dashed rgba(255, 255, 255, 0.45);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.card-parlay-btn:hover:not(:disabled) {
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: var(--border-gold-soft);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.card-parlay-btn.active {
|
||||
border-style: solid;
|
||||
border-color: rgba(212, 175, 55, 0.35);
|
||||
border-color: rgba(255, 255, 255, 0.35);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
@@ -1615,7 +1605,7 @@ onUnmounted(() => {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
background: rgba(212, 175, 55, 0.16);
|
||||
background: rgba(255, 255, 255, 0.16);
|
||||
font-size: 11px;
|
||||
line-height: 1;
|
||||
font-weight: 800;
|
||||
@@ -1645,7 +1635,7 @@ onUnmounted(() => {
|
||||
.panel-warning {
|
||||
font-size: 11px;
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: 4px;
|
||||
padding: 8px;
|
||||
@@ -1659,7 +1649,7 @@ onUnmounted(() => {
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
padding: 4px 6px;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@@ -1668,7 +1658,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.stake-control {
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
@@ -1679,7 +1669,7 @@ onUnmounted(() => {
|
||||
.stake-input-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: #0d0d0d;
|
||||
background: #002244;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
padding: 0 10px;
|
||||
@@ -1723,7 +1713,7 @@ onUnmounted(() => {
|
||||
|
||||
.chip-btn {
|
||||
flex: 1;
|
||||
background: #1e1e1e;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
font-size: 11px;
|
||||
@@ -1755,7 +1745,7 @@ onUnmounted(() => {
|
||||
.panel-bottom-fixed {
|
||||
flex-shrink: 0;
|
||||
border-top: 1px solid var(--border);
|
||||
background: rgba(16, 16, 16, 0.98);
|
||||
background: rgba(10, 37, 64, 0.98);
|
||||
}
|
||||
|
||||
.panel-summary {
|
||||
@@ -1808,7 +1798,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.add-parlay-btn:hover {
|
||||
background: rgba(212, 175, 55, 0.05);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
@@ -1816,26 +1806,17 @@ onUnmounted(() => {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 10px;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/pc-betslip-btn-primary-v1.webp') center / 100% 100% no-repeat;
|
||||
color: #1b1200;
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: #3D2800;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
transition: opacity 0.2s, filter 0.15s;
|
||||
transition: opacity 0.2s;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.submit-btn:not(:disabled):hover {
|
||||
filter: brightness(1.06);
|
||||
}
|
||||
|
||||
.submit-btn:not(:disabled):active {
|
||||
background-image: url('../../assets/images/generated/pc-betslip-btn-primary-pressed-v1.webp');
|
||||
filter: brightness(0.98);
|
||||
}
|
||||
|
||||
.submit-btn:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
@@ -1848,7 +1829,7 @@ onUnmounted(() => {
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
@@ -1858,7 +1839,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.history-view-all-btn:hover {
|
||||
background: rgba(212, 175, 55, 0.14);
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
@@ -1888,7 +1869,7 @@ onUnmounted(() => {
|
||||
.scope-chip.active {
|
||||
color: var(--primary-light);
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.history-loading {
|
||||
@@ -1908,7 +1889,7 @@ onUnmounted(() => {
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border);
|
||||
background: #1e1e1e;
|
||||
background: #0A2540;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
transition: border-color 0.15s, background 0.15s;
|
||||
@@ -1916,7 +1897,7 @@ onUnmounted(() => {
|
||||
|
||||
.history-card:hover {
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.04);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.history-card-top {
|
||||
@@ -1960,7 +1941,7 @@ onUnmounted(() => {
|
||||
|
||||
.history-status.hist-pending {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.history-match {
|
||||
|
||||
@@ -60,7 +60,7 @@ const { t } = useI18n();
|
||||
.data-table-container {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
background: rgba(20, 20, 20, 0.95);
|
||||
background: rgba(12, 40, 66, 0.95);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ const { t } = useI18n();
|
||||
}
|
||||
|
||||
th {
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
color: var(--text-muted);
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
|
||||
@@ -42,16 +42,15 @@ withDefaults(
|
||||
.desktop-auth-page {
|
||||
position: relative;
|
||||
min-height: 100dvh;
|
||||
background: linear-gradient(135deg, #0a0a0a 0%, #111 50%, #0d0d0d 100%);
|
||||
background: linear-gradient(135deg, #001A33 0%, #001A33 50%, #002244 100%);
|
||||
overflow: hidden;
|
||||
font-family: var(--font-body);
|
||||
}
|
||||
|
||||
.desktop-auth-page::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(ellipse 60% 60% at 50% 40%, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
|
||||
background: radial-gradient(ellipse 60% 60% at 50% 40%, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@@ -69,7 +68,7 @@ withDefaults(
|
||||
height: 320px;
|
||||
top: 10%;
|
||||
left: 12%;
|
||||
background: radial-gradient(circle, rgba(212, 175, 55, 0.5) 0%, transparent 70%);
|
||||
background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
|
||||
animation: ambient-drift-1 12s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
@@ -78,7 +77,7 @@ withDefaults(
|
||||
height: 280px;
|
||||
bottom: 12%;
|
||||
right: 12%;
|
||||
background: radial-gradient(circle, rgba(240, 216, 117, 0.35) 0%, transparent 70%);
|
||||
background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
|
||||
animation: ambient-drift-2 16s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
@@ -113,60 +112,40 @@ withDefaults(
|
||||
|
||||
.auth-card {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
width: 100%;
|
||||
max-width: 720px;
|
||||
background:
|
||||
linear-gradient(rgba(8, 8, 7, 0.18), rgba(8, 8, 7, 0.24)),
|
||||
url('../../assets/images/generated/auth-panel-bg-v1.webp') center / 100% 100% no-repeat;
|
||||
backdrop-filter: var(--blur-lg);
|
||||
-webkit-backdrop-filter: var(--blur-lg);
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
|
||||
background: linear-gradient(
|
||||
165deg,
|
||||
rgba(255, 255, 255, 0.06) 0%,
|
||||
rgba(255, 255, 255, 0.03) 28%,
|
||||
rgba(10, 37, 64, 0.55) 65%,
|
||||
rgba(0, 20, 40, 0.75) 100%
|
||||
);
|
||||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||||
border-radius: 12px;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.12),
|
||||
0 8px 32px rgba(0, 0, 0, 0.4);
|
||||
overflow: hidden;
|
||||
transition:
|
||||
filter 0.22s ease,
|
||||
transform 0.22s ease;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
}
|
||||
|
||||
.auth-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
top: 0;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
height: 1px;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
transparent 0%,
|
||||
rgba(255, 255, 255, 0.28) 50%,
|
||||
transparent 100%
|
||||
);
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
background: url('../../assets/images/generated/auth-panel-bg-v1.webp') center / 100% 100% no-repeat;
|
||||
filter: brightness(1.28) saturate(1.16);
|
||||
mix-blend-mode: screen;
|
||||
transition: opacity 0.22s ease;
|
||||
}
|
||||
|
||||
.auth-card::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
background:
|
||||
linear-gradient(90deg, transparent 8%, rgba(255, 226, 156, 0.08) 50%, transparent 92%),
|
||||
radial-gradient(circle at 72% 48%, rgba(212, 175, 55, 0.1), transparent 34%);
|
||||
transition: opacity 0.22s ease;
|
||||
}
|
||||
|
||||
.auth-card:focus-within {
|
||||
transform: translateY(-2px);
|
||||
filter: brightness(1.04) saturate(1.05);
|
||||
}
|
||||
|
||||
.auth-card:focus-within::before {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.auth-card:focus-within::after {
|
||||
opacity: 1;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.auth-card--wide {
|
||||
@@ -178,15 +157,12 @@ withDefaults(
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 14px 24px 0;
|
||||
padding: 14px 18px 0;
|
||||
}
|
||||
|
||||
.form-body {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(200px, 260px) 1fr;
|
||||
gap: 24px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
@@ -194,9 +170,13 @@ withDefaults(
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--space-6) var(--space-5);
|
||||
background: rgba(0, 0, 0, 0.18);
|
||||
border-right: 1px solid rgba(212, 175, 55, 0.15);
|
||||
padding: 28px 20px;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(255, 255, 255, 0.03) 0%,
|
||||
rgba(0, 26, 51, 0.3) 100%
|
||||
);
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.logo-large {
|
||||
@@ -204,14 +184,14 @@ withDefaults(
|
||||
max-width: 220px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
filter: drop-shadow(0 4px 24px rgba(212, 175, 55, 0.25));
|
||||
filter: drop-shadow(0 4px 24px rgba(255, 255, 255, 0.25));
|
||||
}
|
||||
|
||||
.form-fields {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
padding: 22px 24px 24px 0;
|
||||
padding: 22px 28px 28px;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
@@ -232,7 +212,7 @@ withDefaults(
|
||||
.form-brand {
|
||||
padding: 20px 24px 12px;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid rgba(212, 175, 55, 0.15);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.logo-large {
|
||||
@@ -240,7 +220,7 @@ withDefaults(
|
||||
}
|
||||
|
||||
.form-fields {
|
||||
padding: 18px 24px 22px;
|
||||
padding: 18px 20px 22px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ onUnmounted(stopAutoPlay);
|
||||
height: 100%;
|
||||
border-radius: 14px;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
|
||||
background: linear-gradient(180deg, #0A2540 0%, #001A33 100%);
|
||||
box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
|
||||
transition: box-shadow 0.35s ease, filter 0.35s ease, transform 0.25s ease;
|
||||
display: flex;
|
||||
@@ -276,8 +276,8 @@ onUnmounted(stopAutoPlay);
|
||||
filter: none;
|
||||
box-shadow:
|
||||
0 16px 40px rgba(0, 0, 0, 0.5),
|
||||
0 0 28px rgba(212, 175, 55, 0.22),
|
||||
0 0 56px rgba(212, 175, 55, 0.1);
|
||||
0 0 28px rgba(255, 255, 255, 0.22),
|
||||
0 0 56px rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.coverflow-slide.is-active:hover .slide-card {
|
||||
@@ -290,16 +290,16 @@ onUnmounted(stopAutoPlay);
|
||||
transform: scale(1);
|
||||
box-shadow:
|
||||
0 16px 40px rgba(0, 0, 0, 0.5),
|
||||
0 0 22px rgba(212, 175, 55, 0.16),
|
||||
0 0 48px rgba(212, 175, 55, 0.08);
|
||||
0 0 22px rgba(255, 255, 255, 0.16),
|
||||
0 0 48px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(1.008);
|
||||
box-shadow:
|
||||
0 18px 44px rgba(0, 0, 0, 0.52),
|
||||
0 0 32px rgba(212, 175, 55, 0.26),
|
||||
0 0 60px rgba(212, 175, 55, 0.12);
|
||||
0 0 32px rgba(255, 255, 255, 0.26),
|
||||
0 0 60px rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,13 +318,13 @@ onUnmounted(stopAutoPlay);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), #1a1a1a);
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), #0A2540);
|
||||
}
|
||||
|
||||
.fallback-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
color: rgba(212, 175, 55, 0.35);
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
|
||||
.click-hint {
|
||||
@@ -338,7 +338,7 @@ onUnmounted(stopAutoPlay);
|
||||
justify-content: center;
|
||||
pointer-events: none;
|
||||
z-index: 2;
|
||||
background: rgba(0, 0, 0, 0.35);
|
||||
background: rgba(0, 26, 51, 0.35);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ onUnmounted(stopAutoPlay);
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(212, 175, 55, 0.45);
|
||||
border: 1px solid rgba(255, 255, 255, 0.45);
|
||||
animation: click-ring-pulse 2.8s ease-out infinite;
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ onUnmounted(stopAutoPlay);
|
||||
position: relative;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
color: rgba(212, 175, 55, 0.88);
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
animation: click-icon-bob 2.8s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ onUnmounted(stopAutoPlay);
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
background: rgba(0, 26, 51, 0.65);
|
||||
backdrop-filter: blur(8px);
|
||||
color: #ffffff;
|
||||
display: flex;
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import api from '../../api';
|
||||
import GoldSpinner from '../GoldSpinner.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
betNo: string | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:visible': [value: boolean];
|
||||
}>();
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
type BetDetail = {
|
||||
betNo: string;
|
||||
stake: string;
|
||||
potentialReturn?: string;
|
||||
status: string;
|
||||
placedAt: string;
|
||||
legs: Array<{
|
||||
matchTitle?: string;
|
||||
marketLabel?: string;
|
||||
selectionName?: string;
|
||||
odds?: number;
|
||||
resultStatus?: string;
|
||||
score?: { ht: string | null; ft: string | null } | null;
|
||||
[key: string]: any;
|
||||
}>;
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
const detail = ref<BetDetail | null>(null);
|
||||
const loading = ref(true);
|
||||
const error = ref(false);
|
||||
|
||||
async function loadDetail(betNo: string) {
|
||||
loading.value = true;
|
||||
error.value = false;
|
||||
detail.value = null;
|
||||
try {
|
||||
const { data } = await api.get(`/player/bets/${betNo}`);
|
||||
detail.value = data.data ?? null;
|
||||
} catch {
|
||||
error.value = true;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [props.visible, props.betNo] as const,
|
||||
([vis, no]) => {
|
||||
if (vis && no) loadDetail(no);
|
||||
if (!vis) {
|
||||
detail.value = null;
|
||||
error.value = false;
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
|
||||
function statusClass(status: string) {
|
||||
const map: Record<string, string> = { WON: 'st-won', LOST: 'st-lost', PENDING: 'st-pending', PUSH: 'st-push' };
|
||||
return map[status?.toUpperCase()] ?? 'st-default';
|
||||
}
|
||||
|
||||
function statusLabel(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
WON: t('history.filter_won'),
|
||||
LOST: t('history.filter_lost'),
|
||||
PENDING: t('history.filter_pending'),
|
||||
PUSH: t('history.filter_push'),
|
||||
};
|
||||
return map[status?.toUpperCase()] ?? status;
|
||||
}
|
||||
|
||||
const SEL_TRANS: Record<string, Record<string, string>> = {
|
||||
'\u4e3b\u80dc': { 'en-US': 'Home Win', 'ms-MY': 'Rumah Menang' },
|
||||
'\u5ba2\u80dc': { 'en-US': 'Away Win', 'ms-MY': 'Tandang Menang' },
|
||||
'\u548c\u5c40': { 'en-US': 'Draw', 'ms-MY': 'Seri' },
|
||||
'\u4e3b': { 'en-US': 'Home', 'ms-MY': 'Rumah' },
|
||||
'\u5ba2': { 'en-US': 'Away', 'ms-MY': 'Tandang' },
|
||||
'\u5927': { 'en-US': 'Over', 'ms-MY': 'Atas' },
|
||||
'\u5c0f': { 'en-US': 'Under', 'ms-MY': 'Bawah' },
|
||||
'\u5355': { 'en-US': 'Odd', 'ms-MY': 'Ganjil' },
|
||||
'\u53cc': { 'en-US': 'Even', 'ms-MY': 'Genap' },
|
||||
'\u51a0\u519b': { 'en-US': 'Winner', 'ms-MY': 'Juara' },
|
||||
};
|
||||
|
||||
function translateSel(name: string): string {
|
||||
if (locale.value === 'zh-CN') return name;
|
||||
const exact = SEL_TRANS[name];
|
||||
if (exact) return exact[locale.value] ?? exact['en-US'] ?? name;
|
||||
const sp = name.indexOf(' ');
|
||||
if (sp > 0) {
|
||||
const head = name.slice(0, sp);
|
||||
const m = SEL_TRANS[head];
|
||||
if (m) return (m[locale.value] ?? m['en-US'] ?? head) + name.slice(sp);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<Transition name="modal-fade">
|
||||
<div v-if="visible" class="modal-overlay" @click.self="close">
|
||||
<div class="modal-container" role="dialog" aria-modal="true">
|
||||
<div class="modal-header">
|
||||
<span class="modal-title">{{ t('bet.detail_title') }}</span>
|
||||
<button type="button" class="modal-close" @click="close">✕</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div v-if="loading" class="modal-loading">
|
||||
<GoldSpinner :size="32" />
|
||||
</div>
|
||||
|
||||
<div v-else-if="error" class="modal-error">
|
||||
<p>{{ t('common.load_failed') }}</p>
|
||||
<button v-if="betNo" type="button" class="retry-btn" @click="loadDetail(betNo)">{{ t('common.retry') }}</button>
|
||||
</div>
|
||||
|
||||
<template v-else-if="detail">
|
||||
<div class="info-rows">
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('bet.bet_no') }}</span>
|
||||
<span class="row-val mono">{{ detail.betNo }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('common.status') }}</span>
|
||||
<span class="row-val">
|
||||
<span class="st-badge" :class="statusClass(detail.status)">{{ statusLabel(detail.status) }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('bet.stake') }}</span>
|
||||
<span class="row-val">{{ detail.stake }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('bet.potential_payout') }}</span>
|
||||
<span class="row-val gold">{{ detail.potentialReturn || '-' }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('bet.placed_at') }}</span>
|
||||
<span class="row-val muted">{{ detail.placedAt ? new Date(detail.placedAt).toLocaleString() : '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sel-section">
|
||||
<div class="sel-section-title">{{ t('bet.selections') }}</div>
|
||||
<div v-for="(leg, idx) in detail.legs" :key="idx" class="sel-item">
|
||||
<div class="sel-item-main">
|
||||
<span class="sel-item-match">{{ leg.matchTitle || t('bet.match') }}</span>
|
||||
<span class="sel-item-pick">
|
||||
{{ leg.marketLabel || '' }} - {{ translateSel(leg.selectionName || '') }}
|
||||
</span>
|
||||
<span v-if="leg.score?.ft" class="sel-item-score">{{ t('history.ft') }}: {{ leg.score.ft }}</span>
|
||||
</div>
|
||||
<span class="sel-item-odds">@{{ leg.odds }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-else class="modal-empty">{{ t('common.not_found') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.modal-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.modal-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
max-height: 80vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px 22px 22px;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent 36%),
|
||||
rgba(14, 14, 12, 0.96);
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2px 0 12px;
|
||||
border-bottom: 1px solid rgba(212, 175, 55, 0.16);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-muted);
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
padding: 0 4px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.modal-close:hover { color: var(--text); }
|
||||
|
||||
.modal-body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.modal-loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 48px 0;
|
||||
}
|
||||
|
||||
.modal-error {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 48px 20px;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.retry-btn {
|
||||
padding: 6px 18px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-gold-soft, rgba(212,175,55,0.25));
|
||||
background: transparent;
|
||||
color: var(--primary-light, #F0D875);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48px 20px;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* Info rows */
|
||||
.info-rows { border-bottom: 1px solid rgba(212, 175, 55, 0.12); }
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 10px 16px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.info-row:last-child { border-bottom: none; }
|
||||
|
||||
.row-label {
|
||||
width: 90px;
|
||||
flex-shrink: 0;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.row-val {
|
||||
flex: 1;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.row-val.gold { color: var(--primary-light, #F0D875); }
|
||||
.row-val.muted { color: var(--text-muted); font-weight: 500; }
|
||||
|
||||
.mono { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; }
|
||||
|
||||
.st-badge {
|
||||
display: inline-block;
|
||||
padding: 2px 10px;
|
||||
border-radius: 2px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.st-won { background: rgba(52,199,89,0.12); color: #4cd964; }
|
||||
.st-lost { background: rgba(255,69,58,0.12); color: #ff453a; }
|
||||
.st-pending { background: rgba(212,175,55,0.12); color: var(--primary-light); }
|
||||
.st-push { background: rgba(100,100,100,0.12); color: #aaa; }
|
||||
.st-default { background: rgba(100,100,100,0.1); color: #888; }
|
||||
|
||||
/* Selections */
|
||||
.sel-section { padding: 12px 0 2px; }
|
||||
|
||||
.sel-section-title {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 8px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid var(--desktop-border, #262626);
|
||||
}
|
||||
|
||||
.sel-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.04);
|
||||
}
|
||||
|
||||
.sel-item:last-child { border-bottom: none; }
|
||||
|
||||
.sel-item-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.sel-item-match {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.sel-item-pick {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.sel-item-score {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.sel-item-odds {
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light, #F0D875);
|
||||
flex-shrink: 0;
|
||||
font-family: 'SF Mono', 'Consolas', monospace;
|
||||
}
|
||||
|
||||
/* Transition */
|
||||
.modal-fade-enter-active,
|
||||
.modal-fade-leave-active {
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.modal-fade-enter-from,
|
||||
.modal-fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -47,9 +47,7 @@ watch(
|
||||
width: var(--desktop-right-betslip-w);
|
||||
min-width: 0;
|
||||
border-left: 1px solid var(--border);
|
||||
background:
|
||||
linear-gradient(rgba(14, 12, 9, 0.58), rgba(14, 12, 9, 0.68)),
|
||||
url('../../assets/images/generated/pc-betslip-sidebar-bg-v1.webp') no-repeat center / cover;
|
||||
background: var(--desktop-sidebar-panel-bg);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 0;
|
||||
@@ -75,7 +73,7 @@ watch(
|
||||
transform: translateY(-50%);
|
||||
box-shadow:
|
||||
0 2px 10px rgba(0, 0, 0, 0.5),
|
||||
0 0 0 3px rgba(20, 20, 20, 0.92);
|
||||
0 0 0 3px rgba(12, 40, 66, 0.92);
|
||||
transition:
|
||||
transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
|
||||
background 0.2s,
|
||||
@@ -97,10 +95,10 @@ watch(
|
||||
.rail-toggle:hover {
|
||||
border-color: var(--border-gold);
|
||||
background: var(--primary);
|
||||
color: #111;
|
||||
color: #001A33;
|
||||
box-shadow:
|
||||
0 4px 14px rgba(0, 0, 0, 0.6),
|
||||
0 0 0 3px rgba(212, 175, 55, 0.15);
|
||||
0 0 0 3px rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.rail-toggle:active {
|
||||
@@ -155,8 +153,8 @@ watch(
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
border-radius: 10px;
|
||||
background: var(--primary, #D4AF37);
|
||||
color: #111;
|
||||
background: var(--primary, rgba(255, 255, 255, 0.92));
|
||||
color: #001A33;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
line-height: 20px;
|
||||
|
||||
@@ -262,8 +262,8 @@ function addToParlayList() {
|
||||
width: 190px;
|
||||
padding: 8px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(212, 175, 55, 0.2);
|
||||
background: rgba(22, 22, 22, 0.9);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
background: rgba(14, 44, 70, 0.9);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
|
||||
@@ -284,7 +284,7 @@ function addToParlayList() {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-width: 0 6px 6px 6px;
|
||||
border-color: transparent transparent rgba(22, 22, 22, 0.9) transparent;
|
||||
border-color: transparent transparent rgba(14, 44, 70, 0.9) transparent;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ function addToParlayList() {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-width: 0 7px 7px 7px;
|
||||
border-color: transparent transparent rgba(212, 175, 55, 0.2) transparent;
|
||||
border-color: transparent transparent rgba(255, 255, 255, 0.2) transparent;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ function addToParlayList() {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-width: 6px 6px 0 6px;
|
||||
border-color: rgba(22, 22, 22, 0.9) transparent transparent transparent;
|
||||
border-color: rgba(14, 44, 70, 0.9) transparent transparent transparent;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ function addToParlayList() {
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-width: 7px 7px 0 7px;
|
||||
border-color: rgba(212, 175, 55, 0.2) transparent transparent transparent;
|
||||
border-color: rgba(255, 255, 255, 0.2) transparent transparent transparent;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -342,8 +342,8 @@ function addToParlayList() {
|
||||
padding: 4px 6px;
|
||||
margin-bottom: 6px;
|
||||
border-radius: 3px;
|
||||
background: rgba(212, 175, 55, 0.04);
|
||||
border: 1px solid rgba(212, 175, 55, 0.15);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.pick {
|
||||
@@ -375,13 +375,13 @@ function addToParlayList() {
|
||||
margin-bottom: 5px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: #080808;
|
||||
background: #001A33;
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.stake-input:focus {
|
||||
border-color: rgba(212, 175, 55, 0.3);
|
||||
border-color: rgba(255, 255, 255, 0.3);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ function addToParlayList() {
|
||||
padding: 5px;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
background: linear-gradient(180deg, #f0d875 0%, #d4af37 100%);
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: #3d2800;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
@@ -447,8 +447,8 @@ function addToParlayList() {
|
||||
width: 100%;
|
||||
padding: 4px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid rgba(212, 175, 55, 0.25);
|
||||
background: rgba(212, 175, 55, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.25);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
color: var(--primary-light);
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
@@ -457,6 +457,6 @@ function addToParlayList() {
|
||||
}
|
||||
|
||||
.btn-outline:hover {
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type { OutrightEvent, OutrightSelection } from '../outright/OutrightEventSection.vue';
|
||||
import saishiImg from '../../assets/images/generated/saishi-gold-trophy-v1.webp';
|
||||
import outrightListCardBg from '../../assets/images/generated/pc-match-list-card-bg-v1.webp';
|
||||
|
||||
const outrightCardBg = `url(${outrightListCardBg})`;
|
||||
import saishiImg from '../../assets/images/saishi.webp';
|
||||
|
||||
const props = defineProps<{
|
||||
event: OutrightEvent;
|
||||
@@ -110,9 +107,9 @@ const topSelections = computed(() => {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 140px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: v-bind(outrightCardBg) center / 100% 100% no-repeat;
|
||||
border: 1px solid rgba(140, 140, 140, 0.35);
|
||||
border-radius: 6px;
|
||||
background: linear-gradient(180deg, #0A2540 0%, #002244 100%);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -273,17 +270,18 @@ const topSelections = computed(() => {
|
||||
flex: 1; /* equal share of available width */
|
||||
gap: 1px;
|
||||
padding: 2px 4px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/odds-button-normal-v1.webp') center / 100% 100% no-repeat;
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
cursor: pointer;
|
||||
min-height: 32px;
|
||||
transition: filter 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.odds-btn:hover {
|
||||
background-image: url('../../assets/images/generated/odds-button-selected-v1.webp');
|
||||
filter: brightness(1.08);
|
||||
background: var(--border-gold-soft);
|
||||
border-color: var(--border-gold);
|
||||
box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.selection-name {
|
||||
|
||||
@@ -39,7 +39,7 @@ const layoutMode = computed<'betting' | 'account' | 'hub' | 'marketing'>(() => {
|
||||
p === '/bets' ||
|
||||
p.startsWith('/bets/') ||
|
||||
p.startsWith('/wallet') ||
|
||||
p.startsWith('/profile')
|
||||
p === '/profile/cashbacks'
|
||||
) {
|
||||
return 'account';
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ const activeTab = computed(() => {
|
||||
<div class="nav-right">
|
||||
<LocaleSwitcher />
|
||||
<template v-if="auth.user">
|
||||
<CashBalanceChip />
|
||||
<CashBalanceChip hide-avatar />
|
||||
<UserAvatarMenu />
|
||||
</template>
|
||||
<div v-else class="auth-buttons">
|
||||
@@ -114,7 +114,7 @@ const activeTab = computed(() => {
|
||||
height: 38px;
|
||||
width: auto;
|
||||
display: block;
|
||||
filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.2));
|
||||
filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
|
||||
}
|
||||
|
||||
.site-name {
|
||||
@@ -125,7 +125,7 @@ const activeTab = computed(() => {
|
||||
background: var(--gradient-gold);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
text-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
|
||||
text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ const activeTab = computed(() => {
|
||||
height: 3px;
|
||||
background: var(--primary);
|
||||
border-radius: 3px 3px 0 0;
|
||||
box-shadow: 0 -1px 8px rgba(212, 175, 55, 0.5);
|
||||
box-shadow: 0 -1px 8px rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.badge {
|
||||
@@ -204,7 +204,7 @@ const activeTab = computed(() => {
|
||||
padding: 6px 18px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.05);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
@@ -212,14 +212,14 @@ const activeTab = computed(() => {
|
||||
}
|
||||
|
||||
.login-btn:hover {
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
.register-btn {
|
||||
padding: 7px 18px;
|
||||
border-radius: 4px;
|
||||
background: linear-gradient(180deg, #F0D875 0%, #D4AF37 100%);
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: #3D2800;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
|
||||
@@ -1,293 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import api from '../../api';
|
||||
import GoldSpinner from '../GoldSpinner.vue';
|
||||
import { formatMoney } from '../../utils/localeDisplay';
|
||||
import { txTypeKey, txDisplayType, txSummaryLabel } from '../../utils/walletTx';
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
transactionId: string | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:visible': [value: boolean];
|
||||
}>();
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
type TxDetail = {
|
||||
transactionId: string;
|
||||
transactionType: string;
|
||||
displayType?: string;
|
||||
summary?: string | null;
|
||||
amount: string;
|
||||
balanceBefore?: string;
|
||||
balanceAfter?: string;
|
||||
frozenBefore?: string;
|
||||
frozenAfter?: string;
|
||||
createdAt: string;
|
||||
referenceType?: string | null;
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
const detail = ref<TxDetail | null>(null);
|
||||
const loading = ref(true);
|
||||
const error = ref(false);
|
||||
|
||||
async function loadDetail(id: string) {
|
||||
loading.value = true;
|
||||
error.value = false;
|
||||
detail.value = null;
|
||||
try {
|
||||
const { data } = await api.get(`/player/wallet/transactions/${id}`);
|
||||
detail.value = data.data ?? null;
|
||||
} catch {
|
||||
error.value = true;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [props.visible, props.transactionId] as const,
|
||||
([vis, id]) => {
|
||||
if (vis && id) loadDetail(id);
|
||||
if (!vis) {
|
||||
detail.value = null;
|
||||
error.value = false;
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
|
||||
function txLabel(tx: TxDetail): string {
|
||||
const key = txTypeKey(txDisplayType(tx));
|
||||
if (key) {
|
||||
const translated = t(key);
|
||||
if (translated !== key) return translated;
|
||||
}
|
||||
return tx.transactionType;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<Transition name="modal-fade">
|
||||
<div v-if="visible" class="modal-overlay" @click.self="close">
|
||||
<div class="modal-container" role="dialog" aria-modal="true">
|
||||
<div class="modal-header">
|
||||
<span class="modal-title">{{ t('wallet.transaction_detail') }}</span>
|
||||
<button type="button" class="modal-close" @click="close">✕</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div v-if="loading" class="modal-loading">
|
||||
<GoldSpinner :size="32" />
|
||||
</div>
|
||||
|
||||
<div v-else-if="error" class="modal-error">
|
||||
<p>{{ t('common.load_failed') }}</p>
|
||||
<button v-if="transactionId" type="button" class="retry-btn" @click="loadDetail(transactionId)">{{ t('common.retry') }}</button>
|
||||
</div>
|
||||
|
||||
<template v-else-if="detail">
|
||||
<div class="info-rows">
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('wallet.type') }}</span>
|
||||
<span class="row-val">{{ txLabel(detail) }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('wallet.amount') }}</span>
|
||||
<span class="row-val mono" :class="parseFloat(detail.amount) >= 0 ? 'pos' : 'neg'">{{ formatMoney(detail.amount, locale) }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('wallet.note') }}</span>
|
||||
<span class="row-val">{{ txSummaryLabel(detail, t) || '-' }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('wallet.balance_before') }}</span>
|
||||
<span class="row-val mono">{{ formatMoney(detail.balanceBefore, locale) }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('wallet.balance_after') }}</span>
|
||||
<span class="row-val mono">{{ formatMoney(detail.balanceAfter, locale) }}</span>
|
||||
</div>
|
||||
<div v-if="parseFloat(detail.frozenBefore || '0') > 0 || parseFloat(detail.frozenAfter || '0') > 0" class="info-row">
|
||||
<span class="row-label">{{ t('wallet.frozen_before') }}</span>
|
||||
<span class="row-val mono">{{ formatMoney(detail.frozenBefore, locale) }}</span>
|
||||
</div>
|
||||
<div v-if="parseFloat(detail.frozenBefore || '0') > 0 || parseFloat(detail.frozenAfter || '0') > 0" class="info-row">
|
||||
<span class="row-label">{{ t('wallet.frozen_after') }}</span>
|
||||
<span class="row-val mono">{{ formatMoney(detail.frozenAfter, locale) }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('wallet.time') }}</span>
|
||||
<span class="row-val muted">{{ new Date(detail.createdAt).toLocaleString() }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="row-label">{{ t('wallet.transaction_id') }}</span>
|
||||
<span class="row-val mono muted">{{ detail.transactionId }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-else class="modal-empty">{{ t('common.not_found') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.modal-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1100;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
|
||||
.modal-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 460px;
|
||||
max-height: 80vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px 22px 22px;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent 36%),
|
||||
rgba(14, 14, 12, 0.96);
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2px 0 12px;
|
||||
border-bottom: 1px solid rgba(212, 175, 55, 0.16);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-muted);
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
padding: 0 4px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.modal-close:hover { color: var(--text); }
|
||||
|
||||
.modal-body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.modal-loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 48px 0;
|
||||
}
|
||||
|
||||
.modal-error {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 48px 20px;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.retry-btn {
|
||||
padding: 6px 18px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-gold-soft, rgba(212,175,55,0.25));
|
||||
background: transparent;
|
||||
color: var(--primary-light, #F0D875);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48px 20px;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* Info rows */
|
||||
.info-rows { }
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 10px 16px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.info-row:last-child { border-bottom: none; }
|
||||
|
||||
.row-label {
|
||||
width: 100px;
|
||||
flex-shrink: 0;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.row-val {
|
||||
flex: 1;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.row-val.pos { color: var(--primary-light, #F0D875); }
|
||||
.row-val.neg { color: var(--danger, #FF453A); }
|
||||
.row-val.muted { color: var(--text-muted); font-weight: 500; }
|
||||
|
||||
.mono { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; }
|
||||
|
||||
/* Transition */
|
||||
.modal-fade-enter-active,
|
||||
.modal-fade-leave-active {
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.modal-fade-enter-from,
|
||||
.modal-fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -197,7 +197,7 @@ const handleLeagueClick = (leagueId: string) => {
|
||||
|
||||
.sidebar-search-input {
|
||||
width: 100%;
|
||||
background: #0d0d0d !important;
|
||||
background: #002244 !important;
|
||||
border: 1px solid var(--border) !important;
|
||||
color: var(--text);
|
||||
padding: 6px 10px;
|
||||
@@ -207,7 +207,7 @@ const handleLeagueClick = (leagueId: string) => {
|
||||
|
||||
.sidebar-search-input:focus {
|
||||
border-color: var(--border-gold-soft) !important;
|
||||
box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1) !important;
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
.sidebar-section {
|
||||
@@ -231,7 +231,7 @@ const handleLeagueClick = (leagueId: string) => {
|
||||
|
||||
.time-btn {
|
||||
flex: 1;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
padding: 5px 2px;
|
||||
@@ -248,7 +248,7 @@ const handleLeagueClick = (leagueId: string) => {
|
||||
}
|
||||
|
||||
.time-btn.active {
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: var(--primary);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ const handleLeagueClick = (leagueId: string) => {
|
||||
}
|
||||
|
||||
.league-item.active {
|
||||
background: rgba(212, 175, 55, 0.04);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
@@ -310,7 +310,7 @@ const handleLeagueClick = (leagueId: string) => {
|
||||
border-radius: 2px;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
background: #0d0d0d;
|
||||
background: #002244;
|
||||
}
|
||||
|
||||
.checkbox.checked {
|
||||
@@ -325,7 +325,7 @@ const handleLeagueClick = (leagueId: string) => {
|
||||
left: 4px;
|
||||
width: 3px;
|
||||
height: 6px;
|
||||
border: solid #111;
|
||||
border: solid #001A33;
|
||||
border-width: 0 2px 2px 0;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ watch(currentMatchId, scrollToActive);
|
||||
|
||||
.sidebar-search-input {
|
||||
width: 100%;
|
||||
background: #0d0d0d !important;
|
||||
background: #002244 !important;
|
||||
border: 1px solid var(--border) !important;
|
||||
color: var(--text);
|
||||
padding: 6px 10px;
|
||||
@@ -171,7 +171,7 @@ watch(currentMatchId, scrollToActive);
|
||||
|
||||
.sidebar-search-input:focus {
|
||||
border-color: var(--border-gold-soft) !important;
|
||||
box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1) !important;
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
.sidebar-section {
|
||||
@@ -201,7 +201,7 @@ watch(currentMatchId, scrollToActive);
|
||||
|
||||
.time-btn {
|
||||
flex: 1;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
padding: 5px 2px;
|
||||
@@ -218,7 +218,7 @@ watch(currentMatchId, scrollToActive);
|
||||
}
|
||||
|
||||
.time-btn.active {
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: var(--primary);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
@@ -324,7 +324,7 @@ watch(currentMatchId, scrollToActive);
|
||||
.matches-list :deep(.match-card) {
|
||||
padding: 10px 8px;
|
||||
min-height: unset;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
gap: 6px;
|
||||
@@ -337,7 +337,7 @@ watch(currentMatchId, scrollToActive);
|
||||
|
||||
.matches-list :deep(.match-card.active) {
|
||||
border-color: var(--primary) !important;
|
||||
background: rgba(212, 175, 55, 0.08) !important;
|
||||
box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
|
||||
background: rgba(255, 255, 255, 0.08) !important;
|
||||
box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -126,7 +126,7 @@ watch(currentOutrightId, scrollToActive);
|
||||
|
||||
.sidebar-search-input {
|
||||
width: 100%;
|
||||
background: #0d0d0d !important;
|
||||
background: #002244 !important;
|
||||
border: 1px solid var(--border) !important;
|
||||
color: var(--text);
|
||||
padding: 6px 10px;
|
||||
@@ -136,7 +136,7 @@ watch(currentOutrightId, scrollToActive);
|
||||
|
||||
.sidebar-search-input:focus {
|
||||
border-color: var(--border-gold-soft) !important;
|
||||
box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1) !important;
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
.sidebar-section {
|
||||
@@ -188,7 +188,7 @@ watch(currentOutrightId, scrollToActive);
|
||||
|
||||
.outright-card {
|
||||
padding: 12px 10px;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
@@ -205,8 +205,8 @@ watch(currentOutrightId, scrollToActive);
|
||||
|
||||
.outright-card.active {
|
||||
border-color: var(--primary) !important;
|
||||
background: rgba(212, 175, 55, 0.08) !important;
|
||||
box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
|
||||
background: rgba(255, 255, 255, 0.08) !important;
|
||||
box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
@@ -251,15 +251,15 @@ watch(currentOutrightId, scrollToActive);
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 700;
|
||||
background: #1e1e1e;
|
||||
background: #0A2540;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
.outright-card.active .selections-badge {
|
||||
background: rgba(212, 175, 55, 0.15);
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
color: var(--primary-light);
|
||||
border-color: rgba(212, 175, 55, 0.3);
|
||||
border-color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -120,7 +120,7 @@ function onPageSizeChange(e: Event) {
|
||||
align-items: center;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border);
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
@@ -131,13 +131,13 @@ function onPageSizeChange(e: Event) {
|
||||
.page-btn:hover:not(:disabled) {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
background: rgba(212, 175, 55, 0.05);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.page-btn.active {
|
||||
background: var(--primary);
|
||||
border-color: var(--primary);
|
||||
color: #111;
|
||||
color: #001A33;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ function onPageSizeChange(e: Event) {
|
||||
|
||||
.page-size-select {
|
||||
height: 32px;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
border-radius: 6px;
|
||||
|
||||
@@ -78,9 +78,9 @@ function selectSport(id: SportCategory, enabled: boolean) {
|
||||
|
||||
.sport-category.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: var(--border-gold-soft);
|
||||
box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.08);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.sport-category.disabled {
|
||||
|
||||
@@ -103,11 +103,11 @@ function formatOdds(odds: string) {
|
||||
}
|
||||
|
||||
.drawer {
|
||||
background: linear-gradient(180deg, #222 0%, #141414 100%);
|
||||
background: var(--gradient-card);
|
||||
width: 100%;
|
||||
max-height: 80vh;
|
||||
border-radius: 16px 16px 0 0;
|
||||
border-top: 1px solid var(--border);
|
||||
border-top: 1px solid var(--border-gold-soft);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
@@ -118,12 +118,13 @@ function formatOdds(odds: string) {
|
||||
overflow-y: auto;
|
||||
padding: 10px 14px 0;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.drawer-foot {
|
||||
flex-shrink: 0;
|
||||
padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
|
||||
background: rgba(14, 14, 14, 0.98);
|
||||
background: var(--bg-card);
|
||||
border-top: 1px solid var(--border-gold-soft);
|
||||
box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
@@ -134,8 +135,8 @@ function formatOdds(odds: string) {
|
||||
align-items: center;
|
||||
padding: 14px 14px 12px;
|
||||
flex-shrink: 0;
|
||||
background: rgba(14, 14, 14, 0.98);
|
||||
border-bottom: 1px solid #2a2a2a;
|
||||
background: var(--bg-elevated);
|
||||
border-bottom: 1px solid var(--border);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@@ -157,9 +158,9 @@ function formatOdds(odds: string) {
|
||||
|
||||
.slip-item {
|
||||
padding: 10px 12px;
|
||||
background: #111;
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,14 +129,16 @@ function formatOdds(odds: string) {
|
||||
gap: 3px;
|
||||
min-height: 42px;
|
||||
padding: 6px 3px;
|
||||
background: url('../../assets/images/generated/odds-button-normal-v1.webp') center / 100% 100% no-repeat;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: #161616;
|
||||
border: 1px solid #282828;
|
||||
border-radius: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.score-card.selected {
|
||||
background-image: url('../../assets/images/generated/odds-button-selected-v1.webp');
|
||||
border-color: var(--primary);
|
||||
background: #2d281a;
|
||||
box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.35), 0 0 0 1px rgba(212, 175, 55, 0.2);
|
||||
}
|
||||
|
||||
.score-card.selected .score-line {
|
||||
@@ -148,7 +150,8 @@ function formatOdds(odds: string) {
|
||||
}
|
||||
|
||||
.score-card--locked {
|
||||
background-image: url('../../assets/images/generated/odds-button-disabled-v1.webp');
|
||||
background: #111;
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
.score-card--locked .score-line,
|
||||
|
||||
@@ -83,7 +83,7 @@ const panelStyle = computed(() =>
|
||||
<style scoped>
|
||||
.wrap {
|
||||
padding: 6px 8px 8px;
|
||||
background: #0c0c0c;
|
||||
background: var(--bg-input);
|
||||
}
|
||||
|
||||
.wrap.compact {
|
||||
@@ -188,36 +188,41 @@ const panelStyle = computed(() =>
|
||||
gap: 2px;
|
||||
min-height: 44px;
|
||||
padding: 6px 4px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/odds-button-normal-v1.webp') center / 100% 100% no-repeat;
|
||||
border-radius: 4px;
|
||||
background: var(--gradient-card-soft);
|
||||
border: 1px solid var(--border);
|
||||
text-align: center;
|
||||
transition: border-color 0.15s, background 0.15s;
|
||||
}
|
||||
|
||||
.odds-btn:hover:not(.odds-btn--locked) {
|
||||
filter: brightness(1.12);
|
||||
border-color: var(--border-strong);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.odds-btn.selected {
|
||||
background-image: url('../../assets/images/generated/odds-button-selected-v1.webp');
|
||||
border-color: var(--border-strong);
|
||||
background: var(--surface-active);
|
||||
box-shadow: inset 0 0 0 1px var(--border-gold);
|
||||
}
|
||||
|
||||
.odds-btn.selected .label {
|
||||
color: #e8d48a;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.odds-btn.selected .odds {
|
||||
color: #ffffff;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.odds-btn--locked {
|
||||
background-image: url('../../assets/images/generated/odds-button-disabled-v1.webp');
|
||||
background: var(--bg-body);
|
||||
border-color: var(--border);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.odds-btn--locked .label,
|
||||
.odds-btn--locked .odds {
|
||||
color: #666;
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.label {
|
||||
@@ -229,6 +234,6 @@ const panelStyle = computed(() =>
|
||||
.odds {
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
color: #ffffff;
|
||||
color: var(--text);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,31 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
defineProps<{
|
||||
label: string;
|
||||
promoLabel?: string;
|
||||
statusLabel?: string;
|
||||
expanded: boolean;
|
||||
hasMarket: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{ toggle: [] }>();
|
||||
const { t } = useI18n();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
type="button"
|
||||
class="row"
|
||||
:class="{ expanded, disabled: !hasMarket }"
|
||||
:disabled="!hasMarket"
|
||||
@click="emit('toggle')"
|
||||
>
|
||||
<div class="row">
|
||||
<span class="row-label">{{ label }}</span>
|
||||
<span v-if="promoLabel" class="row-promo">{{ promoLabel }}</span>
|
||||
<span v-if="statusLabel" class="row-status">{{ statusLabel }}</span>
|
||||
<span v-else-if="!hasMarket" class="row-muted">{{ t('bet.market_closed') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -35,24 +21,14 @@ const { t } = useI18n();
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
padding: 13px 12px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
text-align: left;
|
||||
transition: background 0.15s ease;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.row:not(.disabled):active {
|
||||
background: rgba(255, 255, 255, 0.025);
|
||||
}
|
||||
|
||||
.row.expanded {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
.row.expanded::before {
|
||||
.row::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -63,16 +39,12 @@ const { t } = useI18n();
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.row.disabled {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.row-label {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
@@ -80,11 +52,11 @@ const { t } = useI18n();
|
||||
flex-shrink: 0;
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
color: #ffb800;
|
||||
color: var(--primary-light);
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
background: rgba(255, 184, 0, 0.12);
|
||||
border: 1px solid rgba(255, 184, 0, 0.35);
|
||||
background: var(--surface-accent);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.row-status {
|
||||
@@ -97,14 +69,4 @@ const { t } = useI18n();
|
||||
background: rgba(240, 180, 41, 0.12);
|
||||
border: 1px solid rgba(240, 180, 41, 0.35);
|
||||
}
|
||||
|
||||
.row.expanded .row-label {
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.row-muted {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,8 +6,6 @@ import { usePlayerProfile } from '../../composables/usePlayerProfile';
|
||||
import { formatMoney, parseAmount } from '../../utils/localeDisplay';
|
||||
import { teamFlagUrl } from '../../utils/teamFlag';
|
||||
import BetSuccessOverlay from '../BetSuccessOverlay.vue';
|
||||
import ConfirmDialog from '../ConfirmDialog.vue';
|
||||
import { buildBetPlaceConfirmMessage } from '../../utils/betPlaceConfirmMessage';
|
||||
|
||||
export interface OutrightPick {
|
||||
selectionId: string;
|
||||
@@ -53,8 +51,6 @@ const balance = ref(0);
|
||||
const successBalance = ref(0);
|
||||
const successStake = ref(0);
|
||||
const showSuccess = ref(false);
|
||||
const showPlaceConfirm = ref(false);
|
||||
const placeConfirmMessage = ref('');
|
||||
const currentOdds = ref('');
|
||||
const currentOddsVersion = ref('');
|
||||
const oddsDelta = ref<OddsDelta | null>(null);
|
||||
@@ -213,54 +209,19 @@ function setMaxStake() {
|
||||
if (balance.value > 0) setStake(balance.value);
|
||||
}
|
||||
|
||||
function validateSubmit(): boolean {
|
||||
if (!props.pick || stake.value <= 0) return false;
|
||||
async function submit() {
|
||||
if (!props.pick || stake.value <= 0) return;
|
||||
if (stake.value > balance.value) {
|
||||
error.value = t('bet.outright_insufficient');
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
if (hasSuspendedSelection.value) {
|
||||
error.value = t('bet.odds_suspended');
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function onSubmitClick() {
|
||||
if (!props.pick) return;
|
||||
if (!validateSubmit()) return;
|
||||
if (hasPendingOddsChanges.value) {
|
||||
acceptPendingOdds();
|
||||
}
|
||||
placeConfirmMessage.value = buildBetPlaceConfirmMessage(t, {
|
||||
mode: 'single',
|
||||
items: [
|
||||
{
|
||||
selectionId: props.pick.selectionId,
|
||||
oddsVersion: currentOddsVersion.value,
|
||||
matchId: '',
|
||||
matchName: props.pick.eventTitle,
|
||||
marketId: '',
|
||||
marketName: props.pick.eventTitle,
|
||||
selectionName: `${props.pick.teamName} - ${props.pick.eventTitle}`,
|
||||
odds: oddsNum.value,
|
||||
marketType: 'OUTRIGHT',
|
||||
lineValue: null,
|
||||
allowSingle: true,
|
||||
allowParlay: false,
|
||||
},
|
||||
],
|
||||
totalStake: stake.value,
|
||||
totalReturn: estReturn.value,
|
||||
formatMoney: (amount) => formatMoney(amount, locale.value),
|
||||
getStake: () => stake.value,
|
||||
getOdds: () => oddsNum.value,
|
||||
});
|
||||
showPlaceConfirm.value = true;
|
||||
}
|
||||
|
||||
async function executeSubmit() {
|
||||
if (!props.pick || stake.value <= 0) return;
|
||||
|
||||
loading.value = true;
|
||||
error.value = '';
|
||||
@@ -290,11 +251,6 @@ async function executeSubmit() {
|
||||
}
|
||||
}
|
||||
|
||||
async function confirmSubmit() {
|
||||
showPlaceConfirm.value = false;
|
||||
await executeSubmit();
|
||||
}
|
||||
|
||||
function formatOdds(odds: string) {
|
||||
const n = parseFloat(odds);
|
||||
return Number.isFinite(n) ? n.toFixed(2) : odds;
|
||||
@@ -304,7 +260,7 @@ function formatOdds(odds: string) {
|
||||
<template>
|
||||
<div v-if="open && pick" class="overlay" @click.self="close">
|
||||
<div class="modal" role="dialog" aria-modal="true">
|
||||
<button type="button" class="close-x" :aria-label="t('bet.cancel')" @click="close">✕</button>
|
||||
<button type="button" class="close-x" :aria-label="t('bet.cancel')" @click="close">✕</button>
|
||||
|
||||
<template v-if="step === 'form'">
|
||||
<p class="hint">{{ t('bet.outright_enter_stake') }}</p>
|
||||
@@ -321,7 +277,7 @@ function formatOdds(odds: string) {
|
||||
}"
|
||||
>
|
||||
<template v-if="oddsDelta && !oddsDelta.suspended">
|
||||
@ {{ oddsDelta.oldOdds.toFixed(2) }} -> {{ oddsDelta.newOdds.toFixed(2) }}
|
||||
@ {{ oddsDelta.oldOdds.toFixed(2) }} → {{ oddsDelta.newOdds.toFixed(2) }}
|
||||
</template>
|
||||
<template v-else>
|
||||
@ {{ formatOdds(currentOdds || pick.odds) }}
|
||||
@@ -357,7 +313,7 @@ function formatOdds(odds: string) {
|
||||
</div>
|
||||
|
||||
<p class="est-return">
|
||||
{{ t('history.est_return') }}: <span class="est-value">{{ estReturnText }}</span>
|
||||
{{ t('history.est_return') }}:<span class="est-value">{{ estReturnText }}</span>
|
||||
</p>
|
||||
|
||||
<p v-if="error" class="error">{{ error }}</p>
|
||||
@@ -368,9 +324,9 @@ function formatOdds(odds: string) {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-confirm"
|
||||
class="btn-confirm btn-gold-outline"
|
||||
:disabled="loading || stake <= 0 || hasSuspendedSelection"
|
||||
@click="onSubmitClick"
|
||||
@click="submit"
|
||||
>
|
||||
{{ submitButtonLabel }}
|
||||
</button>
|
||||
@@ -378,7 +334,7 @@ function formatOdds(odds: string) {
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div class="success-icon">✓</div>
|
||||
<div class="success-icon">✓</div>
|
||||
<h3 class="success-title">{{ t('bet.outright_success') }}</h3>
|
||||
|
||||
<div class="hero hero--compact">
|
||||
@@ -400,7 +356,7 @@ function formatOdds(odds: string) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn-done" @click="close">
|
||||
<button type="button" class="btn-done btn-gold-outline" @click="close">
|
||||
{{ t('bet.outright_done') }}
|
||||
</button>
|
||||
</template>
|
||||
@@ -408,16 +364,6 @@ function formatOdds(odds: string) {
|
||||
</div>
|
||||
|
||||
<BetSuccessOverlay :show="showSuccess" @done="showSuccess = false" />
|
||||
|
||||
<ConfirmDialog
|
||||
v-model:visible="showPlaceConfirm"
|
||||
:title="t('bet.place_confirm_title')"
|
||||
:message="placeConfirmMessage"
|
||||
:confirm-text="t('bet.place_bet')"
|
||||
:cancel-text="t('common.cancel')"
|
||||
:loading="loading"
|
||||
@confirm="confirmSubmit"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -437,32 +383,27 @@ function formatOdds(odds: string) {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
background: url('../../assets/images/generated/outright-bet-modal-frame-v2.webp') center / 100% 100% no-repeat;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
padding: 30px 24px 24px;
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: var(--radius);
|
||||
padding: 18px 16px 16px;
|
||||
text-align: center;
|
||||
box-shadow: none;
|
||||
box-shadow: var(--shadow), var(--glow-gold);
|
||||
}
|
||||
|
||||
.close-x {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/modal-close-gold-v1.webp') center / contain no-repeat;
|
||||
color: transparent;
|
||||
font-size: 0;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.close-x:active {
|
||||
background-image: url('../../assets/images/generated/modal-close-gold-pressed-v1.webp');
|
||||
}
|
||||
|
||||
.hint {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
@@ -502,9 +443,9 @@ function formatOdds(odds: string) {
|
||||
.odds-badge {
|
||||
display: inline-block;
|
||||
padding: 3px 10px;
|
||||
background: rgba(198, 40, 40, 0.85);
|
||||
border: 1px solid rgba(255, 120, 120, 0.35);
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
border-radius: 4px;
|
||||
@@ -550,9 +491,9 @@ function formatOdds(odds: string) {
|
||||
align-items: center;
|
||||
padding: 8px 10px;
|
||||
margin-bottom: 12px;
|
||||
background: rgba(0, 0, 0, 0.35);
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.balance-label {
|
||||
@@ -580,9 +521,9 @@ function formatOdds(odds: string) {
|
||||
width: 100%;
|
||||
padding: 11px 12px;
|
||||
margin-bottom: 8px;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border);
|
||||
background: #0a0a0a;
|
||||
background: var(--bg-body);
|
||||
color: var(--text);
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
@@ -592,13 +533,14 @@ function formatOdds(odds: string) {
|
||||
|
||||
.stake-input:focus {
|
||||
border-color: var(--border-gold-soft);
|
||||
box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.15);
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.stake-input::placeholder {
|
||||
color: #555;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.quick-stakes {
|
||||
@@ -610,9 +552,9 @@ function formatOdds(odds: string) {
|
||||
.chip {
|
||||
flex: 1;
|
||||
padding: 6px 4px;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border);
|
||||
background: #141414;
|
||||
background: var(--bg-card);
|
||||
color: var(--text-muted);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
@@ -621,7 +563,7 @@ function formatOdds(odds: string) {
|
||||
.chip:active {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: var(--surface-accent);
|
||||
}
|
||||
|
||||
.est-return {
|
||||
@@ -649,36 +591,22 @@ function formatOdds(odds: string) {
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
height: 46px;
|
||||
padding: 10px 12px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/pc-betslip-btn-secondary-v1.webp') center / 100% 100% no-repeat;
|
||||
padding: 10px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.btn-cancel:active {
|
||||
background-image: url('../../assets/images/generated/pc-betslip-btn-secondary-pressed-v1.webp');
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
height: 46px;
|
||||
padding: 10px 12px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/pc-betslip-btn-primary-v1.webp') center / 100% 100% no-repeat;
|
||||
color: #100d04;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.btn-confirm:active {
|
||||
background-image: url('../../assets/images/generated/pc-betslip-btn-primary-pressed-v1.webp');
|
||||
}
|
||||
|
||||
.btn-cancel:disabled,
|
||||
.btn-confirm:disabled {
|
||||
opacity: 0.45;
|
||||
}
|
||||
@@ -688,9 +616,9 @@ function formatOdds(odds: string) {
|
||||
height: 44px;
|
||||
margin: 0 auto 8px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid rgba(46, 158, 94, 0.8);
|
||||
background: rgba(46, 158, 94, 0.12);
|
||||
color: #4ade80;
|
||||
border: 2px solid var(--success);
|
||||
background: rgba(46, 204, 113, 0.12);
|
||||
color: var(--success);
|
||||
font-size: 24px;
|
||||
font-weight: 900;
|
||||
line-height: 40px;
|
||||
@@ -706,9 +634,9 @@ function formatOdds(odds: string) {
|
||||
.summary {
|
||||
margin: 12px 0 14px;
|
||||
padding: 10px;
|
||||
background: rgba(0, 0, 0, 0.35);
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.summary-row {
|
||||
@@ -727,17 +655,9 @@ function formatOdds(odds: string) {
|
||||
|
||||
.btn-done {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
padding: 11px 12px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/pc-betslip-btn-primary-v1.webp') center / 100% 100% no-repeat;
|
||||
color: #100d04;
|
||||
padding: 11px;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.btn-done:active {
|
||||
background-image: url('../../assets/images/generated/pc-betslip-btn-primary-pressed-v1.webp');
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import OutrightOptionCard from './OutrightOptionCard.vue';
|
||||
import saishiImg from '../../assets/images/generated/saishi-gold-trophy-v1.webp';
|
||||
import cardBg from '../../assets/images/generated/pc-match-list-card-bg-v1.webp';
|
||||
import saishiImg from '../../assets/images/saishi.webp';
|
||||
import cardBg from '../../assets/images/card-bg.webp';
|
||||
|
||||
const matchCardBg = `url(${cardBg})`;
|
||||
|
||||
@@ -55,7 +55,7 @@ const isSettled = computed(() => props.event.bettingOpen === false || props.even
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="event-block">
|
||||
<section class="event-block" :class="{ expanded }">
|
||||
<button type="button" class="event-head" :class="{ 'is-expanded': expanded, 'is-settled': isSettled }" :aria-expanded="expanded" @click="emit('toggle')">
|
||||
<span class="toggle-icon" :class="{ open: expanded }">
|
||||
<span class="toggle-mark">{{ expanded ? '−' : '+' }}</span>
|
||||
@@ -110,7 +110,7 @@ const isSettled = computed(() => props.event.bettingOpen === false || props.even
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 12px 16px;
|
||||
background: none;
|
||||
background: var(--bg-elevated);
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
text-align: left;
|
||||
@@ -132,7 +132,7 @@ const isSettled = computed(() => props.event.bettingOpen === false || props.even
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 50%;
|
||||
background: #141414;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -170,8 +170,8 @@ const isSettled = computed(() => props.event.bettingOpen === false || props.even
|
||||
flex-shrink: 0;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
color: #c9a227;
|
||||
border: 1px solid rgba(201, 162, 39, 0.45);
|
||||
color: var(--primary-light);
|
||||
border: 1px solid color-mix(in srgb, var(--primary-light) 45%, transparent);
|
||||
border-radius: 999px;
|
||||
padding: 1px 7px;
|
||||
line-height: 1.4;
|
||||
@@ -187,14 +187,15 @@ const isSettled = computed(() => props.event.bettingOpen === false || props.even
|
||||
.event-league {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.event-meta {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #666;
|
||||
color: var(--text-muted);
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.event-saishi {
|
||||
@@ -204,16 +205,17 @@ const isSettled = computed(() => props.event.bettingOpen === false || props.even
|
||||
max-width: 40px;
|
||||
object-fit: contain;
|
||||
padding-left: 8px;
|
||||
border-left: 1px solid #2a2a2a;
|
||||
border-left: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.options-scroll {
|
||||
max-height: 408px;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 8px 2px 2px;
|
||||
padding: 12px 8px 8px;
|
||||
background: var(--bg-card);
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #333 transparent;
|
||||
scrollbar-color: var(--border) transparent;
|
||||
}
|
||||
|
||||
.options-grid {
|
||||
|
||||
@@ -9,7 +9,6 @@ const props = defineProps<{
|
||||
logoUrl?: string | null;
|
||||
disabled?: boolean;
|
||||
isWinner?: boolean;
|
||||
selectionId?: string;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{ pick: [] }>();
|
||||
@@ -64,7 +63,6 @@ onUnmounted(() => {
|
||||
type="button"
|
||||
class="option-card"
|
||||
:class="{ 'option-card--disabled': disabled, 'option-card--winner': isWinner }"
|
||||
:data-bet-selection-id="selectionId || undefined"
|
||||
:disabled="disabled"
|
||||
@click="emit('pick')"
|
||||
>
|
||||
@@ -87,9 +85,9 @@ onUnmounted(() => {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding: 8px 4px 6px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/odds-button-normal-v1.webp') center / 100% 100% no-repeat;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -99,11 +97,15 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.option-card::before {
|
||||
display: none;
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 50%, rgba(0, 51, 102, 0.08) 100%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.option-card:active {
|
||||
filter: brightness(1.12);
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.option-card--disabled {
|
||||
@@ -112,15 +114,12 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.option-card--disabled:active {
|
||||
filter: none;
|
||||
border-color: var(--border);
|
||||
}
|
||||
|
||||
.option-card--winner {
|
||||
background-image: url('../../assets/images/generated/odds-button-selected-v1.webp');
|
||||
}
|
||||
|
||||
.option-card--disabled {
|
||||
background-image: url('../../assets/images/generated/odds-button-disabled-v1.webp');
|
||||
border-color: color-mix(in srgb, var(--primary-light) 75%, transparent);
|
||||
box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary-light) 25%, transparent);
|
||||
}
|
||||
|
||||
.flag {
|
||||
@@ -154,6 +153,6 @@ onUnmounted(() => {
|
||||
.odds {
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
color: #ffffff;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import api from '../../api';
|
||||
import OutrightEventSection, {
|
||||
type OutrightEvent,
|
||||
type OutrightSelection,
|
||||
} from './OutrightEventSection.vue';
|
||||
import OutrightBetModal, { type OutrightPick } from './OutrightBetModal.vue';
|
||||
import { useAuthStore } from '../../stores/auth';
|
||||
import emptyMatchesImg from '../../assets/images/generated/empty-matches-stadium-v1.webp';
|
||||
import emptyMatchesImg from '../../assets/images/empty-matches.svg';
|
||||
import GoldSpinner from '../../components/GoldSpinner.vue';
|
||||
import { useOutrightEvents } from '../../composables/useOutrightEvents';
|
||||
import { useOnLocaleChange } from '../../composables/useOnLocaleChange';
|
||||
|
||||
const props = defineProps<{
|
||||
activated?: boolean;
|
||||
@@ -17,12 +18,14 @@ const props = defineProps<{
|
||||
|
||||
const { t } = useI18n();
|
||||
const auth = useAuthStore();
|
||||
const { loading, loadError, events, load } = useOutrightEvents();
|
||||
|
||||
function goLogin() {
|
||||
auth.showLoginPrompt('/bet');
|
||||
}
|
||||
|
||||
const loading = ref(true);
|
||||
const loadError = ref('');
|
||||
const events = ref<OutrightEvent[]>([]);
|
||||
const expanded = ref<Set<string>>(new Set());
|
||||
const modalOpen = ref(false);
|
||||
const activePick = ref<OutrightPick | null>(null);
|
||||
@@ -34,6 +37,7 @@ const totalSelections = computed(() =>
|
||||
|
||||
function syncExpandedAfterLoad() {
|
||||
const ids = events.value.map((e) => e.id);
|
||||
// 只保留仍然存在的 id,且最多保留 1 个
|
||||
const kept = [...expanded.value].filter((id) => ids.includes(id));
|
||||
if (kept.length > 0) {
|
||||
expanded.value = new Set([kept[0]]);
|
||||
@@ -46,18 +50,59 @@ function syncExpandedAfterLoad() {
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => events.value.length,
|
||||
(len, prev) => {
|
||||
if (len > 0 && prev === 0) syncExpandedAfterLoad();
|
||||
},
|
||||
);
|
||||
async function load() {
|
||||
const hadData = events.value.length > 0;
|
||||
if (!hadData) loading.value = true;
|
||||
loadError.value = '';
|
||||
try {
|
||||
const { data } = await api.get('/player/outrights');
|
||||
const list = (data?.data ?? []) as OutrightEvent[];
|
||||
const fresh = list.filter((e) => e.selections?.length > 0);
|
||||
if (!hadData) {
|
||||
events.value = fresh;
|
||||
syncExpandedAfterLoad();
|
||||
} else {
|
||||
mergeOddsOnly(fresh);
|
||||
}
|
||||
} catch (e: unknown) {
|
||||
if (!hadData) events.value = [];
|
||||
const err = e as { response?: { status?: number; data?: { error?: string } } };
|
||||
if (err.response?.status === 403) {
|
||||
loadError.value = t('bet.outright_player_only');
|
||||
} else {
|
||||
loadError.value = err.response?.data?.error ?? t('bet.outright_load_failed');
|
||||
}
|
||||
} finally {
|
||||
if (!hadData) loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function mergeOddsOnly(fresh: OutrightEvent[]) {
|
||||
const freshMap = new Map<string, OutrightEvent>();
|
||||
for (const e of fresh) freshMap.set(e.id, e);
|
||||
|
||||
for (const event of events.value) {
|
||||
const freshEvent = freshMap.get(event.id);
|
||||
if (!freshEvent) continue;
|
||||
const selMap = new Map<string, OutrightSelection>();
|
||||
for (const s of freshEvent.selections) selMap.set(s.id, s);
|
||||
for (const sel of event.selections) {
|
||||
const fs = selMap.get(sel.id);
|
||||
if (fs) {
|
||||
sel.odds = fs.odds;
|
||||
sel.oddsVersion = fs.oddsVersion;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
useOnLocaleChange(load);
|
||||
|
||||
// 每次切回优胜冠军 Tab 时静默刷新赔率
|
||||
watch(
|
||||
() => props.activated,
|
||||
(active) => {
|
||||
if (active && events.value.length > 0) void load({ silent: true });
|
||||
if (active && events.value.length > 0) void load();
|
||||
},
|
||||
);
|
||||
|
||||
@@ -129,7 +174,7 @@ function closeModal() {
|
||||
|
||||
<style scoped>
|
||||
.outright-panel {
|
||||
padding: 4px 12px 0;
|
||||
padding: 4px 0 0;
|
||||
}
|
||||
|
||||
.panel-summary {
|
||||
@@ -145,11 +190,11 @@ function closeModal() {
|
||||
margin: 0 0 12px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 8px;
|
||||
background: rgba(201, 162, 39, 0.08);
|
||||
border: 1px solid rgba(201, 162, 39, 0.22);
|
||||
background: color-mix(in srgb, var(--primary-light) 8%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--primary-light) 22%, transparent);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #c9a227;
|
||||
color: var(--primary-light);
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
@@ -159,25 +204,16 @@ function closeModal() {
|
||||
|
||||
.state,
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
padding: 34px 20px 44px;
|
||||
padding: 48px 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
width: min(270px, 82vw);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
margin-bottom: 12px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
opacity: 0.86;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.empty-hint {
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import api from '../api';
|
||||
import type { OutrightEvent } from '../components/outright/OutrightEventSection.vue';
|
||||
import type { OutrightSelection } from '../components/outright/OutrightEventSection.vue';
|
||||
|
||||
const CACHE_TTL_MS = 8000;
|
||||
const loading = ref(false);
|
||||
const loadError = ref('');
|
||||
const events = ref<OutrightEvent[]>([]);
|
||||
let lastLoadedAt = 0;
|
||||
let inFlight: Promise<OutrightEvent[]> | null = null;
|
||||
|
||||
type LoadOptions = {
|
||||
silent?: boolean;
|
||||
force?: boolean;
|
||||
};
|
||||
import { useOnLocaleChange } from './useOnLocaleChange';
|
||||
|
||||
export function useOutrightEvents() {
|
||||
const { t, locale } = useI18n();
|
||||
const { t } = useI18n();
|
||||
const loading = ref(true);
|
||||
const loadError = ref('');
|
||||
const events = ref<OutrightEvent[]>([]);
|
||||
|
||||
function mergeOddsOnly(fresh: OutrightEvent[]) {
|
||||
const freshMap = new Map<string, OutrightEvent>();
|
||||
@@ -38,34 +30,15 @@ export function useOutrightEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
async function load(options?: LoadOptions) {
|
||||
async function load(options?: { silent?: boolean }) {
|
||||
const hadData = events.value.length > 0;
|
||||
if (!options?.force && hadData && Date.now() - lastLoadedAt < CACHE_TTL_MS) {
|
||||
loading.value = false;
|
||||
loadError.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (inFlight) {
|
||||
if (!hadData && !options?.silent) loading.value = true;
|
||||
try {
|
||||
await inFlight;
|
||||
} finally {
|
||||
if (!hadData && !options?.silent) loading.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hadData && !options?.silent) loading.value = true;
|
||||
loadError.value = '';
|
||||
try {
|
||||
inFlight = api.get('/player/outrights').then(({ data }) => {
|
||||
const { data } = await api.get('/player/outrights');
|
||||
const list = (data?.data ?? []) as OutrightEvent[];
|
||||
return list.filter((e) => e.selections?.length > 0);
|
||||
});
|
||||
const fresh = await inFlight;
|
||||
lastLoadedAt = Date.now();
|
||||
if (!hadData || options?.force) {
|
||||
const fresh = list.filter((e) => e.selections?.length > 0);
|
||||
if (!hadData) {
|
||||
events.value = fresh;
|
||||
} else {
|
||||
mergeOddsOnly(fresh);
|
||||
@@ -80,19 +53,10 @@ export function useOutrightEvents() {
|
||||
}
|
||||
} finally {
|
||||
if (!hadData && !options?.silent) loading.value = false;
|
||||
inFlight = null;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void load({ silent: events.value.length > 0 });
|
||||
});
|
||||
|
||||
watch(locale, (next, prev) => {
|
||||
if (prev && next !== prev) {
|
||||
void load({ silent: events.value.length > 0, force: true });
|
||||
}
|
||||
});
|
||||
useOnLocaleChange(load);
|
||||
|
||||
return {
|
||||
loading,
|
||||
|
||||
@@ -313,9 +313,6 @@ export default {
|
||||
recharge_btn: 'Deposit',
|
||||
recharge_history: 'Deposit history',
|
||||
cashbacks_tab: 'Cashback',
|
||||
detail_info: 'Details',
|
||||
frozen_before: 'Frozen before',
|
||||
frozen_after: 'Frozen after',
|
||||
},
|
||||
recharge: {
|
||||
title: 'Recharge',
|
||||
@@ -604,13 +601,11 @@ export default {
|
||||
placed_at: 'Placed at',
|
||||
detail_title: 'Bet details',
|
||||
selections: 'Selections',
|
||||
summary: 'Bet summary',
|
||||
legs_count: 'Legs',
|
||||
back_to_list: 'Back to bet list',
|
||||
},
|
||||
profile: {
|
||||
edit: 'Edit Profile',
|
||||
edit_title: 'Edit profile',
|
||||
settings: 'Settings',
|
||||
save_success: 'Saved successfully',
|
||||
basic_info: 'Basic info',
|
||||
change_avatar: 'Change avatar',
|
||||
@@ -662,15 +657,5 @@ export default {
|
||||
rules_p3: 'Results use admin-entered half-time and full-time scores; payouts apply after settlement preview is confirmed.',
|
||||
rules_p4: 'If this text conflicts with site notices, the latest notice and market rules prevail.',
|
||||
rules_p5: 'How to bet: open any match, tap the ? icon on the top right.',
|
||||
qnav_bets_desc: 'View bet history',
|
||||
qnav_wallet_desc: 'Wallet transactions',
|
||||
qnav_cashback_desc: 'Cashback records',
|
||||
qnav_recharge_desc: 'Deposit funds',
|
||||
qnav_announcements_desc: 'View announcements',
|
||||
qnav_edit_desc: 'Edit your profile',
|
||||
security_tips: 'Security tips',
|
||||
tip_1: 'Change your password regularly to keep your account secure',
|
||||
tip_2: 'Never share your password with anyone',
|
||||
tip_3: 'Contact customer service if you need help',
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -325,9 +325,6 @@ export default {
|
||||
recharge_btn: 'Topup',
|
||||
recharge_history: 'Sejarah topup',
|
||||
cashbacks_tab: 'Rebat',
|
||||
detail_info: 'Butiran',
|
||||
frozen_before: 'Beku sebelum',
|
||||
frozen_after: 'Beku selepas',
|
||||
},
|
||||
recharge: {
|
||||
title: 'Topup',
|
||||
@@ -616,13 +613,11 @@ export default {
|
||||
placed_at: 'Masa pertaruhan',
|
||||
detail_title: 'Butiran pertaruhan',
|
||||
selections: 'Pilihan',
|
||||
summary: 'Ringkasan pertaruhan',
|
||||
legs_count: 'Bilangan pilihan',
|
||||
back_to_list: 'Kembali ke senarai pertaruhan',
|
||||
},
|
||||
profile: {
|
||||
edit: 'Edit Profil',
|
||||
edit_title: 'Edit profil',
|
||||
settings: 'Tetapan',
|
||||
save_success: 'Berjaya disimpan',
|
||||
basic_info: 'Maklumat asas',
|
||||
change_avatar: 'Tukar avatar',
|
||||
@@ -674,15 +669,5 @@ export default {
|
||||
rules_p3: 'Keputusan berdasarkan skor separuh masa/penuh yang dimasukkan admin; bayaran selepas pratonton disahkan.',
|
||||
rules_p4: 'Jika bercanggah dengan notis laman, ikut notis terkini dan peraturan pasaran.',
|
||||
rules_p5: 'Langkah operasi: buka butiran perlawanan, ketik ikon ? di atas kanan.',
|
||||
qnav_bets_desc: 'Lihat sejarah pertaruhan',
|
||||
qnav_wallet_desc: 'Transaksi dompet',
|
||||
qnav_cashback_desc: 'Rekod rebat',
|
||||
qnav_recharge_desc: 'Tambah dana',
|
||||
qnav_announcements_desc: 'Lihat pengumuman',
|
||||
qnav_edit_desc: 'Edit profil anda',
|
||||
security_tips: 'Tip keselamatan',
|
||||
tip_1: 'Tukar kata laluan secara berkala untuk keselamatan akaun',
|
||||
tip_2: 'Jangan berkongsi kata laluan dengan sesiapa',
|
||||
tip_3: 'Hubungi perkhidmatan pelanggan jika memerlukan bantuan',
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -313,9 +313,6 @@ export default {
|
||||
recharge_btn: '充值',
|
||||
recharge_history: '充值记录',
|
||||
cashbacks_tab: '返水明细',
|
||||
detail_info: '详细信息',
|
||||
frozen_before: '冻结前',
|
||||
frozen_after: '冻结后',
|
||||
},
|
||||
recharge: {
|
||||
title: '充值',
|
||||
@@ -604,13 +601,11 @@ export default {
|
||||
placed_at: '下注时间',
|
||||
detail_title: '注单详情',
|
||||
selections: '投注选项',
|
||||
summary: '注单概要',
|
||||
legs_count: '过关场数',
|
||||
back_to_list: '返回注单列表',
|
||||
},
|
||||
profile: {
|
||||
edit: '修改资料',
|
||||
edit_title: '修改资料',
|
||||
settings: '设置',
|
||||
save_success: '保存成功',
|
||||
basic_info: '基础信息',
|
||||
change_avatar: '更换头像',
|
||||
@@ -662,15 +657,5 @@ export default {
|
||||
rules_p3: '赛果由平台根据官方录入的半场/全场比分结算,结算预览经确认后入账。',
|
||||
rules_p4: '若本说明与后台公告冲突,以最新公告及实际盘口规则为准。',
|
||||
rules_p5: '操作步骤:进入任意赛事详情,点右上角「?」查看玩法说明。',
|
||||
qnav_bets_desc: '查看历史投注记录',
|
||||
qnav_wallet_desc: '资金流水明细',
|
||||
qnav_cashback_desc: '返水记录详情',
|
||||
qnav_recharge_desc: '账户充值',
|
||||
qnav_announcements_desc: '查看站内公告',
|
||||
qnav_edit_desc: '修改个人资料',
|
||||
security_tips: '安全提示',
|
||||
tip_1: '定期更换密码以保护账户安全',
|
||||
tip_2: '不要将密码透露给他人',
|
||||
tip_3: '如需帮助请联系在线客服',
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -1,33 +1,194 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterView, RouterLink, useRoute } from 'vue-router';
|
||||
import { RouterView, RouterLink, useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { useBetSlipStore } from '../stores/betSlip';
|
||||
import CashBalanceChip from '../components/CashBalanceChip.vue';
|
||||
import UserAvatarMenu from '../components/UserAvatarMenu.vue';
|
||||
import LocaleSwitcher from '../components/LocaleSwitcher.vue';
|
||||
import { useAppLocale } from '../composables/useAppLocale';
|
||||
import AnnouncementMarquee from '../components/AnnouncementMarquee.vue';
|
||||
import BottomNavIcon from '../components/BottomNavIcon.vue';
|
||||
import BackToTopButton from '../components/BackToTopButton.vue';
|
||||
import SettingsDrawer from '../components/SettingsDrawer.vue';
|
||||
import { computed, defineAsyncComponent, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { useViewport } from '../composables/useViewport';
|
||||
import DesktopShell from '../components/desktop/DesktopShell.vue';
|
||||
|
||||
const BetSlipDrawer = defineAsyncComponent(() => import('../components/BetSlipDrawer.vue'));
|
||||
const { isDesktop } = useViewport();
|
||||
|
||||
import { usePlayerHome } from '../composables/usePlayerHome';
|
||||
import { useInboxFeature } from '../composables/useInboxFeature';
|
||||
import { usePlayerProfile } from '../composables/usePlayerProfile';
|
||||
import { startPresencePing, stopPresencePing } from '../composables/usePresencePing';
|
||||
import { useDepositNotifications } from '../composables/useDepositNotifications';
|
||||
import { usePlayerMessages } from '../composables/usePlayerMessages';
|
||||
import { startPresencePing, stopPresencePing } from '../composables/usePresencePing';
|
||||
import { useInboxFeature } from '../composables/useInboxFeature';
|
||||
|
||||
const { isDesktop } = useViewport();
|
||||
const { t, locale } = useI18n();
|
||||
const auth = useAuthStore();
|
||||
const { initFromUser } = useAppLocale();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const slip = useBetSlipStore();
|
||||
const { inboxEnabled, hubRoute, hubOpenLabelKey } = useInboxFeature();
|
||||
const showSettings = ref(false);
|
||||
const floatBtnRef = ref<HTMLElement | null>(null);
|
||||
|
||||
const btnX = ref<number | null>(null);
|
||||
const btnY = ref<number | null>(null);
|
||||
const isDragging = ref(false);
|
||||
const isDocked = ref(false);
|
||||
const dockSide = ref<'left' | 'right'>('right');
|
||||
|
||||
let startX = 0;
|
||||
let startY = 0;
|
||||
let initialX = 0;
|
||||
let initialY = 0;
|
||||
let hasMoved = false;
|
||||
let wasDockedBeforeInteraction = false;
|
||||
|
||||
const btnStyle = computed(() => {
|
||||
if (btnX.value === null || btnY.value === null) {
|
||||
return {
|
||||
right: '16px',
|
||||
bottom: '80px',
|
||||
};
|
||||
}
|
||||
return {
|
||||
left: `${btnX.value}px`,
|
||||
top: `${btnY.value}px`,
|
||||
};
|
||||
});
|
||||
|
||||
const DOCK_OFFSET = 24;
|
||||
const SNAP_THRESHOLD = 16; // 仅当按钮贴近å±<C3A5>幕边缘时æ‰<C3A6>å<EFBFBD>¸é™„
|
||||
const DOCK_SNAP_THRESHOLD = 20; // px â€?按钮边缘è·<C3A8>å±<C3A5>幕边缘å°<C3A5>于æ¤å€¼æ‰<C3A6>å<EFBFBD>¸é™„
|
||||
const FLOAT_BTN_SIZE = 48;
|
||||
const FLOAT_BTN_EDGE_INSET = 8;
|
||||
|
||||
function undockToVisualPosition() {
|
||||
if (!isDocked.value || btnX.value === null) return;
|
||||
if (dockSide.value === 'right') {
|
||||
btnX.value += DOCK_OFFSET;
|
||||
} else {
|
||||
btnX.value -= DOCK_OFFSET;
|
||||
}
|
||||
isDocked.value = false;
|
||||
}
|
||||
|
||||
function snapToEdge(side: 'left' | 'right') {
|
||||
const screenWidth = window.innerWidth;
|
||||
dockSide.value = side;
|
||||
btnX.value = side === 'left' ? FLOAT_BTN_EDGE_INSET : screenWidth - FLOAT_BTN_SIZE - FLOAT_BTN_EDGE_INSET;
|
||||
isDocked.value = true;
|
||||
}
|
||||
|
||||
function onPointerDown(e: PointerEvent) {
|
||||
if (e.pointerType === 'mouse' && e.button !== 0) return;
|
||||
if (isDragging.value) return;
|
||||
|
||||
const el = e.currentTarget as HTMLElement;
|
||||
try {
|
||||
el.setPointerCapture(e.pointerId);
|
||||
} catch (err) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
isDragging.value = true;
|
||||
hasMoved = false;
|
||||
wasDockedBeforeInteraction = isDocked.value;
|
||||
|
||||
startX = e.clientX;
|
||||
startY = e.clientY;
|
||||
|
||||
// å<>¸é™„æ€<C3A6>下 transform 会把按钮推出å±<C3A5>幕,先还原到å<C2B0>¯è§<C3A8>ä½<C3A4>置,å<C592>¦åˆ™å‡ ä¹Žæ— æ³•è§¦å<C2A6>‘拖拽
|
||||
undockToVisualPosition();
|
||||
|
||||
const btnSize = FLOAT_BTN_SIZE;
|
||||
initialX = btnX.value !== null ? btnX.value : window.innerWidth - btnSize - 16;
|
||||
initialY = btnY.value !== null ? btnY.value : window.innerHeight - btnSize - 80;
|
||||
|
||||
btnX.value = initialX;
|
||||
btnY.value = initialY;
|
||||
}
|
||||
|
||||
function onPointerMove(e: PointerEvent) {
|
||||
if (!isDragging.value) return;
|
||||
|
||||
const dx = e.clientX - startX;
|
||||
const dy = e.clientY - startY;
|
||||
|
||||
if (!hasMoved && (Math.abs(dx) > 5 || Math.abs(dy) > 5)) {
|
||||
hasMoved = true;
|
||||
}
|
||||
|
||||
if (hasMoved) {
|
||||
const newX = initialX + dx;
|
||||
const newY = initialY + dy;
|
||||
|
||||
const btnSize = 48;
|
||||
const minX = -24;
|
||||
const maxX = window.innerWidth - 24;
|
||||
const minY = 60;
|
||||
const maxY = window.innerHeight - btnSize - 60;
|
||||
|
||||
btnX.value = Math.max(minX, Math.min(newX, maxX));
|
||||
btnY.value = Math.max(minY, Math.min(newY, maxY));
|
||||
}
|
||||
}
|
||||
|
||||
function openInboxHub() {
|
||||
if (!auth.token) {
|
||||
auth.showLoginPrompt(hubRoute.value);
|
||||
return;
|
||||
}
|
||||
|
||||
void router.push(hubRoute.value);
|
||||
}
|
||||
|
||||
function onPointerUp(e: PointerEvent) {
|
||||
if (!isDragging.value) return;
|
||||
isDragging.value = false;
|
||||
|
||||
const el = e.currentTarget as HTMLElement;
|
||||
try {
|
||||
el.releasePointerCapture(e.pointerId);
|
||||
} catch (err) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
if (hasMoved) {
|
||||
if (btnX.value !== null && btnY.value !== null) {
|
||||
const screenWidth = window.innerWidth;
|
||||
const btnSize = 48;
|
||||
const snapThreshold = SNAP_THRESHOLD;
|
||||
|
||||
const distLeft = btnX.value;
|
||||
const distRight = screenWidth - (btnX.value + btnSize);
|
||||
|
||||
if (distLeft <= snapThreshold) {
|
||||
snapToEdge('left');
|
||||
} else if (distRight <= snapThreshold) {
|
||||
snapToEdge('right');
|
||||
} else {
|
||||
// Float freely in place �no folding
|
||||
isDocked.value = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (wasDockedBeforeInteraction) {
|
||||
snapToEdge(dockSide.value);
|
||||
}
|
||||
openInboxHub();
|
||||
}
|
||||
|
||||
if (btnX.value !== null && btnY.value !== null) {
|
||||
localStorage.setItem('float_cs_x', String(btnX.value));
|
||||
localStorage.setItem('float_cs_y', String(btnY.value));
|
||||
localStorage.setItem('float_cs_side', dockSide.value);
|
||||
localStorage.setItem('float_cs_docked', isDocked.value ? '1' : '0');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const isDetailPage = computed(() => {
|
||||
const p = route.path;
|
||||
@@ -43,6 +204,9 @@ const isDetailPage = computed(() => {
|
||||
});
|
||||
|
||||
const showHeader = computed(() => !isDetailPage.value);
|
||||
const showAnnouncement = computed(
|
||||
() => !isDetailPage.value && !route.path.startsWith('/profile') && !route.path.startsWith('/announcements')
|
||||
);
|
||||
|
||||
const showBottomNav = computed(() => {
|
||||
const p = route.path;
|
||||
@@ -60,42 +224,24 @@ const showBottomNav = computed(() => {
|
||||
if (!inboxEnabled.value && p === '/messages') return true;
|
||||
return false;
|
||||
});
|
||||
const { load: loadPlayerHome } = usePlayerHome();
|
||||
const { announcements, announcementItems, load: loadPlayerHome } = usePlayerHome();
|
||||
const { loadProfile, refreshProfile, bindProfileVisibilityRefresh } = usePlayerProfile();
|
||||
const { startPolling, stopPolling } = useDepositNotifications();
|
||||
const { unreadCount, refreshUnreadCount, resetMessagesState } = usePlayerMessages();
|
||||
const { inboxEnabled, hubRoute, hubOpenLabelKey } = useInboxFeature();
|
||||
const showFloatCsBtn = computed(() => !route.path.startsWith('/messages'));
|
||||
const primaryAnnouncementId = computed(() => announcementItems.value[0]?.id ?? '');
|
||||
|
||||
const mainRef = ref<HTMLElement | null>(null);
|
||||
const tabScrollTops = new Map<string, number>();
|
||||
const bottomNavHidden = ref(false);
|
||||
let lastMainScrollTop = 0;
|
||||
|
||||
function onMainScroll() {
|
||||
const el = mainRef.value;
|
||||
if (!el || !showBottomNav.value) return;
|
||||
|
||||
const scrollTop = el.scrollTop;
|
||||
const delta = scrollTop - lastMainScrollTop;
|
||||
|
||||
if (scrollTop <= 8) {
|
||||
bottomNavHidden.value = false;
|
||||
} else if (delta > 10) {
|
||||
bottomNavHidden.value = true;
|
||||
} else if (delta < -10) {
|
||||
bottomNavHidden.value = false;
|
||||
}
|
||||
|
||||
lastMainScrollTop = scrollTop;
|
||||
}
|
||||
|
||||
watch(showBottomNav, (visible) => {
|
||||
if (!visible) bottomNavHidden.value = false;
|
||||
watch(locale, (next, prev) => {
|
||||
if (prev && next !== prev) void loadPlayerHome(true);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.fullPath,
|
||||
(_path, oldPath) => {
|
||||
lastMainScrollTop = 0;
|
||||
bottomNavHidden.value = false;
|
||||
const el = mainRef.value;
|
||||
if (!el) return;
|
||||
if (oldPath) tabScrollTops.set(oldPath, el.scrollTop);
|
||||
@@ -104,30 +250,33 @@ watch(
|
||||
);
|
||||
|
||||
const balanceRefreshPaths = ['/profile', '/wallet', '/bets'];
|
||||
let mainScrollEl: HTMLElement | null = null;
|
||||
|
||||
watch(locale, (next, prev) => {
|
||||
if (prev && next !== prev) void loadPlayerHome(true);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (auth.user?.locale) void initFromUser(auth.user.locale);
|
||||
bindProfileVisibilityRefresh();
|
||||
mainScrollEl = mainRef.value;
|
||||
mainScrollEl?.addEventListener('scroll', onMainScroll, { passive: true });
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
mainScrollEl?.removeEventListener('scroll', onMainScroll);
|
||||
mainScrollEl = null;
|
||||
const savedX = localStorage.getItem('float_cs_x');
|
||||
const savedY = localStorage.getItem('float_cs_y');
|
||||
const savedSide = localStorage.getItem('float_cs_side');
|
||||
const savedDocked = localStorage.getItem('float_cs_docked');
|
||||
if (savedX !== null && savedY !== null) {
|
||||
btnX.value = Number(savedX);
|
||||
btnY.value = Number(savedY);
|
||||
}
|
||||
if (savedSide === 'left' || savedSide === 'right') {
|
||||
dockSide.value = savedSide;
|
||||
}
|
||||
if (savedDocked !== null) {
|
||||
isDocked.value = savedDocked === '1';
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => auth.token,
|
||||
(token) => {
|
||||
// 首页数据(公告、热门赛事)对所有人公开,始终加载
|
||||
// 首页数æ<EFBFBD>®ï¼ˆå…¬å‘Šã€<EFBFBD>çƒé—¨èµ›äº‹ï¼‰å¯¹æ‰€æœ‰äººå…¬å¼€ï¼Œå§‹ç»ˆåŠ è½?
|
||||
void loadPlayerHome(true);
|
||||
// 个人资料仅登录用户需要
|
||||
// 个人资料仅登录用户需�
|
||||
if (token) {
|
||||
void loadProfile(true);
|
||||
startPolling();
|
||||
@@ -162,29 +311,20 @@ watch(
|
||||
<header v-if="showHeader" class="header">
|
||||
<img src="/logo.png" alt="TheBet365" class="logo" />
|
||||
<div class="header-actions">
|
||||
<RouterLink
|
||||
:to="hubRoute"
|
||||
class="hub-btn"
|
||||
:aria-label="inboxEnabled && unreadCount ? t('messages.unread_badge', { count: unreadCount }) : t(hubOpenLabelKey)"
|
||||
>
|
||||
<svg class="hub-icon" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
d="M12 3C7.03 3 3 6.58 3 11c0 2.02.9 3.86 2.38 5.24L4 21l4.2-1.02A10.8 10.8 0 0 0 12 19c4.97 0 9-3.58 9-8s-4.03-8-9-8Z"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.8"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
<circle cx="9" cy="11" r="1" fill="currentColor" />
|
||||
<circle cx="12" cy="11" r="1" fill="currentColor" />
|
||||
<circle cx="15" cy="11" r="1" fill="currentColor" />
|
||||
</svg>
|
||||
<span v-if="auth.user && inboxEnabled && unreadCount > 0" class="hub-badge">{{ unreadCount > 99 ? '99+' : unreadCount }}</span>
|
||||
</RouterLink>
|
||||
<LocaleSwitcher />
|
||||
<LocaleSwitcher v-if="!auth.user" />
|
||||
<template v-if="auth.user">
|
||||
<CashBalanceChip />
|
||||
<UserAvatarMenu />
|
||||
<button
|
||||
type="button"
|
||||
class="settings-trigger-btn"
|
||||
:aria-label="t('profile.settings')"
|
||||
@click="showSettings = true"
|
||||
>
|
||||
<svg class="settings-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.1a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
</svg>
|
||||
</button>
|
||||
</template>
|
||||
<button v-else type="button" class="login-btn" @click="auth.showLoginPrompt(route.fullPath)">
|
||||
{{ t('auth.login') }}
|
||||
@@ -192,7 +332,15 @@ watch(
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main ref="mainRef" :class="['main', { 'has-nav': showBottomNav }]">
|
||||
<div v-if="showAnnouncement" class="announce-strip">
|
||||
<AnnouncementMarquee
|
||||
:items="announcements"
|
||||
:target-id="primaryAnnouncementId"
|
||||
embedded
|
||||
/>
|
||||
</div>
|
||||
|
||||
<main ref="mainRef" :class="['main', { 'has-nav': showBottomNav, 'main--sub-page': isDetailPage }]">
|
||||
<RouterView v-slot="{ Component, route: viewRoute }">
|
||||
<KeepAlive v-if="viewRoute.meta.keepAlive" :max="10">
|
||||
<component :is="Component" :key="viewRoute.path" />
|
||||
@@ -201,12 +349,7 @@ watch(
|
||||
</RouterView>
|
||||
</main>
|
||||
|
||||
<nav
|
||||
v-if="showBottomNav"
|
||||
class="bottom-nav"
|
||||
:class="{ 'bottom-nav--hidden': bottomNavHidden }"
|
||||
aria-label="Main"
|
||||
>
|
||||
<nav v-if="showBottomNav" class="bottom-nav" aria-label="Main">
|
||||
<RouterLink to="/" class="nav-item" :class="{ active: route.path === '/' }">
|
||||
<BottomNavIcon name="home" />
|
||||
<span class="nav-label">{{ t('nav.home') }}</span>
|
||||
@@ -233,41 +376,64 @@ watch(
|
||||
</RouterLink>
|
||||
</nav>
|
||||
|
||||
<BackToTopButton
|
||||
:scroll-el="mainRef"
|
||||
:above-nav="showBottomNav && !bottomNavHidden"
|
||||
/>
|
||||
<BackToTopButton :scroll-el="mainRef" :above-nav="showBottomNav" />
|
||||
|
||||
<BetSlipDrawer v-model="slip.drawerOpen" />
|
||||
<SettingsDrawer v-model="showSettings" />
|
||||
|
||||
<!-- Draggable Floating Customer Service Button -->
|
||||
<div
|
||||
v-if="showFloatCsBtn"
|
||||
ref="floatBtnRef"
|
||||
class="float-cs-btn"
|
||||
:class="{ dragging: isDragging, docked: isDocked, 'dock-left': dockSide === 'left', 'dock-right': dockSide === 'right' }"
|
||||
:style="btnStyle"
|
||||
@pointerdown="onPointerDown"
|
||||
@pointermove="onPointerMove"
|
||||
@pointerup="onPointerUp"
|
||||
@pointercancel="onPointerUp"
|
||||
@touchstart.prevent
|
||||
:aria-label="inboxEnabled && unreadCount ? t('messages.unread_badge', { count: unreadCount }) : t(hubOpenLabelKey)"
|
||||
>
|
||||
<svg class="cs-icon" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path
|
||||
d="M12 3C7.03 3 3 6.58 3 11c0 2.02.9 3.86 2.38 5.24L4 21l4.2-1.02A10.8 10.8 0 0 0 12 19c4.97 0 9-3.58 9-8s-4.03-8-9-8Z"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.8"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
<circle cx="9" cy="11" r="1" fill="currentColor" />
|
||||
<circle cx="12" cy="11" r="1" fill="currentColor" />
|
||||
<circle cx="15" cy="11" r="1" fill="currentColor" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.layout {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 100dvh;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
box-sizing: border-box;
|
||||
padding-top: var(--safe-top);
|
||||
padding-top: calc(var(--app-top-gap) + env(safe-area-inset-top, 0px));
|
||||
}
|
||||
.header {
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
min-height: var(--player-header-h);
|
||||
background: rgba(29, 27, 22, 0.88);
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
padding: 6px var(--space-page-x);
|
||||
min-height: var(--header-h);
|
||||
background: var(--glass);
|
||||
backdrop-filter: blur(20px) saturate(180%);
|
||||
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
||||
border-bottom: 1px solid var(--border);
|
||||
z-index: 120;
|
||||
z-index: 110;
|
||||
}
|
||||
.logo {
|
||||
height: 36px; width: auto; display: block;
|
||||
filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.2));
|
||||
}
|
||||
.header-actions {
|
||||
--header-chip-h: 36px;
|
||||
@@ -277,76 +443,154 @@ watch(
|
||||
min-width: 0;
|
||||
}
|
||||
.header-actions :deep(.locale-switch:not(.compact)),
|
||||
.header-actions :deep(.cash-chip),
|
||||
.header-actions :deep(.avatar-btn) {
|
||||
.header-actions :deep(.cash-chip) {
|
||||
height: var(--header-chip-h);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.header-actions :deep(.avatar-btn) {
|
||||
width: var(--header-chip-h);
|
||||
|
||||
.float-cs-btn {
|
||||
position: fixed;
|
||||
z-index: 135;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 50%;
|
||||
background: var(--dropdown-bg, #0A2540);
|
||||
border: 1px solid var(--border-strong);
|
||||
color: var(--text);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
|
||||
cursor: grab;
|
||||
user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
touch-action: none;
|
||||
transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.hub-btn {
|
||||
position: relative;
|
||||
.float-cs-btn:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.float-cs-btn.dragging {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.float-cs-btn.docked {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
.float-cs-btn.docked:hover {
|
||||
opacity: 1;
|
||||
transform: translateX(0) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.float-cs-btn.docked:active {
|
||||
opacity: 1;
|
||||
transform: translateX(0) !important;
|
||||
}
|
||||
|
||||
.float-cs-btn.docked.dock-left {
|
||||
transform: translateX(-24px);
|
||||
}
|
||||
|
||||
.float-cs-btn.docked.dock-right {
|
||||
transform: translateX(24px);
|
||||
}
|
||||
|
||||
/* Expand touch target to bypass edge gesture intercept */
|
||||
.float-cs-btn::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
bottom: -12px;
|
||||
left: -24px;
|
||||
right: -24px;
|
||||
background: transparent;
|
||||
border-radius: 50%;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.cs-icon {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.cs-badge {
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
padding: 0 4px;
|
||||
border-radius: 999px;
|
||||
background: rgba(239, 68, 68, 0.95);
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
box-shadow: 0 0 0 2px var(--bg-body);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.cs-badge.badge-left {
|
||||
left: -2px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.cs-badge.badge-right {
|
||||
right: -2px;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
padding: 6px 14px;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border-strong);
|
||||
background: transparent;
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.18s;
|
||||
}
|
||||
|
||||
.login-btn:active {
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.settings-trigger-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: var(--header-chip-h, 36px);
|
||||
height: var(--header-chip-h, 36px);
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border-gold-soft, rgba(200, 168, 78, 0.25));
|
||||
background: rgba(200, 168, 78, 0.08);
|
||||
color: var(--primary-light, #c8a84e);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
flex-shrink: 0;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.18s, border-color 0.18s;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.hub-btn:active {
|
||||
background: rgba(200, 168, 78, 0.16);
|
||||
.settings-trigger-btn:active {
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.hub-icon {
|
||||
.settings-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.hub-badge {
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
right: -4px;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
padding: 0 4px;
|
||||
border-radius: 999px;
|
||||
background: #e74c3c;
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.94);
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
padding: 6px 16px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--primary, #c8a84e);
|
||||
background: transparent;
|
||||
color: var(--primary-light, #c8a84e);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.login-btn:active {
|
||||
background: rgba(200, 168, 78, 0.15);
|
||||
}
|
||||
.announce-strip {
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
z-index: 105;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--bg-body);
|
||||
}
|
||||
|
||||
.main {
|
||||
@@ -355,34 +599,26 @@ watch(
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 12px 16px 0;
|
||||
padding: var(--space-section) var(--space-page-x) 0;
|
||||
}
|
||||
|
||||
.main.main--sub-page {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.main.has-nav {
|
||||
padding-bottom: calc(var(--player-bottom-nav-h) + var(--safe-bottom));
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.bottom-nav {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
min-height: calc(var(--player-bottom-nav-h) + var(--safe-bottom));
|
||||
padding-bottom: var(--safe-bottom);
|
||||
background: rgba(29, 27, 22, 0.9);
|
||||
background: var(--glass);
|
||||
backdrop-filter: blur(20px) saturate(180%);
|
||||
-webkit-backdrop-filter: blur(20px) saturate(180%);
|
||||
border-top: 1px solid var(--border);
|
||||
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
|
||||
box-shadow: none;
|
||||
z-index: 100;
|
||||
transition: transform 0.28s ease, opacity 0.28s ease;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.bottom-nav--hidden {
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
padding-bottom: env(safe-area-inset-bottom, 0);
|
||||
min-height: var(--nav-h);
|
||||
}
|
||||
.nav-item {
|
||||
flex: 1;
|
||||
@@ -390,14 +626,14 @@ watch(
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 3px;
|
||||
padding: 6px 2px 4px;
|
||||
font-size: 9px;
|
||||
gap: 2px;
|
||||
padding: 6px 2px 8px;
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0;
|
||||
position: relative;
|
||||
transition: color 0.2s;
|
||||
transition: color 0.18s;
|
||||
line-height: 1.2;
|
||||
min-width: 0;
|
||||
}
|
||||
@@ -411,22 +647,16 @@ watch(
|
||||
}
|
||||
|
||||
.nav-item.active {
|
||||
color: var(--primary-light);
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.nav-item.active :deep(.nav-icon) {
|
||||
filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.35));
|
||||
color: var(--text);
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.nav-item.active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 22%;
|
||||
right: 22%;
|
||||
height: 2px;
|
||||
background: var(--primary);
|
||||
border-radius: 0 0 4px 4px;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,239 +1,214 @@
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
:root {
|
||||
--primary: #D4AF37;
|
||||
--primary-dark: #A8841F;
|
||||
--primary-light: #F0D875;
|
||||
--secondary: #1A1A1A;
|
||||
--tertiary: #000000;
|
||||
--neutral: #8E8E93;
|
||||
--bg-body: #080806;
|
||||
--bg-card: rgba(33, 31, 25, 0.76);
|
||||
--bg-hover: rgba(47, 44, 35, 0.82);
|
||||
--bg-elevated: rgba(58, 54, 43, 0.86);
|
||||
--text: #FFFFFF;
|
||||
--text-muted: #B7B0A0;
|
||||
--border: rgba(255, 226, 156, 0.18);
|
||||
--border-gold: #D4AF37;
|
||||
--border-gold-soft: rgba(212, 175, 55, 0.28);
|
||||
color-scheme: dark;
|
||||
/* ── 海军 · 白色强调(替代红色) ── */
|
||||
--primary: rgba(255, 255, 255, 0.92);
|
||||
--primary-dark: rgba(255, 255, 255, 0.78);
|
||||
--primary-light: rgba(255, 255, 255, 0.68);
|
||||
--primary-muted: rgba(255, 255, 255, 0.52);
|
||||
--on-primary: #001A33;
|
||||
--secondary: #0A3558;
|
||||
--tertiary: #001A33;
|
||||
--neutral: rgba(255, 255, 255, 0.42);
|
||||
--bg-body: #001A33;
|
||||
--dropdown-bg: #0A2540;
|
||||
--bg-card: rgba(255, 255, 255, 0.045);
|
||||
--bg-hover: rgba(255, 255, 255, 0.06);
|
||||
--bg-elevated: rgba(255, 255, 255, 0.08);
|
||||
--bg-input: rgba(255, 255, 255, 0.06);
|
||||
--captcha-canvas-bg: #002244;
|
||||
--captcha-char: #ffffff;
|
||||
--captcha-noise-rgb: 255, 255, 255;
|
||||
--surface-active: rgba(255, 255, 255, 0.1);
|
||||
--surface-accent: rgba(255, 255, 255, 0.08);
|
||||
--text: rgba(255, 255, 255, 0.94);
|
||||
--text-muted: rgba(255, 255, 255, 0.56);
|
||||
--text-dim: rgba(255, 255, 255, 0.38);
|
||||
--border: rgba(255, 255, 255, 0.1);
|
||||
--border-strong: rgba(255, 255, 255, 0.16);
|
||||
--border-gold: rgba(255, 255, 255, 0.2);
|
||||
--border-gold-soft: rgba(255, 255, 255, 0.18);
|
||||
--border-w: 1px;
|
||||
--border-w-thick: 1px;
|
||||
--danger: #FF453A;
|
||||
--danger: rgba(255, 255, 255, 0.62);
|
||||
--success: #34C759;
|
||||
--radius: 12px;
|
||||
--radius-sm: 8px;
|
||||
--shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
|
||||
--shadow-gold: 0 2px 12px rgba(212, 175, 55, 0.12);
|
||||
--glow-gold: 0 0 8px rgba(212, 175, 55, 0.2);
|
||||
--gradient-gold: linear-gradient(
|
||||
180deg,
|
||||
#FFF4C8 0%,
|
||||
#F0D875 18%,
|
||||
#D4AF37 50%,
|
||||
#B8942B 78%,
|
||||
#8B6914 100%
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 32px rgba(0, 0, 0, 0.22);
|
||||
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.16);
|
||||
--shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 28px rgba(0, 0, 0, 0.22);
|
||||
--shadow-card-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 18px rgba(0, 0, 0, 0.18);
|
||||
--shadow-gold: none;
|
||||
--glow-gold: none;
|
||||
--gradient-accent: rgba(255, 255, 255, 0.88);
|
||||
--gradient-gold: var(--gradient-accent);
|
||||
--gradient-gold-border: var(--gradient-accent);
|
||||
--gradient-card: linear-gradient(
|
||||
165deg,
|
||||
rgba(255, 255, 255, 0.11) 0%,
|
||||
rgba(255, 255, 255, 0.055) 24%,
|
||||
rgba(10, 53, 88, 0.32) 58%,
|
||||
rgba(0, 20, 40, 0.62) 100%
|
||||
);
|
||||
--gradient-gold-border: linear-gradient(
|
||||
--gradient-card-soft: linear-gradient(
|
||||
180deg,
|
||||
#FFF8DC 0%,
|
||||
#E8C96A 35%,
|
||||
#A8841F 70%,
|
||||
#5C4A12 100%
|
||||
rgba(255, 255, 255, 0.08) 0%,
|
||||
rgba(255, 255, 255, 0.03) 40%,
|
||||
rgba(0, 26, 51, 0.45) 100%
|
||||
);
|
||||
--gradient-card: linear-gradient(160deg, #1E1A12 0%, #141414 40%, #0A0A0A 100%);
|
||||
--player-header-h: 52px;
|
||||
--player-bottom-nav-h: 54px;
|
||||
--safe-top: env(safe-area-inset-top, 0px);
|
||||
--safe-bottom: env(safe-area-inset-bottom, 0px);
|
||||
--gradient-card-shine: linear-gradient(
|
||||
90deg,
|
||||
transparent 0%,
|
||||
rgba(255, 255, 255, 0.28) 50%,
|
||||
transparent 100%
|
||||
);
|
||||
--glass: rgba(0, 26, 51, 0.78);
|
||||
--space-page-x: 20px;
|
||||
--space-toolbar-top: 8px;
|
||||
--space-section: 16px;
|
||||
--space-card: 16px;
|
||||
--header-h: 48px;
|
||||
--nav-h: 52px;
|
||||
--app-top-gap: 8px;
|
||||
}
|
||||
|
||||
/** 金色描边按钮(避免大面积实心填充) */
|
||||
/** 描边按钮 */
|
||||
.btn-gold-outline {
|
||||
background: #141414;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
color: var(--primary-light);
|
||||
font-weight: 800;
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-strong);
|
||||
color: var(--text);
|
||||
font-weight: 500;
|
||||
}
|
||||
.btn-gold-outline:active:not(:disabled) {
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: var(--border-gold);
|
||||
background: var(--surface-active);
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
/** 选中态:浅底 + 金边,非整块金色 */
|
||||
/** 选中态:中性浅底 */
|
||||
.tab-gold-active {
|
||||
background: rgba(212, 175, 55, 0.08) !important;
|
||||
border-color: var(--border-gold) !important;
|
||||
color: var(--primary-light) !important;
|
||||
background: var(--bg-elevated) !important;
|
||||
border-color: var(--border-strong) !important;
|
||||
color: var(--text) !important;
|
||||
}
|
||||
|
||||
/* 登录等关键区域:轻量金边(非厚重 PS 描边) */
|
||||
/* 登录等关键区域 */
|
||||
.ps-gold-frame {
|
||||
position: relative;
|
||||
border: 1px solid var(--border-gold-soft) !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.12) !important;
|
||||
border-radius: var(--radius);
|
||||
background: rgba(14, 14, 14, 0.92) !important;
|
||||
box-shadow: var(--shadow);
|
||||
background: var(--gradient-card) !important;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ps-gold-frame::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ps-gold-frame::before,
|
||||
.ps-gold-frame::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ps-gold-input {
|
||||
background: #0d0d0d !important;
|
||||
background: var(--bg-input) !important;
|
||||
border: 1px solid var(--border) !important;
|
||||
box-shadow: none;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.ps-gold-input::placeholder {
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.ps-gold-input:focus {
|
||||
border-color: var(--border-gold-soft) !important;
|
||||
box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12) !important;
|
||||
border-color: var(--border-strong) !important;
|
||||
box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08) !important;
|
||||
}
|
||||
|
||||
/* 主按钮:斜面浮雕 + 渐变描边 + 外发光 */
|
||||
/* 主按钮 · 扁平 CTA(Stripe 式) */
|
||||
.btn-primary {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
padding: 17px 24px;
|
||||
padding: 14px 24px;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
color: #3D2800;
|
||||
font-weight: 900;
|
||||
font-size: 16px;
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
width: 100%;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
text-shadow:
|
||||
0 1px 0 rgba(255, 252, 235, 0.95),
|
||||
0 -1px 0 rgba(120, 85, 15, 0.35);
|
||||
transition: transform 0.12s ease;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.btn-primary::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -3px;
|
||||
border-radius: calc(var(--radius-sm) + 3px);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
#FFFCE8 0%,
|
||||
#F7E08A 12%,
|
||||
#D4AF37 35%,
|
||||
#8B6914 55%,
|
||||
#5C4A12 72%,
|
||||
#E8C040 90%,
|
||||
#FFF8DC 100%
|
||||
);
|
||||
z-index: -2;
|
||||
box-shadow:
|
||||
0 0 14px rgba(255, 210, 70, 0.55),
|
||||
0 0 28px rgba(212, 175, 55, 0.28),
|
||||
0 6px 14px rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
.btn-primary::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 2px;
|
||||
border-radius: calc(var(--radius-sm) - 1px);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
#FFFBE8 0%,
|
||||
#FFE566 6%,
|
||||
#F0D050 22%,
|
||||
#D4AF37 48%,
|
||||
#B8860B 72%,
|
||||
#8B6914 100%
|
||||
);
|
||||
z-index: -1;
|
||||
box-shadow:
|
||||
inset 0 2px 0 rgba(255, 255, 255, 0.95),
|
||||
inset 0 4px 10px rgba(255, 240, 180, 0.45),
|
||||
inset 0 -2px 0 rgba(90, 65, 12, 0.85),
|
||||
inset 0 -6px 14px rgba(45, 32, 6, 0.5);
|
||||
letter-spacing: -0.01em;
|
||||
text-transform: none;
|
||||
transition: opacity 0.15s ease, transform 0.12s ease;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btn-primary:active:not(:disabled) {
|
||||
transform: translateY(2px) scale(0.985);
|
||||
}
|
||||
|
||||
.btn-primary:active:not(:disabled)::after {
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
#E8C040 0%,
|
||||
#C9962A 40%,
|
||||
#8B6914 100%
|
||||
);
|
||||
box-shadow:
|
||||
inset 0 4px 10px rgba(35, 24, 4, 0.65),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
|
||||
.btn-primary:active:not(:disabled)::before {
|
||||
box-shadow:
|
||||
0 0 10px rgba(255, 200, 50, 0.35),
|
||||
0 2px 6px rgba(0, 0, 0, 0.5);
|
||||
transform: scale(0.985);
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
.btn-primary:disabled {
|
||||
opacity: 0.5;
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
filter: saturate(0.4);
|
||||
}
|
||||
|
||||
/* 筛选 Tab · iOS 分段风格 */
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
padding: 0 0 var(--space-section);
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.filter-tabs::-webkit-scrollbar { display: none; }
|
||||
|
||||
.filter-tab {
|
||||
flex-shrink: 0;
|
||||
padding: 7px 14px;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background 0.18s, border-color 0.18s, color 0.18s;
|
||||
}
|
||||
|
||||
.filter-tab.active {
|
||||
background: var(--surface-active);
|
||||
border-color: var(--border-gold);
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
text-size-adjust: 100%;
|
||||
height: -webkit-fill-available;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100%;
|
||||
min-height: -webkit-fill-available;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
/* 保留 bg 位图;用 scroll 替代 fixed,减轻移动端滚动重绘(后续可换 WebP/AVIF) */
|
||||
background-color: var(--tertiary);
|
||||
background-image:
|
||||
radial-gradient(ellipse 120% 60% at 50% -10%, rgba(246, 210, 108, 0.2), transparent 56%),
|
||||
linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.7)),
|
||||
url('./assets/images/generated/saishi-gold-trophy-v1.webp');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
background-attachment: scroll;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
|
||||
background-color: var(--bg-body);
|
||||
background-image: none;
|
||||
color: var(--text);
|
||||
overflow: hidden;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
body {
|
||||
background-image:
|
||||
radial-gradient(ellipse 90% 70% at 50% 0%, rgba(246, 210, 108, 0.14), transparent 58%),
|
||||
linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.58)),
|
||||
url('./assets/images/generated/pc-global-bg-v1.webp');
|
||||
background-attachment: fixed;
|
||||
}
|
||||
}
|
||||
|
||||
#app {
|
||||
min-height: 100%;
|
||||
min-height: -webkit-fill-available;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
a { color: inherit; text-decoration: none; }
|
||||
@@ -246,20 +221,21 @@ button {
|
||||
|
||||
input {
|
||||
font-family: inherit;
|
||||
background: #0D0D0D;
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text);
|
||||
padding: 14px 16px;
|
||||
padding: 13px 16px;
|
||||
border-radius: var(--radius-sm);
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
font-weight: 400;
|
||||
transition: border-color 0.18s, box-shadow 0.18s;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
outline: none;
|
||||
border-color: var(--border-gold-soft);
|
||||
border-color: var(--border-strong);
|
||||
box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
input:-webkit-autofill,
|
||||
@@ -268,27 +244,28 @@ input:-webkit-autofill:focus,
|
||||
input:-webkit-autofill:active {
|
||||
-webkit-text-fill-color: var(--text);
|
||||
caret-color: var(--text);
|
||||
box-shadow: 0 0 0 1000px #0a0a0a inset;
|
||||
box-shadow: 0 0 0 1000px #0A2540 inset;
|
||||
border: 1px solid var(--border);
|
||||
transition: background-color 99999s ease-out 0s;
|
||||
}
|
||||
|
||||
.odds-btn {
|
||||
background: #161616;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--gradient-card-soft);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
color: var(--text);
|
||||
padding: 12px 14px;
|
||||
padding: 11px 14px;
|
||||
border-radius: var(--radius-sm);
|
||||
text-align: center;
|
||||
min-width: 78px;
|
||||
transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||
transition: border-color 0.18s, background 0.18s, transform 0.12s;
|
||||
}
|
||||
|
||||
.odds-btn:active { transform: scale(0.96); }
|
||||
.odds-btn:active { transform: scale(0.98); }
|
||||
|
||||
.odds-btn.selected {
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: #2d281a;
|
||||
border-color: var(--border-strong);
|
||||
background: var(--bg-elevated);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
@@ -305,38 +282,56 @@ input:-webkit-autofill:active {
|
||||
|
||||
.odds-btn .label {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-dim);
|
||||
font-weight: 500;
|
||||
letter-spacing: 0;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.odds-btn .value {
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
text-shadow: none;
|
||||
margin-top: 2px;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.odds-btn.selected .value {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
position: relative;
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px;
|
||||
margin-bottom: 12px;
|
||||
box-shadow: var(--shadow);
|
||||
background: rgba(26, 26, 26, 0.92);
|
||||
padding: var(--space-card);
|
||||
margin-bottom: var(--space-section);
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 8%;
|
||||
right: 8%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
margin-bottom: 14px;
|
||||
padding: 4px 0 4px 12px;
|
||||
border-left: 3px solid var(--border-gold);
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 12px;
|
||||
padding: 0;
|
||||
border-left: none;
|
||||
color: var(--text);
|
||||
letter-spacing: -0.02em;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.state {
|
||||
@@ -348,6 +343,47 @@ input:-webkit-autofill:active {
|
||||
gap: 12px;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* Sub-page toolbar: full-bleed under .main horizontal padding */
|
||||
.sub-toolbar {
|
||||
box-sizing: border-box;
|
||||
margin-left: calc(-1 * var(--space-page-x));
|
||||
margin-right: calc(-1 * var(--space-page-x));
|
||||
width: calc(100% + 2 * var(--space-page-x));
|
||||
padding: var(--space-toolbar-top) var(--space-page-x) 8px;
|
||||
background: var(--bg-body);
|
||||
}
|
||||
|
||||
.sub-toolbar--sticky {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.sub-toolbar--glass {
|
||||
background: var(--bg-body);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
/* Top-left diagonal ribbon for open-match status */
|
||||
.status-ribbon {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: -28px;
|
||||
width: 100px;
|
||||
transform: rotate(-45deg);
|
||||
background: var(--success);
|
||||
color: #fff;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 4px 0;
|
||||
z-index: 3;
|
||||
line-height: 1.3;
|
||||
letter-spacing: 0.02em;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
/* ═══════════════════════════════════════════════════════════
|
||||
Desktop Interaction System
|
||||
Style: Modern Dark + Gold Accent — premium micro-interactions
|
||||
═══════════════════════════════════════════════════════════ */
|
||||
|
||||
/* ── Cursor & Touch ── */
|
||||
/* Hover Cursors and active resets */
|
||||
.desktop-shell a,
|
||||
.desktop-shell button,
|
||||
.desktop-shell select,
|
||||
@@ -13,130 +8,89 @@
|
||||
touch-action: auto;
|
||||
}
|
||||
|
||||
/* ── Focus Visible (Accessibility) ── */
|
||||
.desktop-shell a:focus-visible,
|
||||
.desktop-shell button:focus-visible,
|
||||
.desktop-shell select:focus-visible,
|
||||
.desktop-shell [role="button"]:focus-visible,
|
||||
.desktop-shell input:focus-visible,
|
||||
.desktop-shell textarea:focus-visible,
|
||||
.desktop-shell [tabindex]:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 2px;
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
/* ── Scrollbar Customization ── */
|
||||
/* Scrollbar customizations */
|
||||
.desktop-shell ::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.desktop-shell ::-webkit-scrollbar-track {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.desktop-shell ::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
border-radius: 3px;
|
||||
transition: background var(--duration-normal) var(--ease-smooth);
|
||||
}
|
||||
|
||||
.desktop-shell ::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(212, 175, 55, 0.4);
|
||||
background: var(--primary-light);
|
||||
}
|
||||
|
||||
/* ── Hover Highlights ── */
|
||||
.desktop-shell .hover-bg {
|
||||
transition: background-color var(--duration-normal) var(--ease-smooth);
|
||||
}
|
||||
/* Hover highlights */
|
||||
.desktop-shell .hover-bg:hover {
|
||||
background-color: var(--bg-hover) !important;
|
||||
}
|
||||
|
||||
.desktop-shell .hover-gold-soft {
|
||||
transition: border-color var(--duration-normal) var(--ease-smooth),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth);
|
||||
}
|
||||
.desktop-shell .hover-gold-soft:hover {
|
||||
border-color: var(--border-gold) !important;
|
||||
box-shadow: var(--glow-gold);
|
||||
}
|
||||
|
||||
.desktop-shell .hover-gold-text {
|
||||
transition: color var(--duration-normal) var(--ease-smooth);
|
||||
}
|
||||
.desktop-shell .hover-gold-text:hover {
|
||||
color: var(--primary-light) !important;
|
||||
}
|
||||
|
||||
/* ── Form Elements ── */
|
||||
.desktop-shell input,
|
||||
.desktop-shell textarea {
|
||||
/* Form elements styling */
|
||||
.desktop-shell input {
|
||||
padding: 10px 12px;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-base);
|
||||
border-radius: var(--radius);
|
||||
transition: border-color var(--duration-normal) var(--ease-smooth),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth);
|
||||
font-size: 13px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.desktop-shell input:focus,
|
||||
.desktop-shell textarea:focus {
|
||||
.desktop-shell input:focus {
|
||||
border-color: var(--border-gold) !important;
|
||||
box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2) !important;
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2) !important;
|
||||
}
|
||||
|
||||
/* ── Button System ── */
|
||||
/* Button hover overrides */
|
||||
.desktop-shell .btn-gold-outline {
|
||||
transition: background-color var(--duration-normal) var(--ease-smooth),
|
||||
border-color var(--duration-normal) var(--ease-smooth),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth),
|
||||
transform var(--duration-fast) var(--ease-out-expo);
|
||||
transition: background-color 0.2s, border-color 0.2s;
|
||||
}
|
||||
.desktop-shell .btn-gold-outline:hover:not(:disabled) {
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: var(--border-gold);
|
||||
box-shadow: var(--glow-gold);
|
||||
}
|
||||
.desktop-shell .btn-gold-outline:active {
|
||||
transform: translateY(1px);
|
||||
transform: none; /* No mobile shrink on PC */
|
||||
}
|
||||
|
||||
.desktop-shell .btn-primary {
|
||||
transition: filter var(--duration-normal) var(--ease-smooth),
|
||||
transform var(--duration-fast) var(--ease-out-expo),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth);
|
||||
transition: filter 0.2s, transform 0.1s;
|
||||
}
|
||||
.desktop-shell .btn-primary:hover:not(:disabled) {
|
||||
filter: brightness(1.1);
|
||||
box-shadow: var(--glow-gold);
|
||||
}
|
||||
.desktop-shell .btn-primary:active {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
|
||||
/* ── Skeleton Loading Animation ── */
|
||||
/* Skeleton rows animation for high density PC loaders */
|
||||
@keyframes desktop-skeleton-glow {
|
||||
0% { background-position: -200% 0; }
|
||||
100% { background-position: 200% 0; }
|
||||
}
|
||||
|
||||
.desktop-skeleton {
|
||||
background: linear-gradient(90deg, #161616 25%, #222222 37%, #161616 63%);
|
||||
background: linear-gradient(90deg, #0A2540 25%, rgba(255, 255, 255, 0.06) 37%, #0A2540 63%);
|
||||
background-size: 400% 100%;
|
||||
animation: desktop-skeleton-glow 1.4s ease infinite;
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
/* ── Bet Locate Pulse ── */
|
||||
@keyframes bet-locate-pulse {
|
||||
0%, 100% {
|
||||
box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
|
||||
0%,
|
||||
100% {
|
||||
box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.45);
|
||||
box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,51 +98,5 @@
|
||||
animation: bet-locate-pulse 0.6s ease 3;
|
||||
border-color: var(--border-gold) !important;
|
||||
position: relative;
|
||||
z-index: var(--z-card);
|
||||
}
|
||||
|
||||
/* ── Fade-in Stagger Utility ── */
|
||||
@keyframes desktop-fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(12px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.desktop-shell .anim-fade-in {
|
||||
animation: desktop-fade-in 0.5s var(--ease-out-expo) both;
|
||||
animation-delay: var(--stagger-delay, 0ms);
|
||||
}
|
||||
|
||||
/* ── Scale Press Micro-interaction ── */
|
||||
.desktop-shell .press-scale {
|
||||
transition: transform var(--duration-fast) var(--ease-out-expo);
|
||||
}
|
||||
.desktop-shell .press-scale:active {
|
||||
transform: scale(0.97);
|
||||
}
|
||||
|
||||
/* ── Hover Lift Effect ── */
|
||||
.desktop-shell .hover-lift {
|
||||
transition: transform var(--duration-normal) var(--ease-out-expo),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth);
|
||||
}
|
||||
.desktop-shell .hover-lift:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
/* ── Reduced Motion Preference ── */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.desktop-shell *,
|
||||
.desktop-shell *::before,
|
||||
.desktop-shell *::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -1,54 +1,34 @@
|
||||
/* ═══════════════════════════════════════════════════════════
|
||||
Desktop Global layout structure
|
||||
Style: Modern Dark + Gold Accent — layered depth + glassmorphism
|
||||
═══════════════════════════════════════════════════════════ */
|
||||
|
||||
/* Desktop Global layout structure */
|
||||
.desktop-shell {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #0d0b08;
|
||||
background-image:
|
||||
radial-gradient(ellipse 90% 68% at 50% 0%, rgba(246, 210, 108, 0.14), transparent 58%),
|
||||
linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.58)),
|
||||
url('../../assets/images/generated/pc-global-bg-v1.webp');
|
||||
background-color: #001A33;
|
||||
/* background-image removed for theme-4 */
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-attachment: fixed;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Subtle ambient overlay for depth */
|
||||
.desktop-shell::after {
|
||||
content: '';
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 221, 128, 0.08) 0%, transparent 60%);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.desktop-header-wrap {
|
||||
flex-shrink: 0;
|
||||
height: var(--desktop-header-h);
|
||||
background: #12100c url('../../assets/images/generated/pc-top-nav-bg-v1.webp') center / 100% 100% no-repeat;
|
||||
border-bottom: 0;
|
||||
z-index: var(--z-header);
|
||||
background: #001A33;
|
||||
border-bottom: 1px solid var(--border);
|
||||
z-index: 120;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
transition: background var(--duration-normal) var(--ease-smooth);
|
||||
}
|
||||
|
||||
.desktop-marquee-wrap {
|
||||
flex-shrink: 0;
|
||||
z-index: var(--z-sticky);
|
||||
z-index: 110;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: rgba(26, 24, 19, 0.78);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
background: #001A33;
|
||||
}
|
||||
|
||||
.desktop-shell.betslip-hidden {
|
||||
@@ -64,8 +44,6 @@
|
||||
display: flex;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
z-index: var(--z-base);
|
||||
}
|
||||
|
||||
.desktop-main-container {
|
||||
@@ -77,7 +55,7 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* ── Betting Layout: Sports bar + Left Sidebar + Center View + Right Betslip ── */
|
||||
/* Betting Layout: Sports bar + Left Sidebar + Center View + Right Betslip */
|
||||
.desktop-layout-betting-wrap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -91,9 +69,7 @@
|
||||
width: 100%;
|
||||
padding: 0 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: rgba(26, 24, 19, 0.76);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
background: rgba(0, 26, 51, 0.9);
|
||||
}
|
||||
|
||||
.desktop-layout-betting {
|
||||
@@ -106,15 +82,13 @@
|
||||
|
||||
.desktop-betting-left {
|
||||
border-right: 1px solid var(--border);
|
||||
background: rgba(26, 24, 19, 0.56);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
background: rgba(10, 37, 64, 0.8);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.desktop-betting-center {
|
||||
overflow-y: auto;
|
||||
padding: var(--space-4);
|
||||
padding: 14px 16px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@@ -122,7 +96,7 @@
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* ── Account Layout: full-width records center ── */
|
||||
/* Account Layout: full-width records center */
|
||||
.desktop-layout-account {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -138,7 +112,7 @@
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
padding: var(--space-7) var(--space-10) var(--space-10);
|
||||
padding: 28px 40px 40px;
|
||||
}
|
||||
|
||||
.desktop-account-center > .desktop-records-page {
|
||||
@@ -146,13 +120,6 @@
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.desktop-account-center > .desktop-records-page.profile-page,
|
||||
.desktop-account-center > .desktop-records-page.edit-page {
|
||||
overflow-y: auto;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.desktop-account-center > .desktop-account-page {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@@ -167,7 +134,7 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ── Marketing / Home Layout: Single Column centered ── */
|
||||
/* Marketing / Home Layout: Single Column centered */
|
||||
.desktop-layout-marketing {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -175,7 +142,7 @@
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
align-items: center;
|
||||
padding: var(--space-5);
|
||||
padding: 20px;
|
||||
-ms-overflow-style: none; /* IE and Edge */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
@@ -189,7 +156,7 @@
|
||||
max-width: 1400px;
|
||||
}
|
||||
|
||||
/* ── Hub Layout: Left Sidebar (List) + Right Outlet (Detail) ── */
|
||||
/* Hub Layout: Left Sidebar (List) + Right Outlet (Detail) */
|
||||
.desktop-layout-hub {
|
||||
display: grid;
|
||||
grid-template-columns: 320px 1fr;
|
||||
@@ -200,8 +167,6 @@
|
||||
.desktop-hub-left {
|
||||
border-right: 1px solid var(--border);
|
||||
background: var(--desktop-sidebar-panel-bg);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -209,11 +174,11 @@
|
||||
|
||||
.desktop-hub-right {
|
||||
overflow-y: auto;
|
||||
padding: var(--space-5);
|
||||
background: rgba(18, 16, 12, 0.18);
|
||||
padding: 20px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
/* ── Auth Layout: Centered container ── */
|
||||
/* Auth Layout: Centered container */
|
||||
.desktop-layout-auth {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -221,15 +186,15 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: var(--space-10);
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
.desktop-auth-card {
|
||||
width: 100%;
|
||||
max-width: 440px;
|
||||
padding: 30px;
|
||||
background: rgba(20, 20, 20, 0.95);
|
||||
background: rgba(10, 37, 64, 0.95);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-lg), var(--glow-gold);
|
||||
border-radius: 8px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
@@ -1,30 +1,25 @@
|
||||
/* ═══════════════════════════════════════════════════════════
|
||||
PC account records: bets, wallet, recharge, cashbacks
|
||||
Style: Modern Dark + Gold Accent — premium data table
|
||||
═══════════════════════════════════════════════════════════ */
|
||||
|
||||
/* PC account records: bets, wallet, recharge, cashbacks */
|
||||
.desktop-records-page {
|
||||
width: 100%;
|
||||
max-width: 1480px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* ── Header ── */
|
||||
.desktop-records-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-5) var(--space-8);
|
||||
gap: 20px 32px;
|
||||
flex-wrap: wrap;
|
||||
flex-shrink: 0;
|
||||
padding-bottom: var(--space-4);
|
||||
padding-bottom: 14px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
@@ -39,7 +34,7 @@
|
||||
.desktop-records-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -47,42 +42,27 @@
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--space-2) 18px;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 8px 18px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--primary-light);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-base);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: background var(--duration-normal) var(--ease-smooth),
|
||||
border-color var(--duration-normal) var(--ease-smooth),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth),
|
||||
transform var(--duration-fast) var(--ease-out-expo);
|
||||
transition: background 0.2s, border-color 0.2s;
|
||||
}
|
||||
|
||||
.desktop-records-action-btn:hover {
|
||||
background: rgba(212, 175, 55, 0.14);
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
border-color: var(--border-gold);
|
||||
box-shadow: var(--glow-gold);
|
||||
}
|
||||
|
||||
.desktop-records-action-btn:active {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
|
||||
.desktop-records-action-btn:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ── Filter System ── */
|
||||
.desktop-records-filter-bar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@@ -90,20 +70,19 @@
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-3) 14px;
|
||||
gap: 10px 14px;
|
||||
}
|
||||
|
||||
.desktop-records-filter-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.desktop-records-filter-group-label {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 400;
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
@@ -119,60 +98,45 @@
|
||||
|
||||
.desktop-records-filter-chip {
|
||||
padding: 7px 16px;
|
||||
border-radius: var(--radius-md);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-sm);
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: color var(--duration-normal) var(--ease-smooth),
|
||||
border-color var(--duration-normal) var(--ease-smooth),
|
||||
background var(--duration-normal) var(--ease-smooth),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth);
|
||||
transition: color 0.2s, border-color 0.2s, background 0.2s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.desktop-records-filter-chip:hover {
|
||||
color: #fff;
|
||||
border-color: rgba(212, 175, 55, 0.25);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.desktop-records-filter-chip.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: rgba(212, 175, 55, 0.35);
|
||||
box-shadow: 0 0 8px rgba(212, 175, 55, 0.1);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
|
||||
.desktop-records-filter-chip:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ── Wallet Sub Nav ── */
|
||||
.desktop-wallet-subnav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-1);
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.desktop-wallet-subnav-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: var(--space-2) var(--space-4);
|
||||
border-radius: var(--radius-md);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-base);
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
text-decoration: none;
|
||||
border: 1px solid transparent;
|
||||
transition: color var(--duration-normal) var(--ease-smooth),
|
||||
background var(--duration-normal) var(--ease-smooth),
|
||||
border-color var(--duration-normal) var(--ease-smooth);
|
||||
transition: color 0.2s, background 0.2s, border-color 0.2s;
|
||||
}
|
||||
|
||||
.desktop-wallet-subnav-link:hover {
|
||||
@@ -182,28 +146,19 @@
|
||||
|
||||
.desktop-wallet-subnav-link.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: rgba(212, 175, 55, 0.28);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: rgba(255, 255, 255, 0.28);
|
||||
}
|
||||
|
||||
.desktop-wallet-subnav-link:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ── Panel & Table ── */
|
||||
.desktop-records-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
background: rgba(18, 18, 18, 0.92);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
background: rgba(10, 37, 64, 0.94);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.desktop-records-table-wrap {
|
||||
@@ -215,53 +170,34 @@
|
||||
.desktop-records-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-base);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* ── Table Header ── */
|
||||
.desktop-records-table th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: var(--z-sticky);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
z-index: 2;
|
||||
padding: 12px 16px;
|
||||
text-align: left;
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 400;
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
color: var(--text-muted);
|
||||
background: rgba(12, 12, 12, 0.97);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
background: #0A2540;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.08em;
|
||||
letter-spacing: 0.06em;
|
||||
border-bottom: 1px solid var(--border);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Gold accent line under thead */
|
||||
.desktop-records-table thead tr::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.desktop-records-table th.num-th {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* ── Table Body ── */
|
||||
.desktop-records-table td {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
||||
color: var(--text);
|
||||
vertical-align: middle;
|
||||
transition: background var(--duration-fast) var(--ease-smooth);
|
||||
}
|
||||
|
||||
.desktop-records-table tbody tr:nth-child(even) {
|
||||
@@ -269,8 +205,7 @@
|
||||
}
|
||||
|
||||
.desktop-records-table tbody tr.hover-row {
|
||||
transition: background var(--duration-fast) var(--ease-smooth),
|
||||
box-shadow var(--duration-fast) var(--ease-smooth);
|
||||
transition: background 0.15s;
|
||||
}
|
||||
|
||||
.desktop-records-table tbody tr.clickable-row {
|
||||
@@ -279,16 +214,14 @@
|
||||
|
||||
.desktop-records-table tbody tr.hover-row:hover,
|
||||
.desktop-records-table tbody tr.clickable-row:hover {
|
||||
background: rgba(212, 175, 55, 0.04);
|
||||
box-shadow: inset 3px 0 0 var(--primary);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
/* ── Cell Styles ── */
|
||||
.desktop-records-table .id-cell {
|
||||
color: var(--text);
|
||||
font-weight: 700;
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--text-sm);
|
||||
font-family: 'SF Mono', 'Consolas', monospace;
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
@@ -296,27 +229,21 @@
|
||||
text-align: right;
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 700;
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
.desktop-records-table .date-cell {
|
||||
white-space: nowrap;
|
||||
color: var(--text-muted);
|
||||
font-size: var(--text-sm);
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* ── Pagination ── */
|
||||
.desktop-records-pagination {
|
||||
flex-shrink: 0;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
border-top: 1px solid var(--border-subtle);
|
||||
background: rgba(10, 10, 10, 0.5);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
padding: 12px 16px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
||||
background: rgba(0, 26, 51, 0.5);
|
||||
}
|
||||
|
||||
/* ── Loading & Empty States ── */
|
||||
.desktop-records-loading,
|
||||
.desktop-records-empty {
|
||||
display: flex;
|
||||
@@ -326,10 +253,9 @@
|
||||
gap: 14px;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: var(--space-12) var(--space-6);
|
||||
padding: 48px 24px;
|
||||
color: var(--text-muted);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-md);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -341,15 +267,15 @@
|
||||
|
||||
.desktop-records-table-empty {
|
||||
text-align: center;
|
||||
padding: 56px var(--space-4) !important;
|
||||
padding: 56px 16px !important;
|
||||
color: var(--text-muted);
|
||||
font-size: var(--text-md);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.desktop-records-table-empty .empty-hint {
|
||||
margin: var(--space-2) 0 0;
|
||||
font-size: var(--text-base);
|
||||
margin: 8px 0 0;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
line-height: 1.6;
|
||||
color: var(--text-muted);
|
||||
@@ -360,77 +286,27 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 280px;
|
||||
padding: var(--space-12) var(--space-6);
|
||||
padding: 48px 24px;
|
||||
}
|
||||
|
||||
/* ── Status Badges ── */
|
||||
.desktop-records-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-sm);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.03em;
|
||||
white-space: nowrap;
|
||||
transition: transform var(--duration-fast) var(--ease-out-expo);
|
||||
}
|
||||
|
||||
.desktop-records-status::before {
|
||||
content: '';
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.desktop-records-status.status-won { background: rgba(52, 199, 89, 0.12); color: #4cd964; }
|
||||
.desktop-records-status.status-lost { background: rgba(255, 69, 58, 0.12); color: #ff453a; }
|
||||
.desktop-records-status.status-pending { background: rgba(255, 255, 255, 0.12); color: var(--primary-light); }
|
||||
.desktop-records-status.status-push { background: rgba(100, 100, 100, 0.12); color: #aaa; }
|
||||
.desktop-records-status.status-cancelled { background: rgba(100, 100, 100, 0.1); color: #777; }
|
||||
.desktop-records-status.status-default { background: rgba(100, 100, 100, 0.1); color: #888; }
|
||||
|
||||
.desktop-records-status.status-won {
|
||||
background: rgba(52, 199, 89, 0.12);
|
||||
color: #4cd964;
|
||||
}
|
||||
.desktop-records-status.status-won::before { background: #4cd964; }
|
||||
|
||||
.desktop-records-status.status-lost {
|
||||
background: rgba(255, 69, 58, 0.12);
|
||||
color: #ff453a;
|
||||
}
|
||||
.desktop-records-status.status-lost::before { background: #ff453a; }
|
||||
|
||||
.desktop-records-status.status-pending {
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
.desktop-records-status.status-pending::before {
|
||||
background: var(--primary-light);
|
||||
animation: pulse-dot 1.6s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.desktop-records-status.status-push {
|
||||
background: rgba(100, 100, 100, 0.12);
|
||||
color: #aaa;
|
||||
}
|
||||
.desktop-records-status.status-push::before { background: #aaa; }
|
||||
|
||||
.desktop-records-status.status-cancelled {
|
||||
background: rgba(100, 100, 100, 0.1);
|
||||
color: #777;
|
||||
}
|
||||
.desktop-records-status.status-cancelled::before { background: #777; }
|
||||
|
||||
.desktop-records-status.status-default {
|
||||
background: rgba(100, 100, 100, 0.1);
|
||||
color: #888;
|
||||
}
|
||||
.desktop-records-status.status-default::before { background: #888; }
|
||||
|
||||
@keyframes pulse-dot {
|
||||
0%, 100% { opacity: 1; transform: scale(1); }
|
||||
50% { opacity: 0.5; transform: scale(0.7); }
|
||||
}
|
||||
|
||||
/* ── Amount Colors ── */
|
||||
.desktop-records-amount.pos { color: var(--primary-light); }
|
||||
.desktop-records-amount.neg { color: var(--danger); }
|
||||
.desktop-records-amount.zero { color: var(--text-muted); }
|
||||
|
||||
@@ -1,123 +1,46 @@
|
||||
/* ═══════════════════════════════════════════════════════════
|
||||
Desktop Design Tokens — TheBet365
|
||||
Style: Modern Dark + Gold Accent (Cinema Mobile)
|
||||
Typography: Russo One / Chakra Petch
|
||||
═══════════════════════════════════════════════════════════ */
|
||||
|
||||
/* ── Google Fonts Import ── */
|
||||
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@300;400;500;600;700&family=Russo+One&display=swap');
|
||||
|
||||
.desktop-shell {
|
||||
/* ── Color Palette ── */
|
||||
--primary: #D4AF37;
|
||||
--primary-dark: #A8841F;
|
||||
--primary-light: #F0D875;
|
||||
--secondary: #1c1a15;
|
||||
--tertiary: #0f0d09;
|
||||
/* Color Palette overrides */
|
||||
--primary: rgba(255, 255, 255, 0.92);
|
||||
--primary-dark: rgba(255, 255, 255, 0.78);
|
||||
--primary-light: rgba(255, 255, 255, 0.68);
|
||||
--secondary: #0A3558;
|
||||
--tertiary: #001A33;
|
||||
--neutral: #8E8E93;
|
||||
--bg-body: #0d0b08;
|
||||
--bg-card: rgba(32, 30, 24, 0.82);
|
||||
--bg-card-hover: rgba(44, 40, 31, 0.9);
|
||||
--bg-hover: rgba(52, 48, 38, 0.9);
|
||||
--bg-elevated: rgba(62, 57, 45, 0.92);
|
||||
--bg-surface: rgba(28, 26, 21, 0.8);
|
||||
--text: #FFFFFF;
|
||||
--text-secondary: #D3CBB8;
|
||||
--text-muted: #B5AD9B;
|
||||
--border: rgba(255, 226, 156, 0.16);
|
||||
--border-subtle: rgba(255, 235, 185, 0.1);
|
||||
--border-gold: #D4AF37;
|
||||
--border-gold-soft: rgba(212, 175, 55, 0.25);
|
||||
--bg-body: #001A33;
|
||||
--bg-card: rgba(255, 255, 255, 0.045);
|
||||
--bg-hover: rgba(255, 255, 255, 0.06);
|
||||
--bg-elevated: rgba(255, 255, 255, 0.08);
|
||||
--text: rgba(255, 255, 255, 0.94);
|
||||
--text-muted: rgba(255, 255, 255, 0.56);
|
||||
--border: rgba(255, 255, 255, 0.1);
|
||||
--border-gold: rgba(255, 255, 255, 0.2);
|
||||
--border-gold-soft: rgba(255, 255, 255, 0.18);
|
||||
--border-w: 1px;
|
||||
--border-w-thick: 1px;
|
||||
--danger: #FF453A;
|
||||
--success: #34C759;
|
||||
--warning: #FFD60A;
|
||||
--radius: 4px;
|
||||
--radius-sm: 2px;
|
||||
--radius-md: 8px;
|
||||
--radius-lg: 12px;
|
||||
--radius-xl: 16px;
|
||||
--danger: rgba(255, 255, 255, 0.62);
|
||||
--radius: 12px;
|
||||
--radius-sm: 8px;
|
||||
--shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 32px rgba(0, 0, 0, 0.22);
|
||||
--shadow-gold: none;
|
||||
--glow-gold: none;
|
||||
|
||||
/* ── Shadows & Elevation ── */
|
||||
--shadow: 0 4px 16px rgba(0, 0, 0, 0.65);
|
||||
--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
|
||||
--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
|
||||
--shadow-gold: 0 2px 12px rgba(212, 175, 55, 0.15);
|
||||
--shadow-gold-lg: 0 4px 24px rgba(212, 175, 55, 0.2);
|
||||
--glow-gold: 0 0 6px rgba(212, 175, 55, 0.15);
|
||||
--glow-gold-md: 0 0 16px rgba(212, 175, 55, 0.2);
|
||||
--glow-gold-lg: 0 0 24px rgba(212, 175, 55, 0.25);
|
||||
|
||||
/* ── Backdrop Blur ── */
|
||||
--blur-sm: blur(8px);
|
||||
--blur-md: blur(16px);
|
||||
--blur-lg: blur(24px);
|
||||
|
||||
/* ── PC Dimensioning ── */
|
||||
/* PC Dimensioning */
|
||||
--desktop-header-h: 56px;
|
||||
--desktop-left-sidebar-w: 220px;
|
||||
--desktop-right-betslip-w: 288px;
|
||||
--desktop-right-betslip-expanded-w: 288px;
|
||||
--desktop-right-betslip-collapsed-w: 40px;
|
||||
|
||||
/* ── Desktop specific vars ── */
|
||||
--desktop-bg: #0d0b08;
|
||||
--desktop-border: rgba(255, 226, 156, 0.16);
|
||||
--desktop-sidebar-bg: rgba(30, 28, 23, 0.82);
|
||||
--desktop-sidebar-panel-bg: linear-gradient(rgba(18, 16, 12, 0.52), rgba(18, 16, 12, 0.64)), url('../../assets/images/generated/pc-sidebar-bg-v1.webp') no-repeat center / cover;
|
||||
|
||||
/* ── Spacing Scale (8dp rhythm) ── */
|
||||
--space-1: 4px;
|
||||
--space-2: 8px;
|
||||
--space-3: 12px;
|
||||
--space-4: 16px;
|
||||
--space-5: 20px;
|
||||
--space-6: 24px;
|
||||
--space-7: 28px;
|
||||
--space-8: 32px;
|
||||
--space-10: 40px;
|
||||
--space-12: 48px;
|
||||
--space-16: 64px;
|
||||
|
||||
/* ── Typography ── */
|
||||
--font-display: 'Russo One', 'Chakra Petch', sans-serif;
|
||||
--font-body: 'Chakra Petch', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
--font-mono: 'SF Mono', 'Consolas', 'Chakra Petch', monospace;
|
||||
|
||||
--text-xs: 10px;
|
||||
--text-sm: 11px;
|
||||
--text-base: 13px;
|
||||
--text-md: 14px;
|
||||
--text-lg: 16px;
|
||||
--text-xl: 18px;
|
||||
--text-2xl: 22px;
|
||||
--text-3xl: 28px;
|
||||
/* Desktop specific added vars */
|
||||
--desktop-bg: #001A33;
|
||||
--desktop-border: rgba(255, 255, 255, 0.1);
|
||||
--desktop-sidebar-bg: rgba(10, 37, 64, 0.95);
|
||||
--desktop-sidebar-panel-bg: linear-gradient(rgba(0, 26, 51, 0.88), rgba(0, 26, 51, 0.88));
|
||||
|
||||
/* Reset typography inside desktop */
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-base);
|
||||
line-height: 1.5;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
color: var(--text);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
/* ── Transition Timings ── */
|
||||
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
--ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
|
||||
--duration-fast: 150ms;
|
||||
--duration-normal: 200ms;
|
||||
--duration-smooth: 300ms;
|
||||
--duration-emphasis: 400ms;
|
||||
|
||||
/* ── Z-index Scale ── */
|
||||
--z-base: 0;
|
||||
--z-card: 10;
|
||||
--z-sticky: 20;
|
||||
--z-overlay: 40;
|
||||
--z-modal: 100;
|
||||
--z-popover: 110;
|
||||
--z-header: 120;
|
||||
--z-tooltip: 1000;
|
||||
}
|
||||
|
||||
18
apps/player/src/utils/walletStats.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export type WalletTransactionStats = {
|
||||
netAmount?: string;
|
||||
byType?: Array<{ transactionType?: string; totalAmount?: string }>;
|
||||
};
|
||||
|
||||
const CASHBACK_TYPES = new Set(['CASHBACK', 'CASHBACK_DEPOSIT']);
|
||||
|
||||
/** Sum wallet credits from cashback transaction types (matches WalletDetailView fallback). */
|
||||
export function sumCashbackFromStats(stats: WalletTransactionStats | null | undefined): number {
|
||||
let sum = 0;
|
||||
for (const group of stats?.byType ?? []) {
|
||||
const type = group.transactionType?.toUpperCase() ?? '';
|
||||
if (CASHBACK_TYPES.has(type)) {
|
||||
sum += Math.abs(parseFloat(group.totalAmount ?? '0') || 0);
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
@@ -100,11 +100,20 @@ function goLogin() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="login-page" :class="{ 'login-page--desktop': props.desktop }" :style="props.desktop ? undefined : { backgroundImage: `url(${loginBg})` }">
|
||||
<div
|
||||
class="login-page"
|
||||
:class="{ 'login-page--desktop': props.desktop }"
|
||||
:style="props.desktop ? undefined : { backgroundImage: `url(${loginBg})` }"
|
||||
>
|
||||
<div v-if="!props.desktop" class="login-lang">
|
||||
<LocaleSwitcher compact />
|
||||
</div>
|
||||
<form @submit.prevent="submit" class="login-form" :class="{ 'ps-gold-frame': !props.desktop }">
|
||||
<div class="login-stack">
|
||||
<form
|
||||
@submit.prevent="submit"
|
||||
class="login-form"
|
||||
:class="{ 'ps-gold-frame': !props.desktop }"
|
||||
>
|
||||
<h2 class="form-title">{{ t('auth.forgot_password_title') }}</h2>
|
||||
|
||||
<div class="field">
|
||||
@@ -114,6 +123,7 @@ function goLogin() {
|
||||
<input
|
||||
v-model="phone"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="tel"
|
||||
required
|
||||
autocomplete="tel-national"
|
||||
@@ -128,6 +138,7 @@ function goLogin() {
|
||||
<input
|
||||
v-model="smsCode"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
inputmode="numeric"
|
||||
maxlength="6"
|
||||
autocomplete="one-time-code"
|
||||
@@ -149,6 +160,7 @@ function goLogin() {
|
||||
<input
|
||||
v-model="password"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="password"
|
||||
required
|
||||
autocomplete="new-password"
|
||||
@@ -162,6 +174,7 @@ function goLogin() {
|
||||
<input
|
||||
v-model="confirmPassword"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="password"
|
||||
required
|
||||
autocomplete="new-password"
|
||||
@@ -171,13 +184,25 @@ function goLogin() {
|
||||
|
||||
<p v-if="fieldError()" class="error">{{ fieldError() }}</p>
|
||||
|
||||
<button type="submit" class="btn-login btn-gold-outline" :disabled="loading">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn-login btn-gold-outline"
|
||||
:disabled="loading"
|
||||
>
|
||||
{{ t('auth.reset_password_btn') }}
|
||||
</button>
|
||||
<button type="button" class="btn-skip" @click="goLogin">
|
||||
|
||||
<button v-if="props.desktop" type="button" class="btn-skip btn-skip--desktop" @click="goLogin">
|
||||
{{ t('auth.back_to_login') }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div v-if="!props.desktop" class="login-actions">
|
||||
<button type="button" class="btn-skip" @click="goLogin">
|
||||
{{ t('auth.back_to_login') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -186,7 +211,7 @@ function goLogin() {
|
||||
position: absolute;
|
||||
top: max(12px, env(safe-area-inset-top));
|
||||
right: 16px;
|
||||
z-index: 2;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.login-page {
|
||||
@@ -199,12 +224,27 @@ function goLogin() {
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 30vh 16px calc(10vh + max(20px, env(safe-area-inset-bottom)));
|
||||
background-color: var(--tertiary);
|
||||
background-color: var(--bg-body);
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.login-page::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(0, 34, 68, 0.35) 0%,
|
||||
rgba(0, 34, 68, 0.78) 52%,
|
||||
rgba(0, 34, 68, 0.94) 100%
|
||||
);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* ===== Desktop mode: fields only (card shell in DesktopAuthLayout) ===== */
|
||||
.login-page--desktop {
|
||||
min-height: auto;
|
||||
height: auto;
|
||||
@@ -216,13 +256,30 @@ function goLogin() {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
.login-page--desktop::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.login-stack {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.login-page--desktop .login-stack {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.login-page--desktop .login-form {
|
||||
@@ -235,6 +292,14 @@ function goLogin() {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.login-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 0 14px 4px;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
margin: 0 0 2px;
|
||||
font-size: 16px;
|
||||
@@ -247,7 +312,7 @@ function goLogin() {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
color: var(--primary-light, #f0d875);
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
@@ -274,32 +339,28 @@ label {
|
||||
}
|
||||
|
||||
.field-input {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #0d0d0d;
|
||||
background-color: #0d0d0d;
|
||||
background: var(--bg-input);
|
||||
color: var(--text);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
caret-color: var(--primary-light, #f0d875);
|
||||
}
|
||||
|
||||
.field-input::placeholder {
|
||||
color: rgba(255, 255, 255, 0.32);
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.field-input:focus {
|
||||
outline: none;
|
||||
border-color: #555;
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
/* Desktop: visible focus ring per UX guideline */
|
||||
.login-page--desktop .field-input {
|
||||
height: 46px;
|
||||
font-size: 14px;
|
||||
@@ -308,31 +369,12 @@ label {
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:focus {
|
||||
border-color: var(--border-gold, #d4af37);
|
||||
color: var(--text);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.06), transparent 72%),
|
||||
#0d0d0d;
|
||||
background-color: #0d0d0d;
|
||||
box-shadow:
|
||||
inset 0 0 18px rgba(212, 175, 55, 0.08),
|
||||
0 0 14px rgba(212, 175, 55, 0.14);
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:-webkit-autofill,
|
||||
.login-page--desktop .field-input:-webkit-autofill:hover,
|
||||
.login-page--desktop .field-input:-webkit-autofill:focus {
|
||||
border-color: var(--border-gold, #d4af37);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
box-shadow:
|
||||
0 0 0 1000px #0d0d0d inset,
|
||||
inset 0 0 18px rgba(212, 175, 55, 0.08);
|
||||
transition: background-color 9999s ease-out;
|
||||
border-color: var(--border-strong);
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:hover:not(:focus) {
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.inline-row {
|
||||
@@ -352,7 +394,7 @@ label {
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #141414;
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
@@ -369,8 +411,14 @@ label {
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-secondary:hover:not(:disabled) {
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
background: rgba(30, 30, 30, 0.8);
|
||||
border-color: var(--border-gold-soft);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.btn-secondary:not(:disabled):active {
|
||||
border-color: var(--border-gold);
|
||||
background: var(--surface-accent);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.btn-secondary:disabled {
|
||||
@@ -384,6 +432,10 @@ label {
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
|
||||
}
|
||||
|
||||
@@ -396,8 +448,12 @@ label {
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-login:hover:not(:disabled) {
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: var(--border-gold, #d4af37);
|
||||
background: var(--surface-accent);
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-login:active:not(:disabled) {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.btn-login:disabled {
|
||||
@@ -405,6 +461,10 @@ label {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-login:disabled {
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.btn-skip {
|
||||
margin-top: 2px;
|
||||
padding: 8px 14px;
|
||||
@@ -417,24 +477,24 @@ label {
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-skip {
|
||||
.btn-skip:active {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
|
||||
.btn-skip--desktop {
|
||||
margin-top: 6px;
|
||||
padding: 12px 16px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border, #333);
|
||||
background: rgba(20, 20, 20, 0.6);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-input);
|
||||
font-size: 14px;
|
||||
transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-skip:hover {
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
background: rgba(30, 30, 30, 0.8);
|
||||
}
|
||||
|
||||
.btn-skip:active {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
.btn-skip--desktop:hover:not(:disabled) {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.error {
|
||||
@@ -450,6 +510,17 @@ label {
|
||||
padding: 6px 10px;
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 69, 58, 0.08);
|
||||
border-left: 2px solid var(--danger, #ff453a);
|
||||
border-left: 2px solid var(--danger);
|
||||
}
|
||||
|
||||
/* Respect reduced motion */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -88,10 +88,15 @@ function goRegister() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="login-page" :class="{ 'login-page--desktop': props.desktop }" :style="props.desktop ? undefined : { backgroundImage: `url(${loginBg})` }">
|
||||
<div
|
||||
class="login-page"
|
||||
:class="{ 'login-page--desktop': props.desktop }"
|
||||
:style="props.desktop ? undefined : { backgroundImage: `url(${loginBg})` }"
|
||||
>
|
||||
<div v-if="!props.desktop" class="login-lang">
|
||||
<LocaleSwitcher compact />
|
||||
</div>
|
||||
<div class="login-stack">
|
||||
<form
|
||||
@submit.prevent="submit"
|
||||
class="login-form"
|
||||
@@ -101,12 +106,34 @@ function goRegister() {
|
||||
<GoldSpinner :size="40" :active="true" />
|
||||
<p class="form-busy-text">{{ t('auth.logging_in') }}</p>
|
||||
</div>
|
||||
|
||||
<h2 v-if="props.desktop" class="form-title">{{ t('auth.login') }}</h2>
|
||||
|
||||
<div class="auth-tabs" :class="{ 'auth-tabs--desktop': props.desktop }">
|
||||
<button
|
||||
type="button"
|
||||
class="auth-tab"
|
||||
:class="{ active: loginMode === 'account' }"
|
||||
@click="switchLoginMode('account')"
|
||||
>
|
||||
{{ t('auth.login_by_account') }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="auth-tab"
|
||||
:class="{ active: loginMode === 'phone' }"
|
||||
@click="switchLoginMode('phone')"
|
||||
>
|
||||
{{ t('auth.login_by_phone') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="loginMode === 'account'" class="field">
|
||||
<label>{{ t('auth.username') }}</label>
|
||||
<input
|
||||
v-model="account"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
required
|
||||
autocomplete="username"
|
||||
maxlength="32"
|
||||
@@ -122,6 +149,7 @@ function goRegister() {
|
||||
<input
|
||||
v-model="phone"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="tel"
|
||||
required
|
||||
autocomplete="tel-national"
|
||||
@@ -133,22 +161,21 @@ function goRegister() {
|
||||
|
||||
<div class="field">
|
||||
<label>{{ t('auth.password') }}</label>
|
||||
<input v-model="password" class="field-input" type="password" required autocomplete="current-password" :disabled="loading" />
|
||||
<input
|
||||
v-model="password"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="password"
|
||||
required
|
||||
autocomplete="current-password"
|
||||
:disabled="loading"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn-forgot" :disabled="loading" @click="goForgotPassword">
|
||||
{{ t('auth.forgot_password') }}
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn-mode-switch"
|
||||
:disabled="loading"
|
||||
@click="switchLoginMode(loginMode === 'account' ? 'phone' : 'account')"
|
||||
>
|
||||
{{ loginMode === 'account' ? t('auth.login_by_phone') : t('auth.login_by_account') }}
|
||||
</button>
|
||||
|
||||
<RobotVerify ref="captchaRef" />
|
||||
<p v-if="resetSuccess" class="success">{{ t('auth.reset_success') }}</p>
|
||||
<p v-if="error" class="error">{{ error }}</p>
|
||||
@@ -165,14 +192,22 @@ function goRegister() {
|
||||
</span>
|
||||
<span v-else>{{ t('auth.login') }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn-skip" :disabled="loading" @click="goRegister">
|
||||
|
||||
<button v-if="props.desktop" type="button" class="btn-skip btn-skip--desktop" :disabled="loading" @click="goRegister">
|
||||
{{ t('auth.go_register') }}
|
||||
</button>
|
||||
</form>
|
||||
<button v-if="!props.desktop" type="button" class="btn-skip-light" @click="continueBrowsing">
|
||||
|
||||
<div v-if="!props.desktop" class="login-actions">
|
||||
<button type="button" class="btn-skip" @click="goRegister">
|
||||
{{ t('auth.go_register') }}
|
||||
</button>
|
||||
<button type="button" class="btn-skip-light" @click="continueBrowsing">
|
||||
{{ t('auth.continue_browsing') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -180,7 +215,7 @@ function goRegister() {
|
||||
position: absolute;
|
||||
top: max(12px, env(safe-area-inset-top));
|
||||
right: 16px;
|
||||
z-index: 2;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.login-page {
|
||||
@@ -192,13 +227,27 @@ function goRegister() {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 34vh 20px calc(15vh + max(28px, env(safe-area-inset-bottom)));
|
||||
background-color: var(--tertiary);
|
||||
padding: 34vh 20px max(20px, env(safe-area-inset-bottom));
|
||||
background-color: var(--bg-body);
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.login-page::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(0, 34, 68, 0.35) 0%,
|
||||
rgba(0, 34, 68, 0.78) 52%,
|
||||
rgba(0, 34, 68, 0.94) 100%
|
||||
);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* ===== Desktop mode: fields only (card shell in DesktopAuthLayout) ===== */
|
||||
.login-page--desktop {
|
||||
min-height: auto;
|
||||
@@ -211,26 +260,43 @@ function goRegister() {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light, #f0d875);
|
||||
text-align: left;
|
||||
letter-spacing: 0.04em;
|
||||
.login-page--desktop::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
.login-stack {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.login-page--desktop .login-stack {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 14px;
|
||||
transition: border-color 0.25s ease, box-shadow 0.25s ease;
|
||||
}
|
||||
|
||||
.login-page--desktop .login-form {
|
||||
max-width: none;
|
||||
width: 100%;
|
||||
gap: 10px;
|
||||
padding: 0;
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.login-form.is-busy {
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -245,7 +311,7 @@ function goRegister() {
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
border-radius: inherit;
|
||||
background: rgba(8, 8, 8, 0.72);
|
||||
background: rgba(0, 26, 51, 0.82);
|
||||
backdrop-filter: blur(2px);
|
||||
pointer-events: all;
|
||||
}
|
||||
@@ -254,7 +320,7 @@ function goRegister() {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: rgba(240, 216, 117, 0.95);
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
@@ -265,14 +331,65 @@ function goRegister() {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.login-page--desktop .login-form {
|
||||
max-width: none;
|
||||
width: 100%;
|
||||
gap: 10px;
|
||||
padding: 0;
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
.login-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 0 14px 4px;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
text-align: left;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.auth-tabs {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
margin-bottom: 4px;
|
||||
padding: 4px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.auth-tabs--desktop {
|
||||
margin-bottom: 6px;
|
||||
background: var(--bg-input);
|
||||
}
|
||||
|
||||
.auth-tab {
|
||||
flex: 1;
|
||||
min-height: 34px;
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid transparent;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, border-color 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.auth-tab.active {
|
||||
border-color: var(--border-gold);
|
||||
color: var(--text);
|
||||
background: var(--surface-accent);
|
||||
}
|
||||
|
||||
.login-page--desktop .auth-tab {
|
||||
min-height: 40px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.login-page--desktop .auth-tab.active {
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
.field {
|
||||
@@ -286,26 +403,25 @@ function goRegister() {
|
||||
}
|
||||
|
||||
.field-input {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #0d0d0d;
|
||||
background-color: #0d0d0d;
|
||||
background: var(--bg-input);
|
||||
color: var(--text);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
caret-color: var(--primary-light, #f0d875);
|
||||
}
|
||||
|
||||
.field-input::placeholder {
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.field-input:focus {
|
||||
outline: none;
|
||||
border-color: #555;
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
/* Desktop: visible focus ring per UX guideline */
|
||||
@@ -317,31 +433,12 @@ function goRegister() {
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:focus {
|
||||
border-color: var(--border-gold, #D4AF37);
|
||||
color: var(--text);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.06), transparent 72%),
|
||||
#0d0d0d;
|
||||
background-color: #0d0d0d;
|
||||
box-shadow:
|
||||
inset 0 0 18px rgba(212, 175, 55, 0.08),
|
||||
0 0 14px rgba(212, 175, 55, 0.14);
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:-webkit-autofill,
|
||||
.login-page--desktop .field-input:-webkit-autofill:hover,
|
||||
.login-page--desktop .field-input:-webkit-autofill:focus {
|
||||
border-color: var(--border-gold, #D4AF37);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
box-shadow:
|
||||
0 0 0 1000px #0d0d0d inset,
|
||||
inset 0 0 18px rgba(212, 175, 55, 0.08);
|
||||
transition: background-color 9999s ease-out;
|
||||
border-color: var(--border-strong);
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:hover:not(:focus) {
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.inline-row {
|
||||
@@ -367,30 +464,13 @@ label {
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
.btn-mode-switch {
|
||||
align-self: flex-start;
|
||||
margin: -2px 0 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgba(240, 216, 117, 0.75);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-mode-switch:hover {
|
||||
color: rgba(240, 216, 117, 0.95);
|
||||
}
|
||||
|
||||
.btn-forgot {
|
||||
align-self: flex-end;
|
||||
margin: -4px 0 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
@@ -398,15 +478,16 @@ label {
|
||||
}
|
||||
|
||||
.btn-forgot:active {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-forgot:hover {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.btn-mode-switch:active {
|
||||
color: rgba(240, 216, 117, 0.95);
|
||||
.btn-forgot:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn-login {
|
||||
@@ -432,8 +513,8 @@ label {
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-login:hover:not(:disabled) {
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: var(--border-gold, #D4AF37);
|
||||
background: var(--surface-accent);
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-login:active:not(:disabled) {
|
||||
@@ -453,22 +534,15 @@ label {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.btn-forgot:disabled,
|
||||
.btn-mode-switch:disabled,
|
||||
.btn-skip:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn-skip {
|
||||
margin-top: 2px;
|
||||
padding: 8px 14px;
|
||||
padding: 6px 14px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgba(255, 255, 255, 0.55);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
@@ -476,28 +550,29 @@ label {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-skip {
|
||||
.btn-skip--desktop {
|
||||
margin-top: 6px;
|
||||
padding: 12px 16px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border, #333);
|
||||
background: rgba(20, 20, 20, 0.6);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-input);
|
||||
font-size: 14px;
|
||||
transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-skip:hover {
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
background: rgba(30, 30, 30, 0.8);
|
||||
.btn-skip--desktop:hover:not(:disabled) {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.btn-skip:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn-skip-light {
|
||||
position: absolute;
|
||||
bottom: calc(20px + env(safe-area-inset-bottom));
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
padding: 8px 16px;
|
||||
padding: 6px 16px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgba(255, 255, 255, 0.45);
|
||||
@@ -505,6 +580,7 @@ label {
|
||||
font-weight: 300;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-skip-light:active {
|
||||
@@ -523,12 +599,12 @@ label {
|
||||
padding: 6px 10px;
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 69, 58, 0.08);
|
||||
border-left: 2px solid var(--danger, #FF453A);
|
||||
border-left: 2px solid var(--danger);
|
||||
}
|
||||
|
||||
.success {
|
||||
margin: 0;
|
||||
color: #6ee7a0;
|
||||
color: var(--success);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
@@ -539,8 +615,8 @@ label {
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
border-radius: 4px;
|
||||
background: rgba(110, 231, 160, 0.08);
|
||||
border-left: 2px solid #6ee7a0;
|
||||
background: rgba(52, 199, 89, 0.08);
|
||||
border-left: 2px solid var(--success);
|
||||
}
|
||||
|
||||
@keyframes login-fade-in {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onActivated, watch } from 'vue';
|
||||
|
||||
const { embedded = false, desktop = false } = defineProps<{ embedded?: boolean; desktop?: boolean }>();
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { formatLocalMatchDateTime } from '@thebet365/shared';
|
||||
@@ -15,24 +13,23 @@ const FALLBACK_IMG = '/uploads/banners/welcome.svg';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { t, locale } = useI18n();
|
||||
const { hubContentItems, loading, load } = usePlayerHome();
|
||||
const { announcementItems, bannerItems, loading, load } = usePlayerHome();
|
||||
|
||||
const announcementId = computed(() => String(route.params.id ?? ''));
|
||||
|
||||
const item = computed<PlayerContentItem | null>(() => {
|
||||
const id = announcementId.value;
|
||||
return hubContentItems.value.find((entry) => entry.id === id) ?? null;
|
||||
return (
|
||||
bannerItems.value.find((entry) => entry.id === id) ??
|
||||
announcementItems.value.find((entry) => entry.id === id) ??
|
||||
null
|
||||
);
|
||||
});
|
||||
|
||||
const isBanner = computed(() => item.value?.contentType === 'BANNER');
|
||||
|
||||
function goBack() {
|
||||
if (embedded) return;
|
||||
if (window.history.length > 1) {
|
||||
router.back();
|
||||
return;
|
||||
}
|
||||
router.push('/announcements');
|
||||
}
|
||||
|
||||
function goList() {
|
||||
@@ -108,21 +105,9 @@ watch(announcementId, () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="announce-detail" :class="{ 'announce-detail--embedded': embedded, 'announce-detail--desktop': desktop }">
|
||||
<header v-if="embedded" class="page-header page-header--embedded-detail">
|
||||
<h1>{{ t('announcements.detail_title') }}</h1>
|
||||
</header>
|
||||
|
||||
<header v-else-if="desktop" class="page-header page-header--desktop">
|
||||
<button type="button" class="back-btn" @click="goBack">
|
||||
<span class="back-icon" aria-hidden="true">‹</span>
|
||||
{{ t('announcements.back') }}
|
||||
</button>
|
||||
<h1>{{ t('announcements.detail_title') }}</h1>
|
||||
</header>
|
||||
|
||||
<header v-else class="page-header">
|
||||
<button type="button" class="back-btn back-btn--icon" :aria-label="t('announcements.back')" @click="goBack">‹</button>
|
||||
<div class="announce-detail">
|
||||
<header class="page-header">
|
||||
<button type="button" class="back-btn" :aria-label="t('announcements.back')" @click="goBack">‹</button>
|
||||
<h1>{{ t('announcements.detail_title') }}</h1>
|
||||
</header>
|
||||
|
||||
@@ -176,16 +161,6 @@ watch(announcementId, () => {
|
||||
padding: 0 0 24px;
|
||||
}
|
||||
|
||||
.announce-detail--embedded {
|
||||
padding: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.announce-detail--desktop {
|
||||
padding: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -195,55 +170,14 @@ watch(announcementId, () => {
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.page-header--desktop {
|
||||
padding: 0 0 16px;
|
||||
margin-bottom: 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.page-header--embedded-detail {
|
||||
padding: 0 0 16px;
|
||||
margin-bottom: 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.page-header--embedded-detail h1 {
|
||||
font-size: 16px;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: #141414;
|
||||
color: var(--gold);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
}
|
||||
|
||||
.back-btn--icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
padding: 0;
|
||||
justify-content: center;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
@@ -254,11 +188,6 @@ watch(announcementId, () => {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.page-header--desktop h1 {
|
||||
font-size: 16px;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.state,
|
||||
.empty {
|
||||
display: flex;
|
||||
@@ -270,11 +199,11 @@ watch(announcementId, () => {
|
||||
}
|
||||
|
||||
.link-btn {
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
padding: 8px 14px;
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
color: var(--gold);
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -284,34 +213,13 @@ watch(announcementId, () => {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.announce-detail--embedded .detail-article,
|
||||
.announce-detail--desktop .detail-article {
|
||||
background: rgba(18, 18, 18, 0.92);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 20px 24px 24px;
|
||||
}
|
||||
|
||||
.detail-hero {
|
||||
margin: 16px -16px 0;
|
||||
padding: 0;
|
||||
background: #080808;
|
||||
background: var(--bg-body);
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.announce-detail--embedded .detail-hero,
|
||||
.announce-detail--desktop .detail-hero {
|
||||
margin: 0 0 18px;
|
||||
max-height: min(280px, 36vh);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
background: #0a0a0a;
|
||||
}
|
||||
|
||||
.detail-hero img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
@@ -320,22 +228,10 @@ watch(announcementId, () => {
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
.announce-detail--embedded .detail-hero img,
|
||||
.announce-detail--desktop .detail-hero img {
|
||||
max-height: min(280px, 36vh);
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.detail-body-wrap {
|
||||
padding: 18px 0 0;
|
||||
}
|
||||
|
||||
.announce-detail--embedded .detail-body-wrap,
|
||||
.announce-detail--desktop .detail-body-wrap {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.detail-date {
|
||||
margin: 0 0 10px;
|
||||
font-size: 12px;
|
||||
@@ -350,12 +246,6 @@ watch(announcementId, () => {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.announce-detail--embedded .detail-title,
|
||||
.announce-detail--desktop .detail-title {
|
||||
font-size: 18px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.detail-body {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
@@ -379,16 +269,6 @@ watch(announcementId, () => {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.announce-detail--embedded .detail-body :deep(img),
|
||||
.announce-detail--desktop .detail-body :deep(img) {
|
||||
max-height: min(320px, 40vh);
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.detail-body :deep(ul),
|
||||
.detail-body :deep(ol) {
|
||||
margin: 0 0 12px;
|
||||
@@ -425,8 +305,8 @@ watch(announcementId, () => {
|
||||
padding: 11px 14px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: var(--gradient-gold);
|
||||
color: #1a1000;
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
@@ -434,7 +314,7 @@ watch(announcementId, () => {
|
||||
|
||||
.link-action--outline {
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
color: var(--gold);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,41 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onActivated } from 'vue';
|
||||
|
||||
const { embedded = false } = defineProps<{ embedded?: boolean }>();
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { formatLocalMatchDateTime } from '@thebet365/shared';
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import { usePlayerHome, type PlayerContentItem } from '../composables/usePlayerHome';
|
||||
import { usePlayerHome } from '../composables/usePlayerHome';
|
||||
import { stripHtml } from '../utils/html';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const { t, locale } = useI18n();
|
||||
const { hubContentItems, loading, load } = usePlayerHome();
|
||||
const { announcementItems, loading, load } = usePlayerHome();
|
||||
|
||||
const items = computed(() => hubContentItems.value);
|
||||
const activeId = computed(() => String(route.params.id ?? ''));
|
||||
|
||||
function leaveAnnouncementHub() {
|
||||
const prev = (window.history.state as { back?: string } | null)?.back;
|
||||
if (prev && !prev.startsWith('/announcements')) {
|
||||
router.back();
|
||||
return;
|
||||
}
|
||||
router.push('/');
|
||||
}
|
||||
const items = computed(() => announcementItems.value);
|
||||
|
||||
function goBack() {
|
||||
if (embedded) {
|
||||
leaveAnnouncementHub();
|
||||
return;
|
||||
}
|
||||
if (window.history.length > 1) {
|
||||
router.back();
|
||||
return;
|
||||
}
|
||||
router.push('/');
|
||||
}
|
||||
|
||||
function openDetail(id: string) {
|
||||
@@ -47,48 +26,30 @@ function formatDate(createdAt?: string) {
|
||||
return formatLocalMatchDateTime(createdAt, locale.value, { variant: 'full' });
|
||||
}
|
||||
|
||||
function itemTitle(item: PlayerContentItem) {
|
||||
function itemTitle(item: (typeof items.value)[number]) {
|
||||
const title = item.translation?.title?.trim();
|
||||
if (title) return title;
|
||||
return stripHtml(item.translation?.body ?? '') || t('home.announcement_badge');
|
||||
}
|
||||
|
||||
function itemPreview(item: PlayerContentItem) {
|
||||
function itemPreview(item: (typeof items.value)[number]) {
|
||||
const title = item.translation?.title?.trim();
|
||||
const bodyText = stripHtml(item.translation?.body ?? '');
|
||||
if (bodyText && bodyText !== title) return bodyText;
|
||||
return '';
|
||||
}
|
||||
|
||||
function typeLabel(item: PlayerContentItem) {
|
||||
switch (item.contentType) {
|
||||
case 'BANNER':
|
||||
return t('announcements.type_banner');
|
||||
case 'TICKER':
|
||||
return t('announcements.type_ticker');
|
||||
default:
|
||||
return t('announcements.type_notice');
|
||||
}
|
||||
}
|
||||
|
||||
onActivated(() => {
|
||||
void load(true);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="announce-page" :class="{ 'announce-page--embedded': embedded }">
|
||||
<header v-if="!embedded" class="page-header">
|
||||
<div class="announce-page">
|
||||
<header class="page-header">
|
||||
<button type="button" class="back-btn" :aria-label="t('announcements.back')" @click="goBack">‹</button>
|
||||
<h1>{{ t('announcements.title') }}</h1>
|
||||
</header>
|
||||
<header v-else class="embedded-header">
|
||||
<button type="button" class="back-btn" @click="goBack">
|
||||
<span class="back-icon" aria-hidden="true">‹</span>
|
||||
<span class="back-label">{{ t('announcements.back') }}</span>
|
||||
</button>
|
||||
<span class="embedded-title">{{ t('announcements.title') }}</span>
|
||||
</header>
|
||||
|
||||
<div v-if="loading && !items.length" class="state">
|
||||
<GoldSpinner :size="36" />
|
||||
@@ -104,14 +65,10 @@ onActivated(() => {
|
||||
:key="item.id"
|
||||
type="button"
|
||||
class="list-row"
|
||||
:class="{ 'list-row--active': embedded && activeId === item.id }"
|
||||
@click="openDetail(item.id)"
|
||||
>
|
||||
<span class="row-main">
|
||||
<span class="row-top">
|
||||
<span class="type-badge">{{ typeLabel(item) }}</span>
|
||||
<span class="title">{{ itemTitle(item) }}</span>
|
||||
</span>
|
||||
<span v-if="itemPreview(item)" class="preview">{{ itemPreview(item) }}</span>
|
||||
<span v-if="item.createdAt" class="date">{{ formatDate(item.createdAt) }}</span>
|
||||
</span>
|
||||
@@ -127,86 +84,6 @@ onActivated(() => {
|
||||
padding: 0 0 24px;
|
||||
}
|
||||
|
||||
.announce-page--embedded {
|
||||
padding: 0;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.announce-page--embedded .list {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.embedded-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 14px 16px 12px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.embedded-header .back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: #141414;
|
||||
color: var(--gold);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-width: 0;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
}
|
||||
|
||||
.embedded-header .back-btn:hover {
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.back-label {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.embedded-title {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.announce-page--embedded .list-row {
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.announce-page--embedded .list-row:hover {
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.list-row--active {
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
box-shadow: inset 3px 0 0 var(--gold);
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -216,17 +93,15 @@ onActivated(() => {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.page-header .back-btn {
|
||||
.back-btn {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: #141414;
|
||||
color: var(--gold);
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 22px;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.page-header h1 {
|
||||
@@ -268,36 +143,12 @@ onActivated(() => {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.row-top {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.type-badge {
|
||||
flex-shrink: 0;
|
||||
margin-top: 2px;
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
color: var(--gold);
|
||||
}
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: block;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
color: var(--text);
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.preview {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ref, computed, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import api from '../api';
|
||||
import { formatMoney, parseAmount } from '../utils/localeDisplay';
|
||||
import { formatMoney } from '../utils/localeDisplay';
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
import StatusWatermark from '../components/StatusWatermark.vue';
|
||||
@@ -52,8 +52,6 @@ const statusKey = computed(() => {
|
||||
|
||||
const statusLabel = computed(() => t(`history.status_${statusKey.value}`));
|
||||
|
||||
const isSettled = computed(() => statusKey.value !== 'pending');
|
||||
|
||||
const placedDateTime = computed(() => {
|
||||
if (!bet.value) return '';
|
||||
const d = new Date(bet.value.placedAt);
|
||||
@@ -66,53 +64,10 @@ const returnAmount = computed(() => {
|
||||
if (!bet.value) return '';
|
||||
if (statusKey.value === 'won') return formatMoney(bet.value.actualReturn, locale.value);
|
||||
if (statusKey.value === 'pending') return formatMoney(bet.value.potentialReturn, locale.value);
|
||||
if (statusKey.value === 'lost') return formatMoney(-parseAmount(bet.value.stake), locale.value);
|
||||
if (statusKey.value === 'lost') return formatMoney(-parseFloat(String(bet.value.stake ?? 0)), locale.value);
|
||||
return formatMoney(bet.value.actualReturn ?? bet.value.potentialReturn, locale.value);
|
||||
});
|
||||
|
||||
const profitAmount = computed(() => {
|
||||
if (!bet.value || statusKey.value !== 'won') return '';
|
||||
const profit = parseAmount(bet.value.actualReturn) - parseAmount(bet.value.stake);
|
||||
return `+${formatMoney(profit, locale.value)}`;
|
||||
});
|
||||
|
||||
const heroAmount = computed(() => {
|
||||
if (statusKey.value === 'won') return profitAmount.value;
|
||||
return returnAmount.value;
|
||||
});
|
||||
|
||||
const heroTitle = computed(() => {
|
||||
if (statusKey.value === 'won') return t('history.profit');
|
||||
if (statusKey.value === 'pending') return t('history.est_return');
|
||||
return statusLabel.value;
|
||||
});
|
||||
|
||||
const formulaText = computed(() => {
|
||||
if (!bet.value || !oddsText.value || statusKey.value === 'pending') return '';
|
||||
return t('history.stake_to_return', {
|
||||
stake: stakeAmount.value,
|
||||
odds: oddsText.value,
|
||||
amount: returnAmount.value,
|
||||
});
|
||||
});
|
||||
|
||||
const stakeAmount = computed(() =>
|
||||
bet.value ? formatMoney(bet.value.stake, locale.value) : '',
|
||||
);
|
||||
|
||||
const oddsText = computed(() => {
|
||||
const o = bet.value?.totalOdds;
|
||||
if (o == null || o === '' || o === 0) return '';
|
||||
const n = parseFloat(String(o));
|
||||
return Number.isFinite(n) ? n.toFixed(2) : String(o);
|
||||
});
|
||||
|
||||
const betTypeLabel = computed(() => {
|
||||
if (!bet.value) return '';
|
||||
if (bet.value.isParlay) return t('bet.parlay');
|
||||
return bet.value.betType || '';
|
||||
});
|
||||
|
||||
function formatOdds(v: unknown): string {
|
||||
const n = parseFloat(String(v));
|
||||
return isNaN(n) || n <= 0 ? '-' : n.toFixed(2);
|
||||
@@ -161,20 +116,13 @@ const matchTitle = computed(() => {
|
||||
return bet.value.matchTitle;
|
||||
});
|
||||
|
||||
const pickMarket = computed(() => {
|
||||
const myPick = computed(() => {
|
||||
if (!bet.value || bet.value.isParlay) return '';
|
||||
const raw = bet.value.pickLabel ?? '';
|
||||
if (locale.value === 'zh-CN' || !raw) return raw;
|
||||
const ci = raw.indexOf(': ');
|
||||
return ci >= 0 ? raw.slice(0, ci) : raw;
|
||||
});
|
||||
|
||||
const pickSelection = computed(() => {
|
||||
if (!bet.value || bet.value.isParlay) return '';
|
||||
const raw = bet.value.pickLabel ?? '';
|
||||
const ci = raw.indexOf(': ');
|
||||
if (ci < 0) return '';
|
||||
const sel = raw.slice(ci + 2);
|
||||
return locale.value === 'zh-CN' ? sel : translateSel(sel);
|
||||
if (ci < 0) return raw;
|
||||
return raw.slice(0, ci + 2) + translateSel(raw.slice(ci + 2));
|
||||
});
|
||||
|
||||
const matchPhase = computed(
|
||||
@@ -182,152 +130,134 @@ const matchPhase = computed(
|
||||
);
|
||||
|
||||
const matchPhaseText = computed(() => matchPhaseLabel(t, matchPhase.value));
|
||||
|
||||
const showPhaseWatermark = computed(
|
||||
() => !isSettled.value && matchPhase.value && matchPhase.value !== 'open',
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="detail-page">
|
||||
<div class="pull-indicator" :style="pullIndicatorStyle()">
|
||||
<div
|
||||
class="pull-indicator"
|
||||
:style="pullIndicatorStyle()"
|
||||
>
|
||||
<GoldSpinner v-if="spinning" :size="28" :progress="progress" :active="spinning" />
|
||||
</div>
|
||||
|
||||
<div class="top-bar">
|
||||
<button type="button" class="back-btn" @click="router.back()">‹ {{ t('history.back') }}</button>
|
||||
</div>
|
||||
<!-- back bar -->
|
||||
<header class="top-bar sub-toolbar">
|
||||
<button class="back-btn" @click="router.back()">‹ {{ t('history.back') }}</button>
|
||||
</header>
|
||||
|
||||
<div v-if="loading" class="state">
|
||||
<GoldSpinner :size="36" />
|
||||
</div>
|
||||
<div v-else-if="notFound || !bet" class="state">{{ t('history.not_found') }}</div>
|
||||
|
||||
<article v-else class="receipt">
|
||||
<!-- result strip -->
|
||||
<div class="receipt-result" :class="statusKey">
|
||||
<div class="result-icon" :class="statusKey">
|
||||
<svg v-if="statusKey === 'won'" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="1.5" />
|
||||
<path d="M7 12.5l3 3 7-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<svg v-else-if="statusKey === 'lost'" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="1.5" />
|
||||
<path d="M8 8l8 8M16 8l-8 8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
||||
</svg>
|
||||
<svg v-else-if="statusKey === 'pending'" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="1.5" />
|
||||
<path d="M12 7v5l3 2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
||||
</svg>
|
||||
<svg v-else viewBox="0 0 24 24" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="1.5" />
|
||||
<path d="M8 12h8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="result-text">
|
||||
<span class="result-label">{{ heroTitle }}</span>
|
||||
<span class="result-amount">{{ heroAmount }}</span>
|
||||
<span v-if="statusKey === 'won'" class="result-sub">
|
||||
{{ t('history.return_incl_stake', { amount: returnAmount }) }}
|
||||
</span>
|
||||
<span v-else-if="formulaText && statusKey !== 'pending'" class="result-sub">{{ formulaText }}</span>
|
||||
<span v-else-if="statusKey === 'pending' && oddsText" class="result-sub">
|
||||
{{ stakeAmount }} × {{ oddsText }}
|
||||
<template v-else>
|
||||
<!-- status hero -->
|
||||
<div class="hero" :class="statusKey">
|
||||
<span class="hero-status">{{ statusLabel }}</span>
|
||||
<span class="hero-return">{{ returnAmount }}</span>
|
||||
<span class="hero-return-label">
|
||||
{{ statusKey === 'pending' ? t('history.est_return') : t('history.return') }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- match / parlay title -->
|
||||
<section class="section">
|
||||
<div class="section-head">
|
||||
<span class="league-tag">
|
||||
{{ bet.isParlay ? t('history.parlay_league') : (bet.leagueName || t('history.league_default')) }}
|
||||
</span>
|
||||
<span class="placed-time">{{ placedDateTime }}</span>
|
||||
</div>
|
||||
<div class="match-name">{{ matchTitle }}</div>
|
||||
|
||||
<div class="receipt-perforation" aria-hidden="true" />
|
||||
|
||||
<!-- body -->
|
||||
<div class="receipt-body">
|
||||
<div class="receipt-meta">
|
||||
<div class="meta-tags">
|
||||
<span v-if="betTypeLabel" class="meta-tag">{{ betTypeLabel }}</span>
|
||||
<span v-if="oddsText" class="meta-tag dim">@{{ oddsText }}</span>
|
||||
<span v-if="bet.isCashbacked" class="meta-tag cashback">{{ t('history.cashbacked') }}</span>
|
||||
</div>
|
||||
<span class="meta-time">{{ placedDateTime }}</span>
|
||||
</div>
|
||||
|
||||
<h2 class="match-title">{{ matchTitle }}</h2>
|
||||
|
||||
<!-- single pick -->
|
||||
<div v-if="!bet.isParlay" class="pick-block">
|
||||
<!-- single bet: score comparison -->
|
||||
<div v-if="!bet.isParlay" class="score-block" :class="{ 'score-block--phase': matchPhase && matchPhase !== 'open' }">
|
||||
<StatusWatermark
|
||||
v-if="showPhaseWatermark"
|
||||
v-if="matchPhase && matchPhase !== 'open'"
|
||||
:label="matchPhaseText"
|
||||
:variant="matchPhaseVariant(matchPhase!)"
|
||||
:variant="matchPhaseVariant(matchPhase)"
|
||||
size="md"
|
||||
/>
|
||||
<span class="pick-market">{{ pickMarket }}</span>
|
||||
<div class="pick-line">
|
||||
<span class="pick-selection">{{ pickSelection }}</span>
|
||||
<span v-if="oddsText" class="pick-odds">@{{ oddsText }}</span>
|
||||
<!-- my pick row -->
|
||||
<div class="row-label-val">
|
||||
<span class="row-label">{{ t('history.my_pick') }}</span>
|
||||
<span class="row-val pick">{{ myPick }}</span>
|
||||
</div>
|
||||
<div v-if="bet.matchScore?.ft || bet.matchScore?.ht" class="score-row">
|
||||
<span v-if="bet.matchScore.ft" class="score-pill">
|
||||
<em>{{ t('history.ft') }}</em>{{ bet.matchScore.ft }}
|
||||
</span>
|
||||
<span v-if="bet.matchScore.ht" class="score-pill dim">
|
||||
<em>{{ t('history.ht') }}</em>{{ bet.matchScore.ht }}
|
||||
</span>
|
||||
<!-- scores -->
|
||||
<div v-if="bet.matchScore?.ft || bet.matchScore?.ht" class="score-chips">
|
||||
<div v-if="bet.matchScore.ft" class="score-item">
|
||||
<span class="score-period">{{ t('history.ft') }}</span>
|
||||
<span class="score-value">{{ bet.matchScore.ft }}</span>
|
||||
</div>
|
||||
<p v-else-if="statusKey === 'pending'" class="awaiting">{{ t('history.awaiting_result') }}</p>
|
||||
<div v-if="bet.matchScore.ht" class="score-item">
|
||||
<span class="score-period">{{ t('history.ht') }}</span>
|
||||
<span class="score-value muted">{{ bet.matchScore.ht }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="statusKey === 'pending'" class="no-score">{{ t('history.awaiting_result') }}</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- parlay legs -->
|
||||
<div v-if="bet.isParlay && bet.legs?.length" class="legs-list">
|
||||
<div
|
||||
v-for="(leg, i) in bet.legs"
|
||||
:key="i"
|
||||
class="leg-item"
|
||||
:class="legStatusKey(leg.resultStatus)"
|
||||
>
|
||||
<div class="leg-status-dot" :class="legStatusKey(leg.resultStatus)">
|
||||
<svg v-if="legStatusKey(leg.resultStatus) === 'won'" viewBox="0 0 12 12"><path d="M2 6l3 3 5-5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
||||
<svg v-else-if="legStatusKey(leg.resultStatus) === 'lost'" viewBox="0 0 12 12"><path d="M3 3l6 6M9 3l-6 6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" /></svg>
|
||||
<span v-else>{{ i + 1 }}</span>
|
||||
</div>
|
||||
<div class="leg-content">
|
||||
<div class="leg-head">
|
||||
<section v-if="bet.isParlay && bet.legs?.length" class="section">
|
||||
<div class="section-title">{{ t('history.legs') }}</div>
|
||||
<div class="legs-list">
|
||||
<div v-for="(leg, i) in bet.legs" :key="i" class="leg-row" :class="legStatusKey(leg.resultStatus)">
|
||||
<div class="leg-left">
|
||||
<span class="leg-num" :class="legStatusKey(leg.resultStatus)">{{ i + 1 }}</span>
|
||||
<div class="leg-body">
|
||||
<span class="leg-match">{{ leg.matchTitle }}</span>
|
||||
<span class="leg-odds">@{{ formatOdds(leg.odds) }}</span>
|
||||
</div>
|
||||
<span class="leg-pick">{{ leg.marketLabel }} · {{ translateSel(leg.selectionName) }}</span>
|
||||
<div v-if="leg.score?.ft || leg.score?.ht" class="score-row compact">
|
||||
<span v-if="leg.score.ft" class="score-pill sm"><em>{{ t('history.ft') }}</em>{{ leg.score.ft }}</span>
|
||||
<span v-if="leg.score.ht" class="score-pill sm dim"><em>{{ t('history.ht') }}</em>{{ leg.score.ht }}</span>
|
||||
<span class="leg-pick-line">
|
||||
{{ leg.marketLabel }}: {{ translateSel(leg.selectionName) }}
|
||||
</span>
|
||||
<div v-if="leg.score?.ft || leg.score?.ht" class="leg-scores">
|
||||
<span v-if="leg.score.ft">{{ t('history.ft') }} {{ leg.score.ft }}</span>
|
||||
<span v-if="leg.score.ht" class="muted-score">{{ t('history.ht') }} {{ leg.score.ht }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="leg-right">
|
||||
<span class="leg-odds-val">{{ formatOdds(leg.odds) }}</span>
|
||||
<span v-if="leg.resultStatus" class="leg-result-badge" :class="legStatusKey(leg.resultStatus)">
|
||||
{{ t(`history.status_${legStatusKey(leg.resultStatus)}`) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="receipt-perforation" aria-hidden="true" />
|
||||
|
||||
<!-- footer -->
|
||||
<div class="receipt-foot">
|
||||
<div class="foot-row">
|
||||
<!-- bet summary -->
|
||||
<section class="section">
|
||||
<div class="section-title">{{ t('history.summary') }}</div>
|
||||
<div class="summary-rows">
|
||||
<div class="sum-row">
|
||||
<span>{{ t('history.stake') }}</span>
|
||||
<span>{{ stakeAmount }}</span>
|
||||
<span>{{ formatMoney(bet.stake, locale) }}</span>
|
||||
</div>
|
||||
<div v-if="bet.totalOdds" class="foot-row">
|
||||
<div v-if="bet.totalOdds" class="sum-row">
|
||||
<span>{{ t('history.odds') }}</span>
|
||||
<span class="gold">{{ formatOdds(bet.totalOdds) }}</span>
|
||||
<span class="odds-val">{{ formatOdds(bet.totalOdds) }}</span>
|
||||
</div>
|
||||
<div class="foot-row id">
|
||||
<div class="sum-row">
|
||||
<span>{{ statusKey === 'pending' ? t('history.est_return') : t('history.return') }}</span>
|
||||
<span :class="{ 'amt-won': statusKey === 'won', 'amt-pending': statusKey === 'pending', 'amt-lost': statusKey === 'lost' }">
|
||||
{{ returnAmount }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="sum-row muted">
|
||||
<span>{{ t('history.bet_no') }}</span>
|
||||
<span class="mono">{{ bet.betNo }}</span>
|
||||
<span class="bet-no-val">{{ bet.betNo }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.detail-page {
|
||||
padding-bottom: 36px;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
|
||||
.pull-indicator {
|
||||
@@ -339,7 +269,7 @@ const showPhaseWatermark = computed(
|
||||
}
|
||||
|
||||
.top-bar {
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
@@ -350,6 +280,9 @@ const showPhaseWatermark = computed(
|
||||
font-weight: 700;
|
||||
padding: 4px 0 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.state {
|
||||
@@ -360,382 +293,348 @@ const showPhaseWatermark = computed(
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ── receipt ticket ── */
|
||||
.receipt {
|
||||
position: relative;
|
||||
/* ── hero ── */
|
||||
.hero {
|
||||
border-radius: var(--radius);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.07), transparent 30%),
|
||||
rgba(18, 17, 14, 0.92);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.receipt > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* result strip */
|
||||
.receipt-result {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 20px 18px 18px;
|
||||
}
|
||||
|
||||
.receipt-result.won {
|
||||
background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, transparent 70%);
|
||||
}
|
||||
|
||||
.receipt-result.lost {
|
||||
background: linear-gradient(135deg, rgba(255, 69, 58, 0.08) 0%, transparent 70%);
|
||||
}
|
||||
|
||||
.receipt-result.pending {
|
||||
background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
|
||||
}
|
||||
|
||||
.result-icon {
|
||||
flex-shrink: 0;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.result-icon svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.result-icon.won { color: #34c759; }
|
||||
.result-icon.lost { color: var(--danger); }
|
||||
.result-icon.pending { color: var(--primary-light); }
|
||||
.result-icon.push { color: var(--text-muted); }
|
||||
|
||||
.result-text {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 20px 20px 18px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin-bottom: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.result-label {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
.hero.won {
|
||||
background: linear-gradient(135deg, rgba(46, 204, 113, 0.18), rgba(46, 204, 113, 0.06));
|
||||
border: 1px solid rgba(46, 204, 113, 0.35);
|
||||
}
|
||||
|
||||
.result-amount {
|
||||
font-size: 32px;
|
||||
font-weight: 900;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.1;
|
||||
.hero.lost {
|
||||
background: linear-gradient(135deg, var(--surface-accent), rgba(255, 255, 255, 0.06));
|
||||
border: 1px solid rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
|
||||
.receipt-result.won .result-amount { color: #34c759; }
|
||||
.receipt-result.lost .result-amount { color: var(--danger); }
|
||||
.receipt-result.pending .result-amount { color: var(--primary-light); }
|
||||
.receipt-result.push .result-amount { color: var(--text-muted); }
|
||||
|
||||
.result-sub {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* perforated divider */
|
||||
.receipt-perforation {
|
||||
height: 1px;
|
||||
margin: 0 14px;
|
||||
background: repeating-linear-gradient(
|
||||
90deg,
|
||||
transparent 0,
|
||||
transparent 4px,
|
||||
rgba(255, 255, 255, 0.08) 4px,
|
||||
rgba(255, 255, 255, 0.08) 8px
|
||||
);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.receipt-perforation::before,
|
||||
.receipt-perforation::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background: var(--bg-body, #000);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.receipt-perforation::before { left: -20px; }
|
||||
.receipt-perforation::after { right: -20px; }
|
||||
|
||||
/* body */
|
||||
.receipt-body {
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
.receipt-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.meta-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.meta-tag {
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
padding: 3px 8px;
|
||||
border-radius: 4px;
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
.hero.pending {
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.meta-tag.dim {
|
||||
color: var(--text-muted);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border-color: var(--border);
|
||||
.hero.push {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.meta-tag.cashback {
|
||||
color: #f0b90b;
|
||||
background: rgba(240, 185, 11, 0.1);
|
||||
border-color: rgba(240, 185, 11, 0.25);
|
||||
}
|
||||
|
||||
.meta-time {
|
||||
flex-shrink: 0;
|
||||
.hero-status {
|
||||
font-size: 11px;
|
||||
color: #555;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.match-title {
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
line-height: 1.35;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
/* pick block */
|
||||
.pick-block {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
padding: 14px;
|
||||
background: rgba(255, 242, 198, 0.045);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.pick-market {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: none;
|
||||
opacity: 0.85;
|
||||
}
|
||||
.hero.won .hero-status { color: var(--success); }
|
||||
.hero.lost .hero-status { color: var(--primary); }
|
||||
.hero.pending .hero-status { color: var(--primary-light); }
|
||||
.hero.push .hero-status { color: var(--text-muted); }
|
||||
|
||||
.hero-return {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
.hero.won .hero-return { color: var(--success); text-shadow: none; }
|
||||
.hero.lost .hero-return { color: var(--primary); }
|
||||
.hero.pending .hero-return { color: var(--primary-light); }
|
||||
.hero.push .hero-return { color: var(--text-muted); }
|
||||
|
||||
.hero-return-label {
|
||||
font-size: 10.5px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
/* ── sections ── */
|
||||
.section {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--space-card) 16px;
|
||||
margin-bottom: var(--space-section);
|
||||
}
|
||||
|
||||
.section-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.pick-line {
|
||||
.league-tag {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.placed-time {
|
||||
font-size: 11px;
|
||||
color: var(--neutral);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.match-name {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
line-height: 1.35;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* score block */
|
||||
.score-block {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.score-block--phase {
|
||||
padding: 8px 0 4px;
|
||||
}
|
||||
|
||||
.row-label-val {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.pick-selection {
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.pick-odds {
|
||||
font-size: 14px;
|
||||
font-weight: 900;
|
||||
.row-label {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.score-row {
|
||||
.row-val {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.row-val.pick {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.score-chips {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.score-row.compact {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.score-pill {
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
.score-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 7px;
|
||||
padding: 5px 10px;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.score-pill em {
|
||||
font-style: normal;
|
||||
font-size: 9px;
|
||||
font-weight: 800;
|
||||
.score-period {
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
margin-right: 5px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.score-pill.dim { color: var(--text-muted); }
|
||||
.score-pill.sm { font-size: 11px; padding: 3px 8px; }
|
||||
.score-value {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.awaiting {
|
||||
margin-top: 10px;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
.score-value.muted {
|
||||
color: var(--neutral);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.no-score {
|
||||
font-size: 11.5px;
|
||||
color: var(--neutral);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* section title */
|
||||
.section-title {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: none;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* parlay legs */
|
||||
.legs-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.leg-item {
|
||||
.leg-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 9px;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.leg-item:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.leg-row.won { border-color: rgba(46, 204, 113, 0.35); }
|
||||
.leg-row.lost { border-color: rgba(255, 255, 255, 0.35); }
|
||||
|
||||
.leg-status-dot {
|
||||
flex-shrink: 0;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 50%;
|
||||
.leg-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 10px;
|
||||
font-weight: 900;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1.5px solid var(--border);
|
||||
color: var(--text-muted);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.leg-status-dot svg {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.leg-status-dot.won {
|
||||
background: rgba(52, 199, 89, 0.12);
|
||||
border-color: rgba(52, 199, 89, 0.45);
|
||||
color: #34c759;
|
||||
}
|
||||
|
||||
.leg-status-dot.lost {
|
||||
background: rgba(255, 69, 58, 0.1);
|
||||
border-color: rgba(255, 69, 58, 0.35);
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.leg-content {
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.leg-head {
|
||||
.leg-num {
|
||||
flex-shrink: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: var(--bg-card);
|
||||
color: var(--text-muted);
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
margin-bottom: 4px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.leg-num.won { background: rgba(46, 204, 113, 0.18); color: var(--success); }
|
||||
.leg-num.lost { background: rgba(255, 255, 255, 0.18); color: var(--primary); }
|
||||
|
||||
.leg-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.leg-match {
|
||||
font-size: 13px;
|
||||
font-size: 12.5px;
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.leg-odds {
|
||||
flex-shrink: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
.leg-pick-line {
|
||||
font-size: 11.5px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.leg-pick {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* footer */
|
||||
.receipt-foot {
|
||||
padding: 14px 18px 16px;
|
||||
.leg-scores {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.foot-row {
|
||||
.leg-scores span {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.leg-scores .muted-score {
|
||||
color: var(--neutral);
|
||||
}
|
||||
|
||||
.leg-right {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.leg-odds-val {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.leg-result-badge {
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: none;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.leg-result-badge.won { color: var(--success); background: rgba(46, 204, 113, 0.12); }
|
||||
.leg-result-badge.lost { color: var(--primary); background: rgba(255, 255, 255, 0.1); }
|
||||
.leg-result-badge.push { color: var(--text-muted); background: var(--bg-card); }
|
||||
.leg-result-badge.pending { color: var(--neutral); background: var(--bg-body); }
|
||||
|
||||
/* summary */
|
||||
.summary-rows {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.sum-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 7px 0;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
font-size: 13px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.foot-row span:last-child {
|
||||
.sum-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.sum-row.muted {
|
||||
color: var(--neutral);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.odds-val {
|
||||
color: var(--text);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.foot-row .gold {
|
||||
color: var(--primary-light);
|
||||
font-weight: 800;
|
||||
.amt-won {
|
||||
color: var(--success);
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.foot-row.id {
|
||||
margin-top: 4px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
||||
font-size: 11px;
|
||||
.amt-pending {
|
||||
color: var(--text-muted);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.foot-row.id span:last-child {
|
||||
color: #555;
|
||||
font-weight: 600;
|
||||
.amt-lost {
|
||||
color: var(--primary);
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.mono {
|
||||
font-family: ui-monospace, monospace;
|
||||
letter-spacing: 0.02em;
|
||||
.bet-no-val {
|
||||
font-family: monospace;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -117,11 +117,11 @@ const pullIndicatorStyle = () => ({
|
||||
|
||||
<template>
|
||||
<div class="cashback-page">
|
||||
<div class="top-bar">
|
||||
<header class="top-bar sub-toolbar">
|
||||
<button type="button" class="back-btn" @click="router.back()">
|
||||
‹ {{ t('history.back') }}
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="pull-indicator" :style="pullIndicatorStyle()">
|
||||
<GoldSpinner v-if="spinning" :size="28" :progress="progress" :active="spinning" />
|
||||
@@ -202,7 +202,7 @@ const pullIndicatorStyle = () => ({
|
||||
.back-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--primary-light, #d4af37);
|
||||
color: var(--primary-light);
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
padding: 4px 0 8px;
|
||||
@@ -243,18 +243,18 @@ const pullIndicatorStyle = () => ({
|
||||
gap: 4px;
|
||||
padding: 18px 16px 16px;
|
||||
margin-bottom: 14px;
|
||||
border-radius: var(--radius, 12px);
|
||||
background: linear-gradient(135deg, rgba(212, 175, 55, 0.14), rgba(26, 26, 26, 0.92));
|
||||
border: 1px solid rgba(212, 175, 55, 0.28);
|
||||
border-radius: var(--radius);
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero-amount {
|
||||
font-size: 28px;
|
||||
font-weight: 800;
|
||||
color: #f0b90b;
|
||||
color: var(--primary-light);
|
||||
line-height: 1.2;
|
||||
text-shadow: 0 0 20px rgba(240, 185, 11, 0.2);
|
||||
text-shadow: 0 0 20px var(--surface-accent);
|
||||
}
|
||||
|
||||
.hero-sub {
|
||||
@@ -265,7 +265,7 @@ const pullIndicatorStyle = () => ({
|
||||
|
||||
.section-title {
|
||||
font-size: 10.5px;
|
||||
color: #555;
|
||||
color: var(--text-muted);
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
@@ -290,15 +290,15 @@ const pullIndicatorStyle = () => ({
|
||||
}
|
||||
|
||||
.record-row--highlight {
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
box-shadow: inset 3px 0 0 #d4af37;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
box-shadow: inset 3px 0 0 var(--primary);
|
||||
}
|
||||
|
||||
.ledger-hint {
|
||||
margin: 0 0 12px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: #666;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.row-main {
|
||||
@@ -331,9 +331,9 @@ const pullIndicatorStyle = () => ({
|
||||
flex-shrink: 0;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #f0b90b;
|
||||
background: rgba(240, 185, 11, 0.1);
|
||||
border: 1px solid rgba(240, 185, 11, 0.22);
|
||||
color: var(--primary-light);
|
||||
background: var(--surface-accent);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: 999px;
|
||||
padding: 3px 10px;
|
||||
}
|
||||
@@ -354,9 +354,9 @@ const pullIndicatorStyle = () => ({
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px dashed rgba(255, 255, 255, 0.06);
|
||||
border-top: 1px dashed var(--border);
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
color: var(--neutral);
|
||||
}
|
||||
|
||||
.row-batch {
|
||||
@@ -387,7 +387,7 @@ const pullIndicatorStyle = () => ({
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
color: #666;
|
||||
color: var(--neutral);
|
||||
}
|
||||
|
||||
.sentinel {
|
||||
@@ -403,7 +403,7 @@ const pullIndicatorStyle = () => ({
|
||||
.end-hint {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
color: var(--neutral);
|
||||
font-weight: 600;
|
||||
padding: 16px 0 4px;
|
||||
letter-spacing: 0.03em;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onActivated, watch } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { usePlayerMatches } from '../composables/usePlayerMatches';
|
||||
import LeagueAccordionItem from '../components/LeagueAccordionItem.vue';
|
||||
import MatchBetCard from '../components/MatchBetCard.vue';
|
||||
import OutrightPanel from '../components/outright/OutrightPanel.vue';
|
||||
import emptyMatchesImg from '../assets/images/generated/empty-matches-stadium-v1.webp';
|
||||
import emptyMatchesImg from '../assets/images/empty-matches.svg';
|
||||
import { useOnLocaleChange } from '../composables/useOnLocaleChange';
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
@@ -60,10 +59,8 @@ interface LeagueGroup {
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const mainTab = ref<MainTab>('matches');
|
||||
const searchQuery = ref('');
|
||||
const filterState = ref({
|
||||
time: 'all' as 'all' | 'today' | 'early',
|
||||
status: 'open' as 'all' | 'open' | 'settled',
|
||||
@@ -99,23 +96,10 @@ function normalizeLeagueName(name: string): string {
|
||||
.trim();
|
||||
}
|
||||
|
||||
function syncSearchFromRoute() {
|
||||
const q = route.query.search;
|
||||
searchQuery.value = typeof q === 'string' ? q : '';
|
||||
}
|
||||
|
||||
function matchesSearchKeyword(m: Match, keyword: string) {
|
||||
if (!keyword) return true;
|
||||
const haystack = `${m.homeTeamName} ${m.awayTeamName} ${m.leagueName}`.toLowerCase();
|
||||
return haystack.includes(keyword);
|
||||
}
|
||||
|
||||
const filteredMatches = computed(() => {
|
||||
if (mainTab.value !== 'matches') return [];
|
||||
const now = filterNow.value;
|
||||
const keyword = searchQuery.value.trim().toLowerCase();
|
||||
return matches.value.filter((m) => {
|
||||
if (!matchesSearchKeyword(m, keyword)) return false;
|
||||
let timeMatch = true;
|
||||
if (filterState.value.time === 'today') {
|
||||
timeMatch = isInTodayMatchWindow(m.startTime, now);
|
||||
@@ -147,9 +131,6 @@ const availableLeagues = computed(() => {
|
||||
}
|
||||
if (!timeMatch) continue;
|
||||
|
||||
if (filterState.value.status === 'open' && m.matchPhase !== 'open' && m.matchPhase !== undefined) continue;
|
||||
if (filterState.value.status === 'settled' && m.matchPhase !== 'settled') continue;
|
||||
|
||||
const id = m.leagueId ?? m.leagueName;
|
||||
if (!map.has(id)) {
|
||||
map.set(id, { id, name: normalizeLeagueName(m.leagueName) });
|
||||
@@ -215,16 +196,6 @@ function buildLeagueGroups(source: Match[]): LeagueGroup[] {
|
||||
|
||||
const leagueGroups = computed(() => buildLeagueGroups(filteredMatches.value));
|
||||
|
||||
const isSearchActive = computed(() => searchQuery.value.trim().length > 0);
|
||||
|
||||
const sortedFilteredMatches = computed(() =>
|
||||
[...filteredMatches.value].sort(
|
||||
(a, b) =>
|
||||
(a.displayOrder ?? 0) - (b.displayOrder ?? 0) ||
|
||||
new Date(a.startTime).getTime() - new Date(b.startTime).getTime(),
|
||||
),
|
||||
);
|
||||
|
||||
const expandedLeagues = ref(new Set<string>());
|
||||
|
||||
watch(leagueGroups, (groups) => {
|
||||
@@ -255,22 +226,9 @@ function selectMainTab(tab: MainTab) {
|
||||
onActivated(() => {
|
||||
filterNow.value = new Date();
|
||||
filterState.value.time = 'all';
|
||||
syncSearchFromRoute();
|
||||
|
||||
if (route.query.tab === 'outright') {
|
||||
selectMainTab('outright');
|
||||
} else {
|
||||
selectMainTab('matches');
|
||||
}
|
||||
|
||||
void loadSummary(true, true);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.query.search,
|
||||
() => syncSearchFromRoute(),
|
||||
);
|
||||
|
||||
function goMatch(id: string) {
|
||||
router.push(`/match/${id}`);
|
||||
}
|
||||
@@ -289,7 +247,7 @@ function goMatch(id: string) {
|
||||
<button
|
||||
type="button"
|
||||
class="main-tab"
|
||||
:class="{ active: mainTab === 'matches', 'tab-gold-active': mainTab === 'matches' }"
|
||||
:class="{ active: mainTab === 'matches' }"
|
||||
@click="selectMainTab('matches')"
|
||||
>
|
||||
<span class="tab-icon">⚽</span>
|
||||
@@ -298,7 +256,7 @@ function goMatch(id: string) {
|
||||
<button
|
||||
type="button"
|
||||
class="main-tab"
|
||||
:class="{ active: mainTab === 'outright', 'tab-gold-active': mainTab === 'outright' }"
|
||||
:class="{ active: mainTab === 'outright' }"
|
||||
@click="selectMainTab('outright')"
|
||||
>
|
||||
<span class="tab-icon">🏆</span>
|
||||
@@ -307,17 +265,6 @@ function goMatch(id: string) {
|
||||
</div>
|
||||
|
||||
<div :class="['tab-panel', { 'tab-panel--hidden': mainTab !== 'matches' }]">
|
||||
<div class="search-bar">
|
||||
<span class="search-icon" aria-hidden="true">⌕</span>
|
||||
<input
|
||||
v-model="searchQuery"
|
||||
type="search"
|
||||
:placeholder="t('search.placeholder')"
|
||||
enterkeyhint="search"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="filters-bar">
|
||||
<div class="phase-filter">
|
||||
<div class="league-dropdown">
|
||||
@@ -393,22 +340,7 @@ function goMatch(id: string) {
|
||||
</div>
|
||||
<template v-else>
|
||||
<div>
|
||||
<div v-if="isSearchActive && sortedFilteredMatches.length" class="search-results">
|
||||
<p class="search-results-meta">
|
||||
{{ t('search.results_count', { count: sortedFilteredMatches.length }) }}
|
||||
</p>
|
||||
<div class="search-match-list">
|
||||
<article
|
||||
v-for="match in sortedFilteredMatches"
|
||||
:key="match.id"
|
||||
class="search-result-item"
|
||||
>
|
||||
<p class="search-result-league">{{ normalizeLeagueName(match.leagueName) }}</p>
|
||||
<MatchBetCard :match="match" @bet="goMatch" />
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="!isSearchActive && leagueGroups.length" class="league-list">
|
||||
<div v-if="leagueGroups.length" class="league-list">
|
||||
<LeagueAccordionItem
|
||||
v-for="group in leagueGroups"
|
||||
:key="group.leagueId"
|
||||
@@ -423,7 +355,7 @@ function goMatch(id: string) {
|
||||
</div>
|
||||
<div v-else class="empty">
|
||||
<img :src="emptyMatchesImg" alt="" class="empty-icon" />
|
||||
<p>{{ isSearchActive ? t('search.no_results') : t('bet.no_matches') }}</p>
|
||||
<p>{{ t('bet.no_matches') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -450,8 +382,8 @@ function goMatch(id: string) {
|
||||
}
|
||||
|
||||
.bet-page {
|
||||
margin: 0 -16px;
|
||||
padding-bottom: 8px;
|
||||
background: var(--bg-body);
|
||||
}
|
||||
|
||||
/* Tab panel toggle: avoid display:none to prevent browser releasing image resources */
|
||||
@@ -474,8 +406,13 @@ function goMatch(id: string) {
|
||||
|
||||
.main-tabs {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
padding: 0 12px 12px;
|
||||
gap: 2px;
|
||||
margin: 0 0 var(--space-section);
|
||||
padding: 3px;
|
||||
background: var(--gradient-card-soft);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: var(--radius-sm);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.main-tab {
|
||||
@@ -484,23 +421,23 @@ function goMatch(id: string) {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
padding: 10px 8px;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
padding: 9px 8px;
|
||||
border-radius: calc(var(--radius-sm) - 3px);
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
box-shadow: var(--shadow);
|
||||
transition: background 0.2s, border-color 0.2s, color 0.2s;
|
||||
box-shadow: none;
|
||||
transition: background 0.18s, color 0.18s;
|
||||
}
|
||||
|
||||
.main-tab.active {
|
||||
font-weight: 700;
|
||||
background: rgba(244, 162, 97, 0.1);
|
||||
border-color: var(--primary);
|
||||
color: var(--primary-light);
|
||||
font-weight: 600;
|
||||
background: var(--bg-elevated);
|
||||
color: var(--text);
|
||||
box-shadow: inset 0 0 0 1px var(--border);
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
@@ -508,51 +445,24 @@ function goMatch(id: string) {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin: 0 12px 8px;
|
||||
padding: 0 10px;
|
||||
height: 32px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
color: var(--gold);
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.search-bar input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
outline: none;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.search-bar input::placeholder {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.filters-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 8px;
|
||||
padding: 0 12px 12px;
|
||||
padding: 0 0 var(--space-section);
|
||||
background: var(--bg-body);
|
||||
}
|
||||
|
||||
.time-tab.active,
|
||||
.status-toggle-btn.active {
|
||||
color: var(--text);
|
||||
background: var(--surface-active);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.time-tab.active {
|
||||
box-shadow: inset 0 0 0 1px var(--border-gold);
|
||||
}
|
||||
|
||||
.phase-filter {
|
||||
@@ -575,9 +485,9 @@ function goMatch(id: string) {
|
||||
align-items: center;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 2px;
|
||||
height: 24px;
|
||||
height: 28px;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -590,9 +500,9 @@ function goMatch(id: string) {
|
||||
color: var(--text-muted);
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
border-radius: calc(var(--radius-sm) - 2px);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -600,30 +510,24 @@ function goMatch(id: string) {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.time-tab.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(244, 162, 97, 0.15);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.right-filters .divider {
|
||||
width: 1px;
|
||||
height: 12px;
|
||||
height: 14px;
|
||||
background: var(--border);
|
||||
}
|
||||
|
||||
.status-toggle-btn {
|
||||
padding: 0 8px;
|
||||
height: 24px;
|
||||
padding: 0 10px;
|
||||
height: 28px;
|
||||
box-sizing: border-box;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
background: var(--bg-card);
|
||||
background: transparent;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -632,10 +536,8 @@ function goMatch(id: string) {
|
||||
}
|
||||
|
||||
.status-toggle-btn.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(244, 162, 97, 0.15);
|
||||
border-color: var(--primary);
|
||||
font-weight: 600;
|
||||
border-color: var(--border-gold);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
/* League Dropdown Selector */
|
||||
@@ -651,16 +553,17 @@ function goMatch(id: string) {
|
||||
gap: 6px;
|
||||
padding: 0 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
height: 24px;
|
||||
height: 28px;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
transition: border-color 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.dropdown-text {
|
||||
@@ -698,23 +601,25 @@ function goMatch(id: string) {
|
||||
max-width: 240px;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
background: #0f1217;
|
||||
border: 1px solid #2a3240;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65);
|
||||
background: var(--dropdown-bg);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-sm);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
padding: 8px 14px;
|
||||
font-size: 13px;
|
||||
color: #e5e7eb;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
border-bottom: 1px solid #1f2937;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.dropdown-item:last-child {
|
||||
@@ -723,73 +628,32 @@ function goMatch(id: string) {
|
||||
|
||||
.dropdown-item:hover,
|
||||
.dropdown-item:active {
|
||||
background: #1b2330;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.dropdown-item.active {
|
||||
color: #f4d06f;
|
||||
background: #242f42;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.league-list {
|
||||
padding: 4px 12px 0;
|
||||
}
|
||||
|
||||
.search-results {
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
.search-results-meta {
|
||||
margin: 0 0 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.search-match-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.search-result-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.search-result-league {
|
||||
margin: 0;
|
||||
padding: 0 2px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-light);
|
||||
line-height: 1.3;
|
||||
padding: 4px 0 0;
|
||||
}
|
||||
|
||||
.state,
|
||||
.placeholder,
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
padding: 34px 20px 44px;
|
||||
padding: 48px 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
width: min(270px, 82vw);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
margin-bottom: 12px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
opacity: 0.86;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
import { onActivated, computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import emptyMatchesImg from '../assets/images/generated/empty-matches-stadium-v1.webp';
|
||||
import vsImg from '../assets/images/generated/vs-gold-alpha-v1.webp';
|
||||
import hotCardBg from '../assets/images/generated/match-card-bg-gold-stadium-v1.webp';
|
||||
import upcomingCardBg from '../assets/images/generated/match-card-bg-gold-tunnel-v1.webp';
|
||||
import emptyMatchesImg from '../assets/images/empty-matches.svg';
|
||||
import vsImg from '../assets/images/vs.png';
|
||||
import cardBg from '../assets/images/card-bg.webp';
|
||||
import BannerCarousel from '../components/BannerCarousel.vue';
|
||||
import { usePlayerHome } from '../composables/usePlayerHome';
|
||||
import TeamEmblem from '../components/TeamEmblem.vue';
|
||||
@@ -16,8 +15,7 @@ import type { PlayerHomeMatch } from '../composables/usePlayerHome';
|
||||
|
||||
type HotTab = 'hot' | 'upcoming';
|
||||
|
||||
const hotMatchCardBg = `url(${hotCardBg})`;
|
||||
const upcomingMatchCardBg = `url(${upcomingCardBg})`;
|
||||
const matchCardBg = `url(${cardBg})`;
|
||||
const { t, locale } = useI18n();
|
||||
const router = useRouter();
|
||||
const { banners, hotMatches, upcomingMatches, loading, load, announcementItems } = usePlayerHome();
|
||||
@@ -55,16 +53,10 @@ function formatKickoff(startTime: string) {
|
||||
return formatLocalMatchDateTime(startTime, locale.value, { variant: 'full' });
|
||||
}
|
||||
|
||||
function matchCardStyle(tab: HotTab) {
|
||||
return {
|
||||
'--match-card-bg': tab === 'hot' ? hotMatchCardBg : upcomingMatchCardBg,
|
||||
};
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mobile-home">
|
||||
<div>
|
||||
<div
|
||||
class="pull-indicator"
|
||||
:style="pullIndicatorStyle()"
|
||||
@@ -101,7 +93,6 @@ function matchCardStyle(tab: HotTab) {
|
||||
:key="match.id"
|
||||
class="match-card"
|
||||
:class="{ 'match-card--live-anim': activeTab === 'hot' && index < 3 }"
|
||||
:style="matchCardStyle(activeTab)"
|
||||
@click="goMatch(match.id)"
|
||||
>
|
||||
<div class="match-info">
|
||||
@@ -157,11 +148,6 @@ function matchCardStyle(tab: HotTab) {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mobile-home {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.pull-indicator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -171,79 +157,33 @@ function matchCardStyle(tab: HotTab) {
|
||||
}
|
||||
|
||||
.hot-tabs {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin: 14px 0;
|
||||
}
|
||||
|
||||
.hot-tab {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
aspect-ratio: 1024 / 275;
|
||||
flex: 1;
|
||||
min-height: 36px;
|
||||
padding: 0 12px;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: rgba(255, 255, 255, 0.62);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-card);
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0;
|
||||
transition: color 0.2s ease, transform 0.2s ease;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
user-select: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.hot-tab::before,
|
||||
.hot-tab::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.hot-tab::before {
|
||||
z-index: -2;
|
||||
background: url('../assets/images/generated/home-tab-frame-gold-v1.webp') center / 100% 100% no-repeat;
|
||||
opacity: 0.58;
|
||||
filter: saturate(0.86) brightness(0.76);
|
||||
}
|
||||
|
||||
.hot-tab::after {
|
||||
z-index: -1;
|
||||
inset: 8px 16px;
|
||||
background: rgba(0, 0, 0, 0.16);
|
||||
opacity: 1;
|
||||
font-weight: 600;
|
||||
transition: background 0.2s, border-color 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.hot-tab.active {
|
||||
color: var(--primary-light);
|
||||
text-shadow: 0 0 10px rgba(247, 211, 101, 0.32);
|
||||
}
|
||||
|
||||
.hot-tab.active::before,
|
||||
.hot-tab:active::before {
|
||||
opacity: 1;
|
||||
filter: saturate(1.08) brightness(1.02);
|
||||
}
|
||||
|
||||
.hot-tab.active::after {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.hot-tab:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.hot-tab:focus-visible::before {
|
||||
filter: drop-shadow(0 0 6px rgba(247, 211, 101, 0.45));
|
||||
font-weight: 700;
|
||||
background: var(--surface-active);
|
||||
border-color: var(--primary);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.hot-tab:active {
|
||||
transform: scale(0.985);
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.match-card {
|
||||
@@ -269,8 +209,8 @@ function matchCardStyle(tab: HotTab) {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: var(--match-card-bg) center / 100% 100% no-repeat;
|
||||
opacity: 0.28;
|
||||
background: v-bind(matchCardBg) center / 100% 100% no-repeat;
|
||||
opacity: 0.25;
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -283,7 +223,7 @@ function matchCardStyle(tab: HotTab) {
|
||||
.match-info,
|
||||
.match-flags {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.match-info {
|
||||
@@ -496,24 +436,15 @@ function matchCardStyle(tab: HotTab) {
|
||||
}
|
||||
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
padding: 30px 20px 36px;
|
||||
padding: 40px 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
width: min(260px, 82vw);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
margin-bottom: 12px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
opacity: 0.86;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -159,7 +159,7 @@ onActivated(() => {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<MessageListPanel v-if="inboxEnabled" v-show="activeTab === 'messages'" @click-message="id => $router.push('/messages/' + id)" />
|
||||
<MessageListPanel v-if="inboxEnabled" v-show="activeTab === 'messages'" />
|
||||
<CustomerServicePanel v-if="activeTab === 'support'" />
|
||||
|
||||
<ConfirmDialog
|
||||
@@ -201,8 +201,8 @@ onActivated(() => {
|
||||
height: 36px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: #141414;
|
||||
color: var(--gold);
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 22px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
@@ -220,8 +220,6 @@ onActivated(() => {
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.hub-tabs {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@@ -248,8 +246,8 @@ onActivated(() => {
|
||||
}
|
||||
|
||||
.hub-tab.active {
|
||||
color: var(--gold);
|
||||
border-bottom-color: var(--gold);
|
||||
color: var(--text);
|
||||
border-bottom-color: var(--primary);
|
||||
}
|
||||
|
||||
.hub-tab-label {
|
||||
@@ -260,8 +258,8 @@ onActivated(() => {
|
||||
min-width: 18px;
|
||||
padding: 0 5px;
|
||||
border-radius: 9px;
|
||||
background: var(--gold);
|
||||
color: #111;
|
||||
background: var(--primary);
|
||||
color: var(--on-primary);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
line-height: 18px;
|
||||
@@ -277,10 +275,10 @@ onActivated(() => {
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
color: var(--gold);
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
@@ -292,8 +290,8 @@ onActivated(() => {
|
||||
}
|
||||
|
||||
.action-btn.danger {
|
||||
border-color: rgba(255, 80, 80, 0.35);
|
||||
background: rgba(255, 80, 80, 0.08);
|
||||
color: #f88;
|
||||
border-color: rgba(239, 68, 68, 0.35);
|
||||
background: rgba(239, 68, 68, 0.08);
|
||||
color: rgba(239, 68, 68, 0.95);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -14,8 +14,8 @@ import CorrectScorePanel from '../components/match-detail/CorrectScorePanel.vue'
|
||||
import { isCorrectScoreMarket, parseScoreCode } from '../utils/correctScoreLayout';
|
||||
import { useOnLocaleChange } from '../composables/useOnLocaleChange';
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
import vsImg from '../assets/images/generated/vs-gold-alpha-v1.webp';
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import VsBadge from '../components/VsBadge.vue';
|
||||
import { matchPhaseLabel, type MatchPhase } from '../utils/matchPhase';
|
||||
import { formatLocalMatchDateTime } from '@thebet365/shared';
|
||||
|
||||
@@ -48,6 +48,7 @@ interface Selection {
|
||||
selectionCode: string;
|
||||
selectionName: string;
|
||||
selectionDisplayName?: string;
|
||||
status?: string;
|
||||
odds: string;
|
||||
oddsVersion: string;
|
||||
}
|
||||
@@ -289,7 +290,7 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
<GoldSpinner v-if="spinning" :size="28" :progress="progress" :active="spinning" />
|
||||
</div>
|
||||
|
||||
<header class="toolbar">
|
||||
<header class="toolbar sub-toolbar sub-toolbar--sticky sub-toolbar--glass">
|
||||
<button type="button" class="icon-btn" :aria-label="t('bet.back')" @click="router.back()">←</button>
|
||||
<span class="toolbar-title">{{ match?.leagueName ?? '' }}</span>
|
||||
<div class="toolbar-actions">
|
||||
@@ -311,7 +312,8 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
</div>
|
||||
<template v-else-if="match">
|
||||
<section class="match-hero" :class="{ 'match-hero--phase': matchPhase !== 'open' }">
|
||||
<span v-if="matchPhase === 'settled'" class="status-tag status-tag--settled">{{ phaseLabel }}</span>
|
||||
<span v-if="matchPhase === 'open'" class="status-ribbon">{{ t('bet.status_open') }}</span>
|
||||
<span v-else-if="matchPhase === 'settled'" class="status-tag status-tag--settled">{{ phaseLabel }}</span>
|
||||
<span v-else-if="matchPhase === 'closed_pending'" class="status-tag status-tag--pending">{{ phaseLabel }}</span>
|
||||
<div class="hero-teams">
|
||||
<!-- home -->
|
||||
@@ -325,32 +327,7 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
<span class="hero-name">{{ match.homeTeamName }}</span>
|
||||
</div>
|
||||
|
||||
<!-- VS arena with lightning -->
|
||||
<div class="vs-arena">
|
||||
<svg class="hz-lightning" viewBox="0 0 72 28" aria-hidden="true">
|
||||
<defs>
|
||||
<linearGradient id="hzDetailGrad" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||
<stop offset="0%" stop-color="#5eb8ff" stop-opacity="0.2" />
|
||||
<stop offset="35%" stop-color="#b8ecff" stop-opacity="1" />
|
||||
<stop offset="50%" stop-color="#ffffff" stop-opacity="1" />
|
||||
<stop offset="65%" stop-color="#ffd080" stop-opacity="1" />
|
||||
<stop offset="100%" stop-color="#ff9040" stop-opacity="0.2" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path
|
||||
class="hz-path hz-path-main"
|
||||
stroke="url(#hzDetailGrad)"
|
||||
d="M1 14 H16 L20 5 L24 23 L28 9 L32 14 H40 L44 6 L48 22 L52 12 L56 14 H71"
|
||||
/>
|
||||
<path
|
||||
class="hz-path hz-path-sub"
|
||||
stroke="url(#hzDetailGrad)"
|
||||
d="M3 19 H14 L18 15 L22 19 H50 L54 16 L58 19 H69"
|
||||
/>
|
||||
</svg>
|
||||
<span class="hz-beam" aria-hidden="true" />
|
||||
<img :src="vsImg" alt="" class="vs-img" />
|
||||
</div>
|
||||
<VsBadge size="lg" />
|
||||
|
||||
<!-- away -->
|
||||
<div class="hero-team">
|
||||
@@ -412,8 +389,6 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
:label="marketLabel(market)"
|
||||
:promo-label="market.promoLabel?.trim() || ''"
|
||||
:status-label="bettingOpen && !isMarketOpen(market) ? marketStatusLabel(market.status) : ''"
|
||||
:has-market="true"
|
||||
:expanded="true"
|
||||
/>
|
||||
<div class="market-panel-wrap" :class="{ locked: isMarketLocked(market) }">
|
||||
<span v-if="!bettingOpen && matchPhase === 'settled'" class="market-status-tag market-status-tag--settled">{{ phaseLabel }}</span>
|
||||
@@ -452,7 +427,8 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
|
||||
<style scoped>
|
||||
.detail-page {
|
||||
margin: 0 -16px;
|
||||
--detail-gutter-x: 0;
|
||||
padding-top: var(--space-toolbar-top);
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
@@ -468,14 +444,12 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 4px 12px 8px;
|
||||
gap: 8px;
|
||||
position: sticky;
|
||||
top: -12px;
|
||||
z-index: 50;
|
||||
margin-top: -12px;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.detail-page > .sub-toolbar {
|
||||
padding-top: 0;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.toolbar-title {
|
||||
@@ -518,42 +492,59 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
.match-hero {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
margin: 0 0 10px;
|
||||
margin: 0 calc(-1 * (var(--space-page-x) - var(--detail-gutter-x))) 12px;
|
||||
padding: 14px 12px 16px;
|
||||
overflow: hidden;
|
||||
border-radius: var(--radius);
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.match-hero::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.match-hero--phase {
|
||||
opacity: 0.98;
|
||||
}
|
||||
|
||||
/* ── hero status tag (top-right corner) ── */
|
||||
/* ── hero status tag (top-left ribbon) ── */
|
||||
.status-tag {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
right: auto;
|
||||
z-index: 5;
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
padding: 4px 14px;
|
||||
border-radius: 0 6px 0 10px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
padding: 4px 12px 4px 10px;
|
||||
border-radius: 0 0 10px 0;
|
||||
line-height: 1.3;
|
||||
white-space: nowrap;
|
||||
letter-spacing: 0.02em;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.status-tag--settled {
|
||||
background: linear-gradient(180deg, #2a2a3a 0%, #1a1a28 100%);
|
||||
color: #8a9ab8;
|
||||
border-bottom: 1px solid rgba(120, 140, 180, 0.3);
|
||||
border-left: 1px solid rgba(120, 140, 180, 0.3);
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 20, 40, 0.75) 100%);
|
||||
color: var(--text-muted);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.status-tag--pending {
|
||||
background: linear-gradient(180deg, #3a3a2a 0%, #28251a 100%);
|
||||
color: #c8a84e;
|
||||
border-bottom: 1px solid rgba(200, 168, 78, 0.3);
|
||||
border-left: 1px solid rgba(200, 168, 78, 0.3);
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(10, 53, 88, 0.6) 100%);
|
||||
color: var(--text-muted);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
/* ── market panel smaller status tag ── */
|
||||
@@ -579,10 +570,10 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
}
|
||||
|
||||
.market-status-tag--pending {
|
||||
background: linear-gradient(180deg, #3a3a2a 0%, #28251a 100%);
|
||||
color: #c8a84e;
|
||||
border-bottom: 1px solid rgba(200, 168, 78, 0.3);
|
||||
border-left: 1px solid rgba(200, 168, 78, 0.3);
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(0, 51, 102, 0.95) 100%);
|
||||
color: var(--primary-light);
|
||||
border-bottom: 1px solid var(--border-gold-soft);
|
||||
border-left: 1px solid var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.market-status-tag--suspended {
|
||||
@@ -594,7 +585,7 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
|
||||
.market-status-tag--closed {
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(40, 40, 55, 0.95) 100%);
|
||||
color: #8a9ab8;
|
||||
color: var(--text-muted);
|
||||
border-bottom: 1px solid rgba(120, 140, 180, 0.3);
|
||||
border-left: 1px solid rgba(120, 140, 180, 0.3);
|
||||
}
|
||||
@@ -622,20 +613,20 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
margin: 8px 0 0;
|
||||
font-size: 28px;
|
||||
font-weight: 900;
|
||||
color: #fff;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
text-align: center;
|
||||
letter-spacing: 0.06em;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.result-stats-section {
|
||||
margin: 0 10px 12px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(180deg, #1b1b1b 0%, #121212 100%);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
|
||||
margin: 0 calc(-1 * (var(--space-page-x) - var(--detail-gutter-x))) 12px;
|
||||
padding: var(--space-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--bg-card);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.result-stats-head {
|
||||
@@ -650,8 +641,8 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.2;
|
||||
font-weight: 900;
|
||||
color: var(--primary-light);
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.result-stats-head span {
|
||||
@@ -678,8 +669,8 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
gap: 8px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 6px;
|
||||
background: rgba(255, 255, 255, 0.035);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
background: var(--bg-body);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.result-stat-label {
|
||||
@@ -729,138 +720,30 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* VS arena — same as HomeView */
|
||||
.vs-arena {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
width: 140px;
|
||||
height: 126px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hz-lightning {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
pointer-events: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.hz-path {
|
||||
fill: none;
|
||||
stroke-width: 2.2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
filter: drop-shadow(0 0 4px rgba(120, 210, 255, 0.95)) drop-shadow(0 0 8px rgba(255, 180, 80, 0.55));
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.hz-path-main {
|
||||
animation: hz-strike-main 2.6s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.hz-path-sub {
|
||||
stroke-width: 1.6;
|
||||
animation: hz-strike-sub 2.6s ease-in-out infinite;
|
||||
animation-delay: 0.12s;
|
||||
}
|
||||
|
||||
.hz-beam {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
height: 2px;
|
||||
transform: translateY(-50%);
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(94, 184, 255, 0) 0%,
|
||||
rgba(184, 236, 255, 0.95) 28%,
|
||||
#fff 50%,
|
||||
rgba(255, 208, 128, 0.95) 72%,
|
||||
rgba(255, 144, 64, 0) 100%
|
||||
);
|
||||
opacity: 0;
|
||||
filter: blur(0.4px);
|
||||
animation: hz-beam-flash 2.6s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.vs-img {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
width: 126px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
@keyframes hz-strike-main {
|
||||
0%, 72%, 100% { opacity: 0; }
|
||||
74% { opacity: 1; }
|
||||
75% { opacity: 0.25; }
|
||||
76% { opacity: 0.95; }
|
||||
78% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes hz-strike-sub {
|
||||
0%, 74%, 100% { opacity: 0; }
|
||||
76% { opacity: 0.85; }
|
||||
77% { opacity: 0.2; }
|
||||
78% { opacity: 0.7; }
|
||||
80% { opacity: 0; }
|
||||
}
|
||||
|
||||
@keyframes hz-beam-flash {
|
||||
0%, 71%, 100% { opacity: 0; transform: translateY(-50%) scaleX(0.6); }
|
||||
73% { opacity: 0.85; transform: translateY(-50%) scaleX(1); }
|
||||
75% { opacity: 0.15; transform: translateY(-50%) scaleX(0.95); }
|
||||
76% { opacity: 0.75; transform: translateY(-50%) scaleX(1); }
|
||||
78% { opacity: 0; transform: translateY(-50%) scaleX(1.05); }
|
||||
}
|
||||
|
||||
@keyframes vs-glow {
|
||||
0%, 100% {
|
||||
opacity: 0.82;
|
||||
filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.3));
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
filter: drop-shadow(0 0 3px rgba(255, 230, 140, 0.7)) drop-shadow(0 0 6px rgba(212, 175, 55, 0.35));
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.hz-path, .hz-beam { animation: none; opacity: 0; }
|
||||
}
|
||||
|
||||
.markets-section {
|
||||
padding: 0 10px 8px;
|
||||
margin: 0 calc(-1 * (var(--space-page-x) - var(--detail-gutter-x)));
|
||||
padding: 0 0 12px;
|
||||
}
|
||||
|
||||
.market-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 4px 0;
|
||||
gap: 10px;
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.market-group {
|
||||
border-radius: 8px;
|
||||
border: 1px solid #252525;
|
||||
background: linear-gradient(180deg, #1a1a1a 0%, #151515 100%);
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-card);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 10px rgba(0,0,0,0.35);
|
||||
box-shadow: var(--shadow);
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.market-group.open {
|
||||
border-color: rgba(212, 175, 55, 0.25);
|
||||
box-shadow: 0 4px 16px rgba(212, 175, 55, 0.08);
|
||||
border-color: var(--border-gold-soft);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.market-group :deep(.row) {
|
||||
@@ -878,7 +761,7 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
padding: 9px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
background: var(--surface-accent);
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
@@ -899,85 +782,65 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
|
||||
/* ── 我的投注 ── */
|
||||
.my-bets-section {
|
||||
margin: 0 calc(-1 * (var(--space-page-x) - var(--detail-gutter-x))) 12px;
|
||||
padding: 0 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.my-bets-title {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: #ccc;
|
||||
color: var(--text-muted);
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
|
||||
.my-bets-list {
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
grid-template-rows: repeat(2, minmax(72px, auto));
|
||||
grid-auto-columns: minmax(158px, calc((100% - 6px) / 2));
|
||||
gap: 6px;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
padding-bottom: 2px;
|
||||
scroll-snap-type: x proximity;
|
||||
scrollbar-width: none;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.my-bets-list::-webkit-scrollbar {
|
||||
display: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.my-bet-card {
|
||||
background: #1c1c1c;
|
||||
border: 1px solid #2e2e2e;
|
||||
border-radius: 8px;
|
||||
padding: 8px 9px;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 10px 12px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
min-width: 0;
|
||||
min-height: 72px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.my-bet-card:active {
|
||||
background: #252525;
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.bet-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.bet-type {
|
||||
font-size: 11px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.bet-status {
|
||||
font-size: 10px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
padding: 1px 6px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
line-height: 1.5;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bet-status-won {
|
||||
background: rgba(61, 184, 101, 0.15);
|
||||
color: #3db865;
|
||||
color: #2ECC71;
|
||||
}
|
||||
|
||||
.bet-status-lost {
|
||||
@@ -992,30 +855,18 @@ function onPickSelection(selId: string, marketId: string) {
|
||||
|
||||
.bet-footer {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bet-stake {
|
||||
font-size: 10px;
|
||||
color: #888;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.bet-return {
|
||||
font-size: 12px;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 340px) {
|
||||
.my-bets-list {
|
||||
grid-auto-columns: minmax(148px, calc((100% - 6px) / 2));
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onActivated, onMounted, ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps<{ embedded?: boolean; id?: string }>();
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { formatLocalMatchDateTime } from '@thebet365/shared';
|
||||
@@ -22,9 +20,8 @@ const router = useRouter();
|
||||
const { t, locale } = useI18n();
|
||||
const { loadMessageDetail, markMessageRead, deleteMessage } = usePlayerMessages();
|
||||
const { hubRoute } = useInboxFeature();
|
||||
const emit = defineEmits<{ (e: 'back'): void }>();
|
||||
|
||||
const messageId = computed(() => props.id || String(route.params.id ?? ''));
|
||||
const messageId = computed(() => String(route.params.id ?? ''));
|
||||
const message = ref<PlayerMessage | null>(null);
|
||||
const loading = ref(false);
|
||||
const error = ref(false);
|
||||
@@ -52,12 +49,8 @@ const contentPromoId = computed(() => {
|
||||
});
|
||||
|
||||
function goBack() {
|
||||
if (props.embedded) {
|
||||
emit('back');
|
||||
} else {
|
||||
router.back();
|
||||
}
|
||||
}
|
||||
|
||||
function goList() {
|
||||
router.push(hubRoute.value);
|
||||
@@ -131,11 +124,7 @@ async function confirmDelete() {
|
||||
try {
|
||||
await deleteMessage(messageId.value);
|
||||
deleteConfirmVisible.value = false;
|
||||
if (props.embedded) {
|
||||
emit('back');
|
||||
} else {
|
||||
router.replace(hubRoute.value);
|
||||
}
|
||||
} finally {
|
||||
deleting.value = false;
|
||||
}
|
||||
@@ -155,8 +144,8 @@ watch(messageId, () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="message-detail" :class="{ 'message-detail--embedded': embedded }">
|
||||
<header v-if="!embedded" class="page-header">
|
||||
<div class="message-detail">
|
||||
<header class="page-header">
|
||||
<button type="button" class="back-btn" :aria-label="t('messages.back')" @click="goBack">‹</button>
|
||||
<h1>{{ t('messages.detail_title') }}</h1>
|
||||
<button
|
||||
@@ -170,19 +159,6 @@ watch(messageId, () => {
|
||||
{{ t('messages.delete') }}
|
||||
</button>
|
||||
</header>
|
||||
<div v-else-if="message" class="embedded-actions">
|
||||
<button type="button" class="back-btn embedded-back-btn" :aria-label="t('messages.back')" @click="goBack">‹</button>
|
||||
<h1 class="embedded-title">{{ t('messages.detail_title') }}</h1>
|
||||
<button
|
||||
type="button"
|
||||
class="delete-header-btn"
|
||||
:aria-label="t('messages.delete')"
|
||||
:disabled="deleting"
|
||||
@click="onDelete"
|
||||
>
|
||||
{{ t('messages.delete') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="loading && !message" class="state">
|
||||
<GoldSpinner :size="36" />
|
||||
@@ -251,27 +227,6 @@ watch(messageId, () => {
|
||||
padding: 0 0 24px;
|
||||
}
|
||||
|
||||
.message-detail--embedded {
|
||||
padding: 0 24px 24px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.embedded-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 16px 0 12px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.embedded-title {
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -281,31 +236,14 @@ watch(messageId, () => {
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: #141414;
|
||||
color: var(--text-muted);
|
||||
font-size: 20px;
|
||||
border-radius: 10px;
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 22px;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: color 0.2s, background 0.2s;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.embedded-back-btn {
|
||||
border: none;
|
||||
background: transparent;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.page-header h1 {
|
||||
@@ -317,11 +255,11 @@ watch(messageId, () => {
|
||||
}
|
||||
|
||||
.delete-header-btn {
|
||||
border: 1px solid rgba(255, 80, 80, 0.35);
|
||||
border: 1px solid rgba(239, 68, 68, 0.35);
|
||||
border-radius: 8px;
|
||||
padding: 6px 10px;
|
||||
background: rgba(255, 80, 80, 0.08);
|
||||
color: #f88;
|
||||
background: rgba(239, 68, 68, 0.08);
|
||||
color: rgba(239, 68, 68, 0.95);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -342,8 +280,8 @@ watch(messageId, () => {
|
||||
}
|
||||
|
||||
.status-badge.unread {
|
||||
color: var(--gold);
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
color: var(--text);
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.state,
|
||||
@@ -357,11 +295,11 @@ watch(messageId, () => {
|
||||
}
|
||||
|
||||
.link-btn {
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
padding: 8px 14px;
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
color: var(--gold);
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -414,21 +352,22 @@ watch(messageId, () => {
|
||||
}
|
||||
|
||||
.rich-body :deep(a) {
|
||||
color: var(--gold);
|
||||
color: var(--primary-light);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.reason-box {
|
||||
margin-top: 18px;
|
||||
padding: 14px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgba(255, 107, 107, 0.25);
|
||||
background: rgba(255, 107, 107, 0.08);
|
||||
border: 1px solid rgba(239, 68, 68, 0.25);
|
||||
background: rgba(239, 68, 68, 0.08);
|
||||
}
|
||||
|
||||
.reason-label {
|
||||
margin: 0 0 8px;
|
||||
font-size: 12px;
|
||||
color: #ffb4b4;
|
||||
color: rgba(239, 68, 68, 0.95);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -436,17 +375,17 @@ watch(messageId, () => {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.55;
|
||||
color: #ffe0e0;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
margin-top: 24px;
|
||||
width: 100%;
|
||||
padding: 11px 14px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
color: var(--gold);
|
||||
background: var(--surface-active);
|
||||
color: var(--text);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -7,7 +7,6 @@ import BetStatsPanel from '../components/BetStatsPanel.vue';
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import { useOnLocaleChange } from '../composables/useOnLocaleChange';
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
import emptyBetsImg from '../assets/images/generated/empty-bets-ticket-v1.webp';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -22,14 +21,13 @@ const statusFilter = ref('');
|
||||
const sentinel = ref<HTMLElement | null>(null);
|
||||
let observer: IntersectionObserver | null = null;
|
||||
|
||||
const STATUS_FILTERS = [
|
||||
const FILTERS = [
|
||||
{ key: '', label: 'history.filter_all' },
|
||||
{ key: 'WON', label: 'history.filter_won' },
|
||||
{ key: 'LOST', label: 'history.filter_lost' },
|
||||
{ key: 'PENDING', label: 'history.filter_pending' },
|
||||
] as const;
|
||||
|
||||
const PUSH_FILTER = { key: 'PUSH', label: 'history.filter_push' } as const;
|
||||
{ key: 'PUSH', label: 'history.filter_push' },
|
||||
];
|
||||
|
||||
async function loadPage(p: number) {
|
||||
if (loading.value) return;
|
||||
@@ -114,11 +112,11 @@ const pullIndicatorStyle = () => ({
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<BetStatsPanel :items="items" />
|
||||
<BetStatsPanel class="stats-panel" :items="items" />
|
||||
|
||||
<div class="filter-tabs">
|
||||
<button
|
||||
v-for="f in STATUS_FILTERS"
|
||||
v-for="f in FILTERS"
|
||||
:key="f.key"
|
||||
type="button"
|
||||
class="filter-tab"
|
||||
@@ -127,20 +125,12 @@ const pullIndicatorStyle = () => ({
|
||||
>
|
||||
{{ t(f.label) }}
|
||||
</button>
|
||||
<span class="filter-divider" aria-hidden="true" />
|
||||
<button
|
||||
type="button"
|
||||
class="filter-tab filter-tab--push"
|
||||
:class="{ active: statusFilter === PUSH_FILTER.key }"
|
||||
:title="t('history.filter_push_hint')"
|
||||
@click="changeFilter(PUSH_FILTER.key)"
|
||||
>
|
||||
{{ t(PUSH_FILTER.label) }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<template v-if="items.length">
|
||||
<div class="bet-list">
|
||||
<BetHistoryCard v-for="bet in items" :key="bet.betNo" :bet="bet" />
|
||||
</div>
|
||||
|
||||
<div ref="sentinel" class="sentinel" />
|
||||
|
||||
@@ -153,10 +143,7 @@ const pullIndicatorStyle = () => ({
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-else class="state empty-state">
|
||||
<img :src="emptyBetsImg" alt="" class="empty-img" />
|
||||
<span>{{ t('history.empty') }}</span>
|
||||
</div>
|
||||
<div v-else class="state">{{ t('history.empty') }}</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -166,6 +153,16 @@ const pullIndicatorStyle = () => ({
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
||||
.stats-panel {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.bet-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-section);
|
||||
}
|
||||
|
||||
.pull-indicator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -176,44 +173,32 @@ const pullIndicatorStyle = () => ({
|
||||
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
margin-bottom: 12px;
|
||||
gap: 8px;
|
||||
margin-bottom: var(--space-section);
|
||||
overflow-x: auto;
|
||||
align-items: center;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.filter-divider {
|
||||
width: 1px;
|
||||
height: 18px;
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
flex-shrink: 0;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
.filter-tab--push {
|
||||
border-style: dashed;
|
||||
}
|
||||
|
||||
.filter-tabs::-webkit-scrollbar { display: none; }
|
||||
|
||||
.filter-tab {
|
||||
flex-shrink: 0;
|
||||
padding: 7px 14px;
|
||||
padding: 8px 16px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
background: #141414;
|
||||
border: 1px solid #2a2a2a;
|
||||
transition: all 0.2s;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
transition: background 0.2s, border-color 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.filter-tab.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
background: var(--surface-accent);
|
||||
border-color: var(--primary);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.state {
|
||||
@@ -228,21 +213,6 @@ const pullIndicatorStyle = () => ({
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding-top: 28px;
|
||||
}
|
||||
|
||||
.empty-img {
|
||||
width: min(320px, 86vw);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
opacity: 0.92;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 13px;
|
||||
}
|
||||
@@ -260,7 +230,7 @@ const pullIndicatorStyle = () => ({
|
||||
.end-hint {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
padding: 16px 0 4px;
|
||||
letter-spacing: 0.03em;
|
||||
|
||||
@@ -185,7 +185,7 @@ function back() {
|
||||
<GoldSpinner v-if="spinning" :size="28" :progress="progress" :active="spinning" />
|
||||
</div>
|
||||
|
||||
<header class="page-head">
|
||||
<header class="page-head sub-toolbar">
|
||||
<button type="button" class="back-btn" @click="back">← {{ t('profile.back') }}</button>
|
||||
<h2 class="page-title">{{ t('profile.edit') }}</h2>
|
||||
</header>
|
||||
@@ -308,7 +308,7 @@ function back() {
|
||||
|
||||
<style scoped>
|
||||
.edit-page {
|
||||
padding: 8px 0 20px;
|
||||
padding: 0 0 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
@@ -366,7 +366,7 @@ function back() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(145deg, #2a2210, #141008);
|
||||
background: var(--gradient-card);
|
||||
}
|
||||
|
||||
.avatar-img {
|
||||
@@ -380,14 +380,14 @@ function back() {
|
||||
padding: 7px 18px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: var(--surface-accent);
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.form-card {
|
||||
padding: 16px;
|
||||
padding: var(--space-card);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
@@ -471,7 +471,7 @@ function back() {
|
||||
border: none;
|
||||
border-left: 1px solid var(--border);
|
||||
border-radius: 0 6px 6px 0;
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
background: var(--surface-accent);
|
||||
color: var(--primary-light);
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
@@ -505,7 +505,7 @@ label {
|
||||
font-weight: 500;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border);
|
||||
background: #0a0a0a;
|
||||
background: var(--bg-input);
|
||||
color: var(--text);
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
@@ -513,19 +513,19 @@ label {
|
||||
.field-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--border-gold-soft);
|
||||
box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.12);
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.field-input:-webkit-autofill,
|
||||
.field-input:-webkit-autofill:hover,
|
||||
.field-input:-webkit-autofill:focus {
|
||||
-webkit-text-fill-color: var(--text);
|
||||
box-shadow: 0 0 0 1000px #0a0a0a inset;
|
||||
box-shadow: 0 0 0 1000px var(--bg-input) inset;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.field-input::placeholder {
|
||||
color: #555;
|
||||
color: var(--neutral);
|
||||
}
|
||||
|
||||
.readonly {
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onActivated, computed } from 'vue';
|
||||
import { ref, onMounted, onActivated } from 'vue';
|
||||
import { useRouter, RouterLink } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import api from '../api';
|
||||
import { formatMoney } from '../utils/localeDisplay';
|
||||
import LocaleFlag from '../components/LocaleFlag.vue';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { useAppLocale } from '../composables/useAppLocale';
|
||||
import { usePlayerProfile } from '../composables/usePlayerProfile';
|
||||
import { useInboxFeature } from '../composables/useInboxFeature';
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
import { parseCashbackApiData, sumCashbackAmount } from '../utils/cashback';
|
||||
import walletBg from '../assets/images/wallet-bg.webp';
|
||||
import { sumCashbackFromStats } from '../utils/walletStats';
|
||||
import WalletBalanceCard from '../components/WalletBalanceCard.vue';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const auth = useAuthStore();
|
||||
const { locales, setLocale, initFromUser } = useAppLocale();
|
||||
const { initFromUser } = useAppLocale();
|
||||
const { profileRaw, refreshProfile } = usePlayerProfile();
|
||||
const { hubRoute } = useInboxFeature();
|
||||
|
||||
const loading = ref(true);
|
||||
const error = ref(false);
|
||||
const rulesExpanded = ref(false);
|
||||
const cashbackTotal = ref('0');
|
||||
|
||||
const displayAmount = ref(0);
|
||||
@@ -51,14 +47,7 @@ async function fetchCashbackTotal() {
|
||||
// Fallback: sum wallet cashback credits when batch detail API is unavailable.
|
||||
try {
|
||||
const { data } = await api.get('/player/wallet/transactions/stats');
|
||||
const byType = data.data?.byType ?? [];
|
||||
let sum = 0;
|
||||
for (const g of byType) {
|
||||
if (['CASHBACK', 'CASHBACK_DEPOSIT'].includes(g.transactionType?.toUpperCase())) {
|
||||
sum += Math.abs(parseFloat(g.totalAmount ?? '0'));
|
||||
}
|
||||
}
|
||||
cashbackTotal.value = sum.toString();
|
||||
cashbackTotal.value = sumCashbackFromStats(data.data).toString();
|
||||
} catch {
|
||||
// Keep default value
|
||||
}
|
||||
@@ -81,28 +70,6 @@ const pullIndicatorStyle = () => ({
|
||||
height: `${pullDistance.value}px`,
|
||||
opacity: Math.min(pullDistance.value / 48, 1),
|
||||
});
|
||||
|
||||
async function changeLocale(code: string) {
|
||||
await setLocale(code);
|
||||
}
|
||||
|
||||
function logout() {
|
||||
auth.logout();
|
||||
router.push('/');
|
||||
}
|
||||
|
||||
const balanceDisplay = computed(() =>
|
||||
formatMoney(profileRaw.value?.wallet?.availableBalance, locale.value),
|
||||
);
|
||||
|
||||
const balanceAmountClass = computed(() => {
|
||||
const len = balanceDisplay.value.length;
|
||||
if (len <= 10) return 'balance-amount--xl';
|
||||
if (len <= 13) return 'balance-amount--lg';
|
||||
if (len <= 16) return 'balance-amount--md';
|
||||
if (len <= 19) return 'balance-amount--sm';
|
||||
return 'balance-amount--xs';
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -124,49 +91,14 @@ const balanceAmountClass = computed(() => {
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div class="wallet-banner">
|
||||
<img class="wallet-banner-img" :src="walletBg" alt="" />
|
||||
<div class="wallet-banner-scrim" aria-hidden="true" />
|
||||
<WalletBalanceCard
|
||||
:available-balance="profileRaw?.wallet?.availableBalance"
|
||||
:cashback-total="cashbackTotal"
|
||||
:frozen-balance="profileRaw?.wallet?.frozenBalance"
|
||||
/>
|
||||
|
||||
<div class="card-overlay">
|
||||
<div class="bank-card-top">
|
||||
<div class="bank-card-top-left">
|
||||
<img src="/logo.png" alt="TheBet365" class="brand-logo" />
|
||||
<div class="bank-card-brand-text">
|
||||
<span class="brand-name">THEBET365</span>
|
||||
<span class="bank-card-type">MEMBER</span>
|
||||
</div>
|
||||
</div>
|
||||
<RouterLink to="/wallet/recharge" class="recharge-btn">
|
||||
<span class="recharge-icon">+</span>
|
||||
<span>{{ t('recharge.title') }}</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
<div class="bank-card-balance">
|
||||
<span class="bank-card-label">当前余额</span>
|
||||
<p class="bank-card-number balance-amount" :class="balanceAmountClass">{{ balanceDisplay }}</p>
|
||||
</div>
|
||||
|
||||
<div class="bank-card-footer">
|
||||
<div class="bank-card-field">
|
||||
<span class="bank-card-label">持卡人</span>
|
||||
<span class="bank-card-holder">{{ profileRaw?.username }}</span>
|
||||
</div>
|
||||
<div class="bank-card-field bank-card-field--center">
|
||||
<span class="bank-card-label">累计返水</span>
|
||||
<span class="bank-card-stat">{{ formatMoney(cashbackTotal, locale) }}</span>
|
||||
</div>
|
||||
<div class="bank-card-field bank-card-field--right">
|
||||
<span class="bank-card-label">未结算</span>
|
||||
<span class="bank-card-stat">{{ formatMoney(profileRaw?.wallet?.frozenBalance, locale) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="settings-group">
|
||||
<RouterLink to="/wallet/detail" class="settings-cell settings-cell--gold-entry">
|
||||
<section class="settings-group settings-group--wallet">
|
||||
<RouterLink to="/wallet/detail" class="settings-cell settings-cell--accent-entry">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<path d="M9 5H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V9" />
|
||||
@@ -177,7 +109,7 @@ const balanceAmountClass = computed(() => {
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</RouterLink>
|
||||
|
||||
<RouterLink to="/profile/cashbacks" class="settings-cell settings-cell--gold-entry">
|
||||
<RouterLink to="/profile/cashbacks" class="settings-cell settings-cell--accent-entry">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="8" />
|
||||
@@ -188,18 +120,7 @@ const balanceAmountClass = computed(() => {
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</RouterLink>
|
||||
|
||||
<RouterLink :to="hubRoute" class="settings-cell settings-cell--gold-entry">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<path d="M4 6.5A2.5 2.5 0 0 1 6.5 4h11A2.5 2.5 0 0 1 20 6.5v11A2.5 2.5 0 0 1 17.5 20H6.5A2.5 2.5 0 0 1 4 17.5v-11Z" />
|
||||
<path d="m4 7 8 5.5L20 7" />
|
||||
</svg>
|
||||
<span class="cell-label">{{ t('messages.title') }}</span>
|
||||
</span>
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</RouterLink>
|
||||
|
||||
<RouterLink to="/wallet/recharge/history" class="settings-cell settings-cell--gold-entry">
|
||||
<RouterLink to="/wallet/recharge/history" class="settings-cell settings-cell--accent-entry">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<path d="M12 8v8M8 12h8" />
|
||||
@@ -210,69 +131,7 @@ const balanceAmountClass = computed(() => {
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</RouterLink>
|
||||
|
||||
<RouterLink to="/profile/edit" class="settings-cell">
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<circle cx="12" cy="8" r="3.5" />
|
||||
<path d="M5 20c0-3.5 3.1-6 7-6s7 2.5 7 6" />
|
||||
</svg>
|
||||
<span class="cell-label">{{ t('profile.edit') }}</span>
|
||||
</span>
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</RouterLink>
|
||||
|
||||
<div class="rules-cell">
|
||||
<button
|
||||
type="button"
|
||||
class="settings-cell rules-toggle"
|
||||
:aria-expanded="rulesExpanded"
|
||||
@click="rulesExpanded = !rulesExpanded"
|
||||
>
|
||||
<span class="cell-main">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<path d="M7 4h10v16H7z" />
|
||||
<path d="M10 8h6M10 12h6M10 16h4" />
|
||||
</svg>
|
||||
<span class="cell-label">{{ t('profile.rules_title') }}</span>
|
||||
</span>
|
||||
<span class="cell-chevron" :class="{ open: rulesExpanded }" aria-hidden="true">›</span>
|
||||
</button>
|
||||
<div v-show="rulesExpanded" class="rules-body">
|
||||
<p>{{ t('profile.rules_p1') }}</p>
|
||||
<p>{{ t('profile.rules_p2') }}</p>
|
||||
<p>{{ t('profile.rules_p3') }}</p>
|
||||
<p>{{ t('profile.rules_p4') }}</p>
|
||||
<p>{{ t('profile.rules_p5') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-cell settings-cell--stack">
|
||||
<div class="cell-head">
|
||||
<svg class="cell-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
<path d="M3 12h18M12 3c2.5 2.8 4 6 4 9s-1.5 6.2-4 9M12 3c-2.5 2.8-4 6-4 9s1.5 6.2 4 9" />
|
||||
</svg>
|
||||
<span class="cell-label">{{ t('profile.language') }}</span>
|
||||
</div>
|
||||
<div class="lang-segment" role="group" :aria-label="t('profile.language')">
|
||||
<button
|
||||
v-for="item in locales"
|
||||
:key="item.code"
|
||||
type="button"
|
||||
class="lang-opt"
|
||||
:class="{ active: locale === item.code }"
|
||||
@click="changeLocale(item.code)"
|
||||
>
|
||||
<LocaleFlag :locale="item.code" :size="14" />
|
||||
<span>{{ item.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<button type="button" class="logout-btn" @click="logout">
|
||||
{{ t('auth.logout') }}
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -324,238 +183,36 @@ const balanceAmountClass = computed(() => {
|
||||
}
|
||||
|
||||
.retry-btn:active {
|
||||
background: rgba(200, 168, 78, 0.15);
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.wallet-banner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin-bottom: 12px;
|
||||
aspect-ratio: 2 / 1;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
box-shadow:
|
||||
0 3px 10px rgba(0, 0, 0, 0.28),
|
||||
0 1px 3px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.wallet-banner::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 1;
|
||||
border-radius: inherit;
|
||||
box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.22);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.wallet-banner-img {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
object-position: center center;
|
||||
transform: scale(1.12);
|
||||
transform-origin: center center;
|
||||
filter: brightness(0.86);
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.wallet-banner-scrim {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(0, 0, 0, 0.4) 0%,
|
||||
rgba(0, 0, 0, 0.18) 42%,
|
||||
rgba(0, 0, 0, 0.46) 100%
|
||||
);
|
||||
}
|
||||
|
||||
.card-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 14px 16px 12px;
|
||||
line-height: 1.3;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.bank-card-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bank-card-top-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.brand-logo {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
flex-shrink: 0;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.bank-card-brand-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.brand-name {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
letter-spacing: 0.14em;
|
||||
line-height: 1;
|
||||
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.bank-card-type {
|
||||
font-size: 8px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.14em;
|
||||
color: rgba(212, 175, 55, 0.65);
|
||||
font-style: italic;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.bank-card-label {
|
||||
display: block;
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(255, 255, 255, 0.82);
|
||||
line-height: 1.3;
|
||||
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
.recharge-btn {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 14px;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
border: 1px solid rgba(212, 175, 55, 0.35);
|
||||
color: var(--primary-light);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
backdrop-filter: blur(6px);
|
||||
transition: background 0.15s ease;
|
||||
}
|
||||
|
||||
.recharge-btn:active {
|
||||
background: rgba(212, 175, 55, 0.15);
|
||||
}
|
||||
|
||||
.recharge-icon {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.bank-card-balance {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-height: 0;
|
||||
padding: 2px 0;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.bank-card-number {
|
||||
margin: 0;
|
||||
font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: var(--primary-light);
|
||||
line-height: 1.1;
|
||||
letter-spacing: 0.04em;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
.balance-amount {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.balance-amount--xl { font-size: clamp(24px, 6.2vw, 30px); }
|
||||
.balance-amount--lg { font-size: clamp(21px, 5.6vw, 26px); }
|
||||
.balance-amount--md { font-size: clamp(18px, 4.9vw, 22px); }
|
||||
.balance-amount--sm { font-size: clamp(16px, 4.2vw, 19px); }
|
||||
.balance-amount--xs { font-size: clamp(14px, 3.6vw, 16px); }
|
||||
|
||||
.bank-card-footer {
|
||||
flex-shrink: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.bank-card-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.bank-card-field--center { text-align: center; }
|
||||
.bank-card-field--right { text-align: right; }
|
||||
|
||||
.bank-card-holder {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
line-height: 1.2;
|
||||
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.bank-card-stat {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: #fff;
|
||||
line-height: 1.2;
|
||||
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
|
||||
.settings-group {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
position: relative;
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
}
|
||||
|
||||
.settings-group::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
height: 1px;
|
||||
background: var(--gradient-card-shine);
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.settings-group--wallet {
|
||||
margin-bottom: var(--space-section);
|
||||
}
|
||||
|
||||
.settings-group--profile {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.settings-cell {
|
||||
@@ -579,33 +236,29 @@ const balanceAmountClass = computed(() => {
|
||||
}
|
||||
|
||||
.settings-cell:active {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.settings-cell--gold-entry {
|
||||
.settings-cell--accent-entry {
|
||||
position: relative;
|
||||
min-height: 50px;
|
||||
border-color: rgba(212, 175, 55, 0.18);
|
||||
border-bottom-color: rgba(212, 175, 55, 0.18);
|
||||
background:
|
||||
linear-gradient(90deg, rgba(212, 175, 55, 0.08), rgba(20, 20, 20, 0.65) 46%, rgba(212, 175, 55, 0.04));
|
||||
box-shadow:
|
||||
inset 1px 0 0 rgba(212, 175, 55, 0.22),
|
||||
inset 0 1px 0 rgba(255, 244, 200, 0.05);
|
||||
border-color: var(--border);
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.settings-cell--gold-entry:active {
|
||||
background:
|
||||
linear-gradient(90deg, rgba(212, 175, 55, 0.12), rgba(20, 20, 20, 0.74) 46%, rgba(212, 175, 55, 0.06));
|
||||
.settings-cell--accent-entry:active {
|
||||
background: var(--surface-active);
|
||||
}
|
||||
|
||||
.settings-cell--gold-entry .cell-label {
|
||||
color: #f4dc8b;
|
||||
font-weight: 800;
|
||||
.settings-cell--accent-entry .cell-label {
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.settings-cell--gold-entry .cell-chevron {
|
||||
color: rgba(240, 216, 117, 0.78);
|
||||
.settings-cell--accent-entry .cell-chevron {
|
||||
color: var(--text-muted);
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.settings-cell--stack {
|
||||
@@ -631,7 +284,7 @@ const balanceAmountClass = computed(() => {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.settings-cell--gold-entry .cell-icon {
|
||||
.settings-cell--accent-entry .cell-icon {
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
@@ -681,23 +334,23 @@ const balanceAmountClass = computed(() => {
|
||||
gap: 4px;
|
||||
min-height: 34px;
|
||||
padding: 0 6px;
|
||||
border-radius: 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border);
|
||||
background: #0a0a0a;
|
||||
background: var(--bg-body);
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.lang-opt.active {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: var(--primary);
|
||||
color: var(--text);
|
||||
background: var(--surface-accent);
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
width: 100%;
|
||||
margin-top: 12px;
|
||||
margin-top: var(--space-section);
|
||||
min-height: 44px;
|
||||
padding: 0 16px;
|
||||
border-radius: var(--radius);
|
||||
|
||||
@@ -281,23 +281,13 @@ function auditNoteDisplayText(remark: { kind: 'note'; text: string }) {
|
||||
|
||||
.summary-card,
|
||||
.audit-card {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(rgba(22, 20, 15, 0.74), rgba(18, 16, 12, 0.84)),
|
||||
url('../assets/images/generated/h5-recharge-detail-panel-v1.webp') center / 100% 100% no-repeat;
|
||||
background: linear-gradient(135deg, #1a1810 0%, #1f1b0e 40%, #16140c 100%);
|
||||
border: 1px solid rgba(212, 175, 55, 0.2);
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.summary-card > *,
|
||||
.audit-card > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.summary-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
|
||||
.method-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
|
||||
.method-badge.bank { background: rgba(212,175,55,0.15); color: var(--primary-light); }
|
||||
|
||||
@@ -6,15 +6,32 @@ import api from '../api';
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
import { formatMoney } from '../utils/localeDisplay';
|
||||
import { useDepositNotifications } from '../composables/useDepositNotifications';
|
||||
import {
|
||||
auditActionTone,
|
||||
auditActorSecondary,
|
||||
formatDepositAuditRemark,
|
||||
shouldShowAuditRejectInTimeline,
|
||||
} from '../utils/depositAuditDisplay';
|
||||
|
||||
const router = useRouter();
|
||||
const { t, locale } = useI18n();
|
||||
const { trackPendingOrder, pollOnce } = useDepositNotifications();
|
||||
|
||||
interface DepositAuditLog {
|
||||
id: string;
|
||||
action: string;
|
||||
actorType: string;
|
||||
statusBefore: string | null;
|
||||
statusAfter: string;
|
||||
amount: string | null;
|
||||
approvedAmount: string | null;
|
||||
remark: string | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
interface DepositOrder {
|
||||
id: string;
|
||||
orderNo: string;
|
||||
paymentMethodId?: string;
|
||||
methodType: string;
|
||||
amount: string;
|
||||
status: string;
|
||||
@@ -24,7 +41,7 @@ interface DepositOrder {
|
||||
createdAt: string;
|
||||
reviewedAt: string | null;
|
||||
paymentMethodName: string | null;
|
||||
auditLogs?: { id: string }[];
|
||||
auditLogs?: DepositAuditLog[];
|
||||
}
|
||||
|
||||
const items = ref<DepositOrder[]>([]);
|
||||
@@ -37,6 +54,8 @@ const hasMore = ref(true);
|
||||
const sentinel = ref<HTMLElement | null>(null);
|
||||
let observer: IntersectionObserver | null = null;
|
||||
|
||||
const selectedOrder = ref<DepositOrder | null>(null);
|
||||
|
||||
async function fetchOrders(p = 1) {
|
||||
if (loading.value) return;
|
||||
loading.value = true;
|
||||
@@ -47,10 +66,6 @@ async function fetchOrders(p = 1) {
|
||||
|
||||
if (p === 1) {
|
||||
items.value = newItems;
|
||||
for (const order of newItems) {
|
||||
if (order.status === 'PENDING') trackPendingOrder(order.id);
|
||||
}
|
||||
void pollOnce();
|
||||
} else {
|
||||
items.value = [...items.value, ...newItems];
|
||||
}
|
||||
@@ -107,31 +122,103 @@ function goRecharge() {
|
||||
}
|
||||
|
||||
function openDetail(order: DepositOrder) {
|
||||
router.push(`/wallet/recharge/history/${order.id}`);
|
||||
selectedOrder.value = order;
|
||||
}
|
||||
|
||||
function closeDetail() {
|
||||
selectedOrder.value = null;
|
||||
}
|
||||
|
||||
function reapply(order: DepositOrder) {
|
||||
const query: Record<string, string> = {
|
||||
orderId: order.id,
|
||||
methodType: order.methodType,
|
||||
amount: order.amount,
|
||||
};
|
||||
if (order.paymentMethodId) {
|
||||
query.methodId = order.paymentMethodId;
|
||||
}
|
||||
router.push({ path: '/wallet/recharge', query });
|
||||
}
|
||||
|
||||
function normalizeText(value: string | null | undefined) {
|
||||
return value?.trim() ?? '';
|
||||
}
|
||||
|
||||
function orderNoteLine(order: DepositOrder) {
|
||||
/** Backend sets remark = rejectReason on reject; show one line only. */
|
||||
function orderNote(order: DepositOrder): { label: string; text: string } | null {
|
||||
const rejectReason = normalizeText(order.rejectReason);
|
||||
const remark = normalizeText(order.remark);
|
||||
|
||||
if (order.status === 'REJECTED') {
|
||||
const text = rejectReason || remark;
|
||||
if (!text) return null;
|
||||
return `${t('recharge.reject_reason')}: ${text}`;
|
||||
return { label: t('recharge.reject_reason'), text };
|
||||
}
|
||||
|
||||
if (remark) {
|
||||
return { label: t('recharge.remark'), text: remark };
|
||||
}
|
||||
|
||||
if (remark) return `${t('recharge.remark')}: ${remark}`;
|
||||
return null;
|
||||
}
|
||||
|
||||
function orderNoteLine(order: DepositOrder) {
|
||||
const note = orderNote(order);
|
||||
return note ? `${note.label}: ${note.text}` : null;
|
||||
}
|
||||
|
||||
function auditActionLabel(action: string) {
|
||||
const key = `recharge.audit_${action.toLowerCase()}` as const;
|
||||
const translated = t(key);
|
||||
return translated !== key ? translated : action;
|
||||
}
|
||||
|
||||
function auditStepClass(action: string) {
|
||||
return `audit-step--${auditActionTone(action)}`;
|
||||
}
|
||||
|
||||
function formatAuditTime(iso: string) {
|
||||
return new Date(iso).toLocaleString(undefined, {
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
});
|
||||
}
|
||||
|
||||
function formatOrderTime(iso: string) {
|
||||
return new Date(iso).toLocaleString();
|
||||
}
|
||||
|
||||
function auditRemarkForTimeline(log: DepositAuditLog, order: DepositOrder) {
|
||||
if (log.action === 'REJECTED' && !shouldShowAuditRejectInTimeline(log, order.rejectReason)) {
|
||||
return null;
|
||||
}
|
||||
return formatDepositAuditRemark(log, t);
|
||||
}
|
||||
|
||||
function auditLogsForDisplay(order: DepositOrder) {
|
||||
return [...(order.auditLogs ?? [])]
|
||||
.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())
|
||||
.map((log) => ({
|
||||
log,
|
||||
actor: auditActorSecondary(log, t),
|
||||
remark: auditRemarkForTimeline(log, order),
|
||||
}));
|
||||
}
|
||||
|
||||
function auditNoteLine(text: string) {
|
||||
return `${t('recharge.audit_remark_label')}: ${text}`;
|
||||
}
|
||||
|
||||
function auditNoteDisplayText(remark: { kind: 'note'; text: string }) {
|
||||
if (remark.text === t('wallet.remark_deposit_revoke_generic')) {
|
||||
return remark.text;
|
||||
}
|
||||
return auditNoteLine(remark.text);
|
||||
}
|
||||
|
||||
function auditStepCount(order: DepositOrder) {
|
||||
return order.auditLogs?.length ?? 0;
|
||||
}
|
||||
@@ -139,11 +226,11 @@ function auditStepCount(order: DepositOrder) {
|
||||
|
||||
<template>
|
||||
<div class="recharge-history-page">
|
||||
<div class="page-header">
|
||||
<header class="page-header sub-toolbar">
|
||||
<button class="back-btn" @click="goBack">‹</button>
|
||||
<h2>{{ t('recharge.history_title') }}</h2>
|
||||
<button class="recharge-btn" @click="goRecharge">+ {{ t('recharge.title') }}</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div
|
||||
class="pull-indicator"
|
||||
@@ -175,7 +262,6 @@ function auditStepCount(order: DepositOrder) {
|
||||
<span :class="['status-badge', statusClass(order.status)]">{{ statusLabel(order.status) }}</span>
|
||||
</div>
|
||||
<div class="order-body">
|
||||
<div class="order-no">{{ order.orderNo }}</div>
|
||||
<div class="order-amount">{{ formatMoney(order.amount, locale) }}</div>
|
||||
<div v-if="order.approvedAmount && order.approvedAmount !== order.amount" class="approved-amount">
|
||||
{{ t('recharge.credited') }}: {{ formatMoney(order.approvedAmount, locale) }}
|
||||
@@ -199,12 +285,20 @@ function auditStepCount(order: DepositOrder) {
|
||||
>
|
||||
{{ orderNoteLine(order) }}
|
||||
</div>
|
||||
<div class="card-detail-hint">
|
||||
<span v-if="auditStepCount(order)" class="card-detail-summary">
|
||||
<div v-if="auditStepCount(order)" class="card-detail-hint">
|
||||
<span class="card-detail-summary">
|
||||
{{ t('recharge.audit_summary', { count: auditStepCount(order) }) }}
|
||||
</span>
|
||||
<span class="card-detail-link">{{ t('recharge.view_detail') }} ›</span>
|
||||
</div>
|
||||
<button
|
||||
v-else
|
||||
type="button"
|
||||
class="card-detail-link-only"
|
||||
@click.stop="openDetail(order)"
|
||||
>
|
||||
{{ t('recharge.view_detail') }} ›
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -219,85 +313,179 @@ function auditStepCount(order: DepositOrder) {
|
||||
{{ t('common.no_more') }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<Teleport to="body">
|
||||
<div v-if="selectedOrder" class="detail-overlay" @click.self="closeDetail">
|
||||
<div class="detail-modal" role="dialog" aria-modal="true" :aria-label="t('recharge.order_detail')">
|
||||
<button type="button" class="detail-close" :aria-label="t('common.close')" @click="closeDetail">✕</button>
|
||||
|
||||
<h3 class="detail-title">{{ t('recharge.order_detail') }}</h3>
|
||||
|
||||
<div class="detail-summary">
|
||||
<div class="detail-summary-head">
|
||||
<span class="method-badge" :class="selectedOrder.methodType === 'BANK' ? 'bank' : 'usdt'">
|
||||
{{ selectedOrder.methodType }}
|
||||
</span>
|
||||
<span :class="['status-badge', statusClass(selectedOrder.status)]">
|
||||
{{ statusLabel(selectedOrder.status) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="detail-amount">{{ formatMoney(selectedOrder.amount, locale) }}</div>
|
||||
<div
|
||||
v-if="selectedOrder.approvedAmount && selectedOrder.approvedAmount !== selectedOrder.amount"
|
||||
class="approved-amount"
|
||||
>
|
||||
{{ t('recharge.credited') }}: {{ formatMoney(selectedOrder.approvedAmount, locale) }}
|
||||
</div>
|
||||
<div class="detail-method-name">{{ selectedOrder.paymentMethodName || '-' }}</div>
|
||||
<div class="detail-row">
|
||||
<span class="detail-label">{{ t('recharge.apply_time') }}</span>
|
||||
<span class="detail-value">{{ formatOrderTime(selectedOrder.createdAt) }}</span>
|
||||
</div>
|
||||
<div v-if="selectedOrder.reviewedAt" class="detail-row">
|
||||
<span class="detail-label">{{ t('recharge.review_time') }}</span>
|
||||
<span class="detail-value">{{ formatOrderTime(selectedOrder.reviewedAt) }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="orderNoteLine(selectedOrder)"
|
||||
:class="selectedOrder.status === 'REJECTED' ? 'reject-reason' : 'order-remark'"
|
||||
>
|
||||
{{ orderNoteLine(selectedOrder) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="selectedOrder.auditLogs?.length" class="detail-audit">
|
||||
<h4 class="detail-audit-title">{{ t('recharge.audit_title') }}</h4>
|
||||
<div class="audit-track">
|
||||
<div
|
||||
v-for="(entry, logIdx) in auditLogsForDisplay(selectedOrder)"
|
||||
:key="entry.log.id"
|
||||
class="audit-step"
|
||||
:class="auditStepClass(entry.log.action)"
|
||||
>
|
||||
<div class="audit-step-rail" aria-hidden="true">
|
||||
<span class="audit-dot" />
|
||||
<span v-if="logIdx < auditLogsForDisplay(selectedOrder).length - 1" class="audit-line" />
|
||||
</div>
|
||||
<div class="audit-step-body">
|
||||
<div class="audit-step-head">
|
||||
<span class="audit-step-title">{{ auditActionLabel(entry.log.action) }}</span>
|
||||
<time class="audit-step-time">{{ formatAuditTime(entry.log.createdAt) }}</time>
|
||||
</div>
|
||||
<p v-if="entry.actor" class="audit-step-actor">{{ entry.actor }}</p>
|
||||
<p
|
||||
v-if="entry.log.approvedAmount && entry.log.action === 'APPROVED'"
|
||||
class="audit-step-credited"
|
||||
>
|
||||
{{ t('recharge.audit_credited') }} {{ formatMoney(entry.log.approvedAmount, locale) }}
|
||||
</p>
|
||||
<div
|
||||
v-if="entry.remark?.kind === 'reject'"
|
||||
class="audit-step-box audit-step-box--reject"
|
||||
>
|
||||
<span class="audit-step-box-label">{{ t('recharge.reject_reason') }}</span>
|
||||
<span class="audit-step-box-text">{{ entry.remark.text }}</span>
|
||||
</div>
|
||||
<p v-else-if="entry.remark?.kind === 'note'" class="audit-step-note">
|
||||
{{ auditNoteDisplayText(entry.remark) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
v-if="selectedOrder.status === 'REJECTED'"
|
||||
type="button"
|
||||
class="modal-reapply-btn btn-gold-outline"
|
||||
@click.stop="reapply(selectedOrder)"
|
||||
>
|
||||
{{ t('recharge.reapply') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.recharge-history-page { padding: 0 0 24px; }
|
||||
.page-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
|
||||
.page-header { display: flex; align-items: center; justify-content: space-between; }
|
||||
.page-header h2 { margin: 0; font-size: 17px; font-weight: 700; }
|
||||
.back-btn { background: none; border: none; color: var(--primary-light); font-size: 24px; cursor: pointer; padding: 0 8px; }
|
||||
.recharge-btn { background: none; border: none; color: var(--primary-light); font-size: 13px; cursor: pointer; font-weight: 600; }
|
||||
.state { display: flex; justify-content: center; padding: 48px; }
|
||||
.empty { text-align: center; color: #666; padding: 48px 16px; font-weight: 600; }
|
||||
.empty { text-align: center; color: var(--text-muted); padding: 48px 16px; font-weight: 600; }
|
||||
.pull-indicator { display: flex; align-items: center; justify-content: center; overflow: hidden; transition: height 0.15s ease; }
|
||||
|
||||
.order-list { display: flex; flex-direction: column; gap: 12px; }
|
||||
.order-card {
|
||||
background: linear-gradient(135deg, #1a1810 0%, #1f1b0e 40%, #16140c 100%);
|
||||
border: 1px solid rgba(212, 175, 55, 0.2);
|
||||
border-radius: 12px;
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.order-card:active {
|
||||
opacity: 0.92;
|
||||
}
|
||||
.order-card:active { opacity: 0.92; }
|
||||
.order-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0; left: 0; right: 0;
|
||||
height: 2px;
|
||||
background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent);
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
|
||||
}
|
||||
.order-card.rejected {
|
||||
background: #141414;
|
||||
border-color: rgba(245, 108, 108, 0.22);
|
||||
background: var(--bg-card);
|
||||
border-color: rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
.order-card.rejected::before {
|
||||
background: linear-gradient(90deg, transparent, rgba(245, 108, 108, 0.35), transparent);
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
|
||||
}
|
||||
.order-card.rejected .order-amount {
|
||||
color: #bbb;
|
||||
background: none;
|
||||
-webkit-background-clip: unset;
|
||||
background-clip: unset;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.order-card.rejected .info-label {
|
||||
color: var(--neutral);
|
||||
}
|
||||
.order-card.rejected .info-label { color: #888; }
|
||||
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
|
||||
.method-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
|
||||
.method-badge.bank { background: rgba(30, 58, 95, 0.6); color: #66b1ff; }
|
||||
.method-badge.usdt { background: rgba(26, 58, 42, 0.6); color: #67c23a; }
|
||||
.status-badge { font-size: 12px; font-weight: 700; }
|
||||
.status-pending { color: #e6a23c; }
|
||||
.status-approved { color: #67c23a; }
|
||||
.status-rejected { color: #f56c6c; }
|
||||
.status-pending { color: var(--primary-light); }
|
||||
.status-approved { color: var(--success); }
|
||||
.status-rejected { color: var(--primary); }
|
||||
.order-body { }
|
||||
.order-amount {
|
||||
font-size: 22px;
|
||||
font-weight: 900;
|
||||
margin-bottom: 4px;
|
||||
color: var(--text);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
.order-no {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-family: ui-monospace, monospace;
|
||||
margin-bottom: 6px;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
.approved-amount { font-size: 12px; color: #67c23a; margin-bottom: 6px; font-weight: 600; }
|
||||
.approved-amount { font-size: 12px; color: var(--success); margin-bottom: 6px; font-weight: 600; }
|
||||
.order-info-row { margin-bottom: 8px; }
|
||||
.info-label { font-size: 13px; color: rgba(212, 175, 55, 0.7); font-weight: 600; }
|
||||
.info-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
|
||||
.order-times { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
|
||||
.time-row { display: flex; justify-content: space-between; align-items: center; }
|
||||
.time-label { font-size: 11px; color: #888; }
|
||||
.time-value { font-size: 11px; color: #aaa; font-variant-numeric: tabular-nums; }
|
||||
.time-label { font-size: 11px; color: var(--text-muted); }
|
||||
.time-value { font-size: 11px; color: var(--neutral); font-variant-numeric: tabular-nums; }
|
||||
.order-remark {
|
||||
font-size: 12px;
|
||||
color: rgba(212, 175, 55, 0.8);
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
color: var(--text-muted);
|
||||
background: var(--surface-accent);
|
||||
padding: 6px 10px;
|
||||
border-radius: 6px;
|
||||
margin-top: 6px;
|
||||
border-left: 2px solid rgba(212, 175, 55, 0.3);
|
||||
border-left: 2px solid var(--border-gold-soft);
|
||||
line-height: 1.45;
|
||||
word-break: break-word;
|
||||
}
|
||||
@@ -320,7 +508,7 @@ function auditStepCount(order: DepositOrder) {
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid rgba(212, 175, 55, 0.12);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.card-detail-summary {
|
||||
font-size: 11px;
|
||||
@@ -329,18 +517,331 @@ function auditStepCount(order: DepositOrder) {
|
||||
}
|
||||
.card-detail-link {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
color: var(--primary-light);
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.sentinel { height: 1px; }
|
||||
.load-more-spinner { display: flex; justify-content: center; padding: 20px 0 8px; }
|
||||
.card-detail-link-only {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
text-align: right;
|
||||
font-size: 11px;
|
||||
color: var(--primary-light);
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sentinel {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.load-more-spinner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 20px 0 8px;
|
||||
}
|
||||
|
||||
.end-hint {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
color: var(--neutral);
|
||||
font-weight: 600;
|
||||
padding: 16px 0 4px;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
.detail-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 200;
|
||||
background: rgba(0, 34, 68, 0.72);
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.detail-modal {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
max-height: min(88vh, 720px);
|
||||
overflow-y: auto;
|
||||
background: var(--dropdown-bg);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
border: 1px solid var(--border);
|
||||
border-bottom: none;
|
||||
border-radius: 14px 14px 0 0;
|
||||
padding: 16px 16px calc(14px + env(safe-area-inset-bottom, 0px));
|
||||
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.detail-close {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 12px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
margin: 0 28px 12px 0;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.detail-summary {
|
||||
margin-bottom: 14px;
|
||||
padding: 12px;
|
||||
border-radius: 10px;
|
||||
background: var(--bg-body);
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.detail-summary-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.detail-amount {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 4px;
|
||||
color: var(--primary-light);
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.detail-method-name {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.detail-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.detail-value {
|
||||
font-size: 12px;
|
||||
color: var(--text);
|
||||
text-align: right;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.detail-summary .order-remark {
|
||||
margin-top: 8px;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
background: transparent;
|
||||
padding: 6px 0 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
border-top: 1px solid var(--border);
|
||||
line-height: 1.45;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.detail-summary .reject-reason {
|
||||
margin-top: 8px;
|
||||
font-size: 11px;
|
||||
color: var(--primary-light);
|
||||
background: transparent;
|
||||
padding: 6px 0 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.25);
|
||||
line-height: 1.45;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.detail-summary .approved-amount {
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.detail-audit {
|
||||
margin-top: 2px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.detail-audit-title {
|
||||
margin: 0 0 10px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.audit-track {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.audit-step {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.audit-step-rail {
|
||||
flex: 0 0 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.audit-dot {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background: var(--neutral);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.audit-line {
|
||||
flex: 1;
|
||||
width: 1px;
|
||||
min-height: 10px;
|
||||
margin: 3px 0;
|
||||
background: var(--border);
|
||||
}
|
||||
|
||||
.audit-step-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
.audit-step:last-child .audit-step-body {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.audit-step-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.audit-step-title {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.audit-step-time {
|
||||
font-size: 10px;
|
||||
color: var(--neutral);
|
||||
font-variant-numeric: tabular-nums;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.audit-step-actor {
|
||||
margin: 2px 0 0;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.audit-step-credited {
|
||||
margin: 3px 0 0;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--success);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.audit-step-note {
|
||||
margin: 4px 0 0;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.45;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.audit-step-box {
|
||||
margin-top: 4px;
|
||||
padding: 6px 8px;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1px;
|
||||
line-height: 1.4;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.audit-step-box--reject {
|
||||
background: var(--bg-body);
|
||||
border: 1px solid rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.audit-step-box-label {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.audit-step-box-text {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.audit-step--submitted .audit-dot {
|
||||
background: var(--primary-light);
|
||||
}
|
||||
.audit-step--approved .audit-dot {
|
||||
background: var(--success);
|
||||
}
|
||||
.audit-step--rejected .audit-dot {
|
||||
background: var(--primary);
|
||||
}
|
||||
.audit-step--revoked .audit-dot {
|
||||
background: var(--neutral);
|
||||
}
|
||||
.audit-step--reopened .audit-dot {
|
||||
background: var(--primary-light);
|
||||
}
|
||||
|
||||
.modal-reapply-btn {
|
||||
width: 100%;
|
||||
margin-top: 14px;
|
||||
padding: 11px 16px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -127,8 +127,7 @@ async function compressScreenshot(file: File): Promise<File> {
|
||||
throw new Error('COMPRESS_FAILED');
|
||||
}
|
||||
|
||||
// 重命名文件后缀为 .webp
|
||||
const name = file.name.replace(/\.[^/.]+$/, "") + '.webp';
|
||||
const name = file.name.replace(/\.[^/.]+$/, '') + '.webp';
|
||||
return new File([compressed], name, {
|
||||
type: 'image/webp',
|
||||
lastModified: Date.now(),
|
||||
@@ -251,11 +250,11 @@ onMounted(fetchMethods);
|
||||
|
||||
<template>
|
||||
<div class="recharge-page">
|
||||
<div class="page-header">
|
||||
<header class="page-header sub-toolbar">
|
||||
<button class="back-btn" @click="goBack">‹</button>
|
||||
<h2>{{ t('recharge.title') }}</h2>
|
||||
<button class="history-btn" @click="goHistory">{{ t('recharge.history') }}</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div v-if="loading" class="state">
|
||||
<GoldSpinner :size="36" />
|
||||
@@ -384,7 +383,6 @@ onMounted(fetchMethods);
|
||||
|
||||
.page-header {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
padding: 8px 0 12px;
|
||||
}
|
||||
.page-header h2 { margin: 0; font-size: 16px; font-weight: 700; }
|
||||
.back-btn { background: none; border: none; color: var(--primary-light); font-size: 22px; cursor: pointer; padding: 0 6px; }
|
||||
@@ -404,18 +402,28 @@ onMounted(fetchMethods);
|
||||
}
|
||||
|
||||
.type-tabs {
|
||||
display: flex; margin-bottom: 12px;
|
||||
border-radius: 6px; overflow: hidden;
|
||||
border: 1px solid rgba(212, 175, 55, 0.2);
|
||||
display: flex;
|
||||
margin-bottom: 12px;
|
||||
border-radius: var(--radius-sm);
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-body);
|
||||
}
|
||||
.tab {
|
||||
flex: 1; padding: 8px; border: none;
|
||||
background: rgba(20, 20, 20, 0.8);
|
||||
color: var(--text-muted); font-weight: 700; font-size: 13px;
|
||||
cursor: pointer; transition: all 0.2s;
|
||||
flex: 1;
|
||||
padding: 8px;
|
||||
border: none;
|
||||
background: var(--bg-card);
|
||||
color: var(--text-muted);
|
||||
font-weight: 700;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, color 0.2s;
|
||||
}
|
||||
.tab.active {
|
||||
background: var(--primary-light); color: #000;
|
||||
background: var(--surface-accent);
|
||||
color: var(--text);
|
||||
box-shadow: inset 0 0 0 1px var(--primary);
|
||||
}
|
||||
|
||||
.methods-list {
|
||||
@@ -423,15 +431,15 @@ onMounted(fetchMethods);
|
||||
}
|
||||
.method-pill {
|
||||
display: flex; flex-direction: column; gap: 1px;
|
||||
background: rgba(20, 20, 20, 0.8);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px; padding: 6px 12px;
|
||||
text-align: left; cursor: pointer;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
.method-pill.selected {
|
||||
border-color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
border-color: var(--primary);
|
||||
background: var(--surface-accent);
|
||||
}
|
||||
.pill-name { font-weight: 700; font-size: 12px; color: var(--text); }
|
||||
.pill-sub { font-size: 10px; color: var(--text-muted); }
|
||||
@@ -452,13 +460,13 @@ onMounted(fetchMethods);
|
||||
justify-content: space-between;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(ellipse 80% 60% at 100% 0%, rgba(212, 175, 55, 0.22), transparent 55%),
|
||||
radial-gradient(ellipse 50% 50% at 0% 100%, rgba(212, 175, 55, 0.1), transparent 50%),
|
||||
linear-gradient(135deg, #2a2218 0%, #1a1610 35%, #12100c 70%, #0a0908 100%);
|
||||
border: 1px solid rgba(212, 175, 55, 0.35);
|
||||
radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
|
||||
radial-gradient(ellipse 50% 50% at 0% 100%, var(--surface-accent), transparent 50%),
|
||||
var(--gradient-card);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
box-shadow:
|
||||
0 8px 24px rgba(0, 0, 0, 0.55),
|
||||
0 2px 8px rgba(212, 175, 55, 0.12),
|
||||
0 8px 24px rgba(0, 0, 0, 0.35),
|
||||
0 2px 8px var(--surface-accent),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
@@ -479,7 +487,7 @@ onMounted(fetchMethods);
|
||||
.bank-card-deco {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(212, 175, 55, 0.12);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@@ -488,7 +496,7 @@ onMounted(fetchMethods);
|
||||
height: 180px;
|
||||
right: -60px;
|
||||
bottom: -80px;
|
||||
background: radial-gradient(circle, rgba(212, 175, 55, 0.08), transparent 70%);
|
||||
background: radial-gradient(circle, var(--surface-accent), transparent 70%);
|
||||
}
|
||||
|
||||
.bank-card-deco--2 {
|
||||
@@ -496,7 +504,7 @@ onMounted(fetchMethods);
|
||||
height: 100px;
|
||||
right: 40px;
|
||||
bottom: 20px;
|
||||
border-color: rgba(212, 175, 55, 0.08);
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.bank-card-top,
|
||||
@@ -549,8 +557,8 @@ onMounted(fetchMethods);
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(212, 175, 55, 0.35);
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(0, 34, 68, 0.45);
|
||||
color: var(--primary-light);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -566,7 +574,7 @@ onMounted(fetchMethods);
|
||||
|
||||
.bank-card-copy:active {
|
||||
opacity: 0.65;
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
background: var(--surface-accent);
|
||||
}
|
||||
|
||||
.bank-card-bottom {
|
||||
@@ -605,13 +613,14 @@ onMounted(fetchMethods);
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.18em;
|
||||
color: rgba(212, 175, 55, 0.55);
|
||||
color: var(--primary-light);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.method-info {
|
||||
background: rgba(17, 17, 17, 0.9);
|
||||
border-radius: 8px; padding: 10px 12px;
|
||||
background: var(--bg-body);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 10px 12px;
|
||||
margin-bottom: 12px;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
@@ -642,19 +651,20 @@ onMounted(fetchMethods);
|
||||
color: var(--text-muted); margin-bottom: 4px;
|
||||
}
|
||||
.amount-input {
|
||||
width: 100%; padding: 10px; background: #111;
|
||||
width: 100%; padding: 10px; background: var(--bg-input);
|
||||
border: 1px solid var(--border); border-radius: 6px;
|
||||
color: #fff; font-size: 16px; font-weight: 700;
|
||||
color: var(--text); font-size: 16px; font-weight: 700;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.amount-input:focus { border-color: var(--primary-light); outline: none; }
|
||||
.amount-input:focus { border-color: var(--border-gold-soft); outline: none; }
|
||||
|
||||
.upload-area {
|
||||
border: 1px dashed rgba(212, 175, 55, 0.3);
|
||||
border: 1px dashed var(--border-gold-soft);
|
||||
border-radius: 6px; padding: 16px;
|
||||
text-align: center; position: relative;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
cursor: pointer;
|
||||
background: var(--bg-body);
|
||||
}
|
||||
.upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
|
||||
.upload-hint { font-size: 12px; color: var(--text-muted); }
|
||||
@@ -670,22 +680,22 @@ onMounted(fetchMethods);
|
||||
|
||||
.btn-submit {
|
||||
width: 100%; padding: 12px;
|
||||
background: linear-gradient(135deg, #f0d060, #d4a830);
|
||||
color: #000; border: none; border-radius: 6px;
|
||||
background: var(--gradient-accent);
|
||||
color: #fff; border: none; border-radius: 6px;
|
||||
font-size: 14px; font-weight: 800;
|
||||
cursor: pointer; margin-top: 8px;
|
||||
box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
|
||||
box-shadow: none;
|
||||
}
|
||||
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
|
||||
.success-state { text-align: center; padding: 40px 16px; }
|
||||
.success-icon { font-size: 40px; color: #67c23a; margin-bottom: 10px; }
|
||||
.success-state h3 { margin: 0 0 6px; font-size: 16px; }
|
||||
.order-no { font-family: monospace; color: var(--text-muted); font-size: 13px; margin: 4px 0; }
|
||||
.success-icon { font-size: 40px; color: var(--success); margin-bottom: 10px; }
|
||||
.success-state h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
|
||||
.order-no { font-family: monospace; color: var(--primary-light); font-size: 13px; margin: 4px 0; }
|
||||
.success-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
|
||||
.btn-primary {
|
||||
background: linear-gradient(135deg, #f0d060, #d4a830);
|
||||
color: #000; border: none; border-radius: 6px;
|
||||
background: var(--gradient-accent);
|
||||
color: #fff; border: none; border-radius: 6px;
|
||||
padding: 10px 20px; font-weight: 700; font-size: 13px; cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,6 @@ import { isBetType, isDepositType, isWithdrawType, isCashbackType, txTypeKey, tx
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
import WalletStatsPanel from '../components/WalletStatsPanel.vue';
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
import emptyWalletImg from '../assets/images/generated/empty-wallet-ledger-v1.webp';
|
||||
|
||||
const router = useRouter();
|
||||
const { t, locale } = useI18n();
|
||||
@@ -156,9 +155,9 @@ const pullIndicatorStyle = () => ({
|
||||
|
||||
<template>
|
||||
<div class="wallet-detail-page">
|
||||
<div class="top-bar">
|
||||
<header class="top-bar sub-toolbar">
|
||||
<button class="back-btn" type="button" @click="router.back()">‹ {{ t('history.back') }}</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div
|
||||
class="pull-indicator"
|
||||
@@ -173,7 +172,7 @@ const pullIndicatorStyle = () => ({
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<WalletStatsPanel :items="items" :cashback-total="cashbackTotal" />
|
||||
<WalletStatsPanel class="stats-panel" :items="items" :cashback-total="cashbackTotal" />
|
||||
|
||||
<div class="filter-tabs">
|
||||
<button
|
||||
@@ -196,17 +195,15 @@ const pullIndicatorStyle = () => ({
|
||||
class="tx-row"
|
||||
@click="goDetail(tx)"
|
||||
>
|
||||
<div class="tx-main">
|
||||
<div class="tx-text">
|
||||
<div class="tx-col-left">
|
||||
<span class="tx-type">{{ txLabel(tx) }}</span>
|
||||
<span v-if="txSubtitle(tx)" class="tx-summary">{{ txSubtitle(tx) }}</span>
|
||||
<span class="tx-time">{{ new Date(tx.createdAt).toLocaleString() }}</span>
|
||||
</div>
|
||||
<div class="tx-col-right">
|
||||
<span :class="txAmountClass(tx.amount)">
|
||||
{{ formatMoney(tx.amount, locale) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="tx-meta">
|
||||
<span class="tx-time">{{ new Date(tx.createdAt).toLocaleString() }}</span>
|
||||
<span class="tx-arrow">›</span>
|
||||
</div>
|
||||
</button>
|
||||
@@ -223,8 +220,7 @@ const pullIndicatorStyle = () => ({
|
||||
</div>
|
||||
|
||||
<div v-if="!items.length && !initialLoading" class="empty">
|
||||
<img :src="emptyWalletImg" alt="" class="empty-img" />
|
||||
<span>{{ t('wallet.no_records') }}</span>
|
||||
{{ t('wallet.no_records') }}
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
@@ -235,6 +231,10 @@ const pullIndicatorStyle = () => ({
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
||||
.stats-panel {
|
||||
margin-bottom: var(--space-section);
|
||||
}
|
||||
|
||||
.top-bar {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
@@ -242,9 +242,9 @@ const pullIndicatorStyle = () => ({
|
||||
.back-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--primary-light, #d4af37);
|
||||
color: var(--text-muted);
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
font-weight: 500;
|
||||
padding: 4px 0 8px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
@@ -262,8 +262,8 @@ const pullIndicatorStyle = () => ({
|
||||
|
||||
.filter-tabs {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
margin-bottom: 12px;
|
||||
gap: 8px;
|
||||
margin-bottom: var(--space-section);
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
scrollbar-width: none;
|
||||
@@ -273,20 +273,21 @@ const pullIndicatorStyle = () => ({
|
||||
|
||||
.filter-tab {
|
||||
flex-shrink: 0;
|
||||
padding: 7px 14px;
|
||||
padding: 8px 16px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
background: #141414;
|
||||
border: 1px solid #2a2a2a;
|
||||
transition: all 0.2s;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
transition: background 0.2s, border-color 0.2s, color 0.2s;
|
||||
}
|
||||
|
||||
.filter-tab.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
background: var(--bg-elevated);
|
||||
border-color: var(--border-strong);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.state {
|
||||
@@ -307,14 +308,21 @@ const pullIndicatorStyle = () => ({
|
||||
|
||||
.tx-list {
|
||||
margin-bottom: 0;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tx-row {
|
||||
display: block;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
padding: 12px 16px;
|
||||
padding: 12px 14px;
|
||||
border: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: transparent;
|
||||
@@ -326,21 +334,22 @@ const pullIndicatorStyle = () => ({
|
||||
}
|
||||
|
||||
.tx-row:active {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.tx-main {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.tx-text {
|
||||
.tx-col-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tx-col-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.tx-summary {
|
||||
@@ -352,19 +361,12 @@ const pullIndicatorStyle = () => ({
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.tx-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.tx-type { font-weight: 700; color: var(--text); }
|
||||
.pos { color: var(--primary-light); font-weight: 800; font-size: 15px; }
|
||||
.neg { color: var(--danger); font-weight: 700; }
|
||||
.zero { color: var(--text-muted); font-weight: 700; font-size: 15px; }
|
||||
.tx-time { font-size: 11px; color: var(--text-muted); }
|
||||
.tx-arrow { font-size: 16px; color: #555; font-weight: 700; line-height: 1; }
|
||||
.tx-type { font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
|
||||
.pos { color: var(--success); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
|
||||
.neg { color: var(--text); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
|
||||
.zero { color: var(--text-muted); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
|
||||
.tx-time { font-size: 11px; color: var(--text-dim); }
|
||||
.tx-arrow { font-size: 15px; color: var(--text-dim); font-weight: 400; line-height: 1; }
|
||||
|
||||
.sentinel {
|
||||
height: 1px;
|
||||
@@ -379,31 +381,11 @@ const pullIndicatorStyle = () => ({
|
||||
.end-hint {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #555;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
padding: 16px 0 4px;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
padding: 28px 16px 40px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.empty-img {
|
||||
width: min(320px, 86vw);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
opacity: 0.9;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
}
|
||||
.empty { text-align: center; color: var(--text-muted); padding: 40px 16px; font-weight: 600; }
|
||||
</style>
|
||||
|
||||
@@ -138,9 +138,9 @@ function goCashbackDetail() {
|
||||
<GoldSpinner v-if="spinning" :size="28" :progress="progress" :active="spinning" />
|
||||
</div>
|
||||
|
||||
<div class="top-bar">
|
||||
<header class="top-bar sub-toolbar">
|
||||
<button class="back-btn" type="button" @click="router.back()">‹ {{ t('history.back') }}</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div v-if="loading" class="state">
|
||||
<GoldSpinner :size="36" />
|
||||
@@ -235,7 +235,7 @@ function goCashbackDetail() {
|
||||
.back-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--primary-light, #d4af37);
|
||||
color: var(--primary-light);
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
padding: 4px 0 8px;
|
||||
@@ -248,13 +248,13 @@ function goCashbackDetail() {
|
||||
.state {
|
||||
text-align: center;
|
||||
padding: 60px 20px;
|
||||
color: #666;
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.hero {
|
||||
border-radius: 14px;
|
||||
border-radius: var(--radius);
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -262,31 +262,23 @@ function goCashbackDetail() {
|
||||
gap: 6px;
|
||||
margin-bottom: 12px;
|
||||
text-align: center;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.07), transparent 34%),
|
||||
rgba(18, 17, 14, 0.92);
|
||||
border: 1px solid rgba(255, 226, 156, 0.12);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.hero.pos {
|
||||
border-color: rgba(212, 175, 55, 0.25);
|
||||
background:
|
||||
linear-gradient(135deg, rgba(212, 175, 55, 0.12), transparent 46%),
|
||||
rgba(18, 17, 14, 0.92);
|
||||
border-color: rgba(46, 204, 113, 0.35);
|
||||
background: linear-gradient(135deg, rgba(46, 204, 113, 0.16), rgba(46, 204, 113, 0.05));
|
||||
}
|
||||
|
||||
.hero.neg {
|
||||
border-color: rgba(224, 80, 80, 0.2);
|
||||
background:
|
||||
linear-gradient(135deg, rgba(224, 80, 80, 0.12), transparent 46%),
|
||||
rgba(18, 14, 13, 0.92);
|
||||
border-color: rgba(255, 255, 255, 0.35);
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
|
||||
}
|
||||
|
||||
.hero.zero {
|
||||
border-color: rgba(255, 255, 255, 0.08);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
|
||||
rgba(18, 17, 14, 0.92);
|
||||
border-color: var(--border);
|
||||
background: var(--bg-elevated);
|
||||
}
|
||||
|
||||
.hero-type {
|
||||
@@ -294,13 +286,13 @@ function goCashbackDetail() {
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.hero-summary {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #bbb;
|
||||
color: var(--text);
|
||||
max-width: 100%;
|
||||
word-break: break-all;
|
||||
}
|
||||
@@ -311,37 +303,28 @@ function goCashbackDetail() {
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.hero.pos .hero-amount { color: var(--primary-light); }
|
||||
.hero.neg .hero-amount { color: var(--danger); }
|
||||
.hero.zero .hero-amount { color: var(--text-muted, #888); }
|
||||
.hero.pos .hero-amount { color: var(--success); }
|
||||
.hero.neg .hero-amount { color: var(--primary); }
|
||||
.hero.zero .hero-amount { color: var(--text-muted); }
|
||||
|
||||
.hero-time {
|
||||
font-size: 11px;
|
||||
color: #555;
|
||||
color: var(--neutral);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.section {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.04), transparent 28%),
|
||||
rgba(18, 17, 14, 0.9);
|
||||
border: 1px solid rgba(255, 226, 156, 0.1);
|
||||
border-radius: 12px;
|
||||
padding: 14px 16px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.section > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--space-card) 16px;
|
||||
margin-bottom: var(--space-section);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
color: #888;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.04em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
@@ -358,19 +341,19 @@ function goCashbackDetail() {
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
font-size: 13px;
|
||||
color: #aaa;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.sum-row span:last-child {
|
||||
color: #f0f0f0;
|
||||
color: var(--text);
|
||||
font-weight: 700;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.pos { color: var(--primary-light) !important; }
|
||||
.neg { color: var(--danger) !important; }
|
||||
.zero { color: var(--text-muted, #888) !important; }
|
||||
.pos { color: var(--success) !important; }
|
||||
.neg { color: var(--primary) !important; }
|
||||
.zero { color: var(--text-muted) !important; }
|
||||
|
||||
.mono {
|
||||
font-family: ui-monospace, monospace;
|
||||
@@ -387,9 +370,9 @@ function goCashbackDetail() {
|
||||
margin-top: 12px;
|
||||
padding: 10px 14px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: var(--surface-accent);
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
@@ -398,7 +381,7 @@ function goCashbackDetail() {
|
||||
.tx-id {
|
||||
font-family: ui-monospace, monospace;
|
||||
font-size: 12px;
|
||||
color: #ccc;
|
||||
color: var(--text-muted);
|
||||
word-break: break-all;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -1,285 +1,588 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { ref, onActivated, onMounted } from 'vue';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import api from '../api';
|
||||
import { formatMoney, formatMoneyCompact } from '../utils/localeDisplay';
|
||||
|
||||
import { formatMoney } from '../utils/localeDisplay';
|
||||
|
||||
import { txTypeKey, txDisplayType, txAmountClass, txSummaryLabel } from '../utils/walletTx';
|
||||
import { parseCashbackApiData, sumCashbackAmount } from '../utils/cashback';
|
||||
|
||||
import GoldSpinner from '../components/GoldSpinner.vue';
|
||||
|
||||
import { usePullToRefresh } from '../composables/usePullToRefresh';
|
||||
import emptyWalletImg from '../assets/images/generated/empty-wallet-ledger-v1.webp';
|
||||
|
||||
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
|
||||
|
||||
type Transaction = {
|
||||
|
||||
transactionType: string;
|
||||
|
||||
displayType?: string;
|
||||
|
||||
summary?: string | null;
|
||||
|
||||
summaryKind?: 'opening_bonus' | null;
|
||||
|
||||
referenceType?: string | null;
|
||||
|
||||
amount: string;
|
||||
|
||||
frozenBefore?: string;
|
||||
|
||||
frozenAfter?: string;
|
||||
|
||||
createdAt: string;
|
||||
|
||||
transactionId: string;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const items = ref<Transaction[]>([]);
|
||||
const cashbackTotal = ref<string>('0');
|
||||
|
||||
const loading = ref(true);
|
||||
|
||||
const PREVIEW_COUNT = 15;
|
||||
|
||||
|
||||
|
||||
function txLabel(tx: Transaction): string {
|
||||
|
||||
const key = txTypeKey(txDisplayType(tx));
|
||||
|
||||
if (key) {
|
||||
|
||||
const translated = t(key);
|
||||
|
||||
if (translated !== key) return translated;
|
||||
|
||||
}
|
||||
|
||||
return tx.transactionType;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function txSubtitle(tx: Transaction): string {
|
||||
|
||||
return txSummaryLabel(tx, t);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function goDetail(tx: Transaction) {
|
||||
|
||||
if (!tx.transactionId) return;
|
||||
|
||||
router.push(`/wallet/transactions/${tx.transactionId}`);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function goCashbacks() {
|
||||
|
||||
router.push('/wallet/cashbacks');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function fetchData() {
|
||||
|
||||
loading.value = true;
|
||||
|
||||
try {
|
||||
const [txRes, cbRes] = await Promise.all([
|
||||
api.get('/player/wallet/transactions', { params: { page: 1 } }),
|
||||
api.get('/player/cashbacks').catch(() => ({ data: { data: [] } })),
|
||||
]);
|
||||
const result = txRes.data.data ?? { items: [] };
|
||||
|
||||
const { data } = await api.get('/player/wallet/transactions', { params: { page: 1 } });
|
||||
|
||||
const result = data.data ?? { items: [] };
|
||||
|
||||
items.value = (result.items ?? []).slice(0, PREVIEW_COUNT);
|
||||
const cbRows = parseCashbackApiData(cbRes.data?.data);
|
||||
cashbackTotal.value = sumCashbackAmount(cbRows).toString();
|
||||
|
||||
} catch {
|
||||
|
||||
/* ignore */
|
||||
|
||||
} finally {
|
||||
|
||||
loading.value = false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const { pullDistance, spinning, progress } = usePullToRefresh({
|
||||
|
||||
onRefresh: fetchData,
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
onMounted(fetchData);
|
||||
|
||||
onActivated(fetchData);
|
||||
|
||||
|
||||
|
||||
const pullIndicatorStyle = () => ({
|
||||
|
||||
height: `${pullDistance.value}px`,
|
||||
|
||||
opacity: Math.min(pullDistance.value / 48, 1),
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
|
||||
<div class="wallet-page">
|
||||
|
||||
<div
|
||||
|
||||
class="pull-indicator"
|
||||
|
||||
:style="pullIndicatorStyle()"
|
||||
|
||||
>
|
||||
|
||||
<GoldSpinner v-if="spinning" :size="28" :progress="progress" :active="spinning" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div v-if="loading" class="state">
|
||||
|
||||
<GoldSpinner :size="36" />
|
||||
|
||||
<span class="loading-text">{{ t('bet.loading') }}</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<template v-else>
|
||||
<div class="top-bar">
|
||||
<button type="button" class="more-link secondary" @click="goCashbacks">
|
||||
{{ t('wallet.view_cashbacks_detail') }} ›
|
||||
|
||||
<div class="wallet-links">
|
||||
|
||||
<button type="button" class="wallet-link" @click="goCashbacks">
|
||||
|
||||
{{ t('wallet.view_cashbacks') }}
|
||||
|
||||
</button>
|
||||
|
||||
<button
|
||||
|
||||
v-if="items.length"
|
||||
|
||||
type="button"
|
||||
class="more-link"
|
||||
|
||||
class="wallet-link wallet-link--primary"
|
||||
|
||||
@click="router.push('/wallet/detail')"
|
||||
>{{ t('wallet.view_all') }} ›</button>
|
||||
|
||||
>
|
||||
|
||||
{{ t('wallet.view_all') }}
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div v-if="items.length" class="tx-list">
|
||||
|
||||
<button
|
||||
|
||||
v-for="tx in items"
|
||||
|
||||
:key="tx.transactionId"
|
||||
|
||||
type="button"
|
||||
|
||||
class="tx-row"
|
||||
|
||||
@click="goDetail(tx)"
|
||||
|
||||
>
|
||||
<div class="tx-main">
|
||||
<div class="tx-text">
|
||||
|
||||
<div class="tx-col-left">
|
||||
|
||||
<span class="tx-type">{{ txLabel(tx) }}</span>
|
||||
|
||||
<span v-if="txSubtitle(tx)" class="tx-summary">{{ txSubtitle(tx) }}</span>
|
||||
</div>
|
||||
<span :class="txAmountClass(tx.amount)">
|
||||
{{ formatMoney(tx.amount, locale) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="tx-meta">
|
||||
|
||||
<span class="tx-time">{{ new Date(tx.createdAt).toLocaleString() }}</span>
|
||||
<span class="tx-arrow">›</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tx-col-right">
|
||||
|
||||
<span :class="txAmountClass(tx.amount)">
|
||||
|
||||
{{ formatMoney(tx.amount, locale) }}
|
||||
|
||||
</span>
|
||||
|
||||
<span class="tx-arrow" aria-hidden="true">›</span>
|
||||
|
||||
</div>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div v-if="!items.length" class="empty">
|
||||
<img :src="emptyWalletImg" alt="" class="empty-img" />
|
||||
<span>{{ t('wallet.no_records') }}</span>
|
||||
|
||||
{{ t('wallet.no_records') }}
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
.wallet-page {
|
||||
|
||||
padding-bottom: 24px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.pull-indicator {
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
transition: height 0.15s ease;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.state {
|
||||
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
|
||||
gap: 12px;
|
||||
|
||||
text-align: center;
|
||||
|
||||
color: var(--text-muted);
|
||||
|
||||
padding: 56px 20px;
|
||||
font-weight: 600;
|
||||
|
||||
font-weight: 500;
|
||||
|
||||
font-size: 14px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.loading-text {
|
||||
|
||||
font-size: 13px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.wallet-links {
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
|
||||
justify-content: space-between;
|
||||
|
||||
gap: 12px;
|
||||
|
||||
margin: 0 0 12px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.wallet-link {
|
||||
|
||||
background: none;
|
||||
|
||||
border: none;
|
||||
|
||||
padding: 4px 0;
|
||||
|
||||
font-size: 13px;
|
||||
|
||||
font-weight: 500;
|
||||
|
||||
color: var(--text-muted);
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.wallet-link--primary {
|
||||
|
||||
color: var(--text);
|
||||
|
||||
font-weight: 600;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.wallet-link:active {
|
||||
|
||||
opacity: 0.72;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-list {
|
||||
|
||||
margin-bottom: 0;
|
||||
|
||||
background: var(--gradient-card);
|
||||
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
|
||||
border-radius: var(--radius);
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-row {
|
||||
display: block;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
|
||||
justify-content: space-between;
|
||||
|
||||
gap: 12px;
|
||||
|
||||
width: 100%;
|
||||
|
||||
text-align: left;
|
||||
|
||||
font-size: 14px;
|
||||
padding: 8px 12px;
|
||||
|
||||
padding: 14px 16px;
|
||||
|
||||
border: none;
|
||||
|
||||
border-bottom: 1px solid var(--border);
|
||||
|
||||
background: transparent;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-row:last-child {
|
||||
|
||||
border-bottom: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-row:active {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
|
||||
background: var(--bg-hover);
|
||||
|
||||
}
|
||||
|
||||
.tx-main {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.tx-text {
|
||||
|
||||
.tx-col-left {
|
||||
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
|
||||
gap: 3px;
|
||||
|
||||
min-width: 0;
|
||||
|
||||
flex: 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-col-right {
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
|
||||
gap: 6px;
|
||||
|
||||
flex-shrink: 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-summary {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.tx-meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.tx-type { font-weight: 700; color: var(--text); }
|
||||
.pos { color: var(--primary-light); font-weight: 800; font-size: 15px; }
|
||||
.neg { color: var(--danger); font-weight: 700; }
|
||||
.zero { color: var(--text-muted); font-weight: 700; font-size: 15px; }
|
||||
.tx-time { font-size: 11px; color: var(--text-muted); }
|
||||
.tx-arrow { font-size: 16px; color: #555; font-weight: 700; line-height: 1; }
|
||||
|
||||
.top-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 4px 2px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
||||
.top-bar .more-link.secondary {
|
||||
color: #f0b90b;
|
||||
}
|
||||
|
||||
.more-link {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--primary-light);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
padding: 2px 6px;
|
||||
cursor: pointer;
|
||||
opacity: 0.8;
|
||||
transition: opacity 0.2s;
|
||||
|
||||
color: var(--text-dim);
|
||||
|
||||
font-weight: 500;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
|
||||
}
|
||||
|
||||
.more-link:active {
|
||||
opacity: 1;
|
||||
|
||||
|
||||
.tx-type {
|
||||
|
||||
font-weight: 600;
|
||||
|
||||
color: var(--text);
|
||||
|
||||
letter-spacing: -0.01em;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.pos {
|
||||
|
||||
color: var(--success);
|
||||
|
||||
font-weight: 600;
|
||||
|
||||
font-size: 14px;
|
||||
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.neg {
|
||||
|
||||
color: var(--text);
|
||||
|
||||
font-weight: 600;
|
||||
|
||||
font-size: 14px;
|
||||
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.zero {
|
||||
|
||||
color: var(--text-muted);
|
||||
|
||||
font-weight: 600;
|
||||
|
||||
font-size: 14px;
|
||||
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-time {
|
||||
|
||||
font-size: 11px;
|
||||
|
||||
color: var(--text-dim);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tx-arrow {
|
||||
|
||||
font-size: 15px;
|
||||
|
||||
color: var(--text-dim);
|
||||
|
||||
font-weight: 400;
|
||||
|
||||
line-height: 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
text-align: center;
|
||||
|
||||
color: var(--text-muted);
|
||||
padding: 28px 16px 40px;
|
||||
font-weight: 600;
|
||||
|
||||
padding: 40px 16px;
|
||||
|
||||
font-weight: 500;
|
||||
|
||||
}
|
||||
|
||||
.empty-img {
|
||||
width: min(320px, 86vw);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
opacity: 0.9;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -103,10 +103,15 @@ const fieldError = () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="login-page" :class="{ 'login-page--desktop': props.desktop }" :style="props.desktop ? undefined : { backgroundImage: `url(${loginBg})` }">
|
||||
<div
|
||||
class="login-page"
|
||||
:class="{ 'login-page--desktop': props.desktop }"
|
||||
:style="props.desktop ? undefined : { backgroundImage: `url(${loginBg})` }"
|
||||
>
|
||||
<div v-if="!props.desktop" class="login-lang">
|
||||
<LocaleSwitcher compact />
|
||||
</div>
|
||||
<div class="login-stack">
|
||||
<form
|
||||
@submit.prevent="submit"
|
||||
class="login-form"
|
||||
@@ -116,6 +121,7 @@ const fieldError = () => {
|
||||
<GoldSpinner :size="40" :active="true" />
|
||||
<p class="form-busy-text">{{ t('auth.registering') }}</p>
|
||||
</div>
|
||||
|
||||
<h2 class="form-title">{{ t('auth.register') }}</h2>
|
||||
|
||||
<div class="field">
|
||||
@@ -123,6 +129,7 @@ const fieldError = () => {
|
||||
<input
|
||||
v-model="account"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
required
|
||||
autocomplete="username"
|
||||
maxlength="32"
|
||||
@@ -139,6 +146,7 @@ const fieldError = () => {
|
||||
<input
|
||||
v-model="phone"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="tel"
|
||||
required
|
||||
autocomplete="tel-national"
|
||||
@@ -154,6 +162,7 @@ const fieldError = () => {
|
||||
<input
|
||||
v-model="smsCode"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
inputmode="numeric"
|
||||
maxlength="6"
|
||||
autocomplete="one-time-code"
|
||||
@@ -177,17 +186,41 @@ const fieldError = () => {
|
||||
|
||||
<div class="field">
|
||||
<label>{{ t('auth.password') }}</label>
|
||||
<input v-model="password" class="field-input" type="password" required autocomplete="new-password" minlength="8" :disabled="loading" />
|
||||
<input
|
||||
v-model="password"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="password"
|
||||
required
|
||||
autocomplete="new-password"
|
||||
minlength="8"
|
||||
:disabled="loading"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>{{ t('auth.confirm_password') }}</label>
|
||||
<input v-model="confirmPassword" class="field-input" type="password" required autocomplete="new-password" minlength="8" :disabled="loading" />
|
||||
<input
|
||||
v-model="confirmPassword"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
type="password"
|
||||
required
|
||||
autocomplete="new-password"
|
||||
minlength="8"
|
||||
:disabled="loading"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="field field-optional">
|
||||
<label>{{ t('auth.invite_code') }} <span class="optional-tag">{{ t('auth.optional') }}</span></label>
|
||||
<input v-model="inviteCode" class="field-input" autocomplete="off" :disabled="loading" />
|
||||
<input
|
||||
v-model="inviteCode"
|
||||
class="field-input"
|
||||
:class="{ 'ps-gold-input': !props.desktop }"
|
||||
autocomplete="off"
|
||||
:disabled="loading"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p v-if="fieldError()" class="error">{{ fieldError() }}</p>
|
||||
@@ -205,14 +238,22 @@ const fieldError = () => {
|
||||
</span>
|
||||
<span v-else>{{ t('auth.register_btn') }}</span>
|
||||
</button>
|
||||
<button type="button" class="btn-skip" :disabled="loading" @click="goLogin">
|
||||
|
||||
<button v-if="props.desktop" type="button" class="btn-skip btn-skip--desktop" :disabled="loading" @click="goLogin">
|
||||
{{ t('auth.have_account') }}
|
||||
</button>
|
||||
</form>
|
||||
<button v-if="!props.desktop" type="button" class="btn-skip-light" @click="continueBrowsing">
|
||||
|
||||
<div v-if="!props.desktop" class="login-actions">
|
||||
<button type="button" class="btn-skip" :disabled="loading" @click="goLogin">
|
||||
{{ t('auth.have_account') }}
|
||||
</button>
|
||||
<button type="button" class="btn-skip-light" :disabled="loading" @click="continueBrowsing">
|
||||
{{ t('auth.continue_browsing') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
@@ -220,7 +261,7 @@ const fieldError = () => {
|
||||
position: absolute;
|
||||
top: max(12px, env(safe-area-inset-top));
|
||||
right: 16px;
|
||||
z-index: 2;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.login-page {
|
||||
@@ -232,13 +273,27 @@ const fieldError = () => {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 30vh 16px calc(10vh + max(20px, env(safe-area-inset-bottom)));
|
||||
background-color: var(--tertiary);
|
||||
padding: 30vh 16px max(20px, env(safe-area-inset-bottom));
|
||||
background-color: var(--bg-body);
|
||||
background-size: cover;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.login-page::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
rgba(0, 34, 68, 0.35) 0%,
|
||||
rgba(0, 34, 68, 0.78) 52%,
|
||||
rgba(0, 34, 68, 0.94) 100%
|
||||
);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* ===== Desktop mode: fields only (card shell in DesktopAuthLayout) ===== */
|
||||
.login-page--desktop {
|
||||
min-height: auto;
|
||||
@@ -251,14 +306,31 @@ const fieldError = () => {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
.login-page--desktop::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.login-stack {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.login-page--desktop .login-stack {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.login-page--desktop .login-form {
|
||||
@@ -285,7 +357,7 @@ const fieldError = () => {
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
border-radius: inherit;
|
||||
background: rgba(8, 8, 8, 0.72);
|
||||
background: rgba(0, 26, 51, 0.82);
|
||||
backdrop-filter: blur(2px);
|
||||
pointer-events: all;
|
||||
}
|
||||
@@ -294,7 +366,7 @@ const fieldError = () => {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: rgba(240, 216, 117, 0.95);
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
@@ -305,6 +377,14 @@ const fieldError = () => {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.login-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 0 14px 4px;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
margin: 0 0 2px;
|
||||
font-size: 16px;
|
||||
@@ -317,7 +397,7 @@ const fieldError = () => {
|
||||
font-size: 18px;
|
||||
margin: 0 0 8px;
|
||||
text-align: left;
|
||||
color: var(--primary-light, #f0d875);
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
@@ -350,7 +430,7 @@ label {
|
||||
.optional-tag {
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.login-page--desktop .optional-tag {
|
||||
@@ -358,30 +438,25 @@ label {
|
||||
}
|
||||
|
||||
.field-input {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #0d0d0d;
|
||||
background-color: #0d0d0d;
|
||||
background: var(--bg-input);
|
||||
color: var(--text);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
caret-color: var(--primary-light, #f0d875);
|
||||
}
|
||||
|
||||
.field-input::placeholder {
|
||||
color: rgba(255, 255, 255, 0.32);
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.field-input:focus {
|
||||
outline: none;
|
||||
border-color: #555;
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
/* Desktop: visible focus ring per UX guideline */
|
||||
@@ -393,31 +468,12 @@ label {
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:focus {
|
||||
border-color: var(--border-gold, #D4AF37);
|
||||
color: var(--text);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.06), transparent 72%),
|
||||
#0d0d0d;
|
||||
background-color: #0d0d0d;
|
||||
box-shadow:
|
||||
inset 0 0 18px rgba(212, 175, 55, 0.08),
|
||||
0 0 14px rgba(212, 175, 55, 0.14);
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:-webkit-autofill,
|
||||
.login-page--desktop .field-input:-webkit-autofill:hover,
|
||||
.login-page--desktop .field-input:-webkit-autofill:focus {
|
||||
border-color: var(--border-gold, #D4AF37);
|
||||
-webkit-text-fill-color: var(--text);
|
||||
box-shadow:
|
||||
0 0 0 1000px #0d0d0d inset,
|
||||
inset 0 0 18px rgba(212, 175, 55, 0.08);
|
||||
transition: background-color 9999s ease-out;
|
||||
border-color: var(--border-strong);
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.login-page--desktop .field-input:hover:not(:focus) {
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.inline-row {
|
||||
@@ -437,7 +493,7 @@ label {
|
||||
padding: 0 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: #141414;
|
||||
background: var(--bg-card);
|
||||
color: var(--text);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
@@ -454,8 +510,15 @@ label {
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-secondary:hover:not(:disabled) {
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
background: rgba(30, 30, 30, 0.8);
|
||||
border-color: var(--border-gold-soft);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.btn-secondary:not(:disabled).active,
|
||||
.btn-secondary:active:not(:disabled) {
|
||||
border-color: var(--border-gold);
|
||||
background: var(--surface-accent);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.btn-secondary:disabled {
|
||||
@@ -485,8 +548,8 @@ label {
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-login:hover:not(:disabled) {
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border-color: var(--border-gold, #D4AF37);
|
||||
background: var(--surface-accent);
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-login:active:not(:disabled) {
|
||||
@@ -507,14 +570,14 @@ label {
|
||||
}
|
||||
|
||||
.btn-skip {
|
||||
margin-top: 2px;
|
||||
padding: 8px 14px;
|
||||
padding: 6px 14px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgba(255, 255, 255, 0.55);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
@@ -522,28 +585,29 @@ label {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-skip {
|
||||
.btn-skip--desktop {
|
||||
margin-top: 6px;
|
||||
padding: 12px 16px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border, #333);
|
||||
background: rgba(20, 20, 20, 0.6);
|
||||
border: 1px solid var(--border);
|
||||
background: var(--bg-input);
|
||||
font-size: 14px;
|
||||
transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.login-page--desktop .btn-skip:hover {
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
background: rgba(30, 30, 30, 0.8);
|
||||
.btn-skip--desktop:hover:not(:disabled) {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--text);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.btn-skip:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn-skip-light {
|
||||
position: absolute;
|
||||
bottom: calc(20px + env(safe-area-inset-bottom));
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
padding: 8px 16px;
|
||||
padding: 6px 16px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: rgba(255, 255, 255, 0.45);
|
||||
@@ -551,6 +615,7 @@ label {
|
||||
font-weight: 300;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-skip-light:active {
|
||||
@@ -571,7 +636,7 @@ label {
|
||||
padding: 6px 10px;
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 69, 58, 0.08);
|
||||
border-left: 2px solid var(--danger, #FF453A);
|
||||
border-left: 2px solid var(--danger);
|
||||
}
|
||||
|
||||
@keyframes reg-fade-in {
|
||||
|
||||
@@ -135,7 +135,7 @@ onActivated(() => {
|
||||
padding: 18px 20px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(18, 18, 18, 0.95) 42%);
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(10, 42, 68, 0.95) 42%);
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
@@ -147,8 +147,8 @@ onActivated(() => {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: #141414;
|
||||
color: var(--gold);
|
||||
background: #0A2540;
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
@@ -158,7 +158,7 @@ onActivated(() => {
|
||||
|
||||
.back-btn:hover {
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
@@ -202,7 +202,7 @@ onActivated(() => {
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-light);
|
||||
@@ -238,7 +238,7 @@ onActivated(() => {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
background: rgba(18, 18, 18, 0.96);
|
||||
background: rgba(10, 42, 68, 0.96);
|
||||
text-align: left;
|
||||
transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
@@ -251,7 +251,7 @@ onActivated(() => {
|
||||
|
||||
.card-cover {
|
||||
aspect-ratio: 16 / 7;
|
||||
background: #0a0a0a;
|
||||
background: #001A33;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -281,11 +281,11 @@ onActivated(() => {
|
||||
flex-shrink: 0;
|
||||
padding: 2px 7px;
|
||||
border-radius: 4px;
|
||||
background: rgba(212, 175, 55, 0.12);
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border: 1px solid rgba(255, 255, 255, 0.22);
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: var(--gold);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.card-date {
|
||||
|
||||
@@ -96,24 +96,6 @@ function translateSel(name: string): string {
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
function legResultIcon(status?: string) {
|
||||
switch (status?.toUpperCase()) {
|
||||
case 'WON': return '✓';
|
||||
case 'LOST': return '✗';
|
||||
case 'PUSH': return '=';
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
||||
function legResultClass(status?: string) {
|
||||
switch (status?.toUpperCase()) {
|
||||
case 'WON': return 'leg-won';
|
||||
case 'LOST': return 'leg-lost';
|
||||
case 'PUSH': return 'leg-push';
|
||||
default: return 'leg-pending';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -135,70 +117,42 @@ function legResultClass(status?: string) {
|
||||
<button type="button" class="retry-btn" @click="loadDetail">{{ t('common.retry') }}</button>
|
||||
</div>
|
||||
|
||||
<div v-else-if="detail" class="detail-grid">
|
||||
<!-- Left column: selections -->
|
||||
<div class="detail-left">
|
||||
<div v-else-if="detail" class="detail-layout">
|
||||
<!-- Header info -->
|
||||
<div class="detail-card header-card">
|
||||
<div class="bet-no">{{ detail.betNo }}</div>
|
||||
<span class="status-badge" :class="statusClass(detail.status)">{{ statusLabel(detail.status) }}</span>
|
||||
<div class="amount-row">
|
||||
<div class="amount-item">
|
||||
<span class="amount-label">{{ t('bet.stake') || '投注额' }}</span>
|
||||
<span class="amount-val">{{ detail.stake }}</span>
|
||||
</div>
|
||||
<div class="amount-item">
|
||||
<span class="amount-label">{{ t('bet.potential_payout') || '预计派彩' }}</span>
|
||||
<span class="amount-val gold">{{ detail.potentialReturn || '-' }}</span>
|
||||
</div>
|
||||
<div class="amount-item">
|
||||
<span class="amount-label">{{ t('bet.placed_at') || '下注时间' }}</span>
|
||||
<span class="amount-val date">{{ detail.placedAt ? new Date(detail.placedAt).toLocaleString() : '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Selections -->
|
||||
<div class="detail-card">
|
||||
<div class="card-title">{{ t('bet.selections') || '投注选项' }}</div>
|
||||
<div v-for="(leg, idx) in detail.legs" :key="idx" class="sel-row">
|
||||
<div class="sel-row-left">
|
||||
<span class="sel-index">{{ idx + 1 }}</span>
|
||||
<div class="sel-info">
|
||||
<div class="sel-match">{{ leg.matchTitle || t('bet.match') }}</div>
|
||||
<div class="sel-meta">
|
||||
<span class="sel-market">{{ leg.marketLabel || '' }}</span>
|
||||
<span class="sel-name">{{ translateSel(leg.selectionName || '') }}</span>
|
||||
<span v-if="leg.score?.ft" class="sel-score">{{ t('history.ft') }}: {{ leg.score.ft }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sel-row-right">
|
||||
<span class="sel-odds">@{{ leg.odds }}</span>
|
||||
<span v-if="leg.resultStatus" class="leg-result" :class="legResultClass(leg.resultStatus)">
|
||||
{{ legResultIcon(leg.resultStatus) }}
|
||||
</span>
|
||||
<span v-if="leg.score?.ft" class="sel-score">({{ t('history.ft') }}: {{ leg.score.ft }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right column: summary -->
|
||||
<div class="detail-right">
|
||||
<div class="detail-card summary-card">
|
||||
<div class="card-title">{{ t('bet.summary') || '注单概要' }}</div>
|
||||
<div class="summary-bet-no">
|
||||
<span class="summary-label">{{ t('bet.bet_no') || '注单号' }}</span>
|
||||
<span class="summary-value mono">{{ detail.betNo }}</span>
|
||||
</div>
|
||||
<div class="summary-status">
|
||||
<span class="status-badge" :class="statusClass(detail.status)">{{ statusLabel(detail.status) }}</span>
|
||||
</div>
|
||||
<div class="summary-amounts">
|
||||
<div class="summary-amount-item">
|
||||
<span class="summary-amount-label">{{ t('bet.stake') || '投注额' }}</span>
|
||||
<span class="summary-amount-val">{{ detail.stake }}</span>
|
||||
</div>
|
||||
<div class="summary-amount-item">
|
||||
<span class="summary-amount-label">{{ t('bet.potential_payout') || '预计派彩' }}</span>
|
||||
<span class="summary-amount-val gold">{{ detail.potentialReturn || '-' }}</span>
|
||||
</div>
|
||||
<div class="summary-amount-item">
|
||||
<span class="summary-amount-label">{{ t('bet.placed_at') || '下注时间' }}</span>
|
||||
<span class="summary-amount-val date">{{ detail.placedAt ? new Date(detail.placedAt).toLocaleString() : '-' }}</span>
|
||||
</div>
|
||||
<div class="summary-amount-item">
|
||||
<span class="summary-amount-label">{{ t('bet.legs_count') || '过关场数' }}</span>
|
||||
<span class="summary-amount-val">{{ detail.legs?.length ?? 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<RouterLink to="/bets" class="back-to-list-btn">
|
||||
{{ t('bet.back_to_list') || '返回注单列表' }}
|
||||
</RouterLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="empty-state">{{ t('common.not_found') || '未找到记录' }}</div>
|
||||
</main>
|
||||
</div>
|
||||
@@ -217,127 +171,45 @@ function legResultClass(status?: string) {
|
||||
.retry-btn { padding: 8px 24px; border-radius: 6px; border: 1px solid var(--primary); background: transparent; color: var(--primary-light); font-size: 13px; font-weight: 700; cursor: pointer; }
|
||||
.empty-state { display: flex; align-items: center; justify-content: center; padding: 80px 20px; color: var(--text-muted); font-size: 14px; font-weight: 600; }
|
||||
|
||||
.detail-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 340px;
|
||||
gap: 20px;
|
||||
max-width: 1100px;
|
||||
}
|
||||
|
||||
.detail-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
|
||||
.detail-right { display: flex; flex-direction: column; gap: 16px; }
|
||||
.detail-layout { display: flex; flex-direction: column; gap: 16px; max-width: 680px; }
|
||||
|
||||
.detail-card {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(rgba(22, 20, 15, 0.76), rgba(18, 16, 12, 0.82)),
|
||||
url('../../assets/images/generated/detail-ledger-ticket-bg-v1.webp') center / cover no-repeat;
|
||||
background: var(--desktop-sidebar-bg);
|
||||
border: 1px solid var(--desktop-border);
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.detail-card > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.header-card { display: flex; flex-direction: column; gap: 12px; }
|
||||
|
||||
.card-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--desktop-border); }
|
||||
|
||||
/* Selection rows */
|
||||
.sel-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 14px 0;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.04);
|
||||
gap: 16px;
|
||||
}
|
||||
.sel-row:last-child { border-bottom: none; }
|
||||
|
||||
.sel-row-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
|
||||
|
||||
.sel-index {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255,255,255,0.06);
|
||||
font-size: 11px;
|
||||
.bet-no {
|
||||
font-family: 'SF Mono', 'Consolas', monospace;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
flex-shrink: 0;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.sel-info { min-width: 0; }
|
||||
.sel-match { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
|
||||
.sel-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
|
||||
.sel-name { color: var(--text); font-weight: 700; }
|
||||
.sel-score { color: var(--text-muted); }
|
||||
|
||||
.sel-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
|
||||
.sel-odds { color: var(--primary-light); font-weight: 800; font-size: 14px; }
|
||||
|
||||
.leg-result {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 50%;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
}
|
||||
.leg-won { background: rgba(52,199,89,0.15); color: #4cd964; }
|
||||
.leg-lost { background: rgba(255,69,58,0.15); color: #ff453a; }
|
||||
.leg-push { background: rgba(100,100,100,0.15); color: #aaa; }
|
||||
.leg-pending { background: rgba(212,175,55,0.12); color: var(--primary-light); font-size: 10px; }
|
||||
|
||||
/* Summary card */
|
||||
.summary-card { display: flex; flex-direction: column; gap: 16px; }
|
||||
|
||||
.summary-bet-no { display: flex; flex-direction: column; gap: 4px; }
|
||||
.summary-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.summary-value { font-size: 14px; font-weight: 700; color: var(--text); }
|
||||
.mono { font-family: 'SF Mono', 'Consolas', monospace; letter-spacing: 0.03em; }
|
||||
|
||||
.summary-status { display: flex; }
|
||||
|
||||
.status-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; }
|
||||
.status-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; align-self: flex-start; }
|
||||
.status-won { background: rgba(52,199,89,0.12); color: #4cd964; }
|
||||
.status-lost { background: rgba(255,69,58,0.12); color: #ff453a; }
|
||||
.status-pending { background: rgba(212,175,55,0.12); color: var(--primary-light); }
|
||||
.status-pending { background: rgba(255, 255, 255,0.12); color: var(--primary-light); }
|
||||
.status-push { background: rgba(100,100,100,0.12); color: #aaa; }
|
||||
.status-default { background: rgba(100,100,100,0.1); color: #888; }
|
||||
|
||||
.summary-amounts { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; border-top: 1px solid var(--desktop-border); }
|
||||
.summary-amount-item { display: flex; flex-direction: column; gap: 4px; }
|
||||
.summary-amount-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.summary-amount-val { font-size: 18px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
|
||||
.summary-amount-val.gold { color: var(--primary-light); }
|
||||
.summary-amount-val.date { font-size: 13px; color: var(--text-muted); font-weight: 600; }
|
||||
.amount-row { display: flex; gap: 32px; padding-top: 4px; flex-wrap: wrap; }
|
||||
.amount-item { display: flex; flex-direction: column; gap: 4px; }
|
||||
.amount-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
|
||||
.amount-val { font-size: 18px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
|
||||
.amount-val.gold { color: var(--primary-light); }
|
||||
.amount-val.date { font-size: 13px; color: var(--text-muted); font-weight: 600; }
|
||||
|
||||
.back-to-list-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--desktop-border);
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.back-to-list-btn:hover { border-color: var(--border-gold-soft); color: var(--primary-light); background: rgba(212,175,55,0.06); }
|
||||
.card-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--desktop-border); }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.detail-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
.sel-row { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
|
||||
.sel-row:last-child { border-bottom: none; }
|
||||
.sel-match { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
|
||||
.sel-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-muted); }
|
||||
.sel-name { color: var(--text); font-weight: 700; }
|
||||
.sel-odds { color: var(--primary-light); font-weight: 800; margin-left: auto; }
|
||||
</style>
|
||||
|
||||
@@ -149,9 +149,9 @@ onActivated(loadData);
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
padding: 8px 14px;
|
||||
border: 1px solid rgba(212, 175, 55, 0.22);
|
||||
border: 1px solid rgba(255, 255, 255, 0.22);
|
||||
border-radius: 8px;
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
|
||||
@@ -7,7 +7,6 @@ import { useDesktopParlayMatches, type DesktopParlayMatch } from '../../composab
|
||||
import { useOutrightEvents } from '../../composables/useOutrightEvents';
|
||||
import MatchBetCard from '../../components/MatchBetCard.vue';
|
||||
import DesktopOutrightEventCard from '../../components/desktop/DesktopOutrightEventCard.vue';
|
||||
import emptyMatchesImg from '../../assets/images/generated/empty-matches-stadium-v1.webp';
|
||||
import {
|
||||
isAfterLocalTodayMatchWindow as isAfterTodayMatchWindow,
|
||||
isInLocalTodayMatchWindow as isInTodayMatchWindow,
|
||||
@@ -160,7 +159,7 @@ function closeModal() {
|
||||
|
||||
async function refresh() {
|
||||
if (mainTab.value === 'outright') {
|
||||
await loadOutrights({ silent: false, force: true });
|
||||
await loadOutrights({ silent: false });
|
||||
return;
|
||||
}
|
||||
await loadParlayMatches(true);
|
||||
@@ -225,7 +224,6 @@ void loadParlayMatches(true);
|
||||
</template>
|
||||
|
||||
<div v-else class="empty-state">
|
||||
<img :src="emptyMatchesImg" alt="" class="empty-state-art" />
|
||||
<p>{{ t('bet.no_matches') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -256,7 +254,6 @@ void loadParlayMatches(true);
|
||||
</template>
|
||||
|
||||
<div v-else class="empty-state">
|
||||
<img :src="emptyMatchesImg" alt="" class="empty-state-art" />
|
||||
<p>{{ outrightError || t('bet.no_outright') }}</p>
|
||||
<p v-if="!outrightError" class="empty-hint">{{ t('bet.no_outright_hint') }}</p>
|
||||
</div>
|
||||
@@ -306,7 +303,7 @@ void loadParlayMatches(true);
|
||||
|
||||
.main-tab.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
}
|
||||
|
||||
@@ -350,7 +347,7 @@ void loadParlayMatches(true);
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border-left: 3px solid var(--primary);
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
@@ -441,31 +438,12 @@ void loadParlayMatches(true);
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
text-align: center;
|
||||
padding: 40px 16px;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.empty-state-art {
|
||||
width: min(460px, 70%);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
opacity: 0.72;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
}
|
||||
|
||||
.empty-state p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.empty-hint {
|
||||
margin-top: 8px;
|
||||
font-size: 12px;
|
||||
@@ -481,8 +459,7 @@ void loadParlayMatches(true);
|
||||
|
||||
.outright-event-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(340px, 420px));
|
||||
justify-content: start;
|
||||
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,8 +8,6 @@ import AnnouncementMarquee from '../../components/AnnouncementMarquee.vue';
|
||||
import { usePlayerHome } from '../../composables/usePlayerHome';
|
||||
import TeamEmblem from '../../components/TeamEmblem.vue';
|
||||
import GoldSpinner from '../../components/GoldSpinner.vue';
|
||||
import emptyMatchesImg from '../../assets/images/generated/empty-matches-stadium-v1.webp';
|
||||
import vsImg from '../../assets/images/generated/vs-gold-alpha-v1.webp';
|
||||
import { formatLocalMatchDateTime } from '@thebet365/shared';
|
||||
import type { PlayerHomeMatch } from '../../composables/usePlayerHome';
|
||||
import { useDesktopBetPopover } from '../../composables/useDesktopBetPopover';
|
||||
@@ -228,9 +226,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
/>
|
||||
<span class="featured-team-name">{{ featuredMatch.homeTeamName }}</span>
|
||||
</div>
|
||||
<div class="featured-vs vs-heartbeat">
|
||||
<img :src="vsImg" alt="VS" class="featured-vs-img" />
|
||||
</div>
|
||||
<div class="featured-vs vs-heartbeat">VS</div>
|
||||
<div class="featured-team">
|
||||
<TeamEmblem
|
||||
size="lg"
|
||||
@@ -297,9 +293,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
/>
|
||||
<span class="team-name">{{ match.homeTeamName }}</span>
|
||||
</div>
|
||||
<div class="vs-text">
|
||||
<img :src="vsImg" alt="VS" class="vs-mini-img" />
|
||||
</div>
|
||||
<div class="vs-text">VS</div>
|
||||
<div class="team-row">
|
||||
<TeamEmblem
|
||||
size="sm"
|
||||
@@ -323,9 +317,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
/>
|
||||
<span class="hover-team-name">{{ match.homeTeamName }}</span>
|
||||
</div>
|
||||
<div class="hover-vs-glow">
|
||||
<img :src="vsImg" alt="VS" class="hover-vs-img" />
|
||||
</div>
|
||||
<div class="hover-vs-glow">VS</div>
|
||||
<div class="hover-team away-slide">
|
||||
<TeamEmblem
|
||||
size="md"
|
||||
@@ -372,7 +364,6 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
</template>
|
||||
|
||||
<div v-else class="empty-state">
|
||||
<img :src="emptyMatchesImg" alt="" class="empty-state-art" />
|
||||
<p>{{ t('home.no_matches') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
@@ -414,9 +405,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
/>
|
||||
<span class="team-name">{{ match.homeTeamName }}</span>
|
||||
</div>
|
||||
<div class="vs-text">
|
||||
<img :src="vsImg" alt="VS" class="vs-mini-img" />
|
||||
</div>
|
||||
<div class="vs-text">VS</div>
|
||||
<div class="team-row">
|
||||
<TeamEmblem
|
||||
size="sm"
|
||||
@@ -440,9 +429,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
/>
|
||||
<span class="hover-team-name">{{ match.homeTeamName }}</span>
|
||||
</div>
|
||||
<div class="hover-vs-glow">
|
||||
<img :src="vsImg" alt="VS" class="hover-vs-img" />
|
||||
</div>
|
||||
<div class="hover-vs-glow">VS</div>
|
||||
<div class="hover-team away-slide">
|
||||
<TeamEmblem
|
||||
size="md"
|
||||
@@ -487,7 +474,6 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="!loading" class="empty-state">
|
||||
<img :src="emptyMatchesImg" alt="" class="empty-state-art" />
|
||||
<p>{{ t('home.upcoming_empty') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
@@ -519,9 +505,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
</div>
|
||||
<div class="sri-teams">
|
||||
<span>{{ m.homeTeamName }}</span>
|
||||
<span class="sri-vs">
|
||||
<img :src="vsImg" alt="VS" class="sri-vs-img" />
|
||||
</span>
|
||||
<span class="sri-vs">vs</span>
|
||||
<span>{{ m.awayTeamName }}</span>
|
||||
</div>
|
||||
|
||||
@@ -536,9 +520,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
<TeamEmblem size="md" :team-code="m.homeTeamCode" :team-name="m.homeTeamName" :logo-url="m.homeTeamLogoUrl" />
|
||||
<span>{{ m.homeTeamName }}</span>
|
||||
</div>
|
||||
<div class="sri-preview-vs-text">
|
||||
<img :src="vsImg" alt="VS" class="sri-preview-vs-img" />
|
||||
</div>
|
||||
<div class="sri-preview-vs-text">VS</div>
|
||||
<div class="sri-preview-team away-team">
|
||||
<TeamEmblem size="md" :team-code="m.awayTeamCode" :team-name="m.awayTeamName" :logo-url="m.awayTeamLogoUrl" />
|
||||
<span>{{ m.awayTeamName }}</span>
|
||||
@@ -570,7 +552,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
.desktop-home-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
gap: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -599,19 +581,17 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
.home-marquee-strip {
|
||||
position: relative;
|
||||
height: 34px;
|
||||
border-radius: var(--radius-md);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(90deg,
|
||||
rgba(212, 175, 55, 0.02),
|
||||
rgba(212, 175, 55, 0.14),
|
||||
rgba(212, 175, 55, 0.02));
|
||||
rgba(255, 255, 255, 0.02),
|
||||
rgba(255, 255, 255, 0.14),
|
||||
rgba(255, 255, 255, 0.02));
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
padding: 0;
|
||||
box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.08);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
align-items: stretch; /* let child fill full height */
|
||||
padding: 0; /* no padding — child spans edge to edge */
|
||||
box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
/* force the embedded button to fill the strip completely */
|
||||
@@ -629,7 +609,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
.main-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 320px;
|
||||
gap: var(--space-4);
|
||||
gap: 16px;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
@@ -637,25 +617,22 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-5);
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.content-section {
|
||||
background: rgba(32, 30, 24, 0.78);
|
||||
backdrop-filter: var(--blur-md);
|
||||
-webkit-backdrop-filter: var(--blur-md);
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--space-4) 18px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
border-radius: 12px;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
/* section-title 金线 */
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
margin-bottom: var(--space-4);
|
||||
gap: 12px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.st-line {
|
||||
@@ -663,13 +640,12 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
height: 18px;
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(180deg, var(--primary), var(--primary-light));
|
||||
box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
|
||||
box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.st-text {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-lg);
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
@@ -703,88 +679,43 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
.loading-state,
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-height: 160px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.empty-state-art {
|
||||
width: min(420px, 72%);
|
||||
aspect-ratio: 16 / 9;
|
||||
height: auto;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
opacity: 0.72;
|
||||
mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
|
||||
}
|
||||
|
||||
.empty-state p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Featured 焦点大卡 */
|
||||
.featured-match {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
padding: 18px 20px 20px;
|
||||
border-radius: var(--radius-lg);
|
||||
gap: 14px;
|
||||
padding: 18px 20px;
|
||||
border-radius: 12px;
|
||||
background:
|
||||
linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.12) 50%, rgba(10, 6, 0, 0.36)),
|
||||
url('../../assets/images/generated/pc-featured-match-bg-v1.webp') center / 100% 100% no-repeat;
|
||||
linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.04) 50%, rgba(0, 26, 51, 0.2)),
|
||||
url('../../assets/images/card-bg.webp') center/cover no-repeat;
|
||||
border: 1px solid var(--border-gold);
|
||||
box-shadow: var(--shadow-gold-lg), inset 0 0 20px rgba(212, 175, 55, 0.06);
|
||||
margin-bottom: var(--space-4);
|
||||
box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.04);
|
||||
margin-bottom: 14px;
|
||||
cursor: pointer;
|
||||
transition: box-shadow var(--duration-smooth) var(--ease-smooth),
|
||||
transform var(--duration-normal) var(--ease-out-expo);
|
||||
transition: box-shadow 0.25s, transform 0.15s;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.featured-match > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.featured-match::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0; right: 0;
|
||||
width: 180px; height: 180px;
|
||||
background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.2), transparent 60%);
|
||||
width: 140px; height: 140px;
|
||||
background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 65%);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
animation: goldGlowPulse 3.5s ease-in-out infinite;
|
||||
transform-origin: top right;
|
||||
}
|
||||
|
||||
.featured-match::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
background: url('../../assets/images/generated/pc-featured-match-bg-v1.webp') center / 100% 100% no-repeat;
|
||||
mask:
|
||||
linear-gradient(#000 0 0) top / 100% 22px no-repeat,
|
||||
linear-gradient(#000 0 0) bottom / 100% 22px no-repeat,
|
||||
linear-gradient(#000 0 0) left / 22px 100% no-repeat,
|
||||
linear-gradient(#000 0 0) right / 22px 100% no-repeat;
|
||||
-webkit-mask:
|
||||
linear-gradient(#000 0 0) top / 100% 22px no-repeat,
|
||||
linear-gradient(#000 0 0) bottom / 100% 22px no-repeat,
|
||||
linear-gradient(#000 0 0) left / 22px 100% no-repeat,
|
||||
linear-gradient(#000 0 0) right / 22px 100% no-repeat;
|
||||
}
|
||||
|
||||
.featured-match:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: var(--glow-gold-lg), inset 0 0 24px rgba(212, 175, 55, 0.08);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 24px rgba(255, 255, 255, 0.08), inset 0 0 20px rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.featured-top {
|
||||
@@ -846,35 +777,21 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.featured-vs {
|
||||
width: 72px;
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.featured-vs-img {
|
||||
width: 68px;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
filter:
|
||||
drop-shadow(0 0 4px rgba(255, 231, 150, 0.42))
|
||||
drop-shadow(0 0 8px rgba(212, 175, 55, 0.26));
|
||||
font-size: 22px;
|
||||
font-weight: 900;
|
||||
font-style: italic;
|
||||
color: var(--primary-light);
|
||||
text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.featured-markets {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
margin: 14px -12px 0;
|
||||
padding: 14px 12px 8px;
|
||||
background: rgba(10, 8, 4, 0.46);
|
||||
border-top: 1px solid rgba(246, 210, 108, 0.22);
|
||||
border-radius: 0 0 8px 8px;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 236, 174, 0.08);
|
||||
backdrop-filter: blur(4px);
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
margin: 14px -20px -18px;
|
||||
padding: 14px 20px 18px;
|
||||
background: rgba(0, 26, 51, 0.6);
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.featured-market-block {
|
||||
@@ -885,9 +802,8 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.featured-market-label {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 400;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
letter-spacing: 0.4px;
|
||||
@@ -904,38 +820,32 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
.match-card {
|
||||
display: flex;
|
||||
background: var(--bg-card);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-md);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
transition: border-color var(--duration-normal) var(--ease-smooth),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth),
|
||||
transform var(--duration-normal) var(--ease-out-expo);
|
||||
transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
|
||||
min-height: 76px;
|
||||
}
|
||||
|
||||
.match-card:is(:hover, .match-card--engaged) {
|
||||
border-color: var(--border-gold);
|
||||
box-shadow: var(--shadow-gold-lg), var(--glow-gold);
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--border-strong);
|
||||
box-shadow: var(--shadow-sm);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.match-info-side {
|
||||
flex: 1;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
padding: 8px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: var(--space-1);
|
||||
gap: 4px;
|
||||
border-right: 1px solid var(--border);
|
||||
min-width: 0;
|
||||
cursor: pointer;
|
||||
background: rgba(255, 255, 255, 0.01);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: background var(--duration-fast) var(--ease-smooth),
|
||||
box-shadow var(--duration-normal) var(--ease-smooth);
|
||||
}
|
||||
|
||||
.match-info-side > * {
|
||||
@@ -944,8 +854,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.match-card:is(:hover, .match-card--engaged) .match-info-side {
|
||||
background: rgba(212, 175, 55, 0.03);
|
||||
box-shadow: inset 3px 0 0 var(--primary);
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
}
|
||||
|
||||
.match-market-side {
|
||||
@@ -975,13 +884,12 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.league-tag {
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-xs);
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-light);
|
||||
background: var(--border-gold-soft);
|
||||
padding: 1px 6px;
|
||||
border-radius: var(--radius-sm);
|
||||
border-radius: 3px;
|
||||
max-width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -993,23 +901,20 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.live-indicator {
|
||||
font-family: var(--font-display);
|
||||
font-size: 9px;
|
||||
font-weight: 400;
|
||||
font-weight: 800;
|
||||
background: var(--danger);
|
||||
color: #fff;
|
||||
padding: 1px 3px;
|
||||
border-radius: var(--radius-sm);
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.match-time {
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--text-xs);
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.teams-versus-compact {
|
||||
@@ -1020,20 +925,15 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.vs-text {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
color: var(--text-muted);
|
||||
font-style: italic;
|
||||
padding-left: 36px;
|
||||
line-height: 1;
|
||||
margin: -2px 0;
|
||||
}
|
||||
|
||||
.vs-mini-img {
|
||||
width: 30px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
opacity: 0.78;
|
||||
filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.75));
|
||||
}
|
||||
|
||||
.team-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1042,7 +942,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.team-name {
|
||||
font-size: var(--text-sm);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
overflow: hidden;
|
||||
@@ -1060,16 +960,14 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
|
||||
.market-tab-btn {
|
||||
padding: 2px 6px;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-xs);
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
border-radius: var(--radius);
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: background var(--duration-fast) var(--ease-smooth),
|
||||
color var(--duration-fast) var(--ease-smooth);
|
||||
transition: all 0.15s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -1083,11 +981,6 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.market-tab-btn:focus-visible {
|
||||
outline: 2px solid var(--primary);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.market-odds-area {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@@ -1097,7 +990,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.no-market-odds {
|
||||
font-size: var(--text-xs);
|
||||
font-size: 10px;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
@@ -1107,21 +1000,18 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.home-sidebar :deep(.home-announce-card) {
|
||||
border-radius: var(--radius-lg);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.side-card {
|
||||
background: rgba(20, 20, 20, 0.88);
|
||||
backdrop-filter: var(--blur-md);
|
||||
-webkit-backdrop-filter: var(--blur-md);
|
||||
background: var(--gradient-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--space-3) 14px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
border-radius: 12px;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
.side-card-header {
|
||||
@@ -1133,9 +1023,8 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.side-card-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-base);
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
@@ -1153,18 +1042,14 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 8px 10px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: background var(--duration-fast) var(--ease-smooth),
|
||||
transform var(--duration-fast) var(--ease-out-expo),
|
||||
box-shadow var(--duration-fast) var(--ease-smooth);
|
||||
transition: background 0.15s;
|
||||
}
|
||||
|
||||
.side-recommend-item:hover {
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
transform: translateX(3px);
|
||||
box-shadow: inset 2px 0 0 var(--primary);
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.sri-top-row {
|
||||
@@ -1202,17 +1087,10 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.sri-vs {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.sri-vs-img {
|
||||
width: 22px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
opacity: 0.7;
|
||||
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
|
||||
color: var(--text-muted);
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.sri-time {
|
||||
@@ -1275,6 +1153,10 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
}
|
||||
|
||||
.featured-match::before {
|
||||
animation: goldGlowPulse 3.5s ease-in-out infinite;
|
||||
transform-origin: top right;
|
||||
}
|
||||
|
||||
/* --- 3. VS 心跳 --- */
|
||||
@keyframes vsHeartbeat {
|
||||
@@ -1338,7 +1220,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
transform: translateY(8px) scale(0.95);
|
||||
transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
|
||||
pointer-events: none;
|
||||
background: rgba(14, 14, 14, 0.96);
|
||||
background: var(--glass);
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
@@ -1394,26 +1276,19 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.hover-vs-glow {
|
||||
width: 58px;
|
||||
height: 38px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
font-weight: 900;
|
||||
font-style: italic;
|
||||
color: var(--primary-light);
|
||||
transform: scale(2.8);
|
||||
opacity: 0;
|
||||
text-shadow:
|
||||
0 0 10px rgba(255, 255, 255, 0.8),
|
||||
0 0 20px rgba(255, 255, 255, 0.4);
|
||||
transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s, opacity 0.3s ease 0.1s;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.hover-vs-img {
|
||||
width: 56px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
filter:
|
||||
drop-shadow(0 0 5px rgba(255, 231, 150, 0.52))
|
||||
drop-shadow(0 0 9px rgba(212, 175, 55, 0.34));
|
||||
}
|
||||
|
||||
.match-card:is(:hover, .match-card--engaged) .hover-vs-glow {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
@@ -1422,9 +1297,11 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
|
||||
@keyframes vs-clash-impact {
|
||||
0% {
|
||||
text-shadow: 0 0 25px rgba(255, 255, 255, 1);
|
||||
transform: scale(1.25);
|
||||
}
|
||||
100% {
|
||||
text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
@@ -1436,7 +1313,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
|
||||
.side-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 20px rgba(212, 175, 55, 0.12);
|
||||
box-shadow: 0 4px 20px rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
/* --- 8. 推荐列表 item 左侧金点指示 hover --- */
|
||||
@@ -1446,7 +1323,7 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.side-recommend-item:hover {
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
transform: translateX(3px);
|
||||
}
|
||||
|
||||
@@ -1469,21 +1346,18 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
right: calc(100% + 6px);
|
||||
transform: translateY(-50%) translateX(8px);
|
||||
width: 260px;
|
||||
background: rgba(12, 12, 12, 0.97);
|
||||
backdrop-filter: var(--blur-lg);
|
||||
-webkit-backdrop-filter: var(--blur-lg);
|
||||
background: var(--dropdown-bg);
|
||||
border: 1px solid var(--border-gold);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--space-3) 14px;
|
||||
box-shadow: var(--shadow-lg), var(--glow-gold-md);
|
||||
border-radius: 10px;
|
||||
padding: 12px 14px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.08);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity var(--duration-smooth) var(--ease-smooth),
|
||||
transform var(--duration-smooth) var(--ease-out-expo);
|
||||
z-index: var(--z-popover);
|
||||
transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.side-recommend-item:is(:hover, .side-recommend-item--engaged) .sri-preview-card {
|
||||
@@ -1561,26 +1435,17 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
}
|
||||
|
||||
.sri-preview-vs-text {
|
||||
width: 48px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
font-weight: 900;
|
||||
font-style: italic;
|
||||
color: var(--primary-light);
|
||||
text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
|
||||
flex-shrink: 0;
|
||||
opacity: 0;
|
||||
transform: scale(2.2);
|
||||
transition: opacity 0.3s ease 0.1s, transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s;
|
||||
}
|
||||
|
||||
.sri-preview-vs-img {
|
||||
width: 46px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
filter:
|
||||
drop-shadow(0 0 4px rgba(255, 231, 150, 0.42))
|
||||
drop-shadow(0 0 8px rgba(212, 175, 55, 0.26));
|
||||
}
|
||||
|
||||
.side-recommend-item:hover .sri-preview-vs-text {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
@@ -1598,19 +1463,21 @@ function getHoveredSideForMatch(match: PlayerHomeMatch | null, cardRootId: strin
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 5px 4px;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: url('../../assets/images/generated/odds-button-normal-v1.webp') center / 100% 100% no-repeat;
|
||||
border-radius: 6px;
|
||||
background: var(--bg-hover);
|
||||
border: 1px solid var(--border);
|
||||
cursor: pointer;
|
||||
transition: filter 0.15s;
|
||||
transition: background 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
.sri-preview-odd-btn:hover {
|
||||
filter: brightness(1.1);
|
||||
background: var(--border-gold-soft);
|
||||
border-color: var(--border-gold);
|
||||
}
|
||||
|
||||
.sri-preview-odd-btn.selected {
|
||||
background-image: url('../../assets/images/generated/odds-button-selected-v1.webp');
|
||||
background: var(--border-gold-soft);
|
||||
border-color: var(--primary-light);
|
||||
}
|
||||
|
||||
.sri-odd-label {
|
||||
|
||||
@@ -185,7 +185,7 @@ onActivated(refreshUnreadCount);
|
||||
|
||||
.hub-tab.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.hub-tab.active .dot { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
|
||||
@@ -194,7 +194,7 @@ onActivated(refreshUnreadCount);
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #333;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
flex-shrink: 0;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
@@ -260,5 +260,6 @@ onActivated(refreshUnreadCount);
|
||||
.hub-panel {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 24px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -16,7 +16,6 @@ import { formatLocalMatchDateTime, defaultMarketName, DETAIL_MARKET_TYPES } from
|
||||
import { resolveSelectionLabel } from '../../utils/selectionLabel';
|
||||
import { useDesktopBetPopover } from '../../composables/useDesktopBetPopover';
|
||||
import { useDesktopBetLocate, scrollToBetSelection } from '../../composables/useDesktopBetLocate';
|
||||
import vsImg from '../../assets/images/generated/vs-gold-alpha-v1.webp';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -361,9 +360,7 @@ function getHoveredSide() {
|
||||
<span class="divider">-</span>
|
||||
<span class="score">{{ match.score?.ftAway }}</span>
|
||||
</div>
|
||||
<div class="versus-row vs" v-else>
|
||||
<img :src="vsImg" alt="VS" class="score-vs-img" />
|
||||
</div>
|
||||
<div class="versus-row vs" v-else>VS</div>
|
||||
<span class="kickoff-time">{{ kickoff }}</span>
|
||||
</div>
|
||||
|
||||
@@ -493,7 +490,7 @@ function getHoveredSide() {
|
||||
padding: 10px 16px;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
background: #0c0c0c;
|
||||
background: var(--desktop-sidebar-panel-bg);
|
||||
border-bottom: 1px solid var(--border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -540,15 +537,13 @@ function getHoveredSide() {
|
||||
}
|
||||
|
||||
.match-score-band {
|
||||
aspect-ratio: 1600 / 320;
|
||||
background-image: url('../../assets/images/generated/pc-featured-match-bg-v1.webp');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
border: 0;
|
||||
box-shadow: var(--shadow-gold);
|
||||
border-radius: 4px;
|
||||
padding: 12px 24px;
|
||||
background:
|
||||
linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.04) 50%, rgba(15, 10, 0, 0.1)),
|
||||
url('../../assets/images/card-bg.webp') center/cover no-repeat;
|
||||
border: 1px solid var(--border-gold);
|
||||
box-shadow: var(--shadow-gold), inset 0 0 20px rgba(255, 255, 255, 0.06);
|
||||
border-radius: 12px;
|
||||
padding: 18px 24px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -591,7 +586,7 @@ function getHoveredSide() {
|
||||
font-size: 32px;
|
||||
font-weight: 900;
|
||||
color: var(--primary-light);
|
||||
text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
|
||||
text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.versus-row .divider {
|
||||
@@ -600,17 +595,9 @@ function getHoveredSide() {
|
||||
}
|
||||
|
||||
.versus-row.vs {
|
||||
min-height: 42px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.score-vs-img {
|
||||
width: 72px;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
filter:
|
||||
drop-shadow(0 0 4px rgba(255, 231, 150, 0.42))
|
||||
drop-shadow(0 0 8px rgba(212, 175, 55, 0.26));
|
||||
font-size: 22px;
|
||||
font-weight: 800;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.kickoff-time {
|
||||
@@ -619,7 +606,7 @@ function getHoveredSide() {
|
||||
}
|
||||
|
||||
.result-stats-card {
|
||||
background: rgba(20, 20, 20, 0.8);
|
||||
background: rgba(12, 40, 66, 0.8);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 16px;
|
||||
@@ -640,7 +627,7 @@ function getHoveredSide() {
|
||||
}
|
||||
|
||||
.stat-pill {
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
padding: 6px 12px;
|
||||
@@ -659,7 +646,7 @@ function getHoveredSide() {
|
||||
padding: 6px 8px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: rgba(18, 18, 18, 0.85);
|
||||
background: rgba(10, 42, 68, 0.85);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@@ -709,9 +696,9 @@ function getHoveredSide() {
|
||||
|
||||
.market-filter-chip.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: var(--border-gold-soft);
|
||||
box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.08);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.markets-score-section {
|
||||
@@ -751,7 +738,7 @@ function getHoveredSide() {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background: rgba(18, 18, 18, 0.98);
|
||||
background: rgba(10, 42, 68, 0.98);
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
@@ -765,7 +752,7 @@ function getHoveredSide() {
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 6px 10px;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
@@ -792,7 +779,7 @@ function getHoveredSide() {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background: rgba(18, 18, 18, 0.98);
|
||||
background: rgba(10, 42, 68, 0.98);
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
@@ -806,7 +793,7 @@ function getHoveredSide() {
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 6px 10px;
|
||||
background: #141414;
|
||||
background: #0A2540;
|
||||
border-bottom: 1px solid var(--border);
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
|
||||
@@ -128,7 +128,7 @@ onActivated(refreshUnreadCount);
|
||||
|
||||
.hub-tab.active {
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.hub-tab.active .dot {
|
||||
@@ -140,7 +140,7 @@ onActivated(refreshUnreadCount);
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #333;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onActivated } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import api from '../../api';
|
||||
import GoldSpinner from '../../components/GoldSpinner.vue';
|
||||
import Pagination from '../../components/desktop/Pagination.vue';
|
||||
import DesktopBetDetailModal from '../../components/desktop/DesktopBetDetailModal.vue';
|
||||
import { type BetHistoryItem } from '../../components/BetHistoryCard.vue';
|
||||
import { useOnLocaleChange } from '../../composables/useOnLocaleChange';
|
||||
|
||||
const COL_COUNT = 8;
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const detailModalVisible = ref(false);
|
||||
const detailBetNo = ref<string | null>(null);
|
||||
|
||||
function openDetail(betNo: string) {
|
||||
detailBetNo.value = betNo;
|
||||
detailModalVisible.value = true;
|
||||
}
|
||||
const router = useRouter();
|
||||
|
||||
const items = ref<BetHistoryItem[]>([]);
|
||||
const total = ref(0);
|
||||
@@ -161,7 +154,7 @@ function statusLabel(status: string) {
|
||||
v-for="bet in items"
|
||||
:key="bet.betNo"
|
||||
class="hover-row clickable-row"
|
||||
@click="openDetail(bet.betNo)"
|
||||
@click="router.push(`/bets/${bet.betNo}`)"
|
||||
>
|
||||
<td class="id-cell">{{ bet.betNo }}</td>
|
||||
<td>{{ bet.matchTitle || '-' }}</td>
|
||||
@@ -194,16 +187,12 @@ function statusLabel(status: string) {
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<DesktopBetDetailModal v-model:visible="detailModalVisible" :bet-no="detailBetNo" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.muted-cell {
|
||||
color: var(--text-muted);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-sm);
|
||||
max-width: 280px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,11 +8,11 @@ import OutrightOptionCard from '../../components/outright/OutrightOptionCard.vue
|
||||
import OutrightBetModal, { type OutrightPick } from '../../components/outright/OutrightBetModal.vue';
|
||||
import { useAuthStore } from '../../stores/auth';
|
||||
import GoldSpinner from '../../components/GoldSpinner.vue';
|
||||
import saishiImg from '../../assets/images/generated/saishi-gold-trophy-v1.webp';
|
||||
import outrightDetailBg from '../../assets/images/generated/pc-outright-detail-bg-v1.webp';
|
||||
import saishiImg from '../../assets/images/saishi.webp';
|
||||
import cardBg from '../../assets/images/card-bg.webp';
|
||||
import { useDesktopBetLocate, scrollToBetSelection } from '../../composables/useDesktopBetLocate';
|
||||
|
||||
const matchCardBg = `url(${outrightDetailBg})`;
|
||||
const matchCardBg = `url(${cardBg})`;
|
||||
const ODDS_POLL_MS = 15000;
|
||||
|
||||
const route = useRoute();
|
||||
@@ -237,7 +237,7 @@ onUnmounted(stopPolling);
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
background: rgba(18, 18, 18, 0.98);
|
||||
background: rgba(10, 42, 68, 0.98);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ onUnmounted(stopPolling);
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: v-bind(matchCardBg) center / cover no-repeat;
|
||||
opacity: 0.36;
|
||||
opacity: 0.22;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ const auth = useAuthStore();
|
||||
const { loadProfile, setAvatarKey, profileRaw, avatarUrl } = usePlayerProfile();
|
||||
|
||||
const username = ref('');
|
||||
const viewablePassword = ref('');
|
||||
const passwordVisible = ref(false);
|
||||
const phone = ref('');
|
||||
const email = ref('');
|
||||
const avatarModalOpen = ref(false);
|
||||
@@ -33,6 +35,11 @@ const allowUsernameChange = computed(
|
||||
() => profileRaw.value?.preferences?.allowUsernameChange ?? false,
|
||||
);
|
||||
|
||||
const canTogglePassword = computed(() => !!viewablePassword.value);
|
||||
const passwordInputType = computed(() =>
|
||||
passwordVisible.value && canTogglePassword.value ? 'text' : 'password',
|
||||
);
|
||||
|
||||
const displayAvatarUrl = computed(() => {
|
||||
if (avatarUrl.value) return avatarUrl.value;
|
||||
const seed = profileRaw.value?.username ?? auth.user?.username;
|
||||
@@ -42,6 +49,7 @@ const displayAvatarUrl = computed(() => {
|
||||
function syncFromProfile() {
|
||||
const user = profileRaw.value;
|
||||
username.value = user?.username ?? auth.user?.username ?? '';
|
||||
viewablePassword.value = user?.preferences?.viewablePassword ?? '';
|
||||
phone.value = user?.preferences?.phone ?? '';
|
||||
email.value = user?.preferences?.email ?? '';
|
||||
}
|
||||
@@ -90,13 +98,19 @@ async function savePassword() {
|
||||
saving.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function onAvatarSelect(key: string | null) {
|
||||
avatarModalOpen.value = false;
|
||||
await setAvatarKey(key);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="desktop-records-page edit-page">
|
||||
<header class="desktop-records-header">
|
||||
<div class="desktop-records-header-main header-row">
|
||||
<button type="button" class="back-btn" @click="router.push('/profile')">
|
||||
<div class="desktop-account-page">
|
||||
<main class="account-main">
|
||||
<div class="edit-layout">
|
||||
<div class="page-header">
|
||||
<button type="button" class="back-btn" @click="router.back()">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<line x1="19" y1="12" x2="5" y2="12"></line>
|
||||
<polyline points="12 19 5 12 12 5"></polyline>
|
||||
@@ -105,11 +119,9 @@ async function savePassword() {
|
||||
</button>
|
||||
<h1 class="page-title">{{ t('profile.edit_title') }}</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="edit-grid">
|
||||
<!-- Left: avatar + basic -->
|
||||
<section class="edit-card">
|
||||
<!-- Avatar section -->
|
||||
<div class="edit-card">
|
||||
<div class="card-title">{{ t('profile.avatar') || '头像' }}</div>
|
||||
<div class="avatar-row">
|
||||
<img
|
||||
@@ -121,22 +133,20 @@ async function savePassword() {
|
||||
<div v-else class="avatar-placeholder">
|
||||
<svg width="36" height="36" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 3.6-7 8-7s8 3 8 7"/></svg>
|
||||
</div>
|
||||
<div class="avatar-meta">
|
||||
<button type="button" class="change-avatar-btn" @click="avatarModalOpen = true">
|
||||
{{ t('profile.change_avatar') || '更换头像' }}
|
||||
</button>
|
||||
<p class="field-hint">{{ t('profile.avatar_hint') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="edit-card edit-card--span">
|
||||
<!-- Basic info -->
|
||||
<div class="edit-card">
|
||||
<div class="card-title">{{ t('profile.basic_info') || '基础信息' }}</div>
|
||||
|
||||
<div v-if="message" class="success-msg">{{ message }}</div>
|
||||
<div v-if="error" class="error-msg">{{ error }}</div>
|
||||
|
||||
<div class="field-grid">
|
||||
<div class="field-group">
|
||||
<div class="field">
|
||||
<label class="field-label">{{ t('profile.username') || '用户名' }}</label>
|
||||
<input
|
||||
@@ -154,21 +164,19 @@ async function savePassword() {
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="field-label">{{ t('profile.email') || '邮箱' }}</label>
|
||||
<label class="field-label">Email</label>
|
||||
<input v-model="email" type="email" class="field-input" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-actions">
|
||||
<button type="button" class="save-btn" :disabled="saving" @click="saveProfile">
|
||||
<GoldSpinner v-if="saving" :size="18" />
|
||||
<span v-else>{{ t('common.save') || '保存' }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Password -->
|
||||
<section v-if="allowPasswordChange" class="edit-card edit-card--span">
|
||||
<!-- Password change -->
|
||||
<div v-if="allowPasswordChange" class="edit-card">
|
||||
<div class="card-title">
|
||||
{{ t('profile.change_password') || '修改密码' }}
|
||||
<button
|
||||
@@ -180,7 +188,7 @@ async function savePassword() {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-show="passwordChangeOpen" class="field-grid">
|
||||
<div v-show="passwordChangeOpen" class="field-group">
|
||||
<div class="field">
|
||||
<label class="field-label">{{ t('profile.old_password') || '当前密码' }}</label>
|
||||
<input v-model="oldPassword" type="password" class="field-input" autocomplete="current-password" />
|
||||
@@ -193,14 +201,12 @@ async function savePassword() {
|
||||
<label class="field-label">{{ t('profile.confirm_password') || '确认密码' }}</label>
|
||||
<input v-model="confirmPassword" type="password" class="field-input" autocomplete="new-password" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="passwordChangeOpen" class="card-actions">
|
||||
<button type="button" class="save-btn" :disabled="saving" @click="savePassword">
|
||||
<GoldSpinner v-if="saving" :size="18" />
|
||||
<span v-else>{{ t('profile.change_password') || '修改密码' }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlayerAvatarModal
|
||||
@@ -209,30 +215,19 @@ async function savePassword() {
|
||||
@close="avatarModalOpen = false"
|
||||
@confirm="(key) => { avatarModalOpen = false; if (key !== undefined) setAvatarKey(key); }"
|
||||
/>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.edit-page {
|
||||
overflow-y: auto;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
max-width: 980px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
.desktop-account-page { display: flex; flex-direction: column; min-height: 0; flex: 1; width: 100%; }
|
||||
|
||||
.header-row {
|
||||
.account-main { flex: 1; min-width: 0; padding: 24px 28px; overflow-y: auto; }
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
@@ -256,41 +251,32 @@ async function savePassword() {
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.back-btn:hover svg {
|
||||
transform: translateX(-2px);
|
||||
}
|
||||
|
||||
.back-btn svg {
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.edit-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
|
||||
gap: 18px;
|
||||
align-items: start;
|
||||
.back-btn:hover svg {
|
||||
transform: translateX(-2px);
|
||||
}
|
||||
|
||||
.page-title { font-size: 18px; font-weight: 800; color: var(--primary-light); margin: 0; }
|
||||
|
||||
.edit-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.edit-card {
|
||||
background: var(--bg-card);
|
||||
backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.edit-card--span {
|
||||
grid-column: auto;
|
||||
}
|
||||
|
||||
.edit-grid > .edit-card:nth-of-type(2) {
|
||||
grid-column: 2;
|
||||
grid-row: 1 / span 2;
|
||||
}
|
||||
|
||||
.edit-grid > .edit-card:nth-of-type(3) {
|
||||
grid-column: 1;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
@@ -307,43 +293,31 @@ async function savePassword() {
|
||||
|
||||
.avatar-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.avatar-meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.avatar-img {
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
border: 2px solid var(--border-gold-soft);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.avatar-placeholder {
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 50%;
|
||||
background: #1a1a1a;
|
||||
background: #0A2540;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-muted);
|
||||
border: 2px solid var(--desktop-border);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.change-avatar-btn {
|
||||
align-self: stretch;
|
||||
justify-content: center;
|
||||
padding: 7px 16px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--desktop-border);
|
||||
@@ -355,32 +329,11 @@ async function savePassword() {
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.change-avatar-btn:hover {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--primary-light);
|
||||
}
|
||||
.change-avatar-btn:hover { border-color: var(--border-gold-soft); color: var(--primary-light); }
|
||||
|
||||
.field-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 16px 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.field-group { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
|
||||
|
||||
.edit-grid > .edit-card:nth-of-type(2) .field:first-child {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.edit-grid > .edit-card:nth-of-type(3) .field-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
.field { display: flex; flex-direction: column; gap: 6px; }
|
||||
|
||||
.field-label {
|
||||
font-size: 11px;
|
||||
@@ -394,7 +347,7 @@ async function savePassword() {
|
||||
padding: 10px 14px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--desktop-border);
|
||||
background: #111;
|
||||
background: #001A33;
|
||||
color: var(--text);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
@@ -402,45 +355,13 @@ async function savePassword() {
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.field-input:focus {
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
.field-input:focus { border-color: var(--border-gold-soft); }
|
||||
.field-input:disabled { opacity: 0.45; cursor: not-allowed; }
|
||||
|
||||
.field-input:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.field-hint { font-size: 11px; color: var(--text-muted); margin: 0; }
|
||||
|
||||
.field-hint {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.success-msg {
|
||||
padding: 10px 14px;
|
||||
border-radius: 6px;
|
||||
background: rgba(52, 199, 89, 0.1);
|
||||
color: #4cd964;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
padding: 10px 14px;
|
||||
border-radius: 6px;
|
||||
background: rgba(255, 69, 58, 0.1);
|
||||
color: #ff453a;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.success-msg { padding: 10px 14px; border-radius: 6px; background: rgba(52,199,89,0.1); color: #4cd964; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
|
||||
.error-msg { padding: 10px 14px; border-radius: 6px; background: rgba(255,69,58,0.1); color: #ff453a; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
|
||||
|
||||
.save-btn {
|
||||
display: inline-flex;
|
||||
@@ -450,7 +371,7 @@ async function savePassword() {
|
||||
padding: 9px 24px;
|
||||
border-radius: 6px;
|
||||
background: var(--primary);
|
||||
color: #111;
|
||||
color: #001A33;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
border: none;
|
||||
@@ -458,14 +379,8 @@ async function savePassword() {
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.save-btn:hover:not(:disabled) {
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
.save-btn:disabled {
|
||||
opacity: 0.45;
|
||||
cursor: default;
|
||||
}
|
||||
.save-btn:hover:not(:disabled) { opacity: 0.88; }
|
||||
.save-btn:disabled { opacity: 0.45; cursor: default; }
|
||||
|
||||
.toggle-btn {
|
||||
background: none;
|
||||
@@ -477,26 +392,4 @@ async function savePassword() {
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.edit-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.edit-grid > .edit-card:nth-of-type(2),
|
||||
.edit-grid > .edit-card:nth-of-type(3) {
|
||||
grid-column: auto;
|
||||
grid-row: auto;
|
||||
}
|
||||
|
||||
.field-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.field-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onActivated, computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter, RouterLink } from 'vue-router';
|
||||
import { useRouter } from 'vue-router';
|
||||
import api from '../../api';
|
||||
import GoldSpinner from '../../components/GoldSpinner.vue';
|
||||
import LocaleFlag from '../../components/LocaleFlag.vue';
|
||||
import { useAuthStore } from '../../stores/auth';
|
||||
import { useAppLocale } from '../../composables/useAppLocale';
|
||||
import { usePlayerProfile } from '../../composables/usePlayerProfile';
|
||||
import { useInboxFeature } from '../../composables/useInboxFeature';
|
||||
import { formatMoney } from '../../utils/localeDisplay';
|
||||
import { parseCashbackApiData, sumCashbackAmount } from '../../utils/cashback';
|
||||
import walletBg from '../../assets/images/generated/pc-wallet-banner-v1.webp';
|
||||
import walletBg from '../../assets/images/wallet-bg.webp';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const router = useRouter();
|
||||
const auth = useAuthStore();
|
||||
const { locales, setLocale, initFromUser } = useAppLocale();
|
||||
const { profileRaw, refreshProfile } = usePlayerProfile();
|
||||
const { hubRoute } = useInboxFeature();
|
||||
|
||||
const loading = ref(true);
|
||||
const error = ref(false);
|
||||
@@ -67,40 +69,15 @@ const balanceDisplay = computed(() =>
|
||||
formatMoney(profileRaw.value?.wallet?.availableBalance, locale.value),
|
||||
);
|
||||
|
||||
const balanceAmountClass = computed(() => {
|
||||
const len = balanceDisplay.value.length;
|
||||
if (len <= 10) return 'balance-amount--xl';
|
||||
if (len <= 13) return 'balance-amount--lg';
|
||||
if (len <= 16) return 'balance-amount--md';
|
||||
if (len <= 19) return 'balance-amount--sm';
|
||||
return 'balance-amount--xs';
|
||||
});
|
||||
|
||||
const quickLinks = computed(() => [
|
||||
{ to: '/bets', label: t('nav.bet_history'), desc: t('profile.qnav_bets_desc') },
|
||||
{ to: '/wallet', label: t('nav.wallet'), desc: t('profile.qnav_wallet_desc') },
|
||||
{ to: '/wallet/recharge', label: t('recharge.title'), desc: t('profile.qnav_recharge_desc') },
|
||||
{ to: '/wallet/cashbacks', label: t('wallet.cashbacks_tab'), desc: t('profile.qnav_cashback_desc') },
|
||||
{ to: '/announcements', label: t('nav.announcements'), desc: t('profile.qnav_announcements_desc') },
|
||||
{ to: '/profile/edit', label: t('profile.edit'), desc: t('profile.qnav_edit_desc') },
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="desktop-records-page profile-page">
|
||||
<header class="desktop-records-header">
|
||||
<div class="desktop-records-header-main">
|
||||
<div class="desktop-account-page">
|
||||
<main class="account-main">
|
||||
<div class="profile-layout">
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ t('nav.profile') }}</h1>
|
||||
</div>
|
||||
<div class="desktop-records-actions">
|
||||
<RouterLink to="/profile/edit" class="desktop-records-action-btn">
|
||||
{{ t('profile.edit') }}
|
||||
</RouterLink>
|
||||
<button type="button" class="logout-btn" @click="logout">
|
||||
{{ t('auth.logout') }}
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div v-if="loading" class="loading-state">
|
||||
<GoldSpinner :size="36" />
|
||||
@@ -112,7 +89,7 @@ const quickLinks = computed(() => [
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<!-- Wallet card -->
|
||||
<!-- Wallet Banner -->
|
||||
<div class="wallet-banner">
|
||||
<img class="wallet-banner-img" :src="walletBg" alt="" />
|
||||
<div class="wallet-banner-scrim" aria-hidden="true" />
|
||||
@@ -126,61 +103,53 @@ const quickLinks = computed(() => [
|
||||
<span class="bank-card-type">MEMBER</span>
|
||||
</div>
|
||||
</div>
|
||||
<RouterLink to="/wallet/recharge" class="recharge-btn">
|
||||
<router-link to="/wallet/recharge" class="recharge-btn">
|
||||
<span class="recharge-icon">+</span>
|
||||
<span>{{ t('recharge.title') }}</span>
|
||||
</RouterLink>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
<div class="bank-card-balance">
|
||||
<span class="bank-card-label">{{ t('wallet.available') }}</span>
|
||||
<p class="bank-card-number balance-amount" :class="balanceAmountClass">{{ balanceDisplay }}</p>
|
||||
<span class="bank-card-label">{{ t('wallet.available') || '可用余额' }}</span>
|
||||
<p class="bank-card-number">{{ balanceDisplay }}</p>
|
||||
</div>
|
||||
|
||||
<div class="bank-card-footer">
|
||||
<div class="bank-card-field">
|
||||
<span class="bank-card-label">{{ t('profile.username') }}</span>
|
||||
<span class="bank-card-label">{{ t('profile.username') || '持卡人' }}</span>
|
||||
<span class="bank-card-holder">{{ profileRaw?.username }}</span>
|
||||
</div>
|
||||
<div class="bank-card-field bank-card-field--center">
|
||||
<span class="bank-card-label">{{ t('wallet.cashback_total') }}</span>
|
||||
<span class="bank-card-label">{{ t('wallet.cashback_total') || '累计返水' }}</span>
|
||||
<span class="bank-card-stat">{{ formatMoney(cashbackTotal, locale) }}</span>
|
||||
</div>
|
||||
<div class="bank-card-field bank-card-field--right">
|
||||
<span class="bank-card-label">{{ t('wallet.frozen') }}</span>
|
||||
<span class="bank-card-label">{{ t('wallet.frozen') || '冻结' }}</span>
|
||||
<span class="bank-card-stat">{{ formatMoney(profileRaw?.wallet?.frozenBalance, locale) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Two-column: account + language -->
|
||||
<div class="profile-grid">
|
||||
<section class="panel">
|
||||
<div class="panel-header">
|
||||
<h2 class="panel-title">{{ t('profile.account') }}</h2>
|
||||
<RouterLink to="/profile/edit" class="panel-link">{{ t('profile.edit') }}</RouterLink>
|
||||
<!-- Account info -->
|
||||
<div class="info-card">
|
||||
<div class="info-header">{{ t('profile.account') || '账户信息' }}</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">{{ t('profile.username') || '用户名' }}</span>
|
||||
<span class="info-val">{{ profileRaw?.username }}</span>
|
||||
</div>
|
||||
<dl class="info-grid">
|
||||
<div class="info-item">
|
||||
<dt>{{ t('profile.username') }}</dt>
|
||||
<dd>{{ profileRaw?.username }}</dd>
|
||||
<div class="info-row">
|
||||
<span class="info-label">{{ t('profile.phone') || '手机号' }}</span>
|
||||
<span class="info-val">{{ profileRaw?.preferences?.phone || '-' }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<dt>{{ t('profile.phone') }}</dt>
|
||||
<dd>{{ profileRaw?.preferences?.phone || '—' }}</dd>
|
||||
<div class="info-actions">
|
||||
<router-link to="/profile/edit" class="edit-btn">{{ t('profile.edit') }}</router-link>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<dt>{{ t('profile.email') }}</dt>
|
||||
<dd>{{ profileRaw?.preferences?.email || '—' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-header">
|
||||
<h2 class="panel-title">{{ t('profile.language') }}</h2>
|
||||
</div>
|
||||
<!-- Language -->
|
||||
<div class="lang-card">
|
||||
<div class="info-header">{{ t('profile.language') }}</div>
|
||||
<div class="lang-group">
|
||||
<button
|
||||
v-for="item in locales"
|
||||
@@ -190,108 +159,47 @@ const quickLinks = computed(() => [
|
||||
:class="{ active: locale === item.code }"
|
||||
@click="setLocale(item.code)"
|
||||
>
|
||||
<LocaleFlag :locale="item.code" :size="16" />
|
||||
<LocaleFlag :locale="item.code" :size="14" />
|
||||
<span>{{ item.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Quick links: desktop density -->
|
||||
<section class="panel quick-panel">
|
||||
<div class="panel-header">
|
||||
<h2 class="panel-title">{{ t('profile.quick_nav') }}</h2>
|
||||
</div>
|
||||
<div class="quick-grid">
|
||||
<RouterLink
|
||||
v-for="link in quickLinks"
|
||||
:key="link.to"
|
||||
:to="link.to"
|
||||
class="quick-card"
|
||||
>
|
||||
<span class="quick-label">{{ link.label }}</span>
|
||||
<span class="quick-desc">{{ link.desc }}</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Logout -->
|
||||
<button type="button" class="logout-btn" @click="logout">
|
||||
{{ t('auth.logout') }}
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.profile-page {
|
||||
overflow-y: auto;
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.desktop-account-page { display: flex; flex-direction: column; min-height: 0; flex: 1; width: 100%; }
|
||||
|
||||
.profile-page::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.account-main { flex: 1; min-width: 0; padding: 24px 28px; overflow-y: auto; }
|
||||
.page-header { margin-bottom: 24px; }
|
||||
.page-title { font-size: 18px; font-weight: 800; color: var(--primary-light); margin: 0; }
|
||||
.loading-state { display: flex; justify-content: center; align-items: center; padding: 80px 0; }
|
||||
.error-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 20px; color: var(--text-muted); }
|
||||
.retry-btn { padding: 8px 24px; border-radius: 6px; border: 1px solid var(--primary); background: transparent; color: var(--primary-light); font-size: 13px; font-weight: 700; cursor: pointer; }
|
||||
|
||||
.page-title {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 18px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(255, 69, 58, 0.35);
|
||||
background: transparent;
|
||||
color: var(--danger);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.logout-btn:hover {
|
||||
background: rgba(255, 69, 58, 0.08);
|
||||
}
|
||||
|
||||
.loading-state,
|
||||
.error-state {
|
||||
.profile-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
padding: 80px 20px;
|
||||
color: var(--text-muted);
|
||||
flex: 1;
|
||||
gap: 16px;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.retry-btn {
|
||||
padding: 8px 24px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--primary);
|
||||
background: transparent;
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* —— Wallet card —— */
|
||||
.wallet-banner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
aspect-ratio: 21 / 9;
|
||||
max-height: 220px;
|
||||
border-radius: 14px;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
box-shadow:
|
||||
0 4px 16px rgba(0, 0, 0, 0.4),
|
||||
0 1px 3px rgba(0, 0, 0, 0.2);
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.wallet-banner::after {
|
||||
@@ -311,9 +219,8 @@ const quickLinks = computed(() => [
|
||||
height: 100%;
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
object-position: center center;
|
||||
transform: scale(1.01);
|
||||
filter: brightness(0.94);
|
||||
transform: scale(1.05);
|
||||
filter: brightness(0.86);
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
@@ -323,12 +230,7 @@ const quickLinks = computed(() => [
|
||||
inset: 0;
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(0, 0, 0, 0.4) 0%,
|
||||
rgba(0, 0, 0, 0.18) 42%,
|
||||
rgba(0, 0, 0, 0.46) 100%
|
||||
);
|
||||
background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.18) 42%, rgba(0,0,0,0.46) 100%);
|
||||
}
|
||||
|
||||
.card-overlay {
|
||||
@@ -337,37 +239,30 @@ const quickLinks = computed(() => [
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px 28px 18px;
|
||||
line-height: 1.3;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.bank-card-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bank-card-top-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.brand-logo {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
flex-shrink: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.bank-card-brand-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.brand-name {
|
||||
@@ -375,95 +270,63 @@ const quickLinks = computed(() => [
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
letter-spacing: 0.14em;
|
||||
line-height: 1;
|
||||
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.bank-card-type {
|
||||
font-size: 10px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.14em;
|
||||
color: rgba(212, 175, 55, 0.8);
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
font-style: italic;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.bank-card-label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(255, 255, 255, 0.82);
|
||||
line-height: 1.3;
|
||||
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
.recharge-btn {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 8px 16px;
|
||||
border-radius: 14px;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
border: 1px solid rgba(212, 175, 55, 0.35);
|
||||
background: rgba(0, 26, 51, 0.45);
|
||||
border: 1px solid rgba(255, 255, 255, 0.35);
|
||||
color: var(--primary-light);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
backdrop-filter: blur(6px);
|
||||
transition: background 0.15s ease;
|
||||
}
|
||||
|
||||
.recharge-btn:hover {
|
||||
background: rgba(212, 175, 55, 0.15);
|
||||
}
|
||||
|
||||
.recharge-icon {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
}
|
||||
.recharge-btn:hover { background: rgba(255, 255, 255, 0.15); }
|
||||
|
||||
.bank-card-balance {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-height: 0;
|
||||
padding: 4px 0;
|
||||
gap: 6px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.bank-card-label {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
color: rgba(255, 255, 255, 0.82);
|
||||
}
|
||||
|
||||
.bank-card-number {
|
||||
margin: 0;
|
||||
font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
|
||||
font-family: 'SF Mono', 'Consolas', monospace;
|
||||
font-weight: 700;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: var(--primary-light);
|
||||
line-height: 1.1;
|
||||
letter-spacing: 0.04em;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 38px;
|
||||
text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
.balance-amount--xl { font-size: 42px; }
|
||||
.balance-amount--lg { font-size: 36px; }
|
||||
.balance-amount--md { font-size: 30px; }
|
||||
.balance-amount--sm { font-size: 24px; }
|
||||
.balance-amount--xs { font-size: 20px; }
|
||||
|
||||
.bank-card-footer {
|
||||
flex-shrink: 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 12px;
|
||||
padding-top: 14px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
@@ -471,7 +334,6 @@ const quickLinks = computed(() => [
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.bank-card-field--center { text-align: center; }
|
||||
@@ -482,110 +344,67 @@ const quickLinks = computed(() => [
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
line-height: 1.2;
|
||||
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bank-card-stat {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
line-height: 1.2;
|
||||
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
/* —— Panels —— */
|
||||
.profile-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1.2fr 1fr;
|
||||
gap: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.panel {
|
||||
.info-card, .lang-card {
|
||||
background: var(--bg-card);
|
||||
backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 10px;
|
||||
padding: 18px 20px;
|
||||
flex-shrink: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 14px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid var(--desktop-border);
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
margin: 0;
|
||||
.info-header {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
margin-bottom: 14px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid var(--desktop-border);
|
||||
}
|
||||
|
||||
.panel-link {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
.info-row {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.04);
|
||||
}
|
||||
|
||||
.info-label { width: 80px; flex-shrink: 0; font-size: 12px; color: var(--text-muted); font-weight: 600; }
|
||||
.info-val { flex: 1; font-size: 14px; font-weight: 700; color: var(--text); }
|
||||
.info-actions { padding-top: 14px; }
|
||||
|
||||
.edit-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 7px 18px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border-gold-soft);
|
||||
color: var(--primary-light);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.panel-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16px 20px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.info-item dt {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.info-item dd {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.lang-group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.edit-btn:hover { background: rgba(255, 255, 255,0.08); }
|
||||
|
||||
.lang-group { display: flex; gap: 8px; flex-wrap: wrap; }
|
||||
|
||||
.lang-opt {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 16px;
|
||||
gap: 6px;
|
||||
padding: 7px 14px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--desktop-border);
|
||||
background: transparent;
|
||||
@@ -596,72 +415,25 @@ const quickLinks = computed(() => [
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.lang-opt:hover {
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.lang-opt.active {
|
||||
border-color: var(--border-gold-soft);
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
background: rgba(255, 255, 255,0.08);
|
||||
}
|
||||
|
||||
.quick-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.quick-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 14px 16px;
|
||||
.logout-btn {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--desktop-border);
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
text-decoration: none;
|
||||
transition: background 0.15s, border-color 0.15s;
|
||||
}
|
||||
|
||||
.quick-card:hover {
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.quick-label {
|
||||
background: transparent;
|
||||
color: var(--danger);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.quick-desc {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.wallet-banner {
|
||||
aspect-ratio: 2 / 1;
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
.balance-amount--xl { font-size: 32px; }
|
||||
.balance-amount--lg { font-size: 28px; }
|
||||
.balance-amount--md { font-size: 24px; }
|
||||
|
||||
.profile-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.quick-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
.logout-btn:hover { background: rgba(255,69,58,0.06); }
|
||||
</style>
|
||||
|
||||
@@ -292,21 +292,12 @@ function auditNoteDisplayText(remark: { kind: 'note'; text: string }) {
|
||||
.detail-layout { display: flex; flex-direction: column; gap: 16px; max-width: 680px; }
|
||||
|
||||
.detail-card {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(rgba(22, 20, 15, 0.76), rgba(18, 16, 12, 0.82)),
|
||||
url('../../assets/images/generated/detail-ledger-ticket-bg-v1.webp') center / cover no-repeat;
|
||||
background: var(--desktop-sidebar-bg);
|
||||
border: 1px solid var(--desktop-border);
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.detail-card > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.header-card { display: flex; flex-direction: column; gap: 12px; }
|
||||
|
||||
.order-no {
|
||||
@@ -320,7 +311,7 @@ function auditNoteDisplayText(remark: { kind: 'note'; text: string }) {
|
||||
.status-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; align-self: flex-start; }
|
||||
.status-won { background: rgba(52,199,89,0.12); color: #4cd964; }
|
||||
.status-lost { background: rgba(255,69,58,0.12); color: #ff453a; }
|
||||
.status-pending { background: rgba(212,175,55,0.12); color: var(--primary-light); }
|
||||
.status-pending { background: rgba(255, 255, 255,0.12); color: var(--primary-light); }
|
||||
.status-default { background: rgba(100,100,100,0.1); color: #888; }
|
||||
|
||||
.amount-row { display: flex; gap: 32px; padding-top: 4px; flex-wrap: wrap; }
|
||||
|
||||
@@ -158,8 +158,8 @@ onActivated(fetchMethods);
|
||||
<div v-else-if="success" class="success-card">
|
||||
<div class="success-icon-wrap">
|
||||
<svg class="check-svg" viewBox="0 0 52 52" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle class="check-circle" cx="26" cy="26" r="24" fill="none" stroke="#D4AF37" stroke-width="3" />
|
||||
<path class="check-mark" d="M14 27l7 7 16-16" fill="none" stroke="#D4AF37" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<circle class="check-circle" cx="26" cy="26" r="24" fill="none" stroke="rgba(255, 255, 255, 0.92)" stroke-width="3" />
|
||||
<path class="check-mark" d="M14 27l7 7 16-16" fill="none" stroke="rgba(255, 255, 255, 0.92)" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
</div>
|
||||
<h2>{{ t('recharge.success_title') || '充值申请已提交' }}</h2>
|
||||
@@ -403,7 +403,7 @@ onActivated(fetchMethods);
|
||||
background: rgba(25, 25, 25, 0.65);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1px solid rgba(212, 175, 55, 0.12);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
border-radius: 16px;
|
||||
text-align: center;
|
||||
max-width: 480px;
|
||||
@@ -434,7 +434,7 @@ onActivated(fetchMethods);
|
||||
}
|
||||
|
||||
.success-details {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
background: rgba(0, 26, 51, 0.25);
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
border-radius: 8px;
|
||||
width: 100%;
|
||||
@@ -479,7 +479,7 @@ onActivated(fetchMethods);
|
||||
.action-btn {
|
||||
padding: 10px 28px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(180deg, #f0d875 0%, #d4af37 100%);
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: #3d2800;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
@@ -488,12 +488,12 @@ onActivated(fetchMethods);
|
||||
transition: opacity 0.2s;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
|
||||
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.action-btn:hover {
|
||||
opacity: 0.9;
|
||||
box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
|
||||
box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
/* Recharge Box Card */
|
||||
@@ -501,7 +501,7 @@ onActivated(fetchMethods);
|
||||
background: rgba(25, 25, 25, 0.65);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border: 1px solid rgba(212, 175, 55, 0.12);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
|
||||
@@ -510,7 +510,7 @@ onActivated(fetchMethods);
|
||||
/* Segment Tabs */
|
||||
.type-tabs {
|
||||
display: flex;
|
||||
background: rgba(0, 0, 0, 0.35);
|
||||
background: rgba(0, 26, 51, 0.35);
|
||||
border-radius: 8px;
|
||||
padding: 4px;
|
||||
gap: 4px;
|
||||
@@ -538,8 +538,8 @@ onActivated(fetchMethods);
|
||||
|
||||
.type-tab.active {
|
||||
color: #3d2800;
|
||||
background: linear-gradient(180deg, #f0d875 0%, #d4af37 100%);
|
||||
box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
/* Columns */
|
||||
@@ -585,13 +585,13 @@ onActivated(fetchMethods);
|
||||
}
|
||||
|
||||
.method-card:hover {
|
||||
border-color: rgba(212, 175, 55, 0.3);
|
||||
border-color: rgba(255, 255, 255, 0.3);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.method-card.selected {
|
||||
border-color: var(--border-gold-soft);
|
||||
background: rgba(212, 175, 55, 0.06);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.method-card-header {
|
||||
@@ -604,7 +604,7 @@ onActivated(fetchMethods);
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border-radius: 6px;
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: var(--primary-light);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -645,7 +645,7 @@ onActivated(fetchMethods);
|
||||
}
|
||||
|
||||
.bank-detail-card {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: rgba(0, 26, 51, 0.2);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
border-radius: 8px;
|
||||
padding: 16px 18px;
|
||||
@@ -678,8 +678,8 @@ onActivated(fetchMethods);
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
background: rgba(212, 175, 55, 0.1);
|
||||
border: 1px solid rgba(212, 175, 55, 0.25);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.25);
|
||||
border-radius: 4px;
|
||||
color: var(--primary-light);
|
||||
font-size: 10px;
|
||||
@@ -691,7 +691,7 @@ onActivated(fetchMethods);
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
background: rgba(212, 175, 55, 0.2);
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -775,7 +775,7 @@ onActivated(fetchMethods);
|
||||
padding: 10px 14px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
background: rgba(0, 26, 51, 0.25);
|
||||
color: var(--text);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
@@ -807,9 +807,9 @@ onActivated(fetchMethods);
|
||||
}
|
||||
|
||||
.preset-btn:hover {
|
||||
border-color: rgba(212, 175, 55, 0.3);
|
||||
border-color: rgba(255, 255, 255, 0.3);
|
||||
color: var(--primary-light);
|
||||
background: rgba(212, 175, 55, 0.05);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
.preview-wrap {
|
||||
@@ -833,7 +833,7 @@ onActivated(fetchMethods);
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 50%;
|
||||
background: #333;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: none;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
@@ -851,7 +851,7 @@ onActivated(fetchMethods);
|
||||
gap: 8px;
|
||||
width: 180px;
|
||||
height: 120px;
|
||||
border: 1.5px dashed rgba(212, 175, 55, 0.3);
|
||||
border: 1.5px dashed rgba(255, 255, 255, 0.3);
|
||||
background: rgba(255, 255, 255, 0.01);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
@@ -860,7 +860,7 @@ onActivated(fetchMethods);
|
||||
|
||||
.upload-zone:hover {
|
||||
border-color: var(--primary);
|
||||
background: rgba(212, 175, 55, 0.04);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.hidden-input {
|
||||
@@ -880,7 +880,7 @@ onActivated(fetchMethods);
|
||||
gap: 8px;
|
||||
padding: 12px 36px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(180deg, #f0d875 0%, #d4af37 100%);
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
color: #3d2800;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
@@ -888,12 +888,12 @@ onActivated(fetchMethods);
|
||||
cursor: pointer;
|
||||
transition: all 0.25s ease;
|
||||
align-self: flex-start;
|
||||
box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
|
||||
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
.submit-btn:hover:not(:disabled) {
|
||||
opacity: 0.9;
|
||||
box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
|
||||
box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.submit-btn:disabled {
|
||||
|
||||
@@ -124,7 +124,7 @@ onActivated(() => loadPage(1));
|
||||
<style scoped>
|
||||
.desktop-account-page { display: flex; flex-direction: column; min-height: 0; flex: 1; width: 100%; }
|
||||
|
||||
.account-main { flex: 1; min-width: 0; padding: var(--space-6) var(--space-7); display: flex; flex-direction: column; overflow: hidden; }
|
||||
.account-main { flex: 1; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; overflow: hidden; }
|
||||
|
||||
.records-layout {
|
||||
display: flex;
|
||||
@@ -136,64 +136,57 @@ onActivated(() => loadPage(1));
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.page-header { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
|
||||
.back-btn { background: none; border: none; color: var(--text-muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; cursor: pointer; padding: 0; transition: color var(--duration-fast) var(--ease-smooth); }
|
||||
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
|
||||
.back-btn { background: none; border: none; color: var(--text-muted); font-size: 14px; font-weight: 700; cursor: pointer; padding: 0; }
|
||||
.back-btn:hover { color: var(--text); }
|
||||
.back-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius); }
|
||||
.page-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 400; color: var(--primary-light); margin: 0; }
|
||||
.page-title { font-size: 18px; font-weight: 800; color: var(--primary-light); margin: 0; }
|
||||
.loading-state { display: flex; justify-content: center; align-items: center; padding: 80px 0; }
|
||||
.table-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 0 1 auto;
|
||||
min-height: 0;
|
||||
background: rgba(18, 18, 18, 0.92);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--bg-card);
|
||||
backdrop-filter: blur(12px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
.table-wrap { flex: 1; overflow-x: auto; overflow-y: auto; }
|
||||
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
|
||||
.dt th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: var(--z-sticky);
|
||||
z-index: 10;
|
||||
padding: 9px 12px;
|
||||
text-align: left;
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--text-xs);
|
||||
font-weight: 400;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
background: rgba(12, 12, 12, 0.97);
|
||||
backdrop-filter: var(--blur-sm);
|
||||
-webkit-backdrop-filter: var(--blur-sm);
|
||||
background: #0A2540;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
border-bottom: 1px solid var(--border);
|
||||
border-bottom: 1px solid var(--desktop-border);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.dt th:first-child { border-top-left-radius: var(--radius-lg); }
|
||||
.dt th:last-child { border-top-right-radius: var(--radius-lg); }
|
||||
.dt th:first-child { border-top-left-radius: 8px; }
|
||||
.dt th:last-child { border-top-right-radius: 8px; }
|
||||
.num-th { text-align: right; }
|
||||
.dt td { padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text); vertical-align: middle; }
|
||||
.hover-row { transition: background var(--duration-fast) var(--ease-smooth), box-shadow var(--duration-fast) var(--ease-smooth); }
|
||||
.hover-row:hover { background: rgba(212, 175, 55, 0.04); box-shadow: inset 3px 0 0 var(--primary); }
|
||||
.type-cell { font-family: var(--font-body); font-weight: 700; }
|
||||
.note-cell { color: var(--text-muted); font-size: var(--text-sm); max-width: 220px; }
|
||||
.num-cell { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-weight: 700; }
|
||||
.date-cell { white-space: nowrap; color: var(--text-muted); font-family: var(--font-mono); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
|
||||
.dt td { padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text); vertical-align: middle; }
|
||||
.hover-row { transition: background 0.15s; }
|
||||
.hover-row:hover { background: rgba(255,255,255,0.03); }
|
||||
.type-cell { font-weight: 700; }
|
||||
.note-cell { color: var(--text-muted); font-size: 12px; max-width: 220px; }
|
||||
.num-cell { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
|
||||
.date-cell { white-space: nowrap; color: var(--text-muted); font-size: 12px; }
|
||||
.arrow-cell { color: #555; font-size: 18px; font-weight: 300; text-align: right; width: 24px; }
|
||||
.pos { color: var(--primary-light); }
|
||||
.neg { color: var(--danger); }
|
||||
.zero { color: var(--text-muted); }
|
||||
.load-more { display: flex; justify-content: center; padding: var(--space-5) 0 var(--space-2); }
|
||||
.load-more-btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 28px; border-radius: var(--radius-md); border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; cursor: pointer; transition: border-color var(--duration-normal) var(--ease-smooth), color var(--duration-normal) var(--ease-smooth), box-shadow var(--duration-normal) var(--ease-smooth); }
|
||||
.load-more-btn:hover:not(:disabled) { border-color: var(--border-gold); color: var(--primary-light); box-shadow: var(--glow-gold); }
|
||||
.load-more { display: flex; justify-content: center; padding: 20px 0 8px; }
|
||||
.load-more-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 28px; border-radius: 6px; border: 1px solid var(--desktop-border); background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
|
||||
.load-more-btn:hover:not(:disabled) { border-color: var(--border-gold-soft); color: var(--primary-light); }
|
||||
.load-more-btn:disabled { opacity: 0.5; cursor: default; }
|
||||
.load-more-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
|
||||
.end-hint { text-align: center; font-family: var(--font-body); font-size: var(--text-xs); color: #444; padding: var(--space-4) 0 var(--space-1); }
|
||||
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: var(--space-12) var(--space-5); color: var(--text-muted); font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; }
|
||||
.end-hint { text-align: center; font-size: 12px; color: #444; padding: 16px 0 4px; }
|
||||
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 20px; color: var(--text-muted); font-size: 14px; font-weight: 600; }
|
||||
</style>
|
||||
|
||||
@@ -68,6 +68,7 @@ function txLabel(tx: TxDetail): string {
|
||||
<template>
|
||||
<div class="desktop-account-page">
|
||||
<main class="account-main">
|
||||
<div class="detail-layout">
|
||||
<div class="page-header">
|
||||
<button type="button" class="back-btn" @click="goBack">
|
||||
‹ {{ t('common.back') || '返回' }}
|
||||
@@ -84,20 +85,12 @@ function txLabel(tx: TxDetail): string {
|
||||
<button type="button" class="retry-btn" @click="loadDetail">{{ t('common.retry') }}</button>
|
||||
</div>
|
||||
|
||||
<div v-else-if="detail" class="detail-grid">
|
||||
<!-- Left: amount hero card -->
|
||||
<div class="detail-card hero-card">
|
||||
<div class="hero-type-label">{{ txLabel(detail) }}</div>
|
||||
<div v-else-if="detail" class="detail-card">
|
||||
<div class="amount-hero" :class="parseFloat(detail.amount) >= 0 ? 'pos' : 'neg'">
|
||||
{{ formatMoney(detail.amount, locale) }}
|
||||
</div>
|
||||
<div class="hero-summary">{{ txSummaryLabel(detail, t) || '-' }}</div>
|
||||
<div class="hero-time">{{ new Date(detail.createdAt).toLocaleString() }}</div>
|
||||
</div>
|
||||
<div class="type-label">{{ txLabel(detail) }}</div>
|
||||
|
||||
<!-- Right: detail rows -->
|
||||
<div class="detail-card rows-card">
|
||||
<div class="card-title">{{ t('wallet.detail_info') || '详细信息' }}</div>
|
||||
<div class="detail-rows">
|
||||
<div class="detail-row">
|
||||
<span class="row-label">{{ t('wallet.type') || '类型' }}</span>
|
||||
@@ -107,10 +100,6 @@ function txLabel(tx: TxDetail): string {
|
||||
<span class="row-label">{{ t('wallet.note') || '备注' }}</span>
|
||||
<span class="row-val">{{ txSummaryLabel(detail, t) || '-' }}</span>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="row-label">{{ t('wallet.amount') || '金额' }}</span>
|
||||
<span class="row-val mono" :class="parseFloat(detail.amount) >= 0 ? 'pos' : 'neg'">{{ formatMoney(detail.amount, locale) }}</span>
|
||||
</div>
|
||||
<div class="detail-row">
|
||||
<span class="row-label">{{ t('wallet.balance_before') || '变动前余额' }}</span>
|
||||
<span class="row-val mono">{{ formatMoney(detail.balanceBefore, locale) }}</span>
|
||||
@@ -137,9 +126,9 @@ function txLabel(tx: TxDetail): string {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="empty-state">{{ t('common.not_found') || '未找到记录' }}</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
@@ -149,6 +138,13 @@ function txLabel(tx: TxDetail): string {
|
||||
|
||||
.account-main { flex: 1; min-width: 0; padding: 24px 28px; overflow-y: auto; }
|
||||
|
||||
.detail-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
|
||||
.back-btn { background: none; border: none; color: var(--text-muted); font-size: 14px; font-weight: 700; cursor: pointer; padding: 0; }
|
||||
.back-btn:hover { color: var(--text); }
|
||||
@@ -158,76 +154,34 @@ function txLabel(tx: TxDetail): string {
|
||||
.retry-btn { padding: 8px 24px; border-radius: 6px; border: 1px solid var(--primary); background: transparent; color: var(--primary-light); font-size: 13px; font-weight: 700; cursor: pointer; }
|
||||
.empty-state { display: flex; align-items: center; justify-content: center; padding: 80px 20px; color: var(--text-muted); font-size: 14px; font-weight: 600; }
|
||||
|
||||
.detail-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 360px 1fr;
|
||||
gap: 20px;
|
||||
max-width: 1000px;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(212, 175, 55, 0.06), transparent 42%),
|
||||
rgba(18, 17, 14, 0.9);
|
||||
border: 1px solid rgba(255, 226, 156, 0.16);
|
||||
border-radius: 10px;
|
||||
background: var(--desktop-sidebar-bg);
|
||||
border: 1px solid var(--desktop-border);
|
||||
border-radius: 12px;
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
.detail-card > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* Hero card (left) */
|
||||
.hero-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
gap: 8px;
|
||||
min-height: 280px;
|
||||
}
|
||||
|
||||
.hero-type-label {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
.amount-hero {
|
||||
font-size: 42px;
|
||||
font-size: 36px;
|
||||
font-weight: 800;
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-family: 'SF Mono', 'Consolas', monospace;
|
||||
line-height: 1.1;
|
||||
margin: 8px 0;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.amount-hero.pos { color: var(--primary-light); }
|
||||
.amount-hero.neg { color: var(--danger); }
|
||||
|
||||
.hero-summary {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
max-width: 280px;
|
||||
}
|
||||
|
||||
.hero-time {
|
||||
font-size: 12px;
|
||||
.type-label {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
margin-top: 4px;
|
||||
margin-bottom: 24px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid var(--desktop-border);
|
||||
}
|
||||
|
||||
/* Rows card (right) */
|
||||
.card-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--desktop-border); }
|
||||
|
||||
.detail-rows { display: flex; flex-direction: column; gap: 0; }
|
||||
|
||||
.detail-row {
|
||||
@@ -239,13 +193,9 @@ function txLabel(tx: TxDetail): string {
|
||||
|
||||
.detail-row:last-child { border-bottom: none; }
|
||||
|
||||
.row-label { width: 130px; flex-shrink: 0; font-size: 12px; color: var(--text-muted); font-weight: 600; }
|
||||
.row-label { width: 120px; flex-shrink: 0; font-size: 12px; color: var(--text-muted); font-weight: 600; }
|
||||
.row-val { flex: 1; font-size: 13px; font-weight: 700; color: var(--text); word-break: break-all; }
|
||||
.row-val.pos { color: var(--primary-light); }
|
||||
.row-val.neg { color: var(--danger); }
|
||||
.mono { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; letter-spacing: 0.03em; }
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.detail-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,25 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onActivated } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { RouterLink } from 'vue-router';
|
||||
import { useRouter, RouterLink } from 'vue-router';
|
||||
import api from '../../api';
|
||||
import GoldSpinner from '../../components/GoldSpinner.vue';
|
||||
import Pagination from '../../components/desktop/Pagination.vue';
|
||||
import DesktopWalletSubNav from '../../components/desktop/DesktopWalletSubNav.vue';
|
||||
import DesktopTxDetailModal from '../../components/desktop/DesktopTxDetailModal.vue';
|
||||
import { formatMoney } from '../../utils/localeDisplay';
|
||||
import { txTypeKey, txDisplayType, txAmountClass, txSummaryLabel } from '../../utils/walletTx';
|
||||
import { parseCashbackApiData, sumCashbackAmount } from '../../utils/cashback';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
const detailModalVisible = ref(false);
|
||||
const detailTxId = ref<string | null>(null);
|
||||
|
||||
function openDetail(txId: string) {
|
||||
detailTxId.value = txId;
|
||||
detailModalVisible.value = true;
|
||||
}
|
||||
const router = useRouter();
|
||||
|
||||
type Transaction = {
|
||||
transactionType: string;
|
||||
@@ -121,7 +113,7 @@ onActivated(() => fetchData(1));
|
||||
v-for="tx in items"
|
||||
:key="tx.transactionId"
|
||||
class="hover-row clickable-row"
|
||||
@click="openDetail(tx.transactionId)"
|
||||
@click="router.push(`/wallet/transactions/${tx.transactionId}`)"
|
||||
>
|
||||
<td class="type-cell">{{ txLabel(tx) }}</td>
|
||||
<td class="muted-cell">{{ txSubtitle(tx) || '-' }}</td>
|
||||
@@ -147,21 +139,16 @@ onActivated(() => fetchData(1));
|
||||
<span>{{ t('wallet.no_records') }}</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<DesktopTxDetailModal v-model:visible="detailModalVisible" :transaction-id="detailTxId" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.type-cell {
|
||||
font-family: var(--font-body);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.muted-cell {
|
||||
color: var(--text-muted);
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--text-sm);
|
||||
max-width: 420px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { resolve } from 'path';
|
||||
import { resolveDevApiTarget } from '../../scripts/resolve-dev-api-target.mjs';
|
||||
import { resolveApiDevTarget } from '../../scripts/dev-api-target.mjs';
|
||||
|
||||
const devApiTarget = resolveDevApiTarget();
|
||||
const apiTarget = resolveApiDevTarget();
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
@@ -38,11 +38,10 @@ export default defineConfig({
|
||||
},
|
||||
publicDir: resolve(__dirname, '../../packages/shared/public'),
|
||||
server: {
|
||||
host: true,
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/api': { target: devApiTarget, changeOrigin: true },
|
||||
'/uploads': { target: devApiTarget, changeOrigin: true },
|
||||
'/api': { target: apiTarget, changeOrigin: true },
|
||||
'/uploads': { target: apiTarget, changeOrigin: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@ services:
|
||||
- thebet365
|
||||
|
||||
player:
|
||||
image: thebet365-player:${PLAYER_IMAGE_TAG:-main}
|
||||
image: thebet365-player:${IMAGE_TAG:-latest}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/player/Dockerfile
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
# 四套主题扩展 — 与 docker-compose.prod.yml 合并使用:
|
||||
# docker compose -f docker-compose.prod.yml -f docker-compose.themes.yml --env-file .env.docker up -d
|
||||
#
|
||||
# 关联文档:docs/四套主题Docker部署任务.md
|
||||
|
||||
services:
|
||||
player2:
|
||||
image: thebet365-player:${PLAYER2_IMAGE_TAG:-theme-2}
|
||||
container_name: thebet365-player2
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- '${BIND_ADDR:-127.0.0.1}:${PLAYER2_PORT:-8083}:80'
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', 'wget -q -O /dev/null http://127.0.0.1/ || exit 1']
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 6
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- thebet365
|
||||
|
||||
player3:
|
||||
image: thebet365-player:${PLAYER3_IMAGE_TAG:-theme-3}
|
||||
container_name: thebet365-player3
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- '${BIND_ADDR:-127.0.0.1}:${PLAYER3_PORT:-8084}:80'
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', 'wget -q -O /dev/null http://127.0.0.1/ || exit 1']
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 6
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- thebet365
|
||||
|
||||
player4:
|
||||
image: thebet365-player:${PLAYER4_IMAGE_TAG:-theme-4}
|
||||
container_name: thebet365-player4
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- '${BIND_ADDR:-127.0.0.1}:${PLAYER4_PORT:-8085}:80'
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', 'wget -q -O /dev/null http://127.0.0.1/ || exit 1']
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 6
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- thebet365
|
||||
@@ -1,13 +0,0 @@
|
||||
@echo off
|
||||
REM Thin launcher for build-and-export-all-themes.ps1
|
||||
REM CMD reads batch files line-by-line from disk; git checkout to theme-* removes
|
||||
REM this file from the working tree. PowerShell loads the script into memory first.
|
||||
REM
|
||||
REM Usage:
|
||||
REM docs\docker\build-and-export-all-themes.bat
|
||||
REM docs\docker\build-and-export-all-themes.bat --use-cache
|
||||
REM docs\docker\build-and-export-all-themes.bat --export-only
|
||||
REM docs\docker\build-and-export-all-themes.bat --skip-api-admin
|
||||
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0build-and-export-all-themes.ps1" %*
|
||||
exit /b %ERRORLEVEL%
|
||||
@@ -1,286 +0,0 @@
|
||||
# 四套主题 player 一键打包(自动切换 Git 分支)
|
||||
# PowerShell 会在启动时将整份脚本载入内存,git checkout 后仍可继续执行。
|
||||
# 用法(项目根目录或本目录均可):
|
||||
# .\docs\docker\build-and-export-all-themes.ps1
|
||||
# .\docs\docker\build-and-export-all-themes.ps1 -UseCache
|
||||
# .\docs\docker\build-and-export-all-themes.ps1 -ExportOnly
|
||||
# .\docs\docker\build-and-export-all-themes.ps1 -SkipApiAdmin
|
||||
# 或通过 bat 启动(参数支持 --use-cache 等 CMD 风格):
|
||||
# docs\docker\build-and-export-all-themes.bat --use-cache
|
||||
|
||||
param(
|
||||
[switch]$UseCache,
|
||||
[switch]$ExportOnly,
|
||||
[switch]$SkipApiAdmin,
|
||||
[switch]$SkipBundle,
|
||||
[switch]$Help
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
foreach ($arg in $args) {
|
||||
switch ($arg.ToLowerInvariant()) {
|
||||
"--use-cache" { $UseCache = $true; continue }
|
||||
"--export-only" { $ExportOnly = $true; continue }
|
||||
"--skip-api-admin" { $SkipApiAdmin = $true; continue }
|
||||
"--skip-bundle" { $SkipBundle = $true; continue }
|
||||
"-h" { $Help = $true; continue }
|
||||
"--help" { $Help = $true; continue }
|
||||
"/?" { $Help = $true; continue }
|
||||
default { throw "Unknown argument: $arg" }
|
||||
}
|
||||
}
|
||||
|
||||
function Show-Help {
|
||||
Write-Host @"
|
||||
|
||||
Usage: docs\docker\build-and-export-all-themes.ps1 [options]
|
||||
|
||||
-UseCache, --use-cache Use Docker build cache (default: --no-cache)
|
||||
-ExportOnly, --export-only Skip build, export existing images only
|
||||
-SkipApiAdmin, --skip-api-admin
|
||||
Only build 4 player themes, skip api/admin
|
||||
-SkipBundle, --skip-bundle Skip thebet365-full-themes-latest.tar (6-in-1 bundle)
|
||||
-Help, -h, --help Show this help
|
||||
|
||||
Output (project root):
|
||||
thebet365-player-main.tar
|
||||
thebet365-player-theme-2.tar
|
||||
thebet365-player-theme-3.tar
|
||||
thebet365-player-theme-4.tar
|
||||
thebet365-images-latest.tar (api + admin, unless -SkipApiAdmin)
|
||||
thebet365-full-themes-latest.tar (api + admin + 4 player themes, unless -SkipBundle)
|
||||
|
||||
"@
|
||||
}
|
||||
|
||||
if ($Help) {
|
||||
Show-Help
|
||||
exit 0
|
||||
}
|
||||
|
||||
$Root = (Resolve-Path (Join-Path $PSScriptRoot "../..")).Path
|
||||
|
||||
$Themes = @(
|
||||
@{ Branch = "main"; Tag = "main" },
|
||||
@{ Branch = "theme-2"; Tag = "theme-2" },
|
||||
@{ Branch = "theme-3"; Tag = "theme-3" },
|
||||
@{ Branch = "theme-4"; Tag = "theme-4" }
|
||||
)
|
||||
|
||||
if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
|
||||
throw "docker not found. Please start Docker Desktop first."
|
||||
}
|
||||
|
||||
if (-not (Test-Path (Join-Path $Root "docs\docker\build-and-export-images.bat"))) {
|
||||
throw "Missing build script: docs\docker\build-and-export-images.bat"
|
||||
}
|
||||
|
||||
function Invoke-Git {
|
||||
param([Parameter(ValueFromRemainingArguments = $true)][string[]]$GitArgs)
|
||||
|
||||
$prevErrorAction = $ErrorActionPreference
|
||||
$ErrorActionPreference = "SilentlyContinue"
|
||||
try {
|
||||
& git @GitArgs 2>$null | Out-Null
|
||||
return $LASTEXITCODE
|
||||
} finally {
|
||||
$ErrorActionPreference = $prevErrorAction
|
||||
}
|
||||
}
|
||||
|
||||
function Get-GitOutput {
|
||||
param([Parameter(ValueFromRemainingArguments = $true)][string[]]$GitArgs)
|
||||
|
||||
$prevErrorAction = $ErrorActionPreference
|
||||
$ErrorActionPreference = "SilentlyContinue"
|
||||
try {
|
||||
return ((& git @GitArgs 2>$null | Out-String).Trim())
|
||||
} finally {
|
||||
$ErrorActionPreference = $prevErrorAction
|
||||
}
|
||||
}
|
||||
|
||||
Set-Location $Root
|
||||
|
||||
$OriginalBranch = Get-GitOutput rev-parse --abbrev-ref HEAD
|
||||
if ([string]::IsNullOrWhiteSpace($OriginalBranch)) {
|
||||
throw "Cannot determine current Git branch. Run this script from the repo root."
|
||||
}
|
||||
Write-Host "[INFO] Current branch: $OriginalBranch"
|
||||
|
||||
$DidStash = $false
|
||||
$diffExit = Invoke-Git diff --quiet
|
||||
$cachedExit = Invoke-Git diff --cached --quiet
|
||||
if ($diffExit -ne 0 -or $cachedExit -ne 0) {
|
||||
Write-Host "[INFO] Stashing local changes before branch switching..."
|
||||
$stashExit = Invoke-Git stash push -m "build-all-themes auto-stash"
|
||||
if ($stashExit -eq 0) {
|
||||
$DidStash = $true
|
||||
Write-Host "[INFO] Changes stashed."
|
||||
} else {
|
||||
Write-Warning "git stash failed. Branch switching may fail if there are conflicts."
|
||||
}
|
||||
}
|
||||
|
||||
$FailedThemes = [System.Collections.Generic.List[string]]::new()
|
||||
$SuccessCount = 0
|
||||
|
||||
function Invoke-BuildExport {
|
||||
param(
|
||||
[string]$Service = "",
|
||||
[string]$Tag
|
||||
)
|
||||
|
||||
$argList = @()
|
||||
if (-not [string]::IsNullOrWhiteSpace($Service)) {
|
||||
$argList += "--service"
|
||||
$argList += $Service
|
||||
}
|
||||
$argList += "--tag"
|
||||
$argList += $Tag
|
||||
if ($UseCache) { $argList += "--use-cache" }
|
||||
if ($ExportOnly) { $argList += "--export-only" }
|
||||
|
||||
Set-Location $Root
|
||||
$batPath = Join-Path $Root "docs\docker\build-and-export-images.bat"
|
||||
$argText = ($argList | ForEach-Object {
|
||||
if ($_ -match '\s') { "`"$_`"" } else { $_ }
|
||||
}) -join ' '
|
||||
& cmd.exe /c "`"$batPath`" $argText"
|
||||
return $LASTEXITCODE
|
||||
}
|
||||
|
||||
function Invoke-PlayerThemeBuild {
|
||||
param(
|
||||
[string]$Branch,
|
||||
[string]$Tag
|
||||
)
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "----------------------------------------------------------------"
|
||||
Write-Host "[INFO] Theme: $Branch (image tag: $Tag)"
|
||||
Write-Host "----------------------------------------------------------------"
|
||||
|
||||
Set-Location $Root
|
||||
$checkoutExit = Invoke-Git checkout $Branch
|
||||
if ($checkoutExit -ne 0) {
|
||||
Write-Host "[ERROR] Cannot switch to branch $Branch -- skipping"
|
||||
$script:FailedThemes.Add($Branch) | Out-Null
|
||||
return
|
||||
}
|
||||
Write-Host "[INFO] Switched to $Branch"
|
||||
|
||||
Set-Location $Root
|
||||
$env:PLAYER_IMAGE_TAG = $Tag
|
||||
if ((Invoke-BuildExport -Service "player" -Tag $Tag) -ne 0) {
|
||||
Write-Host "[ERROR] Player build failed for $Branch"
|
||||
$script:FailedThemes.Add($Branch) | Out-Null
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "[OK] thebet365-player:$Tag exported successfully"
|
||||
$script:SuccessCount++
|
||||
}
|
||||
|
||||
foreach ($theme in $Themes) {
|
||||
Invoke-PlayerThemeBuild -Branch $theme.Branch -Tag $theme.Tag
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "[INFO] Restoring original branch: $OriginalBranch"
|
||||
Set-Location $Root
|
||||
if ((Invoke-Git checkout $OriginalBranch) -eq 0) {
|
||||
Write-Host "[INFO] Restored to $OriginalBranch"
|
||||
} else {
|
||||
Write-Warning "Could not restore branch $OriginalBranch. Run: git checkout $OriginalBranch"
|
||||
}
|
||||
|
||||
if ($DidStash) {
|
||||
Write-Host "[INFO] Restoring stashed changes..."
|
||||
if ((Invoke-Git stash pop) -eq 0) {
|
||||
Write-Host "[INFO] Stash restored."
|
||||
} else {
|
||||
Write-Warning "git stash pop failed. Run: git stash pop"
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $SkipApiAdmin) {
|
||||
Write-Host ""
|
||||
Write-Host "[INFO] Building api + admin (tag: latest) on branch main..."
|
||||
Set-Location $Root
|
||||
if ((Invoke-Git checkout main) -ne 0) {
|
||||
Write-Host "[ERROR] Cannot switch to branch main for api/admin build"
|
||||
$FailedThemes.Add("api/admin") | Out-Null
|
||||
} else {
|
||||
Set-Location $Root
|
||||
if ((Invoke-BuildExport -Service "api-admin" -Tag "latest") -ne 0) {
|
||||
Write-Host "[ERROR] api/admin build failed"
|
||||
$FailedThemes.Add("api/admin") | Out-Null
|
||||
} else {
|
||||
$SuccessCount++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "[INFO] Restoring original branch: $OriginalBranch"
|
||||
Set-Location $Root
|
||||
Invoke-Git checkout $OriginalBranch | Out-Null
|
||||
}
|
||||
|
||||
if (-not $SkipBundle -and -not $SkipApiAdmin -and $FailedThemes.Count -eq 0) {
|
||||
Write-Host ""
|
||||
Write-Host "[INFO] Exporting full bundle (api + admin + 4 player themes)..."
|
||||
Set-Location $Root
|
||||
if ((Invoke-BuildExport -Service "full-themes" -Tag "latest") -ne 0) {
|
||||
Write-Host "[ERROR] Full bundle export failed"
|
||||
$FailedThemes.Add("full-bundle") | Out-Null
|
||||
} else {
|
||||
Write-Host "[OK] thebet365-full-themes-latest.tar exported successfully"
|
||||
$SuccessCount++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "================================================================"
|
||||
Write-Host " BUILD SUMMARY"
|
||||
Write-Host "================================================================"
|
||||
Write-Host " Succeeded: $SuccessCount task(s)"
|
||||
|
||||
if ($FailedThemes.Count -gt 0) {
|
||||
Write-Host " Failed: $($FailedThemes -join ' ')"
|
||||
Write-Host ""
|
||||
Write-Host " Tip: Retry failed themes manually:"
|
||||
Write-Host " git checkout <branch>"
|
||||
Write-Host " docs\docker\build-and-export-images.bat --service player --tag <tag>"
|
||||
Write-Host "================================================================"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " All done! Output files in project root:"
|
||||
Write-Host " thebet365-player-main.tar"
|
||||
Write-Host " thebet365-player-theme-2.tar"
|
||||
Write-Host " thebet365-player-theme-3.tar"
|
||||
Write-Host " thebet365-player-theme-4.tar"
|
||||
if (-not $SkipApiAdmin) {
|
||||
Write-Host " thebet365-images-latest.tar (api + admin)"
|
||||
}
|
||||
if (-not $SkipBundle -and -not $SkipApiAdmin) {
|
||||
Write-Host " thebet365-full-themes-latest.tar (api + admin + 4 themes, upload this only)"
|
||||
}
|
||||
Write-Host ""
|
||||
Write-Host " Server import (single bundle):"
|
||||
Write-Host " docker load -i thebet365-full-themes-latest.tar"
|
||||
Write-Host " docker compose -f docker-compose.prod.yml -f docker-compose.themes.yml --env-file .env.docker up -d"
|
||||
Write-Host ""
|
||||
Write-Host " Or import separate tars:"
|
||||
if (-not $SkipApiAdmin) {
|
||||
Write-Host " docker load -i thebet365-images-latest.tar"
|
||||
}
|
||||
Write-Host " docker load -i thebet365-player-main.tar"
|
||||
Write-Host " docker load -i thebet365-player-theme-2.tar"
|
||||
Write-Host " docker load -i thebet365-player-theme-3.tar"
|
||||
Write-Host " docker load -i thebet365-player-theme-4.tar"
|
||||
Write-Host "================================================================"
|
||||
exit 0
|
||||
@@ -8,9 +8,6 @@ REM docs\docker\build-and-export-images.bat --service admin
|
||||
REM docs\docker\build-and-export-images.bat --tag v1.2.3
|
||||
REM docs\docker\build-and-export-images.bat --use-cache
|
||||
REM docs\docker\build-and-export-images.bat --export-only
|
||||
REM
|
||||
REM 四套主题玩家端一键打包(自动切分支,推荐):
|
||||
REM docs\docker\build-and-export-all-themes.bat
|
||||
|
||||
cd /d "%~dp0..\.."
|
||||
|
||||
@@ -69,7 +66,7 @@ goto parse_args
|
||||
echo.
|
||||
echo Usage: docs\docker\build-and-export-images.bat [options]
|
||||
echo.
|
||||
echo --service SVC api ^| player ^| admin ^| api-admin ^| full-themes ^| all (default: all)
|
||||
echo --service SVC api ^| player ^| admin ^| all (default: all)
|
||||
echo --tag TAG Image tag (default: latest)
|
||||
echo --use-cache Use Docker build cache
|
||||
echo --export-only Skip build, export existing images only
|
||||
@@ -81,9 +78,6 @@ echo docs\docker\build-and-export-images.bat --service admin
|
||||
echo docs\docker\build-and-export-admin.bat
|
||||
echo docs\docker\build-and-export-admin.bat --export-only
|
||||
echo.
|
||||
echo 四套主题玩家端批量打包(自动切分支,推荐):
|
||||
echo docs\docker\build-and-export-all-themes.bat
|
||||
echo.
|
||||
exit /b 0
|
||||
|
||||
:args_done
|
||||
@@ -117,7 +111,8 @@ if errorlevel 1 exit /b 1
|
||||
if not defined OUTPUT call :default_output
|
||||
|
||||
set "OUTPUT_PATH=%OUTPUT%"
|
||||
if /i not "%OUTPUT:~1,1%"==":" set "OUTPUT_PATH=%CD%\%OUTPUT%"
|
||||
echo %OUTPUT_PATH%| findstr /r "^[A-Za-z]:\\" >nul
|
||||
if errorlevel 1 set "OUTPUT_PATH=%CD%\%OUTPUT%"
|
||||
|
||||
where docker >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
@@ -125,19 +120,15 @@ if errorlevel 1 (
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if "%EXPORT_ONLY%"=="0" if /i not "%SERVICE%"=="full-themes" goto do_build
|
||||
if "%EXPORT_ONLY%"=="0" goto do_build
|
||||
goto do_export
|
||||
|
||||
:do_build
|
||||
echo ==^> Building %SERVICE% (tag: %TAG%)
|
||||
set "IMAGE_TAG=%TAG%"
|
||||
REM player 在 compose 里默认 PLAYER_IMAGE_TAG=main;与 --tag 对齐以便导出/部署
|
||||
set "PLAYER_IMAGE_TAG=%TAG%"
|
||||
if "%NO_CACHE%"=="1" goto build_no_cache
|
||||
if /i "%SERVICE%"=="all" (
|
||||
docker compose -f "%COMPOSE_FILE%" --env-file "%ENV_FILE%" build api player admin
|
||||
) else if /i "%SERVICE%"=="api-admin" (
|
||||
docker compose -f "%COMPOSE_FILE%" --env-file "%ENV_FILE%" build api admin
|
||||
) else (
|
||||
docker compose -f "%COMPOSE_FILE%" --env-file "%ENV_FILE%" build %SERVICE%
|
||||
)
|
||||
@@ -146,8 +137,6 @@ goto build_done
|
||||
:build_no_cache
|
||||
if /i "%SERVICE%"=="all" (
|
||||
docker compose -f "%COMPOSE_FILE%" --env-file "%ENV_FILE%" build --no-cache api player admin
|
||||
) else if /i "%SERVICE%"=="api-admin" (
|
||||
docker compose -f "%COMPOSE_FILE%" --env-file "%ENV_FILE%" build --no-cache api admin
|
||||
) else (
|
||||
docker compose -f "%COMPOSE_FILE%" --env-file "%ENV_FILE%" build --no-cache %SERVICE%
|
||||
)
|
||||
@@ -162,10 +151,6 @@ if errorlevel 1 (
|
||||
echo ==^> Exporting %SERVICE% to %OUTPUT_PATH%
|
||||
if /i "%SERVICE%"=="all" (
|
||||
docker save thebet365-api:%TAG% thebet365-player:%TAG% thebet365-admin:%TAG% -o "%OUTPUT_PATH%"
|
||||
) else if /i "%SERVICE%"=="api-admin" (
|
||||
docker save thebet365-api:%TAG% thebet365-admin:%TAG% -o "%OUTPUT_PATH%"
|
||||
) else if /i "%SERVICE%"=="full-themes" (
|
||||
docker save thebet365-api:%TAG% thebet365-admin:%TAG% thebet365-player:main thebet365-player:theme-2 thebet365-player:theme-3 thebet365-player:theme-4 -o "%OUTPUT_PATH%"
|
||||
) else (
|
||||
docker save thebet365-%SERVICE%:%TAG% -o "%OUTPUT_PATH%"
|
||||
)
|
||||
@@ -196,34 +181,16 @@ for %%F in ("%OUTPUT_PATH%") do set /a SIZE_MB=%%~zF/1048576
|
||||
echo git_dirty=!GIT_DIRTY!
|
||||
echo tar=!TAR_NAME!
|
||||
echo tar_sha256=!TAR_SHA256!
|
||||
if /i "!SERVICE!"=="all" (
|
||||
if /i not "!SERVICE!"=="all" (
|
||||
echo image=thebet365-!SERVICE!:%TAG%
|
||||
echo image_id=!SVC_IMAGE_ID!
|
||||
) else (
|
||||
echo api_image=thebet365-api:%TAG%
|
||||
echo api_image_id=!API_IMAGE_ID!
|
||||
echo player_image=thebet365-player:%TAG%
|
||||
echo player_image_id=!PLAYER_IMAGE_ID!
|
||||
echo admin_image=thebet365-admin:%TAG%
|
||||
echo admin_image_id=!ADMIN_IMAGE_ID!
|
||||
) else if /i "!SERVICE!"=="api-admin" (
|
||||
echo api_image=thebet365-api:%TAG%
|
||||
echo api_image_id=!API_IMAGE_ID!
|
||||
echo admin_image=thebet365-admin:%TAG%
|
||||
echo admin_image_id=!ADMIN_IMAGE_ID!
|
||||
) else if /i "!SERVICE!"=="full-themes" (
|
||||
echo api_image=thebet365-api:%TAG%
|
||||
echo api_image_id=!API_IMAGE_ID!
|
||||
echo admin_image=thebet365-admin:%TAG%
|
||||
echo admin_image_id=!ADMIN_IMAGE_ID!
|
||||
echo player_main_image=thebet365-player:main
|
||||
echo player_main_image_id=!PLAYER_MAIN_IMAGE_ID!
|
||||
echo player_theme_2_image=thebet365-player:theme-2
|
||||
echo player_theme_2_image_id=!PLAYER_THEME2_IMAGE_ID!
|
||||
echo player_theme_3_image=thebet365-player:theme-3
|
||||
echo player_theme_3_image_id=!PLAYER_THEME3_IMAGE_ID!
|
||||
echo player_theme_4_image=thebet365-player:theme-4
|
||||
echo player_theme_4_image_id=!PLAYER_THEME4_IMAGE_ID!
|
||||
) else (
|
||||
echo image=thebet365-!SERVICE!:%TAG%
|
||||
echo image_id=!SVC_IMAGE_ID!
|
||||
)
|
||||
)
|
||||
|
||||
@@ -234,12 +201,6 @@ echo Server load and recreate:
|
||||
if /i "%SERVICE%"=="all" (
|
||||
echo docker load -i !TAR_NAME!
|
||||
echo docker compose -f docker-compose.prod.yml --env-file .env.docker up -d --force-recreate api player admin
|
||||
) else if /i "%SERVICE%"=="api-admin" (
|
||||
echo docker load -i !TAR_NAME!
|
||||
echo docker compose -f docker-compose.prod.yml --env-file .env.docker up -d --force-recreate api admin
|
||||
) else if /i "%SERVICE%"=="full-themes" (
|
||||
echo docker load -i !TAR_NAME!
|
||||
echo docker compose -f docker-compose.prod.yml -f docker-compose.themes.yml --env-file .env.docker up -d
|
||||
) else (
|
||||
echo docker load -i !TAR_NAME!
|
||||
echo docker compose -f docker-compose.prod.yml --env-file .env.docker up -d --force-recreate %SERVICE%
|
||||
@@ -256,10 +217,6 @@ exit /b 0
|
||||
:default_output
|
||||
if /i "%SERVICE%"=="all" (
|
||||
set "OUTPUT=thebet365-images-%TAG%.tar"
|
||||
) else if /i "%SERVICE%"=="api-admin" (
|
||||
set "OUTPUT=thebet365-images-%TAG%.tar"
|
||||
) else if /i "%SERVICE%"=="full-themes" (
|
||||
set "OUTPUT=thebet365-full-themes-%TAG%.tar"
|
||||
) else (
|
||||
set "OUTPUT=thebet365-%SERVICE%-%TAG%.tar"
|
||||
)
|
||||
@@ -267,13 +224,10 @@ exit /b 0
|
||||
|
||||
:validate_service
|
||||
if /i "%SERVICE%"=="all" exit /b 0
|
||||
if /i "%SERVICE%"=="api-admin" exit /b 0
|
||||
if /i "%SERVICE%"=="full-themes" exit /b 0
|
||||
if /i "%SERVICE%"=="api" exit /b 0
|
||||
if /i "%SERVICE%"=="player" exit /b 0
|
||||
if /i "%SERVICE%"=="admin" exit /b 0
|
||||
echo ERROR: invalid --service: %SERVICE% (use api, player, admin, api-admin, full-themes, or all)
|
||||
echo TIP: 四套主题一键打包请使用 docs\docker\build-and-export-all-themes.bat
|
||||
echo ERROR: invalid --service: %SERVICE% (use api, player, admin, or all)
|
||||
exit /b 1
|
||||
|
||||
:validate_tag
|
||||
@@ -312,19 +266,10 @@ set "API_IMAGE_ID="
|
||||
set "PLAYER_IMAGE_ID="
|
||||
set "ADMIN_IMAGE_ID="
|
||||
set "SVC_IMAGE_ID="
|
||||
set "PLAYER_MAIN_IMAGE_ID="
|
||||
set "PLAYER_THEME2_IMAGE_ID="
|
||||
set "PLAYER_THEME3_IMAGE_ID="
|
||||
set "PLAYER_THEME4_IMAGE_ID="
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-api:%TAG% --format "{{.Id}}" 2^>nul') do set "API_IMAGE_ID=%%I"
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-player:%TAG% --format "{{.Id}}" 2^>nul') do set "PLAYER_IMAGE_ID=%%I"
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-admin:%TAG% --format "{{.Id}}" 2^>nul') do set "ADMIN_IMAGE_ID=%%I"
|
||||
if /i "%SERVICE%"=="full-themes" (
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-player:main --format "{{.Id}}" 2^>nul') do set "PLAYER_MAIN_IMAGE_ID=%%I"
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-player:theme-2 --format "{{.Id}}" 2^>nul') do set "PLAYER_THEME2_IMAGE_ID=%%I"
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-player:theme-3 --format "{{.Id}}" 2^>nul') do set "PLAYER_THEME3_IMAGE_ID=%%I"
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-player:theme-4 --format "{{.Id}}" 2^>nul') do set "PLAYER_THEME4_IMAGE_ID=%%I"
|
||||
) else if /i not "%SERVICE%"=="all" (
|
||||
if /i not "%SERVICE%"=="all" (
|
||||
for /f "delims=" %%I in ('docker image inspect thebet365-%SERVICE%:%TAG% --format "{{.Id}}" 2^>nul') do set "SVC_IMAGE_ID=%%I"
|
||||
)
|
||||
exit /b 0
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
# ?? api / player / admin ???????? tar
|
||||
# ??????????????????:
|
||||
# 构建 api / player / admin 生产镜像并导出为 tar
|
||||
# 用法(在项目根目录或本目录执行均可):
|
||||
# .\docs\docker\build-and-export-images.ps1
|
||||
# .\docs\docker\build-and-export-images.ps1 -Service admin
|
||||
# .\docs\docker\build-and-export-images.ps1 -Tag v1.2.3
|
||||
# .\docs\docker\build-and-export-images.ps1 -UseCache
|
||||
# .\docs\docker\build-and-export-images.ps1 -ExportOnly
|
||||
#
|
||||
# ????????????????????????????????????
|
||||
# docs\docker\build-and-export-all-themes.bat
|
||||
|
||||
|
||||
param(
|
||||
[ValidateSet("all", "api", "player", "admin", "api-admin")]
|
||||
[ValidateSet("all", "api", "player", "admin")]
|
||||
[string]$Service = "all",
|
||||
[string]$Tag = $env:IMAGE_TAG,
|
||||
[switch]$UseCache,
|
||||
@@ -31,27 +27,27 @@ function Get-DefaultTag { "latest" }
|
||||
|
||||
function Get-DefaultOutput {
|
||||
param([string]$Svc, [string]$ImageTag)
|
||||
if ($Svc -eq "all" -or $Svc -eq "api-admin") { return "thebet365-images-$ImageTag.tar" }
|
||||
if ($Svc -eq "all") { return "thebet365-images-$ImageTag.tar" }
|
||||
return "thebet365-$Svc-$ImageTag.tar"
|
||||
}
|
||||
|
||||
function Assert-ImageTag {
|
||||
param([string]$Value)
|
||||
if ($Value -notmatch '^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$') {
|
||||
throw "?? tag ???? $Value"
|
||||
throw "镜像 tag 不合法: $Value"
|
||||
}
|
||||
}
|
||||
|
||||
if (-not (Test-Path $ComposeFile)) {
|
||||
throw "????$ComposeFile?????? $Root??
|
||||
throw "未找到 $ComposeFile(当前目录: $Root)"
|
||||
}
|
||||
|
||||
if (-not (Test-Path $EnvFile)) {
|
||||
if (Test-Path ".env.docker.example") {
|
||||
Write-Warning "????.env.docker????.env.docker.example????????????"
|
||||
Write-Warning "未找到 .env.docker,使用 .env.docker.example(生产请复制并修改密钥)"
|
||||
$EnvFile = ".env.docker.example"
|
||||
} else {
|
||||
throw "????.env.docker ??.env.docker.example"
|
||||
throw "未找到 .env.docker 或 .env.docker.example"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,11 +56,7 @@ if ([string]::IsNullOrWhiteSpace($Tag)) {
|
||||
}
|
||||
Assert-ImageTag $Tag
|
||||
|
||||
$BuildServices = switch ($Service) {
|
||||
"all" { $AllServices }
|
||||
"api-admin" { @("api", "admin") }
|
||||
default { @($Service) }
|
||||
}
|
||||
$BuildServices = if ($Service -eq "all") { $AllServices } else { @($Service) }
|
||||
$SaveImages = $BuildServices | ForEach-Object { "thebet365-${_}:${Tag}" }
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($Output)) {
|
||||
@@ -72,7 +64,7 @@ if ([string]::IsNullOrWhiteSpace($Output)) {
|
||||
}
|
||||
|
||||
if (-not $ExportOnly) {
|
||||
Write-Host "==> ????: $($BuildServices -join ', ') (tag: $Tag)"
|
||||
Write-Host "==> 构建镜像: $($BuildServices -join ', ') (tag: $Tag)"
|
||||
$buildArgs = @(
|
||||
"compose", "-f", $ComposeFile, "--env-file", $EnvFile, "build"
|
||||
)
|
||||
@@ -84,7 +76,7 @@ if (-not $ExportOnly) {
|
||||
try {
|
||||
$env:IMAGE_TAG = $Tag
|
||||
& docker @buildArgs
|
||||
if ($LASTEXITCODE -ne 0) { throw "docker build ?????? $LASTEXITCODE" }
|
||||
if ($LASTEXITCODE -ne 0) { throw "docker build 失败,退出码 $LASTEXITCODE" }
|
||||
} finally {
|
||||
$env:IMAGE_TAG = $oldImageTag
|
||||
}
|
||||
@@ -92,9 +84,9 @@ if (-not $ExportOnly) {
|
||||
|
||||
$OutputPath = if ([System.IO.Path]::IsPathRooted($Output)) { $Output } else { Join-Path $Root $Output }
|
||||
|
||||
Write-Host "==> ???? ($Service) -> $OutputPath"
|
||||
Write-Host "==> 导出镜像 ($Service) -> $OutputPath"
|
||||
& docker save @SaveImages -o $OutputPath
|
||||
if ($LASTEXITCODE -ne 0) { throw "docker save ?????? $LASTEXITCODE" }
|
||||
if ($LASTEXITCODE -ne 0) { throw "docker save 失败,退出码 $LASTEXITCODE" }
|
||||
|
||||
$manifestPath = if ($OutputPath.EndsWith(".tar")) {
|
||||
$OutputPath.Substring(0, $OutputPath.Length - 4) + ".manifest.txt"
|
||||
@@ -125,7 +117,7 @@ $manifestLines = @(
|
||||
)
|
||||
foreach ($svc in $BuildServices) {
|
||||
$imageId = (& docker image inspect "thebet365-${svc}:${Tag}" --format "{{.Id}}").Trim()
|
||||
if ($Service -eq "all" -or $Service -eq "api-admin") {
|
||||
if ($Service -eq "all") {
|
||||
$manifestLines += "${svc}_image=thebet365-${svc}:${Tag}"
|
||||
$manifestLines += "${svc}_image_id=$imageId"
|
||||
} else {
|
||||
@@ -136,17 +128,13 @@ foreach ($svc in $BuildServices) {
|
||||
$manifestLines | Set-Content -Encoding UTF8 $manifestPath
|
||||
|
||||
$sizeMb = [math]::Round((Get-Item $OutputPath).Length / 1MB, 2)
|
||||
Write-Host "??: $OutputPath (${sizeMb} MB)"
|
||||
Write-Host "完成: $OutputPath (${sizeMb} MB)"
|
||||
Write-Host "Manifest: $manifestPath"
|
||||
|
||||
$recreate = switch ($Service) {
|
||||
"all" { "api player admin" }
|
||||
"api-admin" { "api admin" }
|
||||
default { $Service }
|
||||
}
|
||||
$recreate = if ($Service -eq "all") { "api player admin" } else { $Service }
|
||||
Write-Host @"
|
||||
|
||||
????????:
|
||||
服务器导入并重建:
|
||||
docker load -i $([System.IO.Path]::GetFileName($OutputPath))
|
||||
docker compose -f docker-compose.prod.yml --env-file .env.docker up -d --force-recreate $recreate
|
||||
"@
|
||||
|
||||
@@ -25,7 +25,7 @@ default_tag() { echo "latest"; }
|
||||
|
||||
default_output() {
|
||||
local svc="$1" image_tag="$2"
|
||||
if [[ "$svc" == "all" || "$svc" == "api-admin" ]]; then
|
||||
if [[ "$svc" == "all" ]]; then
|
||||
echo "thebet365-images-${image_tag}.tar"
|
||||
else
|
||||
echo "thebet365-${svc}-${image_tag}.tar"
|
||||
@@ -39,8 +39,8 @@ validate_tag() {
|
||||
|
||||
validate_service() {
|
||||
case "$1" in
|
||||
all|api|player|admin|api-admin) ;;
|
||||
*) echo "错误: --service 无效: $1(可选 api / player / admin / api-admin / all)" >&2; exit 1 ;;
|
||||
all|api|player|admin) ;;
|
||||
*) echo "错误: --service 无效: $1(可选 api / player / admin / all)" >&2; exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ usage() {
|
||||
用法: docs/docker/build-and-export-images.sh [选项]
|
||||
|
||||
选项:
|
||||
--service SVC api | player | admin | api-admin | all(默认 all)
|
||||
--service SVC api | player | admin | all(默认 all)
|
||||
--tag TAG 镜像 tag(默认 latest)
|
||||
--use-cache 构建时使用 Docker 缓存(默认 --no-cache)
|
||||
--export-only 跳过构建,仅导出已有指定 tag 镜像
|
||||
@@ -105,8 +105,6 @@ OUTPUT="${OUTPUT:-$(default_output "$SERVICE" "$TAG")}"
|
||||
|
||||
if [[ "$SERVICE" == "all" ]]; then
|
||||
BUILD_SERVICES=(api player admin)
|
||||
elif [[ "$SERVICE" == "api-admin" ]]; then
|
||||
BUILD_SERVICES=(api admin)
|
||||
else
|
||||
BUILD_SERVICES=("$SERVICE")
|
||||
fi
|
||||
@@ -163,7 +161,7 @@ fi
|
||||
echo "tar=$(basename "$OUTPUT_PATH")"
|
||||
echo "tar_sha256=$CHECKSUM"
|
||||
for svc in "${BUILD_SERVICES[@]}"; do
|
||||
if [[ "$SERVICE" == "all" || "$SERVICE" == "api-admin" ]]; then
|
||||
if [[ "$SERVICE" == "all" ]]; then
|
||||
echo "${svc}_image=thebet365-${svc}:$TAG"
|
||||
echo "${svc}_image_id=$(docker image inspect "thebet365-${svc}:$TAG" --format '{{.Id}}')"
|
||||
else
|
||||
@@ -184,8 +182,6 @@ echo "Manifest: $MANIFEST_PATH"
|
||||
RECREATE="$SERVICE"
|
||||
if [[ "$SERVICE" == "all" ]]; then
|
||||
RECREATE="api player admin"
|
||||
elif [[ "$SERVICE" == "api-admin" ]]; then
|
||||
RECREATE="api admin"
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
@echo off
|
||||
REM Build and export main player theme only.
|
||||
REM Automatically switches to 'main' branch, builds, and restores original branch.
|
||||
REM Usage: docs\docker\build-and-export-player-main.bat [options]
|
||||
|
||||
cd /d "%~dp0..\.."
|
||||
set "BRANCH=main"
|
||||
set "TAG=main"
|
||||
|
||||
set "ORIGINAL_BRANCH="
|
||||
for /f "delims=" %%B in ('git rev-parse --abbrev-ref HEAD 2^>nul') do set "ORIGINAL_BRANCH=%%B"
|
||||
if not defined ORIGINAL_BRANCH (
|
||||
echo ERROR: Cannot determine current Git branch.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [INFO] Switching to branch %BRANCH%...
|
||||
git checkout %BRANCH% >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Cannot switch to branch %BRANCH%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
call docs\docker\build-and-export-images.bat --service player --tag %TAG% %*
|
||||
set "BUILD_STATUS=%ERRORLEVEL%"
|
||||
|
||||
echo [INFO] Restoring original branch: %ORIGINAL_BRANCH%
|
||||
git checkout %ORIGINAL_BRANCH% >nul 2>&1
|
||||
|
||||
exit /b %BUILD_STATUS%
|
||||
@@ -1,30 +0,0 @@
|
||||
@echo off
|
||||
REM Build and export theme-2 player theme only.
|
||||
REM Automatically switches to 'theme-2' branch, builds, and restores original branch.
|
||||
REM Usage: docs\docker\build-and-export-player-theme-2.bat [options]
|
||||
|
||||
cd /d "%~dp0..\.."
|
||||
set "BRANCH=theme-2"
|
||||
set "TAG=theme-2"
|
||||
|
||||
set "ORIGINAL_BRANCH="
|
||||
for /f "delims=" %%B in ('git rev-parse --abbrev-ref HEAD 2^>nul') do set "ORIGINAL_BRANCH=%%B"
|
||||
if not defined ORIGINAL_BRANCH (
|
||||
echo ERROR: Cannot determine current Git branch.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [INFO] Switching to branch %BRANCH%...
|
||||
git checkout %BRANCH% >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Cannot switch to branch %BRANCH%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
call docs\docker\build-and-export-images.bat --service player --tag %TAG% %*
|
||||
set "BUILD_STATUS=%ERRORLEVEL%"
|
||||
|
||||
echo [INFO] Restoring original branch: %ORIGINAL_BRANCH%
|
||||
git checkout %ORIGINAL_BRANCH% >nul 2>&1
|
||||
|
||||
exit /b %BUILD_STATUS%
|
||||
@@ -1,30 +0,0 @@
|
||||
@echo off
|
||||
REM Build and export theme-3 player theme only.
|
||||
REM Automatically switches to 'theme-3' branch, builds, and restores original branch.
|
||||
REM Usage: docs\docker\build-and-export-player-theme-3.bat [options]
|
||||
|
||||
cd /d "%~dp0..\.."
|
||||
set "BRANCH=theme-3"
|
||||
set "TAG=theme-3"
|
||||
|
||||
set "ORIGINAL_BRANCH="
|
||||
for /f "delims=" %%B in ('git rev-parse --abbrev-ref HEAD 2^>nul') do set "ORIGINAL_BRANCH=%%B"
|
||||
if not defined ORIGINAL_BRANCH (
|
||||
echo ERROR: Cannot determine current Git branch.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [INFO] Switching to branch %BRANCH%...
|
||||
git checkout %BRANCH% >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Cannot switch to branch %BRANCH%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
call docs\docker\build-and-export-images.bat --service player --tag %TAG% %*
|
||||
set "BUILD_STATUS=%ERRORLEVEL%"
|
||||
|
||||
echo [INFO] Restoring original branch: %ORIGINAL_BRANCH%
|
||||
git checkout %ORIGINAL_BRANCH% >nul 2>&1
|
||||
|
||||
exit /b %BUILD_STATUS%
|
||||
@@ -1,30 +0,0 @@
|
||||
@echo off
|
||||
REM Build and export theme-4 player theme only.
|
||||
REM Automatically switches to 'theme-4' branch, builds, and restores original branch.
|
||||
REM Usage: docs\docker\build-and-export-player-theme-4.bat [options]
|
||||
|
||||
cd /d "%~dp0..\.."
|
||||
set "BRANCH=theme-4"
|
||||
set "TAG=theme-4"
|
||||
|
||||
set "ORIGINAL_BRANCH="
|
||||
for /f "delims=" %%B in ('git rev-parse --abbrev-ref HEAD 2^>nul') do set "ORIGINAL_BRANCH=%%B"
|
||||
if not defined ORIGINAL_BRANCH (
|
||||
echo ERROR: Cannot determine current Git branch.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [INFO] Switching to branch %BRANCH%...
|
||||
git checkout %BRANCH% >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] Cannot switch to branch %BRANCH%
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
call docs\docker\build-and-export-images.bat --service player --tag %TAG% %*
|
||||
set "BUILD_STATUS=%ERRORLEVEL%"
|
||||
|
||||
echo [INFO] Restoring original branch: %ORIGINAL_BRANCH%
|
||||
git checkout %ORIGINAL_BRANCH% >nul 2>&1
|
||||
|
||||
exit /b %BUILD_STATUS%
|
||||
@@ -14,14 +14,8 @@
|
||||
|------|----------|
|
||||
| `docs/docker/build-and-export-images.bat` | Windows(CMD,构建全部) |
|
||||
| `docs/docker/build-and-export-api.bat` | Windows(仅 api,可双击) |
|
||||
| `docs/docker/build-and-export-player.bat` | Windows(仅单分支 player,可双击) |
|
||||
| `docs/docker/build-and-export-player-main.bat` | Windows(仅主站/暗金主题,自动切分支) |
|
||||
| `docs/docker/build-and-export-player-theme-2.bat` | Windows(仅 theme-2 蓝白主题,自动切分支) |
|
||||
| `docs/docker/build-and-export-player-theme-3.bat` | Windows(仅 theme-3 移动主题,自动切分支) |
|
||||
| `docs/docker/build-and-export-player-theme-4.bat` | Windows(仅 theme-4 海军蓝极简,自动切分支) |
|
||||
| `docs/docker/build-and-export-player.bat` | Windows(仅 player,可双击) |
|
||||
| `docs/docker/build-and-export-admin.bat` | Windows(仅 admin,可双击) |
|
||||
| `docs/docker/build-and-export-all-themes.ps1` | Windows(**四套主题 player 一键打包**,自动切分支,推荐) |
|
||||
| `docs/docker/build-and-export-all-themes.bat` | Windows(同上,薄包装启动器,双击可用) |
|
||||
| `docs/docker/build-and-export-images.ps1` | Windows(PowerShell) |
|
||||
| `docs/docker/build-and-export-images.sh` | Linux / macOS / Git Bash |
|
||||
|
||||
@@ -124,81 +118,6 @@ docs\docker\build-and-export-images.bat --export-only
|
||||
|
||||
---
|
||||
|
||||
## 三、四套主题玩家端打包
|
||||
|
||||
> 关联文档:[四套主题Docker部署任务.md](../四套主题Docker部署任务.md)「阶段 C」
|
||||
|
||||
### 一键打包(推荐)
|
||||
|
||||
脚本会自动:切到各主题分支 → 构建 player 镜像 → 导出 tar → 切回原分支 → 构建 api/admin。
|
||||
|
||||
> **为何用 PowerShell?** 本脚本仅存在于 `main` 分支;执行过程中会 `git checkout theme-*`,CMD 批处理会从磁盘逐行读取,切分支后脚本文件消失会导致中断。PowerShell 启动时已将整份脚本载入内存,可安全跨分支执行。`.bat` 仅为薄包装,内部转调 `.ps1`。
|
||||
|
||||
```powershell
|
||||
cd C:\path\to\thebet365
|
||||
.\docs\docker\build-and-export-all-themes.ps1
|
||||
```
|
||||
|
||||
或双击 / CMD:
|
||||
|
||||
```bat
|
||||
docs\docker\build-and-export-all-themes.bat
|
||||
```
|
||||
|
||||
可选参数(PowerShell 与 bat 均支持):
|
||||
|
||||
| 参数 | 说明 |
|
||||
|------|------|
|
||||
| `-UseCache` / `--use-cache` | 使用 Docker 层缓存,加快重复构建速度 |
|
||||
| `-ExportOnly` / `--export-only` | 跳过构建,仅导出本地已有镜像 |
|
||||
| `-SkipApiAdmin` / `--skip-api-admin` | 只打四套 player,跳过 api/admin |
|
||||
| `-SkipBundle` / `--skip-bundle` | 跳过六合一包,仅保留分散 tar |
|
||||
|
||||
### 产物
|
||||
|
||||
| tar 文件 | 加载后镜像名 |
|
||||
|----------|----------------|
|
||||
| `thebet365-player-main.tar` | `thebet365-player:main` |
|
||||
| `thebet365-player-theme-2.tar` | `thebet365-player:theme-2` |
|
||||
| `thebet365-player-theme-3.tar` | `thebet365-player:theme-3` |
|
||||
| `thebet365-player-theme-4.tar` | `thebet365-player:theme-4` |
|
||||
| `thebet365-images-latest.tar` | `thebet365-api:latest` + `thebet365-admin:latest` |
|
||||
| **`thebet365-full-themes-latest.tar`** | **上面全部 6 个镜像(上传这一个即可)** |
|
||||
|
||||
也可单独导出六合一包(本地镜像已齐时):
|
||||
|
||||
```bat
|
||||
docs\docker\build-and-export-images.bat --service full-themes --export-only --tag latest
|
||||
```
|
||||
|
||||
### 分支要求
|
||||
|
||||
- 执行前确保 `main`、`theme-2`、`theme-3`、`theme-4` 四个分支在本地均已拉取
|
||||
- 工作区若有未提交变更,脚本会给出 WARN;建议先 `git stash` 后再运行
|
||||
- 若某一分支切换失败,该分支会被跳过并标记失败,其余分支仍继续构建
|
||||
|
||||
### 手动逐一打包(有明确失败时)
|
||||
|
||||
```bat
|
||||
git checkout main
|
||||
docs\docker\build-and-export-images.bat --service player --tag main
|
||||
|
||||
git checkout theme-2
|
||||
docs\docker\build-and-export-images.bat --service player --tag theme-2
|
||||
|
||||
git checkout theme-3
|
||||
docs\docker\build-and-export-images.bat --service player --tag theme-3
|
||||
|
||||
git checkout theme-4
|
||||
docs\docker\build-and-export-images.bat --service player --tag theme-4
|
||||
|
||||
REM 最后打 api + admin
|
||||
git checkout main
|
||||
docs\docker\build-and-export-images.bat --tag latest
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、构建产物
|
||||
|
||||
| 镜像名 | 说明 |
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
|
||||
### 阶段 A — 仓库改动(一次性)
|
||||
|
||||
- [x] **A1** 新增 `docker-compose.themes.yml`(player2 / player3 / player4 服务定义)
|
||||
- [x] **A2** 更新 `.env.docker.example`(`PLAYER2_*` ~ `PLAYER4_*`、`CORS_ORIGINS` 示例)
|
||||
- [x] **A3** 更新 `docker-compose.prod.yml` 中 `player` 使用 `PLAYER_IMAGE_TAG`(与 `IMAGE_TAG` 解耦,见下文片段)
|
||||
- [x] **A4**(可选)在 `docs/Docker部署指南.md` 增加「多主题」小节链接到本文
|
||||
- [x] **A5**(可选)在 `AGENTS.md` 文档索引增加本文链接
|
||||
- [ ] **A1** 新增 `docker-compose.themes.yml`(player2 / player3 / player4 服务定义)
|
||||
- [ ] **A2** 更新 `.env.docker.example`(`PLAYER2_*` ~ `PLAYER4_*`、`CORS_ORIGINS` 示例)
|
||||
- [ ] **A3** 更新 `docker-compose.prod.yml` 中 `player` 使用 `PLAYER_IMAGE_TAG`(与 `IMAGE_TAG` 解耦,见下文片段)
|
||||
- [ ] **A4**(可选)在 `docs/Docker部署指南.md` 增加「多主题」小节链接到本文
|
||||
- [ ] **A5**(可选)在 `AGENTS.md` 文档索引增加本文链接
|
||||
|
||||
### 阶段 B — 各主题分支同步 main 功能(发版前每个 theme 分支各做一遍)
|
||||
|
||||
@@ -276,18 +276,7 @@ pnpm dev:player # http://localhost:5173 目视确认仍是本主题皮
|
||||
|
||||
## 六、构建与上传镜像
|
||||
|
||||
### 6.1 四个 player 镜像
|
||||
|
||||
**一键打包(推荐,仅 `main` 分支提供脚本):**
|
||||
|
||||
```powershell
|
||||
cd C:\path\to\thebet365
|
||||
.\docs\docker\build-and-export-all-themes.ps1 -SkipApiAdmin
|
||||
```
|
||||
|
||||
或 `docs\docker\build-and-export-all-themes.bat --skip-api-admin`(内部转调 PowerShell,避免切分支后 bat 从磁盘消失)。
|
||||
|
||||
**手动逐步(Windows CMD):**
|
||||
### 6.1 四个 player 镜像(Windows CMD)
|
||||
|
||||
```bat
|
||||
cd C:\path\to\thebet365
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(180deg, #15120A 0%, #0A0A16 100%);
|
||||
background: #001A33;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#loading-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: linear-gradient(180deg, #15120A 0%, #0A0A16 100%);
|
||||
background: #001A33;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -46,8 +46,8 @@
|
||||
.spinner {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
border: 2px solid rgba(200, 168, 78, 0.3);
|
||||
border-top-color: #c8a84e;
|
||||
border: 2px solid rgba(255, 255, 255, 0.15);
|
||||
border-top-color: rgba(255, 255, 255, 0.72);
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ INIT_DB=false
|
||||
SKIP_BACKUP=false
|
||||
ALLOW_DEFAULT_SECRETS=false
|
||||
IMAGE_TAR=""
|
||||
WITH_THEMES=false
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
@@ -31,7 +30,6 @@ usage() {
|
||||
--no-build 不构建镜像,直接使用服务器已有镜像
|
||||
--images PATH 先 docker load 指定镜像 tar,并自动跳过本机构建
|
||||
--tag TAG 使用指定镜像 tag,并写入 .env.docker 的 IMAGE_TAG
|
||||
--themes 启用四套 player(player2/3/4);加载 thebet365-full-themes-*.tar 时自动开启
|
||||
--no-seed 不执行生产 seed
|
||||
--init-db 调用 scripts/prod-init-db.sh 清空业务数据并初始化生产数据,仅限全新库或明确重置
|
||||
--skip-backup 与 --init-db 一起使用,跳过 prod-init-db 的备份
|
||||
@@ -41,7 +39,6 @@ usage() {
|
||||
示例:
|
||||
./scripts/deploy-first.sh
|
||||
./scripts/deploy-first.sh --images thebet365-images-v1.2.3.tar --tag v1.2.3
|
||||
./scripts/deploy-first.sh --images thebet365-full-themes-latest.tar --tag latest
|
||||
./scripts/deploy-first.sh --no-build
|
||||
./scripts/deploy-first.sh --init-db
|
||||
EOF
|
||||
@@ -62,10 +59,6 @@ while [ $# -gt 0 ]; do
|
||||
set_deploy_image_tag "${2:?缺少 --tag 参数值}"
|
||||
shift 2
|
||||
;;
|
||||
--themes)
|
||||
WITH_THEMES=true
|
||||
shift
|
||||
;;
|
||||
--no-seed)
|
||||
RUN_SEED=false
|
||||
shift
|
||||
@@ -106,12 +99,6 @@ if [ -n "$IMAGE_TAR" ] && [ -z "${DEPLOY_IMAGE_TAG:-}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$WITH_THEMES" = true ]; then
|
||||
enable_themes_deploy
|
||||
elif [ -n "$IMAGE_TAR" ]; then
|
||||
maybe_enable_themes_from_tar "$IMAGE_TAR"
|
||||
fi
|
||||
|
||||
if [ -n "$IMAGE_TAR" ]; then
|
||||
load_image_tar "$IMAGE_TAR"
|
||||
fi
|
||||
@@ -131,9 +118,8 @@ if [ "$INIT_DB" = false ] && [ "$RUN_SEED" = true ]; then
|
||||
seed_production_if_missing_admin
|
||||
fi
|
||||
|
||||
log "启动 $(stack_app_services)"
|
||||
# shellcheck disable=SC2046
|
||||
compose up -d $(stack_app_services)
|
||||
log "启动 api / player / admin"
|
||||
compose up -d api player admin
|
||||
wait_for_stack_ready
|
||||
|
||||
if [ "$INIT_DB" = true ]; then
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
DEPLOY_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT="$(cd "$DEPLOY_LIB_DIR/.." && pwd)"
|
||||
COMPOSE_FILE="$ROOT/docker-compose.prod.yml"
|
||||
COMPOSE_THEMES_FILE="$ROOT/docker-compose.themes.yml"
|
||||
ENV_FILE="$ROOT/.env.docker"
|
||||
ENV_EXAMPLE_FILE="$ROOT/.env.docker.example"
|
||||
BACKUP_DIR="$ROOT/backups"
|
||||
@@ -13,7 +12,6 @@ CURRENT_RELEASE_FILE="$DEPLOY_STATE_DIR/current-release.env"
|
||||
PREVIOUS_RELEASE_FILE="$DEPLOY_STATE_DIR/previous-release.env"
|
||||
|
||||
DEPLOY_IMAGE_TAG="${DEPLOY_IMAGE_TAG:-}"
|
||||
DEPLOY_WITH_THEMES="${DEPLOY_WITH_THEMES:-false}"
|
||||
LAST_DB_BACKUP=""
|
||||
LAST_UPLOADS_BACKUP=""
|
||||
|
||||
@@ -57,95 +55,18 @@ infer_image_tag_from_tar() {
|
||||
local base tag
|
||||
|
||||
base="$(basename "$image_tar")"
|
||||
tag="${base#thebet365-full-themes-}"
|
||||
tag="${tag%.tar}"
|
||||
if [ "$tag" != "$base" ] && [ -n "$tag" ]; then
|
||||
printf '%s' "$tag"
|
||||
return 0
|
||||
fi
|
||||
|
||||
tag="${base#thebet365-images-}"
|
||||
tag="${tag%.tar}"
|
||||
|
||||
if [ "$tag" != "$base" ] && [ -n "$tag" ]; then
|
||||
printf '%s' "$tag"
|
||||
fi
|
||||
}
|
||||
|
||||
is_full_themes_tar() {
|
||||
local image_tar="$1"
|
||||
case "$(basename "$image_tar")" in
|
||||
thebet365-full-themes-*.tar) return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
themes_enabled() {
|
||||
[ "$DEPLOY_WITH_THEMES" = true ]
|
||||
}
|
||||
|
||||
player_image_tag() {
|
||||
local tag
|
||||
tag="$(env_value PLAYER_IMAGE_TAG)"
|
||||
tag="${tag:-main}"
|
||||
validate_image_tag "$tag"
|
||||
printf '%s' "$tag"
|
||||
}
|
||||
|
||||
theme_player_tag() {
|
||||
local key="$1"
|
||||
local default_tag="$2"
|
||||
local tag
|
||||
tag="$(env_value "$key")"
|
||||
tag="${tag:-$default_tag}"
|
||||
validate_image_tag "$tag"
|
||||
printf '%s' "$tag"
|
||||
}
|
||||
|
||||
compose() {
|
||||
local tag player_tag compose_args=(-f "$COMPOSE_FILE")
|
||||
local tag
|
||||
tag="$(current_image_tag)"
|
||||
player_tag="$(player_image_tag)"
|
||||
|
||||
if themes_enabled; then
|
||||
[ -f "$COMPOSE_THEMES_FILE" ] || die "缺少 $COMPOSE_THEMES_FILE,无法启动四套 player"
|
||||
compose_args+=(-f "$COMPOSE_THEMES_FILE")
|
||||
fi
|
||||
|
||||
IMAGE_TAG="$tag" \
|
||||
PLAYER_IMAGE_TAG="$player_tag" \
|
||||
docker compose "${compose_args[@]}" --env-file "$ENV_FILE" "$@"
|
||||
}
|
||||
|
||||
stack_app_services() {
|
||||
if themes_enabled; then
|
||||
printf '%s' "api player player2 player3 player4 admin"
|
||||
else
|
||||
printf '%s' "api player admin"
|
||||
fi
|
||||
}
|
||||
|
||||
enable_themes_deploy() {
|
||||
DEPLOY_WITH_THEMES=true
|
||||
export DEPLOY_WITH_THEMES
|
||||
log "四套 player 主题部署已启用"
|
||||
}
|
||||
|
||||
maybe_enable_themes_from_tar() {
|
||||
local image_tar="$1"
|
||||
if is_full_themes_tar "$image_tar"; then
|
||||
enable_themes_deploy
|
||||
fi
|
||||
}
|
||||
|
||||
load_themes_from_release() {
|
||||
local val
|
||||
[ -f "$CURRENT_RELEASE_FILE" ] || return 1
|
||||
val="$(grep -E '^deploy_with_themes=' "$CURRENT_RELEASE_FILE" 2>/dev/null | tail -1 | cut -d= -f2- || true)"
|
||||
if [ "$val" = true ]; then
|
||||
enable_themes_deploy
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
IMAGE_TAG="$tag" docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" "$@"
|
||||
}
|
||||
|
||||
ensure_env_file() {
|
||||
@@ -282,11 +203,6 @@ wait_for_service_health() {
|
||||
wait_for_stack_ready() {
|
||||
wait_for_service_health api 180
|
||||
wait_for_service_health player 120
|
||||
if themes_enabled; then
|
||||
wait_for_service_health player2 120
|
||||
wait_for_service_health player3 120
|
||||
wait_for_service_health player4 120
|
||||
fi
|
||||
wait_for_service_health admin 120
|
||||
}
|
||||
|
||||
@@ -298,13 +214,8 @@ start_infra() {
|
||||
}
|
||||
|
||||
build_app_images() {
|
||||
if themes_enabled; then
|
||||
log "构建 api / player / player2 / player3 / player4 / admin 镜像"
|
||||
compose build api player player2 player3 player4 admin
|
||||
else
|
||||
log "构建 api / player / admin 镜像: $(current_image_tag)"
|
||||
compose build api player admin
|
||||
fi
|
||||
}
|
||||
|
||||
load_image_tar() {
|
||||
@@ -314,28 +225,12 @@ load_image_tar() {
|
||||
docker load -i "$image_tar"
|
||||
}
|
||||
|
||||
require_image() {
|
||||
local ref="$1"
|
||||
docker image inspect "$ref" >/dev/null 2>&1 || die "缺少镜像: $ref"
|
||||
}
|
||||
|
||||
require_images_for_current_tag() {
|
||||
local tag player_tag t2 t3 t4
|
||||
local tag
|
||||
tag="$(current_image_tag)"
|
||||
player_tag="$(player_image_tag)"
|
||||
|
||||
require_image "thebet365-api:$tag"
|
||||
require_image "thebet365-player:$player_tag"
|
||||
require_image "thebet365-admin:$tag"
|
||||
|
||||
if themes_enabled; then
|
||||
t2="$(theme_player_tag PLAYER2_IMAGE_TAG theme-2)"
|
||||
t3="$(theme_player_tag PLAYER3_IMAGE_TAG theme-3)"
|
||||
t4="$(theme_player_tag PLAYER4_IMAGE_TAG theme-4)"
|
||||
require_image "thebet365-player:$t2"
|
||||
require_image "thebet365-player:$t3"
|
||||
require_image "thebet365-player:$t4"
|
||||
fi
|
||||
docker image inspect "thebet365-api:$tag" >/dev/null 2>&1 || die "缺少镜像: thebet365-api:$tag"
|
||||
docker image inspect "thebet365-player:$tag" >/dev/null 2>&1 || die "缺少镜像: thebet365-player:$tag"
|
||||
docker image inspect "thebet365-admin:$tag" >/dev/null 2>&1 || die "缺少镜像: thebet365-admin:$tag"
|
||||
}
|
||||
|
||||
run_prisma_migrations() {
|
||||
@@ -448,10 +343,9 @@ current_release_tag() {
|
||||
|
||||
record_release_state() {
|
||||
local source="${1:-deploy}"
|
||||
local tag player_tag t2 t3 t4 stamp safe_tag manifest previous_tag
|
||||
local tag stamp safe_tag manifest previous_tag
|
||||
|
||||
tag="$(current_image_tag)"
|
||||
player_tag="$(player_image_tag)"
|
||||
stamp="$(date -u +%Y%m%dT%H%M%SZ)"
|
||||
safe_tag="$(printf '%s' "$tag" | tr -c 'A-Za-z0-9_.-' '-')"
|
||||
manifest="$RELEASES_DIR/${stamp}-${safe_tag}.env"
|
||||
@@ -467,18 +361,9 @@ record_release_state() {
|
||||
printf 'previous_tag=%s\n' "$previous_tag"
|
||||
printf 'deployed_at=%s\n' "$stamp"
|
||||
printf 'source=%s\n' "$source"
|
||||
printf 'deploy_with_themes=%s\n' "$DEPLOY_WITH_THEMES"
|
||||
printf 'api_image=thebet365-api:%s\n' "$tag"
|
||||
printf 'player_image=thebet365-player:%s\n' "$player_tag"
|
||||
printf 'player_image=thebet365-player:%s\n' "$tag"
|
||||
printf 'admin_image=thebet365-admin:%s\n' "$tag"
|
||||
if themes_enabled; then
|
||||
t2="$(theme_player_tag PLAYER2_IMAGE_TAG theme-2)"
|
||||
t3="$(theme_player_tag PLAYER3_IMAGE_TAG theme-3)"
|
||||
t4="$(theme_player_tag PLAYER4_IMAGE_TAG theme-4)"
|
||||
printf 'player2_image=thebet365-player:%s\n' "$t2"
|
||||
printf 'player3_image=thebet365-player:%s\n' "$t3"
|
||||
printf 'player4_image=thebet365-player:%s\n' "$t4"
|
||||
fi
|
||||
[ -n "$LAST_DB_BACKUP" ] && printf 'db_backup=%s\n' "$LAST_DB_BACKUP"
|
||||
[ -n "$LAST_UPLOADS_BACKUP" ] && printf 'uploads_backup=%s\n' "$LAST_UPLOADS_BACKUP"
|
||||
} > "$manifest"
|
||||
@@ -488,40 +373,21 @@ record_release_state() {
|
||||
}
|
||||
|
||||
print_stack_urls() {
|
||||
local player_port player2_port player3_port player4_port admin_port bind_addr tag player_tag
|
||||
local player_port admin_port bind_addr tag
|
||||
player_port="$(env_value PLAYER_PORT)"
|
||||
player2_port="$(env_value PLAYER2_PORT)"
|
||||
player3_port="$(env_value PLAYER3_PORT)"
|
||||
player4_port="$(env_value PLAYER4_PORT)"
|
||||
admin_port="$(env_value ADMIN_PORT)"
|
||||
bind_addr="$(env_value BIND_ADDR)"
|
||||
tag="$(current_image_tag)"
|
||||
player_tag="$(player_image_tag)"
|
||||
player_port="${player_port:-8082}"
|
||||
player2_port="${player2_port:-8083}"
|
||||
player3_port="${player3_port:-8084}"
|
||||
player4_port="${player4_port:-8085}"
|
||||
admin_port="${admin_port:-8081}"
|
||||
bind_addr="${bind_addr:-127.0.0.1}"
|
||||
|
||||
printf '\n'
|
||||
printf '%s\n' "部署完成:"
|
||||
printf '%s\n' " api/admin 镜像 tag: ${tag}"
|
||||
printf '%s\n' " player 镜像 tag: ${player_tag}"
|
||||
if themes_enabled; then
|
||||
printf '%s\n' " 玩家端 main: http://${bind_addr}:${player_port}"
|
||||
printf '%s\n' " 玩家端 theme-2: http://${bind_addr}:${player2_port}"
|
||||
printf '%s\n' " 玩家端 theme-3: http://${bind_addr}:${player3_port}"
|
||||
printf '%s\n' " 玩家端 theme-4: http://${bind_addr}:${player4_port}"
|
||||
else
|
||||
printf '%s\n' " 镜像 tag: ${tag}"
|
||||
printf '%s\n' " 玩家端: http://${bind_addr}:${player_port}"
|
||||
fi
|
||||
printf '%s\n' " 管理端: http://${bind_addr}:${admin_port}"
|
||||
printf '%s\n' " API: 仅在 Docker 网络内暴露,由 player/admin 容器和宝塔反代链路访问"
|
||||
if themes_enabled; then
|
||||
printf '%s\n' " 状态: docker compose -f docker-compose.prod.yml -f docker-compose.themes.yml --env-file .env.docker ps"
|
||||
else
|
||||
printf '%s\n' " 状态: docker compose -f docker-compose.prod.yml --env-file .env.docker ps"
|
||||
fi
|
||||
printf '%s\n' " 当前发布: .deploy/current-release.env"
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ NO_BUILD=false
|
||||
SKIP_BACKUP=false
|
||||
ALLOW_DEFAULT_SECRETS=false
|
||||
IMAGE_TAR=""
|
||||
WITH_THEMES=false
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
@@ -31,7 +30,6 @@ usage() {
|
||||
--pull 先执行 git pull --ff-only
|
||||
--images PATH 先 docker load 指定镜像 tar,并自动跳过本机构建
|
||||
--tag TAG 使用指定镜像 tag,并写入 .env.docker 的 IMAGE_TAG
|
||||
--themes 启用四套 player(player2/3/4);加载 thebet365-full-themes-*.tar 时自动开启
|
||||
--no-build 不构建镜像,直接使用服务器已有镜像
|
||||
--no-backup 跳过 PostgreSQL 与 uploads 备份
|
||||
--allow-default-secrets 允许 .env.docker 使用示例密钥,仅测试环境使用
|
||||
@@ -40,7 +38,6 @@ usage() {
|
||||
示例:
|
||||
./scripts/deploy-update.sh --pull
|
||||
./scripts/deploy-update.sh --images thebet365-images-v1.2.3.tar --tag v1.2.3
|
||||
./scripts/deploy-update.sh --images thebet365-full-themes-latest.tar --tag latest
|
||||
./scripts/deploy-update.sh --no-build
|
||||
EOF
|
||||
}
|
||||
@@ -60,10 +57,6 @@ while [ $# -gt 0 ]; do
|
||||
set_deploy_image_tag "${2:?缺少 --tag 参数值}"
|
||||
shift 2
|
||||
;;
|
||||
--themes)
|
||||
WITH_THEMES=true
|
||||
shift
|
||||
;;
|
||||
--no-build)
|
||||
NO_BUILD=true
|
||||
shift
|
||||
@@ -99,12 +92,6 @@ if [ -n "$IMAGE_TAR" ] && [ -z "${DEPLOY_IMAGE_TAG:-}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$WITH_THEMES" = true ]; then
|
||||
enable_themes_deploy
|
||||
elif [ -n "$IMAGE_TAR" ]; then
|
||||
maybe_enable_themes_from_tar "$IMAGE_TAR"
|
||||
fi
|
||||
|
||||
if [ "$PULL_CODE" = true ]; then
|
||||
require_command git
|
||||
log "拉取代码: git pull --ff-only"
|
||||
@@ -134,9 +121,8 @@ fi
|
||||
|
||||
run_prisma_migrations
|
||||
|
||||
log "启动/更新 $(stack_app_services)"
|
||||
# shellcheck disable=SC2046
|
||||
compose up -d $(stack_app_services)
|
||||
log "启动/更新 api / player / admin"
|
||||
compose up -d api player admin
|
||||
wait_for_stack_ready
|
||||
show_prisma_status
|
||||
compose ps
|
||||
|
||||
19
scripts/dev-api-target.mjs
Normal file
@@ -0,0 +1,19 @@
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
|
||||
/** 本地 dev:与 apps/api/.env 的 PORT 对齐,供 player/admin Vite 代理使用 */
|
||||
export function resolveApiDevTarget() {
|
||||
if (process.env.VITE_DEV_API_TARGET) return process.env.VITE_DEV_API_TARGET;
|
||||
if (process.env.API_DEV_TARGET) return process.env.API_DEV_TARGET;
|
||||
|
||||
let port = '3000';
|
||||
const envPath = resolve(repoRoot, 'apps/api/.env');
|
||||
if (existsSync(envPath)) {
|
||||
const match = readFileSync(envPath, 'utf8').match(/^PORT=(\d+)\s*$/m);
|
||||
if (match) port = match[1];
|
||||
}
|
||||
return `http://localhost:${port}`;
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import { execSync } from 'node:child_process';
|
||||
import { resolveDevApiPort } from './resolve-dev-api-target.mjs';
|
||||
|
||||
const port = process.argv[2] ?? resolveDevApiPort();
|
||||
const port = process.argv[2] ?? '3000';
|
||||
|
||||
function killWindows(portNum) {
|
||||
let out = '';
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { resolve, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const envPath = resolve(root, 'apps/api/.env');
|
||||
|
||||
/** 读取 apps/api/.env 的 PORT,供 Vite 代理与 dev 脚本共用 */
|
||||
export function resolveDevApiPort(fallback = '3000') {
|
||||
if (!existsSync(envPath)) return fallback;
|
||||
const match = readFileSync(envPath, 'utf8').match(/^PORT=(\d+)/m);
|
||||
return match?.[1] ?? fallback;
|
||||
}
|
||||
|
||||
export function resolveDevApiTarget(fallbackPort = '3000') {
|
||||
return `http://127.0.0.1:${resolveDevApiPort(fallbackPort)}`;
|
||||
}
|
||||
@@ -10,7 +10,6 @@ source "$SCRIPT_DIR/deploy-lib.sh"
|
||||
TARGET_TAG=""
|
||||
SKIP_BACKUP=false
|
||||
ALLOW_DEFAULT_SECRETS=false
|
||||
WITH_THEMES="auto"
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
@@ -26,12 +25,9 @@ usage() {
|
||||
注意:
|
||||
本脚本只回滚镜像,不回滚数据库结构或数据。
|
||||
如果目标版本涉及不可逆迁移,必须先按备份文件手工恢复数据库。
|
||||
若当前发布启用了四套 player,默认会一并回滚 player2/3/4;可用 --no-themes 仅回滚单套 player。
|
||||
|
||||
选项:
|
||||
--to TAG 目标镜像 tag,必填
|
||||
--themes 回滚时启用四套 player(player2/3/4)
|
||||
--no-themes 仅回滚单套 player,忽略当前发布的 themes 状态
|
||||
--no-backup 跳过 PostgreSQL 与 uploads 备份
|
||||
--allow-default-secrets 允许 .env.docker 使用示例密钥,仅测试环境使用
|
||||
-h, --help 显示帮助
|
||||
@@ -47,14 +43,6 @@ while [ $# -gt 0 ]; do
|
||||
TARGET_TAG="${2:?缺少 --to 参数值}"
|
||||
shift 2
|
||||
;;
|
||||
--themes)
|
||||
WITH_THEMES=true
|
||||
shift
|
||||
;;
|
||||
--no-themes)
|
||||
WITH_THEMES=false
|
||||
shift
|
||||
;;
|
||||
--no-backup)
|
||||
SKIP_BACKUP=true
|
||||
shift
|
||||
@@ -80,16 +68,6 @@ cd "$ROOT"
|
||||
require_docker
|
||||
ensure_env_file || exit 1
|
||||
validate_prod_env "$ALLOW_DEFAULT_SECRETS"
|
||||
|
||||
if [ "$WITH_THEMES" = true ]; then
|
||||
enable_themes_deploy
|
||||
elif [ "$WITH_THEMES" = false ]; then
|
||||
DEPLOY_WITH_THEMES=false
|
||||
export DEPLOY_WITH_THEMES
|
||||
else
|
||||
load_themes_from_release || true
|
||||
fi
|
||||
|
||||
require_images_for_current_tag
|
||||
|
||||
start_infra
|
||||
@@ -102,9 +80,8 @@ else
|
||||
warn "已跳过 PostgreSQL 与 uploads 备份"
|
||||
fi
|
||||
|
||||
log "回滚 $(stack_app_services) 到 tag: $(current_image_tag)"
|
||||
# shellcheck disable=SC2046
|
||||
compose up -d $(stack_app_services)
|
||||
log "回滚 api / player / admin 到 tag: $(current_image_tag)"
|
||||
compose up -d api player admin
|
||||
wait_for_stack_ready
|
||||
show_prisma_status
|
||||
compose ps
|
||||
|
||||
@@ -61,24 +61,12 @@
|
||||
"skillPath": "skills/minimalist-skill/SKILL.md",
|
||||
"computedHash": "08873a3131d3be27bef9bf3304b310b16b44ca6e3561aebe532797be3443f6bd"
|
||||
},
|
||||
"receiving-code-review": {
|
||||
"source": "obra/superpowers",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/receiving-code-review/SKILL.md",
|
||||
"computedHash": "3f56080356c62e4f74a183d7371686babc661e41a952dc67a97c2c76fe8a9329"
|
||||
},
|
||||
"redesign-existing-projects": {
|
||||
"source": "leonxlnx/taste-skill",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/redesign-skill/SKILL.md",
|
||||
"computedHash": "b405eee0e0e80fc243f731d9aa368bca307e356db7e6157d27101d369dac6726"
|
||||
},
|
||||
"requesting-code-review": {
|
||||
"source": "obra/superpowers",
|
||||
"sourceType": "github",
|
||||
"skillPath": "skills/requesting-code-review/SKILL.md",
|
||||
"computedHash": "cde520e9118d7e6b74b5ab0123cff2f68d9c07bddb3f82c997753b6126600aed"
|
||||
},
|
||||
"stitch-design-taste": {
|
||||
"source": "leonxlnx/taste-skill",
|
||||
"sourceType": "github",
|
||||
|
||||