Skip to content

Commit

Permalink
fix: 打字动画,显示中文不完整
Browse files Browse the repository at this point in the history
  • Loading branch information
SSmJaE committed Mar 23, 2023
1 parent 7cbf1ce commit 27ac4a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/components/TypingAnimation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const TypingAnimationContainer = styled.span<{
background-clip: text ${(props) => (props.showCursor ? ", padding-box" : undefined)};
color: transparent;
background-size: calc(${(props) => props.count} * 1ch) 200%;
background-size: calc(${(props) => props.count} * 2ch) 200%;
background-repeat: no-repeat;
@keyframes typing {
Expand All @@ -74,8 +74,8 @@ const TypingAnimationContainer = styled.span<{
}
}
animation: typing ${(props) => props.duration}ms linear 1 alternate;
animation-timing-function: steps(${(props) => props.count});
animation: typing ${(props) => props.duration * 2}ms linear 1 alternate;
animation-timing-function: steps(${(props) => props.count * 2});
`;

/** 还是纯css实现吧,js的实现,都很卡 */
Expand Down

0 comments on commit 27ac4a8

Please sign in to comment.