Skip to content

Commit

Permalink
feature: add image change on result hover (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
herrardo authored May 3, 2023
1 parent 4eff97c commit 289d31d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions src/components/pre-search/custom-query-preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#default="{ query, totalResults, results }"
>
<div class="x-mb-40 x-flex x-flex-col x-gap-2 desktop:x-mb-64 desktop:x-gap-16">
<h1 class="x-title1 max-desktop:x-px-16 max-desktop:x-title1-sm">
<h1 class="x-title1 max-desktop:x-title1-sm max-desktop:x-px-16">
{{ getTitle(query) }}
</h1>
<CustomSlidingPanel>
Expand All @@ -20,11 +20,14 @@
<ArrowRightIcon class="x-icon-lg" />
</BaseEventButton>
</template>
<ItemsList :items="results" class="x-flex x-gap-16 x-pt-16 max-desktop:x-px-16">
<template #result="{ item: result }">
<Result :result="result" class="x-w-[calc(38vw-16px)] desktop:x-w-[216px]" />
</template>
</ItemsList>
<div class="x-flex x-gap-16 x-pt-16 max-desktop:x-px-16">
<Result
v-for="result in results"
:key="result.id"
:result="result"
class="x-w-[calc(38vw-16px)] desktop:x-w-[216px]"
/>
</div>
</CustomSlidingPanel>
</div>
</QueryPreviewList>
Expand Down
2 changes: 1 addition & 1 deletion src/components/results/result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<MainScrollItem :item="result" tag="article" class="x-result x-group/result x-gap-4">
<div class="x-relative">
<BaseResultLink class="x-result__picture" :result="result">
<BaseResultImage :result="result" :loadAnimation="imageAnimation" class="x-picture-zoom">
<BaseResultImage :result="result" :loadAnimation="imageAnimation" showNextImageOnHover>
<template #placeholder>
<BasePlaceholderImage />
</template>
Expand Down

0 comments on commit 289d31d

Please sign in to comment.