-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
400 lines (328 loc) · 16 KB
/
Copy pathindex.html
File metadata and controls
400 lines (328 loc) · 16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mondelez</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script src="./libs/lib-additional.js"></script>
<script src="./libs/flowchart.js"></script>
<div class="pp-container">
<div class="pp-wrapper">
<div class="pp-nav">
<!--Upper navigation toggle button-->
<div class="pp-nav__toggle-btn">
<span class="toggle-btn-svg">
<svg class="toggle-btn-svg__icon" width="7" height="12" viewBox="0 0 7 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.44194 0.558058C6.68602 0.802136 6.68602 1.19786 6.44194 1.44194L1.88388 6L6.44194 10.5581C6.68602 10.8021 6.68602 11.1979 6.44194 11.4419C6.19786 11.686 5.80214 11.686 5.55806 11.4419L0.558059 6.44194C0.313981 6.19786 0.313981 5.80214 0.558058 5.55806L5.55806 0.558058C5.80214 0.31398 6.19786 0.31398 6.44194 0.558058Z" fill="#4F2170"/>
</svg>
</span>
<span class="toggle-btn-text">
Collapse
</span>
</div>
<!--Main navigation panel-->
<ul class="pp-nav__list">
</ul>
</div>
<div class="pp-main">
<div class="pp-main__upper">
<div class="pp-filter-select">
<span class="pp-filter-select__title">Brand</span>
<select class="pp-filter-select__select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="pp-filter-select">
<span class="pp-filter-select__title">Modelling Discipline</span>
<select class="pp-filter-select__select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="pp-filter-select">
<span class="pp-filter-select__title">Democratisation Tier</span>
<select class="pp-filter-select__select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="pp-filter-select">
<span class="pp-filter-select__title">Model Level</span>
<select class="pp-filter-select__select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="pp-filter-select">
<span class="pp-filter-select__title">Model Category</span>
<select class="pp-filter-select__select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="pp-filter-select">
<span class="pp-filter-select__title">Year Model Created</span>
<select class="pp-filter-select__select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
</div>
<div class="pp-main__container-upper"></div>
<div class="pp-main__container">
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
<script>
class ProcessFlowFrid {
constructor(props) {
}
init() {
const self = this;
const dataObject = {
'chocolate': {
'product design': {
'models': 2,
'order': 1,
'image': '',
'parent': []
},
'design': {
'models': 4,
'order': 2,
'image': '',
'parent': ['chocolate']
},
'bakery': {
'models': 0,
'order': 3,
'image': '',
'parent': ['design']
},
'production': {
'models': 8,
'order': 4,
'image': '',
'parent': ['bakery']
},
'mixing': {
'models': 2,
'order': 5,
'image': '',
'parent': ['production']
},
'additional': {
'models': 1,
'order': 6,
'image': '',
'parent': ['mixing']
},
'package': {
'models': 3,
'order': 7,
'image': '',
'parent': ['additional']
},
'sell': {
'models': 6,
'order': 8,
'image': '',
'parent': ['package']
}
},
'candy': {
'design': {
'models': 4,
'order': 1,
'image': '',
'parent': []
},
'product design': {
'models': 2,
'order': 2,
'image': '',
'parent': ['design']
},
'bakery': {
'models': 0,
'order': 4,
'image': '',
'parent': ['product design']
},
'production': {
'models': 8,
'order': 3,
'image': '',
'parent': ['bakery']
},
'additional': {
'models': 1,
'order': 5,
'image': '',
'parent': ['production']
},
'package': {
'models': 3,
'order': 7,
'image': '',
'parent': ['additional']
},
'sell': {
'models': 6,
'order': 8,
'image': '',
'parent': ['package']
},
'mixing': {
'models': 2,
'order': 6,
'image': '',
'parent': ['sell']
},
},
'buiscits': {
'design': {
'models': 4,
'order': 1,
'image': ''
},
'bakery': {
'models': 0,
'order': 4,
'image': ''
},
'product design': {
'models': 2,
'order': 2,
'image': ''
},
'production': {
'models': 8,
'order': 3,
'image': ''
}
}
};
self.createNavigationList(dataObject);
self.createMainElement(dataObject);
$('.pp-nav__list-item').each((i, item) => {
if(!$('.pp-nav__list-item').hasClass('js-nav-item-active')) {
$(item).addClass('js-nav-item-active');
}
$('.item-wrapper').hide();
$(item).click(function() {
$('.pp-nav__list-item').removeClass('js-nav-item-active');
$(this).addClass('js-nav-item-active');
$('.item-wrapper').hide();
$(`.item-wrapper[data-product="${$(item).attr('data-product')}"]`).show()
})
})
// self.snakeMatrixPattern();
self.createConnectionLines(dataObject);
}
createConnectionLines(object) {
for(let product in object) {
for(let item in object[product]) {
if(object[product][item]['parent'] && object[product][item]['parent'].length != 0) {
console.log(object[product][item])
}
}
}
}
createNavigationList(object) {
for(let item in object) {
$('.pp-nav__list').append(`
<li class="pp-nav__list-item" data-product="${item}">
<span class="list-item-svg">
<svg class="list-item-svg__icon" width="18" height="24" viewBox="0 0 18 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.8076 11.106C17.6855 11.0112 17.5278 10.9756 17.3789 11.0151C17.3052 11.0335 17.1669 11.0688 17 11.1124V5.5C17 5.22363 16.7764 5 16.5 5H12V0.5C12 0.223633 11.7764 0 11.5 0H1.5C1.22363 0 1 0.223633 1 0.5V11.163C0.894104 11.1203 0.794495 11.0792 0.685547 11.0356C0.533691 10.9746 0.35791 10.9937 0.219727 11.0859C0.0825195 11.1792 0 11.334 0 11.5V22C0 23.103 0.896973 24 2 24H16C17.103 24 18 23.103 18 22V11.5C18 11.3462 17.9292 11.2007 17.8076 11.106ZM2 6H6V10H2V6ZM11 10H7V6H11V10ZM7 11H11V13.0831C9.80988 13.5842 8.72925 14.1448 8.0498 14.7305C7.8277 14.5269 7.49542 14.2783 7 13.9751V11ZM17 12.1465V13.5566C14.7078 14.0081 11.1183 17.2514 9.69922 18.6074L8.57495 15.6088C9.90704 14.2625 14.6016 12.7907 17 12.1465ZM12 12.6859V11H16V11.3843C14.9429 11.6821 13.4536 12.1352 12 12.6859ZM16 10H12V6H16V10ZM11 5H7V1H11V5ZM2 1H6V5H2V1ZM2 11H6V13.4111C5.06342 12.9161 3.77161 12.3109 2 11.5729V11ZM7.31219 15.3172L4.67383 16.8247C4.08655 15.9069 2.64246 13.9318 1 13.5743V12.2427C3.71417 13.3609 6.54602 14.7149 7.31219 15.3172ZM16 23H2C1.44873 23 1 22.5513 1 22V14.5961C2.27039 15.035 3.60895 16.9505 4.06592 17.748C4.20264 17.9883 4.50781 18.0718 4.74805 17.9341L7.73828 16.2256L9.03174 19.6758C9.09131 19.835 9.22803 19.9526 9.39404 19.9888C9.4292 19.9961 9.46484 20 9.5 20C9.63135 20 9.75879 19.9482 9.85352 19.8535C11.2234 18.484 14.948 15.1119 17 14.579V22C17 22.5513 16.5513 23 16 23Z" fill="#4F2170"/>
</svg>
</span>
<span class="list-item-text">${item}</span>
</li>
`)
}
}
createMainElement(object) {
for(let product in object) {
$('.pp-main__container-upper').append(`<div>${product}<br></div>`)
for(let item in object[product]) {
$('.pp-main__container').append(`
<div class="item-wrapper" data-product="${product}" data-item="${item}" data-order="${object[product][item]['order']}" style="order: ${object[product][item]['order']};">
<div class="item">
<div class="item__models">${object[product][item]['models']} models</div>
<div class="item__image-box"><img class="item__image" src="${object[product][item]['image']}" alt="Production Image"></div>
<div class="item__name">${item}</div>
</div>
</div>
`)
}
}
}
snakeMatrixPattern() {
let arrTest = [];
let M = 4;
let N = 4;
function print(mat)
{
// Traverse through all rows
for(let i = 0; i < M; i++)
{
// If current row is even, print from
// left to right
if (i % 2 == 0)
{
for(let j = 0; j < N; j++) {
if(mat[i][j] != undefined) {
$('.pp-main__container').append(mat[i][j] + " ");
}
}
// If current row is odd, print from
// right to left
}
else
{
for(let j = N - 1; j >= 0; j--) {
$('.pp-main__container').append(mat[i][j] + " ");
}
}
}
}
$('.item').each((i, item) => {
arrTest.push($(item).attr('data-order'))
})
function spliceIntoChunks(arr, chunkSize) {
const res = [];
while (arr.length > 0) {
const chunk = arr.splice(0, chunkSize);
res.push(chunk);
}
return res;
}
print(spliceIntoChunks(arrTest, 4))
}
}
$(document).ready(function() {
let PortalPageProcessFlowFrid = new ProcessFlowFrid()
PortalPageProcessFlowFrid.init();
//--------------
$('.pp-nav__toggle-btn').click(function() {
$('.pp-nav').toggleClass('js-active-nav');
})
})
</script>
</body>
</html>