Add homepage and make bridges look nice

This commit is contained in:
2026-02-06 23:09:51 +00:00
parent d406db9d18
commit d53748f8ae
16 changed files with 818 additions and 355 deletions

View File

@@ -4,13 +4,30 @@ import path from 'path';
const inputDir = './static/mapFiles/yaml';
const outputDir = './static/mapFiles/json';
const indexFile = './static/map-index.json';
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, { recursive: true });
const mapList = [];
fs.readdirSync(inputDir).forEach((file) => {
if (file.endsWith('.yaml')) {
const content = yaml.load(fs.readFileSync(path.join(inputDir, file), 'utf8'));
const fullPath = path.join(inputDir, file);
const content = yaml.load(fs.readFileSync(fullPath, 'utf8'));
const fileName = file.replace('.yaml', '.json');
fs.writeFileSync(path.join(outputDir, fileName), JSON.stringify(content));
mapList.push({
routeId: content.routeId || null,
routeStart: content.routeStart || null,
routeEnd: content.routeEnd || null,
created: content.created || null,
checked: content.checked || null,
});
}
});
fs.writeFileSync(indexFile, JSON.stringify(mapList));
console.log(`Generated ${mapList.length} map files and index.`)