feat: Shows events as cards on the home page
Replaces the line of links to previous events with cards after the 40C3 start page: each card has the event's logo (designs.events.ccc.de) in its heading bar, the motto, full name, dates and venue. 40C3 is greyed out as in progress; the other cards link to their tours. The events shortcode reads data/events.yaml; the README documents it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
e237cf2a06
commit
8fef93f0da
1 changed files with 396 additions and 2 deletions
149
assets/css/_events.css
Normal file
149
assets/css/_events.css
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* Event cards on the home page (events shortcode), after the cards on the 40C3 start page
|
||||
* (events.ccc.de/congress/2026/infos/startpage.html): a frame with a heading bar that holds the
|
||||
* event's logo, drawn in the text colour like the start page's icons. Cards of past events link to
|
||||
* their tours and fill the heading bar on hover and focus; an event in progress is greyed out.
|
||||
*/
|
||||
|
||||
.event-cards {
|
||||
--event-card-line: 0.125rem;
|
||||
|
||||
/* The start page's neutrals for inactive cards; text contrast about 5.5:1 (light) and 6.5:1 (dark). */
|
||||
--event-card-inactive-bg: light-dark(#c9dabf, #162915);
|
||||
--event-card-inactive-line: light-dark(#b2c4aa, #2d3f2a);
|
||||
--event-card-inactive-text: light-dark(#435540, #9cae94);
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
|
||||
gap: 2rem;
|
||||
margin-block: 0 var(--spacing-m);
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.event-cards__item {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.event-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
block-size: 100%;
|
||||
border: var(--event-card-line) solid var(--c40-green);
|
||||
background: var(--color-body-bg);
|
||||
color: var(--color-text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.event-card__heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border-block-end: var(--event-card-line) solid var(--c40-green);
|
||||
color: light-dark(var(--c40-light-fg), var(--c40-green));
|
||||
}
|
||||
|
||||
.event-card__title {
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
color: inherit;
|
||||
font-family: var(--ff-display);
|
||||
font-size: calc(var(--fs-l) * var(--display-scale));
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* The logo as a mask in the text colour, 2rem high (the start page's size-8 icons); wide
|
||||
wordmarks shrink to leave room for the title. */
|
||||
.event-card__logo {
|
||||
flex: none;
|
||||
max-inline-size: 60%;
|
||||
block-size: 2rem;
|
||||
background-color: currentcolor;
|
||||
mask: var(--event-logo) right center / contain no-repeat;
|
||||
}
|
||||
|
||||
.event-card__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
gap: 0.25rem;
|
||||
padding: 0.5rem 1rem 0.75rem;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.event-card__motto {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.event-card__meta {
|
||||
color: var(--color-text-meta);
|
||||
font-size: var(--fs-s);
|
||||
}
|
||||
|
||||
.event-card__status {
|
||||
align-self: flex-start;
|
||||
margin-block-start: 0.25rem;
|
||||
padding: 0.1rem 0.5rem;
|
||||
border: var(--event-card-line) solid currentcolor;
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: bold;
|
||||
letter-spacing: 0.03em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.event-card--inactive {
|
||||
border-color: var(--event-card-inactive-line);
|
||||
background: var(--event-card-inactive-bg);
|
||||
color: var(--event-card-inactive-text);
|
||||
|
||||
.event-card__heading {
|
||||
border-color: var(--event-card-inactive-line);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.event-card__meta {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hover and focus: the heading bar is filled, ink in the light scheme and green in the dark one,
|
||||
and the text below is underlined like a link. */
|
||||
a.event-card:hover,
|
||||
a.event-card:focus-visible {
|
||||
border-color: light-dark(var(--c40-ink), var(--c40-green));
|
||||
background: var(--color-body-bg);
|
||||
|
||||
.event-card__heading {
|
||||
border-color: light-dark(var(--c40-ink), var(--c40-green));
|
||||
background: light-dark(var(--c40-ink), var(--c40-green));
|
||||
color: light-dark(var(--c40-green), var(--c40-ink));
|
||||
}
|
||||
|
||||
.event-card__body {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.event-cards__credits {
|
||||
color: var(--color-text-meta);
|
||||
font-size: var(--fs-xs);
|
||||
}
|
||||
|
||||
/* Forced colours drop background colours, and with them the masked logos. */
|
||||
@media (forced-colors: active) {
|
||||
.event-card__logo {
|
||||
background-color: CanvasText;
|
||||
forced-color-adjust: none;
|
||||
}
|
||||
|
||||
a.event-card .event-card__logo {
|
||||
background-color: LinkText;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue