-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from zackha/dev
Dev
- Loading branch information
Showing
6 changed files
with
613 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ export default defineAppConfig({ | |
siteName: 'NuxtCommerce', | ||
ui: { | ||
primary: 'red', | ||
gray: 'neutral', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<script setup lang="ts"> | ||
const { isOpenImageSliderModal } = useComponents(); | ||
const props = defineProps({ | ||
product: Object, | ||
}); | ||
const images = computed(() => { | ||
const mainImage = props.product?.image?.sourceUrl ? [props.product.image.sourceUrl] : []; | ||
const additionalImages = props.product?.galleryImages?.nodes.map((image: any) => image.sourceUrl) || []; | ||
return mainImage.concat(additionalImages); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<UModal | ||
:ui="{ | ||
overlay: { | ||
background: 'bg-neutral-200/90 dark:bg-neutral-800/90 backdrop-blur-sm', | ||
}, | ||
background: 'bg-bg-transparent dark:bg-bg-transparent', | ||
container: 'items-center', | ||
shadow: 'shadow-none', | ||
}"> | ||
<div | ||
@click="isOpenImageSliderModal = false" | ||
class="flex p-2 absolute z-50 right-3 top-3 bg-white/50 hover:bg-white rounded-full items-center justify-center shadow transition backdrop-blur-sm"> | ||
<UIcon name="i-iconamoon-close" class="text-black" size="16" /> | ||
</div> | ||
<UCarousel | ||
:items="images" | ||
:ui="{ | ||
item: 'basis-full', | ||
container: 'rounded-3xl', | ||
indicators: { | ||
wrapper: 'relative bottom-0 mt-4', | ||
}, | ||
}" | ||
class="w-full mx-auto" | ||
indicators> | ||
<template #default="{ item }"> | ||
<img :src="item" class="w-full select-none" draggable="false" /> | ||
</template> | ||
<template #indicator="{ onClick, page, active }"> | ||
<UButton :label="String(page)" :variant="active ? 'solid' : 'outline'" size="2xs" class="rounded-full min-w-6 justify-center" @click="onClick(page)" /> | ||
</template> | ||
</UCarousel> | ||
</UModal> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const isOpenImageSliderModal = ref(false); | ||
|
||
export const useComponents = () => { | ||
return { | ||
isOpenImageSliderModal, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.