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/lib/designer.js
ADDED
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
/* Classes:
|
|
2
|
+
ElementMapper
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// NEXT STEPS = FreeLayout
|
|
6
|
+
import {ElementMapper} from "../lib/elementMapper.js";
|
|
7
|
+
import {Animator} from "../layout/animator.js";
|
|
8
|
+
import {Text} from "../layout/text.js";
|
|
9
|
+
import {Image} from "../layout/image.js";
|
|
10
|
+
import {Link} from "../layout/link.js";
|
|
11
|
+
import {FlexRow} from "../layout/flexRow.js"; // Yes! 00:50:30 14/04 add them all here
|
|
12
|
+
import { UINavBar } from "../layout/newNavBar.js";
|
|
13
|
+
import { Free } from "../layout/free.js";
|
|
14
|
+
import { Audio } from "../layout/audionew.js";
|
|
15
|
+
import { Progress } from "../layout/progress.js";
|
|
16
|
+
import { Center } from "../layout/center.js";
|
|
17
|
+
import { Code } from "../layout/code.js";
|
|
18
|
+
//import { Link } from "../layout/link.js";
|
|
19
|
+
import { Stack } from "../layout/stack.js";
|
|
20
|
+
import { Wrapper } from "../layout/container.js";
|
|
21
|
+
import { MetaAdder } from "../layout/metaAdder.js";
|
|
22
|
+
import { Table } from "../layout/table.js";
|
|
23
|
+
import { Dropdown } from "../layout/dropdown2025.js";
|
|
24
|
+
import { Modal } from "../layout/modal2025.js";
|
|
25
|
+
import { TextField } from "../layout/textField.js";
|
|
26
|
+
import { Card } from "../layout/flexCard.js";
|
|
27
|
+
//import { NavBar } from "../layout/navBar.js";
|
|
28
|
+
import { Wrap } from "../layout/wrap.js";
|
|
29
|
+
import { FlexGrid } from "../layout/flexGrid.js";
|
|
30
|
+
import { ZoomCard } from "../layout/zoomCard.js";
|
|
31
|
+
import { /*Multi*/Switcher } from "../layout/multiswitcher.js";
|
|
32
|
+
import { /*Beta*/MobileBar } from "../layout/betaMobileBar.js";
|
|
33
|
+
import { /*Beta*/DesktopBar } from "../layout/betaDesktopBar.js";
|
|
34
|
+
import { SideNav } from "../layout/sideNavBar.js";
|
|
35
|
+
import { Spacer } from "../layout/spacer.js";
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
// FORM COMPONENTS
|
|
39
|
+
import { FloatingInput } from "../layout/formComponents/floatingInput.js";
|
|
40
|
+
import { Range } from "../layout/formComponents/range.js";
|
|
41
|
+
import { RadioGroup } from "../layout/formComponents/radio.js";
|
|
42
|
+
import { Picker } from "../layout/formComponents/picker.js";
|
|
43
|
+
import { FilePickera } from "../layout/formComponents/imagePicker.js";
|
|
44
|
+
import { DataList } from "../layout/formComponents/dataList.js";
|
|
45
|
+
import { Base } from "../layout/base.js";
|
|
46
|
+
import { Form } from "../layout/formComponents/form.js";
|
|
47
|
+
import { Button } from "../layout/button.js";
|
|
48
|
+
import { Slider } from "../layout/slider2025.js";
|
|
49
|
+
import { Video } from "../layout/video.js";
|
|
50
|
+
import { Checkbox } from "../layout/checkbox.js";
|
|
51
|
+
import { LinkStyler } from "../lib/linkGetter.js";
|
|
52
|
+
import { CardGen } from "../lib/cardGetter.js";
|
|
53
|
+
import {Simple} from "../layout/gridSwitcher.js";
|
|
54
|
+
|
|
55
|
+
// Audio, progress, TextField, import navFactor
|
|
56
|
+
class Des {
|
|
57
|
+
constructor() {
|
|
58
|
+
this.items = [];
|
|
59
|
+
this.options = [];
|
|
60
|
+
this.code = [];
|
|
61
|
+
this.ready2Render = [];
|
|
62
|
+
this.stor = {
|
|
63
|
+
text:
|
|
64
|
+
{
|
|
65
|
+
miami: {
|
|
66
|
+
code: `new Text("Hello").set({fluidc: "S3", color: "orange"})`,
|
|
67
|
+
},
|
|
68
|
+
base: {
|
|
69
|
+
code: `new Text("Hello").set({fluidc: "S3", color: "orange"})`,
|
|
70
|
+
},
|
|
71
|
+
nepal: {
|
|
72
|
+
code: `new Text("Hello").set({fluidc: "S3", color: "#2ECC71", font: "Helvetica Neue"})`,
|
|
73
|
+
},
|
|
74
|
+
patagonia: {
|
|
75
|
+
code: `new Text("Hello").set({fluidc: "S3", color: "#3498DB", font: "DIN Alternate"})`,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
complexa: {
|
|
80
|
+
code: `new Wrapper()
|
|
81
|
+
.set({...}) // Rest of the code omitted for brevity`
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
complex: {
|
|
85
|
+
code: `new Wrapper()
|
|
86
|
+
.set({...}) // Rest of the code omitted for brevity`
|
|
87
|
+
}, ops: {
|
|
88
|
+
miami: {
|
|
89
|
+
blast: {
|
|
90
|
+
code: `stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"3px"}}`,
|
|
91
|
+
},
|
|
92
|
+
blastFun: (val) => {
|
|
93
|
+
return `stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"${val}px"}}`;
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
nepal: {
|
|
97
|
+
blast: {
|
|
98
|
+
code: `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"3px"}}`,
|
|
99
|
+
},
|
|
100
|
+
blastFun: (val) => {
|
|
101
|
+
return `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"${val}px"}}`;
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
patagonia: {
|
|
105
|
+
blast: {
|
|
106
|
+
code: `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"3px"}}`,
|
|
107
|
+
},
|
|
108
|
+
blastFun: (val) => {
|
|
109
|
+
return `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"${val}px"}}`;
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
link: {
|
|
115
|
+
miami: {
|
|
116
|
+
code: `new Link("Link").set({text: "Hello", url: "#a", background: "", color: "orange", hover: {color: "white", background: "orange", animation: 0.6}, borderObj: {color: "orange", width: "3px", radius: "0.7rem"}, pad: { sides: ["all"], value: "0.6rem" }, arrayMargin: { sides: ["top", "bottom"], value: "0.8rem" }, radius: "0.4rem"})`,
|
|
117
|
+
},
|
|
118
|
+
base: {
|
|
119
|
+
code: `new Link("Link").set({text: "Hello", url: "#ai", background: "#3498db", pad: [{lr: "0.5rem", tb: "1rem"}], radius: "0.4rem", color: "white"})`,
|
|
120
|
+
},
|
|
121
|
+
nepal: {
|
|
122
|
+
code: `new Link("Link").set({text: "Hello", url: "#a", background: "#2ECC71", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})`,
|
|
123
|
+
},
|
|
124
|
+
patagonia: {
|
|
125
|
+
code: `new Link("Link", "#a").set({text: "Hello", url: "#a", background: "#1ABC9C", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})`,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
grid: {
|
|
130
|
+
code: `new Simple().set({...}).react([...]).add([...])`, // Rest omitted for brevity
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
flexRow: (colat) => ({
|
|
134
|
+
image: {
|
|
135
|
+
code: `new FlexRow().set({border: ["all", "3px"], colat: "600px"}).items([new Image(...), new Image(...), new Image(...)])`,
|
|
136
|
+
},
|
|
137
|
+
text: {
|
|
138
|
+
code: `new FlexRow().set({...}).items([new Text(...), new Text(...), new Text(...)])`,
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
|
|
142
|
+
tabSpace : (len) => {
|
|
143
|
+
return ' '.repeat(len);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
at(opts) {
|
|
153
|
+
this.options.push(opts);
|
|
154
|
+
return this;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
nodes(arr) {
|
|
158
|
+
this.options = arr;
|
|
159
|
+
this.protoOptions = [...arr];
|
|
160
|
+
console.log(this.options);
|
|
161
|
+
console.log(this.protoOptions);
|
|
162
|
+
return this;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
getElType(type) {
|
|
166
|
+
return `S${type.substr(1)}`;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// What if there is multiple objects?
|
|
170
|
+
filtero(name, id, customOptions) {
|
|
171
|
+
// console.warn(customOptions
|
|
172
|
+
// .filter(l => l.op.name === name));
|
|
173
|
+
let aro = customOptions
|
|
174
|
+
.filter(l => l.op.name === name)
|
|
175
|
+
.filter(l => {
|
|
176
|
+
if (l.target) {
|
|
177
|
+
return l.target.includes(id)
|
|
178
|
+
} else {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
return aro[0];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
add(arr) {
|
|
187
|
+
|
|
188
|
+
this.css = [];
|
|
189
|
+
this.elCSS = [];
|
|
190
|
+
this.elHTML = [];
|
|
191
|
+
|
|
192
|
+
let customOptions = this.options;
|
|
193
|
+
//console.log("COO");
|
|
194
|
+
//console.log(customOptions);
|
|
195
|
+
for (var i = 0; i < arr.length; i++) {
|
|
196
|
+
let el = arr[i];
|
|
197
|
+
let ela = null;
|
|
198
|
+
|
|
199
|
+
let ops = ["blast", "gradient", "shadow", "filter", "animationSimple", "transform"];
|
|
200
|
+
let replacementObjects = [
|
|
201
|
+
{
|
|
202
|
+
// range: ["0px", "1900px"],
|
|
203
|
+
op: {
|
|
204
|
+
name: "blast",
|
|
205
|
+
color: "green",
|
|
206
|
+
width: "1px"
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
{ // 18:00:08 OK!!! 25/04/2025
|
|
211
|
+
|
|
212
|
+
op: {
|
|
213
|
+
name: "gradient",
|
|
214
|
+
// gradient: "linear-gradient(#3498db,#1abc9c)"
|
|
215
|
+
gradient: "linear-gradient(orange, green)"
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
{
|
|
221
|
+
|
|
222
|
+
op: {
|
|
223
|
+
name: "shadow",
|
|
224
|
+
color: "#1abc9c",
|
|
225
|
+
steps: 3
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
{
|
|
230
|
+
// range: ["0px", "2000px"],
|
|
231
|
+
op: {
|
|
232
|
+
name: "filter",
|
|
233
|
+
filter: "grayscale(0.7)"
|
|
234
|
+
}, // shadow resets filter so that's okay
|
|
235
|
+
//target: ["#imga", "#eimga"]
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
{
|
|
239
|
+
op: {
|
|
240
|
+
name: "animation",
|
|
241
|
+
color: "green",
|
|
242
|
+
width: "1px",
|
|
243
|
+
fireAt: "inview",
|
|
244
|
+
keyframesOpen: [{
|
|
245
|
+
transform: "translate(100%, 0%)",
|
|
246
|
+
opacity: 0
|
|
247
|
+
}, {
|
|
248
|
+
transform: "translate(0%)",
|
|
249
|
+
opacity: 1
|
|
250
|
+
}],
|
|
251
|
+
keyframesClose: [{
|
|
252
|
+
transform: "translate(0%)",
|
|
253
|
+
opacity: 1
|
|
254
|
+
}, {
|
|
255
|
+
transform: "translate(100%, 0%)",
|
|
256
|
+
opacity: 0
|
|
257
|
+
}],
|
|
258
|
+
openOptions: {
|
|
259
|
+
duration: 300,
|
|
260
|
+
fill: "forwards",
|
|
261
|
+
delay: 1000
|
|
262
|
+
},
|
|
263
|
+
closeOptions: {
|
|
264
|
+
duration: 1,
|
|
265
|
+
fill: "forwards",
|
|
266
|
+
delay: 1000
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
{
|
|
272
|
+
op: {
|
|
273
|
+
name: "transform",
|
|
274
|
+
values: [ // This can be empty or have any order of values
|
|
275
|
+
"ty:-20px",
|
|
276
|
+
"scale(3)",
|
|
277
|
+
"rotate(30deg)",
|
|
278
|
+
"skew(40deg, 0deg)",
|
|
279
|
+
"perspective(500px)",
|
|
280
|
+
"matrix(1, 0, 0, 1, 50, 50)"
|
|
281
|
+
],
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
];
|
|
285
|
+
|
|
286
|
+
/*console.log("OPS");
|
|
287
|
+
console.log(ops);
|
|
288
|
+
|
|
289
|
+
console.log("CUSTOM OPTIONS");
|
|
290
|
+
console.log(customOptions);
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
for (var q = 0; q < ops.length; q++) {
|
|
295
|
+
let blastIDs = customOptions.map(l => l.op)
|
|
296
|
+
.map((value, index) => value === ops[q] ? index : '').filter(String);
|
|
297
|
+
|
|
298
|
+
if (blastIDs.length > 0) {
|
|
299
|
+
for (var d = 0; d < blastIDs.length; d++) {
|
|
300
|
+
let index = blastIDs[d];
|
|
301
|
+
// should run only once once but the next should not disappear
|
|
302
|
+
let target = customOptions[index].target;
|
|
303
|
+
let range = customOptions[index].range;
|
|
304
|
+
let filter = customOptions[index].filter;
|
|
305
|
+
let gradient = customOptions[index].gradient;
|
|
306
|
+
|
|
307
|
+
let as = replacementObjects[q];
|
|
308
|
+
as.target = target;
|
|
309
|
+
|
|
310
|
+
if (range != null) {
|
|
311
|
+
as.range = range;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Do this for all
|
|
315
|
+
if (filter != null) { // This works!!!
|
|
316
|
+
as.op.filter = filter;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (gradient != null) {
|
|
320
|
+
as.op.gradient = gradient;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
customOptions[index] = as;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
console.warn(customOptions);
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
for (var q = 0; q < customOptions.length; q++) {
|
|
333
|
+
let option = customOptions[q].op.name;
|
|
334
|
+
|
|
335
|
+
let cool = this.protoOptions[q].style || "default";
|
|
336
|
+
let duration = this.protoOptions[q].duration || "default";
|
|
337
|
+
|
|
338
|
+
if (option === "transform") {
|
|
339
|
+
let opts = [];
|
|
340
|
+
|
|
341
|
+
if (cool === "SOLARIUM") {
|
|
342
|
+
|
|
343
|
+
opts = [ // This can be empty or have any order of values
|
|
344
|
+
"scale(3)"
|
|
345
|
+
];
|
|
346
|
+
|
|
347
|
+
} else if (cool === "WAVE") {
|
|
348
|
+
opts = [
|
|
349
|
+
"skew(15deg, 0deg)",
|
|
350
|
+
"tx:50px",
|
|
351
|
+
"rotate(10deg)",
|
|
352
|
+
"scale(1.1)"
|
|
353
|
+
];
|
|
354
|
+
} else if (cool === "CUBE-SPIN") { // works
|
|
355
|
+
opts = [
|
|
356
|
+
// "rotate(90deg, 90deg)", TWO VALUES ROTATE PROBLEM
|
|
357
|
+
"perspective(700px)",
|
|
358
|
+
"scale(0.9)"
|
|
359
|
+
];
|
|
360
|
+
} else if (cool === "TORNADO-SWITCH") { // not working
|
|
361
|
+
opts = [
|
|
362
|
+
"rotate(720deg)",
|
|
363
|
+
"scale(0.8)",
|
|
364
|
+
"tx:30px",
|
|
365
|
+
"ty:-50px",// NOT WORKINg WITH TY
|
|
366
|
+
"tz:-80px"
|
|
367
|
+
// "skew(10deg, 0deg)"
|
|
368
|
+
];
|
|
369
|
+
} else if (cool === "LASER-SWEEP") {
|
|
370
|
+
// alert("P")
|
|
371
|
+
opts = [
|
|
372
|
+
|
|
373
|
+
"tx:100px",
|
|
374
|
+
"opacity:0.2",
|
|
375
|
+
"scale(1.2, 1.0)"
|
|
376
|
+
|
|
377
|
+
];
|
|
378
|
+
} else if (cool === "TORNADO-TWIST") {
|
|
379
|
+
opts = [
|
|
380
|
+
"rotate(720deg)",
|
|
381
|
+
"scale(0.8)",
|
|
382
|
+
"tx:30px",
|
|
383
|
+
"ty:-50px",
|
|
384
|
+
"skew(10deg, 0deg)"
|
|
385
|
+
];
|
|
386
|
+
}
|
|
387
|
+
else if (cool === "JELLY-WOBBLE") {
|
|
388
|
+
opts = [
|
|
389
|
+
"scale(1.2, 0.8)",
|
|
390
|
+
"rotate(5deg)",
|
|
391
|
+
"ty:-10px",
|
|
392
|
+
"skew(5deg, 0deg)"
|
|
393
|
+
];
|
|
394
|
+
}
|
|
395
|
+
else if (cool === "DRUNKEN-SWAY") {
|
|
396
|
+
opts = [
|
|
397
|
+
"rotate(15deg)",
|
|
398
|
+
"tx:20px",
|
|
399
|
+
"ty:-10px",
|
|
400
|
+
"skew(10deg, 5deg)"
|
|
401
|
+
];
|
|
402
|
+
}
|
|
403
|
+
else if (cool === "FLAME-FLICKER") {
|
|
404
|
+
opts = [
|
|
405
|
+
"scale(1.1, 0.9)",
|
|
406
|
+
"rotate(-5deg)",
|
|
407
|
+
"ty:5px",
|
|
408
|
+
"opacity:0.7"
|
|
409
|
+
];
|
|
410
|
+
}
|
|
411
|
+
else if (cool === "PHANTOM-SHIFT") {
|
|
412
|
+
opts = [
|
|
413
|
+
"tx:15px",
|
|
414
|
+
"ty:-5px",
|
|
415
|
+
"opacity:0.5",
|
|
416
|
+
"skew(5deg, 5deg)"
|
|
417
|
+
];
|
|
418
|
+
}
|
|
419
|
+
else if (cool === "RUBBER-BOUNCE") {
|
|
420
|
+
opts = [
|
|
421
|
+
"scale(1.3, 0.8)",
|
|
422
|
+
"skew(10deg, 0deg)",
|
|
423
|
+
"ty:-20px"
|
|
424
|
+
];
|
|
425
|
+
}
|
|
426
|
+
else if (cool === "ASTEROID-CRASH") {
|
|
427
|
+
opts = [
|
|
428
|
+
"tx:-80px",
|
|
429
|
+
"ty:100px",
|
|
430
|
+
"rotate(45deg)",
|
|
431
|
+
"scale(0.7)",
|
|
432
|
+
"opacity:0.5"
|
|
433
|
+
];
|
|
434
|
+
}
|
|
435
|
+
else if (cool === "CYBER-GLITCH") {
|
|
436
|
+
opts = [
|
|
437
|
+
"tx:5px",
|
|
438
|
+
"ty:-5px",
|
|
439
|
+
"rotate(3deg)",
|
|
440
|
+
"opacity:0.6",
|
|
441
|
+
"scale(1.05)"
|
|
442
|
+
];
|
|
443
|
+
}
|
|
444
|
+
else if (cool === "BUBBLE-POP") {
|
|
445
|
+
opts = [
|
|
446
|
+
"scale(1.5)",
|
|
447
|
+
"opacity:0.3",
|
|
448
|
+
"ty:-20px"
|
|
449
|
+
];
|
|
450
|
+
}
|
|
451
|
+
else if (cool === "SUPERNOVA-BURST") {
|
|
452
|
+
opts = [
|
|
453
|
+
"scale(2)",
|
|
454
|
+
"opacity:0",
|
|
455
|
+
"tx:50px",
|
|
456
|
+
"ty:-50px"
|
|
457
|
+
];
|
|
458
|
+
}
|
|
459
|
+
else if (cool === "GRAVITY-DROP") {
|
|
460
|
+
opts = [
|
|
461
|
+
"ty:100px",
|
|
462
|
+
"scale(0.8)",
|
|
463
|
+
"rotate(10deg)",
|
|
464
|
+
"skew(0deg, 10deg)"
|
|
465
|
+
];
|
|
466
|
+
}
|
|
467
|
+
else if (cool === "LASER-SWEEP") {
|
|
468
|
+
opts = [
|
|
469
|
+
"tx:100px",
|
|
470
|
+
"opacity:0.2",
|
|
471
|
+
"scale(1.2, 1.0)"
|
|
472
|
+
];
|
|
473
|
+
}
|
|
474
|
+
else if (cool === "VORTEX-SINK") {
|
|
475
|
+
opts = [
|
|
476
|
+
"rotate(-360deg)",
|
|
477
|
+
"scale(0.5)",
|
|
478
|
+
"ty:50px"
|
|
479
|
+
];
|
|
480
|
+
}
|
|
481
|
+
else if (cool === "SHOCKWAVE") {
|
|
482
|
+
opts = [
|
|
483
|
+
"scale(1.7)",
|
|
484
|
+
"opacity:0.4",
|
|
485
|
+
"skew(5deg, 5deg)"
|
|
486
|
+
];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
else {
|
|
490
|
+
opts = [ // This can be empty or have any order of values
|
|
491
|
+
"ty:-20px",
|
|
492
|
+
"scale(3)",
|
|
493
|
+
"rotate(30deg)",
|
|
494
|
+
"skew(40deg, 0deg)",
|
|
495
|
+
"perspective(500px)",
|
|
496
|
+
"matrix(1, 0, 0, 1, 50, 50)"
|
|
497
|
+
];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
if (duration === "default"){
|
|
501
|
+
duration = "MEDIUM";
|
|
502
|
+
}
|
|
503
|
+
if (duration === "FAST") {
|
|
504
|
+
duration = "3s-ease-in-out"; // divide entered value by two
|
|
505
|
+
// 6s is for both leaving and entering
|
|
506
|
+
} else if (duration === "MEDIUM"){
|
|
507
|
+
duration = "6s-ease-in-out";
|
|
508
|
+
} else if (duration === "SLOW"){
|
|
509
|
+
duration = "10s-ease-in-out";
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
if (q == i){ // 23:07.20 Nice!!!! 23:04 bef
|
|
514
|
+
|
|
515
|
+
console.log("DURA");
|
|
516
|
+
console.log(duration);
|
|
517
|
+
|
|
518
|
+
customOptions[q].op.transform = {
|
|
519
|
+
values: opts,
|
|
520
|
+
duration: duration
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
let key = "style"; // The key you want to remove
|
|
524
|
+
|
|
525
|
+
let dur = "duration"; // The key you want to remove
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
// 15:07:47 Nice 02/04/25
|
|
529
|
+
if (customOptions[q]?.op && key in customOptions[q].op) {
|
|
530
|
+
delete customOptions[q].op[key]; // remove in both logs, weird
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (customOptions[q]?.op && dur in customOptions[q].op) {
|
|
534
|
+
delete customOptions[q].op[dur]; // remove in both logs, weird
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
console.log("COQ");
|
|
538
|
+
console.log(customOptions[q].op.values);
|
|
539
|
+
if (customOptions[q]?.op.values){
|
|
540
|
+
|
|
541
|
+
// alert("P")
|
|
542
|
+
|
|
543
|
+
let values = "values";
|
|
544
|
+
|
|
545
|
+
if (customOptions[q]?.op.values) {
|
|
546
|
+
delete customOptions[q].op[values]; // remove in both logs, weird
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
}
|
|
559
|
+
} // for q = cycle end
|
|
560
|
+
|
|
561
|
+
console.log(`----------------------------LLL ${i} ${customOptions.length}`);
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
const matchEls = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(el.type) || el.type === "img" || el.type === "a" || /*el.type == "modal" ||*/ el.type == "slider" || el.type == "table";
|
|
565
|
+
|
|
566
|
+
if (matchEls) {
|
|
567
|
+
|
|
568
|
+
ela = ElementMapper.mapType({
|
|
569
|
+
el: el,
|
|
570
|
+
customOptions: customOptions,
|
|
571
|
+
i: i
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
if (ela.toCode){
|
|
575
|
+
this.code.push(ela.toCode().join(""));
|
|
576
|
+
} else {
|
|
577
|
+
this.code.push(ela);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
this.ready2Render.push(ela);
|
|
581
|
+
ela = ela.render();
|
|
582
|
+
|
|
583
|
+
} else if (el.type === "grid") {
|
|
584
|
+
this.code.push(
|
|
585
|
+
this.stor.grid.code
|
|
586
|
+
);
|
|
587
|
+
} else if (el.type === "modal"){
|
|
588
|
+
this.code.push(`new Code()
|
|
589
|
+
.set({
|
|
590
|
+
pad: [
|
|
591
|
+
{ l: 30 },
|
|
592
|
+
],
|
|
593
|
+
mar: [
|
|
594
|
+
{ a: 30 },
|
|
595
|
+
],
|
|
596
|
+
class: "language-js",
|
|
597
|
+
code: \`
|
|
598
|
+
// You need to copy and paste this example
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
import {Animator} from "../layout/animator.js";
|
|
602
|
+
import {Text} from "../layout/text.js";
|
|
603
|
+
import {Modal} from "../layout/modal2025.js";
|
|
604
|
+
import {Stack} from "../layout/stack.js";
|
|
605
|
+
import {Image} from "../layout/image.js";
|
|
606
|
+
import {FlexRow} from "../layout/flexrow.js";
|
|
607
|
+
import {Button} from "../layout/button.js";
|
|
608
|
+
import {Spacer} from "../layout/spacer.js";
|
|
609
|
+
import {Wrapper} from "../layout/container.js";
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
let firstLong = "Apple today announced that the company has surpassed a 60 percent reduction in its global greenhouse gas emissions compared to 2015 levels, as part of its Apple 2030 goal to become carbon neutral across its entire footprint in the next five years. The company achieved several other major environmental milestones, including the use of 99 percent recycled rare earth elements in all magnets and 99 percent recycled cobalt in all Apple-designed batteries.1 Apple shared this and other progress in its annual Environmental Progress Report, published today.
|
|
613
|
+
“We’re incredibly proud of the progress we’re making toward Apple 2030, which touches every part of our business,” said Lisa Jackson, Apple’s vice president of Environment, Policy, and Social Initiatives. “Today, we’re using more clean energy and recycled materials to make our products than ever before, we’re preserving water and preventing waste around the world, and we’re investing big in nature. As we get closer to 2030, the work gets even harder — and we’re meeting the challenge with innovation, collaboration, and urgency.
|
|
614
|
+
Apple’s 2030 strategy prioritizes cutting greenhouse gas emissions by 75 percent compared with its 2015 baseline year, before applying high-quality carbon credits to balance the remaining emissions. Last year, Apple’s comprehensive efforts to reduce its carbon footprint — including the continued transition of its supply chain to renewable electricity and designing products with more recycled materials — avoided an estimated 41 million metric tons of greenhouse gas emissions.";
|
|
615
|
+
|
|
616
|
+
let elements = [
|
|
617
|
+
new Stack()
|
|
618
|
+
.setup({})
|
|
619
|
+
.add([
|
|
620
|
+
new Image("https://pbs.twimg.com/media/DwYvbCBVAAEKY_R.jpg").set({}),
|
|
621
|
+
|
|
622
|
+
new FlexRow().set({aligns: "start"}).items([
|
|
623
|
+
|
|
624
|
+
new Button("×")
|
|
625
|
+
|
|
626
|
+
.set({
|
|
627
|
+
fluidc: "S3",
|
|
628
|
+
onTap: () => modal.close(),
|
|
629
|
+
frame: { width: 80, height: 80 },
|
|
630
|
+
color: "white",
|
|
631
|
+
background: "none"
|
|
632
|
+
}),
|
|
633
|
+
|
|
634
|
+
new Spacer(true),
|
|
635
|
+
])
|
|
636
|
+
]),
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
new Text("Samuel Suresh")
|
|
640
|
+
.set({
|
|
641
|
+
color: "#00ae56",
|
|
642
|
+
font: "SF Pro Display",
|
|
643
|
+
fluidc: "S2",
|
|
644
|
+
pad: [{"tl": 20}]
|
|
645
|
+
}),
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
new Text("Studying Science and Business, Western Sydney University, class of 2022")
|
|
649
|
+
.set({
|
|
650
|
+
font: "Arial",
|
|
651
|
+
fluidc: "S6",
|
|
652
|
+
pad: [{"l": 20}]
|
|
653
|
+
}),
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
new Text(firstLong)
|
|
657
|
+
.set({
|
|
658
|
+
font: "Arial",
|
|
659
|
+
fluidc: "S6",
|
|
660
|
+
pad: [{"l": 20}]
|
|
661
|
+
}),
|
|
662
|
+
];
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
let wrapper = new Wrapper()
|
|
666
|
+
.set({})
|
|
667
|
+
.add(elements);
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
let modal = new Modal();
|
|
671
|
+
modal
|
|
672
|
+
.set({
|
|
673
|
+
width: "600px",
|
|
674
|
+
background: "#469d73cc",
|
|
675
|
+
close: true
|
|
676
|
+
})
|
|
677
|
+
.add([wrapper])
|
|
678
|
+
.render("#res");
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
new Button("Wow")
|
|
682
|
+
.set({
|
|
683
|
+
fluidc: "S3",
|
|
684
|
+
onTap: () => modal.show()
|
|
685
|
+
})
|
|
686
|
+
.render("#res");
|
|
687
|
+
|
|
688
|
+
\`
|
|
689
|
+
})`
|
|
690
|
+
);
|
|
691
|
+
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/*else if (el.type === "nav") {
|
|
695
|
+
|
|
696
|
+
if (el.isSide) {
|
|
697
|
+
this.code.push(
|
|
698
|
+
storage.sideNav({ items: el.items, animate: el.animate }).code
|
|
699
|
+
);
|
|
700
|
+
} else {
|
|
701
|
+
this.code.push(
|
|
702
|
+
storage.nav({ items: el.items, animate: el.animate }).code
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
}*/ else if (el.type === "row") {
|
|
707
|
+
|
|
708
|
+
if (el.child === "img") {
|
|
709
|
+
this.code.push(this.stor.flexRow(el.colat).image.code);
|
|
710
|
+
} else {
|
|
711
|
+
this.code.push(this.stor.flexRow(el.colat).text.code);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
} else if (el.type === "cards") {
|
|
715
|
+
console.log("STORO");
|
|
716
|
+
console.log(this.stor);
|
|
717
|
+
ela = ElementMapper.mapType({
|
|
718
|
+
el: el,
|
|
719
|
+
customOptions: customOptions,
|
|
720
|
+
i: i,
|
|
721
|
+
storage: this.stor
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
this.code.push(ela);
|
|
725
|
+
} else if (el.type === "wrap") {
|
|
726
|
+
this.code.push(`new Wrapper().set({}).add([
|
|
727
|
+
new Text("Hello").set({}),
|
|
728
|
+
new Text("Hello").set({}),
|
|
729
|
+
new Text("Hello").set({})
|
|
730
|
+
]) \n`);
|
|
731
|
+
|
|
732
|
+
} else if (el.type === "responsive") { // cdiv
|
|
733
|
+
this.code.push(this.stor.complex.code);
|
|
734
|
+
} else if (el.type === "free") {
|
|
735
|
+
ela = ElementMapper.mapType({
|
|
736
|
+
el: el,
|
|
737
|
+
customOptions: customOptions,
|
|
738
|
+
i: i,
|
|
739
|
+
storage: this.stor
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
this.code.push(ela.toCode()); //.join("") is important :)
|
|
743
|
+
this.ready2Render.push(ela);
|
|
744
|
+
ela = ela.render();
|
|
745
|
+
} else if (el.type === "nav") { // protoNav
|
|
746
|
+
ela = ElementMapper.mapType({
|
|
747
|
+
el: el,
|
|
748
|
+
customOptions: customOptions,
|
|
749
|
+
i: i,
|
|
750
|
+
storage: this.stor
|
|
751
|
+
});
|
|
752
|
+
|
|
753
|
+
this.code.push(ela.toCode()); //.join("") is important :)
|
|
754
|
+
this.ready2Render.push(ela);
|
|
755
|
+
ela = ela.render();
|
|
756
|
+
} // 20:20:26
|
|
757
|
+
|
|
758
|
+
else if (el.type === "sideNav") {
|
|
759
|
+
ela = ElementMapper.mapType({
|
|
760
|
+
el: el,
|
|
761
|
+
customOptions: customOptions,
|
|
762
|
+
i: i,
|
|
763
|
+
storage: this.stor
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
this.code.push(ela.toCode()); //.join("") is important :)
|
|
767
|
+
this.ready2Render.push(ela);
|
|
768
|
+
ela = ela.render();
|
|
769
|
+
} // 20:20:26
|
|
770
|
+
|
|
771
|
+
else if (el.type === "dropdown") {
|
|
772
|
+
ela = ElementMapper.mapType({
|
|
773
|
+
el: el,
|
|
774
|
+
customOptions: customOptions,
|
|
775
|
+
i: i,
|
|
776
|
+
storage: this.stor
|
|
777
|
+
});
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
this.code.push(ela.toCode()); //.join("") is important :)
|
|
781
|
+
this.ready2Render.push(ela);
|
|
782
|
+
ela = ela.render();
|
|
783
|
+
} else if (el.type == "code") {
|
|
784
|
+
this.code.push(`new Code()
|
|
785
|
+
.set({
|
|
786
|
+
pad: [
|
|
787
|
+
{ l: 30 },
|
|
788
|
+
],
|
|
789
|
+
mar: [
|
|
790
|
+
{ a: 30 },
|
|
791
|
+
],
|
|
792
|
+
class: "language-js",
|
|
793
|
+
code: 'new Text("Modality").set({ font: "Arial" })'
|
|
794
|
+
})
|
|
795
|
+
`);
|
|
796
|
+
|
|
797
|
+
} else {
|
|
798
|
+
|
|
799
|
+
// keep this simpel else will work for everytign
|
|
800
|
+
ela = ElementMapper.mapType({
|
|
801
|
+
el: el,
|
|
802
|
+
customOptions: customOptions,
|
|
803
|
+
i: i,
|
|
804
|
+
storage: this.stor
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
if (ela.toCode){
|
|
808
|
+
this.code.push(ela.toCode());
|
|
809
|
+
} else {
|
|
810
|
+
this.code.push(ela);
|
|
811
|
+
}
|
|
812
|
+
//.join("") is important :)
|
|
813
|
+
this.ready2Render.push(ela);
|
|
814
|
+
ela = eval(ela).render();
|
|
815
|
+
} // 20:20:26
|
|
816
|
+
} // LARGE FOR I = 0 CYCLE END
|
|
817
|
+
|
|
818
|
+
return this;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
toTextArea() {
|
|
822
|
+
let code = document.createElement("textarea");
|
|
823
|
+
// It is necessary to have it to generate UI
|
|
824
|
+
code.style.width = 300;
|
|
825
|
+
code.style.height = 300; // both work
|
|
826
|
+
code.setAttribute("id", "elements");
|
|
827
|
+
code.value = this.code.join("");
|
|
828
|
+
this.target = "#elements";
|
|
829
|
+
|
|
830
|
+
let pre = document.createElement("pre");
|
|
831
|
+
let codea = document.createElement("code");
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
const prepare = this.code.map(c => `${c}.render("#mount"); \n \n`);
|
|
835
|
+
this.code = prepare;
|
|
836
|
+
|
|
837
|
+
codea.textContent = this.code;//.replaceAll(",.", ".").replaceAll(",, new", "new").replaceAll(/\[\s*\n*,\s*\n*/g, "["); // replace with your code
|
|
838
|
+
pre.appendChild(codea);
|
|
839
|
+
pre.setAttribute("class", "nonLayout");
|
|
840
|
+
document.body.appendChild(pre); // append to the body or any other container
|
|
841
|
+
document.body.appendChild(code);
|
|
842
|
+
|
|
843
|
+
let preo = document.createElement("pre");
|
|
844
|
+
preo.style.marginTop = "100px";
|
|
845
|
+
return this;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
set(obj) {
|
|
849
|
+
this.toTextArea();
|
|
850
|
+
|
|
851
|
+
document.querySelector("#elements").style.display = "none";
|
|
852
|
+
document.querySelector("pre").style.display = "block";
|
|
853
|
+
|
|
854
|
+
if (obj.elements === false) {
|
|
855
|
+
document.querySelector(".nonLayout").style.display = "none";
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
if (obj.layout === false) {
|
|
859
|
+
// document.querySelector("textarea").value = "";
|
|
860
|
+
if (document.querySelector("#layoutPre") != null) {
|
|
861
|
+
document.querySelector("#layoutPre").style.display = "none";
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
for (var i = 0; i < this.code.length; i++) {
|
|
866
|
+
let sub = this.code[i];
|
|
867
|
+
console.log("SUBO");
|
|
868
|
+
console.log(sub);
|
|
869
|
+
eval(`${sub}`);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
export {Des};
|