fix(main.ts): import correct functions from utils module

feat(stage.ts): implement stage navigation functionality
feat(stageNav.ts): implement stage navigation overlay functionality
feat(state.ts): implement state management for index and threshold
feat(utils.ts): add utility functions for increment and decrement
This commit is contained in:
Sped0n
2023-10-29 00:58:53 +08:00
parent 2bc6d213ee
commit d32d5b5e4f
16 changed files with 515 additions and 712 deletions

21
assets/ts/resources.ts Normal file
View File

@@ -0,0 +1,21 @@
// data structure for images info
export interface ImageJSON {
index: number
url: string
imgH: number
imgW: number
pColor: string
sColor: string
}
export function initResources(): ImageJSON[] {
const imagesJson = document.getElementById('imagesSource') as HTMLScriptElement
return JSON.parse(imagesJson.textContent as string).sort(
(a: ImageJSON, b: ImageJSON) => {
if (a.index < b.index) {
return -1
}
return 1
}
)
}