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

@xsyx/hanzo-transition

v0.1.0

Published

动画组件

Downloads

8

Readme

Transition 动画

使用指南

在 app.json 或 index.json 中引入组件

"usingComponents": {
  "hanzo-transition": "path/to/hanzot-weapp/dist/transition/index"
}

代码演示

基础用法

将元素包裹在 transition 组件内,在元素展示/隐藏时,会有相应的过渡动画

<hanzo-transition show="{{ show }}" custom-class="block">
  内容
</hanzo-transition>

动画类型

transition 组件内置了多种动画,可以通过name字段指定动画类型

<hanzo-transition name="fade-up" />

高级用法

可以通过外部样式类自定义过渡效果,还可以定制进入和移出的持续时间:

<hanzo-transition
  show="{{ show }}"
  name=""
  duration="{{ { enter: 300, leave: 1000 } }}"
  enter-class="hanzo-enter-class"
  enter-active-class="hanzo-enter-active-class"
  leave-active-class="hanzo-leave-active-class"
  leave-to-class="hanzo-leave-to-class"
/>
.hanzo-enter-active-class,
.hanzo-leave-active-class {
  transition-property: background-color, transform;
}

.hanzo-enter-class,
.hanzo-leave-to-class {
  background-color: red;
  transform: rotate(-360deg) translate3d(-100%, -100%, 0);
}

API

| 参数 | 说明 | 类型 | 默认值 | |-----------|-----------|-----------|-------------| | name | 动画类型 | String | fade| | show | 是否展示组件 | Boolean | true | | duration | 动画时长,单位为毫秒 | Number | Object | 300 | | custom-style | 自定义样式 | String | - |

动画类型

| 名称 | 说明 | |-----------|-----------| | fade | 淡入 | | fade-up | 上滑淡入 | | fade-down | 下滑淡入 | | fade-left | 左滑淡入 | | fade-right | 右滑淡入 | | slide-up | 上滑进入 | | slide-down | 下滑进入 | | slide-left | 左滑进入 | | slide-right | 右滑进入 |

todo 动画类型

  • 缩放对应的效果