-
Notifications
You must be signed in to change notification settings - Fork 0
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
a6c1a86
commit 28b7a07
Showing
3 changed files
with
70 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {taxonomy} from "@/app/taxonomy"; | ||
import styles from "./taxonomy.module.css" | ||
|
||
export default function Page() { | ||
function tax(n: string, lv: number) { | ||
return <div className={styles.outer}> | ||
<input type="checkbox" id={n} defaultChecked={lv < 3}/> | ||
<label htmlFor={n}>{n}</label> | ||
<div className={styles.inner}>{taxonomy[n]["c"].map((s: string) => tax(s, lv + 1))}</div> | ||
</div> | ||
} | ||
|
||
return <main> | ||
<div className={styles.tax}> | ||
{tax("Viridiplantae", 0)} | ||
</div> | ||
</main> | ||
} |
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,42 @@ | ||
.tax { | ||
padding: 3em; | ||
overflow: auto; | ||
height: calc(100vh - 96px); | ||
font-weight: bold; | ||
} | ||
|
||
.tax input { | ||
display: none; | ||
} | ||
|
||
.tax label { | ||
padding: 0.2em; | ||
border-radius: 0.2em; | ||
transition: background-color 0.2s ease; | ||
} | ||
|
||
.tax label:hover { | ||
background: #eeffe0 !important; | ||
} | ||
|
||
.tax input:checked ~ label { | ||
background: #deffc4; | ||
} | ||
|
||
.tax input:checked ~ .inner { | ||
display: block; | ||
} | ||
|
||
.outer { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.inner { | ||
display: none; | ||
margin: 0.2em; | ||
padding: 0.2em; | ||
border-image: linear-gradient(90deg, #78b75f, #fff 20%) 2; | ||
border-width: 2px 0 2px 2px; | ||
border-style: solid; | ||
} |