mirror of
https://github.com/liyunze-coding/RythonDev.git
synced 2026-09-22 15:53:57 +00:00
improved animation
This commit is contained in:
parent
4eb512d2e8
commit
c69c2a7e52
1 changed files with 11 additions and 4 deletions
|
|
@ -88,6 +88,12 @@
|
||||||
async function animateGreeting(greeting: string) {
|
async function animateGreeting(greeting: string) {
|
||||||
for (let i = 0; i < greeting.length; i++) {
|
for (let i = 0; i < greeting.length; i++) {
|
||||||
greetingState = addCharacter(greetingState, greeting);
|
greetingState = addCharacter(greetingState, greeting);
|
||||||
|
|
||||||
|
if (i === greeting.length - 1) {
|
||||||
|
greetingPulse.classList.remove("animate-pulse");
|
||||||
|
greetingPulse.classList.add("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
await sleep(roleInterval);
|
await sleep(roleInterval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -95,10 +101,11 @@
|
||||||
// after window finish loading, call animateRoles()
|
// after window finish loading, call animateRoles()
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await sleep(800);
|
await sleep(800);
|
||||||
animateGreeting(greeting).then(() => {
|
animateGreeting(greeting);
|
||||||
greetingPulse.classList.remove("animate-pulse");
|
// .then(() => {
|
||||||
greetingPulse.classList.add("hidden");
|
// greetingPulse.classList.remove("animate-pulse");
|
||||||
});
|
// greetingPulse.classList.add("hidden");
|
||||||
|
// });
|
||||||
await animateRoles();
|
await animateRoles();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue