151 lines
No EOL
2.5 KiB
CSS
151 lines
No EOL
2.5 KiB
CSS
.parent {
|
|
display: grid;
|
|
grid-template-columns: repeat(5, 1fr);
|
|
grid-template-rows: repeat(3, 1fr);
|
|
grid-column-gap: 2px;
|
|
grid-row-gap: 2px;
|
|
max-height: 75vh;
|
|
}
|
|
|
|
.div1 {
|
|
grid-area: 1 / 1 / 4 / 4;
|
|
}
|
|
|
|
.div2 {
|
|
grid-area: 1 / 4 / 3 / 6;
|
|
}
|
|
|
|
.div3 {
|
|
grid-area: 3 / 4 / 4 / 5;
|
|
}
|
|
|
|
.div4 {
|
|
grid-area: 3 / 5 / 4 / 6;
|
|
}
|
|
|
|
img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.parent>div {
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.overlay {
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
padding: 20px;
|
|
|
|
background: linear-gradient(to top,
|
|
rgba(0, 0, 0, 0.75),
|
|
rgba(0, 0, 0, 0));
|
|
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease;
|
|
}
|
|
|
|
.overlay p {
|
|
color: white;
|
|
margin: 0;
|
|
font-size: 18px;
|
|
transform: translateY(20px);
|
|
transition: transform 0.3s ease;
|
|
}
|
|
|
|
.parent>div:hover .overlay {
|
|
opacity: 1;
|
|
}
|
|
|
|
.parent>div:hover .overlay p {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.banniere {
|
|
height: 400px;
|
|
/* hauteur de la bannière */
|
|
background-size: cover;
|
|
/* effet image coupée */
|
|
background-position: center;
|
|
background-repeat: no-repeat;
|
|
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
position: relative;
|
|
}
|
|
|
|
/* léger voile sombre sur toute l'image */
|
|
.banniere::before {
|
|
content: "";
|
|
position: absolute;
|
|
inset: 0;
|
|
background: rgba(0, 0, 0, 0.4);
|
|
}
|
|
|
|
/* texte */
|
|
.texte-banniere {
|
|
position: relative;
|
|
/* important pour passer au-dessus du voile */
|
|
color: white;
|
|
font-size: 3rem;
|
|
font-weight: bold;
|
|
text-align: center;
|
|
}
|
|
|
|
.event-banner {
|
|
position: relative;
|
|
height: 220px;
|
|
margin-bottom: 25px;
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
|
|
background-size: cover; /* empêche la déformation */
|
|
background-position: center; /* centre l'image */
|
|
background-repeat: no-repeat;
|
|
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
transition: transform 0.2s ease;
|
|
}
|
|
|
|
.event-banner:hover {
|
|
transform: scale(1.02);
|
|
}
|
|
|
|
.event-overlay {
|
|
position: absolute;
|
|
inset: 0;
|
|
background: rgba(0,0,0,0.45);
|
|
}
|
|
|
|
.event-text {
|
|
position: relative;
|
|
color: white;
|
|
text-align: center;
|
|
z-index: 2;
|
|
}
|
|
|
|
.event-text h2 {
|
|
font-weight: 600;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
/* lien invisible */
|
|
.event-banner-link {
|
|
text-decoration: none;
|
|
color: inherit;
|
|
display: block;
|
|
}
|
|
|
|
.event-banner-link:hover {
|
|
text-decoration: none;
|
|
color: inherit;
|
|
} |