nodality 1.0.84 → 1.0.104
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/dist/animator.cjs.js +1 -2
- package/dist/animator.esm.js +1 -2
- package/dist/appleanim.cjs.js +1 -1
- package/dist/appleanim.esm.js +1 -1
- package/dist/audionew.cjs.js +1 -2
- package/dist/audionew.esm.js +1 -2
- package/dist/base.cjs.js +0 -1
- package/dist/base.esm.js +1 -2
- package/dist/beta-desktop-bar.cjs.js +1 -0
- package/dist/beta-desktop-bar.esm.js +1 -0
- package/dist/beta-mobile-bar.cjs.js +1 -0
- package/dist/beta-mobile-bar.esm.js +1 -0
- package/dist/betaDesktopBar.esm.js +1 -1
- package/dist/betaMobileBar.esm.js +1 -1
- package/dist/bundle.umd.js +1 -2
- package/dist/button.cjs.js +1 -2
- package/dist/button.esm.js +1 -2
- package/dist/card-getter.cjs.js +1 -0
- package/dist/card-getter.esm.js +1 -0
- package/dist/cardGetter.esm.js +1 -1
- package/dist/center.cjs.js +1 -2
- package/dist/center.esm.js +1 -2
- package/dist/checkbox.cjs.js +1 -2
- package/dist/checkbox.esm.js +1 -2
- package/dist/code.cjs.js +1 -2
- package/dist/code.esm.js +1 -2
- package/dist/container.cjs.js +1 -2
- package/dist/container.esm.js +1 -2
- package/dist/data-list.cjs.js +1 -0
- package/dist/data-list.esm.js +1 -0
- package/dist/designer.cjs.js +1 -2
- package/dist/designer.esm.js +1 -2
- package/dist/dropdown.cjs.js +1 -2
- package/dist/dropdown.esm.js +1 -2
- package/dist/element-mapper.cjs.js +1 -0
- package/dist/element-mapper.esm.js +1 -0
- package/dist/elementMapper.cjs.js +1 -1
- package/dist/elementMapper.esm.js +1 -1
- package/dist/finalresult.esm.js +1 -2
- package/dist/flex-card.cjs.js +1 -0
- package/dist/flex-card.esm.js +1 -0
- package/dist/flex-grid.cjs.js +1 -0
- package/dist/flex-grid.esm.js +1 -0
- package/dist/flex-row.cjs.js +1 -0
- package/dist/flex-row.esm.js +1 -0
- package/dist/flexCard.cjs.js +1 -1
- package/dist/flexCard.esm.js +1 -1
- package/dist/floating-input.cjs.js +1 -0
- package/dist/floating-input.esm.js +1 -0
- package/dist/free.cjs.js +1 -2
- package/dist/free.esm.js +1 -2
- package/dist/horizontal-scroller.cjs.js +1 -0
- package/dist/horizontal-scroller.esm.js +1 -0
- package/dist/image-picker.cjs.js +1 -0
- package/dist/image-picker.esm.js +1 -0
- package/dist/image.cjs.js +1 -2
- package/dist/image.esm.js +1 -2
- package/dist/index.cjs.js +1 -2
- package/dist/index.esm.js +1 -2
- package/dist/keyframe-animation.cjs.js +1 -0
- package/dist/keyframe-animation.esm.js +1 -0
- package/dist/link-getter.cjs.js +1 -0
- package/dist/link-getter.esm.js +1 -0
- package/dist/link.cjs.js +1 -2
- package/dist/link.esm.js +1 -2
- package/dist/linkGetter.cjs.js +1 -1
- package/dist/linkGetter.esm.js +1 -1
- package/dist/meta-adder.cjs.js +1 -0
- package/dist/meta-adder.esm.js +1 -0
- package/dist/modal-2025.cjs.js +1 -0
- package/dist/modal-2025.esm.js +1 -0
- package/dist/multiswitcher.cjs.js +1 -0
- package/dist/multiswitcher.esm.js +1 -0
- package/dist/new-nav-bar.cjs.js +1 -0
- package/dist/new-nav-bar.esm.js +1 -0
- package/dist/picker.cjs.js +1 -2
- package/dist/picker.esm.js +1 -2
- package/dist/progress.cjs.js +1 -2
- package/dist/progress.esm.js +1 -2
- package/dist/radio.cjs.js +1 -2
- package/dist/radio.esm.js +1 -2
- package/dist/range.cjs.js +1 -2
- package/dist/range.esm.js +1 -2
- package/dist/scroll-video.cjs.js +1 -0
- package/dist/scroll-video.esm.js +1 -0
- package/dist/scrollvideo.cjs.js +1 -1
- package/dist/scrollvideo.esm.js +1 -1
- package/dist/side-bar.cjs.js +1 -0
- package/dist/side-bar.esm.js +1 -0
- package/dist/side-nav-bar.cjs.js +1 -0
- package/dist/side-nav-bar.esm.js +1 -0
- package/dist/simple-bar.cjs.js +1 -0
- package/dist/simple-bar.esm.js +1 -0
- package/dist/slider-2025.cjs.js +1 -0
- package/dist/slider-2025.esm.js +1 -0
- package/dist/spacer.cjs.js +0 -1
- package/dist/spacer.esm.js +1 -0
- package/dist/stack.cjs.js +1 -2
- package/dist/stack.esm.js +1 -2
- package/dist/stacker.cjs.js +1 -2
- package/dist/stacker.esm.js +1 -2
- package/dist/table.cjs.js +1 -2
- package/dist/table.esm.js +1 -2
- package/dist/text-field.cjs.js +1 -0
- package/dist/text-field.esm.js +1 -0
- package/dist/text.cjs.js +1 -2
- package/dist/text.esm.js +1 -2
- package/dist/transform-anim.cjs.js +1 -0
- package/dist/transform-anim.esm.js +1 -0
- package/dist/transformanim.cjs.js +1 -1
- package/dist/transformanim.esm.js +1 -1
- package/dist/ulist.cjs.js +1 -2
- package/dist/ulist.esm.js +1 -2
- package/dist/video.cjs.js +1 -0
- package/dist/video.esm.js +1 -2
- package/dist/wrap.cjs.js +0 -1
- package/dist/wrap.esm.js +1 -2
- package/dist/zoom-card.cjs.js +1 -0
- package/dist/zoom-card.esm.js +1 -0
- package/layout/animator.js +1 -1
- package/layout/audio.js +1 -1
- package/layout/audionew.js +1 -1
- package/layout/base-2.js +1 -1
- package/layout/base.js +1 -1
- package/layout/{betaDesktopBar.js → beta-desktop-bar.js} +1 -1
- package/layout/{betaMobileBar.js → beta-mobile-bar.js} +1 -1
- package/layout/box.js +1 -1
- package/layout/button.js +1 -1
- package/layout/cards.js +2 -1
- package/layout/center.js +1 -1
- package/layout/checkbox.js +1 -1
- package/layout/circle.js +1 -1
- package/layout/{cleanRow.js → clean-row.js} +1 -1
- package/layout/code.js +1 -1
- package/layout/container.js +1 -1
- package/layout/custom.js +1 -1
- package/layout/{divImage.js → div-image.js} +1 -1
- package/layout/{dropdown2025.js → dropdown-2025.js} +6 -1
- package/layout/dropdown.js +1 -1
- package/layout/{emptyElement.js → empty-element.js} +1 -1
- package/layout/{externalStylesheet.js → external-stylesheet.js} +1 -1
- package/layout/{flexCard.js → flex-card.js} +3 -1
- package/layout/{flexGrid.js → flex-grid.js} +1 -1
- package/layout/{flexrow.js → flex-row.js} +1 -1
- package/layout/footer.js +1 -1
- package/layout/{formComponents → form-components}/custom.js +1 -1
- package/layout/{formComponents/dataList.js → form-components/data-list.js} +1 -1
- package/layout/{formComponents/floatingInput.js → form-components/floating-input.js} +1 -1
- package/layout/{formComponents → form-components}/form-all.js +1 -1
- package/layout/{formComponents → form-components}/form.js +1 -1
- package/layout/{formComponents/imagePicker.js → form-components/image-picker.js} +1 -1
- package/layout/{formComponents → form-components}/picker.js +1 -1
- package/layout/{formComponents → form-components}/radio.js +1 -1
- package/layout/{formComponents → form-components}/radiogroup.js +1 -1
- package/layout/{formComponents → form-components}/range.js +1 -1
- package/layout/free.js +1 -1
- package/layout/grid-new.js +1 -1
- package/layout/{gridSwitcher.js → grid-switcher.js} +1 -1
- package/layout/grid.js +1 -1
- package/layout/group.js +1 -1
- package/layout/header.js +1 -1
- package/layout/{horizontalScroller.js → horizontal-scroller.js} +1 -1
- package/layout/image-old.js +1 -1
- package/layout/image.js +1 -1
- package/layout/index.js +49 -37
- package/layout/label.js +1 -1
- package/layout/link.js +1 -1
- package/layout/list-OLD.js +1 -1
- package/layout/list.js +1 -1
- package/layout/{metaAdder.js → meta-adder.js} +1 -1
- package/layout/{modal2025.js → modal-2025.js} +1 -1
- package/layout/modernwrap.js +1 -1
- package/layout/multiswitcher.js +1 -1
- package/layout/multiswitcherBeta.js +1 -1
- package/layout/{navBar.js → nav-bar.js} +1 -1
- package/layout/{navFactor/customDiv.js → nav-factor/custom-div.js} +1 -1
- package/layout/navBar-OLD.js +1 -1
- package/layout/{newFlatAdder.js → new-flat-adder.js} +1 -1
- package/layout/{newNavBar.js → new-nav-bar.js} +1 -1
- package/layout/{offsetContainer.js → offset-container.js} +1 -1
- package/layout/polygon.js +1 -1
- package/layout/progress.js +1 -1
- package/layout/row.js +1 -1
- package/layout/{savedNewNavBar.js → saved-new-nav-bar.js} +1 -1
- package/layout/{scrollvideo.js → scroll-video.js} +1 -1
- package/layout/{sideBar.js → side-bar.js} +1 -1
- package/layout/{sideNavBar.js → side-nav-bar.js} +1 -1
- package/layout/{simpleBar.js → simple-bar.js} +1 -1
- package/layout/{slider2025.js → slider-2025.js} +1 -1
- package/layout/spacer.js +1 -1
- package/layout/stack.js +1 -1
- package/layout/styler.js +1 -1
- package/layout/switcher.js +1 -1
- package/layout/table.js +1 -1
- package/layout/{textField.js → text-field.js} +1 -1
- package/layout/text.js +1 -1
- package/layout/ulist.js +1 -1
- package/layout/video.js +1 -1
- package/layout/{withoutNew.js → without-new.js} +1 -1
- package/layout/wrap.js +1 -1
- package/layout/{zoomCard.js → zoom-card.js} +1 -1
- package/lib/{cardGetter.js → card-getter.js} +1 -1
- package/lib/designer.js +49 -49
- package/lib/{elementMapper.js → element-mapper.js} +56 -37
- package/lib/{KeyframeAnimation.js → keyframe-animation.js} +1 -1
- package/lib/{linkGetter.js → link-getter.js} +1 -1
- package/lib/{scrollvideo.js → scroll-video.js} +1 -1
- package/lib/{Stacker.js → stacker.js} +2 -1
- package/lib/{TransformAnim.js → transform-anim.js} +1 -1
- package/package.json +4 -2
- package/dist/KeyframeAnimation.cjs.js +0 -2
- package/dist/KeyframeAnimation.cjs.js.LICENSE.txt +0 -5
- package/dist/KeyframeAnimation.esm.js +0 -2
- package/dist/KeyframeAnimation.esm.js.LICENSE.txt +0 -5
- package/dist/animator.cjs.js.LICENSE.txt +0 -5
- package/dist/animator.esm.js.LICENSE.txt +0 -5
- package/dist/appleanim.cjs.js.LICENSE.txt +0 -5
- package/dist/appleanim.esm.js.LICENSE.txt +0 -5
- package/dist/audionew.cjs.js.LICENSE.txt +0 -5
- package/dist/audionew.esm.js.LICENSE.txt +0 -5
- package/dist/base.cjs.js.LICENSE.txt +0 -5
- package/dist/base.esm.js.LICENSE.txt +0 -5
- package/dist/betaDesktopBar.esm.js.LICENSE.txt +0 -5
- package/dist/betaMobileBar.esm.js.LICENSE.txt +0 -5
- package/dist/bundle.umd.js.LICENSE.txt +0 -5
- package/dist/button.cjs.js.LICENSE.txt +0 -5
- package/dist/button.esm.js.LICENSE.txt +0 -5
- package/dist/cardGetter.cjs.js.LICENSE.txt +0 -5
- package/dist/cardGetter.esm.js.LICENSE.txt +0 -5
- package/dist/center.cjs.js.LICENSE.txt +0 -5
- package/dist/center.esm.js.LICENSE.txt +0 -5
- package/dist/checkbox.cjs.js.LICENSE.txt +0 -5
- package/dist/checkbox.esm.js.LICENSE.txt +0 -5
- package/dist/circle.cjs.js +0 -2
- package/dist/circle.cjs.js.LICENSE.txt +0 -5
- package/dist/circle.esm.js +0 -2
- package/dist/circle.esm.js.LICENSE.txt +0 -5
- package/dist/code.cjs.js.LICENSE.txt +0 -5
- package/dist/code.esm.js.LICENSE.txt +0 -5
- package/dist/container.cjs.js.LICENSE.txt +0 -5
- package/dist/container.esm.js.LICENSE.txt +0 -5
- package/dist/datalist.cjs.js.LICENSE.txt +0 -5
- package/dist/datalist.esm.js.LICENSE.txt +0 -5
- package/dist/designer.cjs.js.LICENSE.txt +0 -5
- package/dist/designer.esm.js.LICENSE.txt +0 -5
- package/dist/dropdown.cjs.js.LICENSE.txt +0 -5
- package/dist/dropdown.esm.js.LICENSE.txt +0 -5
- package/dist/elementMapper.cjs.js.LICENSE.txt +0 -5
- package/dist/elementMapper.esm.js.LICENSE.txt +0 -5
- package/dist/finalresult.esm.js.LICENSE.txt +0 -5
- package/dist/flexCard.cjs.js.LICENSE.txt +0 -5
- package/dist/flexCard.esm.js.LICENSE.txt +0 -5
- package/dist/flexGrid.cjs.js.LICENSE.txt +0 -5
- package/dist/flexGrid.esm.js.LICENSE.txt +0 -5
- package/dist/flexRow.cjs.js.LICENSE.txt +0 -5
- package/dist/flexRow.esm.js.LICENSE.txt +0 -5
- package/dist/floatingInput.cjs.js.LICENSE.txt +0 -5
- package/dist/floatingInput.esm.js.LICENSE.txt +0 -5
- package/dist/free.cjs.js.LICENSE.txt +0 -5
- package/dist/free.esm.js.LICENSE.txt +0 -5
- package/dist/gridSwitcher.cjs.js +0 -2
- package/dist/gridSwitcher.cjs.js.LICENSE.txt +0 -5
- package/dist/gridSwitcher.esm.js +0 -2
- package/dist/gridSwitcher.esm.js.LICENSE.txt +0 -5
- package/dist/horizontalScroller.esm.js.LICENSE.txt +0 -5
- package/dist/image.cjs.js.LICENSE.txt +0 -5
- package/dist/image.esm.js.LICENSE.txt +0 -5
- package/dist/imagePicker.cjs.js.LICENSE.txt +0 -5
- package/dist/imagePicker.esm.js.LICENSE.txt +0 -5
- package/dist/index.cjs.js.LICENSE.txt +0 -5
- package/dist/index.esm.js.LICENSE.txt +0 -5
- package/dist/link.cjs.js.LICENSE.txt +0 -5
- package/dist/link.esm.js.LICENSE.txt +0 -5
- package/dist/linkGetter.cjs.js.LICENSE.txt +0 -5
- package/dist/linkGetter.esm.js.LICENSE.txt +0 -5
- package/dist/metaAdder.cjs.js.LICENSE.txt +0 -5
- package/dist/metaAdder.esm.js.LICENSE.txt +0 -5
- package/dist/modal2025.cjs.js.LICENSE.txt +0 -5
- package/dist/modal2025.esm.js.LICENSE.txt +0 -5
- package/dist/multiswitchers.esm.js.LICENSE.txt +0 -5
- package/dist/newNavBar.cjs.js.LICENSE.txt +0 -5
- package/dist/newNavBar.esm.js.LICENSE.txt +0 -5
- package/dist/picker.cjs.js.LICENSE.txt +0 -5
- package/dist/picker.esm.js.LICENSE.txt +0 -5
- package/dist/polygon.cjs.js +0 -2
- package/dist/polygon.cjs.js.LICENSE.txt +0 -5
- package/dist/polygon.esm.js +0 -2
- package/dist/polygon.esm.js.LICENSE.txt +0 -5
- package/dist/progress.cjs.js.LICENSE.txt +0 -5
- package/dist/progress.esm.js.LICENSE.txt +0 -5
- package/dist/radio.cjs.js.LICENSE.txt +0 -5
- package/dist/radio.esm.js.LICENSE.txt +0 -5
- package/dist/range.cjs.js.LICENSE.txt +0 -5
- package/dist/range.esm.js.LICENSE.txt +0 -5
- package/dist/scrollvideo.cjs.js.LICENSE.txt +0 -5
- package/dist/scrollvideo.esm.js.LICENSE.txt +0 -5
- package/dist/sideBar.cjs.js.LICENSE.txt +0 -5
- package/dist/sideBar.esm.js.LICENSE.txt +0 -5
- package/dist/sideNavBar.cjs.js.LICENSE.txt +0 -5
- package/dist/sideNavBar.esm.js.LICENSE.txt +0 -5
- package/dist/simpleBar.cjs.js.LICENSE.txt +0 -5
- package/dist/simpleBar.esm.js.LICENSE.txt +0 -5
- package/dist/slider2025.cjs.js +0 -2
- package/dist/slider2025.cjs.js.LICENSE.txt +0 -5
- package/dist/slider2025.esm.js +0 -2
- package/dist/slider2025.esm.js.LICENSE.txt +0 -5
- package/dist/spacer.cjs.js.LICENSE.txt +0 -5
- package/dist/stack.cjs.js.LICENSE.txt +0 -5
- package/dist/stack.esm.js.LICENSE.txt +0 -5
- package/dist/stacker.cjs.js.LICENSE.txt +0 -5
- package/dist/stacker.esm.js.LICENSE.txt +0 -5
- package/dist/table.cjs.js.LICENSE.txt +0 -5
- package/dist/table.esm.js.LICENSE.txt +0 -5
- package/dist/text.cjs.js.LICENSE.txt +0 -5
- package/dist/text.esm.js.LICENSE.txt +0 -5
- package/dist/textField.cjs.js.LICENSE.txt +0 -5
- package/dist/textField.esm.js.LICENSE.txt +0 -5
- package/dist/transformanim.cjs.js.LICENSE.txt +0 -5
- package/dist/transformanim.esm.js.LICENSE.txt +0 -5
- package/dist/ulist.cjs.js.LICENSE.txt +0 -5
- package/dist/ulist.esm.js.LICENSE.txt +0 -5
- package/dist/video.esm.js.LICENSE.txt +0 -5
- package/dist/wrap.cjs.js.LICENSE.txt +0 -5
- package/dist/wrap.esm.js.LICENSE.txt +0 -5
- package/dist/zoomCard.cjs.js.LICENSE.txt +0 -5
- package/dist/zoomCard.esm.js.LICENSE.txt +0 -5
- package/layout/<head> +0 -59
- package/layout/DEADJOE +0 -49
- package/layout/DEPRECATED-PARAGRAPH.js +0 -109
- package/layout/edit.sh +0 -39
- package/layout/formComponents/edit.sh +0 -39
- package/layout/navFactor/edit.sh +0 -39
- package/layout/newNavBar copy 2.js +0 -921
- package/layout/newNavBar copy.js +0 -780
- package/lib/AppleAnim.js +0 -794
package/lib/AppleAnim.js
DELETED
|
@@ -1,794 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* nodality v1.0.84
|
|
3
|
-
* (c) 2025 Filip Vabrousek
|
|
4
|
-
* License: MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
class KeyframeAnim {
|
|
8
|
-
constructor(data) {
|
|
9
|
-
this.fromFirstImageFlag = false;
|
|
10
|
-
this.flag = 0;
|
|
11
|
-
this.flagValue = data.flagValue;
|
|
12
|
-
this.data = data;
|
|
13
|
-
this.mask = data.mask; // overwrites method
|
|
14
|
-
this.maskData = data.maskData;
|
|
15
|
-
this.id = data.id;
|
|
16
|
-
|
|
17
|
-
this.halfHeight = data.halfHeight;
|
|
18
|
-
if (this.data.type === undefined){
|
|
19
|
-
this.type = "default";
|
|
20
|
-
} else {
|
|
21
|
-
this.type = this.data.type;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
this.stickData = data.stickData;
|
|
25
|
-
this.targetHeight = this.data.targetHeight;
|
|
26
|
-
this.html = document.body;
|
|
27
|
-
this.res = document.createElement("div"); // stack
|
|
28
|
-
this.res.setAttribute("id", this.data.id);
|
|
29
|
-
this.res.style.border = "1px solid green";
|
|
30
|
-
this.res.style.width = "100%";
|
|
31
|
-
this.res.style.display = "grid";
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
this.res.style.position = "sticky";// removed
|
|
35
|
-
this.res.style.top = 0;
|
|
36
|
-
this.res.style.alignSelf = "flex-start";
|
|
37
|
-
|
|
38
|
-
this.res.style.justifyContent = "center";
|
|
39
|
-
this.res.style.alignItems = "center";
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Added
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (!this.data.added){ // Nice effect with false
|
|
46
|
-
this.res.style.marginTop = this.data.noAddedDistance; //"800px";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.frameCount = 100; // 100
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.lastScrollTop = window.scrollY;
|
|
57
|
-
// modrý a bez kroužku
|
|
58
|
-
this.setupTopElement();
|
|
59
|
-
this.scrollFunction();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
window.addEventListener('scroll', () => {
|
|
64
|
-
this.scrollFunction();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
this.preloadImages();
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
marginTop(data){
|
|
73
|
-
// this.data.noAddedDistance = data;
|
|
74
|
-
this.res.style.marginTop = data;
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
toCode(){
|
|
79
|
-
return [""];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
scrollFunction = () => {
|
|
83
|
-
// alert(this.flagValue);
|
|
84
|
-
|
|
85
|
-
// console.log(this.flagValue);
|
|
86
|
-
|
|
87
|
-
if (this.flagValue === undefined){
|
|
88
|
-
this.flagValue = 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var scrollTop = this.html.scrollTop - /*1700*/ this.flagValue;
|
|
92
|
-
var maxScrollTop = this.html.scrollHeight - window.innerHeight;
|
|
93
|
-
|
|
94
|
-
const scrollFraction = scrollTop / maxScrollTop * 16 /** 16*/ ; // TIMES 5 Speeds up the animation
|
|
95
|
-
var frameIndex = Math.min(
|
|
96
|
-
this.frameCount - 1,
|
|
97
|
-
Math.ceil(scrollFraction * this.frameCount)
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
/* if (frameIndex === 99) {
|
|
101
|
-
frameIndex -= 99;
|
|
102
|
-
}*/
|
|
103
|
-
|
|
104
|
-
if (isNaN(frameIndex)) {
|
|
105
|
-
frameIndex = 1;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (frameIndex < 0){
|
|
109
|
-
frameIndex = 0;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// console.log(frameIndex);
|
|
113
|
-
|
|
114
|
-
if (this.data.limit){
|
|
115
|
-
|
|
116
|
-
if (frameIndex < this.data.limit){
|
|
117
|
-
// console.log(frameIndex)
|
|
118
|
-
// console.log("MY Frame index is" + frameIndex);
|
|
119
|
-
requestAnimationFrame(() => this.updateImage(frameIndex + 1));
|
|
120
|
-
}
|
|
121
|
-
} else {
|
|
122
|
-
requestAnimationFrame(() => this.updateImage(frameIndex + 1));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
let query = window.matchMedia("(max-device-width: 415px)");
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// Apple website does not transition...
|
|
130
|
-
/* if (query.matches === false){
|
|
131
|
-
if (window.scrollY > 2300){
|
|
132
|
-
this.res.style.position = "relative";
|
|
133
|
-
this.res.style.marginTop = "1300px";
|
|
134
|
-
} else {
|
|
135
|
-
this.res.style.marginTop = "800px";
|
|
136
|
-
this.res.style.position = "sticky";
|
|
137
|
-
}
|
|
138
|
-
}*/
|
|
139
|
-
|
|
140
|
-
// scroll less than 2300 and fix next
|
|
141
|
-
|
|
142
|
-
/* if (window.scrollY > 2300){
|
|
143
|
-
this.res.style.position = "relative";
|
|
144
|
-
this.res.style.marginTop = "1400px";
|
|
145
|
-
} else {
|
|
146
|
-
this.res.style.marginTop = "800px";
|
|
147
|
-
this.res.style.position = "sticky";
|
|
148
|
-
}*/
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
currentFrame = index => {
|
|
153
|
-
// https://stackoverflow.com/questions/5417979/batch-rename-sequential-files-by-padding-with-zeroes Thanks !
|
|
154
|
-
// for f in *.jpg;do n=${f#*_};n=${n%.*};mv $f $(printf "%04d".jpg $n);done
|
|
155
|
-
let res = `${this.data.path}${index.toString().padStart(4, '0')}.${this.data.extension}`;
|
|
156
|
-
return res;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
preloadImages = () => {
|
|
160
|
-
for (let i = 1; i < this.frameCount; i++) {
|
|
161
|
-
const img = new Image();
|
|
162
|
-
this.img.src = this.currentFrame(i);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
updateImage = index => {
|
|
167
|
-
// console.log(index);
|
|
168
|
-
|
|
169
|
-
this.img.src = this.currentFrame(index);
|
|
170
|
-
|
|
171
|
-
/* if (window.scrollY > 20 && index > 98){
|
|
172
|
-
this.res.style.position = "relative";
|
|
173
|
-
this.res.style.marginTop = "420px";
|
|
174
|
-
} */
|
|
175
|
-
|
|
176
|
-
/* if (window.scrollY < 620 && this.isUp){ // 163408 okay, get exact value
|
|
177
|
-
this.res.style.position = "fixed";
|
|
178
|
-
this.res.style.marginTop = "0px";
|
|
179
|
-
}*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
// WILL NOT WORK
|
|
183
|
-
/* if (window.scrollY > 1370 && !this.isUp){
|
|
184
|
-
this.res.style.position = "fixed";
|
|
185
|
-
this.res.style.marginTop = "0px";
|
|
186
|
-
} // 17:12:25 08/10/23 afetr win UH nice!
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (window.scrollY <= 1370 && this.isUp){
|
|
191
|
-
this.res.style.position = "relative";
|
|
192
|
-
this.res.style.marginTop = "800px";
|
|
193
|
-
} // 21:55:43 Nice !!!
|
|
194
|
-
*/
|
|
195
|
-
// 22:20:50 developer tools change the necessary window.scrollY value
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
drawImageProp(ctx, img, x, y, w, h, offsetX, offsetY) {
|
|
203
|
-
|
|
204
|
-
if (arguments.length === 2) {
|
|
205
|
-
x = y = 0;
|
|
206
|
-
w = ctx.canvas.width;
|
|
207
|
-
h = ctx.canvas.height;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// default offset is center
|
|
211
|
-
offsetX = typeof offsetX === "number" ? offsetX : 0.5;
|
|
212
|
-
offsetY = typeof offsetY === "number" ? offsetY : 0.5;
|
|
213
|
-
|
|
214
|
-
// keep bounds [0.0, 1.0]
|
|
215
|
-
if (offsetX < 0) offsetX = 0;
|
|
216
|
-
if (offsetY < 0) offsetY = 0;
|
|
217
|
-
if (offsetX > 1) offsetX = 1;
|
|
218
|
-
if (offsetY > 1) offsetY = 1;
|
|
219
|
-
|
|
220
|
-
var iw = img.width,
|
|
221
|
-
ih = img.height,
|
|
222
|
-
r = Math.min(w / iw, h / ih),
|
|
223
|
-
nw = iw * r, // new prop. width
|
|
224
|
-
nh = ih * r, // new prop. height
|
|
225
|
-
cx, cy, cw, ch, ar = 1;
|
|
226
|
-
|
|
227
|
-
// decide which gap to fill
|
|
228
|
-
if (nw < w) ar = w / nw;
|
|
229
|
-
if (Math.abs(ar - 1) < 1e-14 && nh < h) ar = h / nh; // updated
|
|
230
|
-
nw *= ar;
|
|
231
|
-
nh *= ar;
|
|
232
|
-
|
|
233
|
-
// calc source rectangle
|
|
234
|
-
cw = iw / (nw / w);
|
|
235
|
-
ch = ih / (nh / h);
|
|
236
|
-
|
|
237
|
-
cx = (iw - cw) * offsetX;
|
|
238
|
-
cy = (ih - ch) * offsetY;
|
|
239
|
-
|
|
240
|
-
// make sure source rectangle is valid
|
|
241
|
-
if (cx < 0) cx = 0;
|
|
242
|
-
if (cy < 0) cy = 0;
|
|
243
|
-
if (cw > iw) cw = iw;
|
|
244
|
-
if (ch > ih) ch = ih;
|
|
245
|
-
|
|
246
|
-
console.log("WEIRD")
|
|
247
|
-
console.log(img);
|
|
248
|
-
console.log(cy);
|
|
249
|
-
console.log(cw);
|
|
250
|
-
// fill image in dest. rectangle
|
|
251
|
-
ctx.drawImage(img, cx, cy, cw, ch, x, y, w, h);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
maska(data){
|
|
256
|
-
window.addEventListener("scroll", () => {
|
|
257
|
-
this.innerMask(data);
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
return this;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
innerMask(data) {
|
|
264
|
-
if (data) {
|
|
265
|
-
let smart = smartRange(window.scrollY, { min: data.start, max: data.end }, { min: 0, max: 7 }) // The other way
|
|
266
|
-
let radius = smartRange(window.scrollY, { min: data.start, max: data.end }, { min: 37, max: 37 }) // both are 20 to stay round
|
|
267
|
-
this.res.style.clipPath = `inset(${smart}% ${smart}% round 0 0 ${radius}px ${radius}px)`;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
setupTopElement() {
|
|
272
|
-
// If we scroll further after seeing topElement
|
|
273
|
-
console.warn("TOP INIT");
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
// 1 - Set up the stack
|
|
278
|
-
// 2 - Set up bottom elements
|
|
279
|
-
let fixTop = document.createElement("canvas");
|
|
280
|
-
|
|
281
|
-
fixTop.style.gridArea = "1/1";
|
|
282
|
-
fixTop.zIndex = 1;
|
|
283
|
-
fixTop.style.display = "grid";
|
|
284
|
-
fixTop.style.gridTemplate = "1fr/1fr";
|
|
285
|
-
fixTop.style.justifyContent = "center";
|
|
286
|
-
fixTop.style.alignItems = "center";
|
|
287
|
-
fixTop.style.marginLeft = "auto";
|
|
288
|
-
fixTop.style.marginRight = "auto";
|
|
289
|
-
// fixTop.style.width = "100%";
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
this.context = fixTop.getContext("2d");
|
|
293
|
-
|
|
294
|
-
// 1158; WAS GOOD
|
|
295
|
-
this.context.canvas.width = window.innerWidth; //document.body.clientWidth; // Make this responsive
|
|
296
|
-
this.context.canvas.height = window.innerHeight * 1.2; //window.innerWidth / 1.77778;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
this.img = new Image();
|
|
302
|
-
|
|
303
|
-
this.img.onload = () => {
|
|
304
|
-
if (this.data.halfHeight){
|
|
305
|
-
this.drawImageProp(this.context, this.img, 0, 0, window.innerWidth, window.innerHeight / 2);
|
|
306
|
-
} else {
|
|
307
|
-
this.drawImageProp(this.context, this.img, 0, 0, window.innerWidth, window.innerHeight * 1.2);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
// 11:41:33 Nice!
|
|
313
|
-
// 17/10/2023
|
|
314
|
-
// M2 iPad Air and iPad (11th gen) are coming today!
|
|
315
|
-
window.addEventListener("resize", () => {
|
|
316
|
-
this.context.canvas.width = window.innerWidth; //document.body.clientWidth; // Make this responsive
|
|
317
|
-
this.context.canvas.height = window.innerHeight * 1.2; //window.innerWidth / 1.77778;
|
|
318
|
-
this.drawImageProp(this.context, this.img, 0, 0, window.innerWidth, window.innerHeight * 1.2);
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
// https://twitter.com/L0vetodream/status/1240753794037600256
|
|
322
|
-
|
|
323
|
-
// git reflog 180427 git reset HEAD@{index}
|
|
324
|
-
this.res.appendChild(fixTop);
|
|
325
|
-
if (this.data.text) {
|
|
326
|
-
let wrap = document.createElement("div");
|
|
327
|
-
wrap.style.gridArea = "1/1";
|
|
328
|
-
|
|
329
|
-
let el = this.data.text.render();
|
|
330
|
-
this.h2a = el;
|
|
331
|
-
wrap.appendChild(el);
|
|
332
|
-
wrap.setAttribute("id", "rem");
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
if (this.data.hasRect) {
|
|
339
|
-
let e = document.createElement("div");
|
|
340
|
-
e.style.width = "30px";
|
|
341
|
-
e.style.height = "30px";
|
|
342
|
-
e.style.backgroundColor = "orange";
|
|
343
|
-
} else {
|
|
344
|
-
for (var i = 0; i < this.res.children.length; i++) {
|
|
345
|
-
if (this.res.children[i].id === "rem") {
|
|
346
|
-
this.res.removeChild(this.res.children[i]);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
this.res.appendChild(wrap);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
this.lastScrollTop = 0;
|
|
356
|
-
this.count = 1;
|
|
357
|
-
this.isUp = false;
|
|
358
|
-
this.done = false;
|
|
359
|
-
this.fireOnce = true;
|
|
360
|
-
this.dec = 1.0;
|
|
361
|
-
this.tdec = 1.0;
|
|
362
|
-
this.atdec = 0.0;
|
|
363
|
-
this.textOpacity = 1.0;
|
|
364
|
-
|
|
365
|
-
let hTwo = this.res.children[this.res.children.length - 1].children[0];
|
|
366
|
-
// hTwo.opacity = 0;
|
|
367
|
-
hTwo.style.opacity = 0;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (this.data.text){
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
window.addEventListener("scroll", () => {
|
|
376
|
-
this.h2a.style.backgroundColor = "rgba(0, 0, 0, 0.8)"; //"black";
|
|
377
|
-
this.h2a.style.opacity = 1;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
/* let offset = smartRange(window.scrollY, {
|
|
381
|
-
// min: this.data.lazyText.start,
|
|
382
|
-
// max: this.data.lazyText.end
|
|
383
|
-
min: 6180,
|
|
384
|
-
max: 8000
|
|
385
|
-
}, {
|
|
386
|
-
min: 0,
|
|
387
|
-
max: 200
|
|
388
|
-
}); // 175
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
let opacity = smartRange(window.scrollY, {
|
|
392
|
-
// min: this.data.lazyText.start,
|
|
393
|
-
// max: this.data.lazyText.end
|
|
394
|
-
min: 6180, // variable args
|
|
395
|
-
max: 8000
|
|
396
|
-
}, {
|
|
397
|
-
min: 0,
|
|
398
|
-
max: 1
|
|
399
|
-
}); // 175
|
|
400
|
-
*/
|
|
401
|
-
// div below #rem has opacity 0
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
/* for (var i = 0; i < this.h2a.children[0].children.length; i++){
|
|
405
|
-
console.log("P")
|
|
406
|
-
this.h2a.children[0].children[i].style.transform = `matrix(1, 0, 0, 1, 0, -${offset})`;
|
|
407
|
-
this.h2a.children[0].children[i].style.opacity = `${opacity - i * 0.2}`;
|
|
408
|
-
}*/
|
|
409
|
-
|
|
410
|
-
// this.h2a.style.transform = "matrix("
|
|
411
|
-
// transform: matrix(1, 0, 0, 1, 0, 15.2135);
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
/* let offset = smartRange(window.scrollY, {
|
|
415
|
-
min: 3750,
|
|
416
|
-
max: 4000
|
|
417
|
-
}, {
|
|
418
|
-
min: 0,
|
|
419
|
-
max: 200
|
|
420
|
-
}); // 175
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
let opacity = smartRange(window.scrollY, {
|
|
424
|
-
min: 3750,
|
|
425
|
-
max: 4200
|
|
426
|
-
}, {
|
|
427
|
-
min: 0,
|
|
428
|
-
max: 1
|
|
429
|
-
}); // 175
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
for (var i = 0; i < this.h2a.children[0].children.length; i++){
|
|
435
|
-
this.h2a.children[0].children[i].style.transform = `matrix(1, 0, 0, 1, 0, -${offset})`;
|
|
436
|
-
this.h2a.children[0].children[i].style.opacity = `${opacity - i * 0.2}`;
|
|
437
|
-
}*/
|
|
438
|
-
// this.h2a.children[0].children[1].style.backgroundColor = "orange";
|
|
439
|
-
|
|
440
|
-
// this.h2a.children[0].style.transform = `matrix(1, 0, 0, 1, 0, -${offset})`;
|
|
441
|
-
|
|
442
|
-
// height here
|
|
443
|
-
// 1800-2200
|
|
444
|
-
|
|
445
|
-
/* let res = smartRange(window.scrollY, {
|
|
446
|
-
// min: 1800,
|
|
447
|
-
// max: 2200
|
|
448
|
-
// min: 30,
|
|
449
|
-
// max: 800
|
|
450
|
-
|
|
451
|
-
min: this.data.opacityRange.start,
|
|
452
|
-
max: this.data.opacityRange.end
|
|
453
|
-
}, {
|
|
454
|
-
min: 0,
|
|
455
|
-
max: 1
|
|
456
|
-
}); // 175*/
|
|
457
|
-
|
|
458
|
-
// console.log(res);
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
// this.h2a.style.opacity = res;
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
window.addEventListener("scroll", (e) => {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
// newly added
|
|
478
|
-
if (this.data.stickyData){
|
|
479
|
-
if (this.data.stickyData.top){
|
|
480
|
-
const top = this.data.stickyData.top; //800;
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
// UNCOMMENT HERE
|
|
484
|
-
|
|
485
|
-
// alert(wrapDiv);
|
|
486
|
-
if (this.data.uncomment) {
|
|
487
|
-
if (window.scrollY > top) { // MAKE THIS ADJUSTABLE
|
|
488
|
-
wrapDiv.style.background = "pink";
|
|
489
|
-
wrapDiv.style.position = "relative";
|
|
490
|
-
wrapDiv.style.top = top; // FIX HERE
|
|
491
|
-
} else {
|
|
492
|
-
wrapDiv.style.background = "orange";
|
|
493
|
-
wrapDiv.style.top = 0;
|
|
494
|
-
wrapDiv.style.position = "fixed";
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
// console.log(window.scrollY);
|
|
503
|
-
|
|
504
|
-
let st = window.scrollY || document.documentElement.scrollTop;
|
|
505
|
-
if (st > this.lastScrollTop) {
|
|
506
|
-
this.isUp = false;
|
|
507
|
-
} else {
|
|
508
|
-
this.isUp = true;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
this.lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling
|
|
512
|
-
|
|
513
|
-
if (this.isUp) {
|
|
514
|
-
if (this.textOpacity < 0.98) {
|
|
515
|
-
this.textOpacity += 0.01;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
if (this.isUp === false) {
|
|
520
|
-
if (this.textOpacity > 0.02) {
|
|
521
|
-
this.textOpacity -= 0.01;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
if (this.data.mask){
|
|
526
|
-
|
|
527
|
-
let rem = this.res; //document.querySelector("#beauty");
|
|
528
|
-
|
|
529
|
-
let smart = smartRange(window.scrollY, {/*min: 2189, max: 2900*/ min: this.data.maskData.start, max: this.data.maskData.end}, {min: 0, max: 7} )
|
|
530
|
-
rem.style.clipPath = `inset(${smart}% ${smart}% round 20px)`;
|
|
531
|
-
// console.log(`SMART: ${smart}`);
|
|
532
|
-
// console.log(this.textOpacity);
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
if (!this.hasH2){
|
|
536
|
-
let grayBack = document.createElement("div");
|
|
537
|
-
grayBack.style.background = "#ecf0f1";
|
|
538
|
-
grayBack.style.width = "86%";
|
|
539
|
-
grayBack.style.marginLeft = "7%";
|
|
540
|
-
grayBack.style.borderRadius = "1rem";
|
|
541
|
-
|
|
542
|
-
this.hasH2 = true;
|
|
543
|
-
grayBack.appendChild(this.data.newSection.render());
|
|
544
|
-
rem.parentElement.appendChild(grayBack);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
// 22:09:11 Code design object
|
|
549
|
-
let elHeight = this.data.targetHeight;
|
|
550
|
-
let begin = elHeight - 250;
|
|
551
|
-
let end = elHeight + 250;
|
|
552
|
-
|
|
553
|
-
/* let res = sm(st + begin, {
|
|
554
|
-
min: begin,
|
|
555
|
-
max: end
|
|
556
|
-
}, {
|
|
557
|
-
min: 0,
|
|
558
|
-
max: 2
|
|
559
|
-
}); // 175
|
|
560
|
-
|
|
561
|
-
if (res < -0.3) {
|
|
562
|
-
res = Math.abs(res);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
if (this.data.animation != "float") {
|
|
566
|
-
hTwo.style.opacity = `${res}`;
|
|
567
|
-
}*/
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
setLazyText(obj){
|
|
577
|
-
this.lazyText= obj;
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
window.addEventListener("scroll", () => {
|
|
581
|
-
let offset = smartRange(window.scrollY, {
|
|
582
|
-
min: this.lazyText.start,
|
|
583
|
-
max: this.lazyText.end
|
|
584
|
-
// min: 6180,
|
|
585
|
-
// max: 8000
|
|
586
|
-
}, {
|
|
587
|
-
min: 0,
|
|
588
|
-
max: 200
|
|
589
|
-
}); // 175
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
let opacity = smartRange(window.scrollY, {
|
|
593
|
-
min: this.lazyText.start,
|
|
594
|
-
max: this.lazyText.end
|
|
595
|
-
// min: 6180, // variable args
|
|
596
|
-
// max: 8000
|
|
597
|
-
}, {
|
|
598
|
-
min: 0,
|
|
599
|
-
max: 1
|
|
600
|
-
}); // 175
|
|
601
|
-
|
|
602
|
-
// div below #rem has opacity 0
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
for (var i = 0; i < this.h2a.children[0].children.length; i++){
|
|
606
|
-
console.log("P")
|
|
607
|
-
this.h2a.children[0].children[i].style.transform = `matrix(1, 0, 0, 1, 0, -${offset})`;
|
|
608
|
-
this.h2a.children[0].children[i].style.opacity = `${opacity - i * 0.2}`;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
});
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
return this;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
setProps(obj){
|
|
618
|
-
|
|
619
|
-
if (obj.targetHeight){
|
|
620
|
-
this.data.targetHeight = obj.targetHeight;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
if (obj.flagValue){
|
|
625
|
-
// alert(obj.flagValue);
|
|
626
|
-
this.flagValue = obj.flagValue;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
return this;
|
|
630
|
-
/* targetHeight: 600,
|
|
631
|
-
flagValue: 3700,*/
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
fixedToRelative(value){
|
|
636
|
-
this.data.uncomment = value;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
toSticky(){
|
|
640
|
-
this.res.style.position = "sticky";
|
|
641
|
-
this.res.style.top = "0";
|
|
642
|
-
return this;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
setOpacityRange(range){
|
|
646
|
-
this.data.opacityRange = range.opacityRange;
|
|
647
|
-
this.data.scaleRange = range.scaleRange;
|
|
648
|
-
// 1800 and 2200 scale
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
window.addEventListener("scroll", () => {
|
|
652
|
-
let res = smartRange(window.scrollY, {
|
|
653
|
-
// min: 1800,
|
|
654
|
-
// max: 2200
|
|
655
|
-
// min: 30,
|
|
656
|
-
// max: 800
|
|
657
|
-
|
|
658
|
-
min: this.data.opacityRange.start,
|
|
659
|
-
max: this.data.opacityRange.end
|
|
660
|
-
}, {
|
|
661
|
-
min: 0,
|
|
662
|
-
max: 1
|
|
663
|
-
}); // 175
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
this.h2a.style.opacity = res;
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
let scale = smartRange(window.scrollY, {
|
|
670
|
-
min: this.data.scaleRange.start,
|
|
671
|
-
max: this.data.scaleRange.end,
|
|
672
|
-
}, {
|
|
673
|
-
min: 3,
|
|
674
|
-
max: 1
|
|
675
|
-
}); // 175
|
|
676
|
-
|
|
677
|
-
/* let scaleChip = smartRange(window.scrollY, {
|
|
678
|
-
min: 1800,
|
|
679
|
-
max: 2200
|
|
680
|
-
}, {
|
|
681
|
-
min: 3,
|
|
682
|
-
max: 0.6
|
|
683
|
-
}); // 175
|
|
684
|
-
*/
|
|
685
|
-
// Bad on mobile
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
// 00:29:51
|
|
689
|
-
if (!window.matchMedia("(max-device-width: 415px)").matches){
|
|
690
|
-
this.h2a.children[0].style.transform = `scale(${scale})`;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
});
|
|
694
|
-
|
|
695
|
-
return this;
|
|
696
|
-
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
/*
|
|
702
|
-
stick(value){
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
if (topOffset != undefined){
|
|
706
|
-
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
if (value){
|
|
710
|
-
this.makeSticky();
|
|
711
|
-
} else {
|
|
712
|
-
this.noSticky();
|
|
713
|
-
}
|
|
714
|
-
return this;
|
|
715
|
-
}*/
|
|
716
|
-
|
|
717
|
-
stick(obj){
|
|
718
|
-
if (!obj){
|
|
719
|
-
this.makeSticky();
|
|
720
|
-
return this;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
if (obj.offset){
|
|
725
|
-
if (this.data.stickyData != undefined){
|
|
726
|
-
// alert(topOffset);
|
|
727
|
-
this.data.stickyData.top = obj.offset;
|
|
728
|
-
} else {
|
|
729
|
-
this.data.stickyData = {top: obj.offset};
|
|
730
|
-
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
if (obj.value){
|
|
735
|
-
this.makeSticky();
|
|
736
|
-
} else {
|
|
737
|
-
this.noSticky();
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
return this;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
to100vh(){
|
|
744
|
-
this.res.style.height = "100vh";
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
makeSticky(){
|
|
749
|
-
this.res.style.position = "sticky";
|
|
750
|
-
this.res.style.top = 0;
|
|
751
|
-
|
|
752
|
-
// 22:23:18 Yes!!!
|
|
753
|
-
// 22:23:39 mobile
|
|
754
|
-
//this.wrdiv.style.marginTop = "800px";
|
|
755
|
-
return this;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
noSticky(){
|
|
760
|
-
// this.wrdiv.style.display = "none";
|
|
761
|
-
// this.wrdiv.style.filter = "grayscale(1)";
|
|
762
|
-
this.res.style.position = "";
|
|
763
|
-
return this;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
toOpacity(opacity){
|
|
768
|
-
this.res.style.opacity = `${opacity}`;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
render(id) {
|
|
773
|
-
// this.res.style.position = "fixed";
|
|
774
|
-
if (id) {
|
|
775
|
-
document.querySelector(id).appendChild(this.res);
|
|
776
|
-
} else {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
// Move this out to wrapper Layout element
|
|
780
|
-
/* let el = document.createElement("div");
|
|
781
|
-
el.style.height = "2300px";
|
|
782
|
-
this.res.style.height = "100vh";
|
|
783
|
-
el.appendChild(this.res);*/
|
|
784
|
-
|
|
785
|
-
return this.res;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
export {KeyframeAnim};
|
|
793
|
-
|
|
794
|
-
// http://localhost:64595/designertest/5-CleanScrollAnimation/cleaner-way
|