responsive h-card on home page

This commit is contained in:
a 2024-03-08 11:26:46 -06:00
parent c75febd707
commit 6289598e40

View file

@ -1,5 +1,7 @@
.h-card.full { .h-card.full {
--border-radius: 10px;
height: min-content; height: min-content;
border-radius: var(--border-radius, 10px);
background: #eee; background: #eee;
h2 { h2 {
text-align: center; text-align: center;
@ -8,21 +10,24 @@
padding: 1rem; padding: 1rem;
} }
header { header {
display: grid;
place-items: center;
aspect-ratio: 2; aspect-ratio: 2;
background-image: url('/images/sunset.jpg'); background-image: url('/images/sunset.jpg');
background-size: cover; background-size: cover;
background-position: center; background-position: center;
position: relative;
border-top-left-radius: var(--border-radius, 10px);
border-top-right-radius: var(--border-radius, 10px);
img { img {
border-radius: 100em; border-radius: 12px;
background-color: rgba(255,255,255,0.4); background-color: #ddd;
padding: 10px; padding: 10px;
aspect-ratio: 1; width: 120px;
height: unset; height: 120px;
width: 25%; position: absolute;
min-width: 120px; left: calc(50% - 60px);
top: calc(100% - 60px);
} }
margin-bottom: 60px;
} }
.info { .info {
text-align: center; text-align: center;
@ -45,22 +50,48 @@
} }
} }
.metadata { .metadata {
padding-block-end: 1rem; padding-block-end: 2rem;
display: grid; display: grid;
grid-template-columns: 1fr 2fr; max-width: calc(33ch + 1em);
gap: 1em;
max-width: 520px;
margin: 0 auto; margin: 0 auto;
gap: 1em;
.field { .field {
display: contents; display: grid;
place-items: start;
gap: 0.5em;
padding: 0 1em;
} }
dt { dt {
font-weight: bold; font-weight: bold;
place-self: center end; font-variant: small-caps
text-align: right;
} }
dd { dd {
place-self: center start;
}
}
@media (min-width: 40em) {
display: grid;
grid-template-columns: 20em 1fr;
grid-template-areas:
"header meta"
"info meta";
header {
width: 20em;
grid-area: header;
border-top-right-radius: 0;
}
.info {
grid-area: info;
}
.metadata {
grid-area: meta;
padding-block-start: 2em;
max-width: unset;
width: 100%;
padding-left: 2em;
background: #e6e6e6;
border-top-right-radius: var(--border-radius, 10px);
border-bottom-right-radius: var(--border-radius, 10px);
} }
} }
} }