X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-themes.js;h=5196574e3064decfb59ce85729acb174c51ff530;hb=68b0f287c76694f2935b6039a42d6359287f4c4f;hp=a94d1300d9434140fc60004ea80eff1a09fb30fe;hpb=db73dc0cea19c7992776392125cd49e28014ea81;p=plack-app-gruntmaster.git diff --git a/js/90-themes.js b/js/90-themes.js index a94d130..5196574 100644 --- a/js/90-themes.js +++ b/js/90-themes.js @@ -3,8 +3,16 @@ function set_style(name, trans){ document.body.classList.add('transition-color'); setTimeout(() => document.body.classList.remove('transition-color'), 1000); } + if(q('html').className == name) + return; q('html').className = name; localStorage.setItem("theme", name); + $(function() { + if(name == 'slate' || name == 'cyborg') + $('img').each(e => e.setAttribute('src', e.getAttribute('src').replace('logos/light', 'logos/dark'))); + else + $('img').each(e => e.setAttribute('src', e.getAttribute('src').replace('logos/dark', 'logos/light'))); + }); } $(function() {