Skip to content

Commit

Permalink
Revamp feature section cards to use more modular approach
Browse files Browse the repository at this point in the history
  • Loading branch information
blackxfiied committed Oct 8, 2024
1 parent a09d8db commit c6f258e
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions src/components/sections/FeatureSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,46 @@ const { title, desc, image, color } = Astro.props;
import { Image } from "astro:assets";
---

<div class="feature">
<h3 style=`color: ${color};`>{title}</h3>
<p>{desc}</p>
<Image src={image} loading="lazy" alt="Mythic logo" />
<div class="feature-card">
<div class="feature-text">
<h3 style={`color: ${color};`}>{title}</h3>
<p>{desc}</p>
</div>
<div class="feature-image">
<Image src={image} loading="lazy" alt="Mythic feature" />
</div>
</div>

<style>
.feature {
margin-top: 20px;
margin-bottom: 20px;
border-radius: 16px;
padding: 20px;
background-color: var(--secondary-nav-color);
text-align: left;
.feature-card {
display: flex;
flex-direction: column;
align-items: center;
background-color: var(--secondary-nav-color);
padding: 20px;
border-radius: 16px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
text-align: center;
margin-bottom: 20px;
}

.feature p {
max-width: 50%;
}

.feature img {
.feature-image {
width: 100%;
height: auto;
object-fit: contain;
max-height: 500px;
}

.feature-text h3 {
font-size: 1.5rem;
margin-bottom: 10px;
}

.feature-text p {
font-size: 1rem;
max-width: 80%;
margin: 0 auto;
}

.feature-text {
padding-bottom: 24px;
}
</style>

0 comments on commit c6f258e

Please sign in to comment.