Smoother tab switch (no dark flash), full welcome sentence, chapter banner sticky and chip centered, floating math glyphs in headers, quiz reaction emojis
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -241,7 +241,7 @@ export function QuizScreen({ lessonId, nodeId }: { lessonId?: number; nodeId?: s
|
||||
const bubble = !answer
|
||||
? 'جوابِ درست رو انتخاب کن!'
|
||||
: answer.correct
|
||||
? 'آفرین! درست بود ⚡'
|
||||
? 'آفرین! درست بود'
|
||||
: outOfHearts
|
||||
? 'قلبهات تموم شد؛ یه کم استراحت کنیم.'
|
||||
: 'اشکالی نداره، جوابِ درست رو ببین.';
|
||||
@@ -282,6 +282,7 @@ export function QuizScreen({ lessonId, nodeId }: { lessonId?: number; nodeId?: s
|
||||
!answer ? 'border-line bg-white text-indigo' : answer.correct ? 'border-green-200 bg-green-50 text-green-700' : 'border-purple-200 bg-purple-50 text-[#5B3FA0]'
|
||||
}`}>
|
||||
{bubble}
|
||||
{answer && <Reaction key={question.id} correct={answer.correct} seed={index} />}
|
||||
{answer?.correct && answer.xpEarned > 0 && (
|
||||
<motion.span
|
||||
key={question.id}
|
||||
@@ -518,3 +519,21 @@ function ReportSheet({ open, questionId, onClose }: { open: boolean; questionId:
|
||||
</Sheet>
|
||||
);
|
||||
}
|
||||
|
||||
/** شکلکِ کوچکِ بعد از جواب؛ هر سوال یکی از مجموعه، با یک تکانِ کوتاه. فقط ایموجی و transform. */
|
||||
const WIN = ['🧠', '💪', '🎯', '⚡', '🤩'];
|
||||
const MISS = ['🤔', '💡', '📐'];
|
||||
function Reaction({ correct, seed }: { correct: boolean; seed: number }) {
|
||||
const set = correct ? WIN : MISS;
|
||||
return (
|
||||
<motion.span
|
||||
aria-hidden
|
||||
className="mr-1.5 inline-block"
|
||||
initial={{ scale: 0.4, rotate: 0 }}
|
||||
animate={{ scale: 1, rotate: [0, -14, 14, -8, 8, 0] }}
|
||||
transition={{ duration: 0.6, ease: 'easeOut' }}
|
||||
>
|
||||
{set[seed % set.length]}
|
||||
</motion.span>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user