]>
Commit | Line | Data |
---|---|---|
1 | (function(){ | |
2 | 'use strict'; | |
3 | function set_style(name){ | |
4 | $('#stylesheet').attr("href", "https://static.mindcoding.ro/css/" + name + ".css"); | |
5 | localStorage.setItem("theme", name); | |
6 | $(document).ready(function() { | |
7 | if(name == 'slate' || name == 'cyborg') | |
8 | $('.logo').removeClass('logo-light'); | |
9 | else | |
10 | $('.logo').addClass('logo-light'); | |
11 | }); | |
12 | } | |
13 | ||
14 | $( document ).ready(function() { | |
15 | $('#theme_slate' ).on('click', function () { set_style("slate"); }); | |
16 | $('#theme_cerulean').on('click', function () { set_style("cerulean"); }); | |
17 | $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); }); | |
18 | $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); }); | |
19 | }); | |
20 | ||
21 | var theme = localStorage.getItem("theme"); | |
22 | if(theme) { | |
23 | set_style(theme); | |
24 | } | |
25 | })(); |