Skip to content

Commit

Permalink
info & energy coin pairs (#16)
Browse files Browse the repository at this point in the history
* ts++

* sorterize++

* safer distance

* position ++

* WIP + tests

* WIP Energy and Info activation coins

* cleanup types ++

* cleanup types ++

* +jest

* +tests

* tests ++

* tests ++

* ++ jest

* tests ++

* test ++

* better formatting for partial types

* test ++; memo keys rename

* fixes build error

* input ++

* supportformore animal formats

* deprecated info/energy dom

* fixes input field

* fixes rendering

* ++ form

* style ++

* style ++

* coin parsing ++

* coin parsing ++

* fixes tests

* so much stuff

* fixes destructure of null

* fixes op table

* refactor for better debugging

* fixes animal stack for partial types

* cleanup

* fixes activation table

* fixes activation table sort

* fixes initial rendering

* revive cleanCoinText

* fixes history

* cleanup

* fixes partial types

* style++

* fixes partial types

* fixes coinOD parsing

* bunp

* fixes parsing fftinecsp

* open in previous
  • Loading branch information
subtleGradient authored Aug 24, 2021
1 parent fd968c2 commit 3f62dbe
Show file tree
Hide file tree
Showing 21 changed files with 1,883 additions and 921 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["next/babel"]
}
114 changes: 79 additions & 35 deletions components/opt-toy/AOPActivationTable.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
import * as React from "react"
import { OPT512 } from "./OPT512"
import { betweenX } from "./between"
import {
Blast,
Consume,
Feeling,
iNtuition,
OPT512,
Play,
Sensing,
Sleep,
Thinking,
} from "./OPT512"
import { FC } from "react"
import { isSSR } from "../../util/constants"

export default function AOPActivationTable({ op512 }: { op512: OPT512 }) {
if (isSSR) {
return null
}
const showSex = op512.fmDe !== "?" || op512.fmS !== "?"
return (
<div className="AOPActivationTable">
<style jsx>{`
<style jsx global>{`
.AOPActivationTable {
box-sizing: border-box;
font-size: 1em;
Expand Down Expand Up @@ -62,7 +76,7 @@ export default function AOPActivationTable({ op512 }: { op512: OPT512 }) {
} */
.AOPActivationTable .pair {
.AOPActivationTable .pair:not(:empty) {
border: 2px solid blue;
}
.AOPActivationTable .pair.next {
Expand All @@ -78,8 +92,8 @@ export default function AOPActivationTable({ op512 }: { op512: OPT512 }) {
margin-right: 4px;
}
.AOPActivationTable .animal.index0 .pair,
.AOPActivationTable .animal.index1 .pair.previous {
.AOPActivationTable .animal.index0 .pair:not(:empty),
.AOPActivationTable .animal.index1 .pair.previous:not(:empty) {
border-color: #fff;
background: blue;
color: white;
Expand All @@ -97,39 +111,69 @@ export default function AOPActivationTable({ op512 }: { op512: OPT512 }) {
]

return (
<span
<AnimalColumn
key={code}
className={`animal ${Ox.sex + Dx.sex} ${code} ${flipSideIsLast &&
"flipSideIsLast"} index${index}`}
>
<span className="part sex">
{showSex && (Ox.sex + Dx.sex).toUpperCase()}
</span>
<span>
{Ox.code}
{Dx.code}
</span>
<span className={`aa`}>{code}</span>
<span
className={`part o ${next?.observer === Ox &&
"pair next"} ${previous?.observer === Ox && "pair previous"}`}
>
{showSex && <i>{Ox.sex}</i>}
{Ox.code}
{Ox.focus}
</span>
<span
className={`part o ${next?.decider === Dx &&
"pair next"} ${previous?.decider === Dx && "pair previous"}`}
>
{showSex && <i>{Dx.sex}</i>}
{Dx.code}
{Dx.focus}
</span>
</span>
{...{
code,
Ox,
Dx,
flipSideIsLast,
index,
showSex,
next,
previous,
}}
/>
)
},
)}
</div>
)
}

const AnimalColumn: FC<{
code: string
Ox?: Sensing | iNtuition
Dx?: Thinking | Feeling
flipSideIsLast: boolean
index: number
showSex: boolean
next?: Play | Sleep | Blast | Consume
previous?: Play | Sleep | Blast | Consume
}> = ({ code, Ox, Dx, flipSideIsLast, index, showSex, next, previous }) => {
return (
<span
key={code}
className={`animal ${Ox?.sex + Dx?.sex} ${code} ${
flipSideIsLast && "flipSideIsLast"
} index${index}`}
>
{showSex && (
<span className="part sex">{(Ox?.sex + Dx?.sex).toUpperCase()}</span>
)}
<span>
{Ox?.code}
{Dx?.code}
</span>
<span className={`aa`}>{code}</span>
<span
className={`part o ${next?.observer === Ox && "pair next"} ${
previous?.observer === Ox && "pair previous"
}`}
>
{showSex && <i>{Ox?.sex}</i>}
{Ox?.code}
{Ox?.focus}
</span>
<span
className={`part o ${next?.decider === Dx && "pair next"} ${
previous?.decider === Dx && "pair previous"
}`}
>
{showSex && <i>{Dx?.sex}</i>}
{Dx?.code}
{Dx?.focus}
</span>
</span>
)
}
Loading

1 comment on commit 3f62dbe

@vercel
Copy link

@vercel vercel bot commented on 3f62dbe Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.