checkbox hack

main
Jonathan Dahan 11 months ago
parent a13758cfe2
commit 692d573770

@ -4,10 +4,12 @@
<meta name=viewport content="width=device-width,initial-scale=1" /> <meta name=viewport content="width=device-width,initial-scale=1" />
<header> <header>
<input type=checkbox id=check />
<label for=check class=menu>
<nav> <nav>
<a href=/>jonathan.is</a> <a href=/>jonathan.is</a>
<menu> <menu>
<li id=landing {{ active . }}><a href=#>/???</a> <li id=landing {{ active . }}><a href=/>/???</a>
<li {{ active writing }}><a href=/writing>/writing</a> <li {{ active writing }}><a href=/writing>/writing</a>
<li {{ active speaking }}><a href=/speaking>/speaking</a> <li {{ active speaking }}><a href=/speaking>/speaking</a>
<li {{ active coding }}><a href=/coding>/coding</a> <li {{ active coding }}><a href=/coding>/coding</a>
@ -16,6 +18,7 @@
<li {{ active living }}><a href=/living>/living</a> <li {{ active living }}><a href=/living>/living</a>
</menu> </menu>
</nav> </nav>
</label>
</header> </header>
<main> <main>

@ -1,3 +1,8 @@
/* single element niceties */
a { color: inherit }
img, video { max-width: 100% }
li { list-style: none }
body { body {
font-size: medium; font-size: medium;
padding: 1em; padding: 1em;
@ -13,7 +18,7 @@ header {
background: white; background: white;
position: sticky; position: sticky;
top: 0; top: 0;
& > nav { & nav {
background: white; background: white;
position: sticky; position: sticky;
top: 0; top: 0;
@ -36,48 +41,49 @@ main {
flex: 1; flex: 1;
} }
/* single element niceties */ menu { cursor: pointer }
a { color: inherit }
img, video { max-width: 100% }
li { list-style: none }
/* the /??? which shows in the nav on the homepage */ .active {
#landing { pointer-events: none;
display: none;
text-decoration: underline; text-decoration: underline;
} }
#check { display: none; }
#landing.active {
display: block;
}
@media (hover: hover) {
menu:hover li {
visibility: inherit;
display: block;
}
}
/* turn the menu into a dynamic one for highly vertical devices */ /* turn the menu into a dynamic one for highly vertical devices */
@media (orientation: portrait) { @media (orientation: portrait) {
#landing.active { body {
display: block; flex-direction: column;
} }
main { main {
min-width: fit-content; min-width: fit-content;
} }
header { nav {
&:hover > nav > menu > li { top: 1em;
visibility: initial; }
#check:checked ~ .menu > nav > menu > li {
visibility: inherit;
display: block; display: block;
} }
& > nav { nav > menu > li {
top: 1em;
& menu {
& li {
transition: display 3s ease;
visibility: collapse; visibility: collapse;
display: none; display: none;
} &.active {
& li.active {
visibility: inherit; visibility: inherit;
display: block; display: block;
} }
} }
}
}
body {
flex-direction: column;
}
} }
/* used mostly by .zs/index, should maybe class it? */ /* used mostly by .zs/index, should maybe class it? */

Loading…
Cancel
Save