-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1002a93
commit ac3435b
Showing
10 changed files
with
267 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.KnownTypes { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.KnownTypes > .TypeTableCells { | ||
box-sizing: border-box; | ||
width: 25%; | ||
border-bottom: 2px solid #aaa; | ||
} | ||
|
||
.TypeTableCells { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
} | ||
.TypeTableCells > * { | ||
box-sizing: border-box; | ||
width: 25%; | ||
text-align: center; | ||
padding: 1ex 0; | ||
font-size: 0.8em; | ||
border: 2px solid transparent; | ||
cursor: pointer; | ||
} | ||
.TypeTableCell[data-optype]:hover { | ||
border-color: #000; | ||
} | ||
|
||
.TypeTableCell[data-optype*="Ni/"], | ||
.TypeTableCell[data-optype*="Si/"] { | ||
background: #c9daf8; | ||
} | ||
.TypeTableCell[data-optype*="Ne/"], | ||
.TypeTableCell[data-optype*="Se/"] { | ||
background: #d9ead3; | ||
} | ||
.TypeTableCell[data-optype*="Fi/"], | ||
.TypeTableCell[data-optype*="Ti/"] { | ||
background: #efefef; | ||
} | ||
.TypeTableCell[data-optype*="Fe/"], | ||
.TypeTableCell[data-optype*="Te/"] { | ||
background: #f4cccc; | ||
} | ||
|
||
@media (max-width: 424px) { | ||
.KnownTypes > .TypeTableCells { | ||
width: 50%; | ||
} | ||
} | ||
@media (min-width: 425px) and (max-width: 767px) { | ||
.KnownTypes > .TypeTableCells { | ||
width: 25%; | ||
} | ||
} | ||
@media (min-width: 768px) { | ||
.KnownTypes > .TypeTableCells { | ||
width: 25%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,115 @@ | ||
import * as React from "react"; | ||
import knownTypes from "./known-types.sheet.json"; | ||
import { OPT512 } from "./OPT512"; | ||
import * as React from "react" | ||
import knownTypes from "./known-types.sheet.json" | ||
import { OPT512 } from "./OPT512" | ||
import "./KnownTypes.css" | ||
|
||
export interface KnownType { | ||
opType: OPT512; | ||
index: number; | ||
"oPT#": number; | ||
"oPT#+": string; | ||
"m/F": string; | ||
saviors: string; | ||
animals: string; | ||
typeCode: string; | ||
doublyActivatedFunctions: string; | ||
people1: string | null; | ||
people2: string | null; | ||
people3: string | null; | ||
people4: string | null; | ||
people5: string | null; | ||
people6: string | null; | ||
people7: string | null; | ||
people8: string | null; | ||
people9: string | null; | ||
people10: string | null; | ||
people11: string | null; | ||
people12: string | null; | ||
people13: string | null; | ||
people14: string | null; | ||
opType: OPT512 | ||
index: number | ||
"oPT#": number | ||
"oPT#+": string | ||
"m/F": string | ||
saviors: string | ||
animals: string | ||
typeCode: string | ||
doublyActivatedFunctions: string | ||
people1: string | null | ||
people2: string | null | ||
people3: string | null | ||
people4: string | null | ||
people5: string | null | ||
people6: string | null | ||
people7: string | null | ||
people8: string | null | ||
people9: string | null | ||
people10: string | null | ||
people11: string | null | ||
people12: string | null | ||
people13: string | null | ||
people14: string | null | ||
} | ||
|
||
export const KNOWN_TYPES: KnownType[] = knownTypes.map(knownType => ({ | ||
...knownType, | ||
opType: OPT512.fromCoinText(knownType.typeCode) | ||
})); | ||
opType: OPT512.fromCoinText(knownType.typeCode), | ||
})) | ||
|
||
export function KnownTypes({ addType, Cell = TypeTableCell }) { | ||
return ( | ||
<div className="type-table"> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(0, 32)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(32, 64)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(64, 96)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(96, 128)} /> | ||
// prettier-ignore | ||
<div className="KnownTypes"> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(0, 32)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(32, 64)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(64, 96)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(96, 128)} /> | ||
</div> | ||
); | ||
) | ||
} | ||
|
||
export function KnownTypesTable({ addType, filters, Cell = TypeTableCell }) { | ||
let o = 0; | ||
let o = 0 | ||
return ( | ||
<div className="type-table"> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<TypeTable | ||
addType={addType} Cell={Cell} | ||
kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} | ||
/> | ||
// prettier-ignore | ||
<div> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} /> | ||
{void (o += 128)} | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<TypeTable | ||
addType={addType} Cell={Cell} | ||
kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} | ||
/> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} /> | ||
{void (o += 128)} | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<TypeTable | ||
addType={addType} Cell={Cell} | ||
kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} | ||
/> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} /> | ||
{void (o += 128)} | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<TypeTable addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<TypeTable | ||
addType={addType} Cell={Cell} | ||
kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} | ||
/> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 0, o + 32)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 32, o + 64)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 64, o + 96)} /> | ||
<Cells addType={addType} Cell={Cell} kTypes={KNOWN_TYPES.slice(o + 96, o + 128)} /> | ||
</div> | ||
); | ||
) | ||
} | ||
|
||
function TypeTable({ kTypes, addType, Cell = TypeTableCell }) { | ||
function Cells({ kTypes, addType, Cell = TypeTableCell }) { | ||
return ( | ||
<div className="type-table with-cells"> | ||
<div>{kTypes[0].animals}</div> | ||
<div>{kTypes[1].animals}</div> | ||
<div>{kTypes[2].animals}</div> | ||
<div>{kTypes[3].animals}</div> | ||
<div className="TypeTableCells"> | ||
<div className="TypeTableCell">{kTypes[0].animals}</div> | ||
<div className="TypeTableCell">{kTypes[1].animals}</div> | ||
<div className="TypeTableCell">{kTypes[2].animals}</div> | ||
<div className="TypeTableCell">{kTypes[3].animals}</div> | ||
{kTypes.map((kType: KnownType) => ( | ||
<Cell key={kType.typeCode} kType={kType} addType={addType} /> | ||
<Cell | ||
key={kType.typeCode} | ||
className="TypeTableCell" | ||
kType={kType} | ||
addType={addType} | ||
/> | ||
))} | ||
</div> | ||
); | ||
) | ||
} | ||
function TypeTableCell({ kType, addType }) { | ||
function TypeTableCell({ kType, addType, className }) { | ||
return ( | ||
<a | ||
className={className} | ||
key={kType.typeCode} | ||
data-optype={kType.typeCode} | ||
onClick={e => { | ||
e.preventDefault(); | ||
e.preventDefault() | ||
addType( | ||
kType.typeCode | ||
.split("-") | ||
.slice(1) | ||
.join("-"), | ||
kType.typeCode | ||
); | ||
kType.typeCode, | ||
) | ||
}} | ||
> | ||
{kType.typeCode.split("-")[1]} | ||
</a> | ||
); | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ac3435b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: