-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #394 from xianmin/v3
Jane Theme V3 Major Update
- Loading branch information
Showing
385 changed files
with
314,987 additions
and
1,696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
{ | ||
"plugins": ["prettier-plugin-go-template"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.html"], | ||
"files": ["*.html", "*.css"], | ||
"options": { | ||
"parser": "go-template" | ||
"parser": "go-template", | ||
"singleQuote": false | ||
} | ||
} | ||
], | ||
"goTemplateBracketSpacing": true | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Toogle Theme | ||
|
||
function initThemeToggle() { | ||
const html = document.documentElement; | ||
const themeToggles = document.querySelectorAll('.theme-toggle'); | ||
|
||
function setTheme(theme) { | ||
html.setAttribute('data-theme', theme); | ||
localStorage.setItem('theme', theme); | ||
} | ||
|
||
function toggleTheme() { | ||
const currentTheme = html.getAttribute('data-theme'); | ||
const newTheme = currentTheme === 'light' ? 'dark' : 'light'; | ||
setTheme(newTheme); | ||
} | ||
|
||
// 为所有切换按钮添加事件监听器 | ||
themeToggles.forEach(toggle => { | ||
toggle.addEventListener('click', function (e) { | ||
e.preventDefault(); | ||
toggleTheme(); | ||
}); | ||
}); | ||
} | ||
|
||
export default initThemeToggle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.