mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-17 03:29:31 -07:00
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
22 lines
471 B
TypeScript
22 lines
471 B
TypeScript
// 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
|
|
}
|
|
)
|
|
}
|