#themes:before {
content: " Themes: ";
-}
\ No newline at end of file
+}
+
+.transition-color, .transition-color * {
+ transition: color 0.5s ease-in, background-color 0.5s ease-in;
+}
-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);
'<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);
}