-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: slide text speed and autoplay speed
- Loading branch information
1 parent
3534bdd
commit 3be26d1
Showing
7 changed files
with
36 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
import { playSpeed } from '@/store/userDataInterface'; | ||
|
||
export function useTextDelay(type: playSpeed) { | ||
switch (type) { | ||
case playSpeed.slow: | ||
return 80; | ||
case playSpeed.normal: | ||
return 35; | ||
case playSpeed.fast: | ||
return 3; | ||
} | ||
// 范围为 [startRange, step * 100 + startRange] | ||
export function useTextDelay(data: number) { | ||
const startRange = 3; | ||
const step = 1.5; | ||
return startRange + (100 - data) * step; | ||
} | ||
|
||
export function useTextAnimationDuration(type: playSpeed) { | ||
switch (type) { | ||
case playSpeed.slow: | ||
return 800; | ||
case playSpeed.normal: | ||
return 350; | ||
case playSpeed.fast: | ||
return 200; | ||
} | ||
// 范围为 [startRange, step * 100 + startRange] | ||
export function useTextAnimationDuration(data: number) { | ||
const startRange = 200; | ||
const step = 15; | ||
return startRange + (100 - data) * step; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters