fix: adjust current card position
This commit is contained in:
@@ -224,7 +224,8 @@ export default function ProcessPurposePracticePage() {
|
||||
if (!deck) return
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
deck.scrollTo({ top: deck.scrollHeight, behavior: 'smooth' })
|
||||
const targetTop = Math.max(deck.scrollHeight - deck.clientHeight - 96, 0)
|
||||
deck.scrollTo({ top: targetTop, behavior: 'smooth' })
|
||||
})
|
||||
}, [progress.currentIndex])
|
||||
|
||||
@@ -489,7 +490,7 @@ export default function ProcessPurposePracticePage() {
|
||||
isCurrent && correctFeedback
|
||||
? 'border-green-300 shadow-lg shadow-green-100/70 ring-2 ring-green-100 dark:border-green-700 dark:shadow-none dark:ring-green-900/40'
|
||||
: isCurrent
|
||||
? 'border-blue-200 shadow-lg shadow-blue-100/70 ring-1 ring-blue-100 dark:border-blue-800 dark:shadow-none dark:ring-blue-900/30'
|
||||
? 'border-blue-200 shadow-xl shadow-blue-100/80 ring-2 ring-blue-100 dark:border-blue-800 dark:shadow-none dark:ring-blue-900/30'
|
||||
: 'border-gray-100 shadow-sm dark:border-gray-800'
|
||||
}`}
|
||||
>
|
||||
@@ -531,7 +532,7 @@ export default function ProcessPurposePracticePage() {
|
||||
|
||||
<p
|
||||
className={`leading-9 text-gray-900 dark:text-gray-100 ${
|
||||
isCurrent ? 'text-2xl font-medium' : 'text-base'
|
||||
isCurrent ? 'text-xl' : 'text-base'
|
||||
}`}
|
||||
>
|
||||
{item.purpose}
|
||||
|
||||
Reference in New Issue
Block a user