Skip to content

Commit 95a3788

Browse files
committed
nicer placement of heart
1 parent 199fc2c commit 95a3788

File tree

1 file changed

+56
-24
lines changed

1 file changed

+56
-24
lines changed

src/components/Explorer.vue

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,40 @@
511511
}"
512512
:style="imageStyle(result, true)"
513513
>
514+
<div class="view-details-hint" aria-hidden="true">
515+
View details
516+
</div>
517+
518+
<div v-if="photoMode !== 'studio'" class="name-scrim">
519+
<div class="name-text">
520+
<h4 class="common-name">{{ result["Common Name"] }}</h4>
521+
<h5 class="scientific-name">
522+
{{ result["Scientific Name"] }}
523+
</h5>
524+
</div>
525+
<button
526+
@click.stop.prevent="toggleFavorite(result._id)"
527+
class="tile-favorite text"
528+
:aria-label="
529+
$store.state.favorites.has(result._id)
530+
? `Remove ${result['Common Name']} from favorites`
531+
: `Add ${result['Common Name']} to favorites`
532+
"
533+
>
534+
<span class="material-icons material-align">{{
535+
renderFavorite(result._id)
536+
}}</span>
537+
</button>
538+
</div>
539+
</div>
540+
541+
<div v-if="photoMode === 'studio'" class="caption">
542+
<div class="caption-text">
543+
<h4 class="common-name">{{ result["Common Name"] }}</h4>
544+
<h5 class="scientific-name">
545+
{{ result["Scientific Name"] }}
546+
</h5>
547+
</div>
514548
<button
515549
@click.stop.prevent="toggleFavorite(result._id)"
516550
class="tile-favorite text"
@@ -524,24 +558,6 @@
524558
renderFavorite(result._id)
525559
}}</span>
526560
</button>
527-
528-
<div class="view-details-hint" aria-hidden="true">
529-
View details
530-
</div>
531-
532-
<div v-if="photoMode !== 'studio'" class="name-scrim">
533-
<h4 class="common-name">{{ result["Common Name"] }}</h4>
534-
<h5 class="scientific-name">
535-
{{ result["Scientific Name"] }}
536-
</h5>
537-
</div>
538-
</div>
539-
540-
<div v-if="photoMode === 'studio'" class="caption">
541-
<h4 class="common-name">{{ result["Common Name"] }}</h4>
542-
<h5 class="scientific-name">
543-
{{ result["Scientific Name"] }}
544-
</h5>
545561
</div>
546562
</div>
547563
</article>
@@ -3917,20 +3933,23 @@ th {
39173933
background: #ffffff;
39183934
}
39193935
.tile-favorite {
3920-
position: absolute;
3921-
right: 12px;
3922-
bottom: 12px;
39233936
width: 52px;
39243937
height: 52px;
39253938
padding: 0;
39263939
border-radius: 999px;
39273940
background: transparent;
3941+
background-color: transparent;
3942+
box-shadow: none;
39283943
border: none;
3944+
appearance: none;
3945+
-webkit-appearance: none;
3946+
-webkit-tap-highlight-color: transparent;
39293947
display: inline-flex;
39303948
align-items: center;
39313949
justify-content: center;
39323950
color: #1d2e26; /* studio default (over white) */
39333951
z-index: 2;
3952+
flex: 0 0 auto;
39343953
}
39353954
.tile-favorite .material-icons {
39363955
font-size: 28px;
@@ -3944,6 +3963,8 @@ th {
39443963
}
39453964
.photo--studio .tile-favorite {
39463965
color: #111;
3966+
background: transparent;
3967+
background-color: transparent;
39473968
}
39483969
.tile-favorite:focus-visible {
39493970
outline: 3px solid rgba(183, 77, 21, 0.35);
@@ -3971,13 +3992,20 @@ th {
39713992
right: 0;
39723993
bottom: 0;
39733994
padding: 12px 12px 10px;
3995+
display: flex;
3996+
gap: 12px;
3997+
align-items: center;
3998+
justify-content: space-between;
39743999
background: linear-gradient(
39754000
to top,
39764001
rgba(0, 0, 0, 0.74) 0%,
39774002
rgba(0, 0, 0, 0.34) 55%,
39784003
rgba(0, 0, 0, 0) 100%
39794004
);
39804005
}
4006+
.name-text {
4007+
min-width: 0;
4008+
}
39814009
.name-scrim .common-name,
39824010
.name-scrim .scientific-name {
39834011
color: #fff;
@@ -3990,9 +4018,13 @@ th {
39904018
background: #fff;
39914019
min-height: 56px; /* reserve space so grid doesn't jump for short/long names */
39924020
display: flex;
3993-
flex-direction: column;
3994-
justify-content: center;
3995-
gap: 2px;
4021+
flex-direction: row;
4022+
align-items: center;
4023+
justify-content: space-between;
4024+
gap: 12px;
4025+
}
4026+
.caption-text {
4027+
min-width: 0;
39964028
}
39974029
.plant-preview .common-name {
39984030
font-size: 15px;

0 commit comments

Comments
 (0)