Skip to content

Commit

Permalink
refactor: revamp homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi committed Dec 21, 2023
1 parent 3a00bff commit 4aa4858
Show file tree
Hide file tree
Showing 78 changed files with 662 additions and 1,883 deletions.
159 changes: 0 additions & 159 deletions components/HeroArea.vue

This file was deleted.

2 changes: 1 addition & 1 deletion components/NavigationMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const menus: Menu[] = [
:external="menu.external"
:to="menu.to"
>
<span> {{ menu.label }} </span>
{{ menu.label }}
<template v-if="menu.external" #append>
<RuiIcon size="18" name="external-link-line" />
</template>
Expand Down
90 changes: 90 additions & 0 deletions components/common/AppShowcaseSlider.vue
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>
20 changes: 0 additions & 20 deletions components/common/NavigationAnchor.vue

This file was deleted.

17 changes: 0 additions & 17 deletions components/download/DownloadButton.vue

This file was deleted.

Loading

0 comments on commit 4aa4858

Please sign in to comment.