Skip to content

Commit e8653dc

Browse files
committed
fix(web): smooth hero search transition
1 parent d8dd654 commit e8653dc

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function Header() {
3030
return (
3131
<header className="navbar">
3232
<div className="navbar-inner">
33-
<Link to="/" className="brand">
33+
<Link to="/" search={{}} className="brand">
3434
<span className="brand-mark">
3535
<img src="/clawd-logo.png" alt="" aria-hidden="true" />
3636
</span>

src/styles.css

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,23 +211,27 @@ code {
211211
max-width: 1200px;
212212
margin: 0 auto;
213213
display: grid;
214-
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
214+
grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
215215
gap: 40px;
216216
align-items: center;
217-
transition: grid-template-columns 0.4s ease;
217+
transition:
218+
grid-template-columns 0.45s cubic-bezier(0.2, 0.9, 0.2, 1),
219+
gap 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
218220
}
219221

220222
.hero-copy {
221223
max-height: 640px;
222224
overflow: hidden;
225+
min-width: 0;
223226
transition:
224227
opacity 0.35s ease,
225228
transform 0.35s ease,
226229
max-height 0.35s ease;
227230
}
228231

229232
.hero.search-mode .hero-inner {
230-
grid-template-columns: 1fr;
233+
grid-template-columns: 0fr minmax(0, 1fr);
234+
gap: 0px;
231235
}
232236

233237
.hero.search-mode .hero-copy {
@@ -265,7 +269,8 @@ code {
265269
}
266270

267271
.hero.search-mode .hero-search-card {
268-
transform: translateY(-6px) scale(1.01);
272+
transform: scale(1.01);
273+
box-shadow: 0 22px 46px rgba(29, 26, 23, 0.16);
269274
}
270275

271276
.hero-badge {
@@ -1087,6 +1092,18 @@ code {
10871092
font-size: 1.1rem;
10881093
}
10891094

1095+
@media (max-width: 860px) {
1096+
.hero-inner {
1097+
grid-template-columns: 1fr;
1098+
transition: none;
1099+
}
1100+
1101+
.hero.search-mode .hero-inner {
1102+
grid-template-columns: 1fr;
1103+
gap: 24px;
1104+
}
1105+
}
1106+
10901107
.search-filter-button {
10911108
border-radius: 999px;
10921109
border: 1px solid rgba(255, 107, 74, 0.3);

0 commit comments

Comments
 (0)