X-Git-Url: http://git.ieval.ro/?p=gruntmaster-page.git;a=blobdiff_plain;f=js%2F90-themes.js;fp=js%2F90-themes.js;h=74506c83b98ba7e951d92a5749955c4f1a3d1ec5;hp=0000000000000000000000000000000000000000;hb=a2e95804fc16f38436b5009629f60051a0123d1a;hpb=124680e8c318f83b91c80e5edb62f287f42de846 diff --git a/js/90-themes.js b/js/90-themes.js new file mode 100644 index 0000000..74506c8 --- /dev/null +++ b/js/90-themes.js @@ -0,0 +1,20 @@ +(function(){ + 'use strict'; + function set_style(name){ + $('#stylesheet').attr("href", "/css/" + name + ".css"); + localStorage.setItem("theme", name); + } + + $( document ).ready(function() { + $('#theme-selector').removeClass('hidden'); + $('#theme_slate' ).on('click', function () { set_style("slate"); }); + $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); + $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); + $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); }); + }); + + var theme = localStorage.getItem("theme"); + if(theme) { + set_style(theme); + } +})();