@arraypress/effects-astro 0.7.0 → 0.9.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/AGENTS.md +1 -1
- package/COMPONENTS.md +10 -1
- package/README.md +1 -1
- package/package.json +6 -2
- package/src/components/BorderSweep.astro +43 -4
- package/src/components/GlitchText.astro +17 -8
- package/src/components/Marquee.astro +34 -10
- package/src/components/text.js +29 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/runtime/budget.d.ts +8 -0
- package/src/runtime/budget.js +49 -0
- package/src/runtime/export/clean-svg.d.ts +21 -0
- package/src/runtime/export/clean-svg.js +368 -0
- package/src/runtime/export/clock.d.ts +25 -0
- package/src/runtime/export/clock.js +122 -0
- package/src/runtime/export/fetch.d.ts +14 -0
- package/src/runtime/export/fetch.js +121 -0
- package/src/runtime/export/fonts.d.ts +30 -0
- package/src/runtime/export/fonts.js +202 -0
- package/src/runtime/export/format.d.ts +11 -0
- package/src/runtime/export/format.js +42 -0
- package/src/runtime/export/probe.d.ts +16 -0
- package/src/runtime/export/probe.js +89 -0
- package/src/runtime/export/raster.d.ts +17 -0
- package/src/runtime/export/raster.js +91 -0
- package/src/runtime/export/save.d.ts +5 -0
- package/src/runtime/export/save.js +41 -0
- package/src/runtime/export/snapshot.d.ts +43 -0
- package/src/runtime/export/snapshot.js +276 -0
- package/src/runtime/export/styles.d.ts +18 -0
- package/src/runtime/export/styles.js +152 -0
- package/src/runtime/export/svg-attrs.d.ts +8 -0
- package/src/runtime/export/svg-attrs.js +274 -0
- package/src/runtime/export/svg-text.d.ts +21 -0
- package/src/runtime/export/svg-text.js +124 -0
- package/src/runtime/export/video.d.ts +45 -0
- package/src/runtime/export/video.js +106 -0
- package/src/styles/border-sweep.css +35 -6
- package/src/styles/glitch-text.css +155 -2
|
@@ -23,7 +23,18 @@
|
|
|
23
23
|
* `--glitch-blend` (how they blend: multiply on a light ground, screen on
|
|
24
24
|
* a dark one). With reduced motion it is the plain text, still.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
26
|
+
* `glitch-text--pseudo` draws the copies as the element's own `::before`
|
|
27
|
+
* and `::after` from its `data-text` instead, for one element of plain
|
|
28
|
+
* text:
|
|
29
|
+
*
|
|
30
|
+
* <span class="glitch-text glitch-text--pseudo" data-text="Free logos">Free logos</span>
|
|
31
|
+
*
|
|
32
|
+
* `glitch-text--skew` is another glitch: the whole word shakes and skews
|
|
33
|
+
* while the copies tear through three bands each, shifted by a share of
|
|
34
|
+
* the type size (em), the second a touch fainter. With either markup.
|
|
35
|
+
*
|
|
36
|
+
* CSS only. From the Logomarks site's Custom card; the pseudo copies and
|
|
37
|
+
* the skew from its home page's headline.
|
|
27
38
|
* ───────────────────────────────────────────────────────────────────── */
|
|
28
39
|
|
|
29
40
|
.glitch-text {
|
|
@@ -162,8 +173,150 @@
|
|
|
162
173
|
}
|
|
163
174
|
}
|
|
164
175
|
|
|
176
|
+
/* The copies as the element's ::before and ::after, from its data-text: one element, plain text. */
|
|
177
|
+
.glitch-text--pseudo::before,
|
|
178
|
+
.glitch-text--pseudo::after {
|
|
179
|
+
content: attr(data-text);
|
|
180
|
+
position: absolute;
|
|
181
|
+
inset: 0;
|
|
182
|
+
opacity: 0;
|
|
183
|
+
pointer-events: none;
|
|
184
|
+
mix-blend-mode: var(--glitch-blend, multiply);
|
|
185
|
+
animation: effect-glitch-text-a var(--glitch-every, 5s) steps(1, end) infinite;
|
|
186
|
+
animation-delay: var(--glitch-delay, 0s);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.glitch-text--pseudo::before {
|
|
190
|
+
color: var(--glitch-a, #ff3ea5);
|
|
191
|
+
-webkit-text-fill-color: currentColor;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.glitch-text--pseudo::after {
|
|
195
|
+
color: var(--glitch-b, #2e4bff);
|
|
196
|
+
-webkit-text-fill-color: currentColor;
|
|
197
|
+
animation-name: effect-glitch-text-b;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* Here the element itself nudges, its copies with it. */
|
|
201
|
+
.glitch-text--pseudo {
|
|
202
|
+
animation: effect-glitch-text-main var(--glitch-every, 5s) steps(1, end) infinite;
|
|
203
|
+
animation-delay: var(--glitch-delay, 0s);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* The skew: the whole word shakes and skews while the copies tear through three bands. */
|
|
207
|
+
.glitch-text--skew {
|
|
208
|
+
animation: effect-glitch-text-skew var(--glitch-every, 5s) steps(1, end) infinite;
|
|
209
|
+
animation-delay: var(--glitch-delay, 0s);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.glitch-text--skew > :not(.glitch-text-a, .glitch-text-b) {
|
|
213
|
+
animation: none;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.glitch-text--skew > .glitch-text-a,
|
|
217
|
+
.glitch-text--skew::before {
|
|
218
|
+
animation-name: effect-glitch-text-skew-a;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.glitch-text--skew > .glitch-text-b,
|
|
222
|
+
.glitch-text--skew::after {
|
|
223
|
+
animation-name: effect-glitch-text-skew-b;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.glitch-text:is(.glitch-text--pseudo, .glitch-text--skew):hover,
|
|
227
|
+
.glitch-text--pseudo:hover::before,
|
|
228
|
+
.glitch-text--pseudo:hover::after,
|
|
229
|
+
:is(a, button):is(:hover, :focus-visible) .glitch-text:is(.glitch-text--pseudo, .glitch-text--skew),
|
|
230
|
+
:is(a, button):is(:hover, :focus-visible) .glitch-text--pseudo::before,
|
|
231
|
+
:is(a, button):is(:hover, :focus-visible) .glitch-text--pseudo::after {
|
|
232
|
+
animation-duration: var(--glitch-hover, 1.6s);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@keyframes effect-glitch-text-skew-a {
|
|
236
|
+
0%,
|
|
237
|
+
88%,
|
|
238
|
+
100% {
|
|
239
|
+
opacity: 0;
|
|
240
|
+
transform: none;
|
|
241
|
+
clip-path: inset(0 0 100% 0);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
89% {
|
|
245
|
+
opacity: 1;
|
|
246
|
+
transform: translate(-0.04em, 0.01em);
|
|
247
|
+
clip-path: inset(12% 0 58% 0);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
91% {
|
|
251
|
+
opacity: 1;
|
|
252
|
+
transform: translate(0.05em, -0.01em);
|
|
253
|
+
clip-path: inset(62% 0 8% 0);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
93% {
|
|
257
|
+
opacity: 1;
|
|
258
|
+
transform: translate(-0.02em, 0);
|
|
259
|
+
clip-path: inset(38% 0 40% 0);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
95% {
|
|
263
|
+
opacity: 0;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@keyframes effect-glitch-text-skew-b {
|
|
268
|
+
0%,
|
|
269
|
+
89%,
|
|
270
|
+
100% {
|
|
271
|
+
opacity: 0;
|
|
272
|
+
transform: none;
|
|
273
|
+
clip-path: inset(0 0 100% 0);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
90% {
|
|
277
|
+
opacity: 0.9;
|
|
278
|
+
transform: translate(0.05em, 0);
|
|
279
|
+
clip-path: inset(48% 0 22% 0);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
92% {
|
|
283
|
+
opacity: 0.9;
|
|
284
|
+
transform: translate(-0.04em, 0.01em);
|
|
285
|
+
clip-path: inset(6% 0 70% 0);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
94% {
|
|
289
|
+
opacity: 0;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
@keyframes effect-glitch-text-skew {
|
|
294
|
+
0%,
|
|
295
|
+
88%,
|
|
296
|
+
95%,
|
|
297
|
+
100% {
|
|
298
|
+
transform: none;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
89% {
|
|
302
|
+
transform: translateX(0.012em) skewX(-4deg);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
91% {
|
|
306
|
+
transform: translateX(-0.012em);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
93% {
|
|
310
|
+
transform: skewX(3deg);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
165
314
|
@media (prefers-reduced-motion: reduce) {
|
|
166
|
-
.glitch-text >
|
|
315
|
+
.glitch-text > *,
|
|
316
|
+
.glitch-text--pseudo,
|
|
317
|
+
.glitch-text--pseudo::before,
|
|
318
|
+
.glitch-text--pseudo::after,
|
|
319
|
+
.glitch-text--skew {
|
|
167
320
|
animation: none !important;
|
|
168
321
|
}
|
|
169
322
|
}
|