irie 0.0.27__py3-none-any.whl → 0.0.28__py3-none-any.whl
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.
Potentially problematic release.
This version of irie might be problematic. Click here for more details.
- irie/apps/admin_dash/__init__.py +1 -0
- irie/apps/admin_dash/admin.py +0 -0
- irie/apps/admin_dash/apps.py +6 -0
- irie/apps/admin_dash/forms.py +67 -0
- irie/apps/admin_dash/models.py +1 -0
- irie/apps/admin_dash/templatetags/__init__.py +0 -0
- irie/apps/admin_dash/templatetags/admin_material.py +86 -0
- irie/apps/admin_dash/templatetags/replace_value.py +8 -0
- irie/apps/admin_dash/urls.py +36 -0
- irie/apps/admin_dash/utils.py +462 -0
- irie/apps/admin_dash/views.py +113 -0
- irie/apps/events/views.py +4 -5
- irie/apps/inventory/filters.py +1 -1
- irie/apps/inventory/migrations/0003_asset_notes.py +18 -0
- irie/apps/inventory/models.py +11 -5
- irie/apps/inventory/urls.py +1 -0
- irie/apps/inventory/views.py +72 -33
- irie/apps/static/assets/css/brace.css +22272 -14509
- irie/apps/static/assets/css/brace.css.map +1 -1
- irie/apps/static/assets/css/brace.min.css +32 -1
- irie/apps/static/assets/img/twin.png +0 -0
- irie/apps/static/assets/js/brace.js +858 -38
- irie/apps/templates/events/event-table.html +1 -2
- irie/apps/templates/includes/asset-event-table.html +1 -1
- irie/apps/templates/includes/navigation.html +1 -1
- irie/apps/templates/includes/sidebar.html +4 -4
- irie/apps/templates/inventory/asset-profile.html +6 -1
- irie/apps/templates/inventory/asset-table.html +12 -2
- irie/apps/templates/inventory/dashboard.html +0 -1
- irie/apps/templates/layouts/base.html +1 -0
- irie/apps/templates/site/index.html +9 -9
- irie/apps/templates/site/robots.txt +42 -1
- irie/core/settings.py +1 -0
- irie/init/calid.py +95 -95
- irie/init/management/commands/init_assets.py +1 -11
- irie/init/management/commands/init_cesmd.py +19 -8
- {irie-0.0.27.dist-info → irie-0.0.28.dist-info}/METADATA +3 -2
- {irie-0.0.27.dist-info → irie-0.0.28.dist-info}/RECORD +41 -28
- {irie-0.0.27.dist-info → irie-0.0.28.dist-info}/WHEEL +1 -1
- {irie-0.0.27.dist-info → irie-0.0.28.dist-info}/entry_points.txt +0 -0
- {irie-0.0.27.dist-info → irie-0.0.28.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const d = document;
|
|
3
|
-
|
|
3
|
+
document.addEventListener("DOMContentLoaded", function(event) {
|
|
4
4
|
/*
|
|
5
5
|
document.getElementById("btnPrint").onclick = function () {
|
|
6
6
|
printElement(document.getElementById("reportModal"), false, "\n");
|
|
@@ -185,42 +185,862 @@ d.addEventListener("DOMContentLoaded", function(event) {
|
|
|
185
185
|
if (document.querySelector('.current-year')){
|
|
186
186
|
document.querySelector('.current-year').textContent = new Date().getFullYear();
|
|
187
187
|
}
|
|
188
|
-
|
|
189
188
|
// Glide JS
|
|
190
|
-
/*
|
|
191
|
-
if (d.querySelector('.glide')) {
|
|
192
|
-
new Glide('.glide', {
|
|
193
|
-
type: 'carousel',
|
|
194
|
-
startAt: 0,
|
|
195
|
-
perView: 3
|
|
196
|
-
}).mount();
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (d.querySelector('.glide-testimonials')) {
|
|
200
|
-
new Glide('.glide-testimonials', {
|
|
201
|
-
type: 'carousel',
|
|
202
|
-
startAt: 0,
|
|
203
|
-
perView: 1,
|
|
204
|
-
autoplay: 2000
|
|
205
|
-
}).mount();
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (d.querySelector('.glide-clients')) {
|
|
209
|
-
new Glide('.glide-clients', {
|
|
210
|
-
type: 'carousel',
|
|
211
|
-
startAt: 0,
|
|
212
|
-
perView: 5,
|
|
213
|
-
autoplay: 2000
|
|
214
|
-
}).mount();
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (d.querySelector('.glide-news-widget')) {
|
|
218
|
-
new Glide('.glide-news-widget', {
|
|
219
|
-
type: 'carousel',
|
|
220
|
-
startAt: 0,
|
|
221
|
-
perView: 1,
|
|
222
|
-
autoplay: 2000
|
|
223
|
-
}).mount();
|
|
224
|
-
}
|
|
225
|
-
*/
|
|
226
189
|
});
|
|
190
|
+
(function() {
|
|
191
|
+
var isWindows = navigator.platform.indexOf('Win') > -1 ? true : false;
|
|
192
|
+
|
|
193
|
+
if (isWindows) {
|
|
194
|
+
// if we are on windows OS we activate the perfectScrollbar function
|
|
195
|
+
if (document.getElementsByClassName('main-content')[0]) {
|
|
196
|
+
var mainpanel = document.querySelector('.main-content');
|
|
197
|
+
var ps = new PerfectScrollbar(mainpanel);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
if (document.getElementsByClassName('sidenav')[0]) {
|
|
201
|
+
var sidebar = document.querySelector('.sidenav');
|
|
202
|
+
var ps1 = new PerfectScrollbar(sidebar);
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
if (document.getElementsByClassName('navbar-collapse')[0]) {
|
|
206
|
+
var fixedplugin = document.querySelector('.navbar:not(.navbar-expand-lg) .navbar-collapse');
|
|
207
|
+
var ps2 = new PerfectScrollbar(fixedplugin);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
if (document.getElementsByClassName('fixed-plugin')[0]) {
|
|
211
|
+
var fixedplugin = document.querySelector('.fixed-plugin');
|
|
212
|
+
var ps3 = new PerfectScrollbar(fixedplugin);
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
})();
|
|
216
|
+
|
|
217
|
+
// Verify navbar blur on scroll
|
|
218
|
+
if (document.getElementById('navbarBlur')) {
|
|
219
|
+
navbarBlurOnScroll('navbarBlur');
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// when input is focused add focused class for style
|
|
223
|
+
function focused(el) {
|
|
224
|
+
if (el.parentElement.classList.contains('input-group')) {
|
|
225
|
+
el.parentElement.classList.add('focused');
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// when input is focused remove focused class for style
|
|
230
|
+
function defocused(el) {
|
|
231
|
+
if (el.parentElement.classList.contains('input-group')) {
|
|
232
|
+
el.parentElement.classList.remove('focused');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// helper for adding on all elements multiple attributes
|
|
237
|
+
function setAttributes(el, options) {
|
|
238
|
+
Object.keys(options).forEach(function(attr) {
|
|
239
|
+
el.setAttribute(attr, options[attr]);
|
|
240
|
+
})
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// adding on inputs attributes for calling the focused and defocused functions
|
|
244
|
+
if (document.querySelectorAll('.input-group').length != 0) {
|
|
245
|
+
var allInputs = document.querySelectorAll('input.form-control');
|
|
246
|
+
allInputs.forEach(el => setAttributes(el, {
|
|
247
|
+
"onfocus": "focused(this)",
|
|
248
|
+
"onfocusout": "defocused(this)"
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
// Fixed Plugin
|
|
254
|
+
|
|
255
|
+
if (document.querySelector('.fixed-plugin')) {
|
|
256
|
+
var fixedPlugin = document.querySelector('.fixed-plugin');
|
|
257
|
+
var fixedPlugin = document.querySelector('.fixed-plugin');
|
|
258
|
+
var fixedPluginButton = document.querySelector('.fixed-plugin-button');
|
|
259
|
+
var fixedPluginButtonNav = document.querySelector('.fixed-plugin-button-nav');
|
|
260
|
+
var fixedPluginCard = document.querySelector('.fixed-plugin .card');
|
|
261
|
+
var fixedPluginCloseButton = document.querySelectorAll('.fixed-plugin-close-button');
|
|
262
|
+
var navbar = document.getElementById('navbarBlur');
|
|
263
|
+
var buttonNavbarFixed = document.getElementById('navbarFixed');
|
|
264
|
+
|
|
265
|
+
if (fixedPluginButton) {
|
|
266
|
+
fixedPluginButton.onclick = function() {
|
|
267
|
+
if (!fixedPlugin.classList.contains('show')) {
|
|
268
|
+
fixedPlugin.classList.add('show');
|
|
269
|
+
} else {
|
|
270
|
+
fixedPlugin.classList.remove('show');
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (fixedPluginButtonNav) {
|
|
276
|
+
fixedPluginButtonNav.onclick = function() {
|
|
277
|
+
if (!fixedPlugin.classList.contains('show')) {
|
|
278
|
+
fixedPlugin.classList.add('show');
|
|
279
|
+
} else {
|
|
280
|
+
fixedPlugin.classList.remove('show');
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
fixedPluginCloseButton.forEach(function(el) {
|
|
286
|
+
el.onclick = function() {
|
|
287
|
+
fixedPlugin.classList.remove('show');
|
|
288
|
+
}
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
document.querySelector('body').onclick = function(e) {
|
|
292
|
+
if (e.target != fixedPluginButton && e.target != fixedPluginButtonNav && e.target.closest('.fixed-plugin .card') != fixedPluginCard) {
|
|
293
|
+
fixedPlugin.classList.remove('show');
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (navbar) {
|
|
298
|
+
if (navbar.getAttribute('data-scroll') == 'true' && buttonNavbarFixed) {
|
|
299
|
+
buttonNavbarFixed.setAttribute("checked", "true");
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
//Set Sidebar Color
|
|
306
|
+
function sidebarColor(a) {
|
|
307
|
+
var parent = document.querySelector(".nav-link.active");
|
|
308
|
+
var color = a.getAttribute("data-color");
|
|
309
|
+
|
|
310
|
+
if (parent.classList.contains('bg-gradient-primary')) {
|
|
311
|
+
parent.classList.remove('bg-gradient-primary');
|
|
312
|
+
}
|
|
313
|
+
if (parent.classList.contains('bg-gradient-dark')) {
|
|
314
|
+
parent.classList.remove('bg-gradient-dark');
|
|
315
|
+
}
|
|
316
|
+
if (parent.classList.contains('bg-gradient-info')) {
|
|
317
|
+
parent.classList.remove('bg-gradient-info');
|
|
318
|
+
}
|
|
319
|
+
if (parent.classList.contains('bg-gradient-success')) {
|
|
320
|
+
parent.classList.remove('bg-gradient-success');
|
|
321
|
+
}
|
|
322
|
+
if (parent.classList.contains('bg-gradient-warning')) {
|
|
323
|
+
parent.classList.remove('bg-gradient-warning');
|
|
324
|
+
}
|
|
325
|
+
if (parent.classList.contains('bg-gradient-danger')) {
|
|
326
|
+
parent.classList.remove('bg-gradient-danger');
|
|
327
|
+
}
|
|
328
|
+
parent.classList.add('bg-gradient-' + color);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Set Sidebar Type
|
|
332
|
+
function sidebarType(a) {
|
|
333
|
+
var parent = a.parentElement.children;
|
|
334
|
+
var color = a.getAttribute("data-class");
|
|
335
|
+
var body = document.querySelector("body");
|
|
336
|
+
var bodyWhite = document.querySelector("body:not(.dark-version)");
|
|
337
|
+
var bodyDark = body.classList.contains('dark-version');
|
|
338
|
+
|
|
339
|
+
var colors = [];
|
|
340
|
+
|
|
341
|
+
for (var i = 0; i < parent.length; i++) {
|
|
342
|
+
parent[i].classList.remove('active');
|
|
343
|
+
colors.push(parent[i].getAttribute('data-class'));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (!a.classList.contains('active')) {
|
|
347
|
+
a.classList.add('active');
|
|
348
|
+
} else {
|
|
349
|
+
a.classList.remove('active');
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
var sidebar = document.querySelector('.sidenav');
|
|
353
|
+
|
|
354
|
+
for (var i = 0; i < colors.length; i++) {
|
|
355
|
+
sidebar.classList.remove(colors[i]);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
sidebar.classList.add(color);
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
// Remove text-white/text-dark classes
|
|
362
|
+
if (color == 'bg-transparent' || color == 'bg-white') {
|
|
363
|
+
var textWhites = document.querySelectorAll('.sidenav .text-white:not(.nav-link-text):not(.active)');
|
|
364
|
+
for (let i = 0; i < textWhites.length; i++) {
|
|
365
|
+
textWhites[i].classList.remove('text-white');
|
|
366
|
+
textWhites[i].classList.add('text-dark');
|
|
367
|
+
}
|
|
368
|
+
} else {
|
|
369
|
+
var textDarks = document.querySelectorAll('.sidenav .text-dark');
|
|
370
|
+
for (let i = 0; i < textDarks.length; i++) {
|
|
371
|
+
textDarks[i].classList.add('text-white');
|
|
372
|
+
textDarks[i].classList.remove('text-dark');
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
if (color == 'bg-transparent' && bodyDark) {
|
|
377
|
+
var textDarks = document.querySelectorAll('.navbar-brand .text-dark');
|
|
378
|
+
for (let i = 0; i < textDarks.length; i++) {
|
|
379
|
+
textDarks[i].classList.add('text-white');
|
|
380
|
+
textDarks[i].classList.remove('text-dark');
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// Remove logo-white/logo-dark
|
|
385
|
+
|
|
386
|
+
if ((color == 'bg-transparent' || color == 'bg-white') && bodyWhite) {
|
|
387
|
+
var navbarBrand = document.querySelector('.navbar-brand-img');
|
|
388
|
+
var navbarBrandImg = navbarBrand.src;
|
|
389
|
+
|
|
390
|
+
if (navbarBrandImg.includes('logo-ct.png')) {
|
|
391
|
+
var navbarBrandImgNew = navbarBrandImg.replace("logo-ct", "logo-ct-dark");
|
|
392
|
+
navbarBrand.src = navbarBrandImgNew;
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
var navbarBrand = document.querySelector('.navbar-brand-img');
|
|
396
|
+
var navbarBrandImg = navbarBrand.src;
|
|
397
|
+
if (navbarBrandImg.includes('logo-ct-dark.png')) {
|
|
398
|
+
var navbarBrandImgNew = navbarBrandImg.replace("logo-ct-dark", "logo-ct");
|
|
399
|
+
navbarBrand.src = navbarBrandImgNew;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (color == 'bg-white' && bodyDark) {
|
|
404
|
+
var navbarBrand = document.querySelector('.navbar-brand-img');
|
|
405
|
+
var navbarBrandImg = navbarBrand.src;
|
|
406
|
+
|
|
407
|
+
if (navbarBrandImg.includes('logo-ct.png')) {
|
|
408
|
+
var navbarBrandImgNew = navbarBrandImg.replace("logo-ct", "logo-ct-dark");
|
|
409
|
+
navbarBrand.src = navbarBrandImgNew;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Set Navbar Fixed
|
|
415
|
+
function navbarFixed(el) {
|
|
416
|
+
let classes = ['position-sticky', 'blur', 'shadow-blur', 'mt-4', 'left-auto', 'top-1', 'z-index-sticky'];
|
|
417
|
+
const navbar = document.getElementById('navbarBlur');
|
|
418
|
+
|
|
419
|
+
if (!el.getAttribute("checked")) {
|
|
420
|
+
navbar.classList.add(...classes);
|
|
421
|
+
navbar.setAttribute('navbar-scroll', 'true');
|
|
422
|
+
navbarBlurOnScroll('navbarBlur');
|
|
423
|
+
el.setAttribute("checked", "true");
|
|
424
|
+
} else {
|
|
425
|
+
navbar.classList.remove(...classes);
|
|
426
|
+
navbar.setAttribute('navbar-scroll', 'false');
|
|
427
|
+
navbarBlurOnScroll('navbarBlur');
|
|
428
|
+
el.removeAttribute("checked");
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
// Set Navbar Minimized
|
|
434
|
+
function navbarMinimize(el) {
|
|
435
|
+
var sidenavShow = document.getElementsByClassName('g-sidenav-show')[0];
|
|
436
|
+
|
|
437
|
+
if (!el.getAttribute("checked")) {
|
|
438
|
+
sidenavShow.classList.remove('g-sidenav-pinned');
|
|
439
|
+
sidenavShow.classList.add('g-sidenav-hidden');
|
|
440
|
+
el.setAttribute("checked", "true");
|
|
441
|
+
} else {
|
|
442
|
+
sidenavShow.classList.remove('g-sidenav-hidden');
|
|
443
|
+
sidenavShow.classList.add('g-sidenav-pinned');
|
|
444
|
+
el.removeAttribute("checked");
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// Navbar blur on scroll
|
|
449
|
+
function navbarBlurOnScroll(id) {
|
|
450
|
+
const navbar = document.getElementById(id);
|
|
451
|
+
let navbarScrollActive = navbar ? navbar.getAttribute("data-scroll") : false;
|
|
452
|
+
let scrollDistance = 5;
|
|
453
|
+
let classes = ['blur', 'shadow-blur', 'left-auto'];
|
|
454
|
+
let toggleClasses = ['shadow-none'];
|
|
455
|
+
|
|
456
|
+
if (navbarScrollActive == 'true') {
|
|
457
|
+
window.onscroll = debounce(function() {
|
|
458
|
+
if (window.scrollY > scrollDistance) {
|
|
459
|
+
blurNavbar();
|
|
460
|
+
} else {
|
|
461
|
+
transparentNavbar();
|
|
462
|
+
}
|
|
463
|
+
}, 10);
|
|
464
|
+
} else {
|
|
465
|
+
window.onscroll = debounce(function() {
|
|
466
|
+
transparentNavbar();
|
|
467
|
+
}, 10);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
var isWindows = navigator.platform.indexOf('Win') > -1 ? true : false;
|
|
471
|
+
|
|
472
|
+
if (isWindows) {
|
|
473
|
+
var content = document.querySelector('.main-content');
|
|
474
|
+
if (navbarScrollActive == 'true') {
|
|
475
|
+
content.addEventListener('ps-scroll-y', debounce(function() {
|
|
476
|
+
if (content.scrollTop > scrollDistance) {
|
|
477
|
+
blurNavbar();
|
|
478
|
+
} else {
|
|
479
|
+
transparentNavbar();
|
|
480
|
+
}
|
|
481
|
+
}, 10));
|
|
482
|
+
} else {
|
|
483
|
+
content.addEventListener('ps-scroll-y', debounce(function() {
|
|
484
|
+
transparentNavbar();
|
|
485
|
+
}, 10));
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function blurNavbar() {
|
|
490
|
+
navbar.classList.add(...classes)
|
|
491
|
+
navbar.classList.remove(...toggleClasses)
|
|
492
|
+
|
|
493
|
+
toggleNavLinksColor('blur');
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function transparentNavbar() {
|
|
497
|
+
navbar.classList.remove(...classes)
|
|
498
|
+
navbar.classList.add(...toggleClasses)
|
|
499
|
+
|
|
500
|
+
toggleNavLinksColor('transparent');
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function toggleNavLinksColor(type) {
|
|
504
|
+
let navLinks = document.querySelectorAll('.navbar-main .nav-link')
|
|
505
|
+
let navLinksToggler = document.querySelectorAll('.navbar-main .sidenav-toggler-line')
|
|
506
|
+
|
|
507
|
+
if (type === "blur") {
|
|
508
|
+
navLinks.forEach(element => {
|
|
509
|
+
element.classList.remove('text-body')
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
navLinksToggler.forEach(element => {
|
|
513
|
+
element.classList.add('bg-dark')
|
|
514
|
+
});
|
|
515
|
+
} else if (type === "transparent") {
|
|
516
|
+
navLinks.forEach(element => {
|
|
517
|
+
element.classList.add('text-body')
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
navLinksToggler.forEach(element => {
|
|
521
|
+
element.classList.remove('bg-dark')
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// Debounce Function
|
|
528
|
+
// Returns a function, that, as long as it continues to be invoked, will not
|
|
529
|
+
// be triggered. The function will be called after it stops being called for
|
|
530
|
+
// N milliseconds. If `immediate` is passed, trigger the function on the
|
|
531
|
+
// leading edge, instead of the trailing.
|
|
532
|
+
function debounce(func, wait, immediate) {
|
|
533
|
+
var timeout;
|
|
534
|
+
return function() {
|
|
535
|
+
var context = this,
|
|
536
|
+
args = arguments;
|
|
537
|
+
var later = function() {
|
|
538
|
+
timeout = null;
|
|
539
|
+
if (!immediate) func.apply(context, args);
|
|
540
|
+
};
|
|
541
|
+
var callNow = immediate && !timeout;
|
|
542
|
+
clearTimeout(timeout);
|
|
543
|
+
timeout = setTimeout(later, wait);
|
|
544
|
+
if (callNow) func.apply(context, args);
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
// initialization of Toasts
|
|
549
|
+
document.addEventListener("DOMContentLoaded", function() {
|
|
550
|
+
var toastElList = [].slice.call(document.querySelectorAll(".toast"));
|
|
551
|
+
|
|
552
|
+
var toastList = toastElList.map(function(toastEl) {
|
|
553
|
+
return new bootstrap.Toast(toastEl);
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
var toastButtonList = [].slice.call(document.querySelectorAll(".toast-btn"));
|
|
557
|
+
|
|
558
|
+
toastButtonList.map(function(toastButtonEl) {
|
|
559
|
+
toastButtonEl.addEventListener("click", function() {
|
|
560
|
+
var toastToTrigger = document.getElementById(toastButtonEl.dataset.target);
|
|
561
|
+
|
|
562
|
+
if (toastToTrigger) {
|
|
563
|
+
var toast = bootstrap.Toast.getInstance(toastToTrigger);
|
|
564
|
+
toast.show();
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
// Tabs navigation
|
|
571
|
+
|
|
572
|
+
var total = document.querySelectorAll('.nav-pills');
|
|
573
|
+
|
|
574
|
+
function initNavs() {
|
|
575
|
+
total.forEach(function(item, i) {
|
|
576
|
+
var moving_div = document.createElement('div');
|
|
577
|
+
var first_li = item.querySelector('li:first-child .nav-link');
|
|
578
|
+
var tab = first_li.cloneNode();
|
|
579
|
+
tab.innerHTML = "-";
|
|
580
|
+
|
|
581
|
+
moving_div.classList.add('moving-tab', 'position-absolute', 'nav-link');
|
|
582
|
+
moving_div.appendChild(tab);
|
|
583
|
+
item.appendChild(moving_div);
|
|
584
|
+
|
|
585
|
+
var list_length = item.getElementsByTagName("li").length;
|
|
586
|
+
|
|
587
|
+
moving_div.style.padding = '0px';
|
|
588
|
+
moving_div.style.width = item.querySelector('li:nth-child(1)').offsetWidth + 'px';
|
|
589
|
+
moving_div.style.transform = 'translate3d(0px, 0px, 0px)';
|
|
590
|
+
moving_div.style.transition = '.5s ease';
|
|
591
|
+
|
|
592
|
+
item.onmouseover = function(event) {
|
|
593
|
+
let target = getEventTarget(event);
|
|
594
|
+
let li = target.closest('li'); // get reference
|
|
595
|
+
if (li) {
|
|
596
|
+
let nodes = Array.from(li.closest('ul').children); // get array
|
|
597
|
+
let index = nodes.indexOf(li) + 1;
|
|
598
|
+
item.querySelector('li:nth-child(' + index + ') .nav-link').onclick = function() {
|
|
599
|
+
moving_div = item.querySelector('.moving-tab');
|
|
600
|
+
let sum = 0;
|
|
601
|
+
if (item.classList.contains('flex-column')) {
|
|
602
|
+
for (var j = 1; j <= nodes.indexOf(li); j++) {
|
|
603
|
+
sum += item.querySelector('li:nth-child(' + j + ')').offsetHeight;
|
|
604
|
+
}
|
|
605
|
+
moving_div.style.transform = 'translate3d(0px,' + sum + 'px, 0px)';
|
|
606
|
+
moving_div.style.height = item.querySelector('li:nth-child(' + j + ')').offsetHeight;
|
|
607
|
+
} else {
|
|
608
|
+
for (var j = 1; j <= nodes.indexOf(li); j++) {
|
|
609
|
+
sum += item.querySelector('li:nth-child(' + j + ')').offsetWidth;
|
|
610
|
+
}
|
|
611
|
+
moving_div.style.transform = 'translate3d(' + sum + 'px, 0px, 0px)';
|
|
612
|
+
moving_div.style.width = item.querySelector('li:nth-child(' + index + ')').offsetWidth + 'px';
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
setTimeout(function() {
|
|
621
|
+
initNavs();
|
|
622
|
+
}, 100);
|
|
623
|
+
|
|
624
|
+
// Tabs navigation resize
|
|
625
|
+
|
|
626
|
+
window.addEventListener('resize', function(event) {
|
|
627
|
+
total.forEach(function(item, i) {
|
|
628
|
+
item.querySelector('.moving-tab').remove();
|
|
629
|
+
var moving_div = document.createElement('div');
|
|
630
|
+
var tab = item.querySelector(".nav-link.active").cloneNode();
|
|
631
|
+
tab.innerHTML = "-";
|
|
632
|
+
|
|
633
|
+
moving_div.classList.add('moving-tab', 'position-absolute', 'nav-link');
|
|
634
|
+
moving_div.appendChild(tab);
|
|
635
|
+
|
|
636
|
+
item.appendChild(moving_div);
|
|
637
|
+
|
|
638
|
+
moving_div.style.padding = '0px';
|
|
639
|
+
moving_div.style.transition = '.5s ease';
|
|
640
|
+
|
|
641
|
+
let li = item.querySelector(".nav-link.active").parentElement;
|
|
642
|
+
|
|
643
|
+
if (li) {
|
|
644
|
+
let nodes = Array.from(li.closest('ul').children); // get array
|
|
645
|
+
let index = nodes.indexOf(li) + 1;
|
|
646
|
+
|
|
647
|
+
let sum = 0;
|
|
648
|
+
if (item.classList.contains('flex-column')) {
|
|
649
|
+
for (var j = 1; j <= nodes.indexOf(li); j++) {
|
|
650
|
+
sum += item.querySelector('li:nth-child(' + j + ')').offsetHeight;
|
|
651
|
+
}
|
|
652
|
+
moving_div.style.transform = 'translate3d(0px,' + sum + 'px, 0px)';
|
|
653
|
+
moving_div.style.width = item.querySelector('li:nth-child(' + index + ')').offsetWidth + 'px';
|
|
654
|
+
moving_div.style.height = item.querySelector('li:nth-child(' + j + ')').offsetHeight;
|
|
655
|
+
} else {
|
|
656
|
+
for (var j = 1; j <= nodes.indexOf(li); j++) {
|
|
657
|
+
sum += item.querySelector('li:nth-child(' + j + ')').offsetWidth;
|
|
658
|
+
}
|
|
659
|
+
moving_div.style.transform = 'translate3d(' + sum + 'px, 0px, 0px)';
|
|
660
|
+
moving_div.style.width = item.querySelector('li:nth-child(' + index + ')').offsetWidth + 'px';
|
|
661
|
+
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
|
|
666
|
+
if (window.innerWidth < 991) {
|
|
667
|
+
total.forEach(function(item, i) {
|
|
668
|
+
if (!item.classList.contains('flex-column')) {
|
|
669
|
+
item.classList.remove('flex-row');
|
|
670
|
+
item.classList.add('flex-column', 'on-resize');
|
|
671
|
+
let li = item.querySelector(".nav-link.active").parentElement;
|
|
672
|
+
let nodes = Array.from(li.closest('ul').children); // get array
|
|
673
|
+
let index = nodes.indexOf(li) + 1;
|
|
674
|
+
let sum = 0;
|
|
675
|
+
for (var j = 1; j <= nodes.indexOf(li); j++) {
|
|
676
|
+
sum += item.querySelector('li:nth-child(' + j + ')').offsetHeight;
|
|
677
|
+
}
|
|
678
|
+
var moving_div = document.querySelector('.moving-tab');
|
|
679
|
+
moving_div.style.width = item.querySelector('li:nth-child(1)').offsetWidth + 'px';
|
|
680
|
+
moving_div.style.transform = 'translate3d(0px,' + sum + 'px, 0px)';
|
|
681
|
+
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
} else {
|
|
685
|
+
total.forEach(function(item, i) {
|
|
686
|
+
if (item.classList.contains('on-resize')) {
|
|
687
|
+
item.classList.remove('flex-column', 'on-resize');
|
|
688
|
+
item.classList.add('flex-row');
|
|
689
|
+
let li = item.querySelector(".nav-link.active").parentElement;
|
|
690
|
+
let nodes = Array.from(li.closest('ul').children); // get array
|
|
691
|
+
let index = nodes.indexOf(li) + 1;
|
|
692
|
+
let sum = 0;
|
|
693
|
+
for (var j = 1; j <= nodes.indexOf(li); j++) {
|
|
694
|
+
sum += item.querySelector('li:nth-child(' + j + ')').offsetWidth;
|
|
695
|
+
}
|
|
696
|
+
var moving_div = document.querySelector('.moving-tab');
|
|
697
|
+
moving_div.style.transform = 'translate3d(' + sum + 'px, 0px, 0px)';
|
|
698
|
+
moving_div.style.width = item.querySelector('li:nth-child(' + index + ')').offsetWidth + 'px';
|
|
699
|
+
}
|
|
700
|
+
})
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
// Function to remove flex row on mobile devices
|
|
705
|
+
if (window.innerWidth < 991) {
|
|
706
|
+
total.forEach(function(item, i) {
|
|
707
|
+
if (item.classList.contains('flex-row')) {
|
|
708
|
+
item.classList.remove('flex-row');
|
|
709
|
+
item.classList.add('flex-column', 'on-resize');
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
function getEventTarget(e) {
|
|
715
|
+
e = e || window.event;
|
|
716
|
+
return e.target || e.srcElement;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
// End tabs navigation
|
|
720
|
+
|
|
721
|
+
window.onload = function() {
|
|
722
|
+
// Material Design Input function
|
|
723
|
+
var inputs = document.querySelectorAll('input');
|
|
724
|
+
|
|
725
|
+
for (var i = 0; i < inputs.length; i++) {
|
|
726
|
+
inputs[i].addEventListener('focus', function(e) {
|
|
727
|
+
this.parentElement.classList.add('is-focused');
|
|
728
|
+
}, false);
|
|
729
|
+
|
|
730
|
+
inputs[i].onkeyup = function(e) {
|
|
731
|
+
if (this.value != "") {
|
|
732
|
+
this.parentElement.classList.add('is-filled');
|
|
733
|
+
} else {
|
|
734
|
+
this.parentElement.classList.remove('is-filled');
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
inputs[i].addEventListener('focusout', function(e) {
|
|
739
|
+
if (this.value != "") {
|
|
740
|
+
this.parentElement.classList.add('is-filled');
|
|
741
|
+
}
|
|
742
|
+
this.parentElement.classList.remove('is-focused');
|
|
743
|
+
}, false);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Ripple Effect
|
|
747
|
+
var ripples = document.querySelectorAll('.btn');
|
|
748
|
+
|
|
749
|
+
for (var i = 0; i < ripples.length; i++) {
|
|
750
|
+
ripples[i].addEventListener('click', function(e) {
|
|
751
|
+
var targetEl = e.target;
|
|
752
|
+
var rippleDiv = targetEl.querySelector('.ripple');
|
|
753
|
+
|
|
754
|
+
rippleDiv = document.createElement('span');
|
|
755
|
+
rippleDiv.classList.add('ripple');
|
|
756
|
+
rippleDiv.style.width = rippleDiv.style.height = Math.max(targetEl.offsetWidth, targetEl.offsetHeight) + 'px';
|
|
757
|
+
targetEl.appendChild(rippleDiv);
|
|
758
|
+
|
|
759
|
+
rippleDiv.style.left = (e.offsetX - rippleDiv.offsetWidth / 2) + 'px';
|
|
760
|
+
rippleDiv.style.top = (e.offsetY - rippleDiv.offsetHeight / 2) + 'px';
|
|
761
|
+
rippleDiv.classList.add('ripple');
|
|
762
|
+
setTimeout(function() {
|
|
763
|
+
rippleDiv.parentElement.removeChild(rippleDiv);
|
|
764
|
+
}, 600);
|
|
765
|
+
}, false);
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
// Toggle Sidenav
|
|
770
|
+
const iconNavbarSidenav = document.getElementById('iconNavbarSidenav');
|
|
771
|
+
const iconSidenav = document.getElementById('iconSidenav');
|
|
772
|
+
const sidenav = document.getElementById('sidenav-main');
|
|
773
|
+
let body = document.getElementsByTagName('body')[0];
|
|
774
|
+
let className = 'g-sidenav-pinned';
|
|
775
|
+
|
|
776
|
+
if (iconNavbarSidenav) {
|
|
777
|
+
iconNavbarSidenav.addEventListener("click", toggleSidenav);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
if (iconSidenav) {
|
|
781
|
+
iconSidenav.addEventListener("click", toggleSidenav);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
function toggleSidenav() {
|
|
785
|
+
if (body.classList.contains(className)) {
|
|
786
|
+
body.classList.remove(className);
|
|
787
|
+
setTimeout(function() {
|
|
788
|
+
sidenav.classList.remove('bg-white');
|
|
789
|
+
}, 100);
|
|
790
|
+
sidenav.classList.remove('bg-transparent');
|
|
791
|
+
|
|
792
|
+
} else {
|
|
793
|
+
body.classList.add(className);
|
|
794
|
+
sidenav.classList.add('bg-white');
|
|
795
|
+
sidenav.classList.remove('bg-transparent');
|
|
796
|
+
iconSidenav.classList.remove('d-none');
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// Resize navbar color depends on configurator active type of sidenav
|
|
801
|
+
|
|
802
|
+
let referenceButtons = document.querySelector('[data-class]');
|
|
803
|
+
|
|
804
|
+
if (sidenav) {
|
|
805
|
+
window.addEventListener("resize", navbarColorOnResize);
|
|
806
|
+
|
|
807
|
+
function navbarColorOnResize() {
|
|
808
|
+
if (window.innerWidth > 1200) {
|
|
809
|
+
if (referenceButtons?.classList.contains('active') && referenceButtons?.getAttribute('data-class') === 'bg-transparent') {
|
|
810
|
+
sidenav.classList.remove('bg-white');
|
|
811
|
+
} else {
|
|
812
|
+
sidenav.classList.add('bg-white');
|
|
813
|
+
}
|
|
814
|
+
} else {
|
|
815
|
+
sidenav.classList.add('bg-white');
|
|
816
|
+
sidenav.classList.remove('bg-transparent');
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// Deactivate sidenav type buttons on resize and small screens
|
|
822
|
+
window.addEventListener("resize", sidenavTypeOnResize);
|
|
823
|
+
window.addEventListener("load", sidenavTypeOnResize);
|
|
824
|
+
|
|
825
|
+
function sidenavTypeOnResize() {
|
|
826
|
+
let elements = document.querySelectorAll('[onclick="sidebarType(this)"]');
|
|
827
|
+
if (window.innerWidth < 1200) {
|
|
828
|
+
elements.forEach(function(el) {
|
|
829
|
+
el.classList.add('disabled');
|
|
830
|
+
});
|
|
831
|
+
} else {
|
|
832
|
+
elements.forEach(function(el) {
|
|
833
|
+
el.classList.remove('disabled');
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
// Light Mode / Dark Mode
|
|
840
|
+
function darkMode(el) {
|
|
841
|
+
const body = document.getElementsByTagName('body')[0];
|
|
842
|
+
const hr = document.querySelectorAll('div:not(.sidenav) > hr');
|
|
843
|
+
const hr_card = document.querySelectorAll('div:not(.bg-gradient-dark) hr');
|
|
844
|
+
const text_btn = document.querySelectorAll('button:not(.btn) > .text-dark');
|
|
845
|
+
const text_span = document.querySelectorAll('span.text-dark, .breadcrumb .text-dark');
|
|
846
|
+
const text_span_white = document.querySelectorAll('span.text-white, .breadcrumb .text-white');
|
|
847
|
+
const text_strong = document.querySelectorAll('strong.text-dark');
|
|
848
|
+
const text_strong_white = document.querySelectorAll('strong.text-white');
|
|
849
|
+
const text_nav_link = document.querySelectorAll('a.nav-link.text-dark');
|
|
850
|
+
const text_nav_link_white = document.querySelectorAll('a.nav-link.text-white');
|
|
851
|
+
const secondary = document.querySelectorAll('.text-secondary');
|
|
852
|
+
const bg_gray_100 = document.querySelectorAll('.bg-gray-100');
|
|
853
|
+
const bg_gray_600 = document.querySelectorAll('.bg-gray-600');
|
|
854
|
+
const btn_text_dark = document.querySelectorAll('.btn.btn-link.text-dark, .material-symbols-rounded.text-dark');
|
|
855
|
+
const btn_text_white = document.querySelectorAll('.btn.btn-link.text-white, .material-symbols-rounded.text-white');
|
|
856
|
+
const card_border = document.querySelectorAll('.card.border');
|
|
857
|
+
const card_border_dark = document.querySelectorAll('.card.border.border-dark');
|
|
858
|
+
|
|
859
|
+
const svg = document.querySelectorAll('g');
|
|
860
|
+
|
|
861
|
+
if (!el.getAttribute("checked")) {
|
|
862
|
+
body.classList.add('dark-version');
|
|
863
|
+
for (var i = 0; i < hr.length; i++) {
|
|
864
|
+
if (hr[i].classList.contains('dark')) {
|
|
865
|
+
hr[i].classList.remove('dark');
|
|
866
|
+
hr[i].classList.add('light');
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
for (var i = 0; i < hr_card.length; i++) {
|
|
871
|
+
if (hr_card[i].classList.contains('dark')) {
|
|
872
|
+
hr_card[i].classList.remove('dark');
|
|
873
|
+
hr_card[i].classList.add('light');
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
for (var i = 0; i < text_btn.length; i++) {
|
|
877
|
+
if (text_btn[i].classList.contains('text-dark')) {
|
|
878
|
+
text_btn[i].classList.remove('text-dark');
|
|
879
|
+
text_btn[i].classList.add('text-white');
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
for (var i = 0; i < text_span.length; i++) {
|
|
883
|
+
if (text_span[i].classList.contains('text-dark')) {
|
|
884
|
+
text_span[i].classList.remove('text-dark');
|
|
885
|
+
text_span[i].classList.add('text-white');
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
for (var i = 0; i < text_strong.length; i++) {
|
|
889
|
+
if (text_strong[i].classList.contains('text-dark')) {
|
|
890
|
+
text_strong[i].classList.remove('text-dark');
|
|
891
|
+
text_strong[i].classList.add('text-white');
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
for (var i = 0; i < text_nav_link.length; i++) {
|
|
895
|
+
if (text_nav_link[i].classList.contains('text-dark')) {
|
|
896
|
+
text_nav_link[i].classList.remove('text-dark');
|
|
897
|
+
text_nav_link[i].classList.add('text-white');
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
for (var i = 0; i < secondary.length; i++) {
|
|
901
|
+
if (secondary[i].classList.contains('text-secondary')) {
|
|
902
|
+
secondary[i].classList.remove('text-secondary');
|
|
903
|
+
secondary[i].classList.add('text-white');
|
|
904
|
+
secondary[i].classList.add('opacity-8');
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
for (var i = 0; i < bg_gray_100.length; i++) {
|
|
908
|
+
if (bg_gray_100[i].classList.contains('bg-gray-100')) {
|
|
909
|
+
bg_gray_100[i].classList.remove('bg-gray-100');
|
|
910
|
+
bg_gray_100[i].classList.add('bg-gray-600');
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
for (var i = 0; i < btn_text_dark.length; i++) {
|
|
914
|
+
btn_text_dark[i].classList.remove('text-dark');
|
|
915
|
+
btn_text_dark[i].classList.add('text-white');
|
|
916
|
+
}
|
|
917
|
+
for (var i = 0; i < svg.length; i++) {
|
|
918
|
+
if (svg[i].hasAttribute('fill')) {
|
|
919
|
+
svg[i].setAttribute('fill', '#fff');
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
for (var i = 0; i < card_border.length; i++) {
|
|
923
|
+
card_border[i].classList.add('border-dark');
|
|
924
|
+
}
|
|
925
|
+
el.setAttribute("checked", "true");
|
|
926
|
+
} else {
|
|
927
|
+
body.classList.remove('dark-version');
|
|
928
|
+
for (var i = 0; i < hr.length; i++) {
|
|
929
|
+
if (hr[i].classList.contains('light')) {
|
|
930
|
+
hr[i].classList.add('dark');
|
|
931
|
+
hr[i].classList.remove('light');
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
for (var i = 0; i < hr_card.length; i++) {
|
|
935
|
+
if (hr_card[i].classList.contains('light')) {
|
|
936
|
+
hr_card[i].classList.add('dark');
|
|
937
|
+
hr_card[i].classList.remove('light');
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
for (var i = 0; i < text_btn.length; i++) {
|
|
941
|
+
if (text_btn[i].classList.contains('text-white')) {
|
|
942
|
+
text_btn[i].classList.remove('text-white');
|
|
943
|
+
text_btn[i].classList.add('text-dark');
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
for (var i = 0; i < text_span_white.length; i++) {
|
|
947
|
+
if (text_span_white[i].classList.contains('text-white') && !text_span_white[i].closest('.sidenav') && !text_span_white[i].closest('.card.bg-gradient-dark')) {
|
|
948
|
+
text_span_white[i].classList.remove('text-white');
|
|
949
|
+
text_span_white[i].classList.add('text-dark');
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
for (var i = 0; i < text_strong_white.length; i++) {
|
|
953
|
+
if (text_strong_white[i].classList.contains('text-white')) {
|
|
954
|
+
text_strong_white[i].classList.remove('text-white');
|
|
955
|
+
text_strong_white[i].classList.add('text-dark');
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
for (var i = 0; i < text_nav_link_white.length; i++) {
|
|
959
|
+
if (text_nav_link_white[i].classList.contains('text-white') && !text_nav_link_white[i].closest('.sidenav')) {
|
|
960
|
+
text_nav_link_white[i].classList.remove('text-white');
|
|
961
|
+
text_nav_link_white[i].classList.add('text-dark');
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
for (var i = 0; i < secondary.length; i++) {
|
|
965
|
+
if (secondary[i].classList.contains('text-white')) {
|
|
966
|
+
secondary[i].classList.remove('text-white');
|
|
967
|
+
secondary[i].classList.remove('opacity-8');
|
|
968
|
+
secondary[i].classList.add('text-dark');
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
for (var i = 0; i < bg_gray_600.length; i++) {
|
|
972
|
+
if (bg_gray_600[i].classList.contains('bg-gray-600')) {
|
|
973
|
+
bg_gray_600[i].classList.remove('bg-gray-600');
|
|
974
|
+
bg_gray_600[i].classList.add('bg-gray-100');
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
for (var i = 0; i < svg.length; i++) {
|
|
978
|
+
if (svg[i].hasAttribute('fill')) {
|
|
979
|
+
svg[i].setAttribute('fill', '#252f40');
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
for (var i = 0; i < btn_text_white.length; i++) {
|
|
983
|
+
if (!btn_text_white[i].closest('.card.bg-gradient-dark')) {
|
|
984
|
+
btn_text_white[i].classList.remove('text-white');
|
|
985
|
+
btn_text_white[i].classList.add('text-dark');
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
for (var i = 0; i < card_border_dark.length; i++) {
|
|
989
|
+
card_border_dark[i].classList.remove('border-dark');
|
|
990
|
+
}
|
|
991
|
+
el.removeAttribute("checked");
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
// side bullets
|
|
997
|
+
|
|
998
|
+
const indicators = document.querySelectorAll(".indicator");
|
|
999
|
+
const sections = document.querySelectorAll("section");
|
|
1000
|
+
|
|
1001
|
+
if (indicators) {
|
|
1002
|
+
const resetCurrentActiveIndicator = () => {
|
|
1003
|
+
const activeIndicator = document.querySelector(".indicator.active");
|
|
1004
|
+
if (activeIndicator) {
|
|
1005
|
+
activeIndicator.classList.remove("active");
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
|
|
1009
|
+
const onSectionLeavesViewport = (section) => {
|
|
1010
|
+
const observer = new IntersectionObserver(
|
|
1011
|
+
(entries) => {
|
|
1012
|
+
entries.forEach((entry) => {
|
|
1013
|
+
if (entry.isIntersecting) {
|
|
1014
|
+
resetCurrentActiveIndicator();
|
|
1015
|
+
const element = entry.target;
|
|
1016
|
+
const indicator = document.querySelector(`a[href='#${element.id}']`);
|
|
1017
|
+
if (indicator) {
|
|
1018
|
+
indicator.classList.add("active");
|
|
1019
|
+
}
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1023
|
+
}, {
|
|
1024
|
+
root: null,
|
|
1025
|
+
rootMargin: "0px",
|
|
1026
|
+
threshold: 0.75
|
|
1027
|
+
}
|
|
1028
|
+
);
|
|
1029
|
+
observer.observe(section);
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
indicators.forEach((indicator) => {
|
|
1033
|
+
indicator.addEventListener("click", function(event) {
|
|
1034
|
+
event.preventDefault();
|
|
1035
|
+
document
|
|
1036
|
+
.querySelector(this.getAttribute("href"))
|
|
1037
|
+
.scrollIntoView({
|
|
1038
|
+
behavior: "smooth"
|
|
1039
|
+
});
|
|
1040
|
+
resetCurrentActiveIndicator();
|
|
1041
|
+
this.classList.add("active");
|
|
1042
|
+
});
|
|
1043
|
+
});
|
|
1044
|
+
|
|
1045
|
+
sections.forEach(onSectionLeavesViewport);
|
|
1046
|
+
}
|