Skip to content

Commit 4e18fe3

Browse files
Merge pull request #176 from CodeForPhilly/feat/zbl-compressed-hero
Refactor Explorer component for a more compact utility header and upd…
2 parents 22a5963 + 309d7fc commit 4e18fe3

File tree

2 files changed

+94
-50
lines changed

2 files changed

+94
-50
lines changed

src/components/Explorer.vue

Lines changed: 90 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,21 @@
99
:large-h1="false"
1010
>
1111
<template v-if="!favorites" v-slot:after-bar>
12-
<div class="not-large-help" v-if="zipCode">
13-
<button class="primary primary-bar" @click="setLocation()">
14-
<span class="material-icons">place</span> Change Location [{{
15-
zipCode
16-
}}]
17-
</button>
18-
</div>
19-
<div v-else class="hide-desk">
20-
<button class="primary primary-bar" @click="setLocation()">
21-
<span class="material-icons">place</span> Set Location
22-
</button>
23-
</div>
24-
25-
<div class="two-up large-help">
26-
<div class="two-up-text">
27-
<h2>
28-
Native plants promote a healthier ecosystem in your garden
29-
<div v-if="zipCode">
30-
<button @click="setLocation()">
31-
<span class="material-icons">place</span> change location [{{
32-
zipCode
33-
}}]
34-
</button>
35-
</div>
36-
<div v-else>
37-
<button @click="setLocation()">
38-
<span class="material-icons">place</span> set location
39-
</button>
40-
</div>
41-
</h2>
42-
<p>
43-
Find which native shrubs, plants and flowers <span v-if="displayLocation">from
44-
<strong>{{ displayLocation }}</strong></span> have the right conditions
45-
to flourish in your garden. Use the side
46-
filters to get started. Detailed instructions are found
47-
<router-link to="/how-to-use#the-directions">here</router-link>
48-
</p>
49-
</div>
50-
<div class="two-up-image" :style="twoUpImage(twoUpIndex)">
51-
<span class="two-up-credit"
52-
><a target="_blank" :href="twoUpImageCredit(twoUpIndex).href">{{
53-
twoUpImageCredit(twoUpIndex).title
54-
}}</a></span
55-
>
12+
<div class="compact-utility-header">
13+
<div class="utility-content">
14+
<div class="location-section">
15+
<button class="location-btn" @click="setLocation()">
16+
<span class="material-icons">place</span>
17+
<span v-if="zipCode">Change Location [{{ zipCode }}]</span>
18+
<span v-else>Set Location</span>
19+
</button>
20+
</div>
21+
<div class="helper-text" v-if="displayLocation">
22+
Find native plants for your yard in <strong>{{ displayLocation }}</strong>. Filter by sun, soil, size, and maintenance.
23+
</div>
24+
<div class="helper-text" v-else>
25+
Find native plants for your yard. Filter by sun, soil, size, and maintenance.
26+
</div>
5627
</div>
5728
</div>
5829
</template>
@@ -3691,7 +3662,7 @@ th {
36913662
.search-desktop-parent {
36923663
display: flex;
36933664
justify-content: right;
3694-
padding: 24px 32px;
3665+
padding: 16px 32px;
36953666
}
36963667
.search-desktop {
36973668
display: flex;
@@ -4002,5 +3973,79 @@ th {
40023973
background: none;
40033974
text-shadow: 0px 0px 2px black;
40043975
}
3976+
3977+
/* Compact utility header styles */
3978+
.compact-utility-header {
3979+
background-color: #f5f5f5;
3980+
border-bottom: 1px solid #e0e0e0;
3981+
padding: 12px 40px 8px;
3982+
margin-bottom: 8px;
3983+
}
3984+
3985+
.utility-content {
3986+
display: flex;
3987+
align-items: center;
3988+
justify-content: space-between;
3989+
flex-wrap: wrap;
3990+
gap: 12px;
3991+
}
3992+
3993+
.location-section {
3994+
flex-shrink: 0;
3995+
}
3996+
3997+
.location-btn {
3998+
display: flex;
3999+
align-items: center;
4000+
gap: 6px;
4001+
padding: 8px 16px;
4002+
background-color: #B74D15;
4003+
color: white;
4004+
border: none;
4005+
border-radius: 4px;
4006+
font-family: Roboto;
4007+
font-size: 14px;
4008+
cursor: pointer;
4009+
transition: background-color 0.2s;
4010+
}
4011+
4012+
.location-btn:hover {
4013+
background-color: #a03d0e;
4014+
}
4015+
4016+
.location-btn .material-icons {
4017+
font-size: 16px;
4018+
}
4019+
4020+
.helper-text {
4021+
color: #555;
4022+
font-family: Roboto;
4023+
font-size: 14px;
4024+
line-height: 1.4;
4025+
flex: 1;
4026+
min-width: 200px;
4027+
}
4028+
4029+
/* Mobile responsive for compact header */
4030+
@media screen and (max-width: 768px) {
4031+
.compact-utility-header {
4032+
padding: 8px 16px 6px;
4033+
}
4034+
4035+
.utility-content {
4036+
flex-direction: column;
4037+
align-items: flex-start;
4038+
gap: 8px;
4039+
}
4040+
4041+
.location-btn {
4042+
font-size: 13px;
4043+
padding: 6px 12px;
4044+
}
4045+
4046+
.helper-text {
4047+
font-size: 13px;
4048+
}
4049+
}
40054050
}
40064051
</style>

src/components/Header.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ export default {
8080
}
8181
8282
.main-nav {
83-
padding-bottom: 32px;
83+
padding-bottom: 20px;
8484
border-bottom: 2px solid #d3d3d3;
85-
/* TODO reduce this when we have more text to make this space look good */
86-
margin-bottom: 32px;
85+
margin-bottom: 16px;
8786
}
8887
8988
.main-nav.seamless {
@@ -252,7 +251,7 @@ menu .copyright {
252251
border-bottom: none;
253252
padding: 0;
254253
margin: 0;
255-
height: 140px;
254+
height: 120px;
256255
}
257256
a.logo-parent h1 {
258257
display: flex;
@@ -262,7 +261,7 @@ menu .copyright {
262261
font-size: 24px;
263262
line-height: 30px;
264263
font-weight: normal;
265-
height: 100px;
264+
height: 80px;
266265
display: flex;
267266
}
268267
h1 .text {

0 commit comments

Comments
 (0)