data-anim 0.1.0
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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/data-anim.d.ts +1 -0
- package/dist/data-anim.esm.js +308 -0
- package/dist/data-anim.esm.js.map +1 -0
- package/dist/data-anim.js +3 -0
- package/dist/data-anim.js.map +1 -0
- package/dist/data-anim.min.js +3 -0
- package/dist/data-anim.min.js.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Ryo Matsukawa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# data-anim
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/data-anim)
|
|
4
|
+
[](https://bundlephobia.com/package/data-anim)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Animate with just HTML. Powered by data attributes. Add scroll, load, click, and hover animations to any HTML element without writing a single line of JavaScript.
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<!-- 1. Add the script -->
|
|
13
|
+
<script src="https://unpkg.com/data-anim/dist/data-anim.min.js"></script>
|
|
14
|
+
|
|
15
|
+
<!-- 2. Add data-anim to any element -->
|
|
16
|
+
<h1 data-anim="fadeInUp">Hello World</h1>
|
|
17
|
+
|
|
18
|
+
<!-- 3. That's it! -->
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- 30+ built-in animations (fade, slide, zoom, bounce, rotate, attention, special)
|
|
24
|
+
- 4 triggers: scroll, load, click, hover
|
|
25
|
+
- Stagger support with directional control
|
|
26
|
+
- Anti-FOUC protection (3-layer defense)
|
|
27
|
+
- Responsive controls (disable/swap per device)
|
|
28
|
+
- `prefers-reduced-motion` respected by default
|
|
29
|
+
- Dynamic element support via MutationObserver
|
|
30
|
+
- GPU-accelerated (transform + opacity only)
|
|
31
|
+
- Under 3KB gzipped
|
|
32
|
+
|
|
33
|
+
## Attribute Reference
|
|
34
|
+
|
|
35
|
+
| Attribute | Values | Default | Description |
|
|
36
|
+
|-----------|--------|---------|-------------|
|
|
37
|
+
| `data-anim` | Animation name | — | Animation to play |
|
|
38
|
+
| `data-anim-trigger` | scroll, load, click, hover | scroll | When to trigger |
|
|
39
|
+
| `data-anim-duration` | ms value | 500ms | Animation duration |
|
|
40
|
+
| `data-anim-delay` | ms value | 0 | Delay before animation |
|
|
41
|
+
| `data-anim-easing` | ease, ease-out-expo, ease-out-back, spring | ease | Easing function |
|
|
42
|
+
| `data-anim-offset` | 0-1 | 0.2 | IntersectionObserver threshold |
|
|
43
|
+
| `data-anim-distance` | px value | 30px | Translation distance |
|
|
44
|
+
| `data-anim-once` | (boolean) | false | Play only once |
|
|
45
|
+
| `data-anim-mirror` | (boolean) | false | Reverse on scroll out |
|
|
46
|
+
| `data-anim-fill` | CSS fill-mode | both | Animation fill mode |
|
|
47
|
+
| `data-anim-iteration` | number | 1 | Iteration count |
|
|
48
|
+
| `data-anim-stagger` | ms value | — | Delay between children |
|
|
49
|
+
| `data-anim-stagger-from` | start, end, center, edges | start | Stagger direction |
|
|
50
|
+
| `data-anim-disable` | mobile, tablet, desktop, px | — | Disable on device |
|
|
51
|
+
| `data-anim-mobile` | Animation name | — | Swap animation on mobile |
|
|
52
|
+
|
|
53
|
+
## Animations (30)
|
|
54
|
+
|
|
55
|
+
**Fade:** fadeIn, fadeOut, fadeInUp, fadeInDown, fadeInLeft, fadeInRight
|
|
56
|
+
**Slide:** slideInUp, slideInDown, slideInLeft, slideInRight
|
|
57
|
+
**Zoom:** zoomIn, zoomOut, zoomInUp, zoomInDown
|
|
58
|
+
**Bounce:** bounce, bounceIn, bounceInUp, bounceInDown
|
|
59
|
+
**Attention:** shake, pulse, wobble, flip, swing, rubberBand
|
|
60
|
+
**Rotate:** rotateIn, rotateInDownLeft, rotateInDownRight
|
|
61
|
+
**Special:** blur, clipReveal, typewriter
|
|
62
|
+
|
|
63
|
+
## Comparison
|
|
64
|
+
|
|
65
|
+
| Feature | data-anim | AOS | animate.css |
|
|
66
|
+
|---------|-----------|-----|-------------|
|
|
67
|
+
| No JS to write | Yes | No | No |
|
|
68
|
+
| Bundle size | <3KB | 14KB | 80KB |
|
|
69
|
+
| Scroll trigger | Yes | Yes | No |
|
|
70
|
+
| Click/Hover trigger | Yes | No | Manual |
|
|
71
|
+
| Stagger | Yes | Manual | No |
|
|
72
|
+
| Anti-FOUC | Yes | Yes | No |
|
|
73
|
+
| MutationObserver | Yes | No | No |
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { }
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
var l = "--da-distance,30px", m = "opacity:0", y = "to{opacity:1;transform:none}", T = [
|
|
2
|
+
{
|
|
3
|
+
name: "fadeIn",
|
|
4
|
+
keyframes: "@keyframes da-fadeIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}",
|
|
5
|
+
initialStyle: m
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
name: "fadeOut",
|
|
9
|
+
keyframes: "@keyframes da-fadeOut{from{opacity:1}to{opacity:0}}"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "fadeInUp",
|
|
13
|
+
keyframes: `@keyframes da-fadeInUp{from{opacity:0;transform:translateY(var(${l}))}${y}}`,
|
|
14
|
+
initialStyle: m,
|
|
15
|
+
supportsDistance: !0
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "fadeInDown",
|
|
19
|
+
keyframes: `@keyframes da-fadeInDown{from{opacity:0;transform:translateY(calc(var(${l})*-1))}${y}}`,
|
|
20
|
+
initialStyle: m,
|
|
21
|
+
supportsDistance: !0
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "fadeInLeft",
|
|
25
|
+
keyframes: `@keyframes da-fadeInLeft{from{opacity:0;transform:translateX(calc(var(${l})*-1))}${y}}`,
|
|
26
|
+
initialStyle: m,
|
|
27
|
+
supportsDistance: !0
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "fadeInRight",
|
|
31
|
+
keyframes: `@keyframes da-fadeInRight{from{opacity:0;transform:translateX(var(${l}))}${y}}`,
|
|
32
|
+
initialStyle: m,
|
|
33
|
+
supportsDistance: !0
|
|
34
|
+
}
|
|
35
|
+
], u = "opacity:0", p = "to{opacity:1;transform:none}", C = [
|
|
36
|
+
{
|
|
37
|
+
name: "slideInUp",
|
|
38
|
+
keyframes: `@keyframes da-slideInUp{from{opacity:0;transform:translateY(100%)}${p}}`,
|
|
39
|
+
initialStyle: u
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "slideInDown",
|
|
43
|
+
keyframes: `@keyframes da-slideInDown{from{opacity:0;transform:translateY(-100%)}${p}}`,
|
|
44
|
+
initialStyle: u
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "slideInLeft",
|
|
48
|
+
keyframes: `@keyframes da-slideInLeft{from{opacity:0;transform:translateX(-100%)}${p}}`,
|
|
49
|
+
initialStyle: u
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "slideInRight",
|
|
53
|
+
keyframes: `@keyframes da-slideInRight{from{opacity:0;transform:translateX(100%)}${p}}`,
|
|
54
|
+
initialStyle: u
|
|
55
|
+
}
|
|
56
|
+
], w = "--da-distance,30px", b = "opacity:0", g = "to{opacity:1;transform:none}", M = [
|
|
57
|
+
{
|
|
58
|
+
name: "zoomIn",
|
|
59
|
+
keyframes: `@keyframes da-zoomIn{from{opacity:0;transform:scale(.5)}${g}}`,
|
|
60
|
+
initialStyle: b,
|
|
61
|
+
supportsScale: !0
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "zoomOut",
|
|
65
|
+
keyframes: `@keyframes da-zoomOut{from{opacity:0;transform:scale(1.5)}${g}}`,
|
|
66
|
+
initialStyle: b,
|
|
67
|
+
supportsScale: !0
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "zoomInUp",
|
|
71
|
+
keyframes: `@keyframes da-zoomInUp{from{opacity:0;transform:scale(.9) translateY(var(${w}))}${g}}`,
|
|
72
|
+
initialStyle: b,
|
|
73
|
+
supportsDistance: !0,
|
|
74
|
+
supportsScale: !0
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "zoomInDown",
|
|
78
|
+
keyframes: `@keyframes da-zoomInDown{from{opacity:0;transform:scale(.9) translateY(calc(var(${w})*-1))}${g}}`,
|
|
79
|
+
initialStyle: b,
|
|
80
|
+
supportsDistance: !0,
|
|
81
|
+
supportsScale: !0
|
|
82
|
+
}
|
|
83
|
+
], k = "opacity:0", R = "to{opacity:1;transform:none}", U = [
|
|
84
|
+
{
|
|
85
|
+
name: "bounce",
|
|
86
|
+
keyframes: "@keyframes da-bounce{0%,20%,53%,to{transform:none}40%{transform:translateY(-20px)}70%{transform:translateY(-10px)}}"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "bounceIn",
|
|
90
|
+
keyframes: `@keyframes da-bounceIn{0%{opacity:0;transform:scale(.3)}50%{transform:scale(1.05)}70%{transform:scale(.9)}${R}}`,
|
|
91
|
+
initialStyle: k
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "bounceInUp",
|
|
95
|
+
keyframes: "@keyframes da-bounceInUp{0%{opacity:0;transform:translateY(50px)}60%{opacity:1;transform:translateY(-10px)}80%{transform:translateY(5px)}to{transform:none}}",
|
|
96
|
+
initialStyle: k
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "bounceInDown",
|
|
100
|
+
keyframes: "@keyframes da-bounceInDown{0%{opacity:0;transform:translateY(-50px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}to{transform:none}}",
|
|
101
|
+
initialStyle: k
|
|
102
|
+
}
|
|
103
|
+
], X = [
|
|
104
|
+
{
|
|
105
|
+
name: "shake",
|
|
106
|
+
keyframes: "@keyframes da-shake{0%,to{transform:none}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "pulse",
|
|
110
|
+
keyframes: "@keyframes da-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: "wobble",
|
|
114
|
+
keyframes: "@keyframes da-wobble{0%,to{transform:none}15%{transform:translateX(-15px) rotate(-5deg)}30%{transform:translateX(10px) rotate(3deg)}45%{transform:translateX(-5px) rotate(-2deg)}}"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "flip",
|
|
118
|
+
keyframes: "@keyframes da-flip{from{transform:perspective(400px) rotateY(0)}to{transform:perspective(400px) rotateY(360deg)}}"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "swing",
|
|
122
|
+
keyframes: "@keyframes da-swing{0%,to{transform:none}20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "rubberBand",
|
|
126
|
+
keyframes: "@keyframes da-rubberBand{0%,to{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}}"
|
|
127
|
+
}
|
|
128
|
+
], h = "opacity:0", v = "to{opacity:1;transform:none}", W = [
|
|
129
|
+
{
|
|
130
|
+
name: "rotateIn",
|
|
131
|
+
keyframes: `@keyframes da-rotateIn{from{opacity:0;transform:rotate(-200deg)}${v}}`,
|
|
132
|
+
initialStyle: h
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "rotateInDownLeft",
|
|
136
|
+
keyframes: `@keyframes da-rotateInDownLeft{from{opacity:0;transform:rotate(-90deg)}${v}}`,
|
|
137
|
+
initialStyle: h + ";transform-origin:left bottom"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "rotateInDownRight",
|
|
141
|
+
keyframes: `@keyframes da-rotateInDownRight{from{opacity:0;transform:rotate(90deg)}${v}}`,
|
|
142
|
+
initialStyle: h + ";transform-origin:right bottom"
|
|
143
|
+
}
|
|
144
|
+
], q = "opacity:0", _ = [
|
|
145
|
+
{
|
|
146
|
+
name: "blur",
|
|
147
|
+
keyframes: "@keyframes da-blur{from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}}",
|
|
148
|
+
initialStyle: q + ";filter:blur(10px)"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "clipReveal",
|
|
152
|
+
keyframes: "@keyframes da-clipReveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}",
|
|
153
|
+
initialStyle: "clip-path:inset(0 100% 0 0)"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "typewriter",
|
|
157
|
+
keyframes: "@keyframes da-typewriter{from{max-width:0}to{max-width:100%}}",
|
|
158
|
+
initialStyle: "max-width:0;overflow:hidden;white-space:nowrap"
|
|
159
|
+
}
|
|
160
|
+
], O = [
|
|
161
|
+
...T,
|
|
162
|
+
...C,
|
|
163
|
+
...M,
|
|
164
|
+
...U,
|
|
165
|
+
...X,
|
|
166
|
+
...W,
|
|
167
|
+
..._
|
|
168
|
+
], A = /* @__PURE__ */ new Map();
|
|
169
|
+
O.forEach((t) => A.set(t.name, t));
|
|
170
|
+
function j() {
|
|
171
|
+
return O.map((t) => t.keyframes).join("");
|
|
172
|
+
}
|
|
173
|
+
var $ = {
|
|
174
|
+
offset: 0.2,
|
|
175
|
+
duration: 1600,
|
|
176
|
+
easing: "cubic-bezier(0.25,0.1,0.25,1)"
|
|
177
|
+
}, B = {
|
|
178
|
+
ease: $.easing,
|
|
179
|
+
"ease-out-expo": "cubic-bezier(0.16,1,0.3,1)",
|
|
180
|
+
"ease-out-back": "cubic-bezier(0.34,1.56,0.64,1)",
|
|
181
|
+
spring: "cubic-bezier(0.175,0.885,0.32,1.275)"
|
|
182
|
+
}, x = {
|
|
183
|
+
mobile: 768,
|
|
184
|
+
tablet: 1024
|
|
185
|
+
}, D, Y = () => {
|
|
186
|
+
const t = window.innerWidth;
|
|
187
|
+
return t < x.mobile ? "mobile" : t < x.tablet ? "tablet" : "desktop";
|
|
188
|
+
}, S = (t) => {
|
|
189
|
+
const a = t.getAttribute("data-anim-disable");
|
|
190
|
+
if (!a) return !1;
|
|
191
|
+
if (a === Y()) return !0;
|
|
192
|
+
const e = parseInt(a);
|
|
193
|
+
return !isNaN(e) && window.innerWidth < e;
|
|
194
|
+
}, N = (t) => Y() === "mobile" ? t.getAttribute("data-anim-mobile") : null, F = (t) => {
|
|
195
|
+
window.addEventListener("resize", () => {
|
|
196
|
+
clearTimeout(D), D = setTimeout(t, 250);
|
|
197
|
+
});
|
|
198
|
+
}, E = (t) => /^\d+$/.test(t) ? t + "ms" : t;
|
|
199
|
+
function s(t, a = !1) {
|
|
200
|
+
if (S(t)) {
|
|
201
|
+
t.style.opacity = "1";
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const e = N(t) || t.getAttribute("data-anim") || "";
|
|
205
|
+
if (!A.has(e)) return;
|
|
206
|
+
const n = t.getAttribute("data-anim-distance");
|
|
207
|
+
n && t.style.setProperty("--da-distance", n);
|
|
208
|
+
const r = t.getAttribute("data-anim-easing") || "ease", o = E(t.getAttribute("data-anim-duration") || "" + $.duration), i = a ? "none" : t.getAttribute("data-anim-fill") || "both", d = a ? "-100ms" : E(t.getAttribute("data-anim-delay") || "0");
|
|
209
|
+
t.style.animation = `da-${e} ${o} ${B[r] || r} ${d} ${t.getAttribute("data-anim-iteration") || "1"} ${i}`;
|
|
210
|
+
}
|
|
211
|
+
function f(t, a = !1) {
|
|
212
|
+
if (t.style.animation = "none", a) {
|
|
213
|
+
t.offsetWidth;
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
A.get(t.getAttribute("data-anim") || "")?.initialStyle?.split(";").forEach((e) => {
|
|
217
|
+
const [n, r] = e.split(":");
|
|
218
|
+
n && r && t.style.setProperty(n.trim(), r.trim());
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function K(t) {
|
|
222
|
+
const a = parseFloat(t.getAttribute("data-anim-offset") || "") || $.offset, e = t.hasAttribute("data-anim-once"), n = t.hasAttribute("data-anim-mirror"), r = new IntersectionObserver((o) => {
|
|
223
|
+
o.forEach((i) => {
|
|
224
|
+
i.isIntersecting ? (s(t), e && r.unobserve(t)) : n && t._daInit && f(t);
|
|
225
|
+
}), t._daInit = !0;
|
|
226
|
+
}, { threshold: a });
|
|
227
|
+
t._daObs = r, r.observe(t);
|
|
228
|
+
}
|
|
229
|
+
function P(t) {
|
|
230
|
+
const a = t.getAttribute("data-anim-trigger") || "scroll";
|
|
231
|
+
if (a === "load") document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", () => s(t), { once: !0 }) : s(t);
|
|
232
|
+
else if (a === "click") t.addEventListener("click", () => {
|
|
233
|
+
t.style.animation = "none", t.offsetWidth, s(t);
|
|
234
|
+
});
|
|
235
|
+
else if (a === "hover") {
|
|
236
|
+
let e = !1;
|
|
237
|
+
t.addEventListener("mouseenter", () => {
|
|
238
|
+
e || (e = !0, t.style.animation = "none", t.offsetWidth, s(t, !0), t.addEventListener("animationend", () => {
|
|
239
|
+
e = !1, t.matches(":hover") || f(t, !0);
|
|
240
|
+
}, { once: !0 }));
|
|
241
|
+
}), t.addEventListener("mouseleave", () => {
|
|
242
|
+
e || f(t, !0);
|
|
243
|
+
}), t.addEventListener("focus", () => {
|
|
244
|
+
t.matches(":focus-visible") && !e && (e = !0, t.style.animation = "none", t.offsetWidth, s(t, !0), t.addEventListener("animationend", () => {
|
|
245
|
+
e = !1, t.matches(":focus-visible") || f(t, !0);
|
|
246
|
+
}, { once: !0 }));
|
|
247
|
+
}), t.addEventListener("blur", () => {
|
|
248
|
+
e || f(t, !0);
|
|
249
|
+
});
|
|
250
|
+
} else K(t);
|
|
251
|
+
}
|
|
252
|
+
function H(t) {
|
|
253
|
+
const a = t.getAttribute("data-anim-stagger");
|
|
254
|
+
if (!a) return;
|
|
255
|
+
const e = parseInt(a) || 100, n = t.getAttribute("data-anim-stagger-from") || "start", r = Array.from(t.querySelectorAll("[data-anim]")), o = r.length, i = (o - 1) / 2;
|
|
256
|
+
r.forEach((d, c) => {
|
|
257
|
+
const z = n === "end" ? o - 1 - c : n === "center" ? Math.abs(c - i) : n === "edges" ? i - Math.abs(c - i) : c;
|
|
258
|
+
d.style.animationDelay = `${(parseInt(d.getAttribute("data-anim-delay") || "0") || 0) + z * e}ms`;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function G() {
|
|
262
|
+
new MutationObserver((t) => t.forEach((a) => a.addedNodes.forEach((e) => {
|
|
263
|
+
if (e.nodeType !== 1) return;
|
|
264
|
+
const n = e;
|
|
265
|
+
n.hasAttribute("data-anim") && I(n), n.querySelectorAll?.("[data-anim]").forEach((r) => I(r));
|
|
266
|
+
}))).observe(document.body, {
|
|
267
|
+
childList: !0,
|
|
268
|
+
subtree: !0
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function J() {
|
|
272
|
+
const t = document.createElement("style");
|
|
273
|
+
t.textContent = '[data-anim]:not([data-anim-trigger="hover"]):not([data-anim-trigger="click"]){opacity:0;will-change:transform,opacity}@media(prefers-reduced-motion:reduce){[data-anim]{animation:none!important;opacity:1!important;transform:none!important;filter:none!important;clip-path:none!important}}', (document.head || document.documentElement).appendChild(t);
|
|
274
|
+
}
|
|
275
|
+
var L = !1;
|
|
276
|
+
function Q() {
|
|
277
|
+
if (L) return;
|
|
278
|
+
L = !0;
|
|
279
|
+
const t = document.createElement("style");
|
|
280
|
+
t.textContent = j(), document.head.appendChild(t);
|
|
281
|
+
}
|
|
282
|
+
function I(t) {
|
|
283
|
+
const a = t;
|
|
284
|
+
if (!a._daInit) {
|
|
285
|
+
if (a._daInit = !0, S(t)) {
|
|
286
|
+
t.style.opacity = "1";
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
t.hasAttribute("data-anim-stagger") && H(t), (t.getAttribute("data-anim-trigger") || "scroll") === "scroll" && t.getBoundingClientRect().top < window.innerHeight && !t.getAttribute("data-anim-duration") && t.setAttribute("data-anim-duration", "800"), P(a);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function V() {
|
|
293
|
+
Q();
|
|
294
|
+
const t = document.createElement("div");
|
|
295
|
+
t.innerHTML = "<noscript><style>[data-anim]{opacity:1!important;transform:none!important}</style></noscript>", document.head.appendChild(t.firstChild);
|
|
296
|
+
const a = () => {
|
|
297
|
+
document.querySelectorAll("[data-anim]").forEach(I), G(), setTimeout(() => document.querySelectorAll("[data-anim]").forEach((e) => {
|
|
298
|
+
getComputedStyle(e).opacity === "0" && (e.style.opacity = "1", e.style.transform = "none");
|
|
299
|
+
}), 5e3), F(() => document.querySelectorAll("[data-anim]").forEach((e) => {
|
|
300
|
+
S(e) && (e.style.opacity = "1", e.style.animation = "none");
|
|
301
|
+
}));
|
|
302
|
+
};
|
|
303
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", a, { once: !0 }) : a();
|
|
304
|
+
}
|
|
305
|
+
J();
|
|
306
|
+
V();
|
|
307
|
+
|
|
308
|
+
//# sourceMappingURL=data-anim.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-anim.esm.js","names":[],"sources":["../src/animations/fade.ts","../src/animations/slide.ts","../src/animations/zoom.ts","../src/animations/bounce.ts","../src/animations/attention.ts","../src/animations/rotate.ts","../src/animations/special.ts","../src/animations/index.ts","../src/core/config.ts","../src/core/responsive.ts","../src/core/observer.ts","../src/core/triggers.ts","../src/core/stagger.ts","../src/core/mutation.ts","../src/core/init.ts","../src/index.ts"],"sourcesContent":["import type { AnimationDef } from '../types';\nconst D = '--da-distance,30px',\n O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const fadeAnimations: AnimationDef[] = [\n {\n name: 'fadeIn',\n keyframes: `@keyframes da-fadeIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}`,\n initialStyle: O,\n },\n {\n name: 'fadeOut',\n keyframes: `@keyframes da-fadeOut{from{opacity:1}to{opacity:0}}`,\n },\n {\n name: 'fadeInUp',\n keyframes: `@keyframes da-fadeInUp{from{opacity:0;transform:translateY(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInDown',\n keyframes: `@keyframes da-fadeInDown{from{opacity:0;transform:translateY(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInLeft',\n keyframes: `@keyframes da-fadeInLeft{from{opacity:0;transform:translateX(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInRight',\n keyframes: `@keyframes da-fadeInRight{from{opacity:0;transform:translateX(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const slideAnimations: AnimationDef[] = [\n {\n name: 'slideInUp',\n keyframes: `@keyframes da-slideInUp{from{opacity:0;transform:translateY(100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInDown',\n keyframes: `@keyframes da-slideInDown{from{opacity:0;transform:translateY(-100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInLeft',\n keyframes: `@keyframes da-slideInLeft{from{opacity:0;transform:translateX(-100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInRight',\n keyframes: `@keyframes da-slideInRight{from{opacity:0;transform:translateX(100%)}${T}}`,\n initialStyle: O,\n },\n];\n","import type { AnimationDef } from '../types';\nconst D = '--da-distance,30px',\n O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const zoomAnimations: AnimationDef[] = [\n {\n name: 'zoomIn',\n keyframes: `@keyframes da-zoomIn{from{opacity:0;transform:scale(.5)}${T}}`,\n initialStyle: O,\n supportsScale: true,\n },\n {\n name: 'zoomOut',\n keyframes: `@keyframes da-zoomOut{from{opacity:0;transform:scale(1.5)}${T}}`,\n initialStyle: O,\n supportsScale: true,\n },\n {\n name: 'zoomInUp',\n keyframes: `@keyframes da-zoomInUp{from{opacity:0;transform:scale(.9) translateY(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n supportsScale: true,\n },\n {\n name: 'zoomInDown',\n keyframes: `@keyframes da-zoomInDown{from{opacity:0;transform:scale(.9) translateY(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n supportsScale: true,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const bounceAnimations: AnimationDef[] = [\n {\n name: 'bounce',\n keyframes: `@keyframes da-bounce{0%,20%,53%,to{transform:none}40%{transform:translateY(-20px)}70%{transform:translateY(-10px)}}`,\n },\n {\n name: 'bounceIn',\n keyframes: `@keyframes da-bounceIn{0%{opacity:0;transform:scale(.3)}50%{transform:scale(1.05)}70%{transform:scale(.9)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'bounceInUp',\n keyframes: `@keyframes da-bounceInUp{0%{opacity:0;transform:translateY(50px)}60%{opacity:1;transform:translateY(-10px)}80%{transform:translateY(5px)}to{transform:none}}`,\n initialStyle: O,\n },\n {\n name: 'bounceInDown',\n keyframes: `@keyframes da-bounceInDown{0%{opacity:0;transform:translateY(-50px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}to{transform:none}}`,\n initialStyle: O,\n },\n];\n","import type { AnimationDef } from '../types';\nexport const attentionAnimations: AnimationDef[] = [\n {\n name: 'shake',\n keyframes: `@keyframes da-shake{0%,to{transform:none}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}`,\n },\n {\n name: 'pulse',\n keyframes: `@keyframes da-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}`,\n },\n {\n name: 'wobble',\n keyframes: `@keyframes da-wobble{0%,to{transform:none}15%{transform:translateX(-15px) rotate(-5deg)}30%{transform:translateX(10px) rotate(3deg)}45%{transform:translateX(-5px) rotate(-2deg)}}`,\n },\n {\n name: 'flip',\n keyframes: `@keyframes da-flip{from{transform:perspective(400px) rotateY(0)}to{transform:perspective(400px) rotateY(360deg)}}`,\n },\n {\n name: 'swing',\n keyframes: `@keyframes da-swing{0%,to{transform:none}20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}`,\n },\n {\n name: 'rubberBand',\n keyframes: `@keyframes da-rubberBand{0%,to{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}}`,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const rotateAnimations: AnimationDef[] = [\n {\n name: 'rotateIn',\n keyframes: `@keyframes da-rotateIn{from{opacity:0;transform:rotate(-200deg)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'rotateInDownLeft',\n keyframes: `@keyframes da-rotateInDownLeft{from{opacity:0;transform:rotate(-90deg)}${T}}`,\n initialStyle: O + ';transform-origin:left bottom',\n },\n {\n name: 'rotateInDownRight',\n keyframes: `@keyframes da-rotateInDownRight{from{opacity:0;transform:rotate(90deg)}${T}}`,\n initialStyle: O + ';transform-origin:right bottom',\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0';\nexport const specialAnimations: AnimationDef[] = [\n {\n name: 'blur',\n keyframes: `@keyframes da-blur{from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}}`,\n initialStyle: O + ';filter:blur(10px)',\n },\n {\n name: 'clipReveal',\n keyframes: `@keyframes da-clipReveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}`,\n initialStyle: 'clip-path:inset(0 100% 0 0)',\n },\n {\n name: 'typewriter',\n keyframes: `@keyframes da-typewriter{from{max-width:0}to{max-width:100%}}`,\n initialStyle: 'max-width:0;overflow:hidden;white-space:nowrap',\n },\n];\n","import type { AnimationDef } from '../types';\nimport { fadeAnimations } from './fade';\nimport { slideAnimations } from './slide';\nimport { zoomAnimations } from './zoom';\nimport { bounceAnimations } from './bounce';\nimport { attentionAnimations } from './attention';\nimport { rotateAnimations } from './rotate';\nimport { specialAnimations } from './special';\n\nexport const allAnimations: AnimationDef[] = [\n ...fadeAnimations,\n ...slideAnimations,\n ...zoomAnimations,\n ...bounceAnimations,\n ...attentionAnimations,\n ...rotateAnimations,\n ...specialAnimations,\n];\n\nexport const animationMap = new Map<string, AnimationDef>();\nallAnimations.forEach((a) => animationMap.set(a.name, a));\n\nexport function getKeyframesCSS(): string {\n return allAnimations.map((a) => a.keyframes).join('');\n}\n","export const DEFAULTS = {\n offset: 0.2,\n duration: 1600,\n easing: 'cubic-bezier(0.25,0.1,0.25,1)',\n} as const;\n\nexport const easings: Record<string, string> = {\n ease: DEFAULTS.easing,\n 'ease-out-expo': 'cubic-bezier(0.16,1,0.3,1)',\n 'ease-out-back': 'cubic-bezier(0.34,1.56,0.64,1)',\n spring: 'cubic-bezier(0.175,0.885,0.32,1.275)',\n};\n\nexport const breakpoints = { mobile: 768, tablet: 1024 };\n","import { breakpoints } from './config';\n\nlet dt: ReturnType<typeof setTimeout>;\n\nexport const getDevice = (): string => {\n const w = window.innerWidth;\n return w < breakpoints.mobile ? 'mobile' : w < breakpoints.tablet ? 'tablet' : 'desktop';\n};\n\nexport const isDisabled = (el: HTMLElement): boolean => {\n const d = el.getAttribute('data-anim-disable');\n if (!d) return false;\n if (d === getDevice()) return true;\n const p = parseInt(d);\n return !isNaN(p) && window.innerWidth < p;\n};\n\nexport const getMobileAnim = (el: HTMLElement): string | null =>\n getDevice() === 'mobile' ? el.getAttribute('data-anim-mobile') : null;\n\nexport const onResize = (cb: () => void): void => {\n window.addEventListener('resize', () => {\n clearTimeout(dt);\n dt = setTimeout(cb, 250);\n });\n};\n","import { DEFAULTS, easings } from './config';\nimport { animationMap } from '../animations/index';\nimport { isDisabled, getMobileAnim } from './responsive';\nimport type { DataAnimElement } from '../types';\n\nconst ms = (v: string) => (/^\\d+$/.test(v) ? v + 'ms' : v);\n\nexport function playAnimation(el: DataAnimElement, isHover = false): void {\n if (isDisabled(el)) {\n el.style.opacity = '1';\n return;\n }\n const n = getMobileAnim(el) || el.getAttribute('data-anim') || '';\n if (!animationMap.has(n)) return;\n const dist = el.getAttribute('data-anim-distance');\n if (dist) el.style.setProperty('--da-distance', dist);\n const e = el.getAttribute('data-anim-easing') || 'ease';\n const dur = ms(el.getAttribute('data-anim-duration') || '' + DEFAULTS.duration);\n // For hover: use fill:none (don't apply from-state) + negative delay to skip initial opacity:0 frame\n const fill = isHover ? 'none' : el.getAttribute('data-anim-fill') || 'both';\n const delay = isHover ? '-100ms' : ms(el.getAttribute('data-anim-delay') || '0');\n el.style.animation = `da-${n} ${dur} ${easings[e] || e} ${delay} ${el.getAttribute('data-anim-iteration') || '1'} ${fill}`;\n}\n\nexport function resetAnimation(el: DataAnimElement, forHover = false): void {\n el.style.animation = 'none';\n if (forHover) {\n // For hover: just clear animation so it can replay on next hover\n // Don't apply initial hidden styles — hover elements stay visible\n void el.offsetWidth; // force reflow\n return;\n }\n const s = animationMap.get(el.getAttribute('data-anim') || '');\n s?.initialStyle?.split(';').forEach((r) => {\n const [p, v] = r.split(':');\n if (p && v) el.style.setProperty(p.trim(), v.trim());\n });\n}\n\nexport function createObserver(el: DataAnimElement): void {\n const th = parseFloat(el.getAttribute('data-anim-offset') || '') || DEFAULTS.offset;\n const once = el.hasAttribute('data-anim-once'),\n mirror = el.hasAttribute('data-anim-mirror');\n const o = new IntersectionObserver(\n (es) => {\n es.forEach((e) => {\n if (e.isIntersecting) {\n playAnimation(el);\n if (once) o.unobserve(el);\n } else if (mirror && el._daInit) resetAnimation(el);\n });\n el._daInit = true;\n },\n { threshold: th },\n );\n el._daObs = o;\n o.observe(el);\n}\n","import { createObserver, playAnimation, resetAnimation } from './observer';\nimport type { DataAnimElement } from '../types';\n\nexport function setupTrigger(el: DataAnimElement): void {\n const t = el.getAttribute('data-anim-trigger') || 'scroll';\n if (t === 'load') {\n if (document.readyState === 'loading')\n document.addEventListener('DOMContentLoaded', () => playAnimation(el), {\n once: true,\n });\n else playAnimation(el);\n } else if (t === 'click') {\n el.addEventListener('click', () => {\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el);\n });\n } else if (t === 'hover') {\n let animating = false;\n el.addEventListener('mouseenter', () => {\n if (animating) return;\n animating = true;\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el, true);\n el.addEventListener(\n 'animationend',\n () => {\n animating = false;\n if (!el.matches(':hover')) resetAnimation(el, true);\n },\n { once: true },\n );\n });\n el.addEventListener('mouseleave', () => {\n if (!animating) resetAnimation(el, true);\n });\n el.addEventListener('focus', () => {\n if (el.matches(':focus-visible') && !animating) {\n animating = true;\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el, true);\n el.addEventListener(\n 'animationend',\n () => {\n animating = false;\n if (!el.matches(':focus-visible')) resetAnimation(el, true);\n },\n { once: true },\n );\n }\n });\n el.addEventListener('blur', () => {\n if (!animating) resetAnimation(el, true);\n });\n } else {\n createObserver(el);\n }\n}\n","export function applyStagger(el: HTMLElement): void {\n const v = el.getAttribute('data-anim-stagger');\n if (!v) return;\n const delay = parseInt(v) || 100,\n from = el.getAttribute('data-anim-stagger-from') || 'start';\n const ch = Array.from(el.querySelectorAll<HTMLElement>('[data-anim]')),\n n = ch.length,\n mid = (n - 1) / 2;\n ch.forEach((c, i) => {\n const idx =\n from === 'end'\n ? n - 1 - i\n : from === 'center'\n ? Math.abs(i - mid)\n : from === 'edges'\n ? mid - Math.abs(i - mid)\n : i;\n c.style.animationDelay = `${(parseInt(c.getAttribute('data-anim-delay') || '0') || 0) + idx * delay}ms`;\n });\n}\n","import { initElement } from './init';\n\nexport function startMutationObserver(): void {\n new MutationObserver((ms) =>\n ms.forEach((m) =>\n m.addedNodes.forEach((nd) => {\n if (nd.nodeType !== 1) return;\n const e = nd as HTMLElement;\n if (e.hasAttribute('data-anim')) initElement(e);\n e.querySelectorAll?.('[data-anim]').forEach((c) => initElement(c as HTMLElement));\n }),\n ),\n ).observe(document.body, { childList: true, subtree: true });\n}\n","import { getKeyframesCSS } from '../animations/index';\nimport { setupTrigger } from './triggers';\nimport { applyStagger } from './stagger';\nimport { isDisabled, onResize } from './responsive';\nimport { startMutationObserver } from './mutation';\nimport type { DataAnimElement } from '../types';\n\n// Layer 1: Anti-FOUC\nexport function injectAntifouc(): void {\n const s = document.createElement('style');\n s.textContent =\n '[data-anim]:not([data-anim-trigger=\"hover\"]):not([data-anim-trigger=\"click\"]){opacity:0;will-change:transform,opacity}@media(prefers-reduced-motion:reduce){[data-anim]{animation:none!important;opacity:1!important;transform:none!important;filter:none!important;clip-path:none!important}}';\n (document.head || document.documentElement).appendChild(s);\n}\n\nlet injected = false;\nfunction injectKeyframes(): void {\n if (injected) return;\n injected = true;\n const s = document.createElement('style');\n s.textContent = getKeyframesCSS();\n document.head.appendChild(s);\n}\n\nexport function initElement(el: HTMLElement): void {\n const d = el as DataAnimElement;\n if (d._daInit) return;\n d._daInit = true;\n if (isDisabled(el)) {\n el.style.opacity = '1';\n return;\n }\n if (el.hasAttribute('data-anim-stagger')) applyStagger(el);\n // Above-fold fast reveal\n if (\n (el.getAttribute('data-anim-trigger') || 'scroll') === 'scroll' &&\n el.getBoundingClientRect().top < window.innerHeight &&\n !el.getAttribute('data-anim-duration')\n )\n el.setAttribute('data-anim-duration', '800');\n setupTrigger(d);\n}\n\nexport function init(): void {\n injectKeyframes();\n // Layer 2: noscript fallback (must use innerHTML — dynamic createElement makes noscript content active)\n const ns = document.createElement('div');\n ns.innerHTML =\n '<noscript><style>[data-anim]{opacity:1!important;transform:none!important}</style></noscript>';\n document.head.appendChild(ns.firstChild!);\n\n const run = () => {\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach(initElement);\n startMutationObserver();\n // Layer 3: fallback timeout\n setTimeout(\n () =>\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach((el) => {\n if (getComputedStyle(el).opacity === '0') {\n el.style.opacity = '1';\n el.style.transform = 'none';\n }\n }),\n 5e3,\n );\n // Resize handler\n onResize(() =>\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach((el) => {\n if (isDisabled(el)) {\n el.style.opacity = '1';\n el.style.animation = 'none';\n }\n }),\n );\n };\n\n if (document.readyState === 'loading')\n document.addEventListener('DOMContentLoaded', run, { once: true });\n else run();\n}\n","import { injectAntifouc, init } from './core/init';\n\n// Layer 1: Inject anti-FOUC styles immediately (before DOM ready)\ninjectAntifouc();\n\n// Initialize when ready\ninit();\n"],"mappings":"AACA,IAAM,IAAI,sBACR,IAAI,aACJ,IAAI,gCACO,IAAiC;AAAA,EAC5C;AAAA,IACE,MAAM;AAAA,IACN,WAAW;AAAA,IACX,cAAc;AAAA;EAEhB;AAAA,IACE,MAAM;AAAA,IACN,WAAW;AAAA;EAEb;AAAA,IACE,MAAM;AAAA,IACN,WAAW,kEAAkE,CAAA,MAAO,CAAA;AAAA,IACpF,cAAc;AAAA,IACd,kBAAkB;AAAA;EAEpB;AAAA,IACE,MAAM;AAAA,IACN,WAAW,yEAAyE,CAAA,UAAW,CAAA;AAAA,IAC/F,cAAc;AAAA,IACd,kBAAkB;AAAA;EAEpB;AAAA,IACE,MAAM;AAAA,IACN,WAAW,yEAAyE,CAAA,UAAW,CAAA;AAAA,IAC/F,cAAc;AAAA,IACd,kBAAkB;AAAA;EAEpB;AAAA,IACE,MAAM;AAAA,IACN,WAAW,qEAAqE,CAAA,MAAO,CAAA;AAAA,IACvF,cAAc;AAAA,IACd,kBAAkB;AAAA;GCnChB,IAAI,aACR,IAAI,gCACO,IAAkC;AAAA,EAC7C;AAAA,IACE,MAAM;AAAA,IACN,WAAW,qEAAqE,CAAA;AAAA,IAChF,cAAc;AAAA;EAEhB;AAAA,IACE,MAAM;AAAA,IACN,WAAW,wEAAwE,CAAA;AAAA,IACnF,cAAc;AAAA;EAEhB;AAAA,IACE,MAAM;AAAA,IACN,WAAW,wEAAwE,CAA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AA,MACE,SAAS,iBAA8B,aAAA,EAAe,QAAA,CAAS,MAAO;AACpE,MAAI,EAAW,CAAA,MACb,EAAG,MAAM,UAAU,KACnB,EAAG,MAAM,YAAY;AAAA,MAEvB;AAAA;AAIN,EAAI,SAAS,eAAe,YAC1B,SAAS,iBAAiB,oBAAoB,GAAK,EAAE,MAAM,GAAA,CAAM,IAC9D,EAAA;;AC3EP,EAAA;AAGA,EAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(i){typeof define=="function"&&define.amd?define([],i):i()})(function(){var i="--da-distance,30px",f="opacity:0",c="to{opacity:1;transform:none}",z=[{name:"fadeIn",keyframes:"@keyframes da-fadeIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}",initialStyle:f},{name:"fadeOut",keyframes:"@keyframes da-fadeOut{from{opacity:1}to{opacity:0}}"},{name:"fadeInUp",keyframes:`@keyframes da-fadeInUp{from{opacity:0;transform:translateY(var(${i}))}${c}}`,initialStyle:f,supportsDistance:!0},{name:"fadeInDown",keyframes:`@keyframes da-fadeInDown{from{opacity:0;transform:translateY(calc(var(${i})*-1))}${c}}`,initialStyle:f,supportsDistance:!0},{name:"fadeInLeft",keyframes:`@keyframes da-fadeInLeft{from{opacity:0;transform:translateX(calc(var(${i})*-1))}${c}}`,initialStyle:f,supportsDistance:!0},{name:"fadeInRight",keyframes:`@keyframes da-fadeInRight{from{opacity:0;transform:translateX(var(${i}))}${c}}`,initialStyle:f,supportsDistance:!0}],l="opacity:0",y="to{opacity:1;transform:none}",T=[{name:"slideInUp",keyframes:`@keyframes da-slideInUp{from{opacity:0;transform:translateY(100%)}${y}}`,initialStyle:l},{name:"slideInDown",keyframes:`@keyframes da-slideInDown{from{opacity:0;transform:translateY(-100%)}${y}}`,initialStyle:l},{name:"slideInLeft",keyframes:`@keyframes da-slideInLeft{from{opacity:0;transform:translateX(-100%)}${y}}`,initialStyle:l},{name:"slideInRight",keyframes:`@keyframes da-slideInRight{from{opacity:0;transform:translateX(100%)}${y}}`,initialStyle:l}],w="--da-distance,30px",u="opacity:0",p="to{opacity:1;transform:none}",C=[{name:"zoomIn",keyframes:`@keyframes da-zoomIn{from{opacity:0;transform:scale(.5)}${p}}`,initialStyle:u,supportsScale:!0},{name:"zoomOut",keyframes:`@keyframes da-zoomOut{from{opacity:0;transform:scale(1.5)}${p}}`,initialStyle:u,supportsScale:!0},{name:"zoomInUp",keyframes:`@keyframes da-zoomInUp{from{opacity:0;transform:scale(.9) translateY(var(${w}))}${p}}`,initialStyle:u,supportsDistance:!0,supportsScale:!0},{name:"zoomInDown",keyframes:`@keyframes da-zoomInDown{from{opacity:0;transform:scale(.9) translateY(calc(var(${w})*-1))}${p}}`,initialStyle:u,supportsDistance:!0,supportsScale:!0}],k="opacity:0",M="to{opacity:1;transform:none}",R=[{name:"bounce",keyframes:"@keyframes da-bounce{0%,20%,53%,to{transform:none}40%{transform:translateY(-20px)}70%{transform:translateY(-10px)}}"},{name:"bounceIn",keyframes:`@keyframes da-bounceIn{0%{opacity:0;transform:scale(.3)}50%{transform:scale(1.05)}70%{transform:scale(.9)}${M}}`,initialStyle:k},{name:"bounceInUp",keyframes:"@keyframes da-bounceInUp{0%{opacity:0;transform:translateY(50px)}60%{opacity:1;transform:translateY(-10px)}80%{transform:translateY(5px)}to{transform:none}}",initialStyle:k},{name:"bounceInDown",keyframes:"@keyframes da-bounceInDown{0%{opacity:0;transform:translateY(-50px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}to{transform:none}}",initialStyle:k}],U=[{name:"shake",keyframes:"@keyframes da-shake{0%,to{transform:none}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}"},{name:"pulse",keyframes:"@keyframes da-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}"},{name:"wobble",keyframes:"@keyframes da-wobble{0%,to{transform:none}15%{transform:translateX(-15px) rotate(-5deg)}30%{transform:translateX(10px) rotate(3deg)}45%{transform:translateX(-5px) rotate(-2deg)}}"},{name:"flip",keyframes:"@keyframes da-flip{from{transform:perspective(400px) rotateY(0)}to{transform:perspective(400px) rotateY(360deg)}}"},{name:"swing",keyframes:"@keyframes da-swing{0%,to{transform:none}20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}"},{name:"rubberBand",keyframes:"@keyframes da-rubberBand{0%,to{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}}"}],h="opacity:0",v="to{opacity:1;transform:none}",X=[{name:"rotateIn",keyframes:`@keyframes da-rotateIn{from{opacity:0;transform:rotate(-200deg)}${v}}`,initialStyle:h},{name:"rotateInDownLeft",keyframes:`@keyframes da-rotateInDownLeft{from{opacity:0;transform:rotate(-90deg)}${v}}`,initialStyle:h+";transform-origin:left bottom"},{name:"rotateInDownRight",keyframes:`@keyframes da-rotateInDownRight{from{opacity:0;transform:rotate(90deg)}${v}}`,initialStyle:h+";transform-origin:right bottom"}],W="opacity:0",q=[{name:"blur",keyframes:"@keyframes da-blur{from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}}",initialStyle:W+";filter:blur(10px)"},{name:"clipReveal",keyframes:"@keyframes da-clipReveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}",initialStyle:"clip-path:inset(0 100% 0 0)"},{name:"typewriter",keyframes:"@keyframes da-typewriter{from{max-width:0}to{max-width:100%}}",initialStyle:"max-width:0;overflow:hidden;white-space:nowrap"}],x=[...z,...T,...C,...R,...U,...X,...q],I=new Map;x.forEach(t=>I.set(t.name,t));function _(){return x.map(t=>t.keyframes).join("")}var A={offset:.2,duration:1600,easing:"cubic-bezier(0.25,0.1,0.25,1)"},j={ease:A.easing,"ease-out-expo":"cubic-bezier(0.16,1,0.3,1)","ease-out-back":"cubic-bezier(0.34,1.56,0.64,1)",spring:"cubic-bezier(0.175,0.885,0.32,1.275)"},D={mobile:768,tablet:1024},E,L=()=>{const t=window.innerWidth;return t<D.mobile?"mobile":t<D.tablet?"tablet":"desktop"},$=t=>{const a=t.getAttribute("data-anim-disable");if(!a)return!1;if(a===L())return!0;const e=parseInt(a);return!isNaN(e)&&window.innerWidth<e},B=t=>L()==="mobile"?t.getAttribute("data-anim-mobile"):null,N=t=>{window.addEventListener("resize",()=>{clearTimeout(E),E=setTimeout(t,250)})},O=t=>/^\d+$/.test(t)?t+"ms":t;function s(t,a=!1){if($(t)){t.style.opacity="1";return}const e=B(t)||t.getAttribute("data-anim")||"";if(!I.has(e))return;const n=t.getAttribute("data-anim-distance");n&&t.style.setProperty("--da-distance",n);const r=t.getAttribute("data-anim-easing")||"ease",m=O(t.getAttribute("data-anim-duration")||""+A.duration),o=a?"none":t.getAttribute("data-anim-fill")||"both",b=a?"-100ms":O(t.getAttribute("data-anim-delay")||"0");t.style.animation=`da-${e} ${m} ${j[r]||r} ${b} ${t.getAttribute("data-anim-iteration")||"1"} ${o}`}function d(t,a=!1){if(t.style.animation="none",a){t.offsetWidth;return}I.get(t.getAttribute("data-anim")||"")?.initialStyle?.split(";").forEach(e=>{const[n,r]=e.split(":");n&&r&&t.style.setProperty(n.trim(),r.trim())})}function F(t){const a=parseFloat(t.getAttribute("data-anim-offset")||"")||A.offset,e=t.hasAttribute("data-anim-once"),n=t.hasAttribute("data-anim-mirror"),r=new IntersectionObserver(m=>{m.forEach(o=>{o.isIntersecting?(s(t),e&&r.unobserve(t)):n&&t._daInit&&d(t)}),t._daInit=!0},{threshold:a});t._daObs=r,r.observe(t)}function K(t){const a=t.getAttribute("data-anim-trigger")||"scroll";if(a==="load")document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>s(t),{once:!0}):s(t);else if(a==="click")t.addEventListener("click",()=>{t.style.animation="none",t.offsetWidth,s(t)});else if(a==="hover"){let e=!1;t.addEventListener("mouseenter",()=>{e||(e=!0,t.style.animation="none",t.offsetWidth,s(t,!0),t.addEventListener("animationend",()=>{e=!1,t.matches(":hover")||d(t,!0)},{once:!0}))}),t.addEventListener("mouseleave",()=>{e||d(t,!0)}),t.addEventListener("focus",()=>{t.matches(":focus-visible")&&!e&&(e=!0,t.style.animation="none",t.offsetWidth,s(t,!0),t.addEventListener("animationend",()=>{e=!1,t.matches(":focus-visible")||d(t,!0)},{once:!0}))}),t.addEventListener("blur",()=>{e||d(t,!0)})}else F(t)}function P(t){const a=t.getAttribute("data-anim-stagger");if(!a)return;const e=parseInt(a)||100,n=t.getAttribute("data-anim-stagger-from")||"start",r=Array.from(t.querySelectorAll("[data-anim]")),m=r.length,o=(m-1)/2;r.forEach((b,g)=>{const V=n==="end"?m-1-g:n==="center"?Math.abs(g-o):n==="edges"?o-Math.abs(g-o):g;b.style.animationDelay=`${(parseInt(b.getAttribute("data-anim-delay")||"0")||0)+V*e}ms`})}function H(){new MutationObserver(t=>t.forEach(a=>a.addedNodes.forEach(e=>{if(e.nodeType!==1)return;const n=e;n.hasAttribute("data-anim")&&S(n),n.querySelectorAll?.("[data-anim]").forEach(r=>S(r))}))).observe(document.body,{childList:!0,subtree:!0})}function G(){const t=document.createElement("style");t.textContent='[data-anim]:not([data-anim-trigger="hover"]):not([data-anim-trigger="click"]){opacity:0;will-change:transform,opacity}@media(prefers-reduced-motion:reduce){[data-anim]{animation:none!important;opacity:1!important;transform:none!important;filter:none!important;clip-path:none!important}}',(document.head||document.documentElement).appendChild(t)}var Y=!1;function J(){if(Y)return;Y=!0;const t=document.createElement("style");t.textContent=_(),document.head.appendChild(t)}function S(t){const a=t;if(!a._daInit){if(a._daInit=!0,$(t)){t.style.opacity="1";return}t.hasAttribute("data-anim-stagger")&&P(t),(t.getAttribute("data-anim-trigger")||"scroll")==="scroll"&&t.getBoundingClientRect().top<window.innerHeight&&!t.getAttribute("data-anim-duration")&&t.setAttribute("data-anim-duration","800"),K(a)}}function Q(){J();const t=document.createElement("div");t.innerHTML="<noscript><style>[data-anim]{opacity:1!important;transform:none!important}</style></noscript>",document.head.appendChild(t.firstChild);const a=()=>{document.querySelectorAll("[data-anim]").forEach(S),H(),setTimeout(()=>document.querySelectorAll("[data-anim]").forEach(e=>{getComputedStyle(e).opacity==="0"&&(e.style.opacity="1",e.style.transform="none")}),5e3),N(()=>document.querySelectorAll("[data-anim]").forEach(e=>{$(e)&&(e.style.opacity="1",e.style.animation="none")}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a,{once:!0}):a()}G(),Q()});
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=data-anim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-anim.js","names":[],"sources":["../src/animations/fade.ts","../src/animations/slide.ts","../src/animations/zoom.ts","../src/animations/bounce.ts","../src/animations/attention.ts","../src/animations/rotate.ts","../src/animations/special.ts","../src/animations/index.ts","../src/core/config.ts","../src/core/responsive.ts","../src/core/observer.ts","../src/core/triggers.ts","../src/core/stagger.ts","../src/core/mutation.ts","../src/core/init.ts","../src/index.ts"],"sourcesContent":["import type { AnimationDef } from '../types';\nconst D = '--da-distance,30px',\n O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const fadeAnimations: AnimationDef[] = [\n {\n name: 'fadeIn',\n keyframes: `@keyframes da-fadeIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}`,\n initialStyle: O,\n },\n {\n name: 'fadeOut',\n keyframes: `@keyframes da-fadeOut{from{opacity:1}to{opacity:0}}`,\n },\n {\n name: 'fadeInUp',\n keyframes: `@keyframes da-fadeInUp{from{opacity:0;transform:translateY(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInDown',\n keyframes: `@keyframes da-fadeInDown{from{opacity:0;transform:translateY(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInLeft',\n keyframes: `@keyframes da-fadeInLeft{from{opacity:0;transform:translateX(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInRight',\n keyframes: `@keyframes da-fadeInRight{from{opacity:0;transform:translateX(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const slideAnimations: AnimationDef[] = [\n {\n name: 'slideInUp',\n keyframes: `@keyframes da-slideInUp{from{opacity:0;transform:translateY(100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInDown',\n keyframes: `@keyframes da-slideInDown{from{opacity:0;transform:translateY(-100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInLeft',\n keyframes: `@keyframes da-slideInLeft{from{opacity:0;transform:translateX(-100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInRight',\n keyframes: `@keyframes da-slideInRight{from{opacity:0;transform:translateX(100%)}${T}}`,\n initialStyle: O,\n },\n];\n","import type { AnimationDef } from '../types';\nconst D = '--da-distance,30px',\n O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const zoomAnimations: AnimationDef[] = [\n {\n name: 'zoomIn',\n keyframes: `@keyframes da-zoomIn{from{opacity:0;transform:scale(.5)}${T}}`,\n initialStyle: O,\n supportsScale: true,\n },\n {\n name: 'zoomOut',\n keyframes: `@keyframes da-zoomOut{from{opacity:0;transform:scale(1.5)}${T}}`,\n initialStyle: O,\n supportsScale: true,\n },\n {\n name: 'zoomInUp',\n keyframes: `@keyframes da-zoomInUp{from{opacity:0;transform:scale(.9) translateY(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n supportsScale: true,\n },\n {\n name: 'zoomInDown',\n keyframes: `@keyframes da-zoomInDown{from{opacity:0;transform:scale(.9) translateY(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n supportsScale: true,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const bounceAnimations: AnimationDef[] = [\n {\n name: 'bounce',\n keyframes: `@keyframes da-bounce{0%,20%,53%,to{transform:none}40%{transform:translateY(-20px)}70%{transform:translateY(-10px)}}`,\n },\n {\n name: 'bounceIn',\n keyframes: `@keyframes da-bounceIn{0%{opacity:0;transform:scale(.3)}50%{transform:scale(1.05)}70%{transform:scale(.9)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'bounceInUp',\n keyframes: `@keyframes da-bounceInUp{0%{opacity:0;transform:translateY(50px)}60%{opacity:1;transform:translateY(-10px)}80%{transform:translateY(5px)}to{transform:none}}`,\n initialStyle: O,\n },\n {\n name: 'bounceInDown',\n keyframes: `@keyframes da-bounceInDown{0%{opacity:0;transform:translateY(-50px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}to{transform:none}}`,\n initialStyle: O,\n },\n];\n","import type { AnimationDef } from '../types';\nexport const attentionAnimations: AnimationDef[] = [\n {\n name: 'shake',\n keyframes: `@keyframes da-shake{0%,to{transform:none}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}`,\n },\n {\n name: 'pulse',\n keyframes: `@keyframes da-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}`,\n },\n {\n name: 'wobble',\n keyframes: `@keyframes da-wobble{0%,to{transform:none}15%{transform:translateX(-15px) rotate(-5deg)}30%{transform:translateX(10px) rotate(3deg)}45%{transform:translateX(-5px) rotate(-2deg)}}`,\n },\n {\n name: 'flip',\n keyframes: `@keyframes da-flip{from{transform:perspective(400px) rotateY(0)}to{transform:perspective(400px) rotateY(360deg)}}`,\n },\n {\n name: 'swing',\n keyframes: `@keyframes da-swing{0%,to{transform:none}20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}`,\n },\n {\n name: 'rubberBand',\n keyframes: `@keyframes da-rubberBand{0%,to{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}}`,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const rotateAnimations: AnimationDef[] = [\n {\n name: 'rotateIn',\n keyframes: `@keyframes da-rotateIn{from{opacity:0;transform:rotate(-200deg)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'rotateInDownLeft',\n keyframes: `@keyframes da-rotateInDownLeft{from{opacity:0;transform:rotate(-90deg)}${T}}`,\n initialStyle: O + ';transform-origin:left bottom',\n },\n {\n name: 'rotateInDownRight',\n keyframes: `@keyframes da-rotateInDownRight{from{opacity:0;transform:rotate(90deg)}${T}}`,\n initialStyle: O + ';transform-origin:right bottom',\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0';\nexport const specialAnimations: AnimationDef[] = [\n {\n name: 'blur',\n keyframes: `@keyframes da-blur{from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}}`,\n initialStyle: O + ';filter:blur(10px)',\n },\n {\n name: 'clipReveal',\n keyframes: `@keyframes da-clipReveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}`,\n initialStyle: 'clip-path:inset(0 100% 0 0)',\n },\n {\n name: 'typewriter',\n keyframes: `@keyframes da-typewriter{from{max-width:0}to{max-width:100%}}`,\n initialStyle: 'max-width:0;overflow:hidden;white-space:nowrap',\n },\n];\n","import type { AnimationDef } from '../types';\nimport { fadeAnimations } from './fade';\nimport { slideAnimations } from './slide';\nimport { zoomAnimations } from './zoom';\nimport { bounceAnimations } from './bounce';\nimport { attentionAnimations } from './attention';\nimport { rotateAnimations } from './rotate';\nimport { specialAnimations } from './special';\n\nexport const allAnimations: AnimationDef[] = [\n ...fadeAnimations,\n ...slideAnimations,\n ...zoomAnimations,\n ...bounceAnimations,\n ...attentionAnimations,\n ...rotateAnimations,\n ...specialAnimations,\n];\n\nexport const animationMap = new Map<string, AnimationDef>();\nallAnimations.forEach((a) => animationMap.set(a.name, a));\n\nexport function getKeyframesCSS(): string {\n return allAnimations.map((a) => a.keyframes).join('');\n}\n","export const DEFAULTS = {\n offset: 0.2,\n duration: 1600,\n easing: 'cubic-bezier(0.25,0.1,0.25,1)',\n} as const;\n\nexport const easings: Record<string, string> = {\n ease: DEFAULTS.easing,\n 'ease-out-expo': 'cubic-bezier(0.16,1,0.3,1)',\n 'ease-out-back': 'cubic-bezier(0.34,1.56,0.64,1)',\n spring: 'cubic-bezier(0.175,0.885,0.32,1.275)',\n};\n\nexport const breakpoints = { mobile: 768, tablet: 1024 };\n","import { breakpoints } from './config';\n\nlet dt: ReturnType<typeof setTimeout>;\n\nexport const getDevice = (): string => {\n const w = window.innerWidth;\n return w < breakpoints.mobile ? 'mobile' : w < breakpoints.tablet ? 'tablet' : 'desktop';\n};\n\nexport const isDisabled = (el: HTMLElement): boolean => {\n const d = el.getAttribute('data-anim-disable');\n if (!d) return false;\n if (d === getDevice()) return true;\n const p = parseInt(d);\n return !isNaN(p) && window.innerWidth < p;\n};\n\nexport const getMobileAnim = (el: HTMLElement): string | null =>\n getDevice() === 'mobile' ? el.getAttribute('data-anim-mobile') : null;\n\nexport const onResize = (cb: () => void): void => {\n window.addEventListener('resize', () => {\n clearTimeout(dt);\n dt = setTimeout(cb, 250);\n });\n};\n","import { DEFAULTS, easings } from './config';\nimport { animationMap } from '../animations/index';\nimport { isDisabled, getMobileAnim } from './responsive';\nimport type { DataAnimElement } from '../types';\n\nconst ms = (v: string) => (/^\\d+$/.test(v) ? v + 'ms' : v);\n\nexport function playAnimation(el: DataAnimElement, isHover = false): void {\n if (isDisabled(el)) {\n el.style.opacity = '1';\n return;\n }\n const n = getMobileAnim(el) || el.getAttribute('data-anim') || '';\n if (!animationMap.has(n)) return;\n const dist = el.getAttribute('data-anim-distance');\n if (dist) el.style.setProperty('--da-distance', dist);\n const e = el.getAttribute('data-anim-easing') || 'ease';\n const dur = ms(el.getAttribute('data-anim-duration') || '' + DEFAULTS.duration);\n // For hover: use fill:none (don't apply from-state) + negative delay to skip initial opacity:0 frame\n const fill = isHover ? 'none' : el.getAttribute('data-anim-fill') || 'both';\n const delay = isHover ? '-100ms' : ms(el.getAttribute('data-anim-delay') || '0');\n el.style.animation = `da-${n} ${dur} ${easings[e] || e} ${delay} ${el.getAttribute('data-anim-iteration') || '1'} ${fill}`;\n}\n\nexport function resetAnimation(el: DataAnimElement, forHover = false): void {\n el.style.animation = 'none';\n if (forHover) {\n // For hover: just clear animation so it can replay on next hover\n // Don't apply initial hidden styles — hover elements stay visible\n void el.offsetWidth; // force reflow\n return;\n }\n const s = animationMap.get(el.getAttribute('data-anim') || '');\n s?.initialStyle?.split(';').forEach((r) => {\n const [p, v] = r.split(':');\n if (p && v) el.style.setProperty(p.trim(), v.trim());\n });\n}\n\nexport function createObserver(el: DataAnimElement): void {\n const th = parseFloat(el.getAttribute('data-anim-offset') || '') || DEFAULTS.offset;\n const once = el.hasAttribute('data-anim-once'),\n mirror = el.hasAttribute('data-anim-mirror');\n const o = new IntersectionObserver(\n (es) => {\n es.forEach((e) => {\n if (e.isIntersecting) {\n playAnimation(el);\n if (once) o.unobserve(el);\n } else if (mirror && el._daInit) resetAnimation(el);\n });\n el._daInit = true;\n },\n { threshold: th },\n );\n el._daObs = o;\n o.observe(el);\n}\n","import { createObserver, playAnimation, resetAnimation } from './observer';\nimport type { DataAnimElement } from '../types';\n\nexport function setupTrigger(el: DataAnimElement): void {\n const t = el.getAttribute('data-anim-trigger') || 'scroll';\n if (t === 'load') {\n if (document.readyState === 'loading')\n document.addEventListener('DOMContentLoaded', () => playAnimation(el), {\n once: true,\n });\n else playAnimation(el);\n } else if (t === 'click') {\n el.addEventListener('click', () => {\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el);\n });\n } else if (t === 'hover') {\n let animating = false;\n el.addEventListener('mouseenter', () => {\n if (animating) return;\n animating = true;\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el, true);\n el.addEventListener(\n 'animationend',\n () => {\n animating = false;\n if (!el.matches(':hover')) resetAnimation(el, true);\n },\n { once: true },\n );\n });\n el.addEventListener('mouseleave', () => {\n if (!animating) resetAnimation(el, true);\n });\n el.addEventListener('focus', () => {\n if (el.matches(':focus-visible') && !animating) {\n animating = true;\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el, true);\n el.addEventListener(\n 'animationend',\n () => {\n animating = false;\n if (!el.matches(':focus-visible')) resetAnimation(el, true);\n },\n { once: true },\n );\n }\n });\n el.addEventListener('blur', () => {\n if (!animating) resetAnimation(el, true);\n });\n } else {\n createObserver(el);\n }\n}\n","export function applyStagger(el: HTMLElement): void {\n const v = el.getAttribute('data-anim-stagger');\n if (!v) return;\n const delay = parseInt(v) || 100,\n from = el.getAttribute('data-anim-stagger-from') || 'start';\n const ch = Array.from(el.querySelectorAll<HTMLElement>('[data-anim]')),\n n = ch.length,\n mid = (n - 1) / 2;\n ch.forEach((c, i) => {\n const idx =\n from === 'end'\n ? n - 1 - i\n : from === 'center'\n ? Math.abs(i - mid)\n : from === 'edges'\n ? mid - Math.abs(i - mid)\n : i;\n c.style.animationDelay = `${(parseInt(c.getAttribute('data-anim-delay') || '0') || 0) + idx * delay}ms`;\n });\n}\n","import { initElement } from './init';\n\nexport function startMutationObserver(): void {\n new MutationObserver((ms) =>\n ms.forEach((m) =>\n m.addedNodes.forEach((nd) => {\n if (nd.nodeType !== 1) return;\n const e = nd as HTMLElement;\n if (e.hasAttribute('data-anim')) initElement(e);\n e.querySelectorAll?.('[data-anim]').forEach((c) => initElement(c as HTMLElement));\n }),\n ),\n ).observe(document.body, { childList: true, subtree: true });\n}\n","import { getKeyframesCSS } from '../animations/index';\nimport { setupTrigger } from './triggers';\nimport { applyStagger } from './stagger';\nimport { isDisabled, onResize } from './responsive';\nimport { startMutationObserver } from './mutation';\nimport type { DataAnimElement } from '../types';\n\n// Layer 1: Anti-FOUC\nexport function injectAntifouc(): void {\n const s = document.createElement('style');\n s.textContent =\n '[data-anim]:not([data-anim-trigger=\"hover\"]):not([data-anim-trigger=\"click\"]){opacity:0;will-change:transform,opacity}@media(prefers-reduced-motion:reduce){[data-anim]{animation:none!important;opacity:1!important;transform:none!important;filter:none!important;clip-path:none!important}}';\n (document.head || document.documentElement).appendChild(s);\n}\n\nlet injected = false;\nfunction injectKeyframes(): void {\n if (injected) return;\n injected = true;\n const s = document.createElement('style');\n s.textContent = getKeyframesCSS();\n document.head.appendChild(s);\n}\n\nexport function initElement(el: HTMLElement): void {\n const d = el as DataAnimElement;\n if (d._daInit) return;\n d._daInit = true;\n if (isDisabled(el)) {\n el.style.opacity = '1';\n return;\n }\n if (el.hasAttribute('data-anim-stagger')) applyStagger(el);\n // Above-fold fast reveal\n if (\n (el.getAttribute('data-anim-trigger') || 'scroll') === 'scroll' &&\n el.getBoundingClientRect().top < window.innerHeight &&\n !el.getAttribute('data-anim-duration')\n )\n el.setAttribute('data-anim-duration', '800');\n setupTrigger(d);\n}\n\nexport function init(): void {\n injectKeyframes();\n // Layer 2: noscript fallback (must use innerHTML — dynamic createElement makes noscript content active)\n const ns = document.createElement('div');\n ns.innerHTML =\n '<noscript><style>[data-anim]{opacity:1!important;transform:none!important}</style></noscript>';\n document.head.appendChild(ns.firstChild!);\n\n const run = () => {\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach(initElement);\n startMutationObserver();\n // Layer 3: fallback timeout\n setTimeout(\n () =>\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach((el) => {\n if (getComputedStyle(el).opacity === '0') {\n el.style.opacity = '1';\n el.style.transform = 'none';\n }\n }),\n 5e3,\n );\n // Resize handler\n onResize(() =>\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach((el) => {\n if (isDisabled(el)) {\n el.style.opacity = '1';\n el.style.animation = 'none';\n }\n }),\n );\n };\n\n if (document.readyState === 'loading')\n document.addEventListener('DOMContentLoaded', run, { once: true });\n else run();\n}\n","import { injectAntifouc, init } from './core/init';\n\n// Layer 1: Inject anti-FOUC styles immediately (before DOM ready)\ninjectAntifouc();\n\n// Initialize when ready\ninit();\n"],"mappings":"iFACA,IAAM,EAAI,qBACR,EAAI,YACJ,EAAI,+BACO,EAAiC,CAC5C,CACE,KAAM,SACN,UAAW,yFACX,aAAc,GAEhB,CACE,KAAM,UACN,UAAW,uDAEb,CACE,KAAM,WACN,UAAW,kEAAkE,CAAA,MAAO,CAAA,IACpF,aAAc,EACd,iBAAkB,IAEpB,CACE,KAAM,aACN,UAAW,yEAAyE,CAAA,UAAW,CAAA,IAC/F,aAAc,EACd,iBAAkB,IAEpB,CACE,KAAM,aACN,UAAW,yEAAyE,CAAA,UAAW,CAAA,IAC/F,aAAc,EACd,iBAAkB,IAEpB,CACE,KAAM,cACN,UAAW,qEAAqE,CAAA,MAAO,CAAA,IACvF,aAAc,EACd,iBAAkB,KCnChB,EAAI,YACR,EAAI,+BACO,EAAkC,CAC7C,CACE,KAAM,YACN,UAAW,qEAAqE,CAAA,IAChF,aAAc,GAEhB,CACE,KAAM,cACN,UAAW,wEAAwE,CAAA,IACnF,aAAc,GAEhB,CACE,KAAM,cACN,UAAW,wEAAwE,CAAA,IACnF,aAAc,GAEhB,CACE,KAAM,eACN,UAAW,wEAAwE,CAAA,IACnF,aAAc,ICrBZ,EAAI,qBACR,EAAI,YACJ,EAAI,+BACO,EAAiC,CAC5C,CACE,KAAM,SACN,UAAW,2DAA2D,CAAA,IACtE,aAAc,EACd,cAAe,IAEjB,CACE,KAAM,UACN,UAAW,6DAA6D,CAAA,IACxE,aAAc,EACd,cAAe,IAEjB,CACE,KAAM,WACN,UAAW,4EAA4E,CAAA,MAAO,CAAA,IAC9F,aAAc,EACd,iBAAkB,GAClB,cAAe,IAEjB,CACE,KAAM,aACN,UAAW,mFAAmF,CAAA,UAAW,CAAA,IACzG,aAAc,EACd,iBAAkB,GAClB,cAAe,KC5Bb,EAAI,YACR,EAAI,+BACO,EAAmC,C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distance,30px",m="opacity:0",c="to{opacity:1;transform:none}",z=[{name:"fadeIn",keyframes:"@keyframes da-fadeIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}",initialStyle:m},{name:"fadeOut",keyframes:"@keyframes da-fadeOut{from{opacity:1}to{opacity:0}}"},{name:"fadeInUp",keyframes:`@keyframes da-fadeInUp{from{opacity:0;transform:translateY(var(${d}))}${c}}`,initialStyle:m,supportsDistance:!0},{name:"fadeInDown",keyframes:`@keyframes da-fadeInDown{from{opacity:0;transform:translateY(calc(var(${d})*-1))}${c}}`,initialStyle:m,supportsDistance:!0},{name:"fadeInLeft",keyframes:`@keyframes da-fadeInLeft{from{opacity:0;transform:translateX(calc(var(${d})*-1))}${c}}`,initialStyle:m,supportsDistance:!0},{name:"fadeInRight",keyframes:`@keyframes da-fadeInRight{from{opacity:0;transform:translateX(var(${d}))}${c}}`,initialStyle:m,supportsDistance:!0}],l="opacity:0",y="to{opacity:1;transform:none}",T=[{name:"slideInUp",keyframes:`@keyframes da-slideInUp{from{opacity:0;transform:translateY(100%)}${y}}`,initialStyle:l},{name:"slideInDown",keyframes:`@keyframes da-slideInDown{from{opacity:0;transform:translateY(-100%)}${y}}`,initialStyle:l},{name:"slideInLeft",keyframes:`@keyframes da-slideInLeft{from{opacity:0;transform:translateX(-100%)}${y}}`,initialStyle:l},{name:"slideInRight",keyframes:`@keyframes da-slideInRight{from{opacity:0;transform:translateX(100%)}${y}}`,initialStyle:l}],w="--da-distance,30px",u="opacity:0",p="to{opacity:1;transform:none}",C=[{name:"zoomIn",keyframes:`@keyframes da-zoomIn{from{opacity:0;transform:scale(.5)}${p}}`,initialStyle:u,supportsScale:!0},{name:"zoomOut",keyframes:`@keyframes da-zoomOut{from{opacity:0;transform:scale(1.5)}${p}}`,initialStyle:u,supportsScale:!0},{name:"zoomInUp",keyframes:`@keyframes da-zoomInUp{from{opacity:0;transform:scale(.9) translateY(var(${w}))}${p}}`,initialStyle:u,supportsDistance:!0,supportsScale:!0},{name:"zoomInDown",keyframes:`@keyframes da-zoomInDown{from{opacity:0;transform:scale(.9) translateY(calc(var(${w})*-1))}${p}}`,initialStyle:u,supportsDistance:!0,supportsScale:!0}],k="opacity:0",M="to{opacity:1;transform:none}",R=[{name:"bounce",keyframes:"@keyframes da-bounce{0%,20%,53%,to{transform:none}40%{transform:translateY(-20px)}70%{transform:translateY(-10px)}}"},{name:"bounceIn",keyframes:`@keyframes da-bounceIn{0%{opacity:0;transform:scale(.3)}50%{transform:scale(1.05)}70%{transform:scale(.9)}${M}}`,initialStyle:k},{name:"bounceInUp",keyframes:"@keyframes da-bounceInUp{0%{opacity:0;transform:translateY(50px)}60%{opacity:1;transform:translateY(-10px)}80%{transform:translateY(5px)}to{transform:none}}",initialStyle:k},{name:"bounceInDown",keyframes:"@keyframes da-bounceInDown{0%{opacity:0;transform:translateY(-50px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}to{transform:none}}",initialStyle:k}],U=[{name:"shake",keyframes:"@keyframes da-shake{0%,to{transform:none}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}"},{name:"pulse",keyframes:"@keyframes da-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}"},{name:"wobble",keyframes:"@keyframes da-wobble{0%,to{transform:none}15%{transform:translateX(-15px) rotate(-5deg)}30%{transform:translateX(10px) rotate(3deg)}45%{transform:translateX(-5px) rotate(-2deg)}}"},{name:"flip",keyframes:"@keyframes da-flip{from{transform:perspective(400px) rotateY(0)}to{transform:perspective(400px) rotateY(360deg)}}"},{name:"swing",keyframes:"@keyframes da-swing{0%,to{transform:none}20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}"},{name:"rubberBand",keyframes:"@keyframes da-rubberBand{0%,to{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}}"}],h="opacity:0",v="to{opacity:1;transform:none}",X=[{name:"rotateIn",keyframes:`@keyframes da-rotateIn{from{opacity:0;transform:rotate(-200deg)}${v}}`,initialStyle:h},{name:"rotateInDownLeft",keyframes:`@keyframes da-rotateInDownLeft{from{opacity:0;transform:rotate(-90deg)}${v}}`,initialStyle:h+";transform-origin:left bottom"},{name:"rotateInDownRight",keyframes:`@keyframes da-rotateInDownRight{from{opacity:0;transform:rotate(90deg)}${v}}`,initialStyle:h+";transform-origin:right bottom"}],W="opacity:0",q=[{name:"blur",keyframes:"@keyframes da-blur{from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}}",initialStyle:W+";filter:blur(10px)"},{name:"clipReveal",keyframes:"@keyframes da-clipReveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}",initialStyle:"clip-path:inset(0 100% 0 0)"},{name:"typewriter",keyframes:"@keyframes da-typewriter{from{max-width:0}to{max-width:100%}}",initialStyle:"max-width:0;overflow:hidden;white-space:nowrap"}],x=[...z,...T,...C,...R,...U,...X,...q],I=new Map;x.forEach(t=>I.set(t.name,t));function _(){return x.map(t=>t.keyframes).join("")}var A={offset:.2,duration:1600,easing:"cubic-bezier(0.25,0.1,0.25,1)"},j={ease:A.easing,"ease-out-expo":"cubic-bezier(0.16,1,0.3,1)","ease-out-back":"cubic-bezier(0.34,1.56,0.64,1)",spring:"cubic-bezier(0.175,0.885,0.32,1.275)"},D={mobile:768,tablet:1024},E,L=()=>{const t=window.innerWidth;return t<D.mobile?"mobile":t<D.tablet?"tablet":"desktop"},$=t=>{const a=t.getAttribute("data-anim-disable");if(!a)return!1;if(a===L())return!0;const e=parseInt(a);return!isNaN(e)&&window.innerWidth<e},B=t=>L()==="mobile"?t.getAttribute("data-anim-mobile"):null,N=t=>{window.addEventListener("resize",()=>{clearTimeout(E),E=setTimeout(t,250)})},O=t=>/^\d+$/.test(t)?t+"ms":t;function o(t,a=!1){if($(t)){t.style.opacity="1";return}const e=B(t)||t.getAttribute("data-anim")||"";if(!I.has(e))return;const n=t.getAttribute("data-anim-distance");n&&t.style.setProperty("--da-distance",n);const r=t.getAttribute("data-anim-easing")||"ease",s=O(t.getAttribute("data-anim-duration")||""+A.duration),i=a?"none":t.getAttribute("data-anim-fill")||"both",b=a?"-100ms":O(t.getAttribute("data-anim-delay")||"0");t.style.animation=`da-${e} ${s} ${j[r]||r} ${b} ${t.getAttribute("data-anim-iteration")||"1"} ${i}`}function f(t,a=!1){if(t.style.animation="none",a){t.offsetWidth;return}I.get(t.getAttribute("data-anim")||"")?.initialStyle?.split(";").forEach(e=>{const[n,r]=e.split(":");n&&r&&t.style.setProperty(n.trim(),r.trim())})}function F(t){const a=parseFloat(t.getAttribute("data-anim-offset")||"")||A.offset,e=t.hasAttribute("data-anim-once"),n=t.hasAttribute("data-anim-mirror"),r=new IntersectionObserver(s=>{s.forEach(i=>{i.isIntersecting?(o(t),e&&r.unobserve(t)):n&&t._daInit&&f(t)}),t._daInit=!0},{threshold:a});t._daObs=r,r.observe(t)}function K(t){const a=t.getAttribute("data-anim-trigger")||"scroll";if(a==="load")document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>o(t),{once:!0}):o(t);else if(a==="click")t.addEventListener("click",()=>{t.style.animation="none",t.offsetWidth,o(t)});else if(a==="hover"){let e=!1;t.addEventListener("mouseenter",()=>{e||(e=!0,t.style.animation="none",t.offsetWidth,o(t,!0),t.addEventListener("animationend",()=>{e=!1,t.matches(":hover")||f(t,!0)},{once:!0}))}),t.addEventListener("mouseleave",()=>{e||f(t,!0)}),t.addEventListener("focus",()=>{t.matches(":focus-visible")&&!e&&(e=!0,t.style.animation="none",t.offsetWidth,o(t,!0),t.addEventListener("animationend",()=>{e=!1,t.matches(":focus-visible")||f(t,!0)},{once:!0}))}),t.addEventListener("blur",()=>{e||f(t,!0)})}else F(t)}function P(t){const a=t.getAttribute("data-anim-stagger");if(!a)return;const e=parseInt(a)||100,n=t.getAttribute("data-anim-stagger-from")||"start",r=Array.from(t.querySelectorAll("[data-anim]")),s=r.length,i=(s-1)/2;r.forEach((b,g)=>{const V=n==="end"?s-1-g:n==="center"?Math.abs(g-i):n==="edges"?i-Math.abs(g-i):g;b.style.animationDelay=`${(parseInt(b.getAttribute("data-anim-delay")||"0")||0)+V*e}ms`})}function H(){new MutationObserver(t=>t.forEach(a=>a.addedNodes.forEach(e=>{if(e.nodeType!==1)return;const n=e;n.hasAttribute("data-anim")&&S(n),n.querySelectorAll?.("[data-anim]").forEach(r=>S(r))}))).observe(document.body,{childList:!0,subtree:!0})}function G(){const t=document.createElement("style");t.textContent='[data-anim]:not([data-anim-trigger="hover"]):not([data-anim-trigger="click"]){opacity:0;will-change:transform,opacity}@media(prefers-reduced-motion:reduce){[data-anim]{animation:none!important;opacity:1!important;transform:none!important;filter:none!important;clip-path:none!important}}',(document.head||document.documentElement).appendChild(t)}var Y=!1;function J(){if(Y)return;Y=!0;const t=document.createElement("style");t.textContent=_(),document.head.appendChild(t)}function S(t){const a=t;if(!a._daInit){if(a._daInit=!0,$(t)){t.style.opacity="1";return}t.hasAttribute("data-anim-stagger")&&P(t),(t.getAttribute("data-anim-trigger")||"scroll")==="scroll"&&t.getBoundingClientRect().top<window.innerHeight&&!t.getAttribute("data-anim-duration")&&t.setAttribute("data-anim-duration","800"),K(a)}}function Q(){J();const t=document.createElement("div");t.innerHTML="<noscript><style>[data-anim]{opacity:1!important;transform:none!important}</style></noscript>",document.head.appendChild(t.firstChild);const a=()=>{document.querySelectorAll("[data-anim]").forEach(S),H(),setTimeout(()=>document.querySelectorAll("[data-anim]").forEach(e=>{getComputedStyle(e).opacity==="0"&&(e.style.opacity="1",e.style.transform="none")}),5e3),N(()=>document.querySelectorAll("[data-anim]").forEach(e=>{$(e)&&(e.style.opacity="1",e.style.animation="none")}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a,{once:!0}):a()}G(),Q()})();
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=data-anim.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-anim.min.js","names":[],"sources":["../src/animations/fade.ts","../src/animations/slide.ts","../src/animations/zoom.ts","../src/animations/bounce.ts","../src/animations/attention.ts","../src/animations/rotate.ts","../src/animations/special.ts","../src/animations/index.ts","../src/core/config.ts","../src/core/responsive.ts","../src/core/observer.ts","../src/core/triggers.ts","../src/core/stagger.ts","../src/core/mutation.ts","../src/core/init.ts","../src/index.ts"],"sourcesContent":["import type { AnimationDef } from '../types';\nconst D = '--da-distance,30px',\n O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const fadeAnimations: AnimationDef[] = [\n {\n name: 'fadeIn',\n keyframes: `@keyframes da-fadeIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:none}}`,\n initialStyle: O,\n },\n {\n name: 'fadeOut',\n keyframes: `@keyframes da-fadeOut{from{opacity:1}to{opacity:0}}`,\n },\n {\n name: 'fadeInUp',\n keyframes: `@keyframes da-fadeInUp{from{opacity:0;transform:translateY(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInDown',\n keyframes: `@keyframes da-fadeInDown{from{opacity:0;transform:translateY(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInLeft',\n keyframes: `@keyframes da-fadeInLeft{from{opacity:0;transform:translateX(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n {\n name: 'fadeInRight',\n keyframes: `@keyframes da-fadeInRight{from{opacity:0;transform:translateX(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const slideAnimations: AnimationDef[] = [\n {\n name: 'slideInUp',\n keyframes: `@keyframes da-slideInUp{from{opacity:0;transform:translateY(100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInDown',\n keyframes: `@keyframes da-slideInDown{from{opacity:0;transform:translateY(-100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInLeft',\n keyframes: `@keyframes da-slideInLeft{from{opacity:0;transform:translateX(-100%)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'slideInRight',\n keyframes: `@keyframes da-slideInRight{from{opacity:0;transform:translateX(100%)}${T}}`,\n initialStyle: O,\n },\n];\n","import type { AnimationDef } from '../types';\nconst D = '--da-distance,30px',\n O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const zoomAnimations: AnimationDef[] = [\n {\n name: 'zoomIn',\n keyframes: `@keyframes da-zoomIn{from{opacity:0;transform:scale(.5)}${T}}`,\n initialStyle: O,\n supportsScale: true,\n },\n {\n name: 'zoomOut',\n keyframes: `@keyframes da-zoomOut{from{opacity:0;transform:scale(1.5)}${T}}`,\n initialStyle: O,\n supportsScale: true,\n },\n {\n name: 'zoomInUp',\n keyframes: `@keyframes da-zoomInUp{from{opacity:0;transform:scale(.9) translateY(var(${D}))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n supportsScale: true,\n },\n {\n name: 'zoomInDown',\n keyframes: `@keyframes da-zoomInDown{from{opacity:0;transform:scale(.9) translateY(calc(var(${D})*-1))}${T}}`,\n initialStyle: O,\n supportsDistance: true,\n supportsScale: true,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const bounceAnimations: AnimationDef[] = [\n {\n name: 'bounce',\n keyframes: `@keyframes da-bounce{0%,20%,53%,to{transform:none}40%{transform:translateY(-20px)}70%{transform:translateY(-10px)}}`,\n },\n {\n name: 'bounceIn',\n keyframes: `@keyframes da-bounceIn{0%{opacity:0;transform:scale(.3)}50%{transform:scale(1.05)}70%{transform:scale(.9)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'bounceInUp',\n keyframes: `@keyframes da-bounceInUp{0%{opacity:0;transform:translateY(50px)}60%{opacity:1;transform:translateY(-10px)}80%{transform:translateY(5px)}to{transform:none}}`,\n initialStyle: O,\n },\n {\n name: 'bounceInDown',\n keyframes: `@keyframes da-bounceInDown{0%{opacity:0;transform:translateY(-50px)}60%{opacity:1;transform:translateY(10px)}80%{transform:translateY(-5px)}to{transform:none}}`,\n initialStyle: O,\n },\n];\n","import type { AnimationDef } from '../types';\nexport const attentionAnimations: AnimationDef[] = [\n {\n name: 'shake',\n keyframes: `@keyframes da-shake{0%,to{transform:none}10%,30%,50%,70%,90%{transform:translateX(-10px)}20%,40%,60%,80%{transform:translateX(10px)}}`,\n },\n {\n name: 'pulse',\n keyframes: `@keyframes da-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}`,\n },\n {\n name: 'wobble',\n keyframes: `@keyframes da-wobble{0%,to{transform:none}15%{transform:translateX(-15px) rotate(-5deg)}30%{transform:translateX(10px) rotate(3deg)}45%{transform:translateX(-5px) rotate(-2deg)}}`,\n },\n {\n name: 'flip',\n keyframes: `@keyframes da-flip{from{transform:perspective(400px) rotateY(0)}to{transform:perspective(400px) rotateY(360deg)}}`,\n },\n {\n name: 'swing',\n keyframes: `@keyframes da-swing{0%,to{transform:none}20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}}`,\n },\n {\n name: 'rubberBand',\n keyframes: `@keyframes da-rubberBand{0%,to{transform:scale(1)}30%{transform:scale(1.25,.75)}40%{transform:scale(.75,1.25)}50%{transform:scale(1.15,.85)}65%{transform:scale(.95,1.05)}75%{transform:scale(1.05,.95)}}`,\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0',\n T = 'to{opacity:1;transform:none}';\nexport const rotateAnimations: AnimationDef[] = [\n {\n name: 'rotateIn',\n keyframes: `@keyframes da-rotateIn{from{opacity:0;transform:rotate(-200deg)}${T}}`,\n initialStyle: O,\n },\n {\n name: 'rotateInDownLeft',\n keyframes: `@keyframes da-rotateInDownLeft{from{opacity:0;transform:rotate(-90deg)}${T}}`,\n initialStyle: O + ';transform-origin:left bottom',\n },\n {\n name: 'rotateInDownRight',\n keyframes: `@keyframes da-rotateInDownRight{from{opacity:0;transform:rotate(90deg)}${T}}`,\n initialStyle: O + ';transform-origin:right bottom',\n },\n];\n","import type { AnimationDef } from '../types';\nconst O = 'opacity:0';\nexport const specialAnimations: AnimationDef[] = [\n {\n name: 'blur',\n keyframes: `@keyframes da-blur{from{opacity:0;filter:blur(10px)}to{opacity:1;filter:blur(0)}}`,\n initialStyle: O + ';filter:blur(10px)',\n },\n {\n name: 'clipReveal',\n keyframes: `@keyframes da-clipReveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}`,\n initialStyle: 'clip-path:inset(0 100% 0 0)',\n },\n {\n name: 'typewriter',\n keyframes: `@keyframes da-typewriter{from{max-width:0}to{max-width:100%}}`,\n initialStyle: 'max-width:0;overflow:hidden;white-space:nowrap',\n },\n];\n","import type { AnimationDef } from '../types';\nimport { fadeAnimations } from './fade';\nimport { slideAnimations } from './slide';\nimport { zoomAnimations } from './zoom';\nimport { bounceAnimations } from './bounce';\nimport { attentionAnimations } from './attention';\nimport { rotateAnimations } from './rotate';\nimport { specialAnimations } from './special';\n\nexport const allAnimations: AnimationDef[] = [\n ...fadeAnimations,\n ...slideAnimations,\n ...zoomAnimations,\n ...bounceAnimations,\n ...attentionAnimations,\n ...rotateAnimations,\n ...specialAnimations,\n];\n\nexport const animationMap = new Map<string, AnimationDef>();\nallAnimations.forEach((a) => animationMap.set(a.name, a));\n\nexport function getKeyframesCSS(): string {\n return allAnimations.map((a) => a.keyframes).join('');\n}\n","export const DEFAULTS = {\n offset: 0.2,\n duration: 1600,\n easing: 'cubic-bezier(0.25,0.1,0.25,1)',\n} as const;\n\nexport const easings: Record<string, string> = {\n ease: DEFAULTS.easing,\n 'ease-out-expo': 'cubic-bezier(0.16,1,0.3,1)',\n 'ease-out-back': 'cubic-bezier(0.34,1.56,0.64,1)',\n spring: 'cubic-bezier(0.175,0.885,0.32,1.275)',\n};\n\nexport const breakpoints = { mobile: 768, tablet: 1024 };\n","import { breakpoints } from './config';\n\nlet dt: ReturnType<typeof setTimeout>;\n\nexport const getDevice = (): string => {\n const w = window.innerWidth;\n return w < breakpoints.mobile ? 'mobile' : w < breakpoints.tablet ? 'tablet' : 'desktop';\n};\n\nexport const isDisabled = (el: HTMLElement): boolean => {\n const d = el.getAttribute('data-anim-disable');\n if (!d) return false;\n if (d === getDevice()) return true;\n const p = parseInt(d);\n return !isNaN(p) && window.innerWidth < p;\n};\n\nexport const getMobileAnim = (el: HTMLElement): string | null =>\n getDevice() === 'mobile' ? el.getAttribute('data-anim-mobile') : null;\n\nexport const onResize = (cb: () => void): void => {\n window.addEventListener('resize', () => {\n clearTimeout(dt);\n dt = setTimeout(cb, 250);\n });\n};\n","import { DEFAULTS, easings } from './config';\nimport { animationMap } from '../animations/index';\nimport { isDisabled, getMobileAnim } from './responsive';\nimport type { DataAnimElement } from '../types';\n\nconst ms = (v: string) => (/^\\d+$/.test(v) ? v + 'ms' : v);\n\nexport function playAnimation(el: DataAnimElement, isHover = false): void {\n if (isDisabled(el)) {\n el.style.opacity = '1';\n return;\n }\n const n = getMobileAnim(el) || el.getAttribute('data-anim') || '';\n if (!animationMap.has(n)) return;\n const dist = el.getAttribute('data-anim-distance');\n if (dist) el.style.setProperty('--da-distance', dist);\n const e = el.getAttribute('data-anim-easing') || 'ease';\n const dur = ms(el.getAttribute('data-anim-duration') || '' + DEFAULTS.duration);\n // For hover: use fill:none (don't apply from-state) + negative delay to skip initial opacity:0 frame\n const fill = isHover ? 'none' : el.getAttribute('data-anim-fill') || 'both';\n const delay = isHover ? '-100ms' : ms(el.getAttribute('data-anim-delay') || '0');\n el.style.animation = `da-${n} ${dur} ${easings[e] || e} ${delay} ${el.getAttribute('data-anim-iteration') || '1'} ${fill}`;\n}\n\nexport function resetAnimation(el: DataAnimElement, forHover = false): void {\n el.style.animation = 'none';\n if (forHover) {\n // For hover: just clear animation so it can replay on next hover\n // Don't apply initial hidden styles — hover elements stay visible\n void el.offsetWidth; // force reflow\n return;\n }\n const s = animationMap.get(el.getAttribute('data-anim') || '');\n s?.initialStyle?.split(';').forEach((r) => {\n const [p, v] = r.split(':');\n if (p && v) el.style.setProperty(p.trim(), v.trim());\n });\n}\n\nexport function createObserver(el: DataAnimElement): void {\n const th = parseFloat(el.getAttribute('data-anim-offset') || '') || DEFAULTS.offset;\n const once = el.hasAttribute('data-anim-once'),\n mirror = el.hasAttribute('data-anim-mirror');\n const o = new IntersectionObserver(\n (es) => {\n es.forEach((e) => {\n if (e.isIntersecting) {\n playAnimation(el);\n if (once) o.unobserve(el);\n } else if (mirror && el._daInit) resetAnimation(el);\n });\n el._daInit = true;\n },\n { threshold: th },\n );\n el._daObs = o;\n o.observe(el);\n}\n","import { createObserver, playAnimation, resetAnimation } from './observer';\nimport type { DataAnimElement } from '../types';\n\nexport function setupTrigger(el: DataAnimElement): void {\n const t = el.getAttribute('data-anim-trigger') || 'scroll';\n if (t === 'load') {\n if (document.readyState === 'loading')\n document.addEventListener('DOMContentLoaded', () => playAnimation(el), {\n once: true,\n });\n else playAnimation(el);\n } else if (t === 'click') {\n el.addEventListener('click', () => {\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el);\n });\n } else if (t === 'hover') {\n let animating = false;\n el.addEventListener('mouseenter', () => {\n if (animating) return;\n animating = true;\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el, true);\n el.addEventListener(\n 'animationend',\n () => {\n animating = false;\n if (!el.matches(':hover')) resetAnimation(el, true);\n },\n { once: true },\n );\n });\n el.addEventListener('mouseleave', () => {\n if (!animating) resetAnimation(el, true);\n });\n el.addEventListener('focus', () => {\n if (el.matches(':focus-visible') && !animating) {\n animating = true;\n el.style.animation = 'none';\n void el.offsetWidth;\n playAnimation(el, true);\n el.addEventListener(\n 'animationend',\n () => {\n animating = false;\n if (!el.matches(':focus-visible')) resetAnimation(el, true);\n },\n { once: true },\n );\n }\n });\n el.addEventListener('blur', () => {\n if (!animating) resetAnimation(el, true);\n });\n } else {\n createObserver(el);\n }\n}\n","export function applyStagger(el: HTMLElement): void {\n const v = el.getAttribute('data-anim-stagger');\n if (!v) return;\n const delay = parseInt(v) || 100,\n from = el.getAttribute('data-anim-stagger-from') || 'start';\n const ch = Array.from(el.querySelectorAll<HTMLElement>('[data-anim]')),\n n = ch.length,\n mid = (n - 1) / 2;\n ch.forEach((c, i) => {\n const idx =\n from === 'end'\n ? n - 1 - i\n : from === 'center'\n ? Math.abs(i - mid)\n : from === 'edges'\n ? mid - Math.abs(i - mid)\n : i;\n c.style.animationDelay = `${(parseInt(c.getAttribute('data-anim-delay') || '0') || 0) + idx * delay}ms`;\n });\n}\n","import { initElement } from './init';\n\nexport function startMutationObserver(): void {\n new MutationObserver((ms) =>\n ms.forEach((m) =>\n m.addedNodes.forEach((nd) => {\n if (nd.nodeType !== 1) return;\n const e = nd as HTMLElement;\n if (e.hasAttribute('data-anim')) initElement(e);\n e.querySelectorAll?.('[data-anim]').forEach((c) => initElement(c as HTMLElement));\n }),\n ),\n ).observe(document.body, { childList: true, subtree: true });\n}\n","import { getKeyframesCSS } from '../animations/index';\nimport { setupTrigger } from './triggers';\nimport { applyStagger } from './stagger';\nimport { isDisabled, onResize } from './responsive';\nimport { startMutationObserver } from './mutation';\nimport type { DataAnimElement } from '../types';\n\n// Layer 1: Anti-FOUC\nexport function injectAntifouc(): void {\n const s = document.createElement('style');\n s.textContent =\n '[data-anim]:not([data-anim-trigger=\"hover\"]):not([data-anim-trigger=\"click\"]){opacity:0;will-change:transform,opacity}@media(prefers-reduced-motion:reduce){[data-anim]{animation:none!important;opacity:1!important;transform:none!important;filter:none!important;clip-path:none!important}}';\n (document.head || document.documentElement).appendChild(s);\n}\n\nlet injected = false;\nfunction injectKeyframes(): void {\n if (injected) return;\n injected = true;\n const s = document.createElement('style');\n s.textContent = getKeyframesCSS();\n document.head.appendChild(s);\n}\n\nexport function initElement(el: HTMLElement): void {\n const d = el as DataAnimElement;\n if (d._daInit) return;\n d._daInit = true;\n if (isDisabled(el)) {\n el.style.opacity = '1';\n return;\n }\n if (el.hasAttribute('data-anim-stagger')) applyStagger(el);\n // Above-fold fast reveal\n if (\n (el.getAttribute('data-anim-trigger') || 'scroll') === 'scroll' &&\n el.getBoundingClientRect().top < window.innerHeight &&\n !el.getAttribute('data-anim-duration')\n )\n el.setAttribute('data-anim-duration', '800');\n setupTrigger(d);\n}\n\nexport function init(): void {\n injectKeyframes();\n // Layer 2: noscript fallback (must use innerHTML — dynamic createElement makes noscript content active)\n const ns = document.createElement('div');\n ns.innerHTML =\n '<noscript><style>[data-anim]{opacity:1!important;transform:none!important}</style></noscript>';\n document.head.appendChild(ns.firstChild!);\n\n const run = () => {\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach(initElement);\n startMutationObserver();\n // Layer 3: fallback timeout\n setTimeout(\n () =>\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach((el) => {\n if (getComputedStyle(el).opacity === '0') {\n el.style.opacity = '1';\n el.style.transform = 'none';\n }\n }),\n 5e3,\n );\n // Resize handler\n onResize(() =>\n document.querySelectorAll<HTMLElement>('[data-anim]').forEach((el) => {\n if (isDisabled(el)) {\n el.style.opacity = '1';\n el.style.animation = 'none';\n }\n }),\n );\n };\n\n if (document.readyState === 'loading')\n document.addEventListener('DOMContentLoaded', run, { once: true });\n else run();\n}\n","import { injectAntifouc, init } from './core/init';\n\n// Layer 1: Inject anti-FOUC styles immediately (before DOM ready)\ninjectAntifouc();\n\n// Initialize when ready\ninit();\n"],"mappings":"YACA,IAAM,EAAI,qBACR,EAAI,YACJ,EAAI,+BACO,EAAiC,CAC5C,CACE,KAAM,SACN,UAAW,yFACX,aAAc,GAEhB,CACE,KAAM,UACN,UAAW,uDAEb,CACE,KAAM,WACN,UAAW,kEAAkE,CAAA,MAAO,CAAA,IACpF,aAAc,EACd,iBAAkB,IAEpB,CACE,KAAM,aACN,UAAW,y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EAAG,MAAM,QAAU,IACnB,OAEE,EAAG,aAAa,mBAAA,GAAsB,EAAa,CAAA,GAGpD,EAAG,aAAa,mBAAA,GAAwB,YAAc,UACvD,EAAG,sBAAA,EAAwB,IAAM,OAAO,aACxC,CAAC,EAAG,aAAa,oBAAA,GAEjB,EAAG,aAAa,qBAAsB,KAAA,EACxC,EAAa,CAAA,GAGf,SAAgB,GAAa,CAC3B,EAAA,EAEA,MAAM,EAAK,SAAS,cAAc,KAAA,EAClC,EAAG,UACD,gGACF,SAAS,KAAK,YAAY,EAAG,UAAA,EAE7B,MAAM,EAAA,IAAY,CAChB,SAAS,iBAA8B,aAAA,EAAe,QAAQ,CAAA,EAC9D,EAAA,EAEA,WAAA,IAEI,SAAS,iBAA8B,aAAA,EAAe,QAAS,GAAO,CAChE,iBAAiB,CAAA,EAAI,UAAY,MACnC,EAAG,MAAM,QAAU,IACnB,EAAG,MAAM,UAAY,UAG3B,GAAA,EAGF,EAAA,IACE,SAAS,iBAA8B,aAAA,EAAe,QAAS,GAAO,CAChE,EAAW,CAAA,IACb,EAAG,MAAM,QAAU,IACnB,EAAG,MAAM,UAAY,SAEvB,GAIF,SAAS,aAAe,UAC1B,SAAS,iBAAiB,mBAAoB,EAAK,CAAE,KAAM,EAAA,CAAM,EAC9D,EAAA,EC3EP,EAAA,EAGA,EAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "data-anim",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Animate with just HTML. Powered by data attributes.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.11.0",
|
|
7
|
+
"main": "dist/data-anim.js",
|
|
8
|
+
"module": "dist/data-anim.esm.js",
|
|
9
|
+
"types": "dist/data-anim.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/data-anim.d.ts",
|
|
13
|
+
"import": "./dist/data-anim.esm.js",
|
|
14
|
+
"require": "./dist/data-anim.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"unpkg": "dist/data-anim.min.js",
|
|
18
|
+
"jsdelivr": "dist/data-anim.min.js",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "vite build",
|
|
24
|
+
"dev": "vite build --watch",
|
|
25
|
+
"lint": "oxlint src/",
|
|
26
|
+
"lint:fix": "oxlint --fix src/",
|
|
27
|
+
"format": "oxfmt --write src/ tests/",
|
|
28
|
+
"format:check": "oxfmt --check src/ tests/",
|
|
29
|
+
"check": "pnpm lint && pnpm format:check && pnpm build"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"animation",
|
|
33
|
+
"css",
|
|
34
|
+
"data-attributes",
|
|
35
|
+
"scroll",
|
|
36
|
+
"intersection-observer",
|
|
37
|
+
"anti-fouc",
|
|
38
|
+
"zero-js",
|
|
39
|
+
"declarative",
|
|
40
|
+
"hover",
|
|
41
|
+
"stagger"
|
|
42
|
+
],
|
|
43
|
+
"author": "Ryo Matsukawa",
|
|
44
|
+
"funding": "https://github.com/ryo-manba/data-anim?sponsor=1",
|
|
45
|
+
"homepage": "https://github.com/ryo-manba/data-anim#readme",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "https://github.com/ryo-manba/data-anim"
|
|
49
|
+
},
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@oxfmt/binding-darwin-arm64": "0.40.0",
|
|
53
|
+
"@oxlint/binding-darwin-arm64": "1.55.0",
|
|
54
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-rc.9",
|
|
55
|
+
"oxfmt": "^0.40.0",
|
|
56
|
+
"oxlint": "1.55.0",
|
|
57
|
+
"puppeteer": "^24.39.1",
|
|
58
|
+
"typescript": "^5.3.0",
|
|
59
|
+
"vite": "^8.0.0",
|
|
60
|
+
"vite-plugin-dts": "^4.0.0"
|
|
61
|
+
}
|
|
62
|
+
}
|