Skip to content

Commit 01f5a3b

Browse files
committed
Implement collection features in search
1 parent 0972e88 commit 01f5a3b

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

punks.auction/app/components/Punk/Search.vue

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,30 @@
2929
</template>
3030
</PunkSearchBar>
3131

32+
<Card
33+
v-for="match in collectionMatches"
34+
:key="`${match.collection.slug}/${match.institution?.slug ?? ''}`"
35+
class="collection-card"
36+
>
37+
<span
38+
class="collection-arrow"
39+
aria-hidden="true"
40+
>↗</span
41+
>
42+
<span class="collection-title">{{
43+
match.institution?.title ?? match.collection.title
44+
}}</span>
45+
<span class="collection-subtitle">{{
46+
match.collection.description
47+
}}</span>
48+
<CardLink
49+
:to="match.institution?.source ?? match.collection.source"
50+
:title="match.institution?.title ?? match.collection.title"
51+
target="_blank"
52+
rel="noopener noreferrer"
53+
/>
54+
</Card>
55+
3256
<LazyPunkGrid
3357
:ids="ids"
3458
:size="size"
@@ -56,6 +80,7 @@ const {
5680
ownerHandle,
5781
ids,
5882
counts,
83+
collectionMatches,
5984
showWrappedStateColors,
6085
onEnter,
6186
clearSearch,
@@ -107,4 +132,41 @@ const {
107132
.for-sale-toggle :deep(.form-checkbox-indicator .icon) {
108133
font-size: 12px;
109134
}
135+
136+
/* Clickable explainer card, matching the detail-page collection cards:
137+
CardLink covers the whole card (and drives the built-in hover); the arrow
138+
floats top-right, aligned with the card's --spacer padding. */
139+
.collection-card {
140+
gap: var(--size-1);
141+
font-size: var(--font-sm);
142+
}
143+
144+
.collection-arrow {
145+
position: absolute;
146+
inline-size: auto;
147+
inset-block-start: var(--spacer);
148+
inset-inline-end: var(--spacer);
149+
color: var(--text-dim);
150+
transition: color var(--speed);
151+
}
152+
153+
.collection-title {
154+
/* leave room for the floating arrow */
155+
padding-inline-end: var(--size-5);
156+
}
157+
158+
.collection-subtitle {
159+
color: var(--text-dim);
160+
font-size: var(--font-xs);
161+
transition: color var(--speed);
162+
}
163+
164+
/* On hover the muted arrow and description brighten to full-contrast text
165+
(white in dark mode) instead of staying greyed against the highlight. */
166+
.collection-card:has(> .card-link:hover) .collection-arrow,
167+
.collection-card:has(> .card-link:focus-visible) .collection-arrow,
168+
.collection-card:has(> .card-link:hover) .collection-subtitle,
169+
.collection-card:has(> .card-link:focus-visible) .collection-subtitle {
170+
color: var(--text);
171+
}
110172
</style>

0 commit comments

Comments
 (0)