fix: refine purpose practice feedback
This commit is contained in:
@@ -450,37 +450,36 @@ export default function ProcessPurposePracticePage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<main className="mx-auto w-full max-w-5xl flex-1 px-4 py-8 pb-48">
|
<main className="mx-auto w-full max-w-5xl flex-1 px-4 py-8 pb-48">
|
||||||
<section className="rounded-2xl border border-gray-200 bg-white p-6 shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
<section
|
||||||
<div className="mb-4 flex items-center justify-between gap-4">
|
className={`rounded-2xl border bg-white p-6 shadow-sm transition-all duration-200 dark:bg-gray-800 ${
|
||||||
|
correctFeedback
|
||||||
|
? 'border-green-300 ring-2 ring-green-100 dark:border-green-700 dark:ring-green-900/40'
|
||||||
|
: 'border-gray-200 dark:border-gray-700'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<div className="mb-4 flex flex-wrap items-center justify-between gap-4">
|
||||||
<span className="rounded-full bg-blue-50 px-3 py-1 text-sm font-medium text-blue-700 dark:bg-blue-900/30 dark:text-blue-200">
|
<span className="rounded-full bg-blue-50 px-3 py-1 text-sm font-medium text-blue-700 dark:bg-blue-900/30 dark:text-blue-200">
|
||||||
第 {Math.min(progress.currentIndex + 1, totalCount)} / {totalCount} 题
|
第 {Math.min(progress.currentIndex + 1, totalCount)} / {totalCount} 题
|
||||||
</span>
|
</span>
|
||||||
<span className="text-sm text-gray-400 dark:text-gray-500">
|
<AnimatePresence mode="wait">
|
||||||
主要作用
|
{showAnswer ? (
|
||||||
</span>
|
<motion.span
|
||||||
|
key="answer"
|
||||||
|
initial={{ opacity: 0, y: -4 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
exit={{ opacity: 0, y: -4 }}
|
||||||
|
className="rounded-2xl border-2 border-indigo-300 bg-indigo-50 px-5 py-2 shadow-sm shadow-indigo-100 text-xl font-bold text-indigo-800 dark:border-indigo-500/70 dark:bg-indigo-950/50 dark:text-indigo-100 dark:shadow-none"
|
||||||
|
>
|
||||||
|
{currentItem.name}
|
||||||
|
</motion.span>
|
||||||
|
) : null}
|
||||||
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xl leading-9 text-gray-900 dark:text-gray-100">
|
<p className="text-xl leading-9 text-gray-900 dark:text-gray-100">
|
||||||
{currentItem.purpose}
|
{currentItem.purpose}
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<AnimatePresence>
|
|
||||||
{showAnswer && !isFinished && (
|
|
||||||
<motion.section
|
|
||||||
initial={{ opacity: 0, y: 8 }}
|
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
exit={{ opacity: 0, y: 8 }}
|
|
||||||
className="mt-6 rounded-2xl border border-indigo-100 bg-indigo-50/80 p-5 shadow-sm dark:border-indigo-800 dark:bg-indigo-900/20"
|
|
||||||
>
|
|
||||||
<div className="mb-2 text-sm font-medium text-indigo-600 dark:text-indigo-300">
|
|
||||||
答案
|
|
||||||
</div>
|
|
||||||
<div className="text-2xl font-semibold text-gray-900 dark:text-gray-100">
|
|
||||||
{currentItem.name}
|
|
||||||
</div>
|
|
||||||
</motion.section>
|
|
||||||
)}
|
|
||||||
</AnimatePresence>
|
|
||||||
|
|
||||||
{isFinished && (
|
{isFinished && (
|
||||||
<section className="mt-6 rounded-2xl border border-gray-200 bg-white p-10 text-center shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
<section className="mt-6 rounded-2xl border border-gray-200 bg-white p-10 text-center shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
||||||
@@ -548,18 +547,6 @@ export default function ProcessPurposePracticePage() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AnimatePresence>
|
|
||||||
{correctFeedback && (
|
|
||||||
<motion.div
|
|
||||||
initial={{ opacity: 0, y: -6 }}
|
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
exit={{ opacity: 0, y: -6 }}
|
|
||||||
className="mt-3 text-center text-sm font-medium text-green-600 dark:text-green-300"
|
|
||||||
>
|
|
||||||
回答正确
|
|
||||||
</motion.div>
|
|
||||||
)}
|
|
||||||
</AnimatePresence>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="px-4 py-3 text-sm text-gray-500 dark:text-gray-400">
|
<div className="px-4 py-3 text-sm text-gray-500 dark:text-gray-400">
|
||||||
|
|||||||
Reference in New Issue
Block a user