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

anima-focuser

v2.0.0

Published

Focus transform for Anima.

Downloads

3

Readme

anima-focuser spm version


焦点转换组件


Focuser 继承了 widget,可使用其中 baseclasseventsattributeaspect 的属性和方法。

72帧大片

preview

安装

$ spm install anima-focuser --save

快速使用

HTML:

<div class="focuser-wrapper" id="J-wrapper1">
    <div class="focuser-box">
        <div class="focuser-card">Pink</div>
        <div class="focuser-card">Yellow</div>
        <div class="focuser-card">Green</div>
        <div class="focuser-card">Red</div>
        <div class="focuser-card">Blue</div>
    </div>
</div>

Javascript:

var Focuser = require('anima-focuser');

var focuser = new Focuser({
    wrapper: '#J-wrapper1'
});

API

属性

wrapper String DOMElement Zepto-object

包裹的层,可以是选择器、DOM 节点或者 Yocto(Zepto) 对象

trigger String

滑动触发区域,只有两个值可选,wrapper 代表最外层,focus 代表当前焦点卡片,默认是 wrapper

注意:选择 focus 后,将只在当前焦点卡片上滑动才会有效果

minDisplacement Number

触发滑动的最小距离,默认 30 像素

如果想要移动任意距离时就产生滑动效果,可以设置为 0

方法

forward

向前翻到下一个焦点卡片 focuser.forward()

backward

向后翻到上一个焦点卡片

getCurrent

获得当前焦点的卡片

事件

beforeArrange

重排触发之前 focuser.on('beforeArrange', function(e) { ... })

afterArrange

重排触发之后

afterPrevTap

前一卡片轻击后

如果想要在点击前一张卡片之后滑动到焦点卡片位置,可以这样使用:

focuser.on('afterPrevTap', function() {
    focuser.backward();
});

点击后一张卡片同理

afterNextTap

后一卡片轻击后

afterCurrentTap

当前卡片轻击后

afterWrapperTap

包裹外层轻击后

外观

修改卡片宽度、高度、间距、动画参数等,可以按 CSS 类名自定义样式去覆盖原来样式