Skip to content

Commit 413abb7

Browse files
committed
Make feature cards more compact with horizontal layout
- Changed from vertical to horizontal layout with emoji on left - Reduced card padding from 2.5rem to 1.5rem for compactness - Made emojis smaller (3.5rem) and placed in rounded background - Adjusted typography sizes for better hierarchy - Added hover effect on emoji (scales and changes to gradient) - Improved grid layout with better responsive breakpoints - Consistent with other card styles on the site
1 parent 5913632 commit 413abb7

File tree

1 file changed

+46
-30
lines changed

1 file changed

+46
-30
lines changed

src/components/Features.astro

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,13 @@ const features = [
5656
class="feature-card"
5757
style={`animation-delay: ${index * 0.1}s`}
5858
>
59-
<div class="feature-icon-wrapper">
60-
<div class={`feature-icon-gradient bg-gradient-to-br ${feature.gradient}`}></div>
59+
<div class="feature-content">
6160
<div class="feature-icon">{feature.icon}</div>
61+
<div class="feature-text">
62+
<h3 class="feature-title">{feature.title}</h3>
63+
<p class="feature-description">{feature.description}</p>
64+
</div>
6265
</div>
63-
64-
<h3 class="feature-title">{feature.title}</h3>
65-
<p class="feature-description">{feature.description}</p>
66-
6766
<div class="feature-hover-effect"></div>
6867
</div>
6968
))}
@@ -83,9 +82,21 @@ const features = [
8382
<style>
8483
.features-grid {
8584
display: grid;
86-
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
87-
gap: 2rem;
88-
margin-top: 4rem;
85+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
86+
gap: 1.5rem;
87+
margin-top: 3rem;
88+
}
89+
90+
@media (min-width: 768px) {
91+
.features-grid {
92+
grid-template-columns: repeat(2, 1fr);
93+
}
94+
}
95+
96+
@media (min-width: 1200px) {
97+
.features-grid {
98+
grid-template-columns: repeat(3, 1fr);
99+
}
89100
}
90101

91102
.feature-card {
@@ -135,6 +146,12 @@ const features = [
135146
opacity: 1;
136147
}
137148

149+
.feature-card:hover .feature-icon {
150+
transform: scale(1.1);
151+
background: var(--gradient-primary);
152+
color: white;
153+
}
154+
138155
.feature-hover-effect {
139156
position: absolute;
140157
inset: -50%;
@@ -149,45 +166,44 @@ const features = [
149166
opacity: 0.1;
150167
}
151168

152-
.feature-icon-wrapper {
169+
.feature-content {
170+
display: flex;
171+
align-items: center;
172+
gap: 1.25rem;
153173
position: relative;
154-
width: 80px;
155-
height: 80px;
156-
margin-bottom: 1.5rem;
157-
}
158-
159-
.feature-icon-gradient {
160-
position: absolute;
161-
inset: 0;
162-
border-radius: 1rem;
163-
opacity: 0.2;
164-
filter: blur(20px);
165-
transform: scale(1.2);
174+
z-index: 1;
166175
}
167176

168177
.feature-icon {
169-
position: relative;
170-
width: 100%;
171-
height: 100%;
178+
font-size: 2.5rem;
179+
flex-shrink: 0;
172180
display: flex;
173181
align-items: center;
174182
justify-content: center;
175-
font-size: 2.5rem;
183+
width: 3.5rem;
184+
height: 3.5rem;
176185
background: var(--color-bg-secondary);
177-
border-radius: 1rem;
186+
border-radius: 0.75rem;
178187
box-shadow: var(--shadow-sm);
188+
transition: all var(--transition-base);
189+
}
190+
191+
.feature-text {
192+
flex: 1;
179193
}
180194

181195
.feature-title {
182-
font-size: 1.5rem;
196+
font-size: 1.125rem;
183197
font-weight: 600;
184-
margin-bottom: 0.75rem;
198+
margin-bottom: 0.25rem;
185199
color: var(--color-text);
186200
}
187201

188202
.feature-description {
189203
color: var(--color-text-secondary);
190-
line-height: 1.6;
204+
line-height: 1.5;
205+
font-size: 0.875rem;
206+
margin: 0;
191207
}
192208

193209
.gradient-text {

0 commit comments

Comments
 (0)