Themes: add themes page

This commit is contained in:
He4eT 2023-05-28 02:22:05 +03:00 committed by Alexey
commit fd49342e12
7 changed files with 149 additions and 8 deletions

View file

@ -7,7 +7,6 @@ export const themes = [
'solarized-dark',
/* Original */
'emo',
'nord',
'redrum',
'toxin',
'valve',
@ -120,6 +119,7 @@ export const themes = [
'nautilus',
'nebula',
'night_runner',
'nord',
'nord_light',
'norse',
'oblivion',

View file

@ -27,5 +27,10 @@ export const useThemeEngine = (initialTheme = getSavedTheme()) => {
localStorage.setItem(LS_THEME_KEY, newTheme)
}
return { currentTheme, setTheme, themes }
const setRandomTheme = () => {
const randomTheme = themes[Math.floor(Math.random() * themes.length)]
setTheme(randomTheme)
}
return { currentTheme, setTheme, setRandomTheme, themes }
}