nodality 1.0.85 → 1.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animator.cjs.js +1 -2
- package/dist/animator.esm.js +1 -2
- package/dist/appleanim.cjs.js +1 -1
- package/dist/appleanim.esm.js +1 -1
- package/dist/audionew.cjs.js +1 -2
- package/dist/audionew.esm.js +1 -2
- package/dist/base.cjs.js +0 -1
- package/dist/base.esm.js +1 -2
- package/dist/beta-desktop-bar.cjs.js +1 -0
- package/dist/beta-desktop-bar.esm.js +1 -0
- package/dist/beta-mobile-bar.cjs.js +1 -0
- package/dist/beta-mobile-bar.esm.js +1 -0
- package/dist/betaDesktopBar.esm.js +1 -1
- package/dist/betaMobileBar.esm.js +1 -1
- package/dist/bundle.umd.js +1 -2
- package/dist/button.cjs.js +1 -2
- package/dist/button.esm.js +1 -2
- package/dist/card-getter.cjs.js +1 -0
- package/dist/card-getter.esm.js +1 -0
- package/dist/cardGetter.esm.js +1 -1
- package/dist/center.cjs.js +1 -2
- package/dist/center.esm.js +1 -2
- package/dist/checkbox.cjs.js +1 -2
- package/dist/checkbox.esm.js +1 -2
- package/dist/code.cjs.js +1 -2
- package/dist/code.esm.js +1 -2
- package/dist/container.cjs.js +1 -2
- package/dist/container.esm.js +1 -2
- package/dist/data-list.cjs.js +1 -0
- package/dist/data-list.esm.js +1 -0
- package/dist/designer.cjs.js +1 -2
- package/dist/designer.esm.js +1 -2
- package/dist/dropdown.cjs.js +1 -2
- package/dist/dropdown.esm.js +1 -2
- package/dist/element-mapper.cjs.js +1 -0
- package/dist/element-mapper.esm.js +1 -0
- package/dist/elementMapper.cjs.js +1 -1
- package/dist/elementMapper.esm.js +1 -1
- package/dist/finalresult.esm.js +1 -2
- package/dist/flex-card.cjs.js +1 -0
- package/dist/flex-card.esm.js +1 -0
- package/dist/flex-grid.cjs.js +1 -0
- package/dist/flex-grid.esm.js +1 -0
- package/dist/flex-row.cjs.js +1 -0
- package/dist/flex-row.esm.js +1 -0
- package/dist/flexCard.cjs.js +1 -1
- package/dist/flexCard.esm.js +1 -1
- package/dist/floating-input.cjs.js +1 -0
- package/dist/floating-input.esm.js +1 -0
- package/dist/free.cjs.js +1 -2
- package/dist/free.esm.js +1 -2
- package/dist/horizontal-scroller.cjs.js +1 -0
- package/dist/horizontal-scroller.esm.js +1 -0
- package/dist/image-picker.cjs.js +1 -0
- package/dist/image-picker.esm.js +1 -0
- package/dist/image.cjs.js +1 -2
- package/dist/image.esm.js +1 -2
- package/dist/index.cjs.js +1 -2
- package/dist/index.esm.js +1 -2
- package/dist/keyframe-animation.cjs.js +1 -0
- package/dist/keyframe-animation.esm.js +1 -0
- package/dist/link-getter.cjs.js +1 -0
- package/dist/link-getter.esm.js +1 -0
- package/dist/link.cjs.js +1 -2
- package/dist/link.esm.js +1 -2
- package/dist/linkGetter.cjs.js +1 -1
- package/dist/linkGetter.esm.js +1 -1
- package/dist/meta-adder.cjs.js +1 -0
- package/dist/meta-adder.esm.js +1 -0
- package/dist/modal-2025.cjs.js +1 -0
- package/dist/modal-2025.esm.js +1 -0
- package/dist/multiswitcher.cjs.js +1 -0
- package/dist/multiswitcher.esm.js +1 -0
- package/dist/new-nav-bar.cjs.js +1 -0
- package/dist/new-nav-bar.esm.js +1 -0
- package/dist/picker.cjs.js +1 -2
- package/dist/picker.esm.js +1 -2
- package/dist/progress.cjs.js +1 -2
- package/dist/progress.esm.js +1 -2
- package/dist/radio.cjs.js +1 -2
- package/dist/radio.esm.js +1 -2
- package/dist/range.cjs.js +1 -2
- package/dist/range.esm.js +1 -2
- package/dist/scroll-video.cjs.js +1 -0
- package/dist/scroll-video.esm.js +1 -0
- package/dist/scrollvideo.cjs.js +1 -1
- package/dist/scrollvideo.esm.js +1 -1
- package/dist/side-bar.cjs.js +1 -0
- package/dist/side-bar.esm.js +1 -0
- package/dist/side-nav-bar.cjs.js +1 -0
- package/dist/side-nav-bar.esm.js +1 -0
- package/dist/simple-bar.cjs.js +1 -0
- package/dist/simple-bar.esm.js +1 -0
- package/dist/slider-2025.cjs.js +1 -0
- package/dist/slider-2025.esm.js +1 -0
- package/dist/spacer.cjs.js +0 -1
- package/dist/spacer.esm.js +1 -0
- package/dist/stack.cjs.js +1 -2
- package/dist/stack.esm.js +1 -2
- package/dist/stacker.cjs.js +1 -2
- package/dist/stacker.esm.js +1 -2
- package/dist/table.cjs.js +1 -2
- package/dist/table.esm.js +1 -2
- package/dist/text-field.cjs.js +1 -0
- package/dist/text-field.esm.js +1 -0
- package/dist/text.cjs.js +1 -2
- package/dist/text.esm.js +1 -2
- package/dist/transform-anim.cjs.js +1 -0
- package/dist/transform-anim.esm.js +1 -0
- package/dist/transformanim.cjs.js +1 -1
- package/dist/transformanim.esm.js +1 -1
- package/dist/ulist.cjs.js +1 -2
- package/dist/ulist.esm.js +1 -2
- package/dist/video.cjs.js +1 -0
- package/dist/video.esm.js +1 -2
- package/dist/wrap.cjs.js +0 -1
- package/dist/wrap.esm.js +1 -2
- package/dist/zoom-card.cjs.js +1 -0
- package/dist/zoom-card.esm.js +1 -0
- package/layout/animator.js +1 -1
- package/layout/audio.js +1 -1
- package/layout/audionew.js +1 -1
- package/layout/base-2.js +1 -1
- package/layout/base.js +1 -1
- package/layout/{betaDesktopBar.js → beta-desktop-bar.js} +1 -1
- package/layout/{betaMobileBar.js → beta-mobile-bar.js} +1 -1
- package/layout/box.js +1 -1
- package/layout/button.js +1 -1
- package/layout/cards.js +2 -1
- package/layout/center.js +1 -1
- package/layout/checkbox.js +1 -1
- package/layout/circle.js +1 -1
- package/layout/{cleanRow.js → clean-row.js} +1 -1
- package/layout/code.js +1 -1
- package/layout/container.js +1 -1
- package/layout/custom.js +1 -1
- package/layout/{divImage.js → div-image.js} +1 -1
- package/layout/{dropdown2025.js → dropdown-2025.js} +1 -1
- package/layout/dropdown.js +1 -1
- package/layout/{emptyElement.js → empty-element.js} +1 -1
- package/layout/{externalStylesheet.js → external-stylesheet.js} +1 -1
- package/layout/{flexCard.js → flex-card.js} +3 -1
- package/layout/{flexGrid.js → flex-grid.js} +1 -1
- package/layout/{flexrow.js → flex-row.js} +1 -1
- package/layout/footer.js +1 -1
- package/layout/{formComponents → form-components}/custom.js +1 -1
- package/layout/{formComponents/dataList.js → form-components/data-list.js} +1 -1
- package/layout/{formComponents/floatingInput.js → form-components/floating-input.js} +1 -1
- package/layout/{formComponents → form-components}/form-all.js +1 -1
- package/layout/{formComponents → form-components}/form.js +1 -1
- package/layout/{formComponents/imagePicker.js → form-components/image-picker.js} +1 -1
- package/layout/{formComponents → form-components}/picker.js +1 -1
- package/layout/{formComponents → form-components}/radio.js +1 -1
- package/layout/{formComponents → form-components}/radiogroup.js +1 -1
- package/layout/{formComponents → form-components}/range.js +1 -1
- package/layout/free.js +1 -1
- package/layout/grid-new.js +1 -1
- package/layout/{gridSwitcher.js → grid-switcher.js} +1 -1
- package/layout/grid.js +1 -1
- package/layout/group.js +1 -1
- package/layout/header.js +1 -1
- package/layout/{horizontalScroller.js → horizontal-scroller.js} +1 -1
- package/layout/image-old.js +1 -1
- package/layout/image.js +1 -1
- package/layout/index.js +49 -37
- package/layout/label.js +1 -1
- package/layout/link.js +1 -1
- package/layout/list-OLD.js +1 -1
- package/layout/list.js +1 -1
- package/layout/{metaAdder.js → meta-adder.js} +1 -1
- package/layout/{modal2025.js → modal-2025.js} +1 -1
- package/layout/modernwrap.js +1 -1
- package/layout/multiswitcher.js +1 -1
- package/layout/multiswitcherBeta.js +1 -1
- package/layout/{navBar.js → nav-bar.js} +1 -1
- package/layout/{navFactor/customDiv.js → nav-factor/custom-div.js} +1 -1
- package/layout/navBar-OLD.js +1 -1
- package/layout/{newFlatAdder.js → new-flat-adder.js} +1 -1
- package/layout/{newNavBar.js → new-nav-bar.js} +1 -1
- package/layout/{offsetContainer.js → offset-container.js} +1 -1
- package/layout/polygon.js +1 -1
- package/layout/progress.js +1 -1
- package/layout/row.js +1 -1
- package/layout/{savedNewNavBar.js → saved-new-nav-bar.js} +1 -1
- package/layout/{scrollvideo.js → scroll-video.js} +1 -1
- package/layout/{sideBar.js → side-bar.js} +1 -1
- package/layout/{sideNavBar.js → side-nav-bar.js} +1 -1
- package/layout/{simpleBar.js → simple-bar.js} +1 -1
- package/layout/{slider2025.js → slider-2025.js} +1 -1
- package/layout/spacer.js +1 -1
- package/layout/stack.js +1 -1
- package/layout/styler.js +1 -1
- package/layout/switcher.js +1 -1
- package/layout/table.js +1 -1
- package/layout/{textField.js → text-field.js} +1 -1
- package/layout/text.js +1 -1
- package/layout/ulist.js +1 -1
- package/layout/video.js +1 -1
- package/layout/{withoutNew.js → without-new.js} +1 -1
- package/layout/wrap.js +1 -1
- package/layout/{zoomCard.js → zoom-card.js} +1 -1
- package/lib/{cardGetter.js → card-getter.js} +1 -1
- package/lib/designer.js +49 -49
- package/lib/{elementMapper.js → element-mapper.js} +56 -37
- package/lib/{KeyframeAnimation.js → keyframe-animation.js} +1 -1
- package/lib/{linkGetter.js → link-getter.js} +1 -1
- package/lib/{scrollvideo.js → scroll-video.js} +1 -1
- package/lib/{Stacker.js → stacker.js} +2 -1
- package/lib/{TransformAnim.js → transform-anim.js} +1 -1
- package/package.json +4 -2
- package/dist/KeyframeAnimation.cjs.js +0 -2
- package/dist/KeyframeAnimation.cjs.js.LICENSE.txt +0 -5
- package/dist/KeyframeAnimation.esm.js +0 -2
- package/dist/KeyframeAnimation.esm.js.LICENSE.txt +0 -5
- package/dist/animator.cjs.js.LICENSE.txt +0 -5
- package/dist/animator.esm.js.LICENSE.txt +0 -5
- package/dist/appleanim.cjs.js.LICENSE.txt +0 -5
- package/dist/appleanim.esm.js.LICENSE.txt +0 -5
- package/dist/audionew.cjs.js.LICENSE.txt +0 -5
- package/dist/audionew.esm.js.LICENSE.txt +0 -5
- package/dist/base.cjs.js.LICENSE.txt +0 -5
- package/dist/base.esm.js.LICENSE.txt +0 -5
- package/dist/betaDesktopBar.esm.js.LICENSE.txt +0 -5
- package/dist/betaMobileBar.esm.js.LICENSE.txt +0 -5
- package/dist/bundle.umd.js.LICENSE.txt +0 -5
- package/dist/button.cjs.js.LICENSE.txt +0 -5
- package/dist/button.esm.js.LICENSE.txt +0 -5
- package/dist/cardGetter.cjs.js.LICENSE.txt +0 -5
- package/dist/cardGetter.esm.js.LICENSE.txt +0 -5
- package/dist/center.cjs.js.LICENSE.txt +0 -5
- package/dist/center.esm.js.LICENSE.txt +0 -5
- package/dist/checkbox.cjs.js.LICENSE.txt +0 -5
- package/dist/checkbox.esm.js.LICENSE.txt +0 -5
- package/dist/circle.cjs.js +0 -2
- package/dist/circle.cjs.js.LICENSE.txt +0 -5
- package/dist/circle.esm.js +0 -2
- package/dist/circle.esm.js.LICENSE.txt +0 -5
- package/dist/code.cjs.js.LICENSE.txt +0 -5
- package/dist/code.esm.js.LICENSE.txt +0 -5
- package/dist/container.cjs.js.LICENSE.txt +0 -5
- package/dist/container.esm.js.LICENSE.txt +0 -5
- package/dist/datalist.cjs.js.LICENSE.txt +0 -5
- package/dist/datalist.esm.js.LICENSE.txt +0 -5
- package/dist/designer.cjs.js.LICENSE.txt +0 -5
- package/dist/designer.esm.js.LICENSE.txt +0 -5
- package/dist/dropdown.cjs.js.LICENSE.txt +0 -5
- package/dist/dropdown.esm.js.LICENSE.txt +0 -5
- package/dist/elementMapper.cjs.js.LICENSE.txt +0 -5
- package/dist/elementMapper.esm.js.LICENSE.txt +0 -5
- package/dist/finalresult.esm.js.LICENSE.txt +0 -5
- package/dist/flexCard.cjs.js.LICENSE.txt +0 -5
- package/dist/flexCard.esm.js.LICENSE.txt +0 -5
- package/dist/flexGrid.cjs.js.LICENSE.txt +0 -5
- package/dist/flexGrid.esm.js.LICENSE.txt +0 -5
- package/dist/flexRow.cjs.js.LICENSE.txt +0 -5
- package/dist/flexRow.esm.js.LICENSE.txt +0 -5
- package/dist/floatingInput.cjs.js.LICENSE.txt +0 -5
- package/dist/floatingInput.esm.js.LICENSE.txt +0 -5
- package/dist/free.cjs.js.LICENSE.txt +0 -5
- package/dist/free.esm.js.LICENSE.txt +0 -5
- package/dist/gridSwitcher.cjs.js +0 -2
- package/dist/gridSwitcher.cjs.js.LICENSE.txt +0 -5
- package/dist/gridSwitcher.esm.js +0 -2
- package/dist/gridSwitcher.esm.js.LICENSE.txt +0 -5
- package/dist/horizontalScroller.esm.js.LICENSE.txt +0 -5
- package/dist/image.cjs.js.LICENSE.txt +0 -5
- package/dist/image.esm.js.LICENSE.txt +0 -5
- package/dist/imagePicker.cjs.js.LICENSE.txt +0 -5
- package/dist/imagePicker.esm.js.LICENSE.txt +0 -5
- package/dist/index.cjs.js.LICENSE.txt +0 -5
- package/dist/index.esm.js.LICENSE.txt +0 -5
- package/dist/link.cjs.js.LICENSE.txt +0 -5
- package/dist/link.esm.js.LICENSE.txt +0 -5
- package/dist/linkGetter.cjs.js.LICENSE.txt +0 -5
- package/dist/linkGetter.esm.js.LICENSE.txt +0 -5
- package/dist/metaAdder.cjs.js.LICENSE.txt +0 -5
- package/dist/metaAdder.esm.js.LICENSE.txt +0 -5
- package/dist/modal2025.cjs.js.LICENSE.txt +0 -5
- package/dist/modal2025.esm.js.LICENSE.txt +0 -5
- package/dist/multiswitchers.esm.js.LICENSE.txt +0 -5
- package/dist/newNavBar.cjs.js.LICENSE.txt +0 -5
- package/dist/newNavBar.esm.js.LICENSE.txt +0 -5
- package/dist/picker.cjs.js.LICENSE.txt +0 -5
- package/dist/picker.esm.js.LICENSE.txt +0 -5
- package/dist/polygon.cjs.js +0 -2
- package/dist/polygon.cjs.js.LICENSE.txt +0 -5
- package/dist/polygon.esm.js +0 -2
- package/dist/polygon.esm.js.LICENSE.txt +0 -5
- package/dist/progress.cjs.js.LICENSE.txt +0 -5
- package/dist/progress.esm.js.LICENSE.txt +0 -5
- package/dist/radio.cjs.js.LICENSE.txt +0 -5
- package/dist/radio.esm.js.LICENSE.txt +0 -5
- package/dist/range.cjs.js.LICENSE.txt +0 -5
- package/dist/range.esm.js.LICENSE.txt +0 -5
- package/dist/scrollvideo.cjs.js.LICENSE.txt +0 -5
- package/dist/scrollvideo.esm.js.LICENSE.txt +0 -5
- package/dist/sideBar.cjs.js.LICENSE.txt +0 -5
- package/dist/sideBar.esm.js.LICENSE.txt +0 -5
- package/dist/sideNavBar.cjs.js.LICENSE.txt +0 -5
- package/dist/sideNavBar.esm.js.LICENSE.txt +0 -5
- package/dist/simpleBar.cjs.js.LICENSE.txt +0 -5
- package/dist/simpleBar.esm.js.LICENSE.txt +0 -5
- package/dist/slider2025.cjs.js +0 -2
- package/dist/slider2025.cjs.js.LICENSE.txt +0 -5
- package/dist/slider2025.esm.js +0 -2
- package/dist/slider2025.esm.js.LICENSE.txt +0 -5
- package/dist/spacer.cjs.js.LICENSE.txt +0 -5
- package/dist/stack.cjs.js.LICENSE.txt +0 -5
- package/dist/stack.esm.js.LICENSE.txt +0 -5
- package/dist/stacker.cjs.js.LICENSE.txt +0 -5
- package/dist/stacker.esm.js.LICENSE.txt +0 -5
- package/dist/table.cjs.js.LICENSE.txt +0 -5
- package/dist/table.esm.js.LICENSE.txt +0 -5
- package/dist/text.cjs.js.LICENSE.txt +0 -5
- package/dist/text.esm.js.LICENSE.txt +0 -5
- package/dist/textField.cjs.js.LICENSE.txt +0 -5
- package/dist/textField.esm.js.LICENSE.txt +0 -5
- package/dist/transformanim.cjs.js.LICENSE.txt +0 -5
- package/dist/transformanim.esm.js.LICENSE.txt +0 -5
- package/dist/ulist.cjs.js.LICENSE.txt +0 -5
- package/dist/ulist.esm.js.LICENSE.txt +0 -5
- package/dist/video.esm.js.LICENSE.txt +0 -5
- package/dist/wrap.cjs.js.LICENSE.txt +0 -5
- package/dist/wrap.esm.js.LICENSE.txt +0 -5
- package/dist/zoomCard.cjs.js.LICENSE.txt +0 -5
- package/dist/zoomCard.esm.js.LICENSE.txt +0 -5
- package/layout/<head> +0 -59
- package/layout/DEADJOE +0 -49
- package/layout/DEPRECATED-PARAGRAPH.js +0 -109
- package/layout/edit.sh +0 -39
- package/layout/formComponents/edit.sh +0 -39
- package/layout/navFactor/edit.sh +0 -39
- package/layout/newNavBar copy 2.js +0 -921
- package/layout/newNavBar copy.js +0 -780
- package/lib/AppleAnim.js +0 -794
|
@@ -1,921 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* nodality v1.0.85
|
|
3
|
-
* (c) 2025 Filip Vabrousek
|
|
4
|
-
* License: MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import {Animator} from "./animator.js";
|
|
8
|
-
// import {CustomDivRenderer} from "./navFactor/customDiv.js";
|
|
9
|
-
// CORRECT
|
|
10
|
-
// const { TIS620_THAI_CI } = require("mysql/lib/protocol/constants/charsets");
|
|
11
|
-
class CustomDivRenderer {
|
|
12
|
-
constructor(obj, items) {
|
|
13
|
-
this.obj = obj || {};
|
|
14
|
-
this.items = items || [];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
render() {
|
|
18
|
-
// Create inner div with flex display
|
|
19
|
-
let tempDiv = document.createElement("div");
|
|
20
|
-
tempDiv.style.display = "flex";
|
|
21
|
-
tempDiv.style.width = "100%";
|
|
22
|
-
tempDiv.style.justifyContent = "space-around";
|
|
23
|
-
tempDiv.setAttribute("id", "innerItemsWrapper");
|
|
24
|
-
|
|
25
|
-
let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
|
|
26
|
-
let media = window.matchMedia(`(max-width: 600px)`);
|
|
27
|
-
|
|
28
|
-
if (mobileMedia.matches || media.matches){
|
|
29
|
-
tempDiv.style.marginTop = "3rem";
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// console.log("ITEMS ARE ORDERED");
|
|
33
|
-
// console.log(this.items);
|
|
34
|
-
|
|
35
|
-
// Append rendered items to inner div
|
|
36
|
-
for (let i = 0; i < this.items.length; i++) {
|
|
37
|
-
const item = this.items[i];
|
|
38
|
-
tempDiv.appendChild(item.render());
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Create outer div and apply styling based on obj properties
|
|
42
|
-
let outerDiv = document.createElement("div");
|
|
43
|
-
outerDiv.style.width = this.obj.isSide ? "333px" : "100%";
|
|
44
|
-
outerDiv.style.background = this.obj.background || "white";
|
|
45
|
-
outerDiv.style.display = "flex";
|
|
46
|
-
outerDiv.style.justifyContent = "center";
|
|
47
|
-
outerDiv.style.alignItems = "center";
|
|
48
|
-
outerDiv.style.height = "100%";
|
|
49
|
-
outerDiv.setAttribute("id", "outerItemsWrapper");
|
|
50
|
-
outerDiv.appendChild(tempDiv);
|
|
51
|
-
|
|
52
|
-
// Apply custom styles if specified in obj
|
|
53
|
-
if (this.obj.customStyle) {
|
|
54
|
-
tempDiv.style.width = "auto";
|
|
55
|
-
tempDiv.style.top = "0rem";
|
|
56
|
-
tempDiv.style.borderRadius = "1rem";
|
|
57
|
-
tempDiv.style.background = this.obj.background || "white";
|
|
58
|
-
tempDiv.style.margin = "1rem";
|
|
59
|
-
tempDiv.style.position = "absolute";
|
|
60
|
-
tempDiv.style.opacity = 0.8;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return outerDiv;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//window.CustomDivRenderer = CustomDivRenderer;
|
|
68
|
-
//export { CustomDivRenderer };
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class UINavBar extends Animator {
|
|
72
|
-
constructor(els) {
|
|
73
|
-
super();
|
|
74
|
-
this.titleText = "";
|
|
75
|
-
this.hasHamburger = false;
|
|
76
|
-
this.code = [];
|
|
77
|
-
this.attributes = {};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
toCode(){
|
|
81
|
-
let codeStr = `new UINavBar()`;
|
|
82
|
-
// 16:01:09 09/11/24 What????
|
|
83
|
-
// Convert attributes to .set({...}) format if there are any attributes
|
|
84
|
-
if (Object.keys(this.attributes).length > 0) {
|
|
85
|
-
codeStr += `.setup(${JSON.stringify(this.attributes, null, 2).replace(/"([^"]+)":/g, '$1:')})`;
|
|
86
|
-
|
|
87
|
-
// codeStr += `.set(${JSON.stringify(this.attributes, null, 2)})`;
|
|
88
|
-
} else {
|
|
89
|
-
codeStr += `.setup({})`;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
codeStr += `.items([\n`;
|
|
93
|
-
|
|
94
|
-
// Generate the code for each item and join with commas only between items
|
|
95
|
-
codeStr += this.items
|
|
96
|
-
.map(item => item.toCode().join("").trim()) // Trim any line breaks or whitespace around the item code
|
|
97
|
-
.join(",\n"); // Insert commas only between items
|
|
98
|
-
|
|
99
|
-
codeStr += `\n])`;
|
|
100
|
-
|
|
101
|
-
return codeStr;
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
styled(obj) {
|
|
106
|
-
this.setup(obj);
|
|
107
|
-
this.styles = obj;
|
|
108
|
-
return this;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
setup(obj) {
|
|
112
|
-
this.obj = obj;
|
|
113
|
-
if (!this.obj.isSide) { // fuck that, not even Ing. can solve this
|
|
114
|
-
this.obj.animate = false;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
this.attributes = obj;
|
|
118
|
-
let wrap = document.createElement("div");
|
|
119
|
-
wrap.setAttribute("id", "sars");
|
|
120
|
-
wrap.style.padding = 0;
|
|
121
|
-
wrap.style.margin = 0;
|
|
122
|
-
|
|
123
|
-
let el = document.createElement("div");
|
|
124
|
-
el.setAttribute("id", "covid");
|
|
125
|
-
el.style.position = "absolute"; // KEEP THIS ?? 07/01/2025
|
|
126
|
-
el.style.width = "100%";
|
|
127
|
-
el.style.zIndex = 1;
|
|
128
|
-
el.style.alignItems = "flex-start";
|
|
129
|
-
// LINE 700 FINAL STYLING !!!
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
let back = document.createElement("div");
|
|
134
|
-
back.style.background = "green";
|
|
135
|
-
back.style.position = "absolute";
|
|
136
|
-
|
|
137
|
-
el.style.margin = "20px";
|
|
138
|
-
el.style.display = "flex";
|
|
139
|
-
el.style.alignItems = "flex-end";
|
|
140
|
-
el.style.margin = 0;
|
|
141
|
-
el.style.padding = 0;
|
|
142
|
-
el.style.margin = 0;
|
|
143
|
-
|
|
144
|
-
wrap.appendChild(el);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
this.addCloseButton = false;
|
|
148
|
-
this.res = wrap;
|
|
149
|
-
// console.log(this.res);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (obj.background) {
|
|
153
|
-
this.background({
|
|
154
|
-
color: obj.background
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (obj.openColor){
|
|
160
|
-
this.openColor = obj.openColor;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (obj.sticky) {
|
|
165
|
-
this.sticky();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (obj.pad){
|
|
169
|
-
this.pad(obj.pad);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (obj.hamburgerColour) {
|
|
174
|
-
this.hamburgerColour = obj.hamburgerColour;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (obj.mobileSize) {
|
|
178
|
-
this.mobileSize = obj.mobileSize;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (obj.desktopSize) {
|
|
182
|
-
this.desktopSize = obj.desktopSize;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (obj.height) {
|
|
186
|
-
this.res.children[0].style.height = obj.height;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return this;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
items(items) {
|
|
194
|
-
|
|
195
|
-
this.items = items;
|
|
196
|
-
|
|
197
|
-
let starts = ["Link", "Image", "Spacer", "Dropdown"].some(e => {
|
|
198
|
-
return items[0].__proto__
|
|
199
|
-
.constructor
|
|
200
|
-
.toString()
|
|
201
|
-
.startsWith(`class ${e}`);
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
// console.log(starts);
|
|
205
|
-
|
|
206
|
-
if (starts) { // We are adding class instances to the Area
|
|
207
|
-
|
|
208
|
-
this.itemCount = items.length; // 675 lines was
|
|
209
|
-
let rend = new CustomDivRenderer(this.obj, this.items);
|
|
210
|
-
let outerDiv = rend.render();
|
|
211
|
-
|
|
212
|
-
this.res.children[0].appendChild(outerDiv);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
let child = this.res.children[0].children[0].children[0];
|
|
217
|
-
// console.log("AHELLO");
|
|
218
|
-
// console.log(child);
|
|
219
|
-
// console.log(child.children);
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
// dont solve range object
|
|
223
|
-
// console.log("ANIMATION OBJECT ");
|
|
224
|
-
|
|
225
|
-
// Read initial state from this
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
let animationObj = this.items[0].options;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (animationObj && animationObj.animation){
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
let animation = animationObj.animation.op;
|
|
235
|
-
// console.log(animation);
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
if (animation){
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
|
|
243
|
-
|
|
244
|
-
let smallScreen = window.matchMedia(`(max-width: 600px)`);
|
|
245
|
-
|
|
246
|
-
if (!mobileMedia.matches && !smallScreen.matches){
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
for (var i = 0; i < child.children.length; i++){
|
|
250
|
-
//child.children[i].style.border = "1px solid purple";
|
|
251
|
-
|
|
252
|
-
// 1 - SET HIDDEN STATE BY IMMEDIATELLY FIRING ANIM
|
|
253
|
-
// set hidden state immediatelly on the mobile
|
|
254
|
-
let immediateAll = {
|
|
255
|
-
duration: 1, // 1 should be acceptable here when I close
|
|
256
|
-
fill: 'forwards',
|
|
257
|
-
delay: 1
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
child.children[i].animate(animation.keyframesClose, immediateAll);
|
|
261
|
-
|
|
262
|
-
// 2 - ANIMATE INTO THE VIEW
|
|
263
|
-
// animate using opening keyframes on the mobile when user click the button
|
|
264
|
-
// when mobile nav is in opended state an I click button to set it to closing state
|
|
265
|
-
// animate "#innerItemsWrapper" children using closing options
|
|
266
|
-
child.children[i].animate(animation.keyframesOpen, animation.openOptions);
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
} else { // We are in animated state on mobile
|
|
273
|
-
let immediateAll = {
|
|
274
|
-
duration: 1, // 1 should be acceptable here when I close
|
|
275
|
-
fill: 'forwards',
|
|
276
|
-
delay: 1
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
//console.log("CHILDREN");
|
|
280
|
-
//console.log(child);
|
|
281
|
-
//console.log(child.children);
|
|
282
|
-
|
|
283
|
-
for (var i = 0; i < child.children.length; i++){
|
|
284
|
-
child.children[i].animate(animation.keyframesClose, immediateAll);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
this.adjust();
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (!starts) { // User is lazy
|
|
297
|
-
|
|
298
|
-
this.itemCount = items.length;
|
|
299
|
-
|
|
300
|
-
let div = document.createElement("div");
|
|
301
|
-
div.style.backgroundColor = "orange";
|
|
302
|
-
|
|
303
|
-
for (var i = 0; i < items.length; i++) {
|
|
304
|
-
let item = items[i];
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if (item.logo) {
|
|
308
|
-
let logo = new Image(item.logo).width("100px");
|
|
309
|
-
let spacer = document.createElement("div");
|
|
310
|
-
spacer.style.flex = "1";
|
|
311
|
-
spacer.style.height = 23;
|
|
312
|
-
|
|
313
|
-
let wr = document.createElement("div");
|
|
314
|
-
wr.setAttribute("id", "WR")
|
|
315
|
-
wr.style.display = "flex";
|
|
316
|
-
wr.style.flexDirection = "row";
|
|
317
|
-
wr.appendChild(logo.render());
|
|
318
|
-
this.res.children[0].appendChild(logo.render());
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
// throws it
|
|
323
|
-
|
|
324
|
-
if (this.obj.spacing) {
|
|
325
|
-
this.res.children[0].appendChild(spacer);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (item.logo) {
|
|
331
|
-
this.allowPad = true;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (item.logo && this.obj.spacing) {
|
|
335
|
-
this.res.children[0].children[0].style.marginLeft = this.obj.spacing.sides;
|
|
336
|
-
this.res.children[0].children[0].style.marginRight = this.obj.spacing.sides;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
if (item.title) {
|
|
341
|
-
|
|
342
|
-
let link;
|
|
343
|
-
if (this.allowPad) {
|
|
344
|
-
if (item.type) {
|
|
345
|
-
link = new Dropdown(item.items, item.title)
|
|
346
|
-
} else {
|
|
347
|
-
link = new Link(item.title, item.url)
|
|
348
|
-
.arrayPadding(["left", "right"], "1em");
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
} else {
|
|
352
|
-
|
|
353
|
-
if (item.type) {
|
|
354
|
-
link = new Link("DRPA", item.url);
|
|
355
|
-
} else {
|
|
356
|
-
link = new Link(item.title, item.url);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
div.appendChild(link.render());
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
this.res.children[0].appendChild(div);
|
|
367
|
-
this.adjust();
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
// Insert hamburger button at the correct place
|
|
374
|
-
var btn = this.addHamburger();
|
|
375
|
-
|
|
376
|
-
let newCount = this.itemCount;
|
|
377
|
-
if (this.obj.spacing) {
|
|
378
|
-
newCount += 1;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
btn.style.zIndex = 1;
|
|
382
|
-
|
|
383
|
-
if (this.res.children[0].children.length === 1) { // Problem here
|
|
384
|
-
this.res.children[0].insertBefore(btn, this.res.children[0].firstChild);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return this;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
instance() {
|
|
391
|
-
return this.res.children[0];
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
sticky() {
|
|
395
|
-
this.res.children[0].style.position = "fixed";
|
|
396
|
-
return this;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
font(family) {
|
|
400
|
-
|
|
401
|
-
for (var i = 0; i < this.res.children[0].children; i++) {
|
|
402
|
-
this.res.children[0].children[i].style.fontFamily = family;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
return this;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
openSymbol(symbol) {
|
|
411
|
-
this.symbol = symbol;
|
|
412
|
-
return this;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
background(obj) {
|
|
417
|
-
|
|
418
|
-
if (!obj.background){
|
|
419
|
-
this.res.children[0].style.backgroundColor = "transparent";
|
|
420
|
-
return this;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
this.res.children[0].style.backgroundColor = obj.color;
|
|
424
|
-
this.res.children[0].style.opacity = obj.opacity;
|
|
425
|
-
return this;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
transluescent() {
|
|
429
|
-
this.res.children[0].style.backgroundColor = "rgba(255,255,255,0.72)";
|
|
430
|
-
return this;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
keepItem(item) {
|
|
435
|
-
// console.log("Wow");
|
|
436
|
-
this.keepItem = item;
|
|
437
|
-
return this;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
addHamburger = () => {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
let media2 = window.matchMedia(`(max-device-width: 415px)`);
|
|
445
|
-
|
|
446
|
-
var btn = document.createElement("button");
|
|
447
|
-
btn.setAttribute("id", "hamburger");
|
|
448
|
-
btn.style.border = "none";
|
|
449
|
-
btn.style.fontWeight = "bold";
|
|
450
|
-
btn.style.position = "absolute"; // NEW
|
|
451
|
-
btn.style.color = "orange";//this.obj.hamColour.opened; //this.hamburgerColour ?? "#3498db";
|
|
452
|
-
btn.style.backgroundColor = "transparent";
|
|
453
|
-
btn.style.fontSize = media2.matches ? "2.1em" : "2em";
|
|
454
|
-
|
|
455
|
-
var node = document.createTextNode(this.symbol ? this.symbol : "☰");
|
|
456
|
-
btn.appendChild(node);
|
|
457
|
-
btn.style.marginLeft = "auto";
|
|
458
|
-
|
|
459
|
-
this.isShown = false;
|
|
460
|
-
|
|
461
|
-
btn.addEventListener("click", () => {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
this.isShown = !this.isShown;
|
|
465
|
-
|
|
466
|
-
this.hasAnimatedToWide = false;
|
|
467
|
-
|
|
468
|
-
// alert("Hello");
|
|
469
|
-
// alert(this.res.children[0].children[1].children[0].getAttribute("id"));
|
|
470
|
-
|
|
471
|
-
// zmenším, otevřu, roztáhnu, zmenším => musím klinout 2x
|
|
472
|
-
// zmenším => kliknu => animace se rozjede 2x
|
|
473
|
-
|
|
474
|
-
// mám rotažené => zmenším, a při otevření se mi animace rozjede 2x
|
|
475
|
-
|
|
476
|
-
// When onResize < 400px the nav must disappear
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
let animationObj = this.items[0].options;
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
if (animationObj && animationObj.animation){
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
let animation = animationObj.animation.op;
|
|
486
|
-
// console.log(animation);
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
const innerItemsWrapper = this.res.children[0].children[1].children[0];
|
|
493
|
-
|
|
494
|
-
if (animation){
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
// console.log("Why not showing on 600px????");
|
|
499
|
-
// console.log(this.isShown);
|
|
500
|
-
|
|
501
|
-
if (this.isShown){
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
for (var i = 0; i < innerItemsWrapper.children.length; i++){
|
|
508
|
-
let inner = innerItemsWrapper.children[i];
|
|
509
|
-
let anima = inner.animate(animation.keyframesClose, {
|
|
510
|
-
duration: 1, // 1 should be acceptable here when I close
|
|
511
|
-
fill: 'forwards',
|
|
512
|
-
delay: 0
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
// 9:16:04 Nice! 21/11/24
|
|
517
|
-
anima.onfinish = () => {
|
|
518
|
-
innerItemsWrapper.parentElement.style.display = "block";
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
/* window.setTimeout(() => {
|
|
524
|
-
innerItemsWrapper.parentElement.style.display = "block";
|
|
525
|
-
}, 50);*/
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
} else {
|
|
534
|
-
innerItemsWrapper.parentElement.style.display = "none";
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
for (var i = 0; i < innerItemsWrapper.children.length; i++){
|
|
538
|
-
let inner = innerItemsWrapper.children[i];
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
inner.animate(animation.keyframesClose, {
|
|
543
|
-
duration: 1, // 1 should be acceptable here when I close
|
|
544
|
-
fill: 'forwards',
|
|
545
|
-
delay: 0
|
|
546
|
-
});
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
if (this.isShown){
|
|
550
|
-
|
|
551
|
-
// if (inner.style.translateX != 0)
|
|
552
|
-
inner.animate(animation.keyframesOpen, animation.openOptions);
|
|
553
|
-
} else {
|
|
554
|
-
inner.animate(animation.keyframesClose, animation.closeOptions);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
} else {
|
|
563
|
-
if (this.isShown){
|
|
564
|
-
innerItemsWrapper.parentElement.style.display = "block";
|
|
565
|
-
} else {
|
|
566
|
-
innerItemsWrapper.parentElement.style.display = "none";
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
// Hide outerItemsWrapper or animate links
|
|
572
|
-
})
|
|
573
|
-
|
|
574
|
-
// let hamb = document.querySelector("#hamburger");
|
|
575
|
-
// alert(this.res.children[0].children[0].getAttribute("id"));
|
|
576
|
-
|
|
577
|
-
return btn;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
/*--------------------------------------------------ADJUST--------------------------------------------------*/
|
|
581
|
-
// set habmurger icon
|
|
582
|
-
adjust(w) {
|
|
583
|
-
let media = window.matchMedia(`(max-width: 600px)`);
|
|
584
|
-
let media2 = window.matchMedia(`(max-device-width: 415px)`);
|
|
585
|
-
|
|
586
|
-
const adjustFontSize = () => {
|
|
587
|
-
//console.log("IN VIEWPORT");
|
|
588
|
-
|
|
589
|
-
// console.log(this.res);
|
|
590
|
-
for (var i = 0; i < this.res.children[0].children.length; i++) {
|
|
591
|
-
let el = this.res.children[0].children[i];
|
|
592
|
-
el.style.fontSize = media2.matches ? (this.mobileSize ? this.mobileSize : "1.2em") : (this.desktopSize ? this.desktopSize : "1em");
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
if (el.textContent === "☰") {
|
|
596
|
-
el.style.fontSize = "2em";
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
const findNestedDivWithId = (elements, targetId) => {
|
|
605
|
-
for (var i = 0; i < elements.length; i++) {
|
|
606
|
-
var element = elements[i];
|
|
607
|
-
|
|
608
|
-
if (element.id === targetId) {
|
|
609
|
-
return element; // Found the target div
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
// Check nested children recursively
|
|
613
|
-
var foundInChildren = findNestedDivWithId(element.children, targetId);
|
|
614
|
-
if (foundInChildren) {
|
|
615
|
-
return foundInChildren;
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
return null; // If not found
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
const toWideScreen = () => {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
let my = this.res.children[0];
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
for (var i = 0; i < this.res.children[0].children.length; i++) {
|
|
646
|
-
|
|
647
|
-
let child = this.res.children[0].children[i];
|
|
648
|
-
|
|
649
|
-
child.style.marginTop = "0em";
|
|
650
|
-
|
|
651
|
-
if (child.id === "WR") {
|
|
652
|
-
child.style.display = "flex";
|
|
653
|
-
} else {
|
|
654
|
-
child.style.display = "flex";
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
if (child.textContent === this.titleText && this.titleText.length > 0) {
|
|
658
|
-
alert(child.textContent)
|
|
659
|
-
child.style.fontSize = "2em";
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
// animate back
|
|
667
|
-
|
|
668
|
-
let animationObj = this.items[0].options;
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
if (animationObj && animationObj.animation){
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
let animation = animationObj.animation.op;
|
|
675
|
-
// console.log(animation);
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
const covid = this.res.children[0];
|
|
682
|
-
const innerItemsWrapper = findNestedDivWithId(this.res.children, 'innerItemsWrapper');
|
|
683
|
-
///covid.children[0].children[1].children[0];
|
|
684
|
-
|
|
685
|
-
// console.log("KINNERA");
|
|
686
|
-
// console.log(innerItemsWrapper);
|
|
687
|
-
|
|
688
|
-
// console.log("COVID");
|
|
689
|
-
// console.log(covid);
|
|
690
|
-
// innerItemsWrapper.style.border = "3px solid orange";
|
|
691
|
-
innerItemsWrapper.style.marginTop = "0";
|
|
692
|
-
|
|
693
|
-
if (animation){
|
|
694
|
-
// console.log("Why not showing on 600px????")
|
|
695
|
-
// console.log("TOWIDE");
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
// console.log(covid);
|
|
699
|
-
// console.log(covid.children[1].children[0]);
|
|
700
|
-
|
|
701
|
-
// alert("OIJHIOHO")
|
|
702
|
-
|
|
703
|
-
// close the nav an expand bad
|
|
704
|
-
|
|
705
|
-
if (!this.hasAnimatedToWide){
|
|
706
|
-
this.hasAnimatedToWide = true;
|
|
707
|
-
|
|
708
|
-
for (var i = 0; i < innerItemsWrapper.children.length; i++){
|
|
709
|
-
|
|
710
|
-
let link = innerItemsWrapper.children[i];
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
link.animate(animation.keyframesOpen, animation.openOptions);
|
|
716
|
-
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
} else {
|
|
725
|
-
const innerItemsWrapper = findNestedDivWithId(this.res.children, 'innerItemsWrapper');
|
|
726
|
-
innerItemsWrapper.style.marginTop = "0";
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
// nice library!
|
|
753
|
-
const doInAdjust = () => {
|
|
754
|
-
|
|
755
|
-
this.isShown = false;
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
let my = this.res.children[0];
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
adjustFontSize();
|
|
762
|
-
var closed = false;
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
this.res.children[0].style.flexDirection = "column";
|
|
766
|
-
|
|
767
|
-
for (var i = 0; i < this.res.children[0].children.length; i++) {
|
|
768
|
-
if (this.res.children[0].children[i].textContent == "☰" || this.res.children[0].children[i].textContent == /*"Lands"*/ this.keepItem) {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
let child = this.res.children[0].children[i];
|
|
772
|
-
if (child.id === "WR") {
|
|
773
|
-
this.res.children[0].children[i].style.display = "flex";
|
|
774
|
-
} else {
|
|
775
|
-
this.res.children[0].children[i].style.display = "flex";
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
} else {
|
|
781
|
-
this.res.children[0].children[i].style.display = "none";
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
const adjust = () => {
|
|
787
|
-
if (!this.obj.isSide) {
|
|
788
|
-
if (media.matches || media2.matches) {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
doInAdjust();
|
|
793
|
-
|
|
794
|
-
} else {
|
|
795
|
-
toWideScreen();
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
if (!this.obj.isSide) {
|
|
804
|
-
|
|
805
|
-
let inner = this.res.children[1]; //document.querySelector("#outerItemsWrapper")
|
|
806
|
-
if (inner != null) {
|
|
807
|
-
inner.style.background = "yellow";
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
if (media.matches || media2.matches) {
|
|
811
|
-
doInAdjust();
|
|
812
|
-
//alert("P")
|
|
813
|
-
//this.res.children[0].style.opacity = 0.3;
|
|
814
|
-
// console.log("884A");
|
|
815
|
-
// console.warn(this.res);
|
|
816
|
-
// console.log(this.res.children[0].children[0]);
|
|
817
|
-
} else {
|
|
818
|
-
toWideScreen();
|
|
819
|
-
}
|
|
820
|
-
} else {
|
|
821
|
-
doInAdjust();
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
// was double anim once we commented this out
|
|
826
|
-
// this.hasAnimatedToWide = false;
|
|
827
|
-
window.addEventListener("resize", adjust);
|
|
828
|
-
return this;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
/*--------------------------------------------------ADJUST--------------------------------------------------*/
|
|
832
|
-
render(div) {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
const method = () => {
|
|
836
|
-
let media = window.matchMedia(`(max-width: 600px)`);
|
|
837
|
-
|
|
838
|
-
// This gets owervwritten, column fires
|
|
839
|
-
|
|
840
|
-
let myMedia = window.matchMedia(`(max-device-width: 415px)`);
|
|
841
|
-
let outerItemsWrapper = this.res.children[0].children[1];
|
|
842
|
-
let innerIW = outerItemsWrapper.children[0];
|
|
843
|
-
|
|
844
|
-
// console.log("TEETH");
|
|
845
|
-
// console.log(outerItemsWrapper);
|
|
846
|
-
// console.log(innerIW);
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
if (myMedia.matches) {
|
|
850
|
-
innerIW.style.position = "relative";
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
if ((media.matches || myMedia.matches) && innerIW != undefined) {
|
|
856
|
-
//alert("PP")
|
|
857
|
-
innerIW.style.flexDirection = "column";
|
|
858
|
-
} else if (innerIW != undefined && !this.obj.isSide) {
|
|
859
|
-
innerIW.style.flexDirection = "row";
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
if (!this.obj.isSide && !media.matches && !myMedia.matches) {
|
|
863
|
-
this.res.children[0].children[0].style.display = "none";
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
if (this.obj.isSide) {
|
|
868
|
-
innerIW.style.flexDirection = "column";
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
if (!this.obj.isSide && !media.matches) {
|
|
872
|
-
this.res.children[0].style.position = "relative";
|
|
873
|
-
outerItemsWrapper.style.transform = "translateY(0px)";
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
if (!this.obj.isSide && media.matches) {
|
|
877
|
-
// this.res.children[0].style.position = "absolute";
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
// my custom
|
|
882
|
-
|
|
883
|
-
if (this.obj.customStyle){
|
|
884
|
-
// this.res.children[0].children[1].children[0].style.width = "200px";
|
|
885
|
-
this.res.children[0].style.marginTop = "1rem";
|
|
886
|
-
this.res.children[0].style.position = "absolute";
|
|
887
|
-
this.res.children[0].style.borderRadius = "1rem";
|
|
888
|
-
outerItemsWrapper.style.borderRadius = "1rem";
|
|
889
|
-
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
// Add line 700
|
|
894
|
-
if (this.obj.radius){
|
|
895
|
-
// this.res.children[0].children[1].children[0].style.width = "200px";
|
|
896
|
-
// alert("P")
|
|
897
|
-
|
|
898
|
-
// Both need to be like this
|
|
899
|
-
this.res.children[0].style.borderRadius = "1rem";
|
|
900
|
-
outerItemsWrapper.style.borderRadius = "1rem";
|
|
901
|
-
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
window.addEventListener("resize", () => method());
|
|
906
|
-
method();
|
|
907
|
-
|
|
908
|
-
if (div) {
|
|
909
|
-
document.querySelector(div).style.padding = 0;
|
|
910
|
-
document.querySelector(div).style.margin = 0;
|
|
911
|
-
document.querySelector(div).appendChild(this.res);
|
|
912
|
-
} else {
|
|
913
|
-
return this.res; //.children[0];
|
|
914
|
-
}
|
|
915
|
-
return this.res; //.children[0];
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
// If I shrink window and open the nav animates 2x
|
|
920
|
-
|
|
921
|
-
export { UINavBar };
|