Skip to content

Commit 2cb51a3

Browse files
committed
Добавление рулетки в 3ю часть игры + теперь работает гифка в лоре Адептов 400
1 parent 3968c9b commit 2cb51a3

3 files changed

Lines changed: 87 additions & 14 deletions

File tree

2.36 MB
Loading

artifacts/game-client/src/apps/adepts-game-3/components/QuestionModal.tsx

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ export function QuestionModal({
265265
const [showFireworks, setShowFireworks] = useState(false);
266266
const [splashDismissed, setSplashDismissed] = useState(false);
267267
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
268+
/** Содержание «Ящика Пандоры» (adepts-game-2 Треш 500) перенесено в Пасхалки 200 */
269+
const isPandora = themeName === "Пасхалки" && points === 200;
268270
const isCelebration = (themeName === "Зацени Look" && points === 500) || (themeName === "Боссы" && points === 200);
269271

270272
const stopTimer = () => {
@@ -367,18 +369,37 @@ export function QuestionModal({
367369
<div className="fixed inset-0 pointer-events-none z-50 flex items-center justify-center p-3 lg:p-6">
368370
<motion.div
369371
initial={{ scale: 0.92, opacity: 0, y: 24 }}
370-
animate={{ scale: 1, opacity: 1, y: 0 }}
372+
animate={isPandora
373+
? { scale: 1, opacity: 1, y: 0, x: [0, -12, 12, -9, 9, -5, 5, -2, 2, 0] }
374+
: { scale: 1, opacity: 1, y: 0 }}
371375
exit={{ scale: 0.92, opacity: 0, y: 24 }}
372-
transition={{ type: "spring", damping: 26, stiffness: 320 }}
373-
className="w-full max-w-5xl bg-card border-2 border-accent/40 rounded-2xl shadow-[0_0_80px_hsla(280,65%,50%,0.2)] pointer-events-auto overflow-hidden flex flex-col"
376+
transition={isPandora
377+
? { duration: 0.55, times: [0, 0.1, 0.2, 0.3, 0.4, 0.55, 0.7, 0.82, 0.92, 1] }
378+
: { type: "spring", damping: 26, stiffness: 320 }}
379+
className="relative w-full max-w-5xl bg-card border-2 border-accent/40 rounded-2xl shadow-[0_0_80px_hsla(280,65%,50%,0.2)] pointer-events-auto overflow-hidden flex flex-col"
374380
style={{ maxHeight: "94vh" }}
375381
>
382+
{isPandora && stage === "question" && (
383+
<motion.div
384+
className="absolute inset-0 rounded-2xl pointer-events-none z-20"
385+
animate={{
386+
boxShadow: [
387+
"inset 0 0 0px 0px rgba(147,51,234,0), 0 0 0px 0px rgba(147,51,234,0)",
388+
"inset 0 0 55px 12px rgba(147,51,234,0.55), 0 0 60px 12px rgba(147,51,234,0.35)",
389+
"inset 0 0 0px 0px rgba(147,51,234,0), 0 0 0px 0px rgba(147,51,234,0)",
390+
],
391+
}}
392+
transition={{ duration: 1.5, repeat: Infinity, ease: "easeInOut" }}
393+
/>
394+
)}
376395
{/* Header */}
377396
<div className="flex-shrink-0 flex items-center justify-between px-5 lg:px-8 py-3 lg:py-4 border-b border-border/60 bg-muted/20">
378397
<div className="flex items-center gap-4 lg:gap-6">
379398
<div className="flex items-center gap-2 lg:gap-3">
380399
<div>
381-
<div className="text-xs font-bold text-accent uppercase tracking-[0.2em] mb-0.5">
400+
<div className={`text-xs font-bold uppercase tracking-[0.2em] mb-0.5 ${isPandora ? "text-purple-400" : "text-accent"}`}
401+
style={isPandora ? { textShadow: "0 0 10px hsla(280,70%,60%,0.7)" } : undefined}
402+
>
382403
{themeName}
383404
</div>
384405
<div className="font-display text-3xl lg:text-5xl text-primary glow-text leading-none">
@@ -652,7 +673,32 @@ export function QuestionModal({
652673
<div className="flex-shrink-0 px-5 lg:px-8 py-3 lg:py-4 border-t border-border/60 bg-muted/20 grid grid-cols-3 items-center gap-4">
653674
{/* Left */}
654675
<div className="flex justify-start">
655-
{isCelebration && stage === "answer" ? (
676+
{isPandora ? (
677+
<div className="flex items-center gap-2 flex-wrap">
678+
<a
679+
href="https://node-script--gg22last.replit.app/spectate"
680+
target="_blank"
681+
rel="noopener noreferrer"
682+
className="inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-bold uppercase tracking-wider border border-purple-500/60 bg-purple-950/50 text-purple-300 hover:bg-purple-900/60 hover:text-purple-200 transition-colors shadow-[0_0_12px_hsla(280,70%,50%,0.35)]"
683+
>
684+
<ExternalLink className="w-4 h-4" />
685+
Ящик пандоры
686+
</a>
687+
{question.used && (
688+
<Button
689+
variant="outline"
690+
size="sm"
691+
onClick={() => {
692+
onUpdate({ text, answerText, answerUrl, used: false });
693+
onClose();
694+
}}
695+
className="font-bold tracking-wide text-muted-foreground hover:text-foreground"
696+
>
697+
Сделать карточку активной
698+
</Button>
699+
)}
700+
</div>
701+
) : isCelebration && stage === "answer" ? (
656702
<Button
657703
size="lg"
658704
onClick={() => window.open(window.location.origin + "/adepts", "_blank")}
@@ -677,7 +723,7 @@ export function QuestionModal({
677723

678724
{/* Center — timer (only on question stage, not for celebration) */}
679725
<div className="flex justify-center">
680-
{stage === "question" && !isCelebration && !question.splashUrl && (
726+
{stage === "question" && !isCelebration && !isPandora && !question.splashUrl && (
681727
<motion.div
682728
initial={{ opacity: 0, scale: 0.7 }}
683729
animate={{ opacity: 1, scale: 1 }}
@@ -703,7 +749,7 @@ export function QuestionModal({
703749

704750
{/* Right */}
705751
<div className="flex justify-end">
706-
{stage === "question" ? (
752+
{stage === "question" && !isPandora ? (
707753
<Button
708754
size="lg"
709755
onClick={handleShowAnswer}
@@ -712,7 +758,7 @@ export function QuestionModal({
712758
<Eye className="w-5 h-5" />
713759
Показать ответ
714760
</Button>
715-
) : isCelebration ? (
761+
) : isPandora || isCelebration ? (
716762
<Button
717763
variant="secondary"
718764
size="lg"

artifacts/game-client/src/apps/adepts-game-3/hooks/useGameState.ts

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@ const DEFAULT_STATE: GameState = {
165165
text: "В канализации Даларана вы можете найти пасхалку к известному мульт-сериалу. Какому?",
166166
questionUrl: "",
167167
answerText: "Черепашки-ниндзя",
168-
answerUrl: "https://images.cybersport.ru/images/as-is/plain/8e/8ea3f54ef99a2e90ed1ef1f34bcc085f.gif@jpg",
168+
// Без @jpg: иначе CDN отдаёт image/jpeg — один кадр, «гифка не играет»
169+
answerUrl: "https://images.cybersport.ru/images/as-is/plain/8e/8ea3f54ef99a2e90ed1ef1f34bcc085f.gif",
169170
used: false,
170171
},
171172
{
172-
text: "В Зангартопи на одном из грибов можно найти интересное место. К какому произведению может быть эта пасхалка?",
173-
questionUrl: "/easter-200-question.png",
174-
answerText: "Алиса в стране чудес",
175-
answerUrl: gd("1w5McZ0KJAVkchXb5dCLikxLQ_FsjvzEX"),
173+
text: "Ящик Пандоры",
174+
questionUrl: "/halyava-500-question.mp4",
175+
answerText: "нужно сделать либо отдельный таймер на сайте, специально для таких евентов, либо как-то по другому.",
176+
answerUrl: "",
176177
used: false,
177178
},
178179
{
@@ -357,7 +358,7 @@ const DEFAULT_STATE: GameState = {
357358

358359
const STORAGE_KEY = "adepts-game-3-state";
359360
const PLAYERS_KEY = "adepts-shared-players";
360-
const DATA_VERSION = 12;
361+
const DATA_VERSION = 14;
361362
const DATA_VERSION_KEY = "adepts-game-3-data-version";
362363
const ROOM = "adepts-game-3";
363364

@@ -380,6 +381,32 @@ function restoreRaccoonCards(state: GameState): GameState {
380381
}
381382
}
382383

384+
if (nextQuestions[3]?.[1]) {
385+
nextQuestions[3][1] = {
386+
...nextQuestions[3][1],
387+
text: "Ящик Пандоры",
388+
questionUrl: "/halyava-500-question.mp4",
389+
};
390+
}
391+
392+
// Лор Адептов 400 — канонический медиа-файл в public (локальные .png/.jpg → .gif)
393+
if (nextQuestions[0]?.[3]) {
394+
const q = nextQuestions[0][3];
395+
const u = (q.questionUrl || "").toLowerCase();
396+
if (/lor-400-question\.(png|jpg|gif)$/i.test(u) && !u.startsWith("http")) {
397+
nextQuestions[0][3] = { ...q, questionUrl: "/lor-400-question.gif" };
398+
}
399+
}
400+
401+
// Пасхалки 100 — старый URL с @jpg = статичный JPEG
402+
if (nextQuestions[3]?.[0]?.answerUrl?.includes("8ea3f54ef99a2e90ed1ef1f34bcc085f.gif@jpg")) {
403+
const q = nextQuestions[3][0];
404+
nextQuestions[3][0] = {
405+
...q,
406+
answerUrl: "https://images.cybersport.ru/images/as-is/plain/8e/8ea3f54ef99a2e90ed1ef1f34bcc085f.gif",
407+
};
408+
}
409+
383410
return { ...state, questions: nextQuestions };
384411
}
385412

0 commit comments

Comments
 (0)