Build and deploy of version 29028296

This commit is contained in:
Renan LE CARO 2025-03-11 13:56:42 +01:00
parent a136475f88
commit 8b1278cb55
8 changed files with 325 additions and 3926 deletions

View file

@ -69,11 +69,14 @@ function levelIconHTML(
return `<img alt="${levelName}" width="${size}" height="${size}" src="${c.toDataURL()}"/>`;
}
export const icons = {} as {[k:string]:string};
export const icons = {} as { [k: string]: string };
export const allLevels = rawLevelsList
.map((level) => {
const bricks = level.bricks.split("").map((c) => palette[c]);
const bricks = level.bricks
.split("")
.map((c) => palette[c])
.slice(0, level.size * level.size);
const icon = levelIconHTML(bricks, level.size, level.name, level.color);
icons[level.name] = icon;
let svg = level.svg;
@ -89,17 +92,16 @@ export const allLevels = rawLevelsList
};
})
.filter((l) => !l.name.startsWith("icon:"))
.map((l,li)=>({
...l,
threshold:li < 8
? 0
: Math.round(
Math.min(Math.pow(10, 1 + (li + l.size) / 30) * 10, 5000) * li,
),
sortKey:((Math.random() + 3) / 3.5) * l.bricks.filter((i) => i).length
})) as Level[];
.map((l, li) => ({
...l,
threshold:
li < 8
? 0
: Math.round(
Math.min(Math.pow(10, 1 + (li + l.size) / 30) * 10, 5000) * li,
),
sortKey: ((Math.random() + 3) / 3.5) * l.bricks.filter((i) => i).length,
})) as Level[];
export const upgrades = rawUpgrades.map((u) => ({
...u,