nodality 1.0.0-beta.7 → 1.0.0-beta.71
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/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/animator.cjs.js +2 -1
- package/dist/animator.cjs.js.LICENSE.txt +5 -0
- package/dist/animator.esm.js +2 -1
- package/dist/animator.esm.js.LICENSE.txt +5 -0
- package/dist/appleanim.cjs.js +2 -0
- package/dist/appleanim.cjs.js.LICENSE.txt +5 -0
- package/dist/appleanim.esm.js +2 -0
- package/dist/appleanim.esm.js.LICENSE.txt +5 -0
- package/dist/audionew.cjs.js +2 -1
- package/dist/audionew.cjs.js.LICENSE.txt +5 -0
- package/dist/audionew.esm.js +2 -1
- package/dist/audionew.esm.js.LICENSE.txt +5 -0
- package/dist/base.cjs.js +2 -1
- package/dist/base.cjs.js.LICENSE.txt +5 -0
- package/dist/base.esm.js +2 -1
- package/dist/base.esm.js.LICENSE.txt +5 -0
- package/dist/betaDesktopBar.esm.js +2 -1
- package/dist/betaDesktopBar.esm.js.LICENSE.txt +5 -0
- package/dist/betaMobileBar.esm.js +2 -1
- package/dist/betaMobileBar.esm.js.LICENSE.txt +5 -0
- package/dist/bundle.umd.js +2 -1
- package/dist/bundle.umd.js.LICENSE.txt +5 -0
- package/dist/button.cjs.js +2 -1
- package/dist/button.cjs.js.LICENSE.txt +5 -0
- package/dist/button.esm.js +2 -1
- package/dist/button.esm.js.LICENSE.txt +5 -0
- package/dist/cardGetter.cjs.js +2 -1
- package/dist/cardGetter.cjs.js.LICENSE.txt +5 -0
- package/dist/cardGetter.esm.js +2 -1
- package/dist/cardGetter.esm.js.LICENSE.txt +5 -0
- package/dist/center.cjs.js +2 -1
- package/dist/center.cjs.js.LICENSE.txt +5 -0
- package/dist/center.esm.js +2 -1
- package/dist/center.esm.js.LICENSE.txt +5 -0
- package/dist/checkbox.cjs.js +2 -1
- package/dist/checkbox.cjs.js.LICENSE.txt +5 -0
- package/dist/checkbox.esm.js +2 -1
- package/dist/checkbox.esm.js.LICENSE.txt +5 -0
- package/dist/code.cjs.js +2 -1
- package/dist/code.cjs.js.LICENSE.txt +5 -0
- package/dist/code.esm.js +2 -1
- package/dist/code.esm.js.LICENSE.txt +5 -0
- package/dist/container.cjs.js +2 -1
- package/dist/container.cjs.js.LICENSE.txt +5 -0
- package/dist/container.esm.js +2 -1
- package/dist/container.esm.js.LICENSE.txt +5 -0
- package/dist/datalist.cjs.js +2 -1
- package/dist/datalist.cjs.js.LICENSE.txt +5 -0
- package/dist/datalist.esm.js +2 -1
- package/dist/datalist.esm.js.LICENSE.txt +5 -0
- package/dist/designer.cjs.js +2 -1
- package/dist/designer.cjs.js.LICENSE.txt +5 -0
- package/dist/designer.esm.js +2 -1
- package/dist/designer.esm.js.LICENSE.txt +5 -0
- package/dist/dropdown.cjs.js +2 -1
- package/dist/dropdown.cjs.js.LICENSE.txt +5 -0
- package/dist/dropdown.esm.js +2 -1
- package/dist/dropdown.esm.js.LICENSE.txt +5 -0
- package/dist/elementMapper.cjs.js +2 -1
- package/dist/elementMapper.cjs.js.LICENSE.txt +5 -0
- package/dist/elementMapper.esm.js +2 -1
- package/dist/elementMapper.esm.js.LICENSE.txt +5 -0
- package/dist/finalresult.esm.js +2 -1
- package/dist/finalresult.esm.js.LICENSE.txt +5 -0
- package/dist/flexCard.cjs.js +2 -1
- package/dist/flexCard.cjs.js.LICENSE.txt +5 -0
- package/dist/flexCard.esm.js +2 -1
- package/dist/flexCard.esm.js.LICENSE.txt +5 -0
- package/dist/flexGrid.cjs.js +2 -1
- package/dist/flexGrid.cjs.js.LICENSE.txt +5 -0
- package/dist/flexGrid.esm.js +2 -1
- package/dist/flexGrid.esm.js.LICENSE.txt +5 -0
- package/dist/flexRow.cjs.js +2 -1
- package/dist/flexRow.cjs.js.LICENSE.txt +5 -0
- package/dist/flexRow.esm.js +2 -1
- package/dist/flexRow.esm.js.LICENSE.txt +5 -0
- package/dist/floatingInput.cjs.js +2 -1
- package/dist/floatingInput.cjs.js.LICENSE.txt +5 -0
- package/dist/floatingInput.esm.js +2 -1
- package/dist/floatingInput.esm.js.LICENSE.txt +5 -0
- package/dist/free.cjs.js +2 -1
- package/dist/free.cjs.js.LICENSE.txt +5 -0
- package/dist/free.esm.js +2 -1
- package/dist/free.esm.js.LICENSE.txt +5 -0
- package/dist/horizontalScroller.esm.js +2 -1
- package/dist/horizontalScroller.esm.js.LICENSE.txt +5 -0
- package/dist/image.cjs.js +2 -1
- package/dist/image.cjs.js.LICENSE.txt +5 -0
- package/dist/image.esm.js +2 -1
- package/dist/image.esm.js.LICENSE.txt +5 -0
- package/dist/imagePicker.cjs.js +2 -1
- package/dist/imagePicker.cjs.js.LICENSE.txt +5 -0
- package/dist/imagePicker.esm.js +2 -1
- package/dist/imagePicker.esm.js.LICENSE.txt +5 -0
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.LICENSE.txt +5 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.LICENSE.txt +5 -0
- package/dist/link.cjs.js +2 -1
- package/dist/link.cjs.js.LICENSE.txt +5 -0
- package/dist/link.esm.js +2 -1
- package/dist/link.esm.js.LICENSE.txt +5 -0
- package/dist/linkGetter.cjs.js +2 -1
- package/dist/linkGetter.cjs.js.LICENSE.txt +5 -0
- package/dist/linkGetter.esm.js +2 -1
- package/dist/linkGetter.esm.js.LICENSE.txt +5 -0
- package/dist/metaAdder.cjs.js +2 -1
- package/dist/metaAdder.cjs.js.LICENSE.txt +5 -0
- package/dist/metaAdder.esm.js +2 -1
- package/dist/metaAdder.esm.js.LICENSE.txt +5 -0
- package/dist/modal2025.cjs.js +2 -1
- package/dist/modal2025.cjs.js.LICENSE.txt +5 -0
- package/dist/modal2025.esm.js +2 -1
- package/dist/modal2025.esm.js.LICENSE.txt +5 -0
- package/dist/multiswitchers.esm.js +2 -1
- package/dist/multiswitchers.esm.js.LICENSE.txt +5 -0
- package/dist/newNavBar.cjs.js +2 -1
- package/dist/newNavBar.cjs.js.LICENSE.txt +5 -0
- package/dist/newNavBar.esm.js +2 -1
- package/dist/newNavBar.esm.js.LICENSE.txt +5 -0
- package/dist/picker.cjs.js +2 -1
- package/dist/picker.cjs.js.LICENSE.txt +5 -0
- package/dist/picker.esm.js +2 -1
- package/dist/picker.esm.js.LICENSE.txt +5 -0
- package/dist/progress.cjs.js +2 -1
- package/dist/progress.cjs.js.LICENSE.txt +5 -0
- package/dist/progress.esm.js +2 -1
- package/dist/progress.esm.js.LICENSE.txt +5 -0
- package/dist/radio.cjs.js +2 -1
- package/dist/radio.cjs.js.LICENSE.txt +5 -0
- package/dist/radio.esm.js +2 -1
- package/dist/radio.esm.js.LICENSE.txt +5 -0
- package/dist/range.cjs.js +2 -1
- package/dist/range.cjs.js.LICENSE.txt +5 -0
- package/dist/range.esm.js +2 -1
- package/dist/range.esm.js.LICENSE.txt +5 -0
- package/dist/scrollvideo.cjs.js +2 -0
- package/dist/scrollvideo.cjs.js.LICENSE.txt +5 -0
- package/dist/scrollvideo.esm.js +2 -0
- package/dist/scrollvideo.esm.js.LICENSE.txt +5 -0
- package/dist/sideBar.cjs.js +2 -1
- package/dist/sideBar.cjs.js.LICENSE.txt +5 -0
- package/dist/sideBar.esm.js +2 -1
- package/dist/sideBar.esm.js.LICENSE.txt +5 -0
- package/dist/sideNavBar.cjs.js +2 -1
- package/dist/sideNavBar.cjs.js.LICENSE.txt +5 -0
- package/dist/sideNavBar.esm.js +2 -1
- package/dist/sideNavBar.esm.js.LICENSE.txt +5 -0
- package/dist/simpleBar.cjs.js +2 -1
- package/dist/simpleBar.cjs.js.LICENSE.txt +5 -0
- package/dist/simpleBar.esm.js +2 -1
- package/dist/simpleBar.esm.js.LICENSE.txt +5 -0
- package/dist/stack.cjs.js +2 -1
- package/dist/stack.cjs.js.LICENSE.txt +5 -0
- package/dist/stack.esm.js +2 -1
- package/dist/stack.esm.js.LICENSE.txt +5 -0
- package/dist/stacker.cjs.js +2 -0
- package/dist/stacker.cjs.js.LICENSE.txt +5 -0
- package/dist/stacker.esm.js +2 -0
- package/dist/stacker.esm.js.LICENSE.txt +5 -0
- package/dist/table.cjs.js +2 -1
- package/dist/table.cjs.js.LICENSE.txt +5 -0
- package/dist/table.esm.js +2 -1
- package/dist/table.esm.js.LICENSE.txt +5 -0
- package/dist/text.cjs.js +2 -1
- package/dist/text.cjs.js.LICENSE.txt +5 -0
- package/dist/text.esm.js +2 -1
- package/dist/text.esm.js.LICENSE.txt +5 -0
- package/dist/textField.cjs.js +2 -1
- package/dist/textField.cjs.js.LICENSE.txt +5 -0
- package/dist/textField.esm.js +2 -1
- package/dist/textField.esm.js.LICENSE.txt +5 -0
- package/dist/transformanim.cjs.js +2 -0
- package/dist/transformanim.cjs.js.LICENSE.txt +5 -0
- package/dist/transformanim.esm.js +2 -0
- package/dist/transformanim.esm.js.LICENSE.txt +5 -0
- package/dist/wrap.cjs.js +2 -1
- package/dist/wrap.cjs.js.LICENSE.txt +5 -0
- package/dist/wrap.esm.js +2 -1
- package/dist/wrap.esm.js.LICENSE.txt +5 -0
- package/dist/zoomCard.cjs.js +2 -1
- package/dist/zoomCard.cjs.js.LICENSE.txt +5 -0
- package/dist/zoomCard.esm.js +2 -1
- package/dist/zoomCard.esm.js.LICENSE.txt +5 -0
- package/layout/DEPRECATED-PARAGRAPH.js +6 -0
- package/layout/animator.js +5 -2
- package/layout/audio.js +6 -0
- package/layout/audionew.js +6 -0
- package/layout/base-2.js +6 -0
- package/layout/base.js +6 -0
- package/layout/betaDesktopBar.js +6 -0
- package/layout/betaMobileBar.js +6 -0
- package/layout/box.js +6 -0
- package/layout/button.js +6 -0
- package/layout/cards.js +6 -0
- package/layout/center.js +6 -0
- package/layout/checkbox.js +6 -0
- package/layout/cleanRow.js +6 -0
- package/layout/code.js +6 -0
- package/layout/container.js +6 -0
- package/layout/custom.js +6 -0
- package/layout/divImage.js +6 -0
- package/layout/dropdown.js +6 -0
- package/layout/dropdown2025.js +6 -0
- package/layout/emptyElement.js +6 -0
- package/layout/externalStylesheet.js +6 -0
- package/layout/flexCard.js +6 -0
- package/layout/flexGrid.js +6 -0
- package/layout/flexrow.js +6 -0
- package/layout/footer.js +6 -0
- package/layout/formComponents/custom.js +6 -0
- package/layout/formComponents/dataList.js +6 -0
- package/layout/formComponents/floatingInput.js +5 -0
- package/layout/formComponents/form-all.js +6 -0
- package/layout/formComponents/form.js +5 -0
- package/layout/formComponents/imagePicker.js +6 -0
- package/layout/formComponents/picker.js +6 -0
- package/layout/formComponents/radio.js +6 -0
- package/layout/formComponents/radiogroup.js +6 -0
- package/layout/formComponents/range.js +6 -0
- package/layout/free.js +6 -0
- package/layout/grid-new.js +6 -0
- package/layout/grid.js +6 -0
- package/layout/gridSwitcher.js +6 -0
- package/layout/group.js +6 -0
- package/layout/header.js +6 -0
- package/layout/horizontalScroller.js +6 -0
- package/layout/image-old.js +6 -0
- package/layout/image.js +6 -0
- package/layout/index.js +22 -0
- package/layout/label.js +6 -0
- package/layout/link.js +6 -0
- package/layout/list-OLD.js +6 -0
- package/layout/list.js +6 -0
- package/layout/metaAdder.js +6 -0
- package/layout/modal2025.js +6 -0
- package/layout/modernwrap.js +6 -0
- package/layout/multiswitcher.js +6 -0
- package/layout/multiswitcherBeta.js +6 -0
- package/layout/navBar-OLD.js +6 -0
- package/layout/navBar.js +6 -0
- package/layout/navFactor/customDiv.js +5 -1
- package/layout/newFlatAdder.js +6 -0
- package/layout/newNavBar copy 2.js +6 -0
- package/layout/newNavBar copy.js +6 -0
- package/layout/newNavBar.js +6 -0
- package/layout/offsetContainer.js +6 -0
- package/layout/progress.js +6 -0
- package/layout/row.js +6 -0
- package/layout/savedNewNavBar.js +6 -0
- package/layout/scrollvideo.js +6 -0
- package/layout/sideBar.js +6 -0
- package/layout/sideNavBar.js +6 -0
- package/layout/simpleBar.js +6 -0
- package/layout/slider2025.js +6 -0
- package/layout/spacer.js +6 -0
- package/layout/stack.js +6 -0
- package/layout/styler.js +6 -0
- package/layout/switcher.js +6 -0
- package/layout/table.js +6 -0
- package/layout/text.js +9 -1
- package/layout/textField.js +6 -0
- package/layout/ulist.js +6 -0
- package/layout/video.js +6 -0
- package/layout/withoutNew.js +6 -0
- package/layout/wrap.js +6 -0
- package/layout/zoomCard.js +6 -0
- package/lib/AppleAnim.js +794 -0
- package/lib/Stacker.js +40 -0
- package/lib/TransformAnim.js +517 -0
- package/lib/cardGetter.js +6 -0
- package/lib/designer.js +217 -14
- package/lib/elementMapper.js +15 -8
- package/lib/linkGetter.js +6 -0
- package/lib/scrollvideo.js +129 -0
- package/package.json +23 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [year] [fullname]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# nodality
|
|
2
|
+
Simple UI JS library using node-based approach.
|
|
3
|
+
|
|
4
|
+
## Installation
|
|
5
|
+
|
|
6
|
+
The easiest way to get up and running is to use **npm**:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm create nodality@latest my-app
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Tutorial
|
|
15
|
+
## Step 1
|
|
16
|
+
|
|
17
|
+
Define an array of elements you want to display in your user interface:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
let elements = [
|
|
21
|
+
{
|
|
22
|
+
type: "h1",
|
|
23
|
+
text: "Hello"
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Step 2
|
|
31
|
+
|
|
32
|
+
Define an array of nodes that will adjust the behaviour of the element.
|
|
33
|
+
This particular node will add the **stroked text** effect:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
let nodes = [
|
|
37
|
+
{
|
|
38
|
+
op: "blast"
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 3
|
|
46
|
+
|
|
47
|
+
Add the `nodes` array using the `.nodes()` modifier, and use the `.set()` method to mount the result of the code to the website.
|
|
48
|
+
Use the `code: true` option to also display the source code of the elements:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
new Des()
|
|
52
|
+
.nodes(nodes)
|
|
53
|
+
.add(elements)
|
|
54
|
+
.set({
|
|
55
|
+
mount: "#mount",
|
|
56
|
+
code: true
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Also define a `<div>` with `id="#mount"` that will serve as a root element to render the UI.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Everything Together
|
|
65
|
+
|
|
66
|
+
Here is the complete working code which uses CDN for convenient testing.
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
|
|
70
|
+
<!-- div for mounting the result -->
|
|
71
|
+
<div id="#mount"></div>
|
|
72
|
+
|
|
73
|
+
<script type="module">
|
|
74
|
+
import {Des} from "https://www.unpkg.com/nodality@1.0.0-beta.4/dist/index.esm.js";
|
|
75
|
+
|
|
76
|
+
let elements = [
|
|
77
|
+
{
|
|
78
|
+
type: "h1",
|
|
79
|
+
text: "Hello"
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
let nodes = [
|
|
84
|
+
{
|
|
85
|
+
op: "blast"
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
new Des()
|
|
90
|
+
.nodes(nodes)
|
|
91
|
+
.add(elements)
|
|
92
|
+
.set({
|
|
93
|
+
mount: "#mount",
|
|
94
|
+
code: true
|
|
95
|
+
});
|
|
96
|
+
</script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Result
|
|
102
|
+
<img src="https://nodalityjs.github.io/assets/images/image-2601c982f747c8e3977a2d588f61e040.png">
|
|
103
|
+
|
|
104
|
+
After running this code:
|
|
105
|
+
|
|
106
|
+
- You will see an `<h1>` element on the screen.
|
|
107
|
+
- When the user resizes the window and hits the **400–600px** breakpoint, a **stroke effect** will appear on the text, thanks to the `blast` modifier.
|
|
108
|
+
- The **resulting code** of the UI will also be displayed below the rendered element.
|
package/dist/animator.cjs.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Animator:()=>s});class s{constructor(){this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}}keySet(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}onScroll(t){"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform=`scale(${t.valMax})`),window.addEventListener("scroll",(()=>{let e=this.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?this.res.style.opacity=e:"scale"===t.value&&(this.res.style.transform=`scale(${e})`)}))}setAny(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}setID(t){this.id=t}setPrevText(t){this.prevText=t}getCSS(){return this.css}getPX(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}respad(t){const e=()=>{this.pad(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(min-width: ${this.getPX(s)}`).matches&&this.pad(t[e].values)}};window.addEventListener("resize",e),e()}resmar(t){const e=()=>{this.mar(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(max-width: ${this.getPX(s)}`).matches&&this.mar(t[e].values)}};window.addEventListener("resize",e),e()}resprop(t){this.prevBackground=this.res.style.background,this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.prevBorder=this.res.style.border;const e=()=>{this.res.style.background=this.prevBackground,this.res.style.width=this.prevWidth,this.res.style.height=this.prevHeight,this.res.style.border=this.prevBorder;for(let e=0;e<t.length;e++){let s=t[e].breakpoint;if(window.matchMedia(`(max-width: ${this.getPX(s)}`).matches){const s={};for(const i in t[e])"breakpoint"!==i&&(s[i]=t[e][i]);this.set(s)}}};window.addEventListener("resize",e),e()}isNumber(t){return"number"==typeof t&&!isNaN(t)}pad(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++)switch(r[t]){case"a":this.res.style.padding=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.paddingTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.paddingLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.paddingRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.paddingBottom=this.isNumber(a)?`${a}px`:a}}}return this}as(t){return this.res.style.alignSelf=t,this}mar(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++){switch(r[t]){case"a":this.res.style.margin=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.marginTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.marginLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.marginRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.marginBottom=this.isNumber(a)?`${a}px`:a}"auto"===r[t]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}}}return this}smartRange(t,e,s){t<e.min&&(t=e.min),t>e.max&&(t=e.max);let i=(t-e.min)/(e.max-e.min);e.min>e.max&&(i=(t-e.max)/(e.min-e.max));let r=(s.min-s.max)*i-s.min;if(r=Math.abs(r),s.min<s.max){let t=(s.max+Math.abs(s.min))*i;r=s.min+t}return r}gpos(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}fluidCopy(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;let e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}setIndex(t){this.index=t}borderObj(t){let e=t.type??"solid";return this.res.style.border=`${t.width} ${e} ${t.color}`,this.res.style.borderRadius=t.radius,this}protoReact(t,e){t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,o]=a.range,n=parseInt(t),l=parseInt(o);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=n&&s<=l&&h&&("gradient"===a.log&&(i+="gradient"),"blast"===a.log&&(i+="blast"),"animation"===a.log&&(i+="animation"),"shadow"===a.log&&(i+="shadow"),"span"===a.log&&(i+="span"),"filter"===a.log&&(i+="filter"),"background"===a.log&&(i+="background"))}this.res.style.margin="";let a=this.res.style.color;for(t.map((t=>t.log)).filter((t=>null!=t)).includes("gradient")&&(this.res.style.WebkitBackgroundClip="",this.res.style.background=""),this.res.style["-webkit-text-stroke"]="",this.res.style.filter="",this.res.style.textShadow="",this.res.style.border="";this.res.firstChild;)this.res.removeChild(this.res.firstChild);if(this.res.textContent=this.text,""===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.color=a),"blast"===i){for(r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}for(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]=this.globalBlast,r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}}if("gradient"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.border="1px solid orange"),"background"===i&&(this.res.style.background="orange"),"gradientblast"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke"]=this.globalBlast),"gradientanimation"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text"),"gradientanimationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.textShadow=this.globalShadow),"animationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"shadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"span"===i&&this.options.span){let t;for(t=Array.isArray(this.options.span)?this.options.span.filter((t=>"span"===t.op.name))[0]:this.options.span,this.res.textContent="",r=0;r<t.op.parts.length;r++){let e=t.op.parts[r].style,s=new Text(t.op.parts[r].text).setup({type:"span"}).set(e).render();this.res.appendChild(s)}}if("filter"===i){let t=this.options.filtera.op.filter;this.res.style.filter=t,this.res.style.border="8px solid orange"}};window.addEventListener("resize",s),s()}setPref(t){this.preffersId=t}setClass(t){this.class=t}betaReact(t,e){this.ap=!1,this.cta=0,this.once=!1,t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,o]=a.range,n=parseInt(t),l=parseInt(o);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=n&&s<=l&&h&&("blast"===a.log&&(i+="blast"),"shadow"===a.log&&(i+="shadow"),"background"===a.log&&(i+="background"),"gradient"===a.log&&(i+="gradient"),"spana"===a.log&&(i+="spana"),"layout"===a.log&&(i+="layout"),"margin"===a.log&&(i+="margin"),a.op&&a.op.margin&&(this.useMargin=a.op.margin))}if(this.res.style.background="",this.res.style.backgroundColor="",this.res.style.textShadow="",this.res.style.border="",this.res.style.margin="",this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-stroke-width"]="","background"===i&&(this.res.style.backgroundColor="green"),"margin"===i)for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if("blastbackgroundmargin"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green","FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("blastbackground"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green",this.useMargin?this.res.style.margin="1rem":this.res.setAttribute("id","iofhwoiefhoih"),"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("layout"===i&&(this.res.style.alignSelf="start",this.res.style.border="1px solid purple"),"blast"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}"blastgradientbackground"===i&&(this.res.style.border="1px solid yellow",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),"gradient"===i&&(this.res.style.background="linear-gradient(to left, #3498db, #1abc9c)","FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.textContent=this.text)),"shadow"===i&&("FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow="#1abc9cff -6px 6px , #1abc9c40 -12px 12px",this.res.textContent=this.text))};window.addEventListener("resize",s),s()}cssGen(t,e,s,i){return this.css=[""],[""]}chainReact(t,e,s){this.cssGen(t,e,this.class,void 0!==this.class),this.ap=!1,this.cta=0,this.once=!1;for(let e of t)e.range||(e.range=["0px","999999px"]);t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const i=()=>{const i=window.visualViewport.width;let r=[],a=[];this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const s of t){this.counterIndex++;const[t,n]=s.range,l=parseInt(t),h=parseInt(n);let d=!0;if(s.target){d=!1;for(var o=0;o<s.target.length;o++)s.target[o]===e&&(d=!0)}i>=l&&i<=h&&d&&(r.push(s.log),a.push(s),s.op&&s.op.margin&&(this.useMargin=s.op.margin))}if(s&&!s.includes("background")&&(this.res.style.background="",this.res.style.backgroundColor=""),this.res.style.textShadow="",s&&!s.includes("border")&&(this.res.style.border=""),s&&!s.includes("margin")&&(this.res.style.margin=""),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke-color"]="",this.res.style["-webkit-text-stroke-width"]="",this.res.style.filter="",(r.includes("gradient")||r.includes("shadow"))&&(this.res.style.position="relative",this.res.style.zIndex=-1),r.includes("blast")){let t=a.filter((t=>"blast"===t.log))[0].op.color,e=a.filter((t=>"blast"===t.log))[0].op.width??"1px";"FlexRowLayoutElement"===this.getType()?this.res.style.border=`${e}px solid orange`:(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]=t,this.res.style["-webkit-text-stroke-width"]=`${e}`)}if(r.includes("filter")){let t=a.filter((t=>"filter"===t.log))[0].op.filter;this.res.style.filter=t}if(r.includes("background")&&(this.res.style.backgroundColor="green"),r.includes("gradient")&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["background-clip"]="text"),r.includes("shadow"))if("FlexRowLayoutElement"===this.getType());else{let t="",e=0;for(o=0;o<this.options.shadow.op.steps;o++)e+=3,t+=`drop-shadow(${e}px ${e}px ${e}px gray) `;this.res.style.filter=t}if(r.includes("margin"))for(o=0;o<t.length;o++){if(!t[o].op)continue;const e=t[o].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if(r.includes("animation")){if(this.options.animation&&!this.hasAnimated&&!this.options.animation.op.fireAt){this.hasAnimated=!0;let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),this.res.animate(t.keyframesOpen,t.openOptions)}if(this.options.animation&&this.options.animation.op.fireAt&&this.options.animation.op.fireAt.endsWith("px")){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"});const e=()=>{window.scrollY>parseFloat(t.fireAt)&&(this.res.animate(t.keyframesOpen,t.openOptions),window.removeEventListener("scroll",e))};window.addEventListener("scroll",e)}if(this.options.animation&&this.options.animation.op.fireAt&&"inview"===this.options.animation.op.fireAt){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver(((e,s)=>{e.forEach((e=>{e.isIntersecting&&(this.res.animate(t.keyframesOpen,t.openOptions),s.disconnect())}))})).observe(this.res)}}};window.addEventListener("resize",i),i()}reactOnTransform=t=>{if(t.transform||t.op&&t.op.transform){let e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),this.setDefault=(t,e="0px")=>0===t.length?e+" ":t;const s=t=>{const e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;const s=e[1].split(",").map((t=>t.trim()));return 1===s.length?`rotate(${s[0]})`:2===s.length?`rotateX(${s[0]}) rotateY(${s[1]})`:3===s.length?`rotateX(${s[0]}) rotateY(${s[1]}) rotate(${s[2]})`:t},i=()=>{let i="",r="",a="",o="",n="",l="",h="",d="",p="";if(0===e.values.length)return;e.values.forEach((t=>{t.startsWith("tx:")&&(i=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?a=t.replace("tz:",""):t.startsWith("scale(")?o=t:t.startsWith("skew(")?n=t:t.startsWith("rotate(")?l=s(t):t.startsWith("perspective(")?h=t:t.startsWith("matrix(")?d=t:t.startsWith("opacity:")&&(p=t.replace("opacity:",""))})),i=this.setDefault(i),r=this.setDefault(r),a=this.setDefault(a);let c="";if("0px"!=r&&"0px"!=i&&"0px"!=a?c+=`translate3d(${i}, ${r}, ${a})`:"0px"==r&&"0px"==i||(c+=`translate(${i}, ${r})`),o&&(c+=` ${o}`),l&&(c+=` ${l}`),n&&(c+=` ${n}`),h&&(c+=` ${h}`),d&&(c+=` ${d}`),c){if(t.op.transform.duration){let e=t.op.transform.duration.replace(/^(\d+)(s)-/,((t,e,s)=>e/2+s+" ")),s=`transform ${e}, opacity ${e}`;this.res.style.transition=s}else this.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";this.res.style.transform=c,this.res.style.opacity=p}};e.on?this.res.addEventListener(e.on,(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()})):window.addEventListener("load",(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()}));const r=()=>{let t="";e.values.forEach((e=>{e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),this.res.style.opacity="1"})),t&&(this.res.style.transform=t.trim())};if(e.on)this.res.addEventListener("mouseout",(()=>{e.keep||r()}));else{let t=1e3*parseFloat(e.duration),s=e.closeAfter?e.closeAfter:0;setTimeout((()=>{e.keep||r()}),t/2+s)}}};maxWidth(t){return this.res.style.maxWidth=t,this}removeQuotesFromFirstWord(t){return t.replace(/"([^"]+)":/g,"$1:")}arrayMargin(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}navBarExpand(){return this.res.style.backgroundColor="green",this.res.animate([{transform:"scaleY(3.0)"}],{duration:2e3,iterations:1,fill:"both"}),this}scrollFade(t,e){return this.res.style.visibility="hidden",this.faden(t,e,"scroll"),this}expand(t){return!1===this.state.isExpanded?"click"===t.on?this.res.addEventListener("click",(()=>{this.innerExpand(t)})):this.innerExpand(t):this.innerExpandBack(t),this.state.isExpanded=!this.state.isExpanded,this}move(t){return"click"===t.on?this.res.addEventListener("click",(()=>{this.moveUpa(t)})):("up"===t.direction&&this.moveUpa(t),"down"===t.direction&&this.moveDowna(t),this.state.isMovedUp=!this.state.isMovedUp,"left"===t.direction&&this.moveLeft(t)),this}moveLeft(t){return this.res.animate([{transform:"translateX(0px)"},{transform:`translateX(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpa(t){return!1===this.state.isMovedUp?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveDowna(t){return!1===this.state.isMovedDown?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpaBack(t){return this.res.animate([{transform:"translateX(0px)"}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}innerExpandBack(t){this.res.animate([{width:this.prevWidth,height:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"})}innerExpand(t){return this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.res.animate([{width:this.prevWidth,height:this.prevHeight},{width:t.width??this.prevWidth,height:t.height??this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"}),this}fade(t){return this.res.style.visibility="hidden",this.faden(t.duration,t.from,"load"),t.finalOpacity&&(this.finalOpacity=t.finalOpacity),this}faden(t,e,s){return this.res.style.visibility="hidden",this.scrolled=!1,window.addEventListener(s,(()=>{this.res.style.visibility="visible";var i=window.innerHeight;(this.res.getBoundingClientRect().top-i<=0||"load"==s)&&0==this.scrolled&&("left"==e&&this.res.animate([{transform:"translateX(-30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"right"==e&&this.res.animate([{transform:"translateX(30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"top"==e&&this.res.animate([{transform:"translateY(-30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),"bottom"==e&&this.res.animate([{transform:"translateY(30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),this.res.animate([{opacity:"0.0"},{opacity:"1.0"}],{duration:t,iterations:1}),this.scrolled=!0)})),this}}module.exports=e})();
|
|
1
|
+
/*! For license information please see animator.cjs.js.LICENSE.txt */
|
|
2
|
+
(()=>{"use strict";var t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var s,n,i,a,o=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(s=i.call(r)).done)&&(o.push(s.value),o.length!==e);l=!0);}catch(t){c=!0,n=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw n}}return o}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var s=0,n=function(){};return{s:n,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){l=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(l)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,s=Array(e);r<e;r++)s[r]=t[r];return s}function o(t,e){for(var r=0;r<e.length;r++){var s=e[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,l(s.key),s)}}function l(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}t.r(e),t.d(e,{Animator:()=>c});var c=function(){return t=function t(){var e,r,s,n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,s=function(t){if(t.transform||t.op&&t.op.transform){var e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),n.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var r=function(){var r="",s="",i="",a="",o="",l="",c="",u="",d="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(s=t.replace("ty:","")),t.startsWith("tz:")?i=t.replace("tz:",""):t.startsWith("scale(")?a=t:t.startsWith("skew(")?o=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var r=e[1].split(",").map((function(t){return t.trim()}));return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(d=t.replace("opacity:",""))})),r=n.setDefault(r),s=n.setDefault(s),i=n.setDefault(i);var f="";if("0px"!=s&&"0px"!=r&&"0px"!=i?f+="translate3d(".concat(r,", ").concat(s,", ").concat(i,")"):"0px"==s&&"0px"==r||(f+="translate(".concat(r,", ").concat(s,")")),a&&(f+=" ".concat(a)),l&&(f+=" ".concat(l)),o&&(f+=" ".concat(o)),c&&(f+=" ".concat(c)),u&&(f+=" ".concat(u)),f){if(t.op.transform.duration){var h=t.op.transform.duration.replace(/^(\d+)(s)-/,(function(t,e,r){return e/2+r+" "})),p="transform ".concat(h,", opacity ").concat(h);n.res.style.transition=p}else n.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";n.res.style.transform=f,n.res.style.opacity=d}}};e.on?n.res.addEventListener(e.on,(function(){e.delay?setTimeout((function(){r()}),e.delay):r()})):window.addEventListener("load",(function(){e.delay?setTimeout((function(){r()}),e.delay):r()}));var s=function(){var t="";e.values.forEach((function(e){e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),n.res.style.opacity="1"})),t&&(n.res.style.transform=t.trim())};if(e.on)n.res.addEventListener("mouseout",(function(){e.keep||s()}));else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||s()}),i/2+a)}}},(r=l(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[r]=s,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}},(e=[{key:"keySet",value:function(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}},{key:"onScroll",value:function(t){var e=this;"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform="scale(".concat(t.valMax,")")),window.addEventListener("scroll",(function(){var r=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=r:"scale"===t.value&&(e.res.style.transform="scale(".concat(r,")"))}))}},{key:"setAny",value:function(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}},{key:"setID",value:function(t){this.id=t}},{key:"setPrevText",value:function(t){this.prevText=t}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}},{key:"respad",value:function(t){var e=this,r=function(){e.pad(t[0].values);for(var r=0;r<t.length;r++){var s=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(s))).matches&&e.pad(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resmar",value:function(t){var e=this,r=function(){e.mar(t[0].values);for(var r=0;r<t.length;r++){var s=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(s))).matches&&e.mar(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resprop",value:function(t){var e=this;this.prevBackground=this.res.style.background,this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.prevBorder=this.res.style.border;var r=function(){e.res.style.background=e.prevBackground,e.res.style.width=e.prevWidth,e.res.style.height=e.prevHeight,e.res.style.border=e.prevBorder;for(var r=0;r<t.length;r++){var s=t[r].breakpoint;if(window.matchMedia("(max-width: ".concat(e.getPX(s))).matches){var n={};for(var i in t[r])"breakpoint"!==i&&(n[i]=t[r][i]);e.set(n)}}};window.addEventListener("resize",r),r()}},{key:"isNumber",value:function(t){return"number"==typeof t&&!isNaN(t)}},{key:"pad",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),s=0;s<r.length;s++)for(var n=r[s],i=t[e][n],a=0;a<n.length;a++)switch(n[a]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),s=0;s<r.length;s++)for(var n=r[s],i=t[e][n],a=0;a<n.length;a++){switch(n[a]){case"a":this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"auto"===n[a]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}return this}},{key:"smartRange",value:function(t,e,r){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var s=(t-e.min)/(e.max-e.min);e.min>e.max&&(s=(t-e.max)/(e.min-e.max));var n=(r.min-r.max)*s-r.min;if(n=Math.abs(n),r.min<r.max){var i=(r.max+Math.abs(r.min))*s;n=r.min+i}return n}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var a=document.createTextNode(this.text);this.res.appendChild(a),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(t){this.index=t}},{key:"borderObj",value:function(t){var e,r=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(r," ").concat(t.color),this.res.style.borderRadius=t.radius,this}},{key:"protoReact",value:function(t,e){var r=this;t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var i=function(){var i=window.innerWidth,a="";r.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var o,l=n(t);try{for(l.s();!(o=l.n()).done;){var c=o.value;r.counterIndex++;var u=s(c.range,2),d=u[0],f=u[1],h=parseInt(d),p=parseInt(f),y=!0;if(c.target){y=!1;for(var m=0;m<c.target.length;m++)c.target[m]===e&&(y=!0)}i>=h&&i<=p&&y&&("gradient"===c.log&&(a+="gradient"),"blast"===c.log&&(a+="blast"),"animation"===c.log&&(a+="animation"),"shadow"===c.log&&(a+="shadow"),"span"===c.log&&(a+="span"),"filter"===c.log&&(a+="filter"),"background"===c.log&&(a+="background"))}}catch(t){l.e(t)}finally{l.f()}r.res.style.margin="";var v,g=r.res.style.color;for(t.map((function(t){return t.log})).filter((function(t){return null!=t})).includes("gradient")&&(r.res.style.WebkitBackgroundClip="",r.res.style.background=""),r.res.style["-webkit-text-stroke"]="",r.res.style.filter="",r.res.style.textShadow="",r.res.style.border="";r.res.firstChild;)r.res.removeChild(r.res.firstChild);if(r.res.textContent=r.text,""===a&&(r.res.style["-webkit-text-fill-color"]="",r.res.style.color=g),"blast"===a){for(m=0;m<t.length;m++){var x=t[m].op.offsets;x&&void 0!==r.index&&(r.res.style.margin=x[Number(r.index)]+"px")}for(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke"]=r.globalBlast,m=0;m<t.length;m++){var b=t[m].op.offsets;b&&void 0!==r.index&&(r.res.style.margin=b[Number(r.index)]+"px")}}if("gradient"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text",r.res.style.border="1px solid orange"),"background"===a&&(r.res.style.background="orange"),"gradientblast"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text",r.res.style["-webkit-text-stroke"]=r.globalBlast),"gradientanimation"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text"),"gradientanimationshadow"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text",r.res.style.textShadow=r.globalShadow),"animationshadow"===a&&(r.res.style["-webkit-text-fill-color"]="",r.res.style.textShadow=r.globalShadow),"shadow"===a&&(r.res.style["-webkit-text-fill-color"]="",r.res.style.textShadow=r.globalShadow),"span"===a&&r.options.span)for(v=Array.isArray(r.options.span)?r.options.span.filter((function(t){return"span"===t.op.name}))[0]:r.options.span,r.res.textContent="",m=0;m<v.op.parts.length;m++){var k=v.op.parts[m].style,w=new Text(v.op.parts[m].text).setup({type:"span"}).set(k).render();r.res.appendChild(w)}if("filter"===a){var S=r.options.filtera.op.filter;r.res.style.filter=S,r.res.style.border="8px solid orange"}};window.addEventListener("resize",i),i()}},{key:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"betaReact",value:function(t,e){var r=this;this.ap=!1,this.cta=0,this.once=!1,t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var i=function(){var i=window.innerWidth,a="";r.resCopy=r.res,r.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var o,l=n(t);try{for(l.s();!(o=l.n()).done;){var c=o.value;r.counterIndex++;var u=s(c.range,2),d=u[0],f=u[1],h=parseInt(d),p=parseInt(f),y=!0;if(c.target){y=!1;for(var m=0;m<c.target.length;m++)c.target[m]===e&&(y=!0)}i>=h&&i<=p&&y&&("blast"===c.log&&(a+="blast"),"shadow"===c.log&&(a+="shadow"),"background"===c.log&&(a+="background"),"gradient"===c.log&&(a+="gradient"),"spana"===c.log&&(a+="spana"),"layout"===c.log&&(a+="layout"),"margin"===c.log&&(a+="margin"),c.op&&c.op.margin&&(r.useMargin=c.op.margin))}}catch(t){l.e(t)}finally{l.f()}if(r.res.style.background="",r.res.style.backgroundColor="",r.res.style.textShadow="",r.res.style.border="",r.res.style.margin="",r.res.style["-webkit-text-fill-color"]="",r.res.style["-webkit-text-stroke"]="",r.res.style["-webkit-text-stroke-width"]="","background"===a&&(r.res.style.backgroundColor="green"),"margin"===a)for(m=0;m<t.length;m++)if(t[m].op){var v=t[m].op.offsets;v&&void 0!==r.index&&(r.res.style.margin=v[Number(r.index)]+"px")}if("blastbackgroundmargin"===a){for(m=0;m<t.length;m++)if(t[m].op){var g=t[m].op.offsets;g&&void 0!==r.index&&(r.res.style.margin=g[Number(r.index)]+"px")}r.res.style.backgroundColor="green","FlexRowLayoutElement"===r.getType()?r.res.style.border="1px solid orange":(r.res.textContent=r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"}if("blastbackground"===a){for(m=0;m<t.length;m++)if(t[m].op){var x=t[m].op.offsets;x&&void 0!==r.index&&(r.res.style.margin=x[Number(r.index)]+"px")}r.res.style.backgroundColor="green",r.useMargin?r.res.style.margin="1rem":r.res.setAttribute("id","iofhwoiefhoih"),"FlexRowLayoutElement"===r.getType()?r.res.style.border="1px solid orange":(r.res.textContent=r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"}if("layout"===a&&(r.res.style.alignSelf="start",r.res.style.border="1px solid purple"),"blast"===a){for(m=0;m<t.length;m++)if(t[m].op){var b=t[m].op.offsets;b&&void 0!==r.index&&(r.res.style.margin=b[Number(r.index)]+"px")}"FlexRowLayoutElement"===r.getType()?r.res.style.border="1px solid orange":(r.res.textContent=r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-background-clip"]="text",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"}"blastgradientbackground"===a&&(r.res.style.border="1px solid yellow",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),"gradient"===a&&(r.res.style.background="linear-gradient(to left, #3498db, #1abc9c)","FlexRowLayoutElement"===r.getType()||(r.res.children[0]&&r.res.removeChild(r.res.children[0]),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-background-clip"]="text",r.res.textContent=r.text)),"shadow"===a&&("FlexRowLayoutElement"===r.getType()||(r.res.children[0]&&r.res.removeChild(r.res.children[0]),r.res.style["-webkit-text-fill-color"]="",r.res.style["-webkit-text-fill-color"]="",r.res.style.textShadow="#1abc9cff -6px 6px , #1abc9c40 -12px 12px",r.res.textContent=r.text))};window.addEventListener("resize",i),i()}},{key:"cssGen",value:function(t,e,r,s){return this.css=[""],[""]}},{key:"chainReact",value:function(t,e,r){var i=this;this.cssGen(t,e,this.class,void 0!==this.class),this.ap=!1,this.cta=0,this.once=!1;var a,o=n(t);try{for(o.s();!(a=o.n()).done;){var l=a.value;l.range||(l.range=["0px","999999px"])}}catch(t){o.e(t)}finally{o.f()}t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var c=function(){var a=window.visualViewport.width,o=[],l=[];i.resCopy=i.res,i.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var c,u=n(t);try{for(u.s();!(c=u.n()).done;){var d=c.value;i.counterIndex++;var f=s(d.range,2),h=f[0],p=f[1],y=parseInt(h),m=parseInt(p),v=!0;if(d.target){v=!1;for(var g=0;g<d.target.length;g++)d.target[g]===e&&(v=!0)}a>=y&&a<=m&&v&&(o.push(d.log),l.push(d),d.op&&d.op.margin&&(i.useMargin=d.op.margin))}}catch(t){u.e(t)}finally{u.f()}if(r&&!r.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",r&&!r.includes("border")&&(i.res.style.border=""),r&&!r.includes("margin")&&(i.res.style.margin=""),i.res.style["-webkit-text-fill-color"]="",i.res.style["-webkit-text-stroke-color"]="",i.res.style["-webkit-text-stroke-width"]="",i.res.style.filter="",(o.includes("gradient")||o.includes("shadow"))&&(i.res.style.position="relative",i.res.style.zIndex=-1),o.includes("blast")){var x,b=l.filter((function(t){return"blast"===t.log}))[0].op.color,k=null!==(x=l.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==x?x:"1px";"FlexRowLayoutElement"===i.getType()?i.res.style.border="".concat(k,"px solid orange"):(i.res.textContent=i.text,i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=b,i.res.style["-webkit-text-stroke-width"]="".concat(k))}if(o.includes("filter")){var w=l.filter((function(t){return"filter"===t.log}))[0].op.filter;i.res.style.filter=w}if(o.includes("background")&&(i.res.style.backgroundColor="green"),o.includes("gradient")&&(i.res.style["-webkit-text-fill-color"]="transparent",i.res.style.background=i.globalGradient,i.res.style["background-clip"]="text"),o.includes("shadow"))if("FlexRowLayoutElement"===i.getType());else{var S="",E=0;for(g=0;g<i.options.shadow.op.steps;g++)S+="drop-shadow(".concat(E+=3,"px ").concat(E,"px ").concat(E,"px gray) ");i.res.style.filter=S}if(o.includes("margin"))for(g=0;g<t.length;g++)if(t[g].op){var T=t[g].op.offsets;T&&void 0!==i.index&&(i.res.style.margin=T[Number(i.index)]+"px")}if(o.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var C=i.options.animation.op;i.res.animate(C.keyframesClose,{duration:0,fill:"forwards"}),i.res.animate(C.keyframesOpen,C.openOptions)}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var W=i.options.animation.op;i.res.animate(W.keyframesClose,{duration:0,fill:"forwards"});var L=function(){window.scrollY>parseFloat(W.fireAt)&&(i.res.animate(W.keyframesOpen,W.openOptions),window.removeEventListener("scroll",L))};window.addEventListener("scroll",L)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var O=i.options.animation.op;i.res.animate(O.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(i.res.animate(O.keyframesOpen,O.openOptions),e.disconnect())}))})).observe(i.res)}}};window.addEventListener("resize",c),c()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}},{key:"navBarExpand",value:function(){return this.res.style.backgroundColor="green",this.res.animate([{transform:"scaleY(3.0)"}],{duration:2e3,iterations:1,fill:"both"}),this}},{key:"scrollFade",value:function(t,e){return this.res.style.visibility="hidden",this.faden(t,e,"scroll"),this}},{key:"expand",value:function(t){var e=this;return!1===this.state.isExpanded?"click"===t.on?this.res.addEventListener("click",(function(){e.innerExpand(t)})):this.innerExpand(t):this.innerExpandBack(t),this.state.isExpanded=!this.state.isExpanded,this}},{key:"move",value:function(t){var e=this;return"click"===t.on?this.res.addEventListener("click",(function(){e.moveUpa(t)})):("up"===t.direction&&this.moveUpa(t),"down"===t.direction&&this.moveDowna(t),this.state.isMovedUp=!this.state.isMovedUp,"left"===t.direction&&this.moveLeft(t)),this}},{key:"moveLeft",value:function(t){return this.res.animate([{transform:"translateX(0px)"},{transform:"translateX(-".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"moveUpa",value:function(t){return!1===this.state.isMovedUp?this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(-".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"moveDowna",value:function(t){return!1===this.state.isMovedDown?this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(-".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"moveUpaBack",value:function(t){return this.res.animate([{transform:"translateX(0px)"}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"innerExpandBack",value:function(t){this.res.animate([{width:this.prevWidth,height:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"})}},{key:"innerExpand",value:function(t){var e,r;return this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.res.animate([{width:this.prevWidth,height:this.prevHeight},{width:null!==(e=t.width)&&void 0!==e?e:this.prevWidth,height:null!==(r=t.height)&&void 0!==r?r:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"}),this}},{key:"fade",value:function(t){return this.res.style.visibility="hidden",this.faden(t.duration,t.from,"load"),t.finalOpacity&&(this.finalOpacity=t.finalOpacity),this}},{key:"faden",value:function(t,e,r){var s=this;return this.res.style.visibility="hidden",this.scrolled=!1,window.addEventListener(r,(function(){s.res.style.visibility="visible";var n=window.innerHeight;(s.res.getBoundingClientRect().top-n<=0||"load"==r)&&0==s.scrolled&&("left"==e&&s.res.animate([{transform:"translateX(-30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"right"==e&&s.res.animate([{transform:"translateX(30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"top"==e&&s.res.animate([{transform:"translateY(-30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),"bottom"==e&&s.res.animate([{transform:"translateY(30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),s.res.animate([{opacity:"0.0"},{opacity:"1.0"}],{duration:t,iterations:1}),s.scrolled=!0)})),this}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();module.exports=e})();
|
package/dist/animator.esm.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{y:()=>s});class s{constructor(){this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}}keySet(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}onScroll(t){"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform=`scale(${t.valMax})`),window.addEventListener("scroll",(()=>{let e=this.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?this.res.style.opacity=e:"scale"===t.value&&(this.res.style.transform=`scale(${e})`)}))}setAny(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}setID(t){this.id=t}setPrevText(t){this.prevText=t}getCSS(){return this.css}getPX(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}respad(t){const e=()=>{this.pad(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(min-width: ${this.getPX(s)}`).matches&&this.pad(t[e].values)}};window.addEventListener("resize",e),e()}resmar(t){const e=()=>{this.mar(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(max-width: ${this.getPX(s)}`).matches&&this.mar(t[e].values)}};window.addEventListener("resize",e),e()}resprop(t){this.prevBackground=this.res.style.background,this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.prevBorder=this.res.style.border;const e=()=>{this.res.style.background=this.prevBackground,this.res.style.width=this.prevWidth,this.res.style.height=this.prevHeight,this.res.style.border=this.prevBorder;for(let e=0;e<t.length;e++){let s=t[e].breakpoint;if(window.matchMedia(`(max-width: ${this.getPX(s)}`).matches){const s={};for(const i in t[e])"breakpoint"!==i&&(s[i]=t[e][i]);this.set(s)}}};window.addEventListener("resize",e),e()}isNumber(t){return"number"==typeof t&&!isNaN(t)}pad(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++)switch(r[t]){case"a":this.res.style.padding=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.paddingTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.paddingLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.paddingRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.paddingBottom=this.isNumber(a)?`${a}px`:a}}}return this}as(t){return this.res.style.alignSelf=t,this}mar(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++){switch(r[t]){case"a":this.res.style.margin=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.marginTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.marginLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.marginRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.marginBottom=this.isNumber(a)?`${a}px`:a}"auto"===r[t]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}}}return this}smartRange(t,e,s){t<e.min&&(t=e.min),t>e.max&&(t=e.max);let i=(t-e.min)/(e.max-e.min);e.min>e.max&&(i=(t-e.max)/(e.min-e.max));let r=(s.min-s.max)*i-s.min;if(r=Math.abs(r),s.min<s.max){let t=(s.max+Math.abs(s.min))*i;r=s.min+t}return r}gpos(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}fluidCopy(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;let e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}setIndex(t){this.index=t}borderObj(t){let e=t.type??"solid";return this.res.style.border=`${t.width} ${e} ${t.color}`,this.res.style.borderRadius=t.radius,this}protoReact(t,e){t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,o]=a.range,n=parseInt(t),l=parseInt(o);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=n&&s<=l&&h&&("gradient"===a.log&&(i+="gradient"),"blast"===a.log&&(i+="blast"),"animation"===a.log&&(i+="animation"),"shadow"===a.log&&(i+="shadow"),"span"===a.log&&(i+="span"),"filter"===a.log&&(i+="filter"),"background"===a.log&&(i+="background"))}this.res.style.margin="";let a=this.res.style.color;for(t.map((t=>t.log)).filter((t=>null!=t)).includes("gradient")&&(this.res.style.WebkitBackgroundClip="",this.res.style.background=""),this.res.style["-webkit-text-stroke"]="",this.res.style.filter="",this.res.style.textShadow="",this.res.style.border="";this.res.firstChild;)this.res.removeChild(this.res.firstChild);if(this.res.textContent=this.text,""===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.color=a),"blast"===i){for(r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}for(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]=this.globalBlast,r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}}if("gradient"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.border="1px solid orange"),"background"===i&&(this.res.style.background="orange"),"gradientblast"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke"]=this.globalBlast),"gradientanimation"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text"),"gradientanimationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.textShadow=this.globalShadow),"animationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"shadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"span"===i&&this.options.span){let t;for(t=Array.isArray(this.options.span)?this.options.span.filter((t=>"span"===t.op.name))[0]:this.options.span,this.res.textContent="",r=0;r<t.op.parts.length;r++){let e=t.op.parts[r].style,s=new Text(t.op.parts[r].text).setup({type:"span"}).set(e).render();this.res.appendChild(s)}}if("filter"===i){let t=this.options.filtera.op.filter;this.res.style.filter=t,this.res.style.border="8px solid orange"}};window.addEventListener("resize",s),s()}setPref(t){this.preffersId=t}setClass(t){this.class=t}betaReact(t,e){this.ap=!1,this.cta=0,this.once=!1,t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,o]=a.range,n=parseInt(t),l=parseInt(o);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=n&&s<=l&&h&&("blast"===a.log&&(i+="blast"),"shadow"===a.log&&(i+="shadow"),"background"===a.log&&(i+="background"),"gradient"===a.log&&(i+="gradient"),"spana"===a.log&&(i+="spana"),"layout"===a.log&&(i+="layout"),"margin"===a.log&&(i+="margin"),a.op&&a.op.margin&&(this.useMargin=a.op.margin))}if(this.res.style.background="",this.res.style.backgroundColor="",this.res.style.textShadow="",this.res.style.border="",this.res.style.margin="",this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-stroke-width"]="","background"===i&&(this.res.style.backgroundColor="green"),"margin"===i)for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if("blastbackgroundmargin"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green","FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("blastbackground"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green",this.useMargin?this.res.style.margin="1rem":this.res.setAttribute("id","iofhwoiefhoih"),"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("layout"===i&&(this.res.style.alignSelf="start",this.res.style.border="1px solid purple"),"blast"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}"blastgradientbackground"===i&&(this.res.style.border="1px solid yellow",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),"gradient"===i&&(this.res.style.background="linear-gradient(to left, #3498db, #1abc9c)","FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.textContent=this.text)),"shadow"===i&&("FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow="#1abc9cff -6px 6px , #1abc9c40 -12px 12px",this.res.textContent=this.text))};window.addEventListener("resize",s),s()}cssGen(t,e,s,i){return this.css=[""],[""]}chainReact(t,e,s){this.cssGen(t,e,this.class,void 0!==this.class),this.ap=!1,this.cta=0,this.once=!1;for(let e of t)e.range||(e.range=["0px","999999px"]);t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const i=()=>{const i=window.visualViewport.width;let r=[],a=[];this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const s of t){this.counterIndex++;const[t,n]=s.range,l=parseInt(t),h=parseInt(n);let d=!0;if(s.target){d=!1;for(var o=0;o<s.target.length;o++)s.target[o]===e&&(d=!0)}i>=l&&i<=h&&d&&(r.push(s.log),a.push(s),s.op&&s.op.margin&&(this.useMargin=s.op.margin))}if(s&&!s.includes("background")&&(this.res.style.background="",this.res.style.backgroundColor=""),this.res.style.textShadow="",s&&!s.includes("border")&&(this.res.style.border=""),s&&!s.includes("margin")&&(this.res.style.margin=""),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke-color"]="",this.res.style["-webkit-text-stroke-width"]="",this.res.style.filter="",(r.includes("gradient")||r.includes("shadow"))&&(this.res.style.position="relative",this.res.style.zIndex=-1),r.includes("blast")){let t=a.filter((t=>"blast"===t.log))[0].op.color,e=a.filter((t=>"blast"===t.log))[0].op.width??"1px";"FlexRowLayoutElement"===this.getType()?this.res.style.border=`${e}px solid orange`:(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]=t,this.res.style["-webkit-text-stroke-width"]=`${e}`)}if(r.includes("filter")){let t=a.filter((t=>"filter"===t.log))[0].op.filter;this.res.style.filter=t}if(r.includes("background")&&(this.res.style.backgroundColor="green"),r.includes("gradient")&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["background-clip"]="text"),r.includes("shadow"))if("FlexRowLayoutElement"===this.getType());else{let t="",e=0;for(o=0;o<this.options.shadow.op.steps;o++)e+=3,t+=`drop-shadow(${e}px ${e}px ${e}px gray) `;this.res.style.filter=t}if(r.includes("margin"))for(o=0;o<t.length;o++){if(!t[o].op)continue;const e=t[o].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if(r.includes("animation")){if(this.options.animation&&!this.hasAnimated&&!this.options.animation.op.fireAt){this.hasAnimated=!0;let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),this.res.animate(t.keyframesOpen,t.openOptions)}if(this.options.animation&&this.options.animation.op.fireAt&&this.options.animation.op.fireAt.endsWith("px")){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"});const e=()=>{window.scrollY>parseFloat(t.fireAt)&&(this.res.animate(t.keyframesOpen,t.openOptions),window.removeEventListener("scroll",e))};window.addEventListener("scroll",e)}if(this.options.animation&&this.options.animation.op.fireAt&&"inview"===this.options.animation.op.fireAt){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver(((e,s)=>{e.forEach((e=>{e.isIntersecting&&(this.res.animate(t.keyframesOpen,t.openOptions),s.disconnect())}))})).observe(this.res)}}};window.addEventListener("resize",i),i()}reactOnTransform=t=>{if(t.transform||t.op&&t.op.transform){let e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),this.setDefault=(t,e="0px")=>0===t.length?e+" ":t;const s=t=>{const e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;const s=e[1].split(",").map((t=>t.trim()));return 1===s.length?`rotate(${s[0]})`:2===s.length?`rotateX(${s[0]}) rotateY(${s[1]})`:3===s.length?`rotateX(${s[0]}) rotateY(${s[1]}) rotate(${s[2]})`:t},i=()=>{let i="",r="",a="",o="",n="",l="",h="",d="",p="";if(0===e.values.length)return;e.values.forEach((t=>{t.startsWith("tx:")&&(i=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?a=t.replace("tz:",""):t.startsWith("scale(")?o=t:t.startsWith("skew(")?n=t:t.startsWith("rotate(")?l=s(t):t.startsWith("perspective(")?h=t:t.startsWith("matrix(")?d=t:t.startsWith("opacity:")&&(p=t.replace("opacity:",""))})),i=this.setDefault(i),r=this.setDefault(r),a=this.setDefault(a);let c="";if("0px"!=r&&"0px"!=i&&"0px"!=a?c+=`translate3d(${i}, ${r}, ${a})`:"0px"==r&&"0px"==i||(c+=`translate(${i}, ${r})`),o&&(c+=` ${o}`),l&&(c+=` ${l}`),n&&(c+=` ${n}`),h&&(c+=` ${h}`),d&&(c+=` ${d}`),c){if(t.op.transform.duration){let e=t.op.transform.duration.replace(/^(\d+)(s)-/,((t,e,s)=>e/2+s+" ")),s=`transform ${e}, opacity ${e}`;this.res.style.transition=s}else this.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";this.res.style.transform=c,this.res.style.opacity=p}};e.on?this.res.addEventListener(e.on,(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()})):window.addEventListener("load",(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()}));const r=()=>{let t="";e.values.forEach((e=>{e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),this.res.style.opacity="1"})),t&&(this.res.style.transform=t.trim())};if(e.on)this.res.addEventListener("mouseout",(()=>{e.keep||r()}));else{let t=1e3*parseFloat(e.duration),s=e.closeAfter?e.closeAfter:0;setTimeout((()=>{e.keep||r()}),t/2+s)}}};maxWidth(t){return this.res.style.maxWidth=t,this}removeQuotesFromFirstWord(t){return t.replace(/"([^"]+)":/g,"$1:")}arrayMargin(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}navBarExpand(){return this.res.style.backgroundColor="green",this.res.animate([{transform:"scaleY(3.0)"}],{duration:2e3,iterations:1,fill:"both"}),this}scrollFade(t,e){return this.res.style.visibility="hidden",this.faden(t,e,"scroll"),this}expand(t){return!1===this.state.isExpanded?"click"===t.on?this.res.addEventListener("click",(()=>{this.innerExpand(t)})):this.innerExpand(t):this.innerExpandBack(t),this.state.isExpanded=!this.state.isExpanded,this}move(t){return"click"===t.on?this.res.addEventListener("click",(()=>{this.moveUpa(t)})):("up"===t.direction&&this.moveUpa(t),"down"===t.direction&&this.moveDowna(t),this.state.isMovedUp=!this.state.isMovedUp,"left"===t.direction&&this.moveLeft(t)),this}moveLeft(t){return this.res.animate([{transform:"translateX(0px)"},{transform:`translateX(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpa(t){return!1===this.state.isMovedUp?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveDowna(t){return!1===this.state.isMovedDown?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpaBack(t){return this.res.animate([{transform:"translateX(0px)"}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}innerExpandBack(t){this.res.animate([{width:this.prevWidth,height:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"})}innerExpand(t){return this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.res.animate([{width:this.prevWidth,height:this.prevHeight},{width:t.width??this.prevWidth,height:t.height??this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"}),this}fade(t){return this.res.style.visibility="hidden",this.faden(t.duration,t.from,"load"),t.finalOpacity&&(this.finalOpacity=t.finalOpacity),this}faden(t,e,s){return this.res.style.visibility="hidden",this.scrolled=!1,window.addEventListener(s,(()=>{this.res.style.visibility="visible";var i=window.innerHeight;(this.res.getBoundingClientRect().top-i<=0||"load"==s)&&0==this.scrolled&&("left"==e&&this.res.animate([{transform:"translateX(-30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"right"==e&&this.res.animate([{transform:"translateX(30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"top"==e&&this.res.animate([{transform:"translateY(-30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),"bottom"==e&&this.res.animate([{transform:"translateY(30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),this.res.animate([{opacity:"0.0"},{opacity:"1.0"}],{duration:t,iterations:1}),this.scrolled=!0)})),this}}var i=e.y;export{i as Animator};
|
|
1
|
+
/*! For license information please see animator.esm.js.LICENSE.txt */
|
|
2
|
+
var t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var s,n,i,a,o=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(s=i.call(r)).done)&&(o.push(s.value),o.length!==e);l=!0);}catch(t){c=!0,n=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw n}}return o}}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var s=0,n=function(){};return{s:n,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){l=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(l)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,s=Array(e);r<e;r++)s[r]=t[r];return s}function o(t,e){for(var r=0;r<e.length;r++){var s=e[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,l(s.key),s)}}function l(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}t.d(e,{y:()=>c});var c=function(){return t=function t(){var e,r,s,n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,s=function(t){if(t.transform||t.op&&t.op.transform){var e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),n.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var r=function(){var r="",s="",i="",a="",o="",l="",c="",u="",d="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(s=t.replace("ty:","")),t.startsWith("tz:")?i=t.replace("tz:",""):t.startsWith("scale(")?a=t:t.startsWith("skew(")?o=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var r=e[1].split(",").map((function(t){return t.trim()}));return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(d=t.replace("opacity:",""))})),r=n.setDefault(r),s=n.setDefault(s),i=n.setDefault(i);var h="";if("0px"!=s&&"0px"!=r&&"0px"!=i?h+="translate3d(".concat(r,", ").concat(s,", ").concat(i,")"):"0px"==s&&"0px"==r||(h+="translate(".concat(r,", ").concat(s,")")),a&&(h+=" ".concat(a)),l&&(h+=" ".concat(l)),o&&(h+=" ".concat(o)),c&&(h+=" ".concat(c)),u&&(h+=" ".concat(u)),h){if(t.op.transform.duration){var f=t.op.transform.duration.replace(/^(\d+)(s)-/,(function(t,e,r){return e/2+r+" "})),p="transform ".concat(f,", opacity ").concat(f);n.res.style.transition=p}else n.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";n.res.style.transform=h,n.res.style.opacity=d}}};e.on?n.res.addEventListener(e.on,(function(){e.delay?setTimeout((function(){r()}),e.delay):r()})):window.addEventListener("load",(function(){e.delay?setTimeout((function(){r()}),e.delay):r()}));var s=function(){var t="";e.values.forEach((function(e){e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),n.res.style.opacity="1"})),t&&(n.res.style.transform=t.trim())};if(e.on)n.res.addEventListener("mouseout",(function(){e.keep||s()}));else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||s()}),i/2+a)}}},(r=l(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[r]=s,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}},(e=[{key:"keySet",value:function(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}},{key:"onScroll",value:function(t){var e=this;"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform="scale(".concat(t.valMax,")")),window.addEventListener("scroll",(function(){var r=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=r:"scale"===t.value&&(e.res.style.transform="scale(".concat(r,")"))}))}},{key:"setAny",value:function(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}},{key:"setID",value:function(t){this.id=t}},{key:"setPrevText",value:function(t){this.prevText=t}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}},{key:"respad",value:function(t){var e=this,r=function(){e.pad(t[0].values);for(var r=0;r<t.length;r++){var s=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(s))).matches&&e.pad(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resmar",value:function(t){var e=this,r=function(){e.mar(t[0].values);for(var r=0;r<t.length;r++){var s=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(s))).matches&&e.mar(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resprop",value:function(t){var e=this;this.prevBackground=this.res.style.background,this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.prevBorder=this.res.style.border;var r=function(){e.res.style.background=e.prevBackground,e.res.style.width=e.prevWidth,e.res.style.height=e.prevHeight,e.res.style.border=e.prevBorder;for(var r=0;r<t.length;r++){var s=t[r].breakpoint;if(window.matchMedia("(max-width: ".concat(e.getPX(s))).matches){var n={};for(var i in t[r])"breakpoint"!==i&&(n[i]=t[r][i]);e.set(n)}}};window.addEventListener("resize",r),r()}},{key:"isNumber",value:function(t){return"number"==typeof t&&!isNaN(t)}},{key:"pad",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),s=0;s<r.length;s++)for(var n=r[s],i=t[e][n],a=0;a<n.length;a++)switch(n[a]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),s=0;s<r.length;s++)for(var n=r[s],i=t[e][n],a=0;a<n.length;a++){switch(n[a]){case"a":this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"auto"===n[a]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}return this}},{key:"smartRange",value:function(t,e,r){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var s=(t-e.min)/(e.max-e.min);e.min>e.max&&(s=(t-e.max)/(e.min-e.max));var n=(r.min-r.max)*s-r.min;if(n=Math.abs(n),r.min<r.max){var i=(r.max+Math.abs(r.min))*s;n=r.min+i}return n}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var a=document.createTextNode(this.text);this.res.appendChild(a),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(t){this.index=t}},{key:"borderObj",value:function(t){var e,r=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(r," ").concat(t.color),this.res.style.borderRadius=t.radius,this}},{key:"protoReact",value:function(t,e){var r=this;t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var i=function(){var i=window.innerWidth,a="";r.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var o,l=n(t);try{for(l.s();!(o=l.n()).done;){var c=o.value;r.counterIndex++;var u=s(c.range,2),d=u[0],h=u[1],f=parseInt(d),p=parseInt(h),y=!0;if(c.target){y=!1;for(var m=0;m<c.target.length;m++)c.target[m]===e&&(y=!0)}i>=f&&i<=p&&y&&("gradient"===c.log&&(a+="gradient"),"blast"===c.log&&(a+="blast"),"animation"===c.log&&(a+="animation"),"shadow"===c.log&&(a+="shadow"),"span"===c.log&&(a+="span"),"filter"===c.log&&(a+="filter"),"background"===c.log&&(a+="background"))}}catch(t){l.e(t)}finally{l.f()}r.res.style.margin="";var v,x=r.res.style.color;for(t.map((function(t){return t.log})).filter((function(t){return null!=t})).includes("gradient")&&(r.res.style.WebkitBackgroundClip="",r.res.style.background=""),r.res.style["-webkit-text-stroke"]="",r.res.style.filter="",r.res.style.textShadow="",r.res.style.border="";r.res.firstChild;)r.res.removeChild(r.res.firstChild);if(r.res.textContent=r.text,""===a&&(r.res.style["-webkit-text-fill-color"]="",r.res.style.color=x),"blast"===a){for(m=0;m<t.length;m++){var g=t[m].op.offsets;g&&void 0!==r.index&&(r.res.style.margin=g[Number(r.index)]+"px")}for(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke"]=r.globalBlast,m=0;m<t.length;m++){var b=t[m].op.offsets;b&&void 0!==r.index&&(r.res.style.margin=b[Number(r.index)]+"px")}}if("gradient"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text",r.res.style.border="1px solid orange"),"background"===a&&(r.res.style.background="orange"),"gradientblast"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text",r.res.style["-webkit-text-stroke"]=r.globalBlast),"gradientanimation"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text"),"gradientanimationshadow"===a&&(r.res.style["-webkit-text-fill-color"]="transparent",r.res.style.background=r.globalGradient,r.res.style["-webkit-background-clip"]="text",r.res.style.textShadow=r.globalShadow),"animationshadow"===a&&(r.res.style["-webkit-text-fill-color"]="",r.res.style.textShadow=r.globalShadow),"shadow"===a&&(r.res.style["-webkit-text-fill-color"]="",r.res.style.textShadow=r.globalShadow),"span"===a&&r.options.span)for(v=Array.isArray(r.options.span)?r.options.span.filter((function(t){return"span"===t.op.name}))[0]:r.options.span,r.res.textContent="",m=0;m<v.op.parts.length;m++){var k=v.op.parts[m].style,w=new Text(v.op.parts[m].text).setup({type:"span"}).set(k).render();r.res.appendChild(w)}if("filter"===a){var S=r.options.filtera.op.filter;r.res.style.filter=S,r.res.style.border="8px solid orange"}};window.addEventListener("resize",i),i()}},{key:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"betaReact",value:function(t,e){var r=this;this.ap=!1,this.cta=0,this.once=!1,t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var i=function(){var i=window.innerWidth,a="";r.resCopy=r.res,r.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var o,l=n(t);try{for(l.s();!(o=l.n()).done;){var c=o.value;r.counterIndex++;var u=s(c.range,2),d=u[0],h=u[1],f=parseInt(d),p=parseInt(h),y=!0;if(c.target){y=!1;for(var m=0;m<c.target.length;m++)c.target[m]===e&&(y=!0)}i>=f&&i<=p&&y&&("blast"===c.log&&(a+="blast"),"shadow"===c.log&&(a+="shadow"),"background"===c.log&&(a+="background"),"gradient"===c.log&&(a+="gradient"),"spana"===c.log&&(a+="spana"),"layout"===c.log&&(a+="layout"),"margin"===c.log&&(a+="margin"),c.op&&c.op.margin&&(r.useMargin=c.op.margin))}}catch(t){l.e(t)}finally{l.f()}if(r.res.style.background="",r.res.style.backgroundColor="",r.res.style.textShadow="",r.res.style.border="",r.res.style.margin="",r.res.style["-webkit-text-fill-color"]="",r.res.style["-webkit-text-stroke"]="",r.res.style["-webkit-text-stroke-width"]="","background"===a&&(r.res.style.backgroundColor="green"),"margin"===a)for(m=0;m<t.length;m++)if(t[m].op){var v=t[m].op.offsets;v&&void 0!==r.index&&(r.res.style.margin=v[Number(r.index)]+"px")}if("blastbackgroundmargin"===a){for(m=0;m<t.length;m++)if(t[m].op){var x=t[m].op.offsets;x&&void 0!==r.index&&(r.res.style.margin=x[Number(r.index)]+"px")}r.res.style.backgroundColor="green","FlexRowLayoutElement"===r.getType()?r.res.style.border="1px solid orange":(r.res.textContent=r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"}if("blastbackground"===a){for(m=0;m<t.length;m++)if(t[m].op){var g=t[m].op.offsets;g&&void 0!==r.index&&(r.res.style.margin=g[Number(r.index)]+"px")}r.res.style.backgroundColor="green",r.useMargin?r.res.style.margin="1rem":r.res.setAttribute("id","iofhwoiefhoih"),"FlexRowLayoutElement"===r.getType()?r.res.style.border="1px solid orange":(r.res.textContent=r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"}if("layout"===a&&(r.res.style.alignSelf="start",r.res.style.border="1px solid purple"),"blast"===a){for(m=0;m<t.length;m++)if(t[m].op){var b=t[m].op.offsets;b&&void 0!==r.index&&(r.res.style.margin=b[Number(r.index)]+"px")}"FlexRowLayoutElement"===r.getType()?r.res.style.border="1px solid orange":(r.res.textContent=r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-background-clip"]="text",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"}"blastgradientbackground"===a&&(r.res.style.border="1px solid yellow",r.res.style["-webkit-text-stroke-color"]="orange",r.res.style["-webkit-text-stroke-width"]="1px"),"gradient"===a&&(r.res.style.background="linear-gradient(to left, #3498db, #1abc9c)","FlexRowLayoutElement"===r.getType()||(r.res.children[0]&&r.res.removeChild(r.res.children[0]),r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-background-clip"]="text",r.res.textContent=r.text)),"shadow"===a&&("FlexRowLayoutElement"===r.getType()||(r.res.children[0]&&r.res.removeChild(r.res.children[0]),r.res.style["-webkit-text-fill-color"]="",r.res.style["-webkit-text-fill-color"]="",r.res.style.textShadow="#1abc9cff -6px 6px , #1abc9c40 -12px 12px",r.res.textContent=r.text))};window.addEventListener("resize",i),i()}},{key:"cssGen",value:function(t,e,r,s){return this.css=[""],[""]}},{key:"chainReact",value:function(t,e,r){var i=this;this.cssGen(t,e,this.class,void 0!==this.class),this.ap=!1,this.cta=0,this.once=!1;var a,o=n(t);try{for(o.s();!(a=o.n()).done;){var l=a.value;l.range||(l.range=["0px","999999px"])}}catch(t){o.e(t)}finally{o.f()}t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var c=function(){var a=window.visualViewport.width,o=[],l=[];i.resCopy=i.res,i.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var c,u=n(t);try{for(u.s();!(c=u.n()).done;){var d=c.value;i.counterIndex++;var h=s(d.range,2),f=h[0],p=h[1],y=parseInt(f),m=parseInt(p),v=!0;if(d.target){v=!1;for(var x=0;x<d.target.length;x++)d.target[x]===e&&(v=!0)}a>=y&&a<=m&&v&&(o.push(d.log),l.push(d),d.op&&d.op.margin&&(i.useMargin=d.op.margin))}}catch(t){u.e(t)}finally{u.f()}if(r&&!r.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",r&&!r.includes("border")&&(i.res.style.border=""),r&&!r.includes("margin")&&(i.res.style.margin=""),i.res.style["-webkit-text-fill-color"]="",i.res.style["-webkit-text-stroke-color"]="",i.res.style["-webkit-text-stroke-width"]="",i.res.style.filter="",(o.includes("gradient")||o.includes("shadow"))&&(i.res.style.position="relative",i.res.style.zIndex=-1),o.includes("blast")){var g,b=l.filter((function(t){return"blast"===t.log}))[0].op.color,k=null!==(g=l.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==g?g:"1px";"FlexRowLayoutElement"===i.getType()?i.res.style.border="".concat(k,"px solid orange"):(i.res.textContent=i.text,i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=b,i.res.style["-webkit-text-stroke-width"]="".concat(k))}if(o.includes("filter")){var w=l.filter((function(t){return"filter"===t.log}))[0].op.filter;i.res.style.filter=w}if(o.includes("background")&&(i.res.style.backgroundColor="green"),o.includes("gradient")&&(i.res.style["-webkit-text-fill-color"]="transparent",i.res.style.background=i.globalGradient,i.res.style["background-clip"]="text"),o.includes("shadow"))if("FlexRowLayoutElement"===i.getType());else{var S="",E=0;for(x=0;x<i.options.shadow.op.steps;x++)S+="drop-shadow(".concat(E+=3,"px ").concat(E,"px ").concat(E,"px gray) ");i.res.style.filter=S}if(o.includes("margin"))for(x=0;x<t.length;x++)if(t[x].op){var C=t[x].op.offsets;C&&void 0!==i.index&&(i.res.style.margin=C[Number(i.index)]+"px")}if(o.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var T=i.options.animation.op;i.res.animate(T.keyframesClose,{duration:0,fill:"forwards"}),i.res.animate(T.keyframesOpen,T.openOptions)}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var W=i.options.animation.op;i.res.animate(W.keyframesClose,{duration:0,fill:"forwards"});var L=function(){window.scrollY>parseFloat(W.fireAt)&&(i.res.animate(W.keyframesOpen,W.openOptions),window.removeEventListener("scroll",L))};window.addEventListener("scroll",L)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var I=i.options.animation.op;i.res.animate(I.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(i.res.animate(I.keyframesOpen,I.openOptions),e.disconnect())}))})).observe(i.res)}}};window.addEventListener("resize",c),c()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}},{key:"navBarExpand",value:function(){return this.res.style.backgroundColor="green",this.res.animate([{transform:"scaleY(3.0)"}],{duration:2e3,iterations:1,fill:"both"}),this}},{key:"scrollFade",value:function(t,e){return this.res.style.visibility="hidden",this.faden(t,e,"scroll"),this}},{key:"expand",value:function(t){var e=this;return!1===this.state.isExpanded?"click"===t.on?this.res.addEventListener("click",(function(){e.innerExpand(t)})):this.innerExpand(t):this.innerExpandBack(t),this.state.isExpanded=!this.state.isExpanded,this}},{key:"move",value:function(t){var e=this;return"click"===t.on?this.res.addEventListener("click",(function(){e.moveUpa(t)})):("up"===t.direction&&this.moveUpa(t),"down"===t.direction&&this.moveDowna(t),this.state.isMovedUp=!this.state.isMovedUp,"left"===t.direction&&this.moveLeft(t)),this}},{key:"moveLeft",value:function(t){return this.res.animate([{transform:"translateX(0px)"},{transform:"translateX(-".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"moveUpa",value:function(t){return!1===this.state.isMovedUp?this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(-".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"moveDowna",value:function(t){return!1===this.state.isMovedDown?this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:"translateY(-".concat(t.distance,")")}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"moveUpaBack",value:function(t){return this.res.animate([{transform:"translateX(0px)"}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}},{key:"innerExpandBack",value:function(t){this.res.animate([{width:this.prevWidth,height:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"})}},{key:"innerExpand",value:function(t){var e,r;return this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.res.animate([{width:this.prevWidth,height:this.prevHeight},{width:null!==(e=t.width)&&void 0!==e?e:this.prevWidth,height:null!==(r=t.height)&&void 0!==r?r:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"}),this}},{key:"fade",value:function(t){return this.res.style.visibility="hidden",this.faden(t.duration,t.from,"load"),t.finalOpacity&&(this.finalOpacity=t.finalOpacity),this}},{key:"faden",value:function(t,e,r){var s=this;return this.res.style.visibility="hidden",this.scrolled=!1,window.addEventListener(r,(function(){s.res.style.visibility="visible";var n=window.innerHeight;(s.res.getBoundingClientRect().top-n<=0||"load"==r)&&0==s.scrolled&&("left"==e&&s.res.animate([{transform:"translateX(-30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"right"==e&&s.res.animate([{transform:"translateX(30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"top"==e&&s.res.animate([{transform:"translateY(-30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),"bottom"==e&&s.res.animate([{transform:"translateY(30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),s.res.animate([{opacity:"0.0"},{opacity:"1.0"}],{duration:t,iterations:1}),s.scrolled=!0)})),this}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),u=e.y;export{u as Animator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see appleanim.cjs.js.LICENSE.txt */
|
|
2
|
+
(()=>{"use strict";var t={d:(e,i)=>{for(var a in i)t.o(i,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:i[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,r(a.key),a)}}function n(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var a=e.call(t,"string");if("object"!=i(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}t.r(e),t.d(e,{KeyframeAnim:()=>s});var s=function(){return t=function t(e){var i=this;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n(this,"scrollFunction",(function(){void 0===i.flagValue&&(i.flagValue=0);var t=(i.html.scrollTop-i.flagValue)/(i.html.scrollHeight-window.innerHeight)*16,e=Math.min(i.frameCount-1,Math.ceil(t*i.frameCount));isNaN(e)&&(e=1),e<0&&(e=0),i.data.limit?e<i.data.limit&&requestAnimationFrame((function(){return i.updateImage(e+1)})):requestAnimationFrame((function(){return i.updateImage(e+1)})),window.matchMedia("(max-device-width: 415px)")})),n(this,"currentFrame",(function(t){return"".concat(i.data.path).concat(t.toString().padStart(4,"0"),".").concat(i.data.extension)})),n(this,"preloadImages",(function(){for(var t=1;t<i.frameCount;t++)new Image,i.img.src=i.currentFrame(t)})),n(this,"updateImage",(function(t){i.img.src=i.currentFrame(t)})),this.fromFirstImageFlag=!1,this.flag=0,this.flagValue=e.flagValue,this.data=e,this.mask=e.mask,this.maskData=e.maskData,this.id=e.id,this.halfHeight=e.halfHeight,void 0===this.data.type?this.type="default":this.type=this.data.type,this.stickData=e.stickData,this.targetHeight=this.data.targetHeight,this.html=document.body,this.res=document.createElement("div"),this.res.setAttribute("id",this.data.id),this.res.style.border="1px solid green",this.res.style.width="100%",this.res.style.display="grid",this.res.style.position="sticky",this.res.style.top=0,this.res.style.alignSelf="flex-start",this.res.style.justifyContent="center",this.res.style.alignItems="center",this.data.added||(this.res.style.marginTop=this.data.noAddedDistance),this.frameCount=100,this.lastScrollTop=window.scrollY,this.setupTopElement(),this.scrollFunction(),window.addEventListener("scroll",(function(){i.scrollFunction()})),this.preloadImages(),this},e=[{key:"marginTop",value:function(t){return this.res.style.marginTop=t,this}},{key:"toCode",value:function(){return[""]}},{key:"drawImageProp",value:function(t,e,i,a,n,r,s,o){2===arguments.length&&(i=a=0,n=t.canvas.width,r=t.canvas.height),(s="number"==typeof s?s:.5)<0&&(s=0),(o="number"==typeof o?o:.5)<0&&(o=0),s>1&&(s=1),o>1&&(o=1);var l,c,d,h,u=e.width,m=e.height,y=Math.min(n/u,r/m),p=u*y,g=m*y,f=1;p<n&&(f=n/p),Math.abs(f-1)<1e-14&&g<r&&(f=r/g),(l=(u-(d=u/((p*=f)/n)))*s)<0&&(l=0),(c=(m-(h=m/((g*=f)/r)))*o)<0&&(c=0),d>u&&(d=u),h>m&&(h=m),console.log("WEIRD"),console.log(e),console.log(c),console.log(d),t.drawImage(e,l,c,d,h,i,a,n,r)}},{key:"maska",value:function(t){var e=this;return window.addEventListener("scroll",(function(){e.innerMask(t)})),this}},{key:"innerMask",value:function(t){if(t){var e=smartRange(window.scrollY,{min:t.start,max:t.end},{min:0,max:7}),i=smartRange(window.scrollY,{min:t.start,max:t.end},{min:37,max:37});this.res.style.clipPath="inset(".concat(e,"% ").concat(e,"% round 0 0 ").concat(i,"px ").concat(i,"px)")}}},{key:"setupTopElement",value:function(){var t=this;console.warn("TOP INIT");var e=document.createElement("canvas");if(e.style.gridArea="1/1",e.zIndex=1,e.style.display="grid",e.style.gridTemplate="1fr/1fr",e.style.justifyContent="center",e.style.alignItems="center",e.style.marginLeft="auto",e.style.marginRight="auto",this.context=e.getContext("2d"),this.context.canvas.width=window.innerWidth,this.context.canvas.height=1.2*window.innerHeight,this.img=new Image,this.img.onload=function(){t.data.halfHeight?t.drawImageProp(t.context,t.img,0,0,window.innerWidth,window.innerHeight/2):t.drawImageProp(t.context,t.img,0,0,window.innerWidth,1.2*window.innerHeight)},window.addEventListener("resize",(function(){t.context.canvas.width=window.innerWidth,t.context.canvas.height=1.2*window.innerHeight,t.drawImageProp(t.context,t.img,0,0,window.innerWidth,1.2*window.innerHeight)})),this.res.appendChild(e),this.data.text){var i=document.createElement("div");i.style.gridArea="1/1";var a=this.data.text.render();if(this.h2a=a,i.appendChild(a),i.setAttribute("id","rem"),this.data.hasRect){var n=document.createElement("div");n.style.width="30px",n.style.height="30px",n.style.backgroundColor="orange"}else for(var r=0;r<this.res.children.length;r++)"rem"===this.res.children[r].id&&this.res.removeChild(this.res.children[r]);this.res.appendChild(i)}this.lastScrollTop=0,this.count=1,this.isUp=!1,this.done=!1,this.fireOnce=!0,this.dec=1,this.tdec=1,this.atdec=0,this.textOpacity=1,this.res.children[this.res.children.length-1].children[0].style.opacity=0,this.data.text&&window.addEventListener("scroll",(function(){t.h2a.style.backgroundColor="rgba(0, 0, 0, 0.8)",t.h2a.style.opacity=1})),window.addEventListener("scroll",(function(e){if(t.data.stickyData&&t.data.stickyData.top){var i=t.data.stickyData.top;t.data.uncomment&&(window.scrollY>i?(wrapDiv.style.background="pink",wrapDiv.style.position="relative",wrapDiv.style.top=i):(wrapDiv.style.background="orange",wrapDiv.style.top=0,wrapDiv.style.position="fixed"))}var a=window.scrollY||document.documentElement.scrollTop;if(a>t.lastScrollTop?t.isUp=!1:t.isUp=!0,t.lastScrollTop=a<=0?0:a,t.isUp&&t.textOpacity<.98&&(t.textOpacity+=.01),!1===t.isUp&&t.textOpacity>.02&&(t.textOpacity-=.01),t.data.mask){var n=t.res,r=smartRange(window.scrollY,{min:t.data.maskData.start,max:t.data.maskData.end},{min:0,max:7});if(n.style.clipPath="inset(".concat(r,"% ").concat(r,"% round 20px)"),!t.hasH2){var s=document.createElement("div");s.style.background="#ecf0f1",s.style.width="86%",s.style.marginLeft="7%",s.style.borderRadius="1rem",t.hasH2=!0,s.appendChild(t.data.newSection.render()),n.parentElement.appendChild(s)}}t.data.targetHeight}))}},{key:"setLazyText",value:function(t){var e=this;return this.lazyText=t,window.addEventListener("scroll",(function(){for(var t=smartRange(window.scrollY,{min:e.lazyText.start,max:e.lazyText.end},{min:0,max:200}),i=smartRange(window.scrollY,{min:e.lazyText.start,max:e.lazyText.end},{min:0,max:1}),a=0;a<e.h2a.children[0].children.length;a++)console.log("P"),e.h2a.children[0].children[a].style.transform="matrix(1, 0, 0, 1, 0, -".concat(t,")"),e.h2a.children[0].children[a].style.opacity="".concat(i-.2*a)})),this}},{key:"setProps",value:function(t){return t.targetHeight&&(this.data.targetHeight=t.targetHeight),t.flagValue&&(this.flagValue=t.flagValue),this}},{key:"fixedToRelative",value:function(t){this.data.uncomment=t}},{key:"toSticky",value:function(){return this.res.style.position="sticky",this.res.style.top="0",this}},{key:"setOpacityRange",value:function(t){var e=this;return this.data.opacityRange=t.opacityRange,this.data.scaleRange=t.scaleRange,window.addEventListener("scroll",(function(){var t=smartRange(window.scrollY,{min:e.data.opacityRange.start,max:e.data.opacityRange.end},{min:0,max:1});e.h2a.style.opacity=t;var i=smartRange(window.scrollY,{min:e.data.scaleRange.start,max:e.data.scaleRange.end},{min:3,max:1});window.matchMedia("(max-device-width: 415px)").matches||(e.h2a.children[0].style.transform="scale(".concat(i,")"))})),this}},{key:"stick",value:function(t){return t?(t.offset&&(null!=this.data.stickyData?this.data.stickyData.top=t.offset:this.data.stickyData={top:t.offset}),t.value?this.makeSticky():this.noSticky(),this):(this.makeSticky(),this)}},{key:"to100vh",value:function(){this.res.style.height="100vh"}},{key:"makeSticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"noSticky",value:function(){return this.res.style.position="",this}},{key:"toOpacity",value:function(t){this.res.style.opacity="".concat(t)}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],e&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();module.exports=e})();
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see appleanim.esm.js.LICENSE.txt */
|
|
2
|
+
var t={d:(e,i)=>{for(var a in i)t.o(i,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:i[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,r(a.key),a)}}function n(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){var e=function(t){if("object"!=i(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var a=e.call(t,"string");if("object"!=i(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==i(e)?e:e+""}t.d(e,{_:()=>s});var s=function(){return t=function t(e){var i=this;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n(this,"scrollFunction",(function(){void 0===i.flagValue&&(i.flagValue=0);var t=(i.html.scrollTop-i.flagValue)/(i.html.scrollHeight-window.innerHeight)*16,e=Math.min(i.frameCount-1,Math.ceil(t*i.frameCount));isNaN(e)&&(e=1),e<0&&(e=0),i.data.limit?e<i.data.limit&&requestAnimationFrame((function(){return i.updateImage(e+1)})):requestAnimationFrame((function(){return i.updateImage(e+1)})),window.matchMedia("(max-device-width: 415px)")})),n(this,"currentFrame",(function(t){return"".concat(i.data.path).concat(t.toString().padStart(4,"0"),".").concat(i.data.extension)})),n(this,"preloadImages",(function(){for(var t=1;t<i.frameCount;t++)new Image,i.img.src=i.currentFrame(t)})),n(this,"updateImage",(function(t){i.img.src=i.currentFrame(t)})),this.fromFirstImageFlag=!1,this.flag=0,this.flagValue=e.flagValue,this.data=e,this.mask=e.mask,this.maskData=e.maskData,this.id=e.id,this.halfHeight=e.halfHeight,void 0===this.data.type?this.type="default":this.type=this.data.type,this.stickData=e.stickData,this.targetHeight=this.data.targetHeight,this.html=document.body,this.res=document.createElement("div"),this.res.setAttribute("id",this.data.id),this.res.style.border="1px solid green",this.res.style.width="100%",this.res.style.display="grid",this.res.style.position="sticky",this.res.style.top=0,this.res.style.alignSelf="flex-start",this.res.style.justifyContent="center",this.res.style.alignItems="center",this.data.added||(this.res.style.marginTop=this.data.noAddedDistance),this.frameCount=100,this.lastScrollTop=window.scrollY,this.setupTopElement(),this.scrollFunction(),window.addEventListener("scroll",(function(){i.scrollFunction()})),this.preloadImages(),this},e=[{key:"marginTop",value:function(t){return this.res.style.marginTop=t,this}},{key:"toCode",value:function(){return[""]}},{key:"drawImageProp",value:function(t,e,i,a,n,r,s,o){2===arguments.length&&(i=a=0,n=t.canvas.width,r=t.canvas.height),(s="number"==typeof s?s:.5)<0&&(s=0),(o="number"==typeof o?o:.5)<0&&(o=0),s>1&&(s=1),o>1&&(o=1);var l,c,d,h,u=e.width,m=e.height,y=Math.min(n/u,r/m),p=u*y,g=m*y,f=1;p<n&&(f=n/p),Math.abs(f-1)<1e-14&&g<r&&(f=r/g),(l=(u-(d=u/((p*=f)/n)))*s)<0&&(l=0),(c=(m-(h=m/((g*=f)/r)))*o)<0&&(c=0),d>u&&(d=u),h>m&&(h=m),console.log("WEIRD"),console.log(e),console.log(c),console.log(d),t.drawImage(e,l,c,d,h,i,a,n,r)}},{key:"maska",value:function(t){var e=this;return window.addEventListener("scroll",(function(){e.innerMask(t)})),this}},{key:"innerMask",value:function(t){if(t){var e=smartRange(window.scrollY,{min:t.start,max:t.end},{min:0,max:7}),i=smartRange(window.scrollY,{min:t.start,max:t.end},{min:37,max:37});this.res.style.clipPath="inset(".concat(e,"% ").concat(e,"% round 0 0 ").concat(i,"px ").concat(i,"px)")}}},{key:"setupTopElement",value:function(){var t=this;console.warn("TOP INIT");var e=document.createElement("canvas");if(e.style.gridArea="1/1",e.zIndex=1,e.style.display="grid",e.style.gridTemplate="1fr/1fr",e.style.justifyContent="center",e.style.alignItems="center",e.style.marginLeft="auto",e.style.marginRight="auto",this.context=e.getContext("2d"),this.context.canvas.width=window.innerWidth,this.context.canvas.height=1.2*window.innerHeight,this.img=new Image,this.img.onload=function(){t.data.halfHeight?t.drawImageProp(t.context,t.img,0,0,window.innerWidth,window.innerHeight/2):t.drawImageProp(t.context,t.img,0,0,window.innerWidth,1.2*window.innerHeight)},window.addEventListener("resize",(function(){t.context.canvas.width=window.innerWidth,t.context.canvas.height=1.2*window.innerHeight,t.drawImageProp(t.context,t.img,0,0,window.innerWidth,1.2*window.innerHeight)})),this.res.appendChild(e),this.data.text){var i=document.createElement("div");i.style.gridArea="1/1";var a=this.data.text.render();if(this.h2a=a,i.appendChild(a),i.setAttribute("id","rem"),this.data.hasRect){var n=document.createElement("div");n.style.width="30px",n.style.height="30px",n.style.backgroundColor="orange"}else for(var r=0;r<this.res.children.length;r++)"rem"===this.res.children[r].id&&this.res.removeChild(this.res.children[r]);this.res.appendChild(i)}this.lastScrollTop=0,this.count=1,this.isUp=!1,this.done=!1,this.fireOnce=!0,this.dec=1,this.tdec=1,this.atdec=0,this.textOpacity=1,this.res.children[this.res.children.length-1].children[0].style.opacity=0,this.data.text&&window.addEventListener("scroll",(function(){t.h2a.style.backgroundColor="rgba(0, 0, 0, 0.8)",t.h2a.style.opacity=1})),window.addEventListener("scroll",(function(e){if(t.data.stickyData&&t.data.stickyData.top){var i=t.data.stickyData.top;t.data.uncomment&&(window.scrollY>i?(wrapDiv.style.background="pink",wrapDiv.style.position="relative",wrapDiv.style.top=i):(wrapDiv.style.background="orange",wrapDiv.style.top=0,wrapDiv.style.position="fixed"))}var a=window.scrollY||document.documentElement.scrollTop;if(a>t.lastScrollTop?t.isUp=!1:t.isUp=!0,t.lastScrollTop=a<=0?0:a,t.isUp&&t.textOpacity<.98&&(t.textOpacity+=.01),!1===t.isUp&&t.textOpacity>.02&&(t.textOpacity-=.01),t.data.mask){var n=t.res,r=smartRange(window.scrollY,{min:t.data.maskData.start,max:t.data.maskData.end},{min:0,max:7});if(n.style.clipPath="inset(".concat(r,"% ").concat(r,"% round 20px)"),!t.hasH2){var s=document.createElement("div");s.style.background="#ecf0f1",s.style.width="86%",s.style.marginLeft="7%",s.style.borderRadius="1rem",t.hasH2=!0,s.appendChild(t.data.newSection.render()),n.parentElement.appendChild(s)}}t.data.targetHeight}))}},{key:"setLazyText",value:function(t){var e=this;return this.lazyText=t,window.addEventListener("scroll",(function(){for(var t=smartRange(window.scrollY,{min:e.lazyText.start,max:e.lazyText.end},{min:0,max:200}),i=smartRange(window.scrollY,{min:e.lazyText.start,max:e.lazyText.end},{min:0,max:1}),a=0;a<e.h2a.children[0].children.length;a++)console.log("P"),e.h2a.children[0].children[a].style.transform="matrix(1, 0, 0, 1, 0, -".concat(t,")"),e.h2a.children[0].children[a].style.opacity="".concat(i-.2*a)})),this}},{key:"setProps",value:function(t){return t.targetHeight&&(this.data.targetHeight=t.targetHeight),t.flagValue&&(this.flagValue=t.flagValue),this}},{key:"fixedToRelative",value:function(t){this.data.uncomment=t}},{key:"toSticky",value:function(){return this.res.style.position="sticky",this.res.style.top="0",this}},{key:"setOpacityRange",value:function(t){var e=this;return this.data.opacityRange=t.opacityRange,this.data.scaleRange=t.scaleRange,window.addEventListener("scroll",(function(){var t=smartRange(window.scrollY,{min:e.data.opacityRange.start,max:e.data.opacityRange.end},{min:0,max:1});e.h2a.style.opacity=t;var i=smartRange(window.scrollY,{min:e.data.scaleRange.start,max:e.data.scaleRange.end},{min:3,max:1});window.matchMedia("(max-device-width: 415px)").matches||(e.h2a.children[0].style.transform="scale(".concat(i,")"))})),this}},{key:"stick",value:function(t){return t?(t.offset&&(null!=this.data.stickyData?this.data.stickyData.top=t.offset:this.data.stickyData={top:t.offset}),t.value?this.makeSticky():this.noSticky(),this):(this.makeSticky(),this)}},{key:"to100vh",value:function(){this.res.style.height="100vh"}},{key:"makeSticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"noSticky",value:function(){return this.res.style.position="",this}},{key:"toOpacity",value:function(t){this.res.style.opacity="".concat(t)}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],e&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),o=e._;export{o as KeyframeAnim};
|