19 lines
550 B
JavaScript
19 lines
550 B
JavaScript
|
$(document).ready(function() {
|
||
|
if (localStorage.getItem('theme') != '') {
|
||
|
$('html').addClass(localStorage.getItem('theme'));
|
||
|
}
|
||
|
|
||
|
$('.logo .sub').on('click', function(event) {
|
||
|
if (event.ctrlKey) {
|
||
|
var classes = ["tablecloth", "weave", "madras", "tartan", "seigaiha"];
|
||
|
var selectedTheme = classes[~~(Math.random()*classes.length)];
|
||
|
|
||
|
$('html').removeClass().addClass(selectedTheme);
|
||
|
localStorage.setItem('theme', selectedTheme);
|
||
|
}
|
||
|
if (event.altKey) {
|
||
|
$('html').removeClass();
|
||
|
localStorage.removeItem('theme');
|
||
|
}
|
||
|
});
|
||
|
});
|