@tombcato/smart-ticker 1.2.1 â 1.2.2
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 +41 -13
- package/dist/svelte.cjs +684 -0
- package/dist/svelte.cjs.map +1 -0
- package/dist/svelte.d.ts +16 -0
- package/dist/svelte.js +684 -0
- package/dist/svelte.js.map +1 -0
- package/package.json +19 -3
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<h1 align="center">Smart Ticker</h1>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="./
|
|
9
|
+
<a href="./README_CN.md">đ¨đŗ įŽäŊ䏿</a> | <strong>đŦđ§ English</strong>
|
|
10
10
|
</p>
|
|
11
11
|
High-Performance Text Diff Motion Component based on Levenshtein diff algorithm. Make your text flow like water. <a href="https://tombcato.github.io/smart-ticker/?lang=en">Live Demo ></a> <br />
|
|
12
12
|
<p align="center">
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
<p align="center">
|
|
26
26
|
<img src="https://img.shields.io/badge/React-18+-61DAFB?logo=react" alt="React" />
|
|
27
27
|
<img src="https://img.shields.io/badge/Vue-3+-4FC08D?logo=vuedotjs" alt="Vue" />
|
|
28
|
+
<img src="https://img.shields.io/badge/Svelte-4+-FF3E00?logo=svelte" alt="Svelte" />
|
|
28
29
|
<img src="https://img.shields.io/badge/TypeScript-5+-3178C6?logo=typescript" alt="TypeScript" />
|
|
29
30
|
<img src="https://img.shields.io/npm/v/@tombcato/smart-ticker?color=cb3837&logo=npm" alt="npm" />
|
|
30
31
|
</p>
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
| :--- | :--- |
|
|
35
36
|
| **đ Multi-Charset Support**<br>Supports CJK, Numbers, Emojis, and mixed text rolling. Auto-adjusts spacing based on Unicode width. | **đ§ Smart Diff Animation**<br>Uses Levenshtein algorithm to find the shortest change path; identical characters remain static. |
|
|
36
37
|
| **⥠Smooth Interruption**<br>Seamlessly transitions to new targets if the value changes dynamically during animation. | **đ Rich Motion**<br>Built-in variety of easings.Supports custom easing function. Supports `charWidth` fine-tuning. |
|
|
37
|
-
| **đĻ
|
|
38
|
+
| **đĻ Multi-Framework**<br>React (Hooks), Vue 3 (Composition), and Svelte 4+ components with a unified API. | **đ High Performance**<br>Powered by `RAF`, supporting **Auto-scale**, **Fading Edge**, and **Disable Animation**. |
|
|
38
39
|
|
|
39
40
|
## đĻ Installation
|
|
40
41
|
|
|
@@ -121,6 +122,26 @@ const price = ref('73.18');
|
|
|
121
122
|
</template>
|
|
122
123
|
```
|
|
123
124
|
|
|
125
|
+
### Svelte
|
|
126
|
+
|
|
127
|
+
```svelte
|
|
128
|
+
<script>
|
|
129
|
+
// NPM Usage
|
|
130
|
+
import { Ticker } from '@tombcato/smart-ticker/svelte';
|
|
131
|
+
import '@tombcato/smart-ticker/style.css';
|
|
132
|
+
|
|
133
|
+
let price = 73.18;
|
|
134
|
+
</script>
|
|
135
|
+
|
|
136
|
+
<Ticker
|
|
137
|
+
value={price.toFixed(2)}
|
|
138
|
+
duration={800}
|
|
139
|
+
easing="easeInOut"
|
|
140
|
+
charWidth={1}
|
|
141
|
+
characterLists={['0123456789.,']}
|
|
142
|
+
/>
|
|
143
|
+
```
|
|
144
|
+
|
|
124
145
|
### đ
Customization
|
|
125
146
|
|
|
126
147
|
#### Custom Fonts
|
|
@@ -199,7 +220,7 @@ Presets.CURRENCY // '0123456789.,'
|
|
|
199
220
|
|
|
200
221
|
## đģ Running Demos
|
|
201
222
|
|
|
202
|
-
This project includes complete NPM-based user examples for React and
|
|
223
|
+
This project includes complete NPM-based user examples for React, Vue, and Svelte in the `examples` directory.
|
|
203
224
|
|
|
204
225
|
### Start React Demo
|
|
205
226
|
|
|
@@ -207,7 +228,6 @@ This project includes complete NPM-based user examples for React and Vue in the
|
|
|
207
228
|
cd examples/react-demo
|
|
208
229
|
npm install
|
|
209
230
|
npm run dev
|
|
210
|
-
# Demo runs at http://localhost:5179
|
|
211
231
|
```
|
|
212
232
|
|
|
213
233
|
### Start Vue Demo
|
|
@@ -216,7 +236,14 @@ npm run dev
|
|
|
216
236
|
cd examples/vue-demo
|
|
217
237
|
npm install
|
|
218
238
|
npm run dev
|
|
219
|
-
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Start Svelte Demo
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
cd examples/svelte-demo
|
|
245
|
+
npm install
|
|
246
|
+
npm run dev
|
|
220
247
|
```
|
|
221
248
|
|
|
222
249
|
## đ Project Structure
|
|
@@ -225,18 +252,19 @@ npm run dev
|
|
|
225
252
|
smart-ticker/
|
|
226
253
|
âââ src/
|
|
227
254
|
â âââ components/
|
|
228
|
-
â â âââ Ticker.tsx # React Component
|
|
229
|
-
â â âââ Ticker.css #
|
|
230
|
-
â â
|
|
231
|
-
â â
|
|
255
|
+
â â âââ Ticker.tsx # React Component
|
|
256
|
+
â â âââ Ticker.css # Core Styles
|
|
257
|
+
â â âââ vue/
|
|
258
|
+
â â â âââ Ticker.vue # Vue Component
|
|
259
|
+
â â âââ svelte/
|
|
260
|
+
â â âââ Ticker.svelte # Svelte Component
|
|
232
261
|
â âââ core/
|
|
233
262
|
â â âââ TickerCore.ts # Core Logic (Levenshtein diff algo)
|
|
234
263
|
â âââ ...
|
|
235
264
|
âââ examples/ # Standalone Example Projects
|
|
236
265
|
â âââ react-demo/ # React Demo (Vite + React + TS)
|
|
237
|
-
â
|
|
238
|
-
|
|
239
|
-
â âââ vue-demo.html # Single File CDN Demo
|
|
266
|
+
â âââ vue-demo/ # Vue Demo (Vite + Vue + TS)
|
|
267
|
+
â âââ svelte-demo/ # Svelte Demo (Vite + Svelte + TS)
|
|
240
268
|
âââ package.json
|
|
241
269
|
```
|
|
242
270
|
|
|
@@ -252,7 +280,7 @@ smart-ticker/
|
|
|
252
280
|
|
|
253
281
|
- **Build Tool**: Vite
|
|
254
282
|
- **Language**: TypeScript
|
|
255
|
-
- **Frameworks**: React 18 / Vue 3
|
|
283
|
+
- **Frameworks**: React 18 / Vue 3 / Svelte 4+
|
|
256
284
|
- **Styling**: CSS Variables + Responsive Design
|
|
257
285
|
|
|
258
286
|
## đ Changelog
|