260 lines
6.4 KiB
Plaintext
260 lines
6.4 KiB
Plaintext
---
|
|
interface Props {
|
|
prefix: string;
|
|
kicker: string;
|
|
title: string;
|
|
intro: string;
|
|
moreParagraphs?: string[];
|
|
introMaxWidth?: string;
|
|
followIntroMaxWidth?: string;
|
|
moreMaxHeight?: string;
|
|
}
|
|
|
|
const {
|
|
prefix,
|
|
kicker,
|
|
title,
|
|
intro,
|
|
moreParagraphs = [],
|
|
introMaxWidth = "70ch",
|
|
followIntroMaxWidth = "62ch",
|
|
moreMaxHeight = "18rem",
|
|
} = Astro.props;
|
|
---
|
|
|
|
<div
|
|
class="glossary-portal-hero glossary-page-hero"
|
|
data-glossary-portal-hero
|
|
style={`--portal-hero-intro-max-w:${introMaxWidth}; --portal-hero-follow-intro-max-w:${followIntroMaxWidth}; --portal-hero-secondary-max-h:${moreMaxHeight};`}
|
|
>
|
|
<p class="glossary-portal-hero__kicker">{kicker}</p>
|
|
|
|
<h1>{title}</h1>
|
|
|
|
<p class="glossary-portal-hero__intro glossary-portal-hero__intro--lead">
|
|
{intro}
|
|
</p>
|
|
|
|
{moreParagraphs.length > 0 && (
|
|
<div class="glossary-portal-hero__collapsible">
|
|
<div
|
|
class="glossary-portal-hero__more"
|
|
id={`${prefix}-hero-more`}
|
|
data-glossary-portal-more
|
|
aria-hidden="false"
|
|
>
|
|
{moreParagraphs.map((paragraph) => (
|
|
<p class="glossary-portal-hero__intro glossary-portal-hero__intro--more">
|
|
{paragraph}
|
|
</p>
|
|
))}
|
|
</div>
|
|
|
|
<button
|
|
class="glossary-portal-hero__toggle"
|
|
id={`${prefix}-hero-toggle`}
|
|
data-glossary-portal-toggle
|
|
type="button"
|
|
aria-controls={`${prefix}-hero-more`}
|
|
aria-expanded="false"
|
|
hidden
|
|
>
|
|
lire la suite
|
|
</button>
|
|
</div>
|
|
)}
|
|
</div>
|
|
|
|
<style>
|
|
.glossary-portal-hero{
|
|
position: sticky;
|
|
top: var(--glossary-sticky-top);
|
|
z-index: 12;
|
|
margin-bottom: var(--portal-hero-margin-bottom, 28px);
|
|
padding:
|
|
var(--portal-hero-pad-top, 20px)
|
|
var(--portal-hero-pad-x, 18px)
|
|
var(--portal-hero-pad-bottom, 22px);
|
|
border: 1px solid rgba(127,127,127,0.18);
|
|
border-radius: 28px;
|
|
background:
|
|
linear-gradient(180deg, rgba(0,0,0,0.60), rgba(0,0,0,0.92)),
|
|
radial-gradient(980px 260px at 18% 0%, rgba(0,217,255,0.08), transparent 60%);
|
|
backdrop-filter: blur(10px);
|
|
-webkit-backdrop-filter: blur(10px);
|
|
display: grid;
|
|
row-gap: var(--portal-hero-gap, 16px);
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
transition:
|
|
background 280ms cubic-bezier(.22,.8,.22,1),
|
|
border-color 220ms cubic-bezier(.22,.8,.22,1),
|
|
box-shadow 220ms cubic-bezier(.22,.8,.22,1),
|
|
border-radius 220ms ease,
|
|
padding 220ms ease,
|
|
row-gap 220ms ease,
|
|
margin-bottom 220ms ease;
|
|
box-shadow:
|
|
inset 0 1px 0 rgba(255,255,255,0.02),
|
|
0 10px 26px rgba(0,0,0,0.08);
|
|
}
|
|
|
|
.glossary-portal-hero__kicker{
|
|
margin: 0;
|
|
font-size: var(--portal-kicker-size, 12px);
|
|
line-height: var(--portal-kicker-lh, 1.2);
|
|
letter-spacing: var(--portal-kicker-spacing, .14em);
|
|
text-transform: uppercase;
|
|
font-weight: 650;
|
|
opacity: .74;
|
|
}
|
|
|
|
.glossary-portal-hero h1{
|
|
margin: 0;
|
|
font-size: var(--portal-hero-h1-size, clamp(3rem, 4.8vw, 4.15rem));
|
|
line-height: var(--portal-hero-h1-lh, .98);
|
|
letter-spacing: var(--portal-hero-h1-spacing, -.045em);
|
|
font-weight: 850;
|
|
text-wrap: balance;
|
|
transition:
|
|
font-size 180ms ease,
|
|
line-height 180ms ease,
|
|
letter-spacing 180ms ease;
|
|
}
|
|
|
|
.glossary-portal-hero__intro{
|
|
margin: 0;
|
|
max-width: var(--portal-hero-intro-max-w, 70ch);
|
|
font-size: var(--portal-hero-intro-size, 1.06rem);
|
|
line-height: var(--portal-hero-intro-lh, 1.6);
|
|
text-wrap: pretty;
|
|
transition:
|
|
font-size 180ms ease,
|
|
line-height 180ms ease,
|
|
max-width 180ms ease,
|
|
opacity 180ms ease;
|
|
}
|
|
|
|
.glossary-portal-hero__intro--lead{ opacity: .95; }
|
|
.glossary-portal-hero__intro--more{ opacity: .89; }
|
|
|
|
.glossary-portal-hero__collapsible{
|
|
display: grid;
|
|
row-gap: 8px;
|
|
min-width: 0;
|
|
}
|
|
|
|
.glossary-portal-hero__more{
|
|
display: grid;
|
|
gap: 12px;
|
|
max-height: var(--portal-hero-secondary-max-h, 20em);
|
|
overflow: hidden;
|
|
opacity: var(--portal-hero-secondary-opacity, .92);
|
|
min-width: 0;
|
|
transition:
|
|
max-height 220ms ease,
|
|
opacity 180ms ease;
|
|
}
|
|
|
|
.glossary-portal-hero__toggle{
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: fit-content;
|
|
min-height: 34px;
|
|
padding: 5px 0;
|
|
border: 0;
|
|
border-radius: 0;
|
|
background: transparent;
|
|
color: inherit;
|
|
font-size: 12.5px;
|
|
line-height: 1.2;
|
|
letter-spacing: .01em;
|
|
opacity: .72;
|
|
cursor: pointer;
|
|
text-decoration: underline;
|
|
text-decoration-thickness: 1px;
|
|
text-underline-offset: 2px;
|
|
transition:
|
|
opacity 120ms ease,
|
|
transform 120ms ease;
|
|
}
|
|
|
|
.glossary-portal-hero__toggle:hover{
|
|
opacity: .92;
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.glossary-portal-hero__toggle:focus-visible{
|
|
outline: 2px solid rgba(0,217,255,0.24);
|
|
outline-offset: 4px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.glossary-portal-hero__toggle[hidden]{
|
|
display: none !important;
|
|
}
|
|
|
|
@media (max-width: 980px){
|
|
.glossary-portal-hero{
|
|
border-radius: 24px;
|
|
}
|
|
|
|
.glossary-portal-hero h1{
|
|
text-wrap: pretty;
|
|
}
|
|
|
|
.glossary-portal-hero__more{
|
|
gap: 10px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 860px){
|
|
.glossary-portal-hero{
|
|
position: static !important;
|
|
top: auto !important;
|
|
z-index: auto !important;
|
|
margin-bottom: 18px !important;
|
|
width: 100% !important;
|
|
max-width: 100% !important;
|
|
min-width: 0 !important;
|
|
}
|
|
|
|
.glossary-portal-hero h1,
|
|
.glossary-portal-hero__intro,
|
|
.glossary-portal-hero__more,
|
|
.glossary-portal-hero__collapsible{
|
|
min-width: 0 !important;
|
|
max-width: 100% !important;
|
|
}
|
|
}
|
|
|
|
@media (orientation: landscape) and (max-width: 920px) and (max-height: 520px){
|
|
.glossary-portal-hero{
|
|
position: static !important;
|
|
top: auto !important;
|
|
z-index: auto !important;
|
|
margin-bottom: 14px !important;
|
|
width: 100% !important;
|
|
max-width: 100% !important;
|
|
min-width: 0 !important;
|
|
border-radius: 16px !important;
|
|
}
|
|
|
|
.glossary-portal-hero h1,
|
|
.glossary-portal-hero__intro,
|
|
.glossary-portal-hero__more,
|
|
.glossary-portal-hero__collapsible{
|
|
min-width: 0 !important;
|
|
max-width: 100% !important;
|
|
}
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark){
|
|
.glossary-portal-hero{
|
|
box-shadow:
|
|
inset 0 1px 0 rgba(255,255,255,0.02),
|
|
0 14px 34px rgba(0,0,0,0.16);
|
|
}
|
|
}
|
|
</style> |