feat: přidání vzhledu My Little Pony
CI / Generate TypeScript types (push) Successful in 11s
CI / Build server (push) Successful in 30s
CI / Build client (push) Successful in 41s
CI / Playwright E2E tests (push) Successful in 1m53s
CI / Server unit tests (push) Successful in 27s
CI / Build and push Docker image (push) Successful in 57s
CI / Notify (push) Successful in 2s

This commit is contained in:
mates committed 2026-10-12 11:04:54 +02:00
1 parent bf631eb913
commit 93d86fe0a5
10 files changed
+865 -9

No files matched your search

+10
View File
@@ -19,6 +19,16 @@
}
}
// Styl My Little Pony: cutie mark s emoji v kulatém odznaku
.eater-badge-mlp {
display: inline-grid;
place-items: center;
font-size: 17px;
line-height: 1;
background: radial-gradient(circle at 35% 30%, #fff, #f6ecff);
box-shadow: 0 0 0 2px #8e4fd1;
}
// Odznak a jméno drží na jednom řádku (úzký sloupec „Člen" na stránce objednávek)
.user-info:has(.eater-badge) {
display: inline-flex;
+19 -2
View File
@@ -13,20 +13,37 @@ const LEVELS = [
{ minItems: 2, character: 'Special Week', title: 'Úroveň Special Week — pořádný apetit' },
];
/** Úrovně ve stylu My Little Pony — místo portrétu cutie mark (emoji). Seřazeno od nejvyšší úrovně. */
const MLP_LEVELS = [
{ minItems: 3, emoji: '🧁', title: 'Úroveň Pinkie Pie — cupcaků není nikdy dost' },
{ minItems: 2, emoji: '🍎', title: 'Úroveň Applejack — poctivý apetit' },
];
type Props = {
/** Počet jídel/položek, které si strávník vybral či objednal */
items: number,
};
/** Odznak s postavou Umamusume u strávníků s více jídly — jen ve stylu Umamusume. */
/** Odznak s postavou u strávníků s více jídly — jen ve stylech Umamusume a My Little Pony. */
export default function EaterBadge({ items }: Readonly<Props>) {
const isUma = useSettings()?.styleTheme === 'umamusume';
const styleTheme = useSettings()?.styleTheme;
const isUma = styleTheme === 'umamusume';
const [characters, setCharacters] = useState<UmaCharacter[]>([]);
useEffect(() => {
if (isUma) loadUmaCharacters().then(setCharacters);
}, [isUma]);
if (styleTheme === 'mlp') {
const mlpLevel = MLP_LEVELS.find(l => items >= l.minItems);
if (!mlpLevel) return null;
return (
<OverlayTrigger placement="top" overlay={<Tooltip>{mlpLevel.title} ({items} jídla)</Tooltip>}>
<span className="eater-badge eater-badge-mlp" role="img" aria-label={mlpLevel.title}>{mlpLevel.emoji}</span>
</OverlayTrigger>
);
}
const level = LEVELS.find(l => items >= l.minItems);
const character = level && characters.find(c => c.name === level.character);
// Malý odznak potřebuje obličej — portrét (icon), případně kulatý obrázek postavy
+3 -2
View File
@@ -77,7 +77,8 @@ export default function Header({ choices, dayIndex }: Props) {
setQrModalOpen(true);
}
const isUmamusume = settings?.styleTheme === 'umamusume';
// Tematické styly mají pevnou paletu, výběr barvy má smysl jen u jednoduchého stylu
const isSimpleStyle = (settings?.styleTheme ?? 'simple') === 'simple';
const toggleTheme = () => {
const newTheme: ThemePreference = effectiveDark ? 'light' : 'dark';
@@ -158,7 +159,7 @@ export default function Header({ choices, dayIndex }: Props) {
>
<FontAwesomeIcon icon={effectiveDark ? faSun : faMoon} />
</button>
{!isUmamusume && <HuePicker
{isSimpleStyle && <HuePicker
accentHue={settings?.accentHue ?? 142}
isDark={effectiveDark}
onChange={hue => settings?.setAccentHue(hue)}
+99
View File
@@ -161,3 +161,102 @@
85% { opacity: 1; transform: translateY(0); }
100% { opacity: 0; transform: translateY(20px); }
}
// ============================================
// Konfety ve stylu My Little Pony
// ============================================
.confetti-mlp {
filter: drop-shadow(0 3px 3px rgb(0 0 0 / 0.2));
}
.confetti-mlp-badge {
padding: 4px 14px;
border-radius: 999px;
border: 3px solid #fff;
color: #fff;
font-family: 'Fredoka', 'Nunito', sans-serif;
font-weight: 700;
font-size: 1.1rem;
white-space: nowrap;
text-shadow: 0 2px 0 rgb(0 0 0 / 0.2);
box-shadow: 0 0 12px rgb(255 255 255 / 0.7), 0 4px 0 rgb(0 0 0 / 0.15);
}
// Duhový nápis „Sonic Rainboom" přes celou obrazovku
.confetti-mlp-banner {
position: absolute;
top: 38%;
left: 50%;
transform: translate(-50%, -50%);
padding: 12px 44px;
font-family: 'Fredoka', 'Nunito', sans-serif;
font-weight: 700;
font-size: clamp(1.8rem, 6.5vw, 3.6rem);
white-space: nowrap;
color: #fff;
border-radius: 999px;
background: linear-gradient(90deg, #ee4144, #f37033, #e3b829, #62bc4d, #1e98d3, #672f89);
border: 5px solid #fff;
text-shadow: 0 3px 0 rgb(0 0 0 / 0.25);
box-shadow: 0 0 30px rgb(236 61 143 / 0.5), 0 8px 0 rgb(0 0 0 / 0.12);
animation: mlp-banner 2s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes mlp-banner {
0% { transform: translate(-50%, -50%) scale(0.2) rotate(-8deg); opacity: 0; }
25% { transform: translate(-50%, -50%) scale(1.08) rotate(0deg); opacity: 1; }
35% { transform: translate(-50%, -50%) scale(1); }
75% { transform: translate(-50%, -50%) scale(1.03); opacity: 1; }
100% { transform: translate(-50%, -160%) scale(0.9); opacity: 0; }
}
// Postava s hláškou — místo obrázku kulatý „cutie mark" s emoji
.confetti-mlp-avatar {
flex: none;
display: grid;
place-items: center;
width: 84px;
height: 84px;
margin-bottom: 8px;
font-size: 46px;
border-radius: 50%;
background: radial-gradient(circle at 35% 30%, #fff, #f6ecff);
border: 4px solid #fff;
box-shadow: 0 0 0 4px var(--mlp-speaker, #8e4fd1), 0 4px 10px rgb(0 0 0 / 0.3);
}
.confetti-mlp-bubble {
position: relative;
margin-bottom: 40px;
padding: 12px 16px;
background: #fff;
color: #2e1f47;
border: 3px solid var(--mlp-speaker, #8e4fd1);
border-radius: 22px;
box-shadow: 0 4px 0 var(--mlp-speaker, #8e4fd1);
font-family: 'Fredoka', 'Nunito', sans-serif;
p {
margin: 0;
font-weight: 600;
font-size: 1rem;
line-height: 1.35;
}
small {
display: block;
margin-top: 4px;
color: var(--mlp-speaker, #8e4fd1);
font-weight: 700;
}
// ocásek bubliny směrem k postavě
&::before {
content: '';
position: absolute;
left: -14px;
bottom: 14px;
border: 8px solid transparent;
border-right: 10px solid var(--mlp-speaker, #8e4fd1);
}
}
+45
View File
@@ -21,6 +21,20 @@ const UMA_EMOJI = ['🐴', '🏇', '🥕', '🏆', '🌸', '✨', '⭐', '🍙',
// Hlášky z fandomu Umamusume (Umapyoi Densetsu, Teio step, hachimī, Golshi, Oguri „okawari"...)
const UMA_BADGES = ['1着!', 'Umazing!', 'Umapyoi!', 'Teio step!', 'Hachimī~', 'Golshi approves', 'Okawari!', 'Pakapaka~', 'ウマい!'];
const UMA_BADGE_COLORS = ['#ff6fa3', '#2e9a3a', '#43b8f0', '#f2a91a'];
const MLP_EMOJI = ['🦄', '🌈', '✨', '⭐', '🧁', '🍎', '🦋', '💎', '🎈', '🎉', '🍰', '💜'];
// Hlášky a narážky z My Little Pony: Friendship is Magic
const MLP_BADGES = ['Friendship is Magic!', '20% cooler!', 'Sonic Rainboom!', 'Yay!', 'Party!', 'Yeehaw!', 'Everypony!', 'Awesome!', 'Darling!', 'Pinkie Promise'];
const MLP_BADGE_COLORS = ['#8e4fd1', '#f06aa6', '#1e98d3', '#f37033', '#e3b829', '#5b4fc9'];
/** Postavy Mane 6 (+ Spike) s „hláškou" po finálním výsledku — místo obrázků cutie mark emoji. */
const MLP_SPEAKERS = [
{ name: 'Twilight Sparkle', emoji: '⭐', color: '#8e4fd1', quote: 'Podle mého seznamu je to ta nejlogičtější volba!' },
{ name: 'Rainbow Dash', emoji: '🌈', color: '#1e98d3', quote: 'Tohle je o 20 % úžasnější než ostatní!' },
{ name: 'Pinkie Pie', emoji: '🎈', color: '#f06aa6', quote: 'Tohle volá po PÁRTY! S dortem! A s cupcaky!' },
{ name: 'Applejack', emoji: '🍎', color: '#f37033', quote: 'Poctivé jídlo pro poctivou práci. Jíhá!' },
{ name: 'Fluttershy', emoji: '🦋', color: '#e3b829', quote: 'Jé… teda, jestli to nevadí… yay.' },
{ name: 'Rarity', emoji: '💎', color: '#5b4fc9', quote: 'Naprosto božská volba, drahoušku!' },
{ name: 'Spike', emoji: '🐉', color: '#62bc4d', quote: 'Zapsáno do svitku a odesláno princezně!' },
];
const DURATION_MS = 6400;
const rand = (min: number, max: number) => min + Math.random() * (max - min);
@@ -107,6 +121,20 @@ function buildPieces(theme: WheelTheme, big: boolean, images: UmaImage[]): Piece
}));
}
const count = big ? 50 : 24;
if (theme === 'mlp') {
return Array.from({ length: count }, (_, id) => {
const base: React.CSSProperties = {
...launchStyle(pick(LAUNCHES)),
['--r1' as any]: `${rand(-25, 25)}deg`,
['--r2' as any]: `${rand(-40, 40)}deg`,
};
if (Math.random() < 0.35) {
return { id, className: 'confetti-mlp confetti-mlp-badge', content: pick(MLP_BADGES),
style: { ...base, background: pick(MLP_BADGE_COLORS) } };
}
return { id, className: 'confetti-mlp confetti-uma-emoji', style: { ...base, fontSize: `${rand(28, 52)}px` }, content: pick(MLP_EMOJI) };
});
}
return Array.from({ length: count }, (_, id) => {
const roll = Math.random();
// Samolepky se tolik netočí, ať jsou čitelné
@@ -157,11 +185,19 @@ export default function WheelConfetti({ theme, burstKey, big = false }: Readonly
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [burstKey]);
// MLP: hlášku pronese náhodná postava z Mane 6
const mlpSpeaker = useMemo(
() => theme === 'mlp' && big ? pick(MLP_SPEAKERS) : undefined,
// eslint-disable-next-line react-hooks/exhaustive-deps
[burstKey],
);
if (!active || window.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return null;
return createPortal(
<div className={`wheel-confetti wheel-confetti-${theme}`} key={burstKey} aria-hidden>
{theme === 'umamusume' && big && <div className="confetti-uma-banner">🏆 1着 🏆</div>}
{theme === 'mlp' && big && <div className="confetti-mlp-banner">🌈 Sonic Rainboom! 🌈</div>}
{pieces.map(p => <span key={p.id} className={p.className} style={p.style}>{p.content}</span>)}
{speaker && (
<div className="confetti-uma-voice">
@@ -172,6 +208,15 @@ export default function WheelConfetti({ theme, burstKey, big = false }: Readonly
</div>
</div>
)}
{mlpSpeaker && (
<div className="confetti-uma-voice confetti-mlp-voice" style={{ ['--mlp-speaker' as any]: mlpSpeaker.color }}>
<span className="confetti-mlp-avatar">{mlpSpeaker.emoji}</span>
<div className="confetti-mlp-bubble">
<p>„{mlpSpeaker.quote}"</p>
<small>— {mlpSpeaker.name}</small>
</div>
</div>
)}
</div>,
document.body,
);
@@ -536,6 +536,244 @@
}
}
// ============================================
// STYL MY LITTLE PONY kola štěstí (dle stylu zvoleného v nastavení).
// Výseče v barvách Mane 6, duhový lem Rainbow Dash, fialová Twilight
// a růžová Pinkie Pie, kulatá „bonbonová" tlačítka.
// ============================================
.spin-wheel-modal.spin-theme-mlp {
--mlp-font: 'Fredoka', 'Nunito', 'Inter', sans-serif;
--mlp-twilight: #8e4fd1;
--mlp-twilight-deep: #6a35b0;
--mlp-twilight-shadow: #4b2287;
--mlp-pinkie: #f06aa6;
--mlp-pinkie-deep: #d6417f;
--mlp-panel: #faf5ff;
--mlp-border: #e5d4f7;
--mlp-text: #2e1f47;
// Mane 6: Twilight, Pinkie, Rainbow Dash, Applejack, Fluttershy, Rarity
--wheel-c0: #9b5fe0;
--wheel-c1: #f06aa6;
--wheel-c2: #1e98d3;
--wheel-c3: #f37033;
--wheel-c4: #e3b829;
--wheel-c5: #5b4fc9;
--wheel-rim: #ec3d8f;
--wheel-hub: #ffffff;
font-family: var(--mlp-font);
.modal-content {
border: 4px solid var(--mlp-border);
border-radius: 26px;
overflow: hidden;
background-color: #fff;
background-image:
radial-gradient(circle at 20% 30%, rgb(142 79 209 / 0.10) 0 2px, transparent 3px),
radial-gradient(circle at 70% 80%, rgb(240 106 166 / 0.10) 0 2px, transparent 3px);
background-size: 120px 120px, 170px 170px;
color: var(--mlp-text);
}
.modal-header {
background:
linear-gradient(90deg, #ee4144 0 16.6%, #f37033 16.6% 33.3%, #fdf6af 33.3% 50%, #62bc4d 50% 66.6%, #1e98d3 66.6% 83.3%, #672f89 83.3% 100%) bottom / 100% 5px no-repeat,
linear-gradient(90deg, var(--mlp-twilight-deep), var(--mlp-twilight) 60%, var(--mlp-pinkie));
border-bottom: none;
h2 {
color: #fff;
font-family: var(--mlp-font);
font-weight: 700;
text-shadow: 0 2px 0 var(--mlp-twilight-shadow);
}
.btn-close {
filter: invert(1) grayscale(1) brightness(2);
opacity: 0.9;
}
}
.modal-footer {
border-top: 3px dotted var(--mlp-border);
}
.spin-steps span {
font-family: var(--mlp-font);
background: #f1e6fc;
color: #9a8ab3;
border-radius: 999px;
padding: 4px 16px;
&.active {
background: linear-gradient(90deg, var(--mlp-twilight-deep), var(--mlp-pinkie));
color: #fff;
}
&.done {
background: var(--mlp-twilight);
color: #fff;
}
}
.btn {
font-family: var(--mlp-font);
font-weight: 600;
border-radius: 999px;
transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
&:active:not(:disabled) {
transform: translateY(3px);
box-shadow: 0 1px 0 var(--mlp-btn-shadow, transparent);
}
}
.btn-primary {
--mlp-btn-shadow: var(--mlp-twilight-shadow);
background: linear-gradient(180deg, #b07ae6, var(--mlp-twilight-deep));
border: none;
box-shadow: 0 4px 0 var(--mlp-twilight-shadow);
color: #fff;
text-shadow: 0 1px 0 rgb(0 0 0 / 0.2);
&:disabled {
background: #c9bdd9;
box-shadow: 0 4px 0 #a99cbc;
}
}
.spin-button {
--mlp-btn-shadow: #a52c63;
background: linear-gradient(180deg, #ff94c4, var(--mlp-pinkie-deep));
box-shadow: 0 5px 0 #a52c63, 0 0 18px rgb(240 106 166 / 0.45);
font-size: 1.15rem;
padding: 12px 36px;
}
.btn-outline-primary {
--mlp-btn-shadow: var(--mlp-border);
background: #fff;
border: 2px solid var(--mlp-twilight);
color: var(--mlp-twilight-deep);
box-shadow: 0 4px 0 var(--mlp-border);
&:hover {
background: #f1e6fc;
color: var(--mlp-twilight-deep);
}
}
.btn-secondary {
--mlp-btn-shadow: var(--mlp-border);
background: #fff;
border: 2px solid var(--mlp-border);
color: var(--mlp-text);
box-shadow: 0 4px 0 var(--mlp-border);
}
.spin-source {
background: #f1e6fc;
> .btn-primary {
background: linear-gradient(180deg, #b07ae6, var(--mlp-twilight-deep));
box-shadow: 0 2px 0 var(--mlp-twilight-shadow) !important;
}
> .btn-outline-primary {
background: transparent;
color: var(--mlp-twilight-deep);
&:hover {
background: #fff;
}
}
}
.spin-result {
font-weight: 700;
strong {
color: var(--mlp-pinkie-deep);
}
}
.spin-options {
background: var(--mlp-panel);
border: 3px solid var(--mlp-border);
border-radius: 18px;
li:hover {
background: #fff0f7;
}
}
.spin-options-header {
border-bottom: 3px solid var(--mlp-border);
color: var(--mlp-twilight-deep);
}
.spin-empty {
border-color: var(--mlp-border);
}
.spin-wheel-pointer {
border-top-color: var(--mlp-pinkie-deep);
}
.spin-seg {
stroke: #fff;
stroke-width: 2.5;
}
.spin-seg-label {
font-family: var(--mlp-font);
font-weight: 700;
}
}
// Tmavý režim — noční obloha princezny Luny
[data-bs-theme="dark"] .spin-wheel-modal.spin-theme-mlp {
--mlp-panel: #1d1745;
--mlp-border: #362c6e;
--mlp-text: #f2edff;
--wheel-hub: #1d1745;
.modal-content {
background-color: #120e2e;
background-image:
radial-gradient(circle at 20% 30%, rgb(255 255 255 / 0.5) 0 1.5px, transparent 2.5px),
radial-gradient(circle at 70% 80%, rgb(183 198 255 / 0.35) 0 1px, transparent 2px);
}
.spin-steps span:not(.active):not(.done) {
background: #282058;
color: #8a7fb5;
}
.btn-outline-primary, .btn-secondary {
background: #1d1745;
color: #f2edff;
}
.spin-source {
background: #282058;
> .btn-outline-primary {
background: transparent;
color: #c2b6e6;
&:hover {
background: #1d1745;
color: #fff;
}
}
}
.spin-options li:hover {
background: #2e2160;
}
}
// Ikona kola se při najetí pootočí
.spin-wheel-icon {
transition: transform 0.4s ease !important;