owpengram-server/internal/seed/giftdemo/specs.go
2026-07-22 20:20:16 +03:00

150 lines
5.3 KiB
Go

package giftdemo
import "telesrv/internal/domain"
// Palette (hex) shared across the demo assets.
const (
colGold = 0xF5C542
colAmber = 0xF59E0B
colBlue = 0x2563EB
colCyan = 0x38BDF8
colViolet = 0x7C3AED
colEmerald = 0x10B981
colRose = 0xF43F5E
colWhite = 0xFFFFFF
colSlate = 0x1E293B
colMidnight = 0x0B1220
colDeepEm = 0x065F46
)
func star(points int, fill, stroke int, strokeW float64, m motion) lottieSpec {
return lottieSpec{kind: shapeStar, points: points, fill: fromHex(fill), stroke: fromHex(stroke), strokeW: strokeW, radius: 168, motion: m}
}
func polygon(points, fill, stroke int, strokeW float64, m motion) lottieSpec {
return lottieSpec{kind: shapePolygon, points: points, fill: fromHex(fill), stroke: fromHex(stroke), strokeW: strokeW, radius: 150, motion: m}
}
func ring(fill, inner int, m motion) lottieSpec {
return lottieSpec{kind: shapeRing, fill: fromHex(fill), stroke: fromHex(inner), radius: 150, motion: m}
}
func burst(points, fill int, m motion) lottieSpec {
return lottieSpec{kind: shapeBurst, points: points, fill: fromHex(fill), radius: 150, motion: m}
}
// Four colour-only backdrops reused across every upgradeable gift (backdrops
// carry no animation asset, so sharing them is free).
func demoBackdrops() []backdropSpec {
return []backdropSpec{
{name: "Midnight", center: colSlate, edge: colMidnight, pattern: colCyan, text: colWhite, permille: 400},
{name: "Sunset", center: colAmber, edge: colRose, pattern: colWhite, text: colSlate, permille: 300},
{name: "Emerald", center: colEmerald, edge: colDeepEm, pattern: colWhite, text: colWhite, permille: 200},
{name: "Royal", center: colViolet, edge: colBlue, pattern: colGold, text: colWhite, permille: 100},
}
}
// demoGifts returns the five demo gifts in display order.
func demoGifts() []giftSpec {
return []giftSpec{
{
// #1 — cheapest, plain, not upgradeable.
title: "OwpenGram Spark",
stars: 15,
convert: 15,
base: burst(8, colGold, motionPulse),
},
{
// #2 — standard upgradeable, no crafting.
title: "OwpenGram Star",
stars: 50,
convert: 50,
base: star(5, colBlue, colCyan, 10, motionSpin),
upgrade: &upgradeSpec{
upgradeStars: 200,
supplyTotal: 10000,
slug: "owg-star",
models: []attrSpec{
{name: "Sapphire", spec: star(5, colBlue, colCyan, 12, motionSpin), permille: 600},
{name: "Frost", spec: star(6, colCyan, colWhite, 10, motionSpin), permille: 400},
},
patterns: []attrSpec{
{name: "Halo", spec: burst(12, colCyan, motionPulse), permille: 700},
{name: "Drift", spec: burst(8, colBlue, motionPulse), permille: 300},
},
backdrops: demoBackdrops(),
},
},
{
// #3 — upgradeable + craftable.
title: "OwpenGram Coin",
stars: 100,
convert: 75,
base: ring(colAmber, colSlate, motionSpin),
upgrade: &upgradeSpec{
upgradeStars: 400,
supplyTotal: 8000,
slug: "owg-coin",
models: []attrSpec{
{name: "Bronze", spec: ring(colAmber, colSlate, motionSpin), permille: 600},
{name: "Silver", spec: ring(colWhite, colSlate, motionSpin), permille: 400},
{name: "Molten", spec: ring(colRose, colAmber, motionSpinPulse), crafted: true, rarity: domain.StarGiftRarityRare},
},
patterns: []attrSpec{
{name: "Gleam", spec: burst(10, colGold, motionPulse), permille: 700},
{name: "Ember", spec: burst(6, colAmber, motionPulse), permille: 300},
},
backdrops: demoBackdrops(),
},
},
{
// #4 — limited edition, upgradeable + craftable.
title: "OwpenGram Gem",
stars: 250,
convert: 200,
base: polygon(6, colViolet, colWhite, 10, motionSpinPulse),
limited: true,
availability: 5000,
upgrade: &upgradeSpec{
upgradeStars: 800,
supplyTotal: 3000,
slug: "owg-gem",
models: []attrSpec{
{name: "Amethyst", spec: polygon(6, colViolet, colWhite, 12, motionSpin), permille: 600},
{name: "Verdant", spec: polygon(6, colEmerald, colWhite, 12, motionSpin), permille: 400},
{name: "Prism", spec: polygon(8, colCyan, colWhite, 10, motionSpinPulse), crafted: true, rarity: domain.StarGiftRarityEpic},
},
patterns: []attrSpec{
{name: "Facet", spec: burst(12, colViolet, motionPulse), permille: 700},
{name: "Shine", spec: burst(8, colWhite, motionPulse), permille: 300},
},
backdrops: demoBackdrops(),
},
},
{
// #5 — premium-gated, limited, the full stack.
title: "OwpenGram Crown",
stars: 1000,
convert: 800,
base: star(3, colGold, colAmber, 12, motionSpinPulse),
limited: true,
availability: 500,
requirePremium: true,
upgrade: &upgradeSpec{
upgradeStars: 2000,
supplyTotal: 500,
slug: "owg-crown",
models: []attrSpec{
{name: "Regal", spec: star(3, colGold, colAmber, 14, motionSpinPulse), permille: 600},
{name: "Noble", spec: star(5, colAmber, colGold, 12, motionSpin), permille: 400},
{name: "Eternal", spec: star(6, colGold, colWhite, 12, motionSpinPulse), crafted: true, rarity: domain.StarGiftRarityLegendary},
},
patterns: []attrSpec{
{name: "Aura", spec: burst(12, colGold, motionPulse), permille: 700},
{name: "Crest", spec: burst(8, colWhite, motionPulse), permille: 300},
},
backdrops: demoBackdrops(),
},
},
}
}