diff --git a/src/App.tsx b/src/App.tsx index 8572d61..fd12fcd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; // import Aoc2223 from "./includes/Aoc2223"; import Aoc2222 from "./includes/Aoc2222"; import Aoc2212 from "./includes/Aoc2212"; // New New -import Aoc2212Alt from "./includes/Aoc2212Alt"; +// import Aoc2212Alt from "./includes/Aoc2212Alt"; import Aoc2210 from "./includes/Aoc2210"; import Aoc2105 from "./includes/Aoc2105"; // New import Aoc2003 from "./includes/Aoc2003"; // New New @@ -27,7 +27,7 @@ const routes: { [key: string]: TargetRoute } = { // 2223: Aoc2223, 2222: Aoc2222, 2212: Aoc2212, // New - '2212Alt': Aoc2212Alt, // New + // '2212Alt': Aoc2212Alt, // New 2210: Aoc2210, 2105: Aoc2105, 2003: Aoc2003, @@ -78,7 +78,7 @@ function App() { > { key === "DadJokes" ? "Jokes" : key === "Nut" ? "Nut" - : key === '2212Alt' ? "22:12\'" + // : key === '2212Alt' ? "22:12\'" : key.replace(/^(\d{2})(\d{1,2})$/, "$1:$2")} ))} diff --git a/src/includes/Aoc2212.tsx b/src/includes/Aoc2212.tsx index 0df5e61..52a86c6 100644 --- a/src/includes/Aoc2212.tsx +++ b/src/includes/Aoc2212.tsx @@ -1,7 +1,10 @@ import { useState, useEffect } from "react" import { FetchData, LenNStrsFromLine } from "../helpers/Helpers" -const choice:string = 'in' +const [sp1, sp2] = [' ', ''] + +const suffixes = ['in', 'alt'] +const choice = suffixes[Math.floor(Math.random() * suffixes.length)] const URL:string = "https://raw.githubusercontent.com/nuoxoxo/in/main/aoc/2212." + choice const symbolArr = ["○", '✲', '✳', '✵', '✶', '✻', '✼'] @@ -76,7 +79,7 @@ var Aoc2212 = () => { while (++i < mp.length) { let j: number = -1 while (++j < mp[i].length) { - if (mp[i][j] > 170) { + if (mp[i][j] > (choice == 'in' ? 170 : 242)) { tempGrid[i][j] = symbol } } @@ -246,33 +249,33 @@ var Aoc2212 = () => {
-
+
{/* { p2Grid ? p2Grid.join('\n') : "No data available." } */} { p2Grid - ? p2Grid.map((line) => line.split("").join(" ")).join("\n") + ? p2Grid.map((line) => line.split("").join(choice === 'alt' ? sp2 : sp1)).join("\n") : "No data available."}
-
+
{/* { p1Grid ? p1Grid.join("\n") : "No data available." } */} { p1Grid - ? p1Grid.map((line) => line.split("").join(" ")).join("\n") + ? p1Grid.map((line) => line.split("").join(choice === 'alt' ? sp2 : sp1)).join("\n") : "No data available."}
-
+
{/* { p2Grid ? p2Grid.join('\n') : "No data available." } */} { P2Path - ? P2Path.map((line) => line.split("").join(" ")).join("\n") + ? P2Path.map((line) => line.split("").join(choice === 'alt' ? sp2 : sp1)).join("\n") : "No data available."}
-
+
{lines ? lines.length === 1 ? LenNStrsFromLine(lines[0], 16).join("\n") : // : lines.join("\n") - lines.map((line) => line.split("").join(" ")).join("\n") + lines.map((line) => line.split("").join(choice === 'alt' ? sp2 : sp1)).join("\n") : "No data available."}
diff --git a/src/styles/App.scss b/src/styles/App.scss index a104fa8..4e9fd5b 100644 --- a/src/styles/App.scss +++ b/src/styles/App.scss @@ -179,7 +179,7 @@ body { .data-field-2212-alt { font-family: monospace; - font-size: 1px; + font-size: 6px; align-items: center; color:$CREAM-YELLO; } @@ -304,7 +304,7 @@ body { font-size: 7px; } .data-field-2212-alt { - font-size: 1px; + font-size: 4px; // color:$CREAM-YELLO; color: yellow; } @@ -378,7 +378,7 @@ body { .data-field-2212-alt { - font-size: 1px; + font-size: 2px; // font-weight:bolder; }