Skip to content

Commit

Permalink
2212 : hide individual alt.tsx . combined alt in route 2212
Browse files Browse the repository at this point in the history
  • Loading branch information
nuoxoxo committed Sep 20, 2023
1 parent 601d084 commit bb149e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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")}
</button>
))}
Expand Down
23 changes: 13 additions & 10 deletions src/includes/Aoc2212.tsx
Original file line number Diff line number Diff line change
@@ -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 = ["○", '✲', '✳', '✵', '✶', '✻', '✼']
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -246,33 +249,33 @@ var Aoc2212 = () => {
</div>
<div className="playground playground-2212">

<div className="field data-field data-field-2212">
<div className={`field data-field-2212${choice === 'alt' ? '-alt' : ''}`}>
{/* { 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."}
</div>

<div className="field data-field data-field-2212">
<div className={`field data-field-2212${choice === 'alt' ? '-alt' : ''}`}>
{/* { 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."}
</div>

<div className="field data-field data-field-2212">
<div className={`field data-field-2212${choice === 'alt' ? '-alt' : ''}`}>
{/* { 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."}
</div>

<div className="field data-field data-field-2212">
<div className={`field data-field-2212${choice === 'alt' ? '-alt' : ''}`}>
{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."}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/styles/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ body {

.data-field-2212-alt {
font-family: monospace;
font-size: 1px;
font-size: 6px;
align-items: center;
color:$CREAM-YELLO;
}
Expand Down Expand Up @@ -304,7 +304,7 @@ body {
font-size: 7px;
}
.data-field-2212-alt {
font-size: 1px;
font-size: 4px;
// color:$CREAM-YELLO;
color: yellow;
}
Expand Down Expand Up @@ -378,7 +378,7 @@ body {

.data-field-2212-alt {

font-size: 1px;
font-size: 2px;
// font-weight:bolder;
}

Expand Down

0 comments on commit bb149e1

Please sign in to comment.