]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into newmc
authorMarius Gavrilescu <marius@ieval.ro>
Mon, 20 Apr 2015 07:42:21 +0000 (10:42 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 20 Apr 2015 07:42:21 +0000 (10:42 +0300)
Conflicts:
css/custom.css

css/custom.css
js/90-themes.js

index 2d5060b837b3ca1412180d371d690f4a422b7730..e85a91b279cc552d775231230db017dca8048a25 100644 (file)
@@ -79,3 +79,7 @@ td.user, td.owner, .break-all {
 #themes:before {
        content: " Themes: ";
 }
+
+.transition-color, .transition-color * {
+       transition: color 0.5s ease-in, background-color 0.5s ease-in;
+}
index 756b15612991212da6c750ff7d7ad00655861ba5..347cad2db80ffa61f88583759136cf7c4de28851 100644 (file)
@@ -1,4 +1,8 @@
-function set_style(name){
+function set_style(name, trans){
+       if(trans){
+               document.body.classList.add('transition-color');
+               setTimeout(() => document.body.classList.remove('transition-color'), 1000);
+       }
        $('link[title]').each(e => e.disabled = true);
        $('link[title="' + name + '"]')[0].disabled = false;
        localStorage.setItem("theme", name);
@@ -17,12 +21,12 @@ $(function() {
                '<li><a role="button" data-theme="readable">White</a></ul>';
        var sidebar = $('#sidebar')[0];
        sidebar.insertBefore(m(theme_ul), sidebar.firstChild);
-       $('#themes a').on('click', e => set_style(e.target.dataset.theme));
+       $('#themes a').on('click', e => set_style(e.target.dataset.theme, true));
 });
 
 let theme = localStorage.getItem("theme");
 if(theme) {
        if(theme == "cerulean" || theme == "cosmo")
                theme = "readable";
-       set_style(theme);
+       set_style(theme, false);
 }
This page took 0.030252 seconds and 4 git commands to generate.