-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a00bff
commit 3288331
Showing
82 changed files
with
670 additions
and
1,950 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
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 |
---|---|---|
|
@@ -3,3 +3,7 @@ | |
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
.container { | ||
@apply px-4 md:px-12 xl:px-16; | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<script setup lang="ts"> | ||
import 'swiper/css/pagination'; | ||
import 'swiper/css/navigation'; | ||
import { Autoplay } from 'swiper/modules'; | ||
import { SwiperSlide } from 'swiper/vue'; | ||
import { type Swiper } from 'swiper/types'; | ||
import { get, set } from '@vueuse/core'; | ||
const css = useCssModule(); | ||
const swiper = ref<Swiper>(); | ||
const pages = ref(get(swiper)?.snapGrid.length ?? 1); | ||
const activeIndex = ref((get(swiper)?.activeIndex ?? 0) + 1); | ||
const images = ref([]); | ||
const scanImages = () => { | ||
const assetContext = import.meta.glob( | ||
'~/public/img/screenshots/*.(png|jpe?g|webp)', | ||
); | ||
const assetPaths = Object.keys(assetContext).map((path) => | ||
path.replace('/public/img', '/img'), | ||
); | ||
set(images, assetPaths); | ||
}; | ||
const onSwiperUpdate = (s: Swiper) => { | ||
set(swiper, s); | ||
set(activeIndex, s.activeIndex + 1); | ||
set(pages, s.snapGrid.length); | ||
}; | ||
scanImages(); | ||
</script> | ||
|
||
<template> | ||
<div :class="css.container" class="container"> | ||
<Carousel | ||
:autoplay="{ | ||
delay: 5000, | ||
disableOnInteraction: false, | ||
pauseOnMouseEnter: true, | ||
}" | ||
:modules="[Autoplay]" | ||
auto-height | ||
:class="css.slider" | ||
@swiper="onSwiperUpdate($event)" | ||
@slide-change="onSwiperUpdate($event)" | ||
> | ||
<SwiperSlide v-for="(image, i) in images" :key="i"> | ||
<img :src="image" alt=" " class="w-full" /> | ||
</SwiperSlide> | ||
</Carousel> | ||
<div class="container relative !px-0"> | ||
<div :class="css.controls"> | ||
<CarouselControls | ||
v-if="swiper" | ||
v-model:swiper="swiper" | ||
:active-index="activeIndex" | ||
:pages="pages" | ||
arrow-buttons | ||
/> | ||
<div :class="css.thumbnail"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" module> | ||
.container { | ||
@apply flex flex-col relative; | ||
.slider { | ||
@apply rounded-lg md:rounded-2xl lg:rounded-3xl border border-black/[0.12]; | ||
} | ||
.controls { | ||
@apply flex flex-col md:absolute top-0 mt-4 transform md:translate-y-[calc(-50%-2.5rem)] md:-left-6 md:-right-6 items-center justify-center z-[1]; | ||
.thumbnail { | ||
@apply px-8 py-2 md:py-6 rounded-xl border border-black/[.12] bg-white; | ||
box-shadow: 4px 32px 80px 0 rgba(191, 194, 203, 0.24); | ||
} | ||
} | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.