question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `:visible-once` variant

See original GitHub issue

Related to https://github.com/vueuse/motion/issues/25, it would be great to be able to trigger an animation when visible only once. I suggest adding a new variant for that but it could be an attribute like once.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
florian-lefebvrecommented, Nov 10, 2021

Meanwhile, I managed to reproduce this effect with the following (using Nuxt 3):

<!-- components/FadeAnimation.vue -->
<template>
  <div ref="el">
    <slot />
  </div>
</template>

<script lang="ts" setup>
import { useMotion } from "@vueuse/motion";

const el = ref<HTMLElement>();

const { stop } = useMotion(el, {
  initial: {
    opacity: 0,
  },
  visible: {
    opacity: 1,
    transition: {
      delay: 300,
      duration: 500,
      onComplete: () => stop(),
    },
  },
});
</script>

1reaction
HassanZahirniacommented, Mar 8, 2022

Hey @florian-lefebvre 👋 Thanks for bringing up the idea of having such variant. 👍 I was also looking for a way to only apply animations once when they enter the viewport. I know you already did the hard work and made a PR, but I also tried to do one here: #50 I noticed your PR also adds a bunch of different presets so I thought I’m just gonna focus on this 1 single variant which we was discussed here so maybe @Tahul can have an easier time to consider merging this feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Directive Usage | @vueuse/motion
If you specified visible , visible-once or enter variant, the delay will be applied to each of them. Otherwise, the delay will be...
Read more >
M14 Variants [SMALL QOL UPDATE] - mod.io
Heya Heres another variant pack featuring the good old classic M14 alongside ... NOTE: the scope mount only visible once you place attachments...
Read more >
5 Ways to Hide Sold Out Products & Variants on Shopify
Go to your Shopify store admin > Products > Collections · Select a particular collection, and in the section Conditions click on Add...
Read more >
Dynamic Imaging - Kibo Documentation
In the standard image management process, you can add images to the File Manager ... associated with certain product variants without developer theme...
Read more >
iCredits for Data Storage and Analysis | Illumina Analytics
Add To Cart ... App: RNA Amplicon; Input: FASTQ; Output: Somatic variants ... In BaseSpace Sequence Hub, the compute cost in iCredits is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found