gallery/style/shiny/gallery.css

128 lines
2.2 KiB
CSS

@import url(base.css);
:root {
--image-size: 200px;
}
body {
--gap: 1em;
max-width: calc(5 * var(--image-size) + 4 * var(--gap));
padding-left: 4em;
padding-right: 4em;
}
.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 white;
border-radius: 0.5em;
background: hsl(340, 45%, 65%);
}
figure {
margin: 0;
padding: 0;
}
figcaption {
position: absolute;
bottom: 0;
left: 0;
display: block;
text-align: center;
width: 100%;
background: hsl(0, 0%, 0%, 75%);
font-size: 80%;
border-top: 1px solid white;
}
.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(30deg);
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);
}
}
}