Skip to content

Commit 263c9f9

Browse files
committed
fix: product card hover
1 parent 72d7d15 commit 263c9f9

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

app.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,23 @@
9191
</div>
9292
</div>
9393
<div class="grid gap-4 grid-cols-3">
94-
<div v-for="node in products" :key="node.id" class="p-2 border border-neutral-700 rounded-2xl">
94+
<div
95+
v-for="node in products"
96+
:key="node.id"
97+
class="p-2 border border-neutral-700 rounded-2xl group cursor-pointer transition-all hover:bg-neutral-800/40 hover:border-neutral-600">
9598
<div class="relative pb-[133%] mb-3">
9699
<NuxtImg
97100
loading="lazy"
98101
:title="node.name"
99102
:alt="node.image.altText || node.name"
100-
:src="node.image.sourceUrl"
103+
:src="node.galleryImages.nodes[0].sourceUrl"
101104
class="object-cover w-full h-full absolute rounded-lg bg-neutral-800" />
105+
<NuxtImg
106+
loading="lazy"
107+
:title="node.name"
108+
:alt="node.image.altText || node.name"
109+
:src="node.image.sourceUrl"
110+
class="object-cover w-full h-full absolute rounded-lg bg-neutral-800 transition-opacity duration-500 group-hover:opacity-0" />
102111
</div>
103112
<div class="px-2 mb-1 text-sm font-semibold gap-6 grid-flow-col grid">
104113
<div class="flex flex-col min-w-0 justify-between gap-1">

gql/queries/getProducts.gql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ query getProducts($after: String, $search: String, $category: String, $order: Or
1616
sourceUrl(size: WOOCOMMERCE_SINGLE)
1717
altText
1818
}
19+
galleryImages {
20+
nodes {
21+
sourceUrl(size: WOOCOMMERCE_SINGLE)
22+
}
23+
}
1924
variations(where: { orderby: { field: NAME, order: DESC } }) {
2025
nodes {
2126
id

0 commit comments

Comments
 (0)