ok, not yet apparently

This commit is contained in:
Chris Kruining 2025-04-01 15:30:18 +02:00
parent 17e769c598
commit 0e05e9ece1
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
2 changed files with 141 additions and 89 deletions

View file

@ -1,7 +1,7 @@
.container { .container {
position: relative; position: relative;
display: grid; display: grid;
grid: 2em 1fr / 7.5em 1fr; grid: auto 1fr / 5em 1fr;
grid-template-areas: grid-template-areas:
'top top' 'top top'
'nav content' 'nav content'
@ -13,9 +13,9 @@
container-type: inline-size; container-type: inline-size;
background-color: var(--surface-1); background-color: var(--surface-1);
&:has(.nav a:hover) > .body { /* &:has(.nav a:hover) > .body {
filter: blur(3px); filter: blur(3px);
} } */
} }
@ -25,7 +25,7 @@
block-size: 100%; block-size: 100%;
background: linear-gradient(180deg, transparent, transparent 90vh, var(--surface-500) 90vh, var(--surface-500)); background: linear-gradient(180deg, transparent, transparent 90vh, var(--surface-500) 90vh, var(--surface-500));
overflow: clip auto; overflow: clip auto;
padding-inline-start: 7.5em; padding-inline-start: 5em;
transition: filter var(--duration-moderate-1) var(--ease-3); transition: filter var(--duration-moderate-1) var(--ease-3);
& > div { & > div {
@ -42,7 +42,7 @@
grid-area: top; grid-area: top;
display: block grid; display: block grid;
grid-auto-flow: column; grid-auto-flow: column;
place-content: center end; justify-content: end;
z-index: 1; z-index: 1;
background-color: inherit; background-color: inherit;
padding: .5em; padding: .5em;
@ -53,23 +53,43 @@
display: block grid; display: block grid;
grid-auto-flow: row; grid-auto-flow: row;
justify-content: space-between; justify-content: space-between;
inline-size: 7.5em; inline-size: 5em;
block-size: 100%; block-size: 100%;
padding: 1em; padding: 1em;
background-color: inherit; background: inherit;
z-index: 0; z-index: 0;
& > ul { & > ul {
position: relative;
display: block grid; display: block grid;
grid-template-columns: auto auto; grid-template-columns: 2.5rem auto;
align-content: center; align-content: center;
inline-size: 100%; inline-size: 4rem;
gap: .5em; gap: 1rem;
transform-origin: left center; transform-origin: left center;
padding: 0; padding: 0;
padding-inline-start: .5rem;
margin: 0; margin: 0;
transition: z-index .3s step-end;
&::before {
content: '';
position: absolute;
inset-inline-start: 100%;
inset-block: 0;
inline-size: 20vw;
/* background:
radial-gradient(ellipse at left center 100% 100%, #f00, transparent),
linear-gradient(to right, #0003, transparent); */
background-image: linear-gradient(to right, #0003, transparent);
mask: radial-gradient(ellipse 20vw 100% at left center, black, transparent);
backdrop-filter: blur(5px);
opacity: 0;
transition: opacity .3s var(--ease-3);
}
& > a { & > a {
position: relative;
grid-column: span 2; grid-column: span 2;
display: block grid; display: block grid;
grid-template-columns: subgrid; grid-template-columns: subgrid;
@ -77,85 +97,117 @@
text-decoration: none; text-decoration: none;
transform-origin: center left; transform-origin: center left;
transition: transform 2s var(--ease-spring-5), opacity 0.3s var(--ease-3); transition: transform 2s var(--ease-spring-5), opacity 0.3s var(--ease-3);
color: var(--red-4); color: var(--stone-4);
font-size: 2rem;
line-height: 1.5;
& > span {
opacity: 0;
transition: opacity .3s var(--ease-3);
text-shadow: 0 0 1em #000;
}
& > svg { & > svg {
fill: var(--red-4); fill: var(--stone-4);
inline-size: 2.5rem;
block-size: 2.5rem;
}
&.active {
color: var(--yellow-4);
list-style: disc;
&::before {
content: '•';
position: absolute;
inset-inline-start: -1rem;
}
& > svg {
fill: var(--yellow-4);
}
} }
} }
&:has(a:hover:nth-child(1)) { &:has(a:is(:hover, :focus))::before {
--target: 1; opacity: 1;
} }
&:has(a:hover:nth-child(2)) { &:has(a:is(:hover, :focus)) > a:not(:is(:hover, :focus)) {
--target: 2;
}
&:has(a:hover:nth-child(3)) {
--target: 3;
}
&:has(a:hover:nth-child(4)) {
--target: 4;
}
&:has(a:hover:nth-child(5)) {
--target: 5;
}
&:has(a:hover:nth-child(6)) {
--target: 6;
}
&:has(a:hover:nth-child(7)) {
--target: 7;
}
&:has(a:hover:nth-child(8)) {
--target: 8;
}
&:has(a:hover:nth-child(9)) {
--target: 9;
}
&:has(a:hover:nth-child(10)) {
--target: 10;
}
&:has(a:hover:nth-child(11)) {
--target: 11;
}
&:has(a:hover:nth-child(12)) {
--target: 12;
}
&:has(a:hover:nth-child(13)) {
--target: 13;
}
&:has(a:hover:nth-child(14)) {
--target: 14;
}
&:has(a:hover:nth-child(15)) {
--target: 15;
}
&:has(a:hover) > a:not(:hover) {
opacity: .25; opacity: .25;
} }
&:has(a:hover) > a { &:has(a:is(:hover, :focus)) > a {
transform: scale(max(1, calc(1.5 - (.2 * abs(var(--target) - var(--sibling-index)))))); transform: scale(max(1, calc(1.5 - (.2 * abs(var(--target) - var(--sibling-index))))));
& > span {
opacity: 1;
} }
} }
&:is(:hover, :focus-within) { &:has(a:is(:hover, :focus):nth-child(1)) {
--target: 1;
}
&:has(a:is(:hover, :focus):nth-child(2)) {
--target: 2;
}
&:has(a:is(:hover, :focus):nth-child(3)) {
--target: 3;
}
&:has(a:is(:hover, :focus):nth-child(4)) {
--target: 4;
}
&:has(a:is(:hover, :focus):nth-child(5)) {
--target: 5;
}
&:has(a:is(:hover, :focus):nth-child(6)) {
--target: 6;
}
&:has(a:is(:hover, :focus):nth-child(7)) {
--target: 7;
}
&:has(a:is(:hover, :focus):nth-child(8)) {
--target: 8;
}
&:has(a:is(:hover, :focus):nth-child(9)) {
--target: 9;
}
&:has(a:is(:hover, :focus):nth-child(10)) {
--target: 10;
}
&:has(a:is(:hover, :focus):nth-child(11)) {
--target: 11;
}
&:has(a:is(:hover, :focus):nth-child(12)) {
--target: 12;
}
&:has(a:is(:hover, :focus):nth-child(13)) {
--target: 13;
}
&:has(a:is(:hover, :focus):nth-child(14)) {
--target: 14;
}
&:has(a:is(:hover, :focus):nth-child(15)) {
--target: 15;
}
}
&:has(a:hover, :focus-within) {
z-index: 1; z-index: 1;
transition: z-index .3s step-start;
} }
} }

View file

@ -1,12 +1,12 @@
import { A } from "@solidjs/router"; import { A } from "@solidjs/router";
import { import {
FaSolidHouseChimney, AiOutlineHome,
FaSolidMagnifyingGlass, AiOutlineStar,
FaSolidStar, AiOutlineSearch,
} from "solid-icons/fa"; } from "solid-icons/ai";
import { ParentComponent, Component } from "solid-js"; import { ParentComponent, Component } from "solid-js";
import css from "./shell.module.css";
import { ColorSchemePicker } from "../theme"; import { ColorSchemePicker } from "../theme";
import css from "./shell.module.css";
export const Shell: ParentComponent = (props) => { export const Shell: ParentComponent = (props) => {
return ( return (
@ -33,17 +33,17 @@ const Nav: Component = (props) => {
return ( return (
<nav class={css.nav}> <nav class={css.nav}>
<ul> <ul>
<A href="/"> <A href="/" activeClass={css.active} end={true}>
<FaSolidHouseChimney /> <AiOutlineHome />
Home <span>Home</span>
</A> </A>
<A href="/library"> <A href="/library" activeClass={css.active}>
<FaSolidStar /> <AiOutlineStar />
Library <span>Library</span>
</A> </A>
<A href="/search"> <A href="/search" activeClass={css.active}>
<FaSolidMagnifyingGlass /> <AiOutlineSearch />
Search <span>Search</span>
</A> </A>
</ul> </ul>
</nav> </nav>