diff --git a/Src/assets/js/changetheme.js b/Src/assets/js/changetheme.js new file mode 100644 index 0000000..d7a9574 --- /dev/null +++ b/Src/assets/js/changetheme.js @@ -0,0 +1,24 @@ +var elForm,elSelectedTheme1,elSelectedTheme2,currentTheme +mainbody = document.getElementById('mainbody'); +currentTheme = document.getElementById('mainbody').getAttribute('class'); +elForm = document.getElementById('form-theme'); +elSelectedTheme1 = document.getElementById('exampleRadios1'); +elSelectedTheme2 = document.getElementById('exampleRadios2'); +console.log(elForm,elSelectedTheme1,elSelectedTheme2,currentTheme); + +// document.querySelector('input[name="Theme"]:checked').value; + +function selectTheme(e){ + if(!elSelectedTheme1.checked && !elSelectedTheme2.checked){ + // elSelectThemeHint.textContent = 'Devi selezionare almeno un tema!' + console.log('Devi selezionare almeno un tema!'); + }else if (!elSelectedTheme2.checked){ + var selectedTheme = elSelectedTheme1.value; + mainbody.className = selectedTheme; + }else{ + var selectedTheme = elSelectedTheme2.value; + mainbody.className = selectedTheme; + } +} + +elForm.addEventListener('change',selectTheme,false); \ No newline at end of file diff --git a/Src/profilo.html b/Src/profilo.html index a6c4f60..dd4b12d 100644 --- a/Src/profilo.html +++ b/Src/profilo.html @@ -164,6 +164,21 @@

NOME PROFILO


+
+
+ + +
+
+ + +
+
+

Lorem ipsum dolor sit amet consectetur adipisicing elit. Eveniet dolorum unde ea laborum eum iure beatae totam assumenda, quisquam architecto nemo, quod blanditiis asperiores magnam commodi exercitationem excepturi dolorem a!

@@ -307,5 +322,6 @@ - + + \ No newline at end of file