Skip to content

Commit

Permalink
Merge pull request #144 from IBEC-BOX/feat/gallery
Browse files Browse the repository at this point in the history
added new components galleries
  • Loading branch information
Zh3nyaZh3nya authored Dec 11, 2024
2 parents 3f79940 + 8ac93e4 commit 8b9cc08
Show file tree
Hide file tree
Showing 6 changed files with 487 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ibecsystems/nuxt3-ui-kit",
"version": "1.0.57",
"version": "1.0.58",
"description": "Ibec Nuxt3 UI components",
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export default defineNuxtConfig({
'partsCardErgNews',
'partsFilesErg',
'partsPagination',
'pagesErrorErg'
'pagesErrorErg',
'partsGalleryRow',
'partsGalleryView'
]
},
devtools: { enabled: false },
Expand Down
20 changes: 20 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,25 @@ export default defineNuxtModule<ModuleOptions>({
),
});
}

// Gallery

if (options.components.includes("partsGalleryRow")) {
addComponent({
name: "partsGalleryRow",
filePath: resolver.resolve(
"runtime/components/Parts/Gallery/Row.vue"
),
});
}

if (options.components.includes("partsGalleryView")) {
addComponent({
name: "partsGalleryView",
filePath: resolver.resolve(
"runtime/components/Parts/Gallery/View.vue"
),
});
}
},
});
173 changes: 146 additions & 27 deletions src/runtime/components/Pages/TestVuetify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,43 @@
<NuxtPage class="bg-primary" />
<section class="h-100 bg-primary">
<v-container class="px-4">
<client-only>
<partsSlider
id="slider-about"
:slides="slides"
slider-allow-touch-move="false"
slider-speed="500"
:static-chips="{
text: 'about',
attrs: {
class: 'mt-12 mb-8 ml-9 ml-md-13',
color: 'white',
variant: 'outlined',
style: 'margin-top: 123px !important;'
}
}"
:slider-pagination="true"
:show-buttons="false"
slider-direction="vertical"
:slider-pagination-active-variant="'white'"
:height="'800px'"
:control-scroll="true"
:slider-background-image="'https://images.unsplash.com/photo-1562043236-559c3b65a6e2?auto=format&fit=crop&q=80&w=2940&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D'"
:slider-background-image-zoom="true"
:slider-background-image-zoom-scale="1.5"
class="main__about__slider"
/>
</client-only>
<!-- <client-only>-->

Check warning on line 45 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- <partsSlider-->

Check warning on line 46 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- id="slider-about"-->

Check warning on line 47 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- :slides="slides"-->

Check warning on line 48 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- slider-allow-touch-move="false"-->

Check warning on line 49 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- slider-speed="500"-->

Check warning on line 50 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- :static-chips="{-->

Check warning on line 51 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- text: 'about',-->

Check warning on line 52 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- attrs: {-->

Check warning on line 53 in src/runtime/components/Pages/TestVuetify.vue

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 0 spaces
<!-- class: 'mt-12 mb-8 ml-9 ml-md-13',-->
<!-- color: 'white',-->
<!-- variant: 'outlined',-->
<!-- style: 'margin-top: 123px !important;'-->
<!-- }-->
<!-- }"-->
<!-- :slider-pagination="true"-->
<!-- :show-buttons="false"-->
<!-- slider-direction="vertical"-->
<!-- :slider-pagination-active-variant="'white'"-->
<!-- :height="'800px'"-->
<!-- :control-scroll="true"-->
<!-- :slider-background-image="'https://images.unsplash.com/photo-1562043236-559c3b65a6e2?auto=format&fit=crop&q=80&w=2940&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D'"-->
<!-- :slider-background-image-zoom="true"-->
<!-- :slider-background-image-zoom-scale="1.5"-->
<!-- class="main__about__slider"-->
<!-- />-->
<!-- </client-only>-->
<v-btn @click="model = !model">gfdgfsdgf</v-btn>
<parts-gallery-row
:blocks="gallery2"
:disable-links="false"
/>
<parts-gallery-view
v-model="model"
:gallery="gallery[0].images"
:preview-image="preview"
/>
</v-container>
</section>

Expand Down Expand Up @@ -100,6 +110,115 @@
</template>

<script setup>
import { ref} from "vue"
const model = ref(false)
const gallery2 = ref([
{
category: {
id: 1,
title: 'asd'
},
id: 1,
title: 'dasdsad',
preview: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
},
{
category: {
id: 1,
title: 'asd'
},
id: 1,
title: 'dasdsad',
preview: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
},
{
category: {
id: 1,
title: 'asd'
},
id: 1,
title: 'dasdsad',
preview: 'https://fastly.picsum.photos/id/523/500/300.jpg?hmac=4pQD_Jbc8uFrr01uI1PtSZM3wIjP-pTu7ZogoeRwVFw',
},
{
category: {
id: 1,
title: 'asd'
},
id: 1,
title: 'dasdsad',
preview: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg'
},
])
const gallery = ref([
{
category: {
id: 1,
title: 'asd'
},
id: 1,
title: 'dasdsad',
images: [
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 1,
},
{
image: 'https://fastly.picsum.photos/id/523/500/300.jpg?hmac=4pQD_Jbc8uFrr01uI1PtSZM3wIjP-pTu7ZogoeRwVFw',
active: false,
id: 2,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 3,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 4,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 5,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 6,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 7,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 8,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 9,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 10,
},
{
image: 'https://cdn.vuetifyjs.com/images/cards/sunshine.jpg',
active: false,
id: 11,
},
]
}
])
const preview = ref(gallery.value[0].images[0])
const contacts = [
{
title: 'asd',
Expand Down
88 changes: 88 additions & 0 deletions src/runtime/components/Parts/Gallery/Row.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<template>
<swiper-container
ref="swiperRefGalleryBlocks"
:slides-per-view="blocks.length === 4 ? (lgAndUp ? 4 : (mdAndUp ? 3.2 : 1.2)) : (lgAndUp ? 4.2 : (mdAndUp ? 3.2 : 1.2))"
:space-between="lgAndUp ? 20 : 8"
direction="horizontal"
class="row-gallery-blocks d-block"
height="290px"
v-bind="swiperAttrs"
>
<swiper-slide
v-for="(block, index) in blocks"
:key="`gallery-block-${index}`"
>
<template v-if="!disableLinks">
<nuxt-link :to="`/gallery/${block.id}`">
<v-card elevation="0" height="290px" class="row-gallery-blocks-card bg-transparent">
<v-img :src="block.preview" height="290px" width="100%" cover class="row-gallery-blocks-card-image" />
<div class="row-gallery-blocks-card-title py-3 px-4">
<span>{{ block.category.title }}</span>
</div>
</v-card>
</nuxt-link>
</template>
<template v-else>
<v-card elevation="0" height="290px" class="row-gallery-blocks-card bg-transparent">
<v-img :src="block.preview" height="290px" width="100%" cover class="row-gallery-blocks-card-image" />
<div class="row-gallery-blocks-card-title py-3 px-4">
<span>{{ block.category.title }}</span>
</div>
</v-card>
</template>

</swiper-slide>
</swiper-container>
</template>

<script setup lang="ts">
import { useAttrs } from "vue";
import { register } from "swiper/element/bundle";
import { useDisplay } from "vuetify";
import { useMainStore } from "../../../store/mainStore";
const mainStore = useMainStore();
const attrs = useAttrs();
const swiperAttrs = {
...mainStore.getObjectPropertiesWithPrefix(attrs, "swiper"),
};
register()
const props = defineProps({
blocks: {
type: Array,
},
disableLinks: {
type: Boolean,
default: false,
},
})
const { mdAndUp, lgAndUp } = useDisplay()
</script>

<style scoped lang="scss">
.row-gallery-blocks {
&-card {
position: relative;
&-image {
border-radius: 32px;
@media(max-width: 960px) {
border-radius: 16px;
}
}
&-title {
position: absolute;
bottom: 24px;
left: 24px;
background: rgba(163, 163, 163, 0.60);
border-radius: 32px;
span {
color: #fff;
}
}
}
}
</style>
Loading

0 comments on commit 8b9cc08

Please sign in to comment.