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

react-native-marquee-easy

v1.0.6

Published

![swipe.gif](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/3172a2645ef84e9d841e5fc8b1156b58~tplv-k3u1fbpfcp-jj-mark:0:0:0:0:q75.image#?w=590&h=190&s=336401&e=gif&f=237&b=fcfbff)

Downloads

16

Readme

使用react native实现一个跨端的跑马灯轮播组件。

效果如图

swipe.gif

normal.gif

例子

配置

type IProps = {
    direction?: 'horizontal' | 'vertical';
    delay?: number;
    iterations?: number;
    itemDurations?: number;
    containerStyle?: ViewStyle;
    onFinished?: () => void;
    children: any;
    type?: 'swipe' | 'normal';
    swiperItemDurations?: number;
};

demo

import {Marquee} from 'react-native-marquee-easy'
<Marquee
        itemDurations={2000}
        containerStyle={styles.cStyle}
        iterations={count}
        onFinished={() => {
          console.log("test finished ani");
        }}
      >
        <View style={{ backgroundColor: "green" }}>
          <Text style={styles.text}>aaaaa</Text>
        </View>

        <View style={styles.item}>
          <Text style={styles.text}>bbbbbbb</Text>
        </View>
        <View style={{ backgroundColor: "pink" }}>
          <Text style={styles.text}>cccccccccc</Text>
        </View>
      </Marquee>

功能

使用简单 纯js实现不依赖任何第三方库 支持水平垂直两个方向 支持文字&view 两种模式

  1. type=normal 连续不间断滚动
  2. type=swipe 停顿式轮播滚动

原理

  1. 加入输入的内容是【item1, item2, item3】
  2. 首先会在最后一个item后面 再添加一个重复的item1视图变为【item1,item2,item3,item1】
  3. 一次如图滚动 截屏2024-01-22 下午3.13.58.png

截屏2024-01-22 下午3.14.54.png

截屏2024-01-22 下午3.15.05.png

截屏2024-01-22 下午3.15.39.png 4. 当滚动到最后一项时 再将动画重置为初始状态 因为第一项和最后一项相同 所以视图不会刷新 实现无限滚动。

代码仓库

github:react-native-marquee-easy

npm:react-native-marquee-easy