sync
This commit is contained in:
parent
a5bffa763e
commit
752041a375
70 changed files with 7484 additions and 7443 deletions
17
app/utils/class-icons.ts
Normal file
17
app/utils/class-icons.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import combatMedic from "../images/icon_medic.png";
|
||||
import engineer from "../images/icon_engi.png";
|
||||
import heavyAssault from "../images/icon_heavy.png";
|
||||
import infiltrator from "../images/icon_infil.png";
|
||||
import lightAssault from "../images/icon_light.png";
|
||||
import max from "../images/icon_max.png";
|
||||
|
||||
export { combatMedic, engineer, heavyAssault, infiltrator, lightAssault, max };
|
||||
|
||||
export const classIconMap = {
|
||||
combatMedic,
|
||||
engineer,
|
||||
heavyAssault,
|
||||
infiltrator,
|
||||
lightAssault,
|
||||
max,
|
||||
};
|
|
@ -1,11 +1,6 @@
|
|||
export const saerroFetch = async <T>(query: string): Promise<T> => {
|
||||
const response = await fetch(
|
||||
`https://saerro.ps2.live/graphql?query=${query}`,
|
||||
{
|
||||
cf: {
|
||||
cacheTtl: 60,
|
||||
},
|
||||
}
|
||||
`https://saerro.ps2.live/graphql?query=${query}`
|
||||
);
|
||||
const json: { data: T } = await response.json();
|
||||
return json.data;
|
||||
|
@ -22,10 +17,10 @@ export type Zone = {
|
|||
id: string;
|
||||
name: string;
|
||||
population: Population;
|
||||
vehicles?: Record<typeof allVehicles[number], Population> & {
|
||||
vehicles?: Record<(typeof allVehicles)[number], Population> & {
|
||||
total: number;
|
||||
};
|
||||
classes?: Record<typeof allClasses[number], Population>;
|
||||
classes?: Record<(typeof allClasses)[number], Population>;
|
||||
};
|
||||
|
||||
export type World = {
|
||||
|
@ -83,6 +78,7 @@ export const worldQuery = async (worldID: string): Promise<WorldResponse> => {
|
|||
zones {
|
||||
all {
|
||||
id
|
||||
name
|
||||
classes {
|
||||
${allClasses.map((cls) => `${cls} { total nc tr vs }`).join(" ")}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import type { MetagameWorld } from "./metagame";
|
||||
import { totalPopulation, type Zone } from "./saerro";
|
||||
|
||||
export const contPrioritySort = (
|
||||
a: MetagameWorld["zones"][number],
|
||||
|
@ -41,3 +42,24 @@ export const contPrioritySort = (
|
|||
|
||||
return 0;
|
||||
};
|
||||
|
||||
export const zonePopulationSort = (a: Zone, b: Zone): number => {
|
||||
const total = ({ nc, vs, tr }: { nc: number; vs: number; tr: number }) =>
|
||||
nc + vs + tr;
|
||||
const ap = total(a.population);
|
||||
const bp = total(b.population);
|
||||
|
||||
if (ap < bp) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (ap > bp) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ap === bp) {
|
||||
return a.id < b.id ? 1 : -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
8
app/utils/theme.ts
Normal file
8
app/utils/theme.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
export const trFaction = "#d30101";
|
||||
export const ncFaction = "#1564cc";
|
||||
export const vsFaction = "#991cba";
|
||||
|
||||
export const background100 = "#222";
|
||||
export const background200 = "#444";
|
||||
|
||||
export const edge = "#4d4d4d";
|
60
app/utils/vehicle-icons.ts
Normal file
60
app/utils/vehicle-icons.ts
Normal file
|
@ -0,0 +1,60 @@
|
|||
import ant from "../images/vehicles/ant.png";
|
||||
import chimera from "../images/vehicles/chimera.png";
|
||||
import corsair from "../images/vehicles/corsair.png";
|
||||
import dervish from "../images/vehicles/dervish.png";
|
||||
import flash from "../images/vehicles/flash.png";
|
||||
import galaxy from "../images/vehicles/galaxy.png";
|
||||
import harasser from "../images/vehicles/harasser.png";
|
||||
import javelin from "../images/vehicles/javelin.png";
|
||||
import liberator from "../images/vehicles/liberator.png";
|
||||
import lightning from "../images/vehicles/lightning.png";
|
||||
import magrider from "../images/vehicles/magrider.png";
|
||||
import mosquito from "../images/vehicles/mosquito.png";
|
||||
import prowler from "../images/vehicles/prowler.png";
|
||||
import reaver from "../images/vehicles/reaver.png";
|
||||
import scythe from "../images/vehicles/scythe.png";
|
||||
import sunderer from "../images/vehicles/sunderer.png";
|
||||
import valkyrie from "../images/vehicles/valkyrie.png";
|
||||
import vanguard from "../images/vehicles/vanguard.png";
|
||||
|
||||
export {
|
||||
ant,
|
||||
chimera,
|
||||
corsair,
|
||||
dervish,
|
||||
flash,
|
||||
galaxy,
|
||||
harasser,
|
||||
javelin,
|
||||
liberator,
|
||||
lightning,
|
||||
magrider,
|
||||
mosquito,
|
||||
prowler,
|
||||
reaver,
|
||||
scythe,
|
||||
sunderer,
|
||||
valkyrie,
|
||||
vanguard,
|
||||
};
|
||||
|
||||
export const vehicleIconMap = {
|
||||
ant,
|
||||
chimera,
|
||||
corsair,
|
||||
dervish,
|
||||
flash,
|
||||
galaxy,
|
||||
harasser,
|
||||
javelin,
|
||||
liberator,
|
||||
lightning,
|
||||
magrider,
|
||||
mosquito,
|
||||
prowler,
|
||||
reaver,
|
||||
scythe,
|
||||
sunderer,
|
||||
valkyrie,
|
||||
vanguard,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue