mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
15 lines
457 B
TypeScript
15 lines
457 B
TypeScript
import { type ImageData } from './utils'
|
|
|
|
// fetch images info from JSON
|
|
const imageArrayElement = document.getElementById('images_array') as HTMLScriptElement
|
|
const rawImageArray = imageArrayElement.textContent as string
|
|
export const imagesArray: ImageData[] = JSON.parse(rawImageArray).sort(
|
|
(a: ImageData, b: ImageData) => {
|
|
if (a.index < b.index) {
|
|
return -1
|
|
}
|
|
return 1
|
|
}
|
|
)
|
|
export const imagesArrayLen: number = imagesArray.length
|