diff --git a/luasrc/app.js b/luasrc/app.js
index 6d4a69c..76c0de5 100644
--- a/luasrc/app.js
+++ b/luasrc/app.js
@@ -31,5 +31,34 @@
},
false
);
- })();
-
\ No newline at end of file
+ var checkboxes = document.querySelectorAll('.cbi-checkbox input[type="checkbox"]');
+
+ checkboxes.forEach(function(checkbox) {
+ var switchElement = document.createElement('label');
+ switchElement.className = 'switch';
+
+ var input = document.createElement('input');
+ input.type = 'checkbox';
+ input.checked = checkbox.checked;
+ switchElement.appendChild(input);
+
+ var slider = document.createElement('span');
+ slider.className = 'slider';
+ switchElement.appendChild(slider);
+
+ // Add the switch to the div wrapping the checkbox
+ checkbox.parentNode.insertBefore(switchElement, checkbox);
+
+ // Hide the original checkbox
+ checkbox.style.display = 'none';
+
+ input.addEventListener('change', function() {
+ checkbox.checked = this.checked;
+ });
+
+ var observer = new MutationObserver(function() {
+ input.checked = checkbox.checked;
+ });
+ observer.observe(checkbox, { attributes: true });
+ });
+ })();
\ No newline at end of file
diff --git a/template/header.htm b/template/header.htm
index 6c22f61..f2e14ba 100644
--- a/template/header.htm
+++ b/template/header.htm
@@ -60,43 +60,6 @@
-