changes to try with chatgpt
All checks were successful
Build / build (push) Successful in 2m38s
Build / deploy-stage (push) Successful in 3m30s
Build / switch-stage (push) Successful in 2m2s

This commit is contained in:
2024-12-12 22:02:21 +01:00
parent 869df50c01
commit 7133371206
6 changed files with 186 additions and 81 deletions

View File

@@ -1,73 +1,155 @@
.frame-type-cloonar_hero {
position: relative;
display: flex;
flex-direction: column;
padding-bottom: 3rem; /* Space for overlap */
background: #f9f9f9;
background: #f9f9f9;
padding: 1rem; /* Mobile-first padding */
}
.frame-type-cloonar_hero .hero-header {
text-align: center;
margin-bottom: 2rem;
font-size: 2.5rem;
color: #3c3c3c;
/* Mobile-first: stacked layout */
.frame-type-cloonar_hero .hero {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.frame-type-cloonar_hero .hero-content {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
gap: 2rem;
.frame-type-cloonar_hero .hero-subheader {
font-size: 1rem;
color: #3c6418;
margin-bottom: 0.5rem;
}
.frame-type-cloonar_hero .hero-title {
font-size: 1.5rem;
font-weight: bold;
color: #3c6418;
margin: 0 0 1rem 0;
line-height: 1.2;
text-transform: uppercase;
}
.frame-type-cloonar_hero .hero-text {
flex: 1;
font-size: 1.2rem;
color: #3c3c3c;
line-height: 1.6;
}
.frame-type-cloonar_hero .hero-image-wrapper {
position: relative;
flex: 1;
}
.frame-type-cloonar_hero .hero-image {
max-width: 100%;
height: auto;
border-radius: 8px;
font-size: 0.9rem;
color: #333;
line-height: 1.4;
margin-bottom: 1rem;
max-width: 45ch;
}
.frame-type-cloonar_hero .hero-social-icons {
position: absolute;
right: -10%;
top: 50%;
transform: translateY(-50%);
display: flex;
flex-direction: column;
gap: 0.5rem;
display: flex;
gap: 0.5rem;
margin-bottom: 1rem;
}
.frame-type-cloonar_hero .social-icon {
display: inline-block;
width: 40px;
height: 40px;
background-color: #3c3c3c;
color: #fff;
text-align: center;
line-height: 40px;
border-radius: 50%;
text-decoration: none;
display: inline-flex;
align-items: center;
justify-content: center;
background: #3c6418;
color: #fff;
font-size: 1rem;
text-decoration: none;
border-radius: 50%;
width: 2rem;
height: 2rem;
transition: background 0.3s;
}
.frame-type-cloonar_hero .social-icon:hover {
background: #1e3810;
}
.frame-type-cloonar_hero .hero-image-wrapper {
margin-top: 1rem;
}
.frame-type-cloonar_hero .hero-image {
max-width: 200px;
width: 100%;
height: auto;
border-radius: 0.5rem;
}
/* Medium devices (≥768px) - slightly larger text and icons */
@media (min-width: 768px) {
.frame-type-cloonar_hero .hero-subheader {
font-size: 1.2rem;
}
.frame-type-cloonar_hero .hero-title {
font-size: 2rem;
margin-bottom: 1.2rem;
}
.frame-type-cloonar_hero .hero-text {
font-size: 1rem;
}
.frame-type-cloonar_hero .social-icon {
width: 2.5rem;
height: 2.5rem;
font-size: 1.2rem;
}
.frame-type-cloonar_hero .hero-image {
max-width: 250px;
}
}
.frame-type-cloonar_hero .next-section-overlap {
position: absolute;
bottom: 2rem;
width: 100%;
height: 2rem;
background: #ffffff;
z-index: 10;
}
/* Large devices (≥992px): Switch to 3-column layout */
@media (min-width: 992px) {
.frame-type-cloonar_hero {
padding: 2rem;
}
/* Three-column grid: text (left), image (middle), icons (right) */
.frame-type-cloonar_hero .hero {
display: grid;
grid-template-columns: 1fr auto auto;
grid-template-areas:
"subheader image icons"
"title image icons"
"text image icons"
"social image icons";
align-items: start;
justify-items: start;
text-align: left;
}
.frame-type-cloonar_hero .hero-subheader {
grid-area: subheader;
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.frame-type-cloonar_hero .hero-title {
grid-area: title;
font-size: 3rem;
margin-bottom: 1.5rem;
}
.frame-type-cloonar_hero .hero-text {
grid-area: text;
font-size: 1rem;
max-width: 40ch;
margin-bottom: 1.5rem;
}
.frame-type-cloonar_hero .hero-social-icons {
grid-area: social;
flex-direction: column;
gap: 1rem;
margin-bottom: 0;
align-items: flex-start;
}
.frame-type-cloonar_hero .hero-image-wrapper {
grid-area: image;
margin-top: 0;
display: flex;
align-items: center;
justify-content: center;
}
.frame-type-cloonar_hero .hero-image {
max-width: 300px; /* Slightly larger on desktop, but not too big */
}
}

View File

@@ -1,30 +1,31 @@
<f:layout name="Default" />
<!-- No extra heading from the parent layout -->
<f:section name="Header" />
<f:section name="Main">
<f:asset.css identifier="CBHero" href="{cb:assetPath()}/frontend.css" />
<div class="hero">
<header class="hero-header">
<h1>{data.header}</h1>
</header>
<div class="hero-content">
<div class="hero-text">
<f:format.html>{data.bodytext}</f:format.html>
</div>
<div class="hero-image-wrapper">
<f:if condition="{data.image}">
<f:then>
<f:image image="{data.image.0}" alt="Hero Image" class="hero-image" />
</f:then>
<f:else>
<p>No image available</p>
</f:else>
</f:if>
<div class="hero-social-icons">
<a href="#" class="social-icon">X</a>
<a href="#" class="social-icon">Instagram</a>
<a href="#" class="social-icon">TikTok</a>
</div>
</div>
<div class="hero-subheader">{data.subheader}</div>
<h2 class="hero-title">{data.header}</h2>
<div class="hero-text">
<f:format.html>{data.bodytext}</f:format.html>
</div>
<div class="hero-social-icons">
<a href="#" class="social-icon">X</a>
<a href="#" class="social-icon">Instagram</a>
<a href="#" class="social-icon">TikTok</a>
</div>
<div class="hero-image-wrapper">
<f:if condition="{data.image}">
<f:then>
<f:image image="{data.image.0}" alt="Hero Image" class="hero-image" />
</f:then>
<f:else>
<p>No image available</p>
</f:else>
</f:if>
</div>
<div class="next-section-overlap"></div>
</div>