gallery/style/gallery.css

106 lines
1.7 KiB
CSS
Raw Normal View History

2020-07-17 06:29:13 -04:00
@import url(base.css);
body {
max-width: 50em;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, var(--image-size));
grid-gap: 1.5em;
justify-content: center;
justify-items: center;
2020-07-17 09:52:13 -04:00
align-items: start;
2020-07-17 06:29:13 -04:00
--image-size: 200px;
--border-thickness: 2px;
padding: 0;
margin: 0;
}
.item {
list-style: none;
padding: 0;
margin: 0;
position: relative;
2020-07-17 09:52:13 -04:00
width: var(--image-size);
height: var(--image-size);
box-shadow: 0 0 10px var(--shadow);
border: 2px solid var(--text);
overflow: hidden;
2020-07-17 06:29:13 -04:00
}
figure {
margin: 0;
padding: 0;
}
.item figcaption {
2020-07-17 09:52:13 -04:00
width: calc(100% - 2 * var(--border-thickness));
2020-07-17 06:29:13 -04:00
margin: 0;
padding: var(--border-thickness);
position: absolute;
left: 0;
bottom: 0;
2020-07-17 09:52:13 -04:00
font-size: 80%;
text-align: center;
2020-07-17 06:29:13 -04:00
background: hsl(0, 0%, 100%, 75%);
2020-07-17 09:52:13 -04:00
text-shadow:
-1px -1px 1px white,
1px -1px 1px white,
-1px 1px 1px white,
1px 1px 1px white;
border-top: 2px solid var(--text);
2020-07-17 06:29:13 -04:00
}
2020-07-17 09:52:13 -04:00
@media (hover) {
.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 * {
transition: all 0.2s ease-in-out;
}
}
2020-07-17 06:29:13 -04:00
}
2020-07-17 09:52:13 -04:00
@media (hover: none) {
.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%);
}
.item {
height: auto;
}
2020-07-17 06:29:13 -04:00
}