gallery/style/shiny/gallery.css
2021-04-16 23:48:56 +02:00

255 lines
4.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, #clear, #singles {
margin: 0;
}
#clear, #singles {
font-weight: 400;
font-size: 110%;
}
#filters h3, #clear {
text-align: right;
grid-area: auto / 1;
}
#singles {
text-align: left;
grid-area: auto / 2;
}
@media (max-width: 80rem) {
#filters div {
grid-template-columns: auto;
}
#filters h3, #clear {
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;
}
#filters label[data-count]::after {
content: '(' attr(data-count) ')';
font-size: 80%;
padding-left: 0.25em;
}
.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:focus-within {
box-shadow: var(--focus-box);
}
figure {
margin: 0;
padding: 0;
}
figcaption .date, figcaption .title {
position: absolute;
width: 100%;
border: 1px solid var(--text-col);
display: block;
text-align: center;
background: hsl(0, 0%, 0%, 75%);
font-size: 80%;
text-shadow: none;
}
figcaption .date { top: -1px; left: -1px; }
figcaption .title { bottom: -1px; left: -1px; }
.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: 800;
transform: scaleX(110%);
}
.item.nsfw::before, .item[data-updated="true"]::after {
height: var(--size);
width: var(--size);
display: inline-block;
position: absolute;
}
.item.nsfw::before {
--size: calc(1/4 * var(--image-size));
--base-transform: rotate(var(--nsfw-sticker-rotate));
content: url(../18_plus_white.svg);
top: calc(1em + 3px);
right: 3px;
mix-blend-mode: multiply;
transform: var(--base-transform);
}
.item[data-updated="true"]::after {
--size: calc(1/4 * var(--image-size));
content: url(../sparkles.svg);
bottom: calc(1em + 3px);
right: 3px;
mix-blend-mode: overlay;
}
footer {
font-size: 90%;
text-align: center;
margin-top: 1em;
}
@media (hover) {
.item:hover .date, .item:hover .title,
.item:hover::before, .item:hover::after {
filter: opacity(20%);
}
@media (prefers-reduced-motion: no-preference) {
figcaption .date, figcaption .title, .item::before, .item::after {
transition-property: filter, transform;
transition-duration: 0.15s;
transition-timing-function: ease-in-out;
}
.item:hover .title {
transform: translate(-20%, 80%) rotateZ(7deg);
}
.item:hover .date {
transform: translate(20%, -80%) rotateZ(7deg);
}
.item:hover::before {
transform: translate(1.5em, -1.5em) var(--base-transform);
}
.item:hover::after {
transform: translate(1.5em, 1.5em);
}
}
}
@media (hover: none) {
.item:not(.year-marker) {
height: min-content;
}
figcaption .date, figcaption .title {
position: initial;
}
figcaption .date::after {
content: ':';
}
.item a {
display: block;
height: var(--image-size);
}
.item img {
margin-bottom: 0;
}
}
@media (pointer: coarse) {
#filters label {
font-size: 150%;
}
}