Files
fizzy/app/assets/stylesheets/splats.css
T
2024-08-05 17:10:38 -05:00

189 lines
3.3 KiB
CSS

:root {
--splat-size: 30vw;
}
.windshield {
background-color: var(--color-bg);
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-block: clamp(var(--block-space), 3%, calc(var(--block-space) * 2));
> * {
flex-shrink: 1;
}
}
.splat {
--hover-size: 0;
--splat-color: var(--color-ink);
--splat-rotate: 20deg;
animation: float-up-left 400ms normal forwards ease-out;
aspect-ratio: 1;
block-size: var(--splat-size);
color: var(--splat-color, currentColor);
container-type: inline-size;
display: grid;
place-items: center;
position: relative;
transition: all 0.2s ease;
&:nth-of-type(2n) {
animation-delay: 50ms;
animation: float-down-right 400ms normal forwards ease-out;
}
&:nth-of-type(4n) {
animation-delay: 150ms;
}
[data-turbo-preview] & { animation: none; }
@media (hover: hover) {
.windshield &:hover {
scale: 1.1;
.splat__svg {
transform: rotate(calc(var(--splat-rotate) + 10deg));
}
}
}
> * {
grid-area: 1/1;
}
.splat__perma & {
--splat-size: 50cqi !important;
}
}
.splat__link {
content: "";
inset: 0;
position: absolute;
z-index: -1;
}
.splat__svg {
fill: var(--color-bg);
position: absolute;
scale: 1.1;
stroke: var(--splat-color);
stroke-width: 1.1rem;
transform: rotate(var(--splat-rotate));
transition: all 200ms ease-out;
z-index: -1;
}
.splat__bubble {
background-color: var(--splat-color);
border: 0.3em solid var(--splat-color);
border-radius: 50%;
position: absolute;
z-index: -1;
a {
color: var(--splat-color);
}
&.splat__category {
inset: auto auto 10cqi 0cqi;
+ & {
inset: auto auto -2cqi 16cqi;
+ & {
inset: auto auto -10cqi 32cqi;
}
}
.windshield &:has(.splat__category--new) {
display: none;
}
}
&.splat__date {
aspect-ratio: 1;
inset: 2cqi 2cqi auto auto;
}
&.splat__meta {
background-color: var(--color-bg);
block-size: auto;
color: var(--splat-color);
display: flex;
font-size: 5cqi;
font-weight: 800;
line-height: 1;
max-inline-size: 18ch;
padding: 1em;
place-items: center;
position: absolute;
scale: 1;
text-overflow: ellipsis;
transform: none;
transition: all 200ms ease-out;
white-space: nowrap;
}
@media (hover: hover) {
.windshield .splat:hover & {
transform: translate(1rem, 1rem);
}
.windshield .splat:hover & + & {
transform: translate(1rem, -1rem);
}
.windshield .splat:hover & + & + & {
transform: translate(-1rem, -1rem);
}
}
}
.splat__title {
-webkit-line-clamp: var(--lines, 5);
-webkit-box-orient: vertical;
display: -webkit-box;
font-size: 8cqi;
hyphens: auto;
line-height: 1.2;
margin: auto;
max-block-size: 75cqi;
max-inline-size: 75cqi;
overflow: hidden;
pointer-events: none;
text-overflow: clip;
white-space: normal;
}
.splats-list {
--hover-size: 0;
.splat__title-link {
color: var(--color-txt);
text-decoration: none;
}
li {
border-radius: 0.6em;
list-style: none;
padding: 0.5em 1em;
transition: background-color 200ms ease;
&:hover{
background-color: var(--color-selected);
}
}
}
.splats-filter {
li {
list-style: none;
margin: 0;
padding: 0;
}
}