@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 CHANGED
@@ -6,7 +6,7 @@
6
6
  <h1 align="center">Smart Ticker</h1>
7
7
 
8
8
  <p align="center">
9
- <a href="./README.md">đŸ‡¨đŸ‡ŗ įŽ€äŊ“中文</a> &nbsp;|&nbsp; <strong>đŸ‡Ŧ🇧 English</strong>
9
+ <a href="./README_CN.md">đŸ‡¨đŸ‡ŗ įŽ€äŊ“中文</a> &nbsp;|&nbsp; <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
- | **đŸĻ„ Dual Framework**<br>Provides both React (Hooks) and Vue 3 (Composition) components with a unified API. | **🚀 High Performance**<br>Powered by `RAF`, supporting **Auto-scale**, **Fading Edge**, and **Disable Animation**. |
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 Vue in the `examples` directory.
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
- # Demo runs at http://localhost:5180
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 Source
229
- │ │ ├── Ticker.css # Component Core Styles
230
- │ │ └── vue/
231
- │ │ └── Ticker.vue # Vue Component Source
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
- │ └── vue-demo/ # Vue Demo (Vite + Vue + TS)
238
- ├── public/
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