This commit is contained in:
41666 2024-07-15 14:13:23 -04:00
parent a5bffa763e
commit 752041a375
70 changed files with 7484 additions and 7443 deletions

View file

@ -1,10 +1,10 @@
import { json, type V2_MetaFunction } from "@remix-run/cloudflare";
import { json, type MetaFunction } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { Footer } from "~/components/footer";
import { WorldContainer } from "~/components/index-world-container";
import { outer } from "~/components/index.css";
import { fetchMetagameWorlds } from "~/utils/metagame";
import { fetchPopulationWorlds } from "~/utils/population";
import { Footer } from "../components/footer";
import { WorldContainer } from "../components/index-world-container";
import { outer } from "../components/index.css";
import { fetchMetagameWorlds } from "../utils/metagame";
import { fetchPopulationWorlds } from "../utils/population";
export const loader = async () => {
const [metagame, population] = await Promise.all([
@ -15,7 +15,7 @@ export const loader = async () => {
return json({ metagame: metagame.sort((a, b) => a.id - b.id), population });
};
export const meta: V2_MetaFunction = () => {
export const meta: MetaFunction = () => {
return [
{ title: "PS2.LIVE" },
{

View file

@ -1,4 +1,4 @@
import { Footer } from "~/components/footer";
import { Footer } from "../components/footer";
import {
header,
item,
@ -8,7 +8,7 @@ import {
link,
love,
outer,
} from "~/components/about.css";
} from "../components/about.css";
export default function About() {
return (

View file

@ -1,7 +1,8 @@
import { useState } from "react";
import { FactionBar } from "~/components/faction-bar";
import { FactionPie } from "~/components/faction-pie";
import type { Population } from "~/utils/saerro";
import { FactionBar } from "../components/faction-bar";
import { FactionPie } from "../components/faction-pie";
import type { Population } from "../utils/saerro";
import { FactionBarSxS } from "../components/faction-bar-sxs";
export default function DebugComponents() {
const [population, setPopulation] = useState<Population>({
@ -66,6 +67,10 @@ export default function DebugComponents() {
value={innerColor}
onChange={(e) => setInnerColor(e.target.value)}
/>
<h3>Vertical Side-by-Side Bar Chart</h3>
<div style={{ fontSize: "5rem" }}>
<FactionBarSxS population={population}></FactionBarSxS>
</div>
</div>
</div>
);

View file

@ -1,32 +1,33 @@
import type { LoaderArgs, V2_MetaFunction } from "@remix-run/cloudflare";
import { json } from "@remix-run/cloudflare";
import type { MetaFunction } from "@remix-run/node";
import { json } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import { Footer } from "~/components/footer";
import type { MetagameWorld } from "~/utils/metagame";
import { fetchSingleMetagameWorld } from "~/utils/metagame";
import type { WorldResponse, Zone } from "~/utils/saerro";
import { Footer } from "../components/footer";
import type { MetagameWorld } from "../utils/metagame";
import { fetchSingleMetagameWorld } from "../utils/metagame";
import type { WorldResponse, Zone } from "../utils/saerro";
import {
allClasses,
allVehicles,
totalPopulation,
worldQuery,
} from "~/utils/saerro";
} from "../utils/saerro";
import {
pascalCaseToTitleCase,
toTitleCase,
worlds,
zones,
} from "~/utils/strings";
import * as styles from "~/components/world.css";
import { c } from "~/utils/classes";
import { FactionBar } from "~/components/faction-bar";
import { popImage } from "~/components/index-world.css";
import vsLogo from "~/images/vs-100.png";
import ncLogo from "~/images/nc-100.png";
import trLogo from "~/images/tr-100.png";
import { FactionPie } from "~/components/faction-pie";
import { AlertTimer } from "~/components/alert-timer";
import { contPrioritySort } from "~/utils/sorting";
} from "../utils/strings";
import * as styles from "../components/world.css";
import { c } from "../utils/classes";
import { FactionBar } from "../components/faction-bar";
import { popImage } from "../components/index-world.css";
import vsLogo from "../images/vs-100.png";
import ncLogo from "../images/nc-100.png";
import trLogo from "../images/tr-100.png";
import { FactionPie } from "../components/faction-pie";
import { AlertTimer } from "../components/alert-timer";
import { contPrioritySort, zonePopulationSort } from "../utils/sorting";
import { WorldZoneContainer } from "../components/world-zone-container";
type LoaderData = {
saerro: WorldResponse;
@ -34,7 +35,7 @@ type LoaderData = {
id: string;
};
export async function loader({ params }: LoaderArgs) {
export async function loader({ params }) {
const [saerro, metagame] = await Promise.all([
worldQuery(params.id as string),
fetchSingleMetagameWorld(params.id as string),
@ -42,7 +43,7 @@ export async function loader({ params }: LoaderArgs) {
return json({ saerro, metagame, id: params.id } as LoaderData);
}
export const meta: V2_MetaFunction<typeof loader> = ({ data }) => {
export const meta: MetaFunction<typeof loader> = ({ data }) => {
const { saerro, id } = data as LoaderData;
const date = new Date();
const worldInfo = worlds[String(id || "default")];
@ -168,10 +169,13 @@ export default function World() {
</div>
</div>
<div>
<h2>Continents</h2>
{world.zones.all.map((zone) => (
<ZoneInfo zone={zone} key={zone.id} />
))}
<h2 className={styles.headerFont}>WARZONES</h2>
<div>
{world.zones.all.sort(zonePopulationSort).map((zone) => (
<WorldZoneContainer key={zone.id} world={world} zone={zone} />
// <ZoneInfo key={zone.id} zone={zone} />
))}
</div>
</div>
</div>
</div>
@ -183,8 +187,8 @@ export default function World() {
const ZoneInfo = ({ zone }: { zone: Zone }) => {
const zoneInfo = zones[String(zone.id)];
return (
<section>
<h3>{zoneInfo.name}</h3>
<section className={styles.zone}>
<h3 className={styles.headerFont}>{zoneInfo.name.toUpperCase()}</h3>
<p>
{totalPopulation(zone.population)} players ({zone.population.vs} VS,{" "}
{zone.population.nc} NC, {zone.population.tr} TR)