mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 00:16:51 +00:00
Improve homepage (#245)
* Improve how generators are listed on home * Add some icons for generators * Remove debug * Refactor cachedFetch and use generated changelogs * Add limit to how many changes are shown by default * Add more generator icons * Refactor cards * Fix generator icons for light theme * Add more worldgen icons * Add remaining generator icons * Refactor navigation and badges style * Group on homepage for guides and tools * Fix header button style * Add versions and technical changelog to homepage * Make it clear that not all changes could be documented
This commit is contained in:
@@ -16,6 +16,7 @@ export namespace Store {
|
||||
export const ID_PROJECT_PANEL_OPEN = 'misode_project_panel_open'
|
||||
export const ID_OPEN_PROJECT = 'misode_open_project'
|
||||
export const ID_TREE_VIEW_MODE = 'misode_tree_view_mode'
|
||||
export const ID_GENERATOR_HISTORY = 'misode_generator_history'
|
||||
|
||||
export function getLanguage() {
|
||||
return localStorage.getItem(ID_LANGUAGE) ?? 'en'
|
||||
@@ -84,6 +85,10 @@ export namespace Store {
|
||||
return localStorage.getItem(ID_TREE_VIEW_MODE) ?? 'resources'
|
||||
}
|
||||
|
||||
export function getGeneratorHistory(): string[] {
|
||||
return JSON.parse(localStorage.getItem(ID_GENERATOR_HISTORY) ?? '[]')
|
||||
}
|
||||
|
||||
export function setLanguage(language: string | undefined) {
|
||||
if (language) localStorage.setItem(ID_LANGUAGE, language)
|
||||
}
|
||||
@@ -145,4 +150,10 @@ export namespace Store {
|
||||
export function setTreeViewMode(mode: string | undefined) {
|
||||
if (mode) localStorage.setItem(ID_TREE_VIEW_MODE, mode)
|
||||
}
|
||||
|
||||
export function visitGenerator(id: string) {
|
||||
const history = getGeneratorHistory()
|
||||
history.push(id)
|
||||
localStorage.setItem(ID_GENERATOR_HISTORY, JSON.stringify(history.slice(-50)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user