@castlenine/svelte-aoe 1.1.0 → 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.
package/README.md CHANGED
@@ -11,7 +11,7 @@ A Svelte component to animate elements, without dependencies
11
11
 
12
12
  When the element is detected as being in the viewport, `@castlenine/svelte-aoe` applies a class that triggers a CSS animation.
13
13
 
14
- ## 🚀 [Demo](https://casltenine-svelte-aoe.vercel.app/)
14
+ ## 🚀 [Demo](https://castlenine-svelte-aoe.vercel.app/)
15
15
 
16
16
  ## Installation
17
17
 
@@ -93,6 +93,36 @@ File: `src/routes/+layout.svelte`
93
93
  - `fade-left-slow`
94
94
  - `fade-down-slow`
95
95
 
96
+ ### Normal speed partial fade
97
+
98
+ Start wih `0.25` opacity
99
+
100
+ - `partial-fade`
101
+ - `partial-fade-up`
102
+ - `partial-fade-right`
103
+ - `partial-fade-left`
104
+ - `partial-fade-down`
105
+
106
+ ### Fast speed partial fade
107
+
108
+ Start wih `0.25` opacity
109
+
110
+ - `partial-fade-fast`
111
+ - `partial-fade-up-fast`
112
+ - `partial-fade-right-fast`
113
+ - `partial-fade-left-fast`
114
+ - `partial-fade-down-fast`
115
+
116
+ ### Slow speed partial fade
117
+
118
+ Start wih `0.25` opacity
119
+
120
+ - `partial-fade-slow`
121
+ - `partial-fade-up-slow`
122
+ - `partial-fade-right-slow`
123
+ - `partial-fade-left-slow`
124
+ - `partial-fade-down-slow`
125
+
96
126
  You can add your own animations by following the same pattern in your CSS.
97
127
 
98
128
  ```css
@@ -117,7 +147,7 @@ You can add your own animations by following the same pattern in your CSS.
117
147
  | `rootMargin` | `string` in pixel (`px`) or percentage (`%`) | `0px` |
118
148
  | `threshold` | `number`, `number[]` between `0` and `1.0` | `0.3` |
119
149
 
120
- `root` is the element that is used as the viewport for checking visibility of the target. Must be the ancestor of the target. Defaults to the browser viewport if not specified or if `null`. Defaults to `null` (browser viewport).
150
+ `root` is the element that is used as the viewport for checking visibility of the target. Must be the ancestor of the target. Defaults to the browser viewport if not specified or if `null`.
121
151
 
122
152
  `rootMargin` is the margin around the root. Can have values similar to the CSS margin property, e.g. `"10px 20px 30px 40px"` (top, right, bottom, left). The values can be percentages. Defaults to `'0px'` (no margin).
123
153
 
@@ -125,7 +155,7 @@ You can add your own animations by following the same pattern in your CSS.
125
155
 
126
156
  ---
127
157
 
128
- Inspired by [Animate on Scroll](https://michalsnik.github.io/aos/) and [lliamscholtz/svelte-aoe](https://github.com/lliamscholtz/svelte-aoe)
158
+ Inspired by [Animate on Scroll](https://michalsnik.github.io/aos/) and forked from [lliamscholtz/svelte-aoe](https://github.com/lliamscholtz/svelte-aoe)
129
159
 
130
160
  [npm]: https://www.npmjs.com/package/@castlenine/svelte-aoe
131
161
  [npm.badge]: https://img.shields.io/npm/v/@castlenine/svelte-aoe
@@ -355,7 +355,211 @@
355
355
  }
356
356
  }
357
357
 
358
- /** You can add your own animations by following the same pattern
358
+ /* **************************************************** */
359
+ /* partial-fade-[direction] */
360
+
361
+ /* normal speed */
362
+ [data-aoe='partial-fade'] {
363
+ opacity: 0.25;
364
+ transition: opacity 900ms;
365
+
366
+ &.aoe {
367
+ opacity: 1;
368
+ transition-delay: 0s;
369
+ }
370
+ }
371
+
372
+ [data-aoe='partial-fade-up'] {
373
+ opacity: 0.25;
374
+ transform: translateY(45px);
375
+ transition:
376
+ transform 600ms,
377
+ opacity 900ms;
378
+
379
+ &.aoe {
380
+ opacity: 1;
381
+ transform: translateY(0);
382
+ transition-delay: 0s;
383
+ }
384
+ }
385
+
386
+ [data-aoe='partial-fade-right'] {
387
+ opacity: 0.25;
388
+ transform: translateX(-45px);
389
+ transition:
390
+ transform 600ms,
391
+ opacity 900ms;
392
+
393
+ &.aoe {
394
+ opacity: 1;
395
+ transform: translateX(0);
396
+ transition-delay: 0s;
397
+ }
398
+ }
399
+
400
+ [data-aoe='partial-fade-down'] {
401
+ opacity: 0.25;
402
+ transform: translateY(-45px);
403
+ transition:
404
+ transform 600ms,
405
+ opacity 900ms;
406
+
407
+ &.aoe {
408
+ opacity: 1;
409
+ transform: translateY(0);
410
+ transition-delay: 0s;
411
+ }
412
+ }
413
+
414
+ [data-aoe='partial-fade-left'] {
415
+ opacity: 0.25;
416
+ transform: translateX(45px);
417
+ transition:
418
+ transform 600ms,
419
+ opacity 900ms;
420
+
421
+ &.aoe {
422
+ opacity: 1;
423
+ transform: translateX(0);
424
+ transition-delay: 0s;
425
+ }
426
+ }
427
+
428
+ /* fast speed */
429
+ [data-aoe='partial-fade-fast'] {
430
+ opacity: 0.25;
431
+ transition: opacity 555ms;
432
+
433
+ &.aoe {
434
+ opacity: 1;
435
+ transition-delay: 0s;
436
+ }
437
+ }
438
+
439
+ [data-aoe='partial-fade-up-fast'] {
440
+ opacity: 0.25;
441
+ transform: translateY(45px);
442
+ transition:
443
+ transform 370ms,
444
+ opacity 555ms;
445
+
446
+ &.aoe {
447
+ opacity: 1;
448
+ transform: translateY(0);
449
+ transition-delay: 0s;
450
+ }
451
+ }
452
+
453
+ [data-aoe='partial-fade-right-fast'] {
454
+ opacity: 0.25;
455
+ transform: translateX(-45px);
456
+ transition:
457
+ transform 370ms,
458
+ opacity 555ms;
459
+
460
+ &.aoe {
461
+ opacity: 1;
462
+ transform: translateX(0);
463
+ transition-delay: 0s;
464
+ }
465
+ }
466
+
467
+ [data-aoe='partial-fade-down-fast'] {
468
+ opacity: 0.25;
469
+ transform: translateY(-45px);
470
+ transition:
471
+ transform 370ms,
472
+ opacity 555ms;
473
+
474
+ &.aoe {
475
+ opacity: 1;
476
+ transform: translateY(0);
477
+ transition-delay: 0s;
478
+ }
479
+ }
480
+
481
+ [data-aoe='partial-fade-left-fast'] {
482
+ opacity: 0.25;
483
+ transform: translateX(45px);
484
+ transition:
485
+ transform 370ms,
486
+ opacity 555ms;
487
+
488
+ &.aoe {
489
+ opacity: 1;
490
+ transform: translateX(0);
491
+ transition-delay: 0s;
492
+ }
493
+ }
494
+
495
+ /* slow speed */
496
+ [data-aoe='partial-fade-slow'] {
497
+ opacity: 0.25;
498
+ transition: opacity 1500ms;
499
+
500
+ &.aoe {
501
+ opacity: 1;
502
+ transition-delay: 0s;
503
+ }
504
+ }
505
+
506
+ [data-aoe='partial-fade-up-slow'] {
507
+ opacity: 0.25;
508
+ transform: translateY(45px);
509
+ transition:
510
+ transform 975ms,
511
+ opacity 1500ms;
512
+
513
+ &.aoe {
514
+ opacity: 1;
515
+ transform: translateY(0);
516
+ transition-delay: 0s;
517
+ }
518
+ }
519
+
520
+ [data-aoe='partial-fade-right-slow'] {
521
+ opacity: 0.25;
522
+ transform: translateX(-45px);
523
+ transition:
524
+ transform 975ms,
525
+ opacity 1500ms;
526
+
527
+ &.aoe {
528
+ opacity: 1;
529
+ transform: translateX(0);
530
+ transition-delay: 0s;
531
+ }
532
+ }
533
+
534
+ [data-aoe='partial-fade-down-slow'] {
535
+ opacity: 0.25;
536
+ transform: translateY(-45px);
537
+ transition:
538
+ transform 975ms,
539
+ opacity 1500ms;
540
+
541
+ &.aoe {
542
+ opacity: 1;
543
+ transform: translateY(0);
544
+ transition-delay: 0s;
545
+ }
546
+ }
547
+
548
+ [data-aoe='partial-fade-left-slow'] {
549
+ opacity: 0.25;
550
+ transform: translateX(45px);
551
+ transition:
552
+ transform 975ms,
553
+ opacity 1500ms;
554
+
555
+ &.aoe {
556
+ opacity: 1;
557
+ transform: translateX(0);
558
+ transition-delay: 0s;
559
+ }
560
+ }
561
+
562
+ /** You can add your own animations by following the same in your own css file
359
563
  [data-aoe='your-animation'] {
360
564
  transform: translateX(-45px);
361
565
  transition:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@castlenine/svelte-aoe",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A Svelte component to animate elements, without dependencies.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -8,8 +8,10 @@
8
8
  "animate",
9
9
  "animation-on-scroll",
10
10
  "animation",
11
+ "component",
11
12
  "css",
12
- "svelte"
13
+ "svelte",
14
+ "sveltekit"
13
15
  ],
14
16
  "author": {
15
17
  "name": "Alexandre Castlenine",
@@ -39,7 +41,7 @@
39
41
  ],
40
42
  "scripts": {
41
43
  "dev": "vite dev",
42
- "build": "vite build",
44
+ "build": "npm run check && vite build",
43
45
  "preview": "vite preview",
44
46
  "package": "npm run remove-dist-folder && svelte-kit sync && svelte-package && publint",
45
47
  "prepublishOnly": "npm run package",