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 🙏

© 2025 – Pkg Stats / Ryan Hefner

time-runner

v1.0.5

Published

Displaying timer, current time, and countdown with light animation effects(React component)

Downloads

330

Readme

时间/计时/倒计时组件

时间/计时/倒计时组件

地址:功能演示-demo

这是一个展示时间、计时、倒计时的组件。 基于 React 开发。 主要功能包括:

  • 展示当前时间
  • 展示显示计时(电脑锁屏、笔记本盒盖不中断计时)
  • 展示倒计时
  • 些许动画效果

安装

npm i time-runner

或者

yarn add time-runner

页面引入

import { TimeRunner } from "time-runner";
// 1.0.3 版本开始,不需要引入css文件了
// import "time-runner/dist/time-runner.css";

使用说明


// 当前时间
<TimeRunner />
// 计时器
<TimeRunner showType="count" />
// 倒计时
<TimeRunner showType="2025-10-31" />

// 当前时间 + 翻牌效果
<TimeRunner mode="card" />
// 计时器 + 翻牌效果
<TimeRunner mode="card" showType="count" />
// 倒计时 + 翻牌效果
<TimeRunner mode="card" showType="2025-10-31" />

// 当前时间 + 翻转(左右)
<TimeRunner mode="cube-h" />
// 计时器 + 翻转(左右)
<TimeRunner mode="cube-h" showType="count" />
// 倒计时 + 翻转(左右)
<TimeRunner mode="cube-h" showType="2025-10-31" />

// 当前时间 + 翻转(上下)
<TimeRunner mode="cube-v" />
// 计时器 + 翻转(上下)
<TimeRunner mode="cube-v" showType="count" />
// 倒计时 + 翻转(上下)
<TimeRunner mode="cube-v" showType="2025-10-31" />

组件属性(props)

/** 
 * 显示模式,默认:default
 * default: 当前时间  
 * count: 计时器  
 * 指定时间:倒计时。
 */
showType?: string;
/** 
 * 动画模式,
 * card:卡片  
 * cube-v:上下翻转  
 * cube-h:左右翻转
 * drift:漂浮
 */
mode?: TransMode;
/** 倒计时结束后执行的方法 */
finishCountFn?: Function;
/** 尺寸,默认40 */
size?: number;
/** 自定义样式类名 */
className?: string;
/** 背景颜色 */
bgColor?: string;
/** 边框颜色 */
borderColor?: string;
/** 文字阴影颜色值 */
textShadowColor?: string;

倒计时传入日期的格式

"YYYY-MM-DD",
"YYYY/MM/DD",
"YYYY-MM-DD HH:mm",
"YYYY/MM/DD HH:mm",
"YYYY-MM-DD HH:mm:ss",
"YYYY/MM/DD HH:mm:ss",

React版本

"react": ">=16.8.0",
"react-dom": ">=16.8.0"

更新日志

[1.0.5] - 2025-11-16

更新内容

  • 更新Readme内容

[1.0.4] - 2025-11-16

更新内容

  • 更新Readme内容

[1.0.3] - 2025-11-16

更新内容【Breaking Change】

  • 移除 “time-runner/dist/time-runner.css”文件引入
  • 增加 textShadowColor(文字阴影颜色)属性
  • 更新Readme内容,增加功能演示地址。

[1.0.2] - 2025-10-11

更新内容

  • 增加 mode = "drift" 效果
  • 更新Readme内容

[1.0.1] - 2025-10-07

更新内容

  • 更新readme内容

[1.0.0] - 2025-10-07

首次发布