Remove nesting
This commit is contained in:
parent
0d3662d9fe
commit
d22cf34a0e
1 changed files with 8 additions and 13 deletions
|
@ -23,37 +23,32 @@ const colourPool = [
|
|||
|
||||
export default function LargeType({ chars }: { chars: string[] }) {
|
||||
return (
|
||||
<table
|
||||
<div
|
||||
style={{
|
||||
fontSize: "4rem",
|
||||
fontWeight: "bold",
|
||||
fontFamily: "monospace",
|
||||
display: "flex",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
{chars.map((char, i) => (
|
||||
<tr
|
||||
<span
|
||||
key={i}
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
padding: "0.5rem",
|
||||
lineHeight: 1.2,
|
||||
// alternating background
|
||||
backgroundColor: i % 2 === 0 ? "#2e2e2e" : "#5e5e5e",
|
||||
// varying colors
|
||||
color: colourPool[i % colourPool.length],
|
||||
}}
|
||||
>
|
||||
<span
|
||||
style={{
|
||||
color: colourPool[i % colourPool.length],
|
||||
lineHeight: 1.2,
|
||||
}}
|
||||
>
|
||||
{char}
|
||||
</span>
|
||||
</tr>
|
||||
{char}
|
||||
</span>
|
||||
))}
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue