mirror of
https://github.com/RealKai42/qwerty-learner.git
synced 2026-04-05 14:29:04 +08:00
Revert "feat: add animation when visible changes" (#487)
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -25,8 +25,7 @@ yarn-error.log*
|
||||
.eslintcache
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
|
||||
.env
|
||||
stats.html
|
||||
|
||||
.idea
|
||||
.idea
|
||||
@@ -1,21 +0,0 @@
|
||||
.letter {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
transition: transform 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.letter::after {
|
||||
content: '_';
|
||||
display: block;
|
||||
}
|
||||
|
||||
.letter > span {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.letter-visible {
|
||||
transform: translateY(0%);
|
||||
}
|
||||
.letter-hide {
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import s from './Letter.module.css'
|
||||
import { EXPLICIT_SPACE } from '@/constants'
|
||||
import React from 'react'
|
||||
|
||||
@@ -25,13 +24,11 @@ export type LetterProps = {
|
||||
|
||||
const Letter: React.FC<LetterProps> = ({ letter, state = 'normal', visible = true }) => (
|
||||
<span
|
||||
className={`m-0 h-14 overflow-hidden p-0 font-mono text-5xl font-normal ${
|
||||
className={`m-0 p-0 font-mono text-5xl font-normal ${
|
||||
stateClassNameMap[(letter === EXPLICIT_SPACE) as unknown as string][state]
|
||||
} pr-0.8 duration-0 dark:text-opacity-80`}
|
||||
>
|
||||
<span className={`h-28 ${s.letter} ${visible ? s.letterVisible : s.letterHide}`}>
|
||||
<span>{letter}</span>
|
||||
</span>
|
||||
{visible ? letter : '_'}
|
||||
</span>
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user