gallery/style/tum/gallery.css

167 lines
2.8 KiB
CSS
Raw Normal View History

2020-07-17 06:29:13 -04:00
@import url(base.css);
body {
2020-07-18 05:47:50 -04:00
--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);
2020-07-17 06:29:13 -04:00
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, var(--image-size));
2020-07-18 05:47:50 -04:00
grid-gap: var(--grid-gap);
2020-07-17 06:29:13 -04:00
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
padding: 0;
margin: 0;
}
.item {
2020-07-18 05:47:50 -04:00
--shadow-size: 10px;
--border-thickness: 2px;
2020-07-17 06:29:13 -04:00
position: relative;
2020-07-17 09:52:13 -04:00
width: var(--image-size);
height: var(--image-size);
2020-07-18 05:47:50 -04:00
padding: 0;
margin: 0;
list-style: none;
box-shadow: 0 0 var(--shadow-size) var(--shadow);
border: var(--border-thickness) solid var(--text);
2020-07-17 09:52:13 -04:00
overflow: hidden;
2020-07-17 06:29:13 -04:00
}
2020-07-18 05:47:50 -04:00
.item.nsfw::after {
--size: calc(1/4 * var(--image-size));
2020-07-19 16:36:15 -04:00
content: url(../18_plus_white.svg);
2020-07-18 05:47:50 -04:00
height: var(--size);
width: var(--size);
display: inline-block;
position: absolute;
top: 3px;
right: 3px;
transform: rotate(30deg);
mix-blend-mode: multiply;
}
2020-07-17 06:29:13 -04:00
figure {
margin: 0;
padding: 0;
}
.item figcaption {
2020-07-18 05:47:50 -04:00
width: 100%;
2020-07-17 06:29:13 -04:00
margin: 0;
padding: var(--border-thickness);
2020-07-18 05:47:50 -04:00
box-sizing: border-box;
2020-07-17 06:29:13 -04:00
position: absolute;
left: 0;
bottom: 0;
2020-07-17 09:52:13 -04:00
font-size: 80%;
2020-07-18 05:47:50 -04:00
font-weight: 500;
2020-07-17 09:52:13 -04:00
text-align: center;
2020-07-18 05:47:50 -04:00
background: hsla(47, 74%, 89%, 87%);
2020-07-17 09:52:13 -04:00
text-shadow:
2020-07-18 05:47:50 -04:00
-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%);
2020-07-17 09:52:13 -04:00
border-top: 2px solid var(--text);
2020-07-17 06:29:13 -04:00
}
2020-07-18 05:47:50 -04:00
.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%;
}
2020-07-17 09:52:13 -04:00
@media (hover) {
2020-07-18 05:47:50 -04:00
.item:not(.year-marker):hover {
--shadow-size: 20px;
}
2020-07-17 09:52:13 -04:00
.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);
}
2020-07-18 05:47:50 -04:00
.item, .item figcaption, .item img {
2020-07-17 09:52:13 -04:00
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) {
2020-07-18 05:47:50 -04:00
.item:not(.year-marker) {
height: auto;
}
2020-07-17 09:52:13 -04:00
.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%);
}
2020-07-18 05:47:50 -04:00
}
2020-07-17 09:52:13 -04:00
2020-07-18 05:47:50 -04:00
@media (prefers-reduced-transparency) {
.item figcaption {
background: hsl(47, 74%, 89%);
text-shadow: none;
}
.item:hover figcaption {
opacity: 100%;
}
figcaption {
transition: none;
2020-07-17 09:52:13 -04:00
}
2020-07-17 06:29:13 -04:00
}