no title toggle, default dark
This commit is contained in:
parent
13dfc43bbd
commit
6c8ea56f56
@ -19,19 +19,9 @@ jQuery(function($) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_Blog.changeTitle = function() {
|
|
||||||
var currentTitle = document.title;
|
|
||||||
window.onblur = function() {
|
|
||||||
document.title = 'I miss you!(>﹏<)';
|
|
||||||
}
|
|
||||||
window.onfocus = function() {
|
|
||||||
document.title = currentTitle;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
_Blog.toggleTheme = function() {
|
_Blog.toggleTheme = function() {
|
||||||
const currentTheme = window.localStorage && window.localStorage.getItem('theme')
|
const currentTheme = window.localStorage && window.localStorage.getItem('theme')
|
||||||
const isDark = currentTheme === 'dark'
|
const isDark = currentTheme === undefined || currentTheme === 'dark'
|
||||||
$('body').toggleClass('dark-theme', isDark)
|
$('body').toggleClass('dark-theme', isDark)
|
||||||
$('.theme-switch').on('click', () => {
|
$('.theme-switch').on('click', () => {
|
||||||
$('body').toggleClass('dark-theme')
|
$('body').toggleClass('dark-theme')
|
||||||
@ -49,7 +39,6 @@ jQuery(function($) {
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
_Blog.prettify()
|
_Blog.prettify()
|
||||||
_Blog.changeTitle()
|
|
||||||
_Blog.toggleTheme()
|
_Blog.toggleTheme()
|
||||||
_Blog.toggleMobileMenu()
|
_Blog.toggleMobileMenu()
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user