@ebolax/animated-icons 1.0.1 → 1.0.5
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 +76 -6
- package/dist/animated-icons.bundle.min.css +1 -0
- package/dist/animated-icons.min.css +1 -1
- package/dist/index.html +32 -4
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -8,7 +8,44 @@ The `/dist` folder contains everything you need to consume the library in your o
|
|
|
8
8
|
|
|
9
9
|
## Getting started
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Install and build**
|
|
12
|
+
|
|
13
|
+
Install from npm
|
|
14
|
+
You can install this package from npm and use the built CSS and icons in your project.
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
npm i @ebolax/animated-icons
|
|
18
|
+
```
|
|
19
|
+
After installing, link the stylesheet from `node_modules/ebolax-animated-icons/dist/animated-icons.css` (or the minified `animated-icons.min.css`) and use the icon classes as shown below.
|
|
20
|
+
|
|
21
|
+
If you prefer an even simpler setup with no dependency on the `aic-icons` directory, you can use the bundled CSS file:
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<link rel="stylesheet" href="/path/to/animated-icons.bundle.min.css">
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This includes all icons and necessary styles as embedded assets (using data URLs), so you **do not need to copy or serve the `aic-icons` folder**. Just use the icon classes in your HTML as usual, and everything will work out of the box.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
You can also copy the `animated-icons.css` file and the `aic-icons` directory from the `dist/` folder to any location in your project. Once copied, update the `<link>` tag `href` and the icon asset paths accordingly, and the icons will work independently from your `node_modules` directory.
|
|
31
|
+
|
|
32
|
+
You can also import the CSS directly in your JavaScript or TypeScript project.
|
|
33
|
+
For example, with modern bundlers (like Vite, Webpack, or esbuild):
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
import "@ebolax/animated-icons";
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or, if you are using CommonJS:
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
require("@ebolax/animated-icons");
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This will automatically bundle and apply the icon CSS to your project, without manually adding a `<link>` tag.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
**Manual Install**
|
|
12
49
|
|
|
13
50
|
```bash
|
|
14
51
|
npm install
|
|
@@ -23,13 +60,19 @@ This generates:
|
|
|
23
60
|
- `dist/icons.json` (metadata used by the docs)
|
|
24
61
|
- `dist/index.html` (demo / playground)
|
|
25
62
|
|
|
26
|
-
|
|
63
|
+
**Include the CSS in your app**
|
|
27
64
|
|
|
28
65
|
```html
|
|
29
66
|
<link rel="stylesheet" href="/path/to/animated-icons.css">
|
|
30
67
|
```
|
|
31
68
|
|
|
32
|
-
You can also copy the contents of `animated-icons.css`
|
|
69
|
+
You can also copy the contents of `animated-icons.css` and `aic-icons` directory into your own bundle.
|
|
70
|
+
|
|
71
|
+
If you prefer an even simpler setup with no dependency on the `aic-icons` directory, you can use the bundled CSS file:
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<link rel="stylesheet" href="/path/to/animated-icons.bundle.min.css">
|
|
75
|
+
```
|
|
33
76
|
|
|
34
77
|
---
|
|
35
78
|
|
|
@@ -76,7 +119,7 @@ In the docs (`dist/index.html`), all sidebar items, tabs and icon buttons use th
|
|
|
76
119
|
|
|
77
120
|
---
|
|
78
121
|
|
|
79
|
-
##
|
|
122
|
+
## Advanced Parameters
|
|
80
123
|
|
|
81
124
|
Icons use CSS custom properties
|
|
82
125
|
|
|
@@ -88,12 +131,39 @@ Icons use CSS custom properties
|
|
|
88
131
|
|
|
89
132
|
To change the animation or size for example:
|
|
90
133
|
|
|
91
|
-
```
|
|
134
|
+
```html
|
|
92
135
|
<i class="aic aic-hero-arrow-path" style="--aic-animation: aic-bar;"></i>
|
|
93
|
-
|
|
136
|
+
```
|
|
137
|
+
```html
|
|
94
138
|
<i class="aic aic-hero-arrow-path" style="--aic-size: 32px;"></i>
|
|
95
139
|
```
|
|
96
140
|
|
|
141
|
+
### Available Animation Names
|
|
142
|
+
|
|
143
|
+
You can control the animation applied to any icon by setting the `--aic-animation` CSS variable. The following animation names are available:
|
|
144
|
+
|
|
145
|
+
- **bar**: Grows or pulses upwards from the bottom, suitable for progress, charts, or similar icons.
|
|
146
|
+
- **bell-ring**: Mimics a ringing bell; a subtle shaking from the top, great for notification or alert icons.
|
|
147
|
+
- **dot-appear**: Fades & scales a dot in/out; best for indicators and "active" states.
|
|
148
|
+
- **fade**: Simple fade-in/out effect.
|
|
149
|
+
- **gear**: Rotates as a gear; useful for settings, cog, or machinery icons.
|
|
150
|
+
- **heart-beat**: Pulseslike a beating heart. Use with heart or favorite icons.
|
|
151
|
+
- **mail-flap**: Flips/flaps on the Y axis like an envelope; works best with mail/envelope icons.
|
|
152
|
+
- **nudge-up, nudge-down, nudge-left, nudge-right, nudge-right-up, nudge-right-down, nudge-left-up, nudge-left-down**: Nudges the icon quickly in a given direction. Great for arrows, navigation, or "movement" cues.
|
|
153
|
+
- **page-turn**: Simulates the corner of a page being turned; ideally used with book or document-related icons.
|
|
154
|
+
- **pulse-element**: Scales and pulses the icon, perfect for "live," "online," or attention-grabbing effects.
|
|
155
|
+
- **rocket-lift**: Lifts/launches like a rocket; fun for rocket, navigation, or launch-related icons.
|
|
156
|
+
- **scale-pop**: Quick scale in/out ("pop"); the default, suitable for most icons.
|
|
157
|
+
- **shake**: Vigorous left-right shake, communicating "no," a warning, or error.
|
|
158
|
+
- **spin**: Continuous rotation, as with spinners/loaders or refresh icons.
|
|
159
|
+
|
|
160
|
+
**Example usage:**
|
|
161
|
+
```html
|
|
162
|
+
<i class="aic aic-luc-bell" style="--aic-animation: aic-bell-ring;"></i>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
You can interactively cycle through available animations in the docs (`dist/index.html`) under the "If you want to change the animation" section.
|
|
166
|
+
|
|
97
167
|
You can also start a dev server:
|
|
98
168
|
|
|
99
169
|
```bash
|