nodality 1.0.0-beta.9 → 1.0.0-beta.91
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 -1
- package/dist/appleanim.cjs.js.LICENSE.txt +5 -0
- package/dist/appleanim.esm.js +2 -1
- 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/circle.cjs.js +2 -0
- package/dist/circle.cjs.js.LICENSE.txt +5 -0
- package/dist/circle.esm.js +2 -0
- package/dist/circle.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/polygon.cjs.js +2 -0
- package/dist/polygon.cjs.js.LICENSE.txt +5 -0
- package/dist/polygon.esm.js +2 -0
- package/dist/polygon.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 -1
- package/dist/stacker.cjs.js.LICENSE.txt +5 -0
- package/dist/stacker.esm.js +2 -1
- 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 -1
- package/dist/transformanim.cjs.js.LICENSE.txt +5 -0
- package/dist/transformanim.esm.js +2 -1
- 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 +145 -84
- 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 +15 -5
- package/layout/cards.js +9 -2
- package/layout/center.js +6 -0
- package/layout/checkbox.js +6 -0
- package/layout/circle.js +175 -0
- package/layout/cleanRow.js +6 -0
- package/layout/code.js +6 -0
- package/layout/container.js +175 -194
- package/layout/custom.js +6 -0
- package/layout/divImage.js +6 -0
- package/layout/dropdown.js +6 -0
- package/layout/dropdown2025.js +45 -1
- package/layout/emptyElement.js +6 -0
- package/layout/externalStylesheet.js +6 -0
- package/layout/flexCard.js +7 -1
- package/layout/flexGrid.js +9 -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 +6 -0
- package/layout/formComponents/form-all.js +6 -0
- package/layout/formComponents/form.js +6 -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 +10 -4
- 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 +8 -1
- package/layout/image-old.js +6 -0
- package/layout/image.js +7 -1
- package/layout/index.js +14 -7
- package/layout/label.js +6 -0
- package/layout/link.js +42 -3
- 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 +6 -0
- 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/polygon.js +179 -0
- package/layout/progress.js +6 -0
- package/layout/row.js +6 -0
- package/layout/savedNewNavBar.js +6 -0
- package/layout/scrollvideo.js +130 -0
- package/layout/sideBar.js +6 -0
- package/layout/sideNavBar.js +6 -0
- package/layout/simpleBar.js +6 -0
- package/layout/slider2025.js +16 -4
- 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 +37 -4
- 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 +6 -0
- package/lib/Stacker.js +6 -0
- package/lib/TransformAnim.js +7 -1
- package/lib/cardGetter.js +6 -0
- package/lib/designer.js +365 -21
- package/lib/elementMapper.js +349 -93
- package/lib/linkGetter.js +9 -0
- package/lib/scrollvideo.js +14 -3
- 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 n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 n(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 n,s,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=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw s}}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 s(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 n=0,s=function(){};return{s,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:s}}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,n=Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;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,n,s=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=function(t){if(console.log("LOBJO IS"),console.log(t),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"),s.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="",n="",i="",a="",o="",l="",c="",u="",p="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(n=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:")&&(p=t.replace("opacity:",""))})),r=s.setDefault(r),n=s.setDefault(n),i=s.setDefault(i);var f="";if("0px"!=n&&"0px"!=r&&"0px"!=i?f+="translate3d(".concat(r,", ").concat(n,", ").concat(i,")"):"0px"==n&&"0px"==r||(f+="translate(".concat(r,", ").concat(n,")")),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+" "})),d="transform ".concat(h,", opacity ").concat(h);s.res.style.transition=d}else s.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.transform.static&&(s.res.style.transition=""),(s.blastTarget||s.res).style.transform=f,s.res.style.opacity=p}else alert("OPE")}};e.on?s.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 n=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) "),s.res.style.opacity="1"})),t&&(s.res.style.transform=t.trim())};if(e.on)s.res.addEventListener("mouseout",(function(){e.keep||n()}));else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||n()}),i/2+a)}e.hardCSS&&(s.res.style.transform=e.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(t)},(r=l(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,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 n=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(n))).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 n=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(n))).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 n=t[r].breakpoint;if(window.matchMedia("(max-width: ".concat(e.getPX(n))).matches){var s={};for(var i in t[r])"breakpoint"!==i&&(s[i]=t[r][i]);e.set(s)}}};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]),n=0;n<r.length;n++)for(var s=r[n],i=t[e][s],a=0;a<s.length;a++)switch(s[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]),n=0;n<r.length;n++)for(var s=r[n],i=t[e][s],a=0;a<s.length;a++){switch(s[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"===s[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 n=(t-e.min)/(e.max-e.min);e.min>e.max&&(n=(t-e.max)/(e.min-e.max));var s=(r.min-r.max)*n-r.min;if(s=Math.abs(s),r.min<r.max){var i=(r.max+Math.abs(r.min))*n;s=r.min+i}return s}},{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 n=document.createTextNode(this.text);this.res.appendChild(n),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 s=document.createTextNode(this.text);this.res.appendChild(s),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:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"chainReact",value:function(t,e,r){var i=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var a,o=s(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(a){var o=window.visualViewport.width,l=[],c=[];i.resCopy=i.res,i.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var u,p=s(t);try{for(p.s();!(u=p.n()).done;){var f=u.value;i.counterIndex++;var h=n(f.range,2),d=h[0],y=h[1],m=parseInt(d),v=parseInt(y),g=!0;if(f.target){g=!1;for(var x=0;x<f.target.length;x++)f.target[x]===e&&(g=!0)}o>=m&&o<=v&&g&&(l.push(f.log),c.push(f),f.op&&f.op.margin&&(i.useMargin=f.op.margin))}}catch(t){p.e(t)}finally{p.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="",i.options.background&&(console.log(i.options.background),i.res.style.background=i.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(i.res.style.position="relative",i.res.style.zIndex=-1),l.includes("blast")){var b,w=c.filter((function(t){return"blast"===t.log}))[0].op.color,k=null!==(b=c.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==b?b:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof k?k+"px":k," solid orange"),i.res.style.display="inline-block",i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text&&(i.res.textContent=i.text),i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(k))}if(l.includes("filter")){var S=c.filter((function(t){return"filter"===t.log}))[0].op.filter;i.res.style.filter=S}if(l.includes("background")&&(i.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&(i.res.style["background-clip"]="text")),l.includes("shadow")){var T="",E=0;for(x=0;x<i.options.shadow.op.steps;x++)T+="drop-shadow(".concat(E+=3,"px ").concat(E,"px ").concat(E,"px gray) ");i.res.style.filter=T}if(l.includes("margin"))for(x=0;x<t.length;x++)if(t[x].op){var O=t[x].op.offsets;O&&void 0!==i.index&&(i.res.style.margin=O[Number(i.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(i.res=i.resCopy,i.options.span){var W;for(W=Array.isArray(i.options.span)?i.options.span.filter((function(t){return"span"===t.op.name}))[0]:i.options.span,i.res.textContent="",x=0;x<W.op.parts.length;x++){var C=W.op.parts[x].style,A=new i.constructor(W.op.parts[x].text).setup({type:"span"}).set(C).render();i.res.appendChild(A)}}}else{var I=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&a&&i.res.appendChild(I)}if(l.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var N=i.options.animation.op;i.res.animate(N.keyframesClose,{duration:0,fill:"forwards"}),i.res.animate(N.keyframesOpen,N.openOptions)}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var L=i.options.animation.op;i.res.animate(L.keyframesClose,{duration:0,fill:"forwards"});var j=function(){window.scrollY>parseFloat(L.fireAt)&&(i.res.animate(L.keyframesOpen,L.openOptions),window.removeEventListener("scroll",j))};window.addEventListener("scroll",j)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var P=i.options.animation.op;i.res.animate(P.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(i.res.animate(P.keyframesOpen,P.openOptions),e.disconnect())}))})).observe(i.res)}}};this.options.animation||window.addEventListener("resize",(function(){return 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}}],e&&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 n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 n(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 n,s,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=(n=i.call(r)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw s}}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 s(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 n=0,s=function(){};return{s,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:s}}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,n=Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;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,n,s=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=function(t){if(console.log("LOBJO IS"),console.log(t),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"),s.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="",n="",i="",a="",o="",l="",c="",u="",p="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(n=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:")&&(p=t.replace("opacity:",""))})),r=s.setDefault(r),n=s.setDefault(n),i=s.setDefault(i);var f="";if("0px"!=n&&"0px"!=r&&"0px"!=i?f+="translate3d(".concat(r,", ").concat(n,", ").concat(i,")"):"0px"==n&&"0px"==r||(f+="translate(".concat(r,", ").concat(n,")")),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+" "})),y="transform ".concat(h,", opacity ").concat(h);s.res.style.transition=y}else s.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.transform.static&&(s.res.style.transition=""),(s.blastTarget||s.res).style.transform=f,s.res.style.opacity=p}else alert("OPE")}};e.on?s.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 n=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) "),s.res.style.opacity="1"})),t&&(s.res.style.transform=t.trim())};if(e.on)s.res.addEventListener("mouseout",(function(){e.keep||n()}));else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||n()}),i/2+a)}e.hardCSS&&(s.res.style.transform=e.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(t)},(r=l(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,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 n=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(n))).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 n=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(n))).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 n=t[r].breakpoint;if(window.matchMedia("(max-width: ".concat(e.getPX(n))).matches){var s={};for(var i in t[r])"breakpoint"!==i&&(s[i]=t[r][i]);e.set(s)}}};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]),n=0;n<r.length;n++)for(var s=r[n],i=t[e][s],a=0;a<s.length;a++)switch(s[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]),n=0;n<r.length;n++)for(var s=r[n],i=t[e][s],a=0;a<s.length;a++){switch(s[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"===s[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 n=(t-e.min)/(e.max-e.min);e.min>e.max&&(n=(t-e.max)/(e.min-e.max));var s=(r.min-r.max)*n-r.min;if(s=Math.abs(s),r.min<r.max){var i=(r.max+Math.abs(r.min))*n;s=r.min+i}return s}},{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 n=document.createTextNode(this.text);this.res.appendChild(n),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 s=document.createTextNode(this.text);this.res.appendChild(s),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:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"chainReact",value:function(t,e,r){var i=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var a,o=s(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(a){var o=window.visualViewport.width,l=[],c=[];i.resCopy=i.res,i.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var u,p=s(t);try{for(p.s();!(u=p.n()).done;){var f=u.value;i.counterIndex++;var h=n(f.range,2),y=h[0],d=h[1],m=parseInt(y),v=parseInt(d),g=!0;if(f.target){g=!1;for(var x=0;x<f.target.length;x++)f.target[x]===e&&(g=!0)}o>=m&&o<=v&&g&&(l.push(f.log),c.push(f),f.op&&f.op.margin&&(i.useMargin=f.op.margin))}}catch(t){p.e(t)}finally{p.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="",i.options.background&&(console.log(i.options.background),i.res.style.background=i.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(i.res.style.position="relative",i.res.style.zIndex=-1),l.includes("blast")){var b,w=c.filter((function(t){return"blast"===t.log}))[0].op.color,k=null!==(b=c.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==b?b:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof k?k+"px":k," solid orange"),i.res.style.display="inline-block",i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text&&(i.res.textContent=i.text),i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(k))}if(l.includes("filter")){var S=c.filter((function(t){return"filter"===t.log}))[0].op.filter;i.res.style.filter=S}if(l.includes("background")&&(i.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&(i.res.style["background-clip"]="text")),l.includes("shadow")){var T="",E=0;for(x=0;x<i.options.shadow.op.steps;x++)T+="drop-shadow(".concat(E+=3,"px ").concat(E,"px ").concat(E,"px gray) ");i.res.style.filter=T}if(l.includes("margin"))for(x=0;x<t.length;x++)if(t[x].op){var O=t[x].op.offsets;O&&void 0!==i.index&&(i.res.style.margin=O[Number(i.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(i.res=i.resCopy,i.options.span){var W;for(W=Array.isArray(i.options.span)?i.options.span.filter((function(t){return"span"===t.op.name}))[0]:i.options.span,i.res.textContent="",x=0;x<W.op.parts.length;x++){var C=W.op.parts[x].style,A=new i.constructor(W.op.parts[x].text).setup({type:"span"}).set(C).render();i.res.appendChild(A)}}}else{var I=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&a&&i.res.appendChild(I)}if(l.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var N=i.options.animation.op;i.res.animate(N.keyframesClose,{duration:0,fill:"forwards"}),i.res.animate(N.keyframesOpen,N.openOptions)}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var L=i.options.animation.op;i.res.animate(L.keyframesClose,{duration:0,fill:"forwards"});var j=function(){window.scrollY>parseFloat(L.fireAt)&&(i.res.animate(L.keyframesOpen,L.openOptions),window.removeEventListener("scroll",j))};window.addEventListener("scroll",j)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var z=i.options.animation.op;i.res.animate(z.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(i.res.animate(z.keyframesOpen,z.openOptions),e.disconnect())}))})).observe(i.res)}}};this.options.animation||window.addEventListener("resize",(function(){return 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}}],e&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),u=e.y;export{u as Animator};
|
package/dist/appleanim.cjs.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
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})();
|
package/dist/appleanim.esm.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
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};
|
package/dist/audionew.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,{Audio:()=>i});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}}class i extends s{constructor(t){super(),this.url=t,this.res=null,this.setup()}setup(){this.res=document.createElement("audio"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}set(t){return this.options=t,t.background&&this.background(t.background),this}background(t){const e=document.createElement("style");return e.type="text/css",e.textContent=`\n\taudio::-webkit-media-controls-panel {\n\t\tbackground-color: ${t};\n\t}\n`,document.head.appendChild(e),this}toCode(){return JSON.stringify(this.options,null,4),[`new Audio("${this.url}")`]}size(t){return this.res.style.width=t,this}render(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}module.exports=e})();
|
|
1
|
+
/*! For license information please see audionew.cjs.js.LICENSE.txt */
|
|
2
|
+
(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 n(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 n,s,i,o,a=[],l=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}(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 s(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 n=0,s=function(){};return{s,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:s}}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 o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}function i(t,e){if(t){if("string"==typeof t)return o(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)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}function c(t){return c="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},c(t)}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}t.r(e),t.d(e,{Audio:()=>d});var d=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,r){return e=y(e),function(t,e){if(e&&("object"==c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,p()?Reflect.construct(e,r||[],y(t).constructor):e.apply(t,r))}(this,e)).url=t,r.res=null,r.setup(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),r=e,(n=[{key:"setup",value:function(){this.res=document.createElement("audio"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"set",value:function(t){return this.options=t,t.background&&this.background(t.background),this}},{key:"background",value:function(t){var e=document.createElement("style");return e.type="text/css",e.textContent="\n\taudio::-webkit-media-controls-panel {\n\t\tbackground-color: ".concat(t,";\n\t}\n"),document.head.appendChild(e),this}},{key:"toCode",value:function(){return JSON.stringify(this.options,null,4),['new Audio("'.concat(this.url,'")')]}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&u(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(function(){return t=function t(){var e,r,n,s=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=function(t){if(console.log("LOBJO IS"),console.log(t),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"),s.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="",n="",i="",o="",a="",l="",c="",u="",f="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(n=t.replace("ty:","")),t.startsWith("tz:")?i=t.replace("tz:",""):t.startsWith("scale(")?o=t:t.startsWith("skew(")?a=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:")&&(f=t.replace("opacity:",""))})),r=s.setDefault(r),n=s.setDefault(n),i=s.setDefault(i);var p="";if("0px"!=n&&"0px"!=r&&"0px"!=i?p+="translate3d(".concat(r,", ").concat(n,", ").concat(i,")"):"0px"==n&&"0px"==r||(p+="translate(".concat(r,", ").concat(n,")")),o&&(p+=" ".concat(o)),l&&(p+=" ".concat(l)),a&&(p+=" ".concat(a)),c&&(p+=" ".concat(c)),u&&(p+=" ".concat(u)),p){if(t.op.transform.duration){var y=t.op.transform.duration.replace(/^(\d+)(s)-/,(function(t,e,r){return e/2+r+" "})),h="transform ".concat(y,", opacity ").concat(y);s.res.style.transition=h}else s.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.transform.static&&(s.res.style.transition=""),(s.blastTarget||s.res).style.transform=p,s.res.style.opacity=f}else alert("OPE")}};e.on?s.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 n=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) "),s.res.style.opacity="1"})),t&&(s.res.style.transform=t.trim())};if(e.on)s.res.addEventListener("mouseout",(function(){e.keep||n()}));else{var i=1e3*parseFloat(e.duration),o=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||n()}),i/2+o)}e.hardCSS&&(s.res.style.transform=e.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(t)},(r=l(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,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 n=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(n))).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 n=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(n))).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 n=t[r].breakpoint;if(window.matchMedia("(max-width: ".concat(e.getPX(n))).matches){var s={};for(var i in t[r])"breakpoint"!==i&&(s[i]=t[r][i]);e.set(s)}}};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]),n=0;n<r.length;n++)for(var s=r[n],i=t[e][s],o=0;o<s.length;o++)switch(s[o]){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]),n=0;n<r.length;n++)for(var s=r[n],i=t[e][s],o=0;o<s.length;o++){switch(s[o]){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"===s[o]&&(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 n=(t-e.min)/(e.max-e.min);e.min>e.max&&(n=(t-e.max)/(e.min-e.max));var s=(r.min-r.max)*n-r.min;if(s=Math.abs(s),r.min<r.max){var i=(r.max+Math.abs(r.min))*n;s=r.min+i}return s}},{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 n=document.createTextNode(this.text);this.res.appendChild(n),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 s=document.createTextNode(this.text);this.res.appendChild(s),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 o=document.createTextNode(this.text);this.res.appendChild(o),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:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"chainReact",value:function(t,e,r){var i=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var o,a=s(t);try{for(a.s();!(o=a.n()).done;){var l=o.value;l.range||(l.range=["0px","999999px"])}}catch(t){a.e(t)}finally{a.f()}t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var c=function(o){var a=window.visualViewport.width,l=[],c=[];i.resCopy=i.res,i.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var u,f=s(t);try{for(f.s();!(u=f.n()).done;){var p=u.value;i.counterIndex++;var y=n(p.range,2),h=y[0],d=y[1],m=parseInt(h),v=parseInt(d),b=!0;if(p.target){b=!1;for(var g=0;g<p.target.length;g++)p.target[g]===e&&(b=!0)}a>=m&&a<=v&&b&&(l.push(p.log),c.push(p),p.op&&p.op.margin&&(i.useMargin=p.op.margin))}}catch(t){f.e(t)}finally{f.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="",i.options.background&&(console.log(i.options.background),i.res.style.background=i.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(i.res.style.position="relative",i.res.style.zIndex=-1),l.includes("blast")){var x,w=c.filter((function(t){return"blast"===t.log}))[0].op.color,k=null!==(x=c.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==x?x:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof k?k+"px":k," solid orange"),i.res.style.display="inline-block",i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text&&(i.res.textContent=i.text),i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(k))}if(l.includes("filter")){var S=c.filter((function(t){return"filter"===t.log}))[0].op.filter;i.res.style.filter=S}if(l.includes("background")&&(i.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&(i.res.style["background-clip"]="text")),l.includes("shadow")){var T="",O=0;for(g=0;g<i.options.shadow.op.steps;g++)T+="drop-shadow(".concat(O+=3,"px ").concat(O,"px ").concat(O,"px gray) ");i.res.style.filter=T}if(l.includes("margin"))for(g=0;g<t.length;g++)if(t[g].op){var E=t[g].op.offsets;E&&void 0!==i.index&&(i.res.style.margin=E[Number(i.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(i.res=i.resCopy,i.options.span){var j;for(j=Array.isArray(i.options.span)?i.options.span.filter((function(t){return"span"===t.op.name}))[0]:i.options.span,i.res.textContent="",g=0;g<j.op.parts.length;g++){var C=j.op.parts[g].style,A=new i.constructor(j.op.parts[g].text).setup({type:"span"}).set(C).render();i.res.appendChild(A)}}}else{var P=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&o&&i.res.appendChild(P)}if(l.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var W=i.options.animation.op;i.res.animate(W.keyframesClose,{duration:0,fill:"forwards"}),i.res.animate(W.keyframesOpen,W.openOptions)}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var I=i.options.animation.op;i.res.animate(I.keyframesClose,{duration:0,fill:"forwards"});var N=function(){window.scrollY>parseFloat(I.fireAt)&&(i.res.animate(I.keyframesOpen,I.openOptions),window.removeEventListener("scroll",N))};window.addEventListener("scroll",N)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var L=i.options.animation.op;i.res.animate(L.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(i.res.animate(L.keyframesOpen,L.openOptions),e.disconnect())}))})).observe(i.res)}}};this.options.animation||window.addEventListener("resize",(function(){return 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}}],e&&a(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}());module.exports=e})();
|