gallery/style/shiny/gallery.css

216 lines
3.4 KiB
CSS

@import url(base.css);
:root {
--image-size: 200px;
}
body {
--gap: 1em;
max-width: calc(4 * var(--image-size) + 3 * var(--gap));
padding-left: 4em;
padding-right: 4em;
}
#filters div {
display: grid;
grid-template-columns: 15% auto;
align-items: baseline;
grid-gap: 0.5em 0.75em;
margin: 1em 0 2em 0;
}
#filters h3, #filters div > a {
font-weight: 100;
font-size: 110%;
margin: 0;
}
#filters h3 {
text-align: right;
grid-area: auto / 1;
}
#clear {
text-align: right;
}
#reset {
text-align: left;
}
#filters ul {
font-weight: 400;
font-size: 90%;
margin: 0;
border-radius: 0.5em;
border: 1px solid var(--text-col);
overflow: hidden;
background: var(--text-col);
grid-gap: 1px;
}
#filters ul:focus-within {
box-shadow: var(--focus-box);
}
#filters li {
margin: 0;
flex-grow: 1;
}
#filters li:focus-within {
color: var(--focus-text);
}
#filters label {
display: block;
margin: 0;
border-radius: 0;
padding: 0.15em 0.5em;
text-align: center;
border: none;
box-shadow: none;
}
.grid {
padding: 0;
display: grid;
grid-template-columns: repeat(auto-fill, var(--image-size));
grid-gap: var(--gap);
justify-content: center;
}
.item {
--border-thickness: 2px;
list-style: none;
width: var(--image-size);
height: var(--image-size);
overflow: hidden;
position: relative;
}
.item:not(.year-marker) {
box-shadow: var(--text-shadow);
border: var(--border-thickness) solid var(--text-col);
border-radius: 0.5em;
background: hsl(340, 45%, 65%);
}
.item.hidden {
display: none;
}
.item:focus-within {
box-shadow: var(--focus-box);
}
figure {
margin: 0;
padding: 0;
}
figcaption {
position: absolute;
bottom: -1px;
left: -1px;
width: 100%;
border: 1px solid var(--text-col);
display: block;
text-align: center;
background: hsl(0, 0%, 0%, 75%);
font-size: 80%;
}
.year-marker {
grid-area: auto / 1;
padding: var(--border-thickness);
}
.year-text {
--gap: 0.2em;
display: grid;
grid-template-columns: repeat(2, calc(50% - 3 * var(--gap)));
grid-gap: var(--gap);
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
}
.year-marker .y {
display: block;
text-align: center;
font-size: calc(var(--image-size) * 0.6);
line-height: 0;
font-weight: 900;
transform: scaleX(110%);
}
.item.nsfw::after {
--size: calc(1/4 * var(--image-size));
content: url(../18_plus_white.svg);
height: var(--size);
width: var(--size);
display: inline-block;
position: absolute;
top: 3px;
right: 3px;
transform: rotate(var(--nsfw-sticker-rotate));
mix-blend-mode: multiply;
}
footer {
font-size: 90%;
text-align: center;
margin-top: 1em;
}
@media (hover) {
.item:hover figcaption {
opacity: 20%;
}
@media (prefers-reduced-motion) {
.item:hover figcaption {
transform: translateY(80%);
}
}
@media (prefers-reduced-motion: no-preference) {
.item figcaption {
transition-property: opacity, transform;
transition-duration: 0.25s;
transition-timing-function: ease-in-out;
}
.item:hover figcaption {
transform: translate(-20%, 80%) rotateZ(7deg);
}
}
}
@media (hover: none) {
.item:not(.year-marker) {
height: min-content;
}
figcaption {
position: initial;
}
.item a {
display: block;
height: var(--image-size);
}
.item img {
margin-bottom: 0;
}
}