@spartan-ng/brain 1.2.0-beta.2 → 1.2.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.
@@ -140,3 +140,410 @@
140
140
  display: none;
141
141
  }
142
142
  }
143
+
144
+ /* scroll-fade */
145
+ @property --scroll-fade-t {
146
+ syntax: '<length-percentage>';
147
+ inherits: false;
148
+ initial-value: 0px;
149
+ }
150
+ @property --scroll-fade-b {
151
+ syntax: '<length-percentage>';
152
+ inherits: false;
153
+ initial-value: 0px;
154
+ }
155
+ @property --scroll-fade-s {
156
+ syntax: '<length-percentage>';
157
+ inherits: false;
158
+ initial-value: 0px;
159
+ }
160
+ @property --scroll-fade-e {
161
+ syntax: '<length-percentage>';
162
+ inherits: false;
163
+ initial-value: 0px;
164
+ }
165
+ @property --scroll-fade-mask {
166
+ syntax: '*';
167
+ inherits: false;
168
+ }
169
+
170
+ @theme inline {
171
+ @keyframes scroll-fade-reveal-t {
172
+ from {
173
+ --scroll-fade-t: 0px;
174
+ }
175
+ to {
176
+ --scroll-fade-t: var(--_scroll-fade-size-t, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
177
+ }
178
+ }
179
+ @keyframes scroll-fade-reveal-b {
180
+ from {
181
+ --scroll-fade-b: var(--_scroll-fade-size-b, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
182
+ }
183
+ to {
184
+ --scroll-fade-b: 0px;
185
+ }
186
+ }
187
+ @keyframes scroll-fade-reveal-s {
188
+ from {
189
+ --scroll-fade-s: 0px;
190
+ }
191
+ to {
192
+ --scroll-fade-s: var(--_scroll-fade-size-s, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
193
+ }
194
+ }
195
+ @keyframes scroll-fade-reveal-e {
196
+ from {
197
+ --scroll-fade-e: var(--_scroll-fade-size-e, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
198
+ }
199
+ to {
200
+ --scroll-fade-e: 0px;
201
+ }
202
+ }
203
+ }
204
+
205
+ @utility scroll-fade {
206
+ --_scroll-fade-size-t: var(--scroll-fade-t-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
207
+ --_scroll-fade-size-b: var(--scroll-fade-b-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
208
+ --scroll-fade-block: linear-gradient(
209
+ to bottom,
210
+ transparent 0,
211
+ #000 var(--scroll-fade-t, 0px),
212
+ #000 calc(100% - var(--scroll-fade-b, 0px)),
213
+ transparent 100%
214
+ );
215
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
216
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
217
+ -webkit-mask-composite: source-in;
218
+ mask-composite: intersect;
219
+ -webkit-mask-repeat: no-repeat;
220
+ mask-repeat: no-repeat;
221
+
222
+ @supports (animation-timeline: scroll()) {
223
+ animation:
224
+ scroll-fade-reveal-t 1ms ease-in-out,
225
+ scroll-fade-reveal-b 1ms ease-in-out;
226
+ animation-timeline: scroll(self y), scroll(self y);
227
+ animation-range:
228
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
229
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
230
+ animation-fill-mode: both;
231
+ }
232
+
233
+ @supports not (animation-timeline: scroll()) {
234
+ --scroll-fade-t: var(--_scroll-fade-size-t);
235
+ --scroll-fade-b: var(--_scroll-fade-size-b);
236
+ }
237
+ }
238
+
239
+ @utility scroll-fade-y {
240
+ @apply scroll-fade;
241
+ }
242
+
243
+ @utility scroll-fade-x {
244
+ --_scroll-fade-size-s: var(--scroll-fade-s-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
245
+ --_scroll-fade-size-e: var(--scroll-fade-e-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
246
+ --scroll-fade-inline: linear-gradient(
247
+ to right,
248
+ transparent 0,
249
+ #000 var(--scroll-fade-s, 0px),
250
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
251
+ transparent 100%
252
+ );
253
+ &:where([dir='rtl'], [dir='rtl'] *) {
254
+ --scroll-fade-inline: linear-gradient(
255
+ to left,
256
+ transparent 0,
257
+ #000 var(--scroll-fade-s, 0px),
258
+ #000 calc(100% - var(--scroll-fade-e, 0px)),
259
+ transparent 100%
260
+ );
261
+ }
262
+ -webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
263
+ mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
264
+ -webkit-mask-composite: source-in;
265
+ mask-composite: intersect;
266
+ -webkit-mask-repeat: no-repeat;
267
+ mask-repeat: no-repeat;
268
+
269
+ @supports (animation-timeline: scroll()) {
270
+ animation:
271
+ scroll-fade-reveal-s 1ms ease-in-out,
272
+ scroll-fade-reveal-e 1ms ease-in-out;
273
+ animation-timeline: scroll(self inline), scroll(self inline);
274
+ animation-range:
275
+ 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
276
+ calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
277
+ animation-fill-mode: both;
278
+ }
279
+
280
+ @supports not (animation-timeline: scroll()) {
281
+ --scroll-fade-s: var(--_scroll-fade-size-s);
282
+ --scroll-fade-e: var(--_scroll-fade-size-e);
283
+ }
284
+ }
285
+
286
+ @utility scroll-fade-t {
287
+ --_scroll-fade-size-t: var(--scroll-fade-t-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
288
+ --scroll-fade-mask: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-t, 0px), #000 100%);
289
+ -webkit-mask-image: var(--scroll-fade-mask);
290
+ mask-image: var(--scroll-fade-mask);
291
+ -webkit-mask-composite: source-in;
292
+ mask-composite: intersect;
293
+ -webkit-mask-repeat: no-repeat;
294
+ mask-repeat: no-repeat;
295
+
296
+ @supports (animation-timeline: scroll()) {
297
+ animation: scroll-fade-reveal-t 1ms ease-in-out;
298
+ animation-timeline: scroll(self y);
299
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
300
+ animation-fill-mode: both;
301
+ }
302
+
303
+ @supports not (animation-timeline: scroll()) {
304
+ --scroll-fade-t: var(--_scroll-fade-size-t);
305
+ }
306
+ }
307
+
308
+ @utility scroll-fade-b {
309
+ --_scroll-fade-size-b: var(--scroll-fade-b-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
310
+ --scroll-fade-mask: linear-gradient(to bottom, #000 0, #000 calc(100% - var(--scroll-fade-b, 0px)), transparent 100%);
311
+ -webkit-mask-image: var(--scroll-fade-mask);
312
+ mask-image: var(--scroll-fade-mask);
313
+ -webkit-mask-composite: source-in;
314
+ mask-composite: intersect;
315
+ -webkit-mask-repeat: no-repeat;
316
+ mask-repeat: no-repeat;
317
+
318
+ @supports (animation-timeline: scroll()) {
319
+ animation: scroll-fade-reveal-b 1ms ease-in-out;
320
+ animation-timeline: scroll(self y);
321
+ animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
322
+ animation-fill-mode: both;
323
+ }
324
+
325
+ @supports not (animation-timeline: scroll()) {
326
+ --scroll-fade-b: var(--_scroll-fade-size-b);
327
+ }
328
+ }
329
+
330
+ @utility scroll-fade-l {
331
+ --_scroll-fade-size-s: var(--scroll-fade-s-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
332
+ --scroll-fade-mask: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s, 0px), #000 100%);
333
+ -webkit-mask-image: var(--scroll-fade-mask);
334
+ mask-image: var(--scroll-fade-mask);
335
+ -webkit-mask-composite: source-in;
336
+ mask-composite: intersect;
337
+ -webkit-mask-repeat: no-repeat;
338
+ mask-repeat: no-repeat;
339
+
340
+ @supports (animation-timeline: scroll()) {
341
+ animation: scroll-fade-reveal-s 1ms ease-in-out;
342
+ animation-timeline: scroll(self x);
343
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
344
+ animation-fill-mode: both;
345
+ }
346
+
347
+ @supports not (animation-timeline: scroll()) {
348
+ --scroll-fade-s: var(--_scroll-fade-size-s);
349
+ }
350
+ }
351
+
352
+ @utility scroll-fade-r {
353
+ --_scroll-fade-size-e: var(--scroll-fade-e-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
354
+ --scroll-fade-mask: linear-gradient(to right, #000 0, #000 calc(100% - var(--scroll-fade-e, 0px)), transparent 100%);
355
+ -webkit-mask-image: var(--scroll-fade-mask);
356
+ mask-image: var(--scroll-fade-mask);
357
+ -webkit-mask-composite: source-in;
358
+ mask-composite: intersect;
359
+ -webkit-mask-repeat: no-repeat;
360
+ mask-repeat: no-repeat;
361
+
362
+ @supports (animation-timeline: scroll()) {
363
+ animation: scroll-fade-reveal-e 1ms ease-in-out;
364
+ animation-timeline: scroll(self x);
365
+ animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
366
+ animation-fill-mode: both;
367
+ }
368
+
369
+ @supports not (animation-timeline: scroll()) {
370
+ --scroll-fade-e: var(--_scroll-fade-size-e);
371
+ }
372
+ }
373
+
374
+ @utility scroll-fade-s {
375
+ --_scroll-fade-size-s: var(--scroll-fade-s-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
376
+ --scroll-fade-mask: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-s, 0px), #000 100%);
377
+ &:where([dir='rtl'], [dir='rtl'] *) {
378
+ --scroll-fade-mask: linear-gradient(to left, transparent 0, #000 var(--scroll-fade-s, 0px), #000 100%);
379
+ }
380
+ -webkit-mask-image: var(--scroll-fade-mask);
381
+ mask-image: var(--scroll-fade-mask);
382
+ -webkit-mask-composite: source-in;
383
+ mask-composite: intersect;
384
+ -webkit-mask-repeat: no-repeat;
385
+ mask-repeat: no-repeat;
386
+
387
+ @supports (animation-timeline: scroll()) {
388
+ animation: scroll-fade-reveal-s 1ms ease-in-out;
389
+ animation-timeline: scroll(self inline);
390
+ animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
391
+ animation-fill-mode: both;
392
+ }
393
+
394
+ @supports not (animation-timeline: scroll()) {
395
+ --scroll-fade-s: var(--_scroll-fade-size-s);
396
+ }
397
+ }
398
+
399
+ @utility scroll-fade-e {
400
+ --_scroll-fade-size-e: var(--scroll-fade-e-size, var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10))));
401
+ --scroll-fade-mask: linear-gradient(to right, #000 0, #000 calc(100% - var(--scroll-fade-e, 0px)), transparent 100%);
402
+ &:where([dir='rtl'], [dir='rtl'] *) {
403
+ --scroll-fade-mask: linear-gradient(to left, #000 0, #000 calc(100% - var(--scroll-fade-e, 0px)), transparent 100%);
404
+ }
405
+ -webkit-mask-image: var(--scroll-fade-mask);
406
+ mask-image: var(--scroll-fade-mask);
407
+ -webkit-mask-composite: source-in;
408
+ mask-composite: intersect;
409
+ -webkit-mask-repeat: no-repeat;
410
+ mask-repeat: no-repeat;
411
+
412
+ @supports (animation-timeline: scroll()) {
413
+ animation: scroll-fade-reveal-e 1ms ease-in-out;
414
+ animation-timeline: scroll(self inline);
415
+ animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
416
+ animation-fill-mode: both;
417
+ }
418
+
419
+ @supports not (animation-timeline: scroll()) {
420
+ --scroll-fade-e: var(--_scroll-fade-size-e);
421
+ }
422
+ }
423
+
424
+ @utility scroll-fade-* {
425
+ --scroll-fade-size: calc(var(--spacing) * --value(integer));
426
+ --scroll-fade-size: --value([length], [percentage]);
427
+ }
428
+
429
+ @utility scroll-fade-t-* {
430
+ --scroll-fade-t-size: calc(var(--spacing) * --value(integer));
431
+ --scroll-fade-t-size: --value([length], [percentage]);
432
+ }
433
+
434
+ @utility scroll-fade-b-* {
435
+ --scroll-fade-b-size: calc(var(--spacing) * --value(integer));
436
+ --scroll-fade-b-size: --value([length], [percentage]);
437
+ }
438
+
439
+ @utility scroll-fade-s-* {
440
+ --scroll-fade-s-size: calc(var(--spacing) * --value(integer));
441
+ --scroll-fade-s-size: --value([length], [percentage]);
442
+ }
443
+
444
+ @utility scroll-fade-e-* {
445
+ --scroll-fade-e-size: calc(var(--spacing) * --value(integer));
446
+ --scroll-fade-e-size: --value([length], [percentage]);
447
+ }
448
+
449
+ @utility scroll-fade-none {
450
+ --scroll-fade-mask: none;
451
+ }
452
+
453
+ /* shimmer */
454
+ @property --shimmer-angle {
455
+ syntax: '<angle>';
456
+ inherits: true;
457
+ initial-value: 20deg;
458
+ }
459
+ @property --shimmer-image {
460
+ syntax: '*';
461
+ inherits: false;
462
+ }
463
+ @property --shimmer-text-fill {
464
+ syntax: '*';
465
+ inherits: false;
466
+ }
467
+
468
+ @theme inline {
469
+ @keyframes tw-shimmer {
470
+ from {
471
+ background-position: 100% 0;
472
+ }
473
+ to {
474
+ background-position: 0 0;
475
+ }
476
+ }
477
+ }
478
+
479
+ @utility shimmer {
480
+ --_spread: var(--shimmer-spread, calc(3ch + 40px));
481
+ --_base: currentColor;
482
+ --_highlight: var(--shimmer-color, oklch(from currentColor l c h / calc(alpha* 0.2)));
483
+
484
+ background-image: var(
485
+ --shimmer-image,
486
+ linear-gradient(
487
+ calc(90deg + var(--shimmer-angle)),
488
+ var(--_base) calc(50% - var(--_spread)),
489
+ color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% - var(--_spread) * 0.5),
490
+ var(--_highlight) 50%,
491
+ color-mix(in oklch, var(--_highlight), var(--_base) 50%) calc(50% + var(--_spread) * 0.5),
492
+ var(--_base) calc(50% + var(--_spread))
493
+ )
494
+ );
495
+ background-repeat: no-repeat;
496
+ background-size: calc(200% + var(--_spread) * 2) 100%;
497
+ background-position: 0 0;
498
+ background-clip: text;
499
+ -webkit-background-clip: text;
500
+ -webkit-text-fill-color: var(--shimmer-text-fill, transparent);
501
+ animation: tw-shimmer var(--shimmer-duration, 2s) linear infinite;
502
+
503
+ @variant dark {
504
+ --_highlight: var(--shimmer-color, oklch(from currentColor max(0.8, calc(l + 0.4)) c h / calc(alpha + 0.4)));
505
+ }
506
+
507
+ &:where([dir='rtl'], [dir='rtl'] *) {
508
+ animation-direction: reverse;
509
+ }
510
+ }
511
+
512
+ @utility shimmer-once {
513
+ animation-iteration-count: 1;
514
+ }
515
+
516
+ @utility shimmer-reverse {
517
+ animation-direction: reverse;
518
+ }
519
+
520
+ @utility shimmer-none {
521
+ --shimmer-image: none;
522
+ --shimmer-text-fill: currentColor;
523
+ }
524
+
525
+ @utility shimmer-color-* {
526
+ --shimmer-color: --value(--color, [color]);
527
+ --shimmer-color: color-mix(in oklch, --value(--color, [color]) calc(--modifier(integer) * 1%), transparent);
528
+ }
529
+
530
+ @utility shimmer-duration-* {
531
+ --shimmer-duration: calc(--value(integer) * 1ms);
532
+ }
533
+
534
+ @utility shimmer-spread-* {
535
+ --shimmer-spread: calc(var(--spacing) * --value(integer));
536
+ --shimmer-spread: --value([length], [percentage]);
537
+ }
538
+
539
+ @utility shimmer-angle-* {
540
+ --shimmer-angle: calc(--value(integer) * 1deg);
541
+ }
542
+
543
+ @media (prefers-reduced-motion: reduce) {
544
+ .shimmer {
545
+ animation: none;
546
+ background-image: none;
547
+ -webkit-text-fill-color: currentColor;
548
+ }
549
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spartan-ng/brain",
3
- "version": "1.2.0-beta.2",
3
+ "version": "1.2.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/spartan-ng/spartan.git"