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-animate-fullpage

v1.1.1

Published

基于animate.css动画库的全屏滚动,适用于vue.js(移动端、pc)项目。

Downloads

10

Readme

vue-animate-fullpage

功能简介

基于animate.css动画库的全屏滚动,适用于vue.js(移动端、pc)项目。

安装

npm install vue-animate-fullpage --save

bug修复

1.1.1版本,修复由于后端生成跳转事件,类型不匹配,页面跳转后动画无效的bug

使用

main.js

在main.js需要引入该插件的css和js文件

import 'vue-animate-fullpage/dist/animate.css'

import VueAnimateFullpage from 'vue-animate-fullpage/dist/index'

Vue.use(VueAnimateFullpage)

Vue.prototype.$fullscreen = VueAnimateFullpage; //全局挂载,方便手动跳转

template

在page-wp容器上加v-fullpage指令,v-fullpage的值是fullpage的配置 在page容器上加v-animate指令,v-animate的值是animate.css的动画效果

<div class="fullscreen">
  <div class="fullscreen-wp" v-fullscreen="opts" ref="fullscreen">
    <div class="page-1 page">
      <p class="part-1" v-animate="{value: 'bounceInLeft'}">1</p>
    </div>
    <div class="page-2 page">
      <p class="part-2" v-animate="{value: 'bounceInRight'}">2</p>
    </div>
    <div class="page-3 page">
      <p class="part-3" v-animate="{value: 'bounceInLeft', delay: 0}">part-3-1</p>
      <p class="part-3" v-animate="{value: 'bounceInRight', delay: 600}" >part-3-2</p>
      <p class="part-3" v-animate="{value: 'zoomInDown', delay: 1200}">part-3-3</p>
    </div>
  </div>
</div>
export default {

  data() {
    return {
      opts: {
        start: 0,
        loop: true,
        direction: "h", 
        duration: 500,
        preventWechat:true,
        beforeChange: (prev, next)=> {
        },
        afterChange:(prev, next)=>{
          
        }
      }
    }
  }
}

手动跳转到指定页:

this.$fullpage.moveTo(0, true) ;


api文档

page

每屏的选择符,默认是 .page。 必须给每页添加该选择符。

start

从第几屏开始,默认是第一屏。

duration

每屏动画的显示时间,切换页面后在duration时间过后才能再次切换下一页,默认为500ms

loop

是否支持循环滚动,默认为false

direction

滚动方向,默认为v,垂直滚动 垂直滚动:v,水平滚动:h

beforeChange

当页面在滑动后触发beforeChange 包含两个参数prev和next,指当前页面和滑动后页面的index 在beforeChange方法中return false可以阻止页面的滑动

afterChange

当页面滑动到下一页并且过了duration这个时间段后触发 包含两个参数prev和next,指当前页面和滑动后页面的index


v-animate指令的值

下面是一个典型的自定义属性

{
	value:'bounceInLeft',
	delay: 0
}
value

这个属性是一个元素的动画类型, 它的值取决于animate.css。