nodality 1.0.0-beta.1
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 -0
- package/dist/animator.esm.js +1 -0
- package/dist/audionew.cjs.js +1 -0
- package/dist/audionew.esm.js +1 -0
- package/dist/base.cjs.js +1 -0
- package/dist/base.esm.js +1 -0
- package/dist/betaDesktopBar.esm.js +1 -0
- package/dist/betaMobileBar.esm.js +1 -0
- package/dist/bundle.umd.js +1 -0
- package/dist/button.cjs.js +1 -0
- package/dist/button.esm.js +1 -0
- package/dist/cardGetter.cjs.js +1 -0
- package/dist/cardGetter.esm.js +1 -0
- package/dist/center.cjs.js +1 -0
- package/dist/center.esm.js +1 -0
- package/dist/checkbox.cjs.js +1 -0
- package/dist/checkbox.esm.js +1 -0
- package/dist/code.cjs.js +1 -0
- package/dist/code.esm.js +1 -0
- package/dist/container.cjs.js +1 -0
- package/dist/container.esm.js +1 -0
- package/dist/datalist.cjs.js +1 -0
- package/dist/datalist.esm.js +1 -0
- package/dist/designer.cjs.js +1 -0
- package/dist/designer.esm.js +1 -0
- package/dist/dropdown.cjs.js +1 -0
- package/dist/dropdown.esm.js +1 -0
- package/dist/elementMapper.cjs.js +1 -0
- package/dist/elementMapper.esm.js +1 -0
- package/dist/finalresult.esm.js +1 -0
- package/dist/flexCard.cjs.js +1 -0
- package/dist/flexCard.esm.js +1 -0
- package/dist/flexGrid.cjs.js +1 -0
- package/dist/flexGrid.esm.js +1 -0
- package/dist/flexRow.cjs.js +1 -0
- package/dist/flexRow.esm.js +1 -0
- package/dist/floatingInput.cjs.js +1 -0
- package/dist/floatingInput.esm.js +1 -0
- package/dist/free.cjs.js +1 -0
- package/dist/free.esm.js +1 -0
- package/dist/horizontalScroller.esm.js +1 -0
- package/dist/image.cjs.js +1 -0
- package/dist/image.esm.js +1 -0
- package/dist/imagePicker.cjs.js +1 -0
- package/dist/imagePicker.esm.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.esm.js +1 -0
- package/dist/link.cjs.js +1 -0
- package/dist/link.esm.js +1 -0
- package/dist/linkGetter.cjs.js +1 -0
- package/dist/linkGetter.esm.js +1 -0
- package/dist/metaAdder.cjs.js +1 -0
- package/dist/metaAdder.esm.js +1 -0
- package/dist/modal2025.cjs.js +1 -0
- package/dist/modal2025.esm.js +1 -0
- package/dist/multiswitchers.esm.js +1 -0
- package/dist/newNavBar.cjs.js +1 -0
- package/dist/newNavBar.esm.js +1 -0
- package/dist/picker.cjs.js +1 -0
- package/dist/picker.esm.js +1 -0
- package/dist/progress.cjs.js +1 -0
- package/dist/progress.esm.js +1 -0
- package/dist/radio.cjs.js +1 -0
- package/dist/radio.esm.js +1 -0
- package/dist/range.cjs.js +1 -0
- package/dist/range.esm.js +1 -0
- package/dist/sideBar.cjs.js +1 -0
- package/dist/sideBar.esm.js +1 -0
- package/dist/sideNavBar.cjs.js +1 -0
- package/dist/sideNavBar.esm.js +1 -0
- package/dist/simpleBar.cjs.js +1 -0
- package/dist/simpleBar.esm.js +1 -0
- package/dist/stack.cjs.js +1 -0
- package/dist/stack.esm.js +1 -0
- package/dist/table.cjs.js +1 -0
- package/dist/table.esm.js +1 -0
- package/dist/text.cjs.js +1 -0
- package/dist/text.esm.js +1 -0
- package/dist/textField.cjs.js +1 -0
- package/dist/textField.esm.js +1 -0
- package/dist/wrap.cjs.js +1 -0
- package/dist/wrap.esm.js +1 -0
- package/dist/zoomCard.cjs.js +1 -0
- package/dist/zoomCard.esm.js +1 -0
- package/layout/<head> +59 -0
- package/layout/DEADJOE +49 -0
- package/layout/DEPRECATED-PARAGRAPH.js +103 -0
- package/layout/animator.js +1915 -0
- package/layout/audio.js +145 -0
- package/layout/audionew.js +70 -0
- package/layout/base-2.js +92 -0
- package/layout/base.js +161 -0
- package/layout/betaDesktopBar.js +126 -0
- package/layout/betaMobileBar.js +293 -0
- package/layout/box.js +29 -0
- package/layout/button.js +516 -0
- package/layout/cards.js +136 -0
- package/layout/center.js +143 -0
- package/layout/checkbox.js +183 -0
- package/layout/cleanRow.js +775 -0
- package/layout/code.js +60 -0
- package/layout/container.js +1005 -0
- package/layout/custom.js +289 -0
- package/layout/divImage.js +209 -0
- package/layout/dropdown.js +154 -0
- package/layout/dropdown2025.js +152 -0
- package/layout/edit.sh +39 -0
- package/layout/emptyElement.js +21 -0
- package/layout/externalStylesheet.js +19 -0
- package/layout/flexCard.js +220 -0
- package/layout/flexGrid.js +192 -0
- package/layout/flexrow.js +866 -0
- package/layout/footer.js +83 -0
- package/layout/formComponents/custom.js +0 -0
- package/layout/formComponents/dataList.js +183 -0
- package/layout/formComponents/edit.sh +39 -0
- package/layout/formComponents/floatingInput.js +163 -0
- package/layout/formComponents/form-all.js +161 -0
- package/layout/formComponents/form.js +76 -0
- package/layout/formComponents/imagePicker.js +266 -0
- package/layout/formComponents/picker.js +208 -0
- package/layout/formComponents/radio.js +231 -0
- package/layout/formComponents/radiogroup.js +231 -0
- package/layout/formComponents/range.js +158 -0
- package/layout/free.js +232 -0
- package/layout/grid-new.js +299 -0
- package/layout/grid.js +190 -0
- package/layout/gridSwitcher.js +188 -0
- package/layout/group.js +163 -0
- package/layout/header.js +175 -0
- package/layout/hello.html +126 -0
- package/layout/horizontalScroller.js +222 -0
- package/layout/image-old.js +487 -0
- package/layout/image.js +1039 -0
- package/layout/index.js +183 -0
- package/layout/label.js +50 -0
- package/layout/link.js +1085 -0
- package/layout/list-OLD.js +0 -0
- package/layout/list.js +127 -0
- package/layout/metaAdder.js +17 -0
- package/layout/modal2025.js +142 -0
- package/layout/modernwrap.js +92 -0
- package/layout/multiswitcher.js +224 -0
- package/layout/multiswitcherBeta.js +63 -0
- package/layout/navBar-OLD.js +261 -0
- package/layout/navBar.js +371 -0
- package/layout/navFactor/customDiv.js +60 -0
- package/layout/navFactor/edit.sh +39 -0
- package/layout/newFlatAdder.js +41 -0
- package/layout/newNavBar copy 2.js +915 -0
- package/layout/newNavBar copy.js +774 -0
- package/layout/newNavBar.js +925 -0
- package/layout/offsetContainer.js +395 -0
- package/layout/progress.js +111 -0
- package/layout/remWin.sh +20 -0
- package/layout/row.js +208 -0
- package/layout/savedNewNavBar.js +437 -0
- package/layout/scrollvideo.js +120 -0
- package/layout/sideBar.js +183 -0
- package/layout/sideNavBar.js +313 -0
- package/layout/simpleBar.js +25 -0
- package/layout/slider2025.js +198 -0
- package/layout/spacer.js +44 -0
- package/layout/stack.js +76 -0
- package/layout/styler.js +113 -0
- package/layout/switcher.js +102 -0
- package/layout/table.js +155 -0
- package/layout/text.js +1685 -0
- package/layout/textField.js +282 -0
- package/layout/ulist.js +147 -0
- package/layout/video.js +70 -0
- package/layout/withoutNew.js +60 -0
- package/layout/wrap.js +140 -0
- package/layout/zoomCard.js +219 -0
- package/lib/cardGetter.js +80 -0
- package/lib/designer.js +875 -0
- package/lib/elementMapper.js +1428 -0
- package/lib/linkGetter.js +202 -0
- package/package.json +33 -0
package/layout/group.js
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {Animator} from "./animator.js";
|
|
2
|
+
|
|
3
|
+
class Group extends Animator {
|
|
4
|
+
|
|
5
|
+
constructor(els){
|
|
6
|
+
super();
|
|
7
|
+
this.setup();
|
|
8
|
+
|
|
9
|
+
if (els){
|
|
10
|
+
for (var i = 0; i < els.length; i++){
|
|
11
|
+
this.res.appendChild(els[i].render());
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
color(color){
|
|
19
|
+
for (var i = 0; i < this.res.children.length; i++){
|
|
20
|
+
this.res.children[i].style.color = color;
|
|
21
|
+
}
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
align(direction){
|
|
27
|
+
this.res.style.display = "flex";
|
|
28
|
+
this.res.style.flexDirection = "column";
|
|
29
|
+
|
|
30
|
+
if (direction === "left"){
|
|
31
|
+
this.res.style.alignItems = "flex-start"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setup(){
|
|
38
|
+
let gr = document.createElement("div");
|
|
39
|
+
gr.style.padding = 0;
|
|
40
|
+
gr.style.margin = 0;
|
|
41
|
+
this.res = gr;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
centerContent(){
|
|
45
|
+
|
|
46
|
+
this.res.style.display = "flex";
|
|
47
|
+
this.res.style.flexDirection = "column";
|
|
48
|
+
|
|
49
|
+
this.res.style.alignItems = "center";
|
|
50
|
+
this.res.style.justifyContent = "spaceAround";
|
|
51
|
+
this.res.style.width = "100vw";
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
width(w, shouldCenter){
|
|
56
|
+
this.res.style.width = w;
|
|
57
|
+
|
|
58
|
+
if (shouldCenter){
|
|
59
|
+
this.res.style.marginLeft = "auto";
|
|
60
|
+
this.res.style.marginRight = "auto";
|
|
61
|
+
}
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
background(value){
|
|
66
|
+
this.res.style.backgroundColor = value;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
padding(value){
|
|
71
|
+
this.res.style.padding = `${value}px`;
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
arrayPadding(arr, value) {
|
|
76
|
+
if (arr.includes("left")){
|
|
77
|
+
this.res.style.paddingLeft = value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (arr.includes("right")){
|
|
81
|
+
this.res.style.paddingRight = value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (arr.includes("top")){
|
|
85
|
+
this.res.style.paddingTop = value;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (arr.includes("bottom")){
|
|
89
|
+
this.res.style.paddingBottom = value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
arrayMargin(arr, value) {
|
|
97
|
+
if (arr.includes("left")){
|
|
98
|
+
this.res.style.marginLeft = value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (arr.includes("right")){
|
|
102
|
+
this.res.style.marginRight = value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (arr.includes("top")){
|
|
106
|
+
this.res.style.marginTop = value;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (arr.includes("bottom")){
|
|
110
|
+
this.res.style.marginBottom = value;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
size(w, h){
|
|
121
|
+
this.w = w;
|
|
122
|
+
this.h = h;
|
|
123
|
+
|
|
124
|
+
if (this.w){
|
|
125
|
+
this.res.style.width = this.w;
|
|
126
|
+
} else {
|
|
127
|
+
this.res.style.width = window.innerWidth;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (this.h){
|
|
131
|
+
this.res.style.height = this.h;
|
|
132
|
+
} else {
|
|
133
|
+
this.res.style.height = window.innerHeight;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
items(els){
|
|
141
|
+
for (var i = 0; i < els.length; i++){
|
|
142
|
+
this.res.appendChild(els[i].render());
|
|
143
|
+
}
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
border(color, width){
|
|
150
|
+
this.res.style.border = `${width}px solid ${color}`;
|
|
151
|
+
return this;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
render(el){
|
|
155
|
+
if (el){
|
|
156
|
+
document.querySelector(el).appendChild(this.res);
|
|
157
|
+
} else {
|
|
158
|
+
return this.res;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
export { Group };
|
package/layout/header.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import {Animator} from "./animator.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Header extends Animator {
|
|
5
|
+
constructor(){
|
|
6
|
+
super();
|
|
7
|
+
this.ele = null;
|
|
8
|
+
// this.setup();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
setup(obj){
|
|
13
|
+
let d = document.createElement("div");
|
|
14
|
+
d.style.width = "100%";
|
|
15
|
+
|
|
16
|
+
if (obj.width){
|
|
17
|
+
d.style.width = obj.width;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Add
|
|
21
|
+
d.style.marginLeft = "auto";
|
|
22
|
+
d.style.marginRight = "auto";
|
|
23
|
+
|
|
24
|
+
if (obj.height){
|
|
25
|
+
d.style.height = obj.height;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
this.ele = d;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
this.globalHeight = obj.height;
|
|
35
|
+
this.gRound = obj.round;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if (obj.url){
|
|
39
|
+
this.url(obj.url, 0, obj);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
if (obj.fixedScale){
|
|
48
|
+
|
|
49
|
+
this.ele.children[0].style.backgroundSize = "contain";
|
|
50
|
+
this.ele.children[0].style.backgroundRepeat = "no-repeat";
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if (obj.width){
|
|
54
|
+
d.style.width = obj.width;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
fadeIn(){
|
|
66
|
+
this.ele.animate(
|
|
67
|
+
[{ opacity: 0 },
|
|
68
|
+
{ opacity: 1 }],
|
|
69
|
+
{
|
|
70
|
+
duration: 1000,
|
|
71
|
+
easing: 'linear',
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
url(url, round, obj){
|
|
78
|
+
let flex = document.createElement("div");
|
|
79
|
+
flex.style.display = "flex";
|
|
80
|
+
flex.style.flexDirection = "column";
|
|
81
|
+
flex.style.justifyContent = "center";
|
|
82
|
+
flex.style.alignItems = "center";
|
|
83
|
+
flex.style.height = `${this.globalHeight}px`;
|
|
84
|
+
flex.style.width = "100%";
|
|
85
|
+
flex.style.backgroundImage = `url("${url}")`;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
if (obj.radius){
|
|
89
|
+
flex.style.borderRadius = "1.4rem";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// NEW
|
|
93
|
+
flex.style.backgroundPosition = "center";
|
|
94
|
+
|
|
95
|
+
// flex.style.filter = "blur(8px)";
|
|
96
|
+
flex.style.backgroundSize = "cover";
|
|
97
|
+
if (this.gRound) {
|
|
98
|
+
flex.style.borderRadius = `16px`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
this.ele.appendChild(flex);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
urlImage(url, round){
|
|
107
|
+
let image = document.createElement("img");
|
|
108
|
+
|
|
109
|
+
image.setAttribute("src", url);
|
|
110
|
+
image.style.filter = "blur(8px)";
|
|
111
|
+
|
|
112
|
+
if (this.gRound) {
|
|
113
|
+
image.style.borderRadius = `16px`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
this.ele.appendChild(image);
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
elements(els){
|
|
122
|
+
for (var i = 0; i < els.length; i++){
|
|
123
|
+
var res = els[i].render().render(); // TWICE RENDER HACK
|
|
124
|
+
this.ele.childNodes[0].appendChild(res);
|
|
125
|
+
//this.ele.appendChild(res);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
round(value){
|
|
134
|
+
this.ele.style.borderRadius = `${value}px`;
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
onTap(e){
|
|
140
|
+
this.ele.addEventListener("click", e);
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/*em(n){
|
|
145
|
+
this.ele.style.fontSize = `${n}em`;
|
|
146
|
+
return this;
|
|
147
|
+
}*/
|
|
148
|
+
|
|
149
|
+
render(div){
|
|
150
|
+
document.querySelector("body").style.margin = 0;
|
|
151
|
+
document.querySelector("body").style.padding = 0;
|
|
152
|
+
|
|
153
|
+
if (div){
|
|
154
|
+
document.querySelector(div).appendChild(this.ele);
|
|
155
|
+
} else {
|
|
156
|
+
return this.ele; // this.ele();
|
|
157
|
+
}
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
// ----------------------------------------------------------------
|
|
174
|
+
|
|
175
|
+
export { Header };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Right Overlay Side Navigation</title>
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
/* Basic reset */
|
|
10
|
+
* {
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/* Sidebar container */
|
|
19
|
+
.sidenav {
|
|
20
|
+
height: 100vh;
|
|
21
|
+
width: 400px; /* Full width */
|
|
22
|
+
position: fixed;
|
|
23
|
+
top: 0;
|
|
24
|
+
right: 0; /* Position sidebar on the right */
|
|
25
|
+
background-color: rgba(51, 51, 51, 0.9); /* Dark background with slight transparency */
|
|
26
|
+
transform: translateX(100%); /* Initially hidden off the screen */
|
|
27
|
+
transition: transform 0.3s ease; /* Smooth transition for sliding effect */
|
|
28
|
+
padding-top: 20px;
|
|
29
|
+
z-index: 1000; /* Ensure the sidebar overlays the content */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Sidebar links */
|
|
33
|
+
.sidenav a {
|
|
34
|
+
padding: 15px 20px;
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
font-size: 18px;
|
|
37
|
+
color: #f1f1f1;
|
|
38
|
+
display: block;
|
|
39
|
+
transition: 0.3s;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Hover effect */
|
|
43
|
+
.sidenav a:hover {
|
|
44
|
+
background-color: #575757;
|
|
45
|
+
color: #fff;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Main content */
|
|
49
|
+
.main-content {
|
|
50
|
+
padding: 20px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Button to open/close sidebar */
|
|
54
|
+
#toggleBtn {
|
|
55
|
+
font-size: 20px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
position: fixed;
|
|
58
|
+
top: 10px;
|
|
59
|
+
right: 10px; /* Position button on the right */
|
|
60
|
+
background-color: #333;
|
|
61
|
+
color: #f1f1f1;
|
|
62
|
+
padding: 10px 15px;
|
|
63
|
+
border: none;
|
|
64
|
+
z-index: 1001; /* Ensure button stays above overlay */
|
|
65
|
+
transition: 0.3s;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Style the button on hover */
|
|
69
|
+
#toggleBtn:hover {
|
|
70
|
+
background-color: #575757;
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
73
|
+
</head>
|
|
74
|
+
<body>
|
|
75
|
+
|
|
76
|
+
<!-- Toggle button -->
|
|
77
|
+
<button id="toggleBtn" onclick="toggleNav()">☰ Open Sidebar</button>
|
|
78
|
+
|
|
79
|
+
<!-- Side navigation menu -->
|
|
80
|
+
<div id="mySidenav" class="sidenav">
|
|
81
|
+
<a href="#home">Home</a>
|
|
82
|
+
<a href="#services">Services</a>
|
|
83
|
+
<a href="#clients">Clients</a>
|
|
84
|
+
<a href="#contact">Contact</a>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<!-- Main content -->
|
|
88
|
+
<div id="mainContent" class="main-content">
|
|
89
|
+
<h2>Right Overlay Side Navigation Example</h2>
|
|
90
|
+
<p>Click the button to toggle the sidebar. The sidebar will overlay the main content and slide in from the right.</p>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<script>
|
|
94
|
+
let isOpen = false;
|
|
95
|
+
|
|
96
|
+
// Toggle the sidebar open and closed
|
|
97
|
+
function toggleNav() {
|
|
98
|
+
const sidenav = document.getElementById("mySidenav");
|
|
99
|
+
const toggleBtn = document.getElementById("toggleBtn");
|
|
100
|
+
|
|
101
|
+
if (isOpen) {
|
|
102
|
+
// Close the sidebar using the animation API
|
|
103
|
+
sidenav.animate(
|
|
104
|
+
[{ transform: 'translateX(0)' }, { transform: 'translateX(100%)' }],
|
|
105
|
+
{ duration: 300, fill: 'forwards' }
|
|
106
|
+
).onfinish = function() {
|
|
107
|
+
// After the animation finishes, set the sidebar transform to off-screen
|
|
108
|
+
// sidenav.style.transform = 'translateX(100%)';
|
|
109
|
+
toggleBtn.innerHTML = "☰ Open Sidebar"; // Change button text
|
|
110
|
+
isOpen = false; // Set isOpen to false
|
|
111
|
+
};
|
|
112
|
+
} else {
|
|
113
|
+
// Open the sidebar immediately
|
|
114
|
+
sidenav.style.transform = 'translateX(0)';
|
|
115
|
+
sidenav.animate(
|
|
116
|
+
[{ transform: 'translateX(100%)' }, { transform: 'translateX(0)' }],
|
|
117
|
+
{ duration: 300, fill: 'forwards' }
|
|
118
|
+
);
|
|
119
|
+
toggleBtn.innerHTML = "✖ Close Sidebar"; // Change button text
|
|
120
|
+
isOpen = true; // Set isOpen to true
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import {Animator} from "./animator.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class HScroller {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.setupa();
|
|
7
|
+
// this.seto();
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
seto(obj){
|
|
12
|
+
this.e = obj.a;
|
|
13
|
+
|
|
14
|
+
obj.speed && (this.divisor = obj.speed);
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setupa(){
|
|
19
|
+
this.parallaxIDs(["#rta"]);
|
|
20
|
+
this.divisor(1.0);
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
add(items){
|
|
25
|
+
this.items = items;
|
|
26
|
+
this.setup();
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
parallaxIDs(ids){
|
|
32
|
+
this.parallaxIDs = ids;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
divisor(divi){
|
|
37
|
+
this.divisor = divi;
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setup() {
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// alert(this.e);
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
this.pts = 0;
|
|
49
|
+
|
|
50
|
+
let wrap = document.createElement("div");
|
|
51
|
+
wrap.style.width = "100%";
|
|
52
|
+
wrap.style.height = "100%";
|
|
53
|
+
|
|
54
|
+
let div = document.createElement("div");//document.querySelector("div");
|
|
55
|
+
div.style.display = "flex";
|
|
56
|
+
div.style.width = "100%";
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
for (var i = 0; i < this.items.length; i++) {
|
|
61
|
+
let t = this.items[i].render(); /* new Text("Hello")
|
|
62
|
+
.set({
|
|
63
|
+
fluidc: "S1",
|
|
64
|
+
background: "orange",
|
|
65
|
+
font: "Arial"
|
|
66
|
+
}).render();*/
|
|
67
|
+
div.appendChild(t);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
wrap.appendChild(div);
|
|
71
|
+
|
|
72
|
+
let pts = window.localStorage.getItem("pts");
|
|
73
|
+
if (pts !== null){
|
|
74
|
+
this.pts = pts;
|
|
75
|
+
} // 16:36:39 10/03/24
|
|
76
|
+
|
|
77
|
+
wrap.addEventListener("wheel", (event) => {
|
|
78
|
+
// console.log("SL" + event.deltaY);
|
|
79
|
+
// console.log("SLA" + event.scrollLeft);
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
if (event.deltaY < 0) {
|
|
83
|
+
console.log('Scrolling up');
|
|
84
|
+
this.pts--;
|
|
85
|
+
} else if (event.deltaY > 0) {
|
|
86
|
+
console.log('Scrolling down');
|
|
87
|
+
this.pts++;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
window.localStorage.setItem("pts", this.pts);
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
|
|
93
|
+
for (var i = 0; i < div.childNodes.length; i++) {
|
|
94
|
+
console.log(div.childNodes[i].toString().substr(7));
|
|
95
|
+
|
|
96
|
+
let child = div.childNodes[i];
|
|
97
|
+
|
|
98
|
+
let parallax = this.parallaxIDs; //["#rta"];
|
|
99
|
+
if (parallax.includes(child.id)){
|
|
100
|
+
child.style.transform = `translateX(${this.pts / this.divisor}%)`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
div.style.transform = `translateX(${this.pts / this.divisor}%)`;
|
|
105
|
+
window.localStorage.setItem("translation", this.pts / this.divisor);
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
let t = window.localStorage.getItem("translation");
|
|
111
|
+
if (t !== null){
|
|
112
|
+
div.style.transform = `translateX(${t}%)`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Make this vertical on mobile, scrolling won't work
|
|
116
|
+
// Simple CSS rule
|
|
117
|
+
// Don't complicate too much
|
|
118
|
+
this.div = wrap;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
render(div) {
|
|
122
|
+
if (div) {
|
|
123
|
+
document.querySelector(div).appendChild(this.div);
|
|
124
|
+
} else {
|
|
125
|
+
return this.div;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// document.body.appendChild(this.div);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* new T()
|
|
133
|
+
.parallaxIDs(["#rta"])
|
|
134
|
+
.divisor(2.2)
|
|
135
|
+
.add([
|
|
136
|
+
|
|
137
|
+
// Nest more views
|
|
138
|
+
new Text("Sail")
|
|
139
|
+
.set({
|
|
140
|
+
color: "#1abc9c",
|
|
141
|
+
fluidc: "S1",
|
|
142
|
+
font: "Arial",
|
|
143
|
+
stroke: {range:["0px","3000px"],op:{name:"blast",color:"#1abc9c",width:"3px"}}
|
|
144
|
+
}),
|
|
145
|
+
|
|
146
|
+
new Text("Wave").set({
|
|
147
|
+
em: 10,
|
|
148
|
+
font: "Arial",
|
|
149
|
+
weight: "bold",
|
|
150
|
+
zIndex: -1,
|
|
151
|
+
absolute: true,
|
|
152
|
+
stroke: {range:["0px","3000px"],op:{name:"blast",color:"#a1dae330",width:"3px"}},
|
|
153
|
+
opacity: 0.6
|
|
154
|
+
}),
|
|
155
|
+
|
|
156
|
+
new Text("the")
|
|
157
|
+
.set({
|
|
158
|
+
color: "#1abc9c",
|
|
159
|
+
fluidc: "S1",
|
|
160
|
+
// background: "orange",
|
|
161
|
+
font: "Arial",
|
|
162
|
+
arrayMargin: {sides: ["top"], value: "3rem"},
|
|
163
|
+
stroke: {range:["0px","3000px"],op:{name:"blast",color:"#1abc9c",width:"3px"}}
|
|
164
|
+
}),
|
|
165
|
+
|
|
166
|
+
new Image("https://media.cnn.com/api/v1/images/stellar/prod/ap24002766263400.jpg?c=original")
|
|
167
|
+
.set({
|
|
168
|
+
width: "400px",
|
|
169
|
+
height: "100%",
|
|
170
|
+
arrayMargin: {sides: ["left", "bottom"], value: "-1.7rem"},
|
|
171
|
+
arrpad: {sides: ["top"], value: "3rem"},
|
|
172
|
+
opacity: 0.7,
|
|
173
|
+
zIndex: -1,
|
|
174
|
+
id: "#rta"
|
|
175
|
+
}),
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
new Wrapper().set({}).add([
|
|
179
|
+
new Text("Seven seas")
|
|
180
|
+
.set({
|
|
181
|
+
fluidc: "S1",
|
|
182
|
+
color: "#1abc9c",
|
|
183
|
+
font: "Arial"
|
|
184
|
+
}),
|
|
185
|
+
|
|
186
|
+
new Text("This is wonderful offer")
|
|
187
|
+
]),
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
new Text("Welcome")
|
|
191
|
+
.set({
|
|
192
|
+
fluidc: "S1",
|
|
193
|
+
// background: "orange",
|
|
194
|
+
font: "Arial"
|
|
195
|
+
}),
|
|
196
|
+
|
|
197
|
+
new Text("onboard")
|
|
198
|
+
.set({
|
|
199
|
+
fluidc: "S1",
|
|
200
|
+
// background: "orange",
|
|
201
|
+
font: "Arial"
|
|
202
|
+
}),
|
|
203
|
+
|
|
204
|
+
new Wrapper().set({}).add([
|
|
205
|
+
new Text("Get in touch.")
|
|
206
|
+
.set({
|
|
207
|
+
fluidc: "S1",
|
|
208
|
+
// background: "orange",
|
|
209
|
+
font: "Arial"
|
|
210
|
+
}),
|
|
211
|
+
|
|
212
|
+
new Image("https://media.cnn.com/api/v1/images/stellar/prod/ap24002766263400.jpg?c=original")
|
|
213
|
+
.set({
|
|
214
|
+
width: "400px",
|
|
215
|
+
opacity: 0.7,
|
|
216
|
+
zIndex: -1
|
|
217
|
+
}),
|
|
218
|
+
]),
|
|
219
|
+
])
|
|
220
|
+
.render();
|
|
221
|
+
*/
|
|
222
|
+
export { HScroller };
|