npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-animation

v0.1.0

Published

Vue Animation Components

Downloads

32

Readme

Install

npm install vue-animation --save

Usage

  • css animation

    The animation will be triggered when value change to true. When the animation stoped, value will be reset to false. You'd better to use v-model.

    AnimationType:

    AnimationType = {
        BOUNCE: 'bounce',
        FLASH: 'flash',
        PULSE: 'pulse',
        RUBBERBAND: 'rubberBand',
        SHAKE: 'shake',
        HEADSHAKE: 'headShake',
        SWING: 'swing',
        TADA: 'tada',
        WOBBLE: 'wobble',
        JELLO: 'jello',
        HINGE: 'hinge',
    }

    Example:

    <template>
        <div class="demo-height-root" @click="triggerAction">
            <animation-css
                :animation-type="AnimationType.TADA"
                v-model="trigger">
                <p class="animated-body">案例库抵押后泵</p>
            </animation-css>
        </div>
    </template>
      
    /*********************************************/
      
    <script>
        // Load on demand
        import {AnimationCss, AnimationCssType} from 'vue-animation'
      
        export default {
            components: {
                [AnimationCss.name]: AnimationCss,
            },
            data () {
                return {
                    AnimationType: AnimationCssType,
                    trigger: false
                };
            },
            methods: {
                triggerAction() {
                    this.trigger = true;
                }
            }
        }
    </script>
  • transition animation

    Use this animation with v-show or v-if. You need to set animation-in-type and animation-out-type. That's all.

    AnimationType:

    AnimationType = {
        BOUNCEIN: 'bounceIn',
            BOUNCEINDOWN: 'bounceInDown',
            BOUNCEINLEFT: 'bounceInLeft',
            BOUNCEINRIGHT: 'bounceInRight',
            BOUNCEINUP: 'bounceInUp',
            BOUNCEOUT: 'bounceOut',
            BOUNCEOUTDOWN: 'bounceOutDown',
            BOUNCEOUTLEFT: 'bounceOutLeft',
            BOUNCEOUTRIGHT: 'bounceOutRight',
            BOUNCEOUTUP: 'bounceOutUp',
            FADEIN: 'fadeIn',
            FADEINDOWN: 'fadeInDown',
            FADEINDOWNBIG: 'fadeInDownBig',
            FADEINLEFT: 'fadeInLeft',
            FADEINLEFTBIG: 'fadeInLeftBig',
            FADEINRIGHT: 'fadeInRight',
            FADEINRIGHTBIG: 'fadeInRightBig',
            FADEINUP: 'fadeInUp',
            FADEINUPBIG: 'fadeInUpBig',
            FADEOUT: 'fadeOut',
            FADEOUTDOWN: 'fadeOutDown',
            FADEOUTDOWNBIG: 'fadeOutDownBig',
            FADEOUTLEFT: 'fadeOutLeft',
            FADEOUTLEFTBIG: 'fadeOutLeftBig',
            FADEOUTRIGHT: 'fadeOutRight',
            FADEOUTRIGHTBIG: 'fadeOutRightBig',
            FADEOUTUP: 'fadeOutUp',
            FADEOUTUPBIG: 'fadeOutUpBig',
            FLIPINX: 'flipInX',
            FLIPINY: 'flipInY',
            FLIPOUTX: 'flipOutX',
            FLIPOUTY: 'flipOutY',
            LIGHTSPEEDIN: 'lightSpeedIn',
            LIGHTSPEEDOUT: 'lightSpeedOut',
            ROTATEIN: 'rotateIn',
            ROTATEINDOWNLEFT: 'rotateInDownLeft',
            ROTATEINDOWNRIGHT: 'rotateInDownRight',
            ROTATEINUPLEFT: 'rotateInUpLeft',
            ROTATEINUPRIGHT: 'rotateInUpRight',
            ROTATEOUT: 'rotateOut',
            ROTATEOUTDOWNLEFT: 'rotateOutDownLeft',
            ROTATEOUTDOWNRIGHT: 'rotateOutDownRight',
            ROTATEOUTUPLEFT: 'rotateOutUpLeft',
            ROTATEOUTUPRIGHT: 'rotateOutUpRight',
            JACKINTHEBOX: 'jackInTheBox',
            ROLLIN: 'rollIn',
            ROLLOUT: 'rollOut',
            ZOOMIN: 'zoomIn',
            ZOOMINDOWN: 'zoomInDown',
            ZOOMINLEFT: 'zoomInLeft',
            ZOOMINRIGHT: 'zoomInRight',
            ZOOMINUP: 'zoomInUp',
            ZOOMOUT: 'zoomOut',
            ZOOMOUTDOWN: 'zoomOutDown',
            ZOOMOUTLEFT: 'zoomOutLeft',
            ZOOMOUTRIGHT: 'zoomOutRight',
            ZOOMOUTUP: 'zoomOutUp',
            SLIDEINDOWN: 'slideInDown',
            SLIDEINLEFT: 'slideInLeft',
            SLIDEINRIGHT: 'slideInRight',
            SLIDEINUP: 'slideInUp',
            SLIDEOUTDOWN: 'slideOutDown',
            SLIDEOUTLEFT: 'slideOutLeft',
            SLIDEOUTRIGHT: 'slideOutRight',
            SLIDEOUTUP: 'slideOutUp',
    }
    

    Example:

    <template>
        <div class="demo-height-root" @click="rootAction">
            <animation-transition
                :animation-in-type="AnimationType.BOUNCEIN"
                :animation-out-type="AnimationType.BOUNCEOUT">
                <p v-show="show" class="animated-body">案例库抵押后泵</p>
            </animation-transition>
        </div>
    </template>
      
    /*********************************************/
      
    <script>
        import {AnimationVueTransition, AnimationVueTransitionType} from 'vue-animation'
      
        export default {
            components: {
                [AnimationVueTransition.name]: AnimationVueTransition,
            },
            data () {
                return {
                    AnimationType: AnimationVueTransitionType,
                    show: true
                };
            },
            methods: {
                rootAction() {
                    this.show = !this.show;
                }
            }
        }
    </script>
    
  • velocity animation

    1, Animations that can be configured:

    clickAnimation,
    mouseenterAnimation,
    mouseoutAnimation,
    mouseupAnimation,
    mousedownAnimation,
    mouseoverAnimation,
    mouseleaveAnimation,

    Animations above will be triggered by mouse event.

    2, Another animation:

    animation    

    The animation will not be affected by mouse event. You have to manually trigger it like this this.$ref.animationRoot.trigger()

    3, If you set mouseenterWithMousedown to true. Only in the scene below will trigger the mousedownAnimation.

    The mouseenter event hanppens in the inner of animate element and hold it, then move cursor out of the animate element, continues to hold mouse left button down, move cursor enter the animate element, the mouseenter event will be triggered and mouseenterAnimation will be triggered.

    How to configure a animation?

    Read the document of Velocity and example below.

    Example:

    <template>
        <div class="demo-height-root" @click.self="trigger">
            <animation-velocity
                ref="animateRoot"
                :mouseenterWithMousedown="true"
                :animation="animation"
                :mousedownAnimation="mousedownAnimation"
                :mouseupAnimation="mouseupAnimation"
                :mouseenterAnimation="mousedownAnimation"
                :mouseoutAnimation="mouseupAnimation">
                <p class="animated-body">案例库抵押后泵</p>
            </animation-velocity>
        </div>
    </template>
      
    /*********************************************/
      
    <script>
        import {AnimationVelocity} from 'vue-animation'
      
        export default {
            components: {
                [AnimationVelocity.name]: AnimationVelocity,
            },
            data () {
                return {
                    mousedownAnimation: [{
                        animation: {scale: 0.8},
                        options: {duration: 200, queue: false}
                    }],
                    mouseupAnimation: [{
                        animation: {scale: 1},
                        options: {duration: 200, queue: false}
                    }],
                    animation: [{
                        animation: {translateX: '15px', rotateZ: '50deg'},
                        options: {duration: 600}
                    }, {
                        animation: {rotateZ: '100deg'},
                        options: {loop: 2}
                    }, {
                        animation: {
                            rotateZ: '45deg',
                            translateY: '30px',
                            translateX: '30px',
                        }
                    }]
                };
            },
            methods: {
                trigger() {
                    this.$refs.animateRoot.trigger();
                }
            }
        }
    </script>