morphing-scroll 1.5.17 → 1.5.18
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 +97 -158
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,9 +58,7 @@ npm install morphing-scroll
|
|
|
58
58
|
|
|
59
59
|
</ul>
|
|
60
60
|
</details>
|
|
61
|
-
|
|
62
61
|
<h2></h2>
|
|
63
|
-
|
|
64
62
|
<details>
|
|
65
63
|
<summary><strong><code>children</code></strong> : <em>Custom user content.</em></summary><br />
|
|
66
64
|
<ul>
|
|
@@ -83,7 +81,6 @@ npm install morphing-scroll
|
|
|
83
81
|
|
|
84
82
|
</ul>
|
|
85
83
|
</details>
|
|
86
|
-
|
|
87
84
|
<h2></h2>
|
|
88
85
|
|
|
89
86
|
#### SCROLL SETTINGS:
|
|
@@ -113,9 +110,7 @@ npm install morphing-scroll
|
|
|
113
110
|
|
|
114
111
|
</ul>
|
|
115
112
|
</details>
|
|
116
|
-
|
|
117
113
|
<h2></h2>
|
|
118
|
-
|
|
119
114
|
<details>
|
|
120
115
|
<summary><strong><code>direction</code></strong> : <em>Scrolling direction.</em></summary><br />
|
|
121
116
|
<ul>
|
|
@@ -140,9 +135,7 @@ npm install morphing-scroll
|
|
|
140
135
|
|
|
141
136
|
</ul>
|
|
142
137
|
</details>
|
|
143
|
-
|
|
144
138
|
<h2></h2>
|
|
145
|
-
|
|
146
139
|
<details>
|
|
147
140
|
<summary><strong><code>scrollTop</code></strong> : <em>Scroll position and animation duration.</em></summary><br />
|
|
148
141
|
<ul>
|
|
@@ -178,9 +171,7 @@ npm install morphing-scroll
|
|
|
178
171
|
|
|
179
172
|
</ul>
|
|
180
173
|
</details>
|
|
181
|
-
|
|
182
174
|
<h2></h2>
|
|
183
|
-
|
|
184
175
|
<details>
|
|
185
176
|
<summary><strong><code>stopLoadOnScroll</code></strong> : <em>Stop loading when scrolling.</em></summary><br />
|
|
186
177
|
<ul>
|
|
@@ -204,9 +195,7 @@ npm install morphing-scroll
|
|
|
204
195
|
|
|
205
196
|
</ul>
|
|
206
197
|
</details>
|
|
207
|
-
|
|
208
198
|
<h2></h2>
|
|
209
|
-
|
|
210
199
|
<details>
|
|
211
200
|
<summary><strong><code>onScrollValue</code></strong> : <em>Callback for scroll value.</em></summary><br />
|
|
212
201
|
<ul>
|
|
@@ -233,9 +222,7 @@ npm install morphing-scroll
|
|
|
233
222
|
|
|
234
223
|
</ul>
|
|
235
224
|
</details>
|
|
236
|
-
|
|
237
|
-
<h2></h2>
|
|
238
|
-
|
|
225
|
+
<h2></h2>
|
|
239
226
|
<details>
|
|
240
227
|
<summary><strong><code>isScrolling</code></strong> : <em>Callback function for scroll status.</em></summary><br />
|
|
241
228
|
<ul>
|
|
@@ -259,7 +246,6 @@ npm install morphing-scroll
|
|
|
259
246
|
|
|
260
247
|
</ul>
|
|
261
248
|
</details>
|
|
262
|
-
|
|
263
249
|
<h2></h2>
|
|
264
250
|
|
|
265
251
|
#### VISUAL SETTINGS:
|
|
@@ -293,9 +279,7 @@ npm install morphing-scroll
|
|
|
293
279
|
|
|
294
280
|
</ul>
|
|
295
281
|
</details>
|
|
296
|
-
|
|
297
282
|
<h2></h2>
|
|
298
|
-
|
|
299
283
|
<details>
|
|
300
284
|
<summary><strong><code>objectsSize</code> (required)</strong> : <em>Required: Size of cells for each object.</em></summary><br />
|
|
301
285
|
<ul>
|
|
@@ -326,9 +310,7 @@ npm install morphing-scroll
|
|
|
326
310
|
|
|
327
311
|
</ul>
|
|
328
312
|
</details>
|
|
329
|
-
|
|
330
313
|
<h2></h2>
|
|
331
|
-
|
|
332
314
|
<details>
|
|
333
315
|
<summary><strong><code>gap</code></strong> : <em>Gap between cells.</em></summary><br />
|
|
334
316
|
<ul>
|
|
@@ -354,9 +336,7 @@ npm install morphing-scroll
|
|
|
354
336
|
|
|
355
337
|
</ul>
|
|
356
338
|
</details>
|
|
357
|
-
|
|
358
339
|
<h2></h2>
|
|
359
|
-
|
|
360
340
|
<details>
|
|
361
341
|
<summary><strong><code>padding</code></strong> : <em>Padding for the <code>objectsWrapper</code>.</em></summary><br />
|
|
362
342
|
<ul>
|
|
@@ -393,9 +373,7 @@ npm install morphing-scroll
|
|
|
393
373
|
|
|
394
374
|
</ul>
|
|
395
375
|
</details>
|
|
396
|
-
|
|
397
376
|
<h2></h2>
|
|
398
|
-
|
|
399
377
|
<details>
|
|
400
378
|
<summary><strong><code>contentAlign</code></strong> : <em>Aligns the content when it is smaller than the MorphScroll <code>size</code>.</em></summary><br />
|
|
401
379
|
<ul>
|
|
@@ -427,9 +405,7 @@ npm install morphing-scroll
|
|
|
427
405
|
|
|
428
406
|
</ul>
|
|
429
407
|
</details>
|
|
430
|
-
|
|
431
408
|
<h2></h2>
|
|
432
|
-
|
|
433
409
|
<details>
|
|
434
410
|
<summary><strong><code>elementsAlign</code></strong> : <em>Aligns the objects within the <code>objectsWrapper</code>.</em></summary><br />
|
|
435
411
|
<ul>
|
|
@@ -448,9 +424,7 @@ npm install morphing-scroll
|
|
|
448
424
|
|
|
449
425
|
</ul>
|
|
450
426
|
</details>
|
|
451
|
-
|
|
452
427
|
<h2></h2>
|
|
453
|
-
|
|
454
428
|
<details>
|
|
455
429
|
<summary><strong><code>edgeGradient</code></strong> : <em>Gradient when scrolling overflows.</em></summary><br />
|
|
456
430
|
<ul>
|
|
@@ -481,9 +455,7 @@ npm install morphing-scroll
|
|
|
481
455
|
|
|
482
456
|
</ul>
|
|
483
457
|
</details>
|
|
484
|
-
|
|
485
458
|
<h2></h2>
|
|
486
|
-
|
|
487
459
|
<details>
|
|
488
460
|
<summary><strong><code>progressReverse</code></strong> : <em>Reverse the progress bar position.</em></summary><br />
|
|
489
461
|
<ul>
|
|
@@ -511,9 +483,7 @@ npm install morphing-scroll
|
|
|
511
483
|
|
|
512
484
|
</ul>
|
|
513
485
|
</details>
|
|
514
|
-
|
|
515
486
|
<h2></h2>
|
|
516
|
-
|
|
517
487
|
<details>
|
|
518
488
|
<summary><strong><code>progressVisibility</code></strong> : <em>Visibility of the progress bar.</em></summary><br />
|
|
519
489
|
<ul>
|
|
@@ -537,9 +507,7 @@ npm install morphing-scroll
|
|
|
537
507
|
|
|
538
508
|
</ul>
|
|
539
509
|
</details>
|
|
540
|
-
|
|
541
510
|
<h2></h2>
|
|
542
|
-
|
|
543
511
|
<details>
|
|
544
512
|
<summary><strong><code>objectsWrapFullMinSize</code></strong> : <em>Sets the <code>min-height</code> CSS property of the <code>objectsWrapper</code> to match the height of the MorphScroll.</em></summary><br />
|
|
545
513
|
<ul>
|
|
@@ -561,7 +529,6 @@ npm install morphing-scroll
|
|
|
561
529
|
|
|
562
530
|
</ul>
|
|
563
531
|
</details>
|
|
564
|
-
|
|
565
532
|
<h2></h2>
|
|
566
533
|
|
|
567
534
|
#### PROGRESS AND RENDERING:
|
|
@@ -604,9 +571,7 @@ npm install morphing-scroll
|
|
|
604
571
|
|
|
605
572
|
</ul>
|
|
606
573
|
</details>
|
|
607
|
-
|
|
608
574
|
<h2></h2>
|
|
609
|
-
|
|
610
575
|
<details>
|
|
611
576
|
<summary><strong><code>render</code></strong> : <em>Types of rendering for optimization.</em></summary><br />
|
|
612
577
|
<ul>
|
|
@@ -657,9 +622,7 @@ npm install morphing-scroll
|
|
|
657
622
|
|
|
658
623
|
</ul>
|
|
659
624
|
</details>
|
|
660
|
-
|
|
661
625
|
<h2></h2>
|
|
662
|
-
|
|
663
626
|
<details>
|
|
664
627
|
<summary><strong><code>emptyElements</code></strong> : <em>Handling of empty scroll elements.</em></summary><br />
|
|
665
628
|
<ul>
|
|
@@ -709,9 +672,7 @@ npm install morphing-scroll
|
|
|
709
672
|
|
|
710
673
|
</ul>
|
|
711
674
|
</details>
|
|
712
|
-
|
|
713
675
|
<h2></h2>
|
|
714
|
-
|
|
715
676
|
<details>
|
|
716
677
|
<summary><strong><code>suspending</code></strong> : <em>Adds React Suspense.</em></summary><br />
|
|
717
678
|
<ul>
|
|
@@ -724,20 +685,18 @@ npm install morphing-scroll
|
|
|
724
685
|
<br />
|
|
725
686
|
<strong>Example:</strong>
|
|
726
687
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
688
|
+
```tsx
|
|
689
|
+
<MorphScroll
|
|
690
|
+
suspending
|
|
691
|
+
// another props
|
|
692
|
+
>
|
|
693
|
+
{children}
|
|
694
|
+
</MorphScroll>
|
|
695
|
+
```
|
|
735
696
|
|
|
736
697
|
</ul>
|
|
737
698
|
</details>
|
|
738
|
-
|
|
739
699
|
<h2></h2>
|
|
740
|
-
|
|
741
700
|
<details>
|
|
742
701
|
<summary><strong><code>fallback</code></strong> : <em>Fallback element.</em></summary><br />
|
|
743
702
|
<ul>
|
|
@@ -748,14 +707,14 @@ npm install morphing-scroll
|
|
|
748
707
|
<br />
|
|
749
708
|
<strong>Example:</strong>
|
|
750
709
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
710
|
+
```tsx
|
|
711
|
+
<MorphScroll
|
|
712
|
+
fallback={<div>Loading...</div>}
|
|
713
|
+
// another props
|
|
714
|
+
>
|
|
715
|
+
{children}
|
|
716
|
+
</MorphScroll>
|
|
717
|
+
```
|
|
759
718
|
|
|
760
719
|
</ul>
|
|
761
720
|
</details>
|
|
@@ -792,24 +751,22 @@ npm install morphing-scroll
|
|
|
792
751
|
<br />
|
|
793
752
|
<strong>Example:</strong>
|
|
794
753
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
754
|
+
```tsx
|
|
755
|
+
<ResizeTracker
|
|
756
|
+
// another props
|
|
757
|
+
>
|
|
758
|
+
{(rect) => (
|
|
759
|
+
<p>
|
|
760
|
+
Width: {rect.width}, Height: {rect.height}
|
|
761
|
+
</p>
|
|
762
|
+
)}
|
|
763
|
+
</ResizeTracker>
|
|
764
|
+
```
|
|
806
765
|
|
|
807
766
|
</ul>
|
|
808
767
|
|
|
809
768
|
</details>
|
|
810
|
-
|
|
811
769
|
<h2></h2>
|
|
812
|
-
|
|
813
770
|
<details>
|
|
814
771
|
<summary><strong><code>style</code></strong> : <em>Applies inline styles to the container.</em></summary><br />
|
|
815
772
|
<ul>
|
|
@@ -817,20 +774,18 @@ npm install morphing-scroll
|
|
|
817
774
|
<br />
|
|
818
775
|
<strong>Example:</strong>
|
|
819
776
|
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
777
|
+
```tsx
|
|
778
|
+
<ResizeTracker style={{ backgroundColor: "blue" }}>
|
|
779
|
+
{(rect) => (
|
|
780
|
+
// content
|
|
781
|
+
)}
|
|
782
|
+
</ResizeTracker>
|
|
783
|
+
```
|
|
827
784
|
|
|
828
785
|
</ul>
|
|
829
786
|
|
|
830
787
|
</details>
|
|
831
|
-
|
|
832
788
|
<h2></h2>
|
|
833
|
-
|
|
834
789
|
<details>
|
|
835
790
|
<summary><strong><code>measure</code></strong> : <em>Defines the measurement strategy.</em></summary><br />
|
|
836
791
|
<ul>
|
|
@@ -849,20 +804,18 @@ npm install morphing-scroll
|
|
|
849
804
|
<br />
|
|
850
805
|
<strong>Example:</strong>
|
|
851
806
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
807
|
+
```tsx
|
|
808
|
+
<ResizeTracker measure="all">
|
|
809
|
+
{(rect) => (
|
|
810
|
+
// content
|
|
811
|
+
)}
|
|
812
|
+
</ResizeTracker>
|
|
813
|
+
```
|
|
859
814
|
|
|
860
815
|
</ul>
|
|
861
816
|
|
|
862
817
|
</details>
|
|
863
|
-
|
|
864
818
|
<h2></h2>
|
|
865
|
-
|
|
866
819
|
<details>
|
|
867
820
|
<summary><strong><code>onResize</code></strong> : <em>Callback triggered on size changes.</em></summary><br />
|
|
868
821
|
<ul>
|
|
@@ -874,22 +827,21 @@ npm install morphing-scroll
|
|
|
874
827
|
<br />
|
|
875
828
|
<strong>Example:</strong>
|
|
876
829
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
830
|
+
```tsx
|
|
831
|
+
<ResizeTracker
|
|
832
|
+
onResize={(rect) => {
|
|
833
|
+
console.log("New size:", rect);
|
|
834
|
+
}}
|
|
835
|
+
>
|
|
836
|
+
{(rect) => (
|
|
837
|
+
// content
|
|
838
|
+
)}
|
|
839
|
+
</ResizeTracker>
|
|
840
|
+
```
|
|
888
841
|
|
|
889
842
|
</ul>
|
|
890
843
|
|
|
891
844
|
</details>
|
|
892
|
-
|
|
893
845
|
<h2></h2>
|
|
894
846
|
|
|
895
847
|
- ### Link:
|
|
@@ -911,16 +863,14 @@ npm install morphing-scroll
|
|
|
911
863
|
<br />
|
|
912
864
|
<strong>Example:</strong>
|
|
913
865
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
866
|
+
```tsx
|
|
867
|
+
<IntersectionTracker>{children}</IntersectionTracker>
|
|
868
|
+
```
|
|
917
869
|
|
|
918
870
|
</ul>
|
|
919
871
|
|
|
920
872
|
</details>
|
|
921
|
-
|
|
922
873
|
<h2></h2>
|
|
923
|
-
|
|
924
874
|
<details>
|
|
925
875
|
<summary><strong><code>style</code></strong> : <em>Applies inline styles to the container.</em></summary><br />
|
|
926
876
|
<ul>
|
|
@@ -928,18 +878,16 @@ npm install morphing-scroll
|
|
|
928
878
|
<br />
|
|
929
879
|
<strong>Example:</strong>
|
|
930
880
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
881
|
+
```tsx
|
|
882
|
+
<IntersectionTracker style={{ backgroundColor: "blue" }}>
|
|
883
|
+
{children}
|
|
884
|
+
</IntersectionTracker>
|
|
885
|
+
```
|
|
936
886
|
|
|
937
887
|
</ul>
|
|
938
888
|
|
|
939
889
|
</details>
|
|
940
|
-
|
|
941
890
|
<h2></h2>
|
|
942
|
-
|
|
943
891
|
<details>
|
|
944
892
|
<summary><strong><code>root</code></strong> : <em>Defines the observation area.</em></summary><br />
|
|
945
893
|
<ul>
|
|
@@ -955,18 +903,16 @@ npm install morphing-scroll
|
|
|
955
903
|
<br />
|
|
956
904
|
<strong>Example:</strong>
|
|
957
905
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
906
|
+
```tsx
|
|
907
|
+
<IntersectionTracker root={document.getElementById("root")}>
|
|
908
|
+
{children}
|
|
909
|
+
</IntersectionTracker>
|
|
910
|
+
```
|
|
963
911
|
|
|
964
912
|
</ul>
|
|
965
913
|
|
|
966
914
|
</details>
|
|
967
|
-
|
|
968
915
|
<h2></h2>
|
|
969
|
-
|
|
970
916
|
<details>
|
|
971
917
|
<summary><strong><code>rootMargin</code></strong> : <em>Sets the margin around the root element.</em></summary><br />
|
|
972
918
|
<ul>
|
|
@@ -986,22 +932,20 @@ npm install morphing-scroll
|
|
|
986
932
|
<br />
|
|
987
933
|
<strong>Example:</strong>
|
|
988
934
|
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
935
|
+
```tsx
|
|
936
|
+
<IntersectionTracker
|
|
937
|
+
rootMargin={10}
|
|
938
|
+
// rootMargin={[10, 20]}
|
|
939
|
+
// rootMargin={[10, 20, 10, 20]}
|
|
940
|
+
>
|
|
941
|
+
{children}
|
|
942
|
+
</IntersectionTracker>
|
|
943
|
+
```
|
|
998
944
|
|
|
999
945
|
</ul>
|
|
1000
946
|
|
|
1001
947
|
</details>
|
|
1002
|
-
|
|
1003
948
|
<h2></h2>
|
|
1004
|
-
|
|
1005
949
|
<details>
|
|
1006
950
|
<summary><strong><code>threshold</code></strong> : <em>Defines when the callback is triggered.</em></summary><br />
|
|
1007
951
|
<ul>
|
|
@@ -1019,21 +963,19 @@ npm install morphing-scroll
|
|
|
1019
963
|
<br />
|
|
1020
964
|
<strong>Example:</strong>
|
|
1021
965
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
966
|
+
```tsx
|
|
967
|
+
<IntersectionTracker
|
|
968
|
+
threshold={0.5}
|
|
969
|
+
// threshold={[0, 0.5, 1]}
|
|
970
|
+
>
|
|
971
|
+
{children}
|
|
972
|
+
</IntersectionTracker>
|
|
973
|
+
```
|
|
1030
974
|
|
|
1031
975
|
</ul>
|
|
1032
976
|
|
|
1033
977
|
</details>
|
|
1034
|
-
|
|
1035
978
|
<h2></h2>
|
|
1036
|
-
|
|
1037
979
|
<details>
|
|
1038
980
|
<summary><strong><code>visibleContent</code></strong> : <em>Makes all elements always visible.</em></summary><br />
|
|
1039
981
|
<ul>
|
|
@@ -1048,16 +990,14 @@ npm install morphing-scroll
|
|
|
1048
990
|
<br />
|
|
1049
991
|
<strong>Example:</strong>
|
|
1050
992
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
993
|
+
```tsx
|
|
994
|
+
<IntersectionTracker visibleContent>{children}</IntersectionTracker>
|
|
995
|
+
```
|
|
1054
996
|
|
|
1055
997
|
</ul>
|
|
1056
998
|
|
|
1057
999
|
</details>
|
|
1058
|
-
|
|
1059
1000
|
<h2></h2>
|
|
1060
|
-
|
|
1061
1001
|
<details>
|
|
1062
1002
|
<summary><strong><code>onVisible</code></strong> : <em>Callback function triggered when the element becomes visible.</em></summary><br />
|
|
1063
1003
|
<ul>
|
|
@@ -1074,22 +1014,21 @@ npm install morphing-scroll
|
|
|
1074
1014
|
<br />
|
|
1075
1015
|
<strong>Example:</strong>
|
|
1076
1016
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1017
|
+
```tsx
|
|
1018
|
+
<IntersectionTracker
|
|
1019
|
+
onVisible={(key) => {
|
|
1020
|
+
if (key.includes("elementId")) {
|
|
1021
|
+
// do something
|
|
1022
|
+
}
|
|
1023
|
+
}}
|
|
1024
|
+
>
|
|
1025
|
+
{children}
|
|
1026
|
+
</IntersectionTracker>
|
|
1027
|
+
```
|
|
1088
1028
|
|
|
1089
1029
|
</ul>
|
|
1090
1030
|
|
|
1091
1031
|
</details>
|
|
1092
|
-
|
|
1093
1032
|
<h2></h2>
|
|
1094
1033
|
|
|
1095
1034
|
- ### Link:
|