From e25760ca6de83719d3f39ea40e428b134b476ae6 Mon Sep 17 00:00:00 2001 From: Nexmoe <16796652+nexmoe@users.noreply.github.com> Date: Sun, 12 May 2024 18:57:21 +0800 Subject: [PATCH] feat(Poe): add animation when component is visible (#132) feat(deps): install @vueuse/nuxt package feat(nuxt): add @vueuse/nuxt module to nuxt config chore(deps): update pnpm.lock file with @vueuse/nuxt package The changes made in this commit are: 1. Added a new `@vueuse/nuxt` package to the project dependencies. 2. Installed the `@vueuse/nuxt` module in the `nuxt.config.ts` file. 3. Updated the `pnpm-lock.yaml` file with the new `@vueuse/nuxt` package and its dependencies. 4. In the `components/custom/Poe.vue` file, added a new ref `elePoe` to the root element and used the `useElementVisibility` hook from `@vueuse/core` to detect when the component becomes visible. 5. Added a new class `animate` that is applied to the component when it becomes visible, which triggers the animation on the `.major` and `.poe div` elements. 6. Paused the animation initially, and started it when the component becomes visible. These changes were made to improve the user experience by adding an animation effect to the Poe component when it comes into view, making the content more engaging and visually appealing. --- components/custom/Poe.vue | 21 ++++++++++++++++++--- nuxt.config.ts | 1 + package.json | 1 + pnpm-lock.yaml | 3 +++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/components/custom/Poe.vue b/components/custom/Poe.vue index 58d7f69..3ef833f 100644 --- a/components/custom/Poe.vue +++ b/components/custom/Poe.vue @@ -1,10 +1,19 @@