gallery/style/gallery.css

167 lines
2.8 KiB
CSS

@import url(base.css);
body {
--image-size: 200px;
--grid-gap: 1.5em;
--max-cols: 4;
max-width:
calc(var(--max-cols) * var(--image-size) +
(var(--max-cols) - 1) * var(--grid-gap) +
4em);
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, var(--image-size));
grid-gap: var(--grid-gap);
justify-content: center;
justify-items: center;
align-items: start;
padding: 0;
margin: 0;
}
.item {
--shadow-size: 10px;
--border-thickness: 2px;
position: relative;
width: var(--image-size);
height: var(--image-size);
padding: 0;
margin: 0;
list-style: none;
box-shadow: 0 0 var(--shadow-size) var(--shadow);
border: var(--border-thickness) solid var(--text);
overflow: hidden;
}
.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;
}
figure {
margin: 0;
padding: 0;
}
.item figcaption {
width: 100%;
margin: 0;
padding: var(--border-thickness);
box-sizing: border-box;
position: absolute;
left: 0;
bottom: 0;
font-size: 80%;
font-weight: 500;
text-align: center;
background: hsla(47, 74%, 89%, 87%);
text-shadow:
-1px -1px 1px hsla(47, 74%, 89%, 87%),
1px -1px 1px hsla(47, 74%, 89%, 87%),
-1px 1px 1px hsla(47, 74%, 89%, 87%),
1px 1px 1px hsla(47, 74%, 89%, 87%);
border-top: 2px solid var(--text);
}
.year-marker {
background: var(--text);
display: flex;
justify-content: center;
align-items: center;
grid-area: auto / 1 / auto / auto;
}
.year-text {
color: var(--lighter-tum);
transform: rotate(-45deg);
font-weight: 900;
font-size: 300%;
}
@media (hover) {
.item:not(.year-marker):hover {
--shadow-size: 20px;
}
.item:hover figcaption {
opacity: 20%;
}
@media (prefers-reduced-motion) {
.item:hover figcaption {
transform: translateY(80%);
}
}
@media (prefers-reduced-motion: no-preference) {
.item:hover img {
filter: contrast(120%);
}
.item:hover figcaption {
transform: translate(-20%, 80%) rotateZ(7deg);
}
.item, .item figcaption, .item img {
transition: all 0.2s ease-in-out;
}
}
}
@media (hover: none) {
.item:not(.year-marker) {
height: auto;
}
.item a {
display: block;
margin: 0;
height: var(--image-size);
}
.item img {
margin-bottom: 0;
}
.item figcaption {
position: static;
background: hsl(0, 0%, 100%, 50%);
}
}
@media (prefers-reduced-transparency) {
.item figcaption {
background: hsl(47, 74%, 89%);
text-shadow: none;
}
.item:hover figcaption {
opacity: 100%;
}
figcaption {
transition: none;
}
}