philomena/assets/css/elements/media.css

140 lines
2.7 KiB
CSS
Raw Normal View History

2023-11-23 17:07:49 +01:00
.image-constrained {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
2023-11-23 17:07:49 +01:00
}
.media-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(var(--media-container-width), 1fr));
grid-auto-rows: 1fr;
grid-gap: var(--padding-small);
}
.media-list::before {
content: '';
width: 0;
padding-bottom: calc(100% + var(--media-header-height));
grid-row: 1 / 1;
grid-column: 1 / 1;
}
@mixin if-phone {
2023-11-23 17:07:49 +01:00
.media-list {
grid-template-columns: repeat(auto-fill, minmax(var(--media-small-container-width), 1fr));
}
}
.media-box {
background: var(--background-color);
border: 1px solid var(--secondary-muted-color);
border-radius: var(--border-radius-inner);
overflow: hidden;
}
.media-box:first-child {
grid-row: 1 / 1;
grid-column: 1 / 1;
}
.media-box__header {
display: flex;
line-height: var(--media-header-height);
padding: 0 var(--padding-small);
justify-content: center;
font-size: var(--font-tiny-size);
}
.media-box__header--link-row {
display: grid;
grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr;
text-align: center;
width: fit-content;
}
.media-box__content {
width: 100%;
padding-top: 100%;
position: relative;
border-radius: 0 0 var(--border-radius-inner) var(--border-radius-inner);
overflow: hidden;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
2024-04-30 20:38:28 +02:00
.media-box__content .image-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
2023-11-23 17:07:49 +01:00
}
2024-04-30 20:38:28 +02:00
.media-box__content--featured .media-box__image {
max-height: var(--media-featured-width);
2023-11-23 17:07:49 +01:00
}
.media-box__overlay {
display: block;
position: absolute;
z-index: 4;
min-width: 95%;
text-align: left;
font-weight: bold;
word-wrap: break-word;
color: var(--text-color);
background: var(--primary-color);
padding: 0 var(--padding-normal);
line-height: var(--media-header-height);
pointer-events: none;
top: 0;
}
.media-box__overlay:nth-child(2) {
top: var(--media-header-height);
}
.image-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
2023-11-23 17:07:49 +01:00
}
.image-container a {
display: flex;
max-height: 100%;
2024-04-30 20:38:28 +02:00
}
2023-11-23 17:07:49 +01:00
2024-04-30 20:38:28 +02:00
/* For some reason tall images don't center properly within the container
without this hack. I blame CSS. */
.image-container a > img {
max-height: 100%;
margin: auto;
2023-11-23 17:07:49 +01:00
}
.media-box__image {
max-width: 100%;
height: auto;
}
.media-grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto;
grid-gap: var(--padding-small);
}
.image-scaled {
max-width: 100%;
}
2024-05-01 00:10:05 +02:00
.media-tiny-container, .media-tiny-container img {
2023-11-23 17:07:49 +01:00
width: var(--media-tiny-container-width);
height: var(--media-tiny-container-width);
}
2024-05-01 00:10:05 +02:00
.thumb_tiny, .thumb_tiny img {
2023-11-23 17:07:49 +01:00
max-width: var(--media-tiny-container-width);
max-height: var(--media-tiny-container-width);
}