time-runner 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -73
- package/README.zh-CN.md +172 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,99 +1,111 @@
|
|
|
1
|
-
|
|
1
|
+
English | [中文](./README.zh-CN.md)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Time / Timer / Countdown Component
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+

|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
基于 React 开发。 主要功能包括:
|
|
9
|
-
- 展示当前时间
|
|
10
|
-
- 展示显示计时(电脑锁屏、笔记本盒盖不中断计时)
|
|
11
|
-
- 展示倒计时
|
|
12
|
-
- 些许动画效果
|
|
7
|
+
Demo:[Live Demo](http://showscene.cn/react-demo/clock)
|
|
13
8
|
|
|
9
|
+
This is a component used to display current time, timer, and countdown.
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
It is built with React and provides the following features:
|
|
12
|
+
- Display the current time
|
|
13
|
+
- Display a timer (continues counting even if the computer is locked or the laptop lid is closed)
|
|
14
|
+
- Display a countdown timer
|
|
15
|
+
- Includes several animation effects
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
16
19
|
```bash
|
|
17
20
|
npm i time-runner
|
|
18
21
|
```
|
|
19
|
-
|
|
22
|
+
or
|
|
20
23
|
```bash
|
|
21
24
|
yarn add time-runner
|
|
22
25
|
```
|
|
23
26
|
|
|
24
|
-
##
|
|
27
|
+
## Import
|
|
25
28
|
```jsx
|
|
26
29
|
import { TimeRunner } from "time-runner";
|
|
27
|
-
// 1.0.3
|
|
30
|
+
// Starting from version 1.0.3, CSS import is no longer required
|
|
28
31
|
// import "time-runner/dist/time-runner.css";
|
|
29
32
|
```
|
|
30
33
|
|
|
31
|
-
##
|
|
34
|
+
## Usage
|
|
32
35
|
```jsx
|
|
33
36
|
|
|
34
|
-
//
|
|
37
|
+
// Current time
|
|
35
38
|
<TimeRunner />
|
|
36
|
-
//
|
|
39
|
+
// Timer
|
|
37
40
|
<TimeRunner showType="count" />
|
|
38
|
-
//
|
|
39
|
-
<TimeRunner showType="
|
|
41
|
+
// Countdown
|
|
42
|
+
<TimeRunner showType="2026-10-31" />
|
|
40
43
|
|
|
41
|
-
//
|
|
44
|
+
// Current time + flip card
|
|
42
45
|
<TimeRunner mode="card" />
|
|
43
|
-
//
|
|
46
|
+
// Timer + flip card
|
|
44
47
|
<TimeRunner mode="card" showType="count" />
|
|
45
|
-
//
|
|
46
|
-
<TimeRunner mode="card" showType="
|
|
48
|
+
// Countdown + flip card
|
|
49
|
+
<TimeRunner mode="card" showType="2026-10-31" />
|
|
47
50
|
|
|
48
|
-
//
|
|
51
|
+
// Current time + horizontal flip
|
|
49
52
|
<TimeRunner mode="cube-h" />
|
|
50
|
-
//
|
|
53
|
+
// Timer + horizontal flip
|
|
51
54
|
<TimeRunner mode="cube-h" showType="count" />
|
|
52
|
-
//
|
|
53
|
-
<TimeRunner mode="cube-h" showType="
|
|
55
|
+
// Countdown + horizontal flip
|
|
56
|
+
<TimeRunner mode="cube-h" showType="2026-10-31" />
|
|
54
57
|
|
|
55
|
-
//
|
|
58
|
+
// Current time + vertical flip
|
|
56
59
|
<TimeRunner mode="cube-v" />
|
|
57
|
-
//
|
|
60
|
+
// Timer + vertical flip
|
|
58
61
|
<TimeRunner mode="cube-v" showType="count" />
|
|
59
|
-
//
|
|
60
|
-
<TimeRunner mode="cube-v" showType="
|
|
62
|
+
// Countdown + vertical flip
|
|
63
|
+
<TimeRunner mode="cube-v" showType="2026-10-31" />
|
|
64
|
+
|
|
65
|
+
// Current time + drift
|
|
66
|
+
<TimeRunner mode="drift" />
|
|
67
|
+
// Timer + drift
|
|
68
|
+
<TimeRunner mode="drift" showType="count" />
|
|
69
|
+
// Countdown + drift
|
|
70
|
+
<TimeRunner mode="drift" showType="2026-10-31" />
|
|
61
71
|
|
|
62
72
|
|
|
63
73
|
```
|
|
64
74
|
|
|
65
|
-
###
|
|
75
|
+
### Component Props
|
|
66
76
|
```jsx
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
77
|
+
/**
|
|
78
|
+
* Display type (default: current time)
|
|
79
|
+
*
|
|
80
|
+
* default: show current time
|
|
81
|
+
* count: timer
|
|
82
|
+
* specific time: countdown
|
|
72
83
|
*/
|
|
73
84
|
showType?: string;
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* cube-
|
|
79
|
-
*
|
|
85
|
+
/**
|
|
86
|
+
* Animation mode
|
|
87
|
+
*
|
|
88
|
+
* card: flip card
|
|
89
|
+
* cube-v: vertical flip
|
|
90
|
+
* cube-h: horizontal flip
|
|
91
|
+
* drift: floating
|
|
80
92
|
*/
|
|
81
93
|
mode?: TransMode;
|
|
82
|
-
/**
|
|
94
|
+
/** Callback function executed when countdown finishes */
|
|
83
95
|
finishCountFn?: Function;
|
|
84
|
-
/**
|
|
96
|
+
/** Component size (default: 40) */
|
|
85
97
|
size?: number;
|
|
86
|
-
/**
|
|
98
|
+
/** Custom class name */
|
|
87
99
|
className?: string;
|
|
88
|
-
/**
|
|
100
|
+
/** Background color */
|
|
89
101
|
bgColor?: string;
|
|
90
|
-
/**
|
|
102
|
+
/** Border color */
|
|
91
103
|
borderColor?: string;
|
|
92
|
-
/**
|
|
104
|
+
/** Text shadow color */
|
|
93
105
|
textShadowColor?: string;
|
|
94
106
|
```
|
|
95
107
|
|
|
96
|
-
###
|
|
108
|
+
### Countdown Date Format
|
|
97
109
|
```
|
|
98
110
|
"YYYY-MM-DD",
|
|
99
111
|
"YYYY/MM/DD",
|
|
@@ -103,56 +115,60 @@ textShadowColor?: string;
|
|
|
103
115
|
"YYYY/MM/DD HH:mm:ss",
|
|
104
116
|
```
|
|
105
117
|
|
|
106
|
-
### React
|
|
118
|
+
### React Version
|
|
107
119
|
```
|
|
108
120
|
"react": ">=16.8.0",
|
|
109
121
|
"react-dom": ">=16.8.0"
|
|
110
122
|
```
|
|
111
123
|
|
|
112
124
|
|
|
113
|
-
#
|
|
125
|
+
# Changelog
|
|
126
|
+
|
|
127
|
+
## [1.1.4] - 2026-03-07
|
|
128
|
+
### Changes
|
|
129
|
+
- Added English README
|
|
114
130
|
|
|
115
131
|
## [1.1.3] - 2026-02-26
|
|
116
|
-
###
|
|
117
|
-
-
|
|
132
|
+
### Changes
|
|
133
|
+
- Fixed an issue where the numeric font was not applied correctly
|
|
118
134
|
|
|
119
135
|
## [1.1.2] - 2026-02-25
|
|
120
|
-
###
|
|
121
|
-
-
|
|
136
|
+
### Changes
|
|
137
|
+
- Updated font and reference paths
|
|
122
138
|
|
|
123
139
|
## [1.1.1] - 2026-02-24
|
|
124
|
-
###
|
|
125
|
-
-
|
|
140
|
+
### Changes
|
|
141
|
+
- Fixed the numeric font reference path issue
|
|
126
142
|
|
|
127
143
|
## [1.1.0] - 2026-02-20
|
|
128
|
-
###
|
|
129
|
-
-
|
|
144
|
+
### Changes
|
|
145
|
+
- Added numeric font
|
|
130
146
|
|
|
131
147
|
## [1.0.5] - 2025-11-16
|
|
132
|
-
###
|
|
133
|
-
-
|
|
148
|
+
### Changes
|
|
149
|
+
- Updated README content
|
|
134
150
|
|
|
135
151
|
## [1.0.4] - 2025-11-16
|
|
136
|
-
###
|
|
137
|
-
-
|
|
152
|
+
### Changes
|
|
153
|
+
- Updated README content
|
|
138
154
|
|
|
139
155
|
## [1.0.3] - 2025-11-16
|
|
140
|
-
###
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
156
|
+
### Changes【Breaking Change】
|
|
157
|
+
- Removed the time-runner/dist/time-runner.css import
|
|
158
|
+
- Added textShadowColor prop
|
|
159
|
+
- Updated README and added demo link
|
|
144
160
|
|
|
145
161
|
|
|
146
162
|
## [1.0.2] - 2025-10-11
|
|
147
|
-
###
|
|
148
|
-
-
|
|
149
|
-
-
|
|
163
|
+
### Changes
|
|
164
|
+
- Added mode = "drift" animation
|
|
165
|
+
- Updated README content
|
|
150
166
|
|
|
151
167
|
|
|
152
168
|
## [1.0.1] - 2025-10-07
|
|
153
|
-
###
|
|
154
|
-
-
|
|
169
|
+
### Changes
|
|
170
|
+
- Updated README content
|
|
155
171
|
|
|
156
172
|
|
|
157
173
|
## [1.0.0] - 2025-10-07
|
|
158
|
-
###
|
|
174
|
+
### Initial release
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
[English](./README.md) | 中文
|
|
2
|
+
|
|
3
|
+
# 时间/计时/倒计时组件
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
地址:[功能演示-demo](http://showscene.cn/react-demo/clock)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
这是一个展示时间、计时、倒计时的组件。
|
|
11
|
+
基于 React 开发。 主要功能包括:
|
|
12
|
+
- 展示当前时间
|
|
13
|
+
- 展示显示计时(电脑锁屏、笔记本盒盖不中断计时)
|
|
14
|
+
- 展示倒计时
|
|
15
|
+
- 些许动画效果
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
```bash
|
|
20
|
+
npm i time-runner
|
|
21
|
+
```
|
|
22
|
+
或者
|
|
23
|
+
```bash
|
|
24
|
+
yarn add time-runner
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 页面引入
|
|
28
|
+
```jsx
|
|
29
|
+
import { TimeRunner } from "time-runner";
|
|
30
|
+
// 1.0.3 版本开始,不需要引入css文件了
|
|
31
|
+
// import "time-runner/dist/time-runner.css";
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 使用说明
|
|
35
|
+
```jsx
|
|
36
|
+
|
|
37
|
+
// 当前时间
|
|
38
|
+
<TimeRunner />
|
|
39
|
+
// 计时器
|
|
40
|
+
<TimeRunner showType="count" />
|
|
41
|
+
// 倒计时
|
|
42
|
+
<TimeRunner showType="2026-10-31" />
|
|
43
|
+
|
|
44
|
+
// 当前时间 + 翻牌效果
|
|
45
|
+
<TimeRunner mode="card" />
|
|
46
|
+
// 计时器 + 翻牌效果
|
|
47
|
+
<TimeRunner mode="card" showType="count" />
|
|
48
|
+
// 倒计时 + 翻牌效果
|
|
49
|
+
<TimeRunner mode="card" showType="2026-10-31" />
|
|
50
|
+
|
|
51
|
+
// 当前时间 + 翻转(左右)
|
|
52
|
+
<TimeRunner mode="cube-h" />
|
|
53
|
+
// 计时器 + 翻转(左右)
|
|
54
|
+
<TimeRunner mode="cube-h" showType="count" />
|
|
55
|
+
// 倒计时 + 翻转(左右)
|
|
56
|
+
<TimeRunner mode="cube-h" showType="2026-10-31" />
|
|
57
|
+
|
|
58
|
+
// 当前时间 + 翻转(上下)
|
|
59
|
+
<TimeRunner mode="cube-v" />
|
|
60
|
+
// 计时器 + 翻转(上下)
|
|
61
|
+
<TimeRunner mode="cube-v" showType="count" />
|
|
62
|
+
// 倒计时 + 翻转(上下)
|
|
63
|
+
<TimeRunner mode="cube-v" showType="2026-10-31" />
|
|
64
|
+
|
|
65
|
+
// 当前时间 + 漂浮
|
|
66
|
+
<TimeRunner mode="drift" />
|
|
67
|
+
// 计时器 + 漂浮
|
|
68
|
+
<TimeRunner mode="drift" showType="count" />
|
|
69
|
+
// 倒计时 + 漂浮
|
|
70
|
+
<TimeRunner mode="drift" showType="2026-10-31" />
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 组件属性(props)
|
|
76
|
+
```jsx
|
|
77
|
+
/**
|
|
78
|
+
* 显示模式,默认:default
|
|
79
|
+
* default: 当前时间
|
|
80
|
+
* count: 计时器
|
|
81
|
+
* 指定时间:倒计时。
|
|
82
|
+
*/
|
|
83
|
+
showType?: string;
|
|
84
|
+
/**
|
|
85
|
+
* 动画模式,
|
|
86
|
+
* card: 卡片
|
|
87
|
+
* cube-v:上下翻转
|
|
88
|
+
* cube-h:左右翻转
|
|
89
|
+
* drift: 漂浮
|
|
90
|
+
*/
|
|
91
|
+
mode?: TransMode;
|
|
92
|
+
/** 倒计时结束后执行的方法 */
|
|
93
|
+
finishCountFn?: Function;
|
|
94
|
+
/** 尺寸,默认40 */
|
|
95
|
+
size?: number;
|
|
96
|
+
/** 自定义样式类名 */
|
|
97
|
+
className?: string;
|
|
98
|
+
/** 背景颜色 */
|
|
99
|
+
bgColor?: string;
|
|
100
|
+
/** 边框颜色 */
|
|
101
|
+
borderColor?: string;
|
|
102
|
+
/** 文字阴影颜色值 */
|
|
103
|
+
textShadowColor?: string;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 倒计时传入日期的格式
|
|
107
|
+
```
|
|
108
|
+
"YYYY-MM-DD",
|
|
109
|
+
"YYYY/MM/DD",
|
|
110
|
+
"YYYY-MM-DD HH:mm",
|
|
111
|
+
"YYYY/MM/DD HH:mm",
|
|
112
|
+
"YYYY-MM-DD HH:mm:ss",
|
|
113
|
+
"YYYY/MM/DD HH:mm:ss",
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### React版本
|
|
117
|
+
```
|
|
118
|
+
"react": ">=16.8.0",
|
|
119
|
+
"react-dom": ">=16.8.0"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
# 更新日志
|
|
124
|
+
|
|
125
|
+
## [1.1.4] - 2026-03-07
|
|
126
|
+
### 更新内容
|
|
127
|
+
- 增加英文版Readme
|
|
128
|
+
|
|
129
|
+
## [1.1.3] - 2026-02-26
|
|
130
|
+
### 更新内容
|
|
131
|
+
- 修复数字字体没有生效的问题
|
|
132
|
+
|
|
133
|
+
## [1.1.2] - 2026-02-25
|
|
134
|
+
### 更新内容
|
|
135
|
+
- 更改字体和引用路径
|
|
136
|
+
|
|
137
|
+
## [1.1.1] - 2026-02-24
|
|
138
|
+
### 更新内容
|
|
139
|
+
- 修复数字字体引用路径的问题
|
|
140
|
+
|
|
141
|
+
## [1.1.0] - 2026-02-20
|
|
142
|
+
### 更新内容
|
|
143
|
+
- 增加数字字体
|
|
144
|
+
|
|
145
|
+
## [1.0.5] - 2025-11-16
|
|
146
|
+
### 更新内容
|
|
147
|
+
- 更新Readme内容
|
|
148
|
+
|
|
149
|
+
## [1.0.4] - 2025-11-16
|
|
150
|
+
### 更新内容
|
|
151
|
+
- 更新Readme内容
|
|
152
|
+
|
|
153
|
+
## [1.0.3] - 2025-11-16
|
|
154
|
+
### 更新内容【Breaking Change】
|
|
155
|
+
- 移除 “time-runner/dist/time-runner.css”文件引入
|
|
156
|
+
- 增加 textShadowColor(文字阴影颜色)属性
|
|
157
|
+
- 更新Readme内容,增加功能演示地址。
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## [1.0.2] - 2025-10-11
|
|
161
|
+
### 更新内容
|
|
162
|
+
- 增加 mode = "drift" 效果
|
|
163
|
+
- 更新Readme内容
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## [1.0.1] - 2025-10-07
|
|
167
|
+
### 更新内容
|
|
168
|
+
- 更新readme内容
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## [1.0.0] - 2025-10-07
|
|
172
|
+
### 首次发布
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "time-runner",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Displaying timer, current time, and countdown with light animation effects(React component)",
|
|
5
5
|
"keywords": ["react", "countdown", "timer", "hook", "card", "less", "animation", "vite"],
|
|
6
6
|
"main": "./dist/time-runner.umd.js",
|