-
Galleria - Circular
-
+
Galleria - AutoPlay
+
AutoPlay mode is used to implement slideshows.
-<h3 class="first">Basic</h3>
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px">
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
-</Galleria>
-
-<h3>AutoPlay</h3>
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 520px"
:circular="true" :autoPlay="true" :transitionInterval="2000">
<template #item="slotProps">
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
</template>
</Galleria>
-import GalleriaService from '../../service/GalleriaService';
+import PhotoService from '../../service/PhotoService';
export default {
data() {
@@ -91,7 +61,7 @@ export default {
},
galleriaService: null,
created() {
- this.galleriaService = new GalleriaService();
+ this.galleriaService = new PhotoService();
},
mounted() {
this.galleriaService.getImages().then(data => this.images = data);
@@ -105,7 +75,7 @@ export default {
-
-
diff --git a/src/views/galleria/GalleriaDoc.vue b/src/views/galleria/GalleriaDoc.vue
index 86da2fc90..abf745333 100755
--- a/src/views/galleria/GalleriaDoc.vue
+++ b/src/views/galleria/GalleriaDoc.vue
@@ -15,6 +15,117 @@ import Galleria from 'primevue/galleria';
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
+
+
+ For the rest of the documentation, sample data below would be return from an example service e.g. PhotoService.
+
+
+{
+ "data":[
+ {
+ "previewImageSrc": "demo/images/galleria/galleria1.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria1s.jpg",
+ "alt": "Description for Image 1",
+ "title": "Title 1"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria2.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria2s.jpg",
+ "alt": "Description for Image 2",
+ "title": "Title 2"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria3.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria3s.jpg",
+ "alt": "Description for Image 3",
+ "title": "Title 3"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria4.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria4s.jpg",
+ "alt": "Description for Image 4",
+ "title": "Title 4"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria5.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria5s.jpg",
+ "alt": "Description for Image 5",
+ "title": "Title 5"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria6.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria6s.jpg",
+ "alt": "Description for Image 6",
+ "title": "Title 6"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria7.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria7s.jpg",
+ "alt": "Description for Image 7",
+ "title": "Title 7"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria8.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria8s.jpg",
+ "alt": "Description for Image 8",
+ "title": "Title 8"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria9.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria9s.jpg",
+ "alt": "Description for Image 9",
+ "title": "Title 9"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria10.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria10s.jpg",
+ "alt": "Description for Image 10",
+ "title": "Title 10"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria11.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria11s.jpg",
+ "alt": "Description for Image 11",
+ "title": "Title 11"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria12.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria12s.jpg",
+ "alt": "Description for Image 12",
+ "title": "Title 12"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria13.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria13s.jpg",
+ "alt": "Description for Image 13",
+ "title": "Title 13"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria14.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria14s.jpg",
+ "alt": "Description for Image 14",
+ "title": "Title 14"
+ },
+ {
+ "previewImageSrc": "demo/images/galleria/galleria15.jpg",
+ "thumbnailImageSrc": "demo/images/galleria/galleria15s.jpg",
+ "alt": "Description for Image 15",
+ "title": "Title 15"
+ }
+ ]
+}
+
+
+
+
+import axios from 'axios'
+
+export default class PhotoService {
+
+ getImages() {
+ return axios.get('demo/data/photos.json').then(res => res.data.data);
+ }
+}
@@ -26,7 +137,7 @@ export default {
},
galleriaService: null,
created() {
- this.galleriaService = new GalleriaService();
+ this.galleriaService = new PhotoService();
},
mounted() {
this.galleriaService.getImages().then(data => this.images = data);
@@ -43,15 +154,13 @@ export default {
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
Responsive
- For responsive design, numVisible can be defined using the responsiveOptions property that should be an array of
+
For responsive design, numVisible can be defined using the responsiveOptions property which references an array of
objects whose breakpoint defines the max-width to apply the settings.
@@ -60,9 +169,7 @@ export default {
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
@@ -84,7 +191,6 @@ responsiveOptions: [
]
-
Header and Footer
Custom content projection is available using the header and footer properties.
@@ -95,15 +201,21 @@ responsiveOptions: [
<template #item="slotProps">
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
- </div>
- </template>
<template #footer>
<h1>Footer</h1>
</template>
</Galleria>
+
+
+ Indicators
+ Indicators allow quick navigation between the items. Set showIndicators to display indicators which can be customized further
+ with the changeItemOnIndicatorHover , showIndicatorsOnItem and indicatorsPosition properties.
+
+<Galleria :value="images" :showIndicators="true">
+ <template #item="slotProps">
+ <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" />
+ </template>
+</Galleria>
Properties
@@ -162,28 +274,28 @@ responsiveOptions: [
An array of options for responsive design.
- showPreviewNavButtons
+ showItemNavigators
boolean
false
- Whether to display navigation buttons in preview container.
+ Whether to display navigation buttons in item section.
- showThumbnailNavButtons
+ showThumbnailNavigators
boolean
true
Whether to display navigation buttons in thumbnail container.
- showNavButtonsOnPreviewHover
+ showItemNavigatorsOnHover
boolean
false
- Whether to display navigation buttons on preview container's hover.
+ Whether to display navigation buttons on item hover.
- changePreviewOnIndicatorHover
+ changeItemOnIndicatorHover
boolean
false
- When enabled, preview item is changed on indicator item's hover.
+ When enabled, item is changed on indicator hover.
circular
@@ -228,10 +340,10 @@ responsiveOptions: [
Whether to display indicator container.
- showIndicatorsOnPreview
+ showIndicatorsOnItem
boolean
false
- When enabled, indicator container is displayed on preview container.
+ When enabled, indicator container is displayed on item container.
indicatorsPosition
@@ -328,206 +440,50 @@ responsiveOptions: [
-<Galleria ref="galleria" :value="images" :activeItemIndex.sync="activeItemIndex" :numVisible="5" style="max-width: 520px;" :class="galleriaClass"
- :showThumbnails="showThumbnails" :showPreviewNavButtons="true" :showNavButtonsOnPreviewHover="true"
- :circular="true" :autoPlay="true" :transitionInterval="3000">
+<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 520px">
<template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" :style="[{'width': !isPreviewFullScreen ? '100%' : '', 'display': !isPreviewFullScreen ? 'block' : ''}]" />
+ <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
- <template #footer>
- <div class="custom-galleria-footer">
- <Button icon="pi pi-list" @click="onThumbnailButtonClick" />
- <span v-if="images">
- <span>{{activeItemIndex + 1}}/{{images.length}}</span>
- <span class="title">{{images[activeItemIndex].title}}</span>
- <span>{{images[activeItemIndex].alt}}</span>
- </span>
- <Button :icon="fullScreenIcon" @click="toggleFullScreen" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
-import GalleriaService from '../../service/GalleriaService';
+import PhotoService from '../../service/PhotoService';
export default {
data() {
return {
images: null,
- activeItemIndex: 0,
- showThumbnails: false,
- isPreviewFullScreen: false
+ responsiveOptions: [
+ {
+ breakpoint: '1024px',
+ numVisible: 5
+ },
+ {
+ breakpoint: '768px',
+ numVisible: 3
+ },
+ {
+ breakpoint: '560px',
+ numVisible: 1
+ }
+ ]
}
},
galleriaService: null,
created() {
- this.galleriaService = new GalleriaService();
+ this.galleriaService = new PhotoService();
},
mounted() {
- this.galleriaService.getImages().then(data => this.images = data);
- this.bindDocumentListeners();
- },
- methods: {
- onThumbnailButtonClick() {
- this.showThumbnails = !this.showThumbnails;
- },
- toggleFullScreen() {
- if (this.isPreviewFullScreen) {
- this.closePreviewFullScreen();
- }
- else {
- this.openPreviewFullScreen();
- }
- },
- onFullScreenChange() {
- this.isPreviewFullScreen = !this.isPreviewFullScreen;
- },
- openPreviewFullScreen() {
- let elem = this.$refs.galleria.$el;
- if (elem.requestFullscreen) {
- elem.requestFullscreen();
- }
- else if (elem.mozRequestFullScreen) { /* Firefox */
- elem.mozRequestFullScreen();
- }
- else if (elem.webkitRequestFullscreen) { /* Chrome, Safari & Opera */
- elem.webkitRequestFullscreen();
- }
- else if (elem.msRequestFullscreen) { /* IE/Edge */
- elem.msRequestFullscreen();
- }
- },
- closePreviewFullScreen() {
- if (document.exitFullscreen) {
- document.exitFullscreen();
- }
- else if (document.mozCancelFullScreen) {
- document.mozCancelFullScreen();
- }
- else if (document.webkitExitFullscreen) {
- document.webkitExitFullscreen();
- }
- else if (document.msExitFullscreen) {
- document.msExitFullscreen();
- }
- },
- bindDocumentListeners() {
- document.addEventListener("fullscreenchange", this.onFullScreenChange);
- document.addEventListener("mozfullscreenchange", this.onFullScreenChange);
- document.addEventListener("webkitfullscreenchange", this.onFullScreenChange);
- document.addEventListener("msfullscreenchange", this.onFullScreenChange);
- },
- unbindDocumentListeners() {
- document.removeEventListener("fullscreenchange", this.onFullScreenChange);
- document.removeEventListener("mozfullscreenchange", this.onFullScreenChange);
- document.removeEventListener("webkitfullscreenchange", this.onFullScreenChange);
- document.removeEventListener("msfullscreenchange", this.onFullScreenChange);
- }
- },
- computed: {
- galleriaClass() {
- return ['custom-galleria', {'preview-fullscreen': this.isPreviewFullScreen}];
- },
- fullScreenIcon() {
- return `pi ${this.isPreviewFullScreen ? 'pi-window-minimize' : 'pi-window-maximize'}`;
- }
+ this.galleriaService.getImages().then(data => this.images = data);
}
}
-
-//SCSS
-::v-deep {
- .custom-galleria {
- &.p-galleria {
- .p-galleria-content {
- height: 95%;
- overflow: hidden;
- position: relative;
-
- .p-galleria-thumbnail-content {
- position: absolute;
- width: 100%;
- bottom: 0;
- background-image: linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.50) 70%);
-
- .p-galleria-thumbnail-container {
- .p-galleria-thumbnail-items-content {
- .p-galleria-thumbnail-items-container {
- .p-galleria-thumbnail-item {
- opacity: .6;
-
- &.p-galleria-thumbnail-item-current {
- opacity: 1;
- }
- }
- }
- }
- }
- }
- }
-
- .p-galleria-footer {
- padding: 0;
- background-color: rgba(0, 0, 0, .9);
- border: rgba(0, 0, 0, .9);
-
- .custom-galleria-footer {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: stretch;
- color: #ffffff;
-
- > button {
- background-color: transparent;
- padding: .3rem;
- margin: .2rem;
- border: 0 none;
- border-radius: 0;
- color: #ffffff;
-
- &:hover {
- background-color: transparent;
- }
- }
-
- > span {
- flex-grow: 1;
-
- > span {
- font-size: .9rem;
- padding-left: .829rem;
-
- &.title {
- font-weight: bold;
- }
- }
- }
- }
- }
-
- &.preview-fullscreen {
- .p-galleria-preview-container {
- .p-galleria-preview-nav-button {
- top: 50%;
- height: 20rem;
- width: 4rem;
- margin-top: -10rem;
- }
- }
- }
- }
- }
-}
-
diff --git a/src/views/galleria/GalleriaFullScreenDemo.vue b/src/views/galleria/GalleriaFullScreenDemo.vue
index 54033cd19..e9954715a 100755
--- a/src/views/galleria/GalleriaFullScreenDemo.vue
+++ b/src/views/galleria/GalleriaFullScreenDemo.vue
@@ -2,22 +2,20 @@
-
Galleria - FullScreen
-
+
Galleria - FullScreen
+
In fullscreen mode content covers the whole page over a mask..
-
Basic
+
With Thumbnails
-
-
-
+
@@ -30,24 +28,20 @@
-
-
-
+
-
Custom Contents
+
Custom Content
-
-
-
+
@@ -63,16 +57,14 @@
-<h3 class="first">Basic</h3>
+<h3>With Thumbnails</h3>
<Galleria :value="images" :responsiveOptions="responsiveOptions2" :numVisible="9" containerStyle="max-width: 50%"
- :circular="true" :fullScreen="true" :showPreviewNavButtons="true" :visible.sync="displayBasic">
+ :circular="true" :fullScreen="true" :showItemNavigators="true" :visible.sync="displayBasic">
<template #item="slotProps">
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
</template>
</Galleria>
@@ -80,29 +72,25 @@
<h3>Without Thumbnails</h3>
<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="7" containerStyle="max-width: 850px"
- :circular="true" :fullScreen="true" :showPreviewNavButtons="true" :showThumbnails="false" :visible.sync="displayBasic2">
+ :circular="true" :fullScreen="true" :showItemNavigators="true" :showThumbnails="false" :visible.sync="displayBasic2">
<template #item="slotProps">
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
</template>
</Galleria>
<Button label="Show" icon="pi pi-external-link" @click="displayBasic2 = true" />
-<h3>Custom Contents</h3>
+<h3>Custom Content</h3>
<Galleria :value="images" :activeItemIndex.sync="activeItemIndex" :responsiveOptions="responsiveOptions" :numVisible="7" containerStyle="max-width: 850px"
- :circular="true" :fullScreen="true" :showPreviewNavButtons="true" :showThumbnails="false" :visible.sync="displayCustom">
+ :circular="true" :fullScreen="true" :showItemNavigators="true" :showThumbnails="false" :visible.sync="displayCustom">
<template #item="slotProps">
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
</template>
</Galleria>
@@ -115,7 +103,7 @@
-import GalleriaService from '../../service/GalleriaService';
+import PhotoService from '../../service/PhotoService';
export default {
data() {
@@ -161,7 +149,7 @@ export default {
},
galleriaService: null,
created() {
- this.galleriaService = new GalleriaService();
+ this.galleriaService = new PhotoService();
},
mounted() {
this.galleriaService.getImages().then(data => this.images = data);
@@ -181,7 +169,7 @@ export default {
-
-
+
\ No newline at end of file
diff --git a/src/views/galleria/GalleriaNavigatorDemo.vue b/src/views/galleria/GalleriaNavigatorDemo.vue
new file mode 100755
index 000000000..f003bb8b1
--- /dev/null
+++ b/src/views/galleria/GalleriaNavigatorDemo.vue
@@ -0,0 +1,176 @@
+
+
+
+
+
Galleria - Navigator
+
Combining item navigators, thumbnails and indicators provide various UI alternatives.
+
+
+
+
+
Item Navigators and Thumbnails
+
+
+
+
+
+
+
+
+
+
Item Navigators without Thumbnails
+
+
+
+
+
+
+
+
+
+
Item Navigators on Hover
+
+
+
+
+
+
+
+
+
+
Item Navigators and Indicators
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h3>Item Navigators and Thumbnails</h3>
+<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px"
+ :showItemNavigators="true">
+ <template #item="slotProps">
+ <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
+ </template>
+ <template #thumbnail="slotProps">
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
+ </template>
+</Galleria>
+
+<h3>Item Navigators without Thumbnails</h3>
+<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px"
+ :showItemNavigators="true" :showThumbnails="false">
+ <template #item="slotProps">
+ <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
+ </template>
+ <template #thumbnail="slotProps">
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
+ </template>
+</Galleria>
+
+<h3>Item Navigators on Hover</h3>
+<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px;"
+ :showItemNavigators="true" :showItemNavigatorsOnHover="true">
+ <template #item="slotProps">
+ <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
+ </template>
+ <template #thumbnail="slotProps">
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
+ </template>
+</Galleria>
+
+<h3>Item Navigators and Indicators</h3>
+<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px;"
+ :showItemNavigators="true" :showThumbnails="false" :showItemNavigatorsOnHover="true" :showIndicators="true">
+ <template #item="slotProps">
+ <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
+ </template>
+ <template #thumbnail="slotProps">
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
+ </template>
+</Galleria>
+
+
+
+
+import PhotoService from '../../service/PhotoService';
+
+export default {
+ data() {
+ return {
+ images: null,
+ responsiveOptions: [
+ {
+ breakpoint: '1024px',
+ numVisible: 5
+ },
+ {
+ breakpoint: '768px',
+ numVisible: 3
+ },
+ {
+ breakpoint: '560px',
+ numVisible: 1
+ }
+ ]
+ }
+ },
+ galleriaService: null,
+ created() {
+ this.galleriaService = new PhotoService();
+ },
+ mounted() {
+ this.galleriaService.getImages().then(data => this.images = data);
+ }
+}
+
+
+
+
+
+
+
+
diff --git a/src/views/galleria/GalleriaPreviewDemo.vue b/src/views/galleria/GalleriaPreviewDemo.vue
deleted file mode 100755
index 047e510c1..000000000
--- a/src/views/galleria/GalleriaPreviewDemo.vue
+++ /dev/null
@@ -1,264 +0,0 @@
-
-
-
-
-
-
Basic
-
-
-
-
-
-
-
-
-
-
-
-
Navigation Buttons
-
-
- With Thumbnails
-
-
-
-
-
-
-
-
-
-
-
-
-
- Without Thumbnails
-
-
-
-
-
-
-
-
-
-
-
-
Show Navigation Buttons on Hover
-
-
- With Thumbnails
-
-
-
-
-
-
-
-
-
-
-
-
-
- Without Thumbnails
-
-
-
-
-
-
-
-
-
-
-
-
Advanced
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h3 class="first">Basic</h3>
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px">
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
-</Galleria>
-
-<h3>Navigation Buttons</h3>
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px"
- :showPreviewNavButtons="true">
- <template #header>
- With Thumbnails
- </template>
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
-</Galleria>
-
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px; margin-top: 2em"
- :showPreviewNavButtons="true" :showThumbnails="false">
- <template #header>
- Without Thumbnails
- </template>
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
-</Galleria>
-
-<h3>Show Navigation Buttons on Preview Hover</h3>
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px;"
- :showPreviewNavButtons="true" :showNavButtonsOnPreviewHover="true">
- <template #header>
- With Thumbnails
- </template>
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
-</Galleria>
-
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px; margin-top: 2em"
- :showPreviewNavButtons="true" :showThumbnails="false" :showNavButtonsOnPreviewHover="true">
- <template #header>
- Without Thumbnails
- </template>
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
-</Galleria>
-
-<h3>Advanced</h3>
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" :circular="true" style="max-width: 520px;"
- :showPreviewNavButtons="true" :showThumbnails="false" :showNavButtonsOnPreviewHover="true"
- :showIndicators="true" :showIndicatorsOnPreview="true" :changePreviewOnIndicatorHover="true">
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%; display: block;" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" style="display: block;" />
- </div>
- </template>
-</Galleria>
-
-
-
-
-import GalleriaService from '../../service/GalleriaService';
-
-export default {
- data() {
- return {
- images: null,
- responsiveOptions: [
- {
- breakpoint: '1024px',
- numVisible: 5
- },
- {
- breakpoint: '768px',
- numVisible: 3
- },
- {
- breakpoint: '560px',
- numVisible: 1
- }
- ]
- }
- },
- galleriaService: null,
- created() {
- this.galleriaService = new GalleriaService();
- },
- mounted() {
- this.galleriaService.getImages().then(data => this.images = data);
- }
-}
-
-
-
-
-
-
-
-
diff --git a/src/views/galleria/GalleriaBasicDemo.vue b/src/views/galleria/GalleriaProgrammaticDemo.vue
old mode 100755
new mode 100644
similarity index 61%
rename from src/views/galleria/GalleriaBasicDemo.vue
rename to src/views/galleria/GalleriaProgrammaticDemo.vue
index 489a9ec48..6586a65a9
--- a/src/views/galleria/GalleriaBasicDemo.vue
+++ b/src/views/galleria/GalleriaProgrammaticDemo.vue
@@ -1,29 +1,16 @@
-
+
-
Galleria - Basic
-
+
Galleria - Programmatic
+
Galleria can be controlled programmatically using the activeItemIndex property.
-
Default
-
-
-
-
-
-
-
-
-
-
-
-
Programmatic
-
+
-
+
@@ -31,9 +18,7 @@
-
-
-
+
@@ -43,22 +28,9 @@
-<h3 class="first">Default</h3>
-<Galleria :value="images" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 520px">
- <template #item="slotProps">
- <img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
- </template>
- <template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
- </div>
- </template>
-</Galleria>
-
-<h3>Programmatic</h3>
-<div style="padding: .5em 0">
+<div style="padding: .5rem 0">
<Button icon="pi pi-minus" @click="activeIndex--" class="p-button-secondary" />
- <Button icon="pi pi-plus" @click="activeIndex++" class="p-button-secondary" style="margin-left: .5em" />
+ <Button icon="pi pi-plus" @click="activeIndex++" class="p-button-secondary" style="margin-left: .5rem" />
</div>
<Galleria :value="images" :activeItemIndex.sync="activeIndex" :responsiveOptions="responsiveOptions" :numVisible="5" style="max-width: 520px">
@@ -66,16 +38,14 @@
<img :src="slotProps.item.previewImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
</template>
<template #thumbnail="slotProps">
- <div class="p-grid p-nogutter p-justify-center">
- <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
- </div>
+ <img :src="slotProps.item.thumbnailImageSrc" :alt="slotProps.item.alt" />
</template>
</Galleria>
-import GalleriaService from '../../service/GalleriaService';
+import PhotoService from '../../service/PhotoService';
export default {
data() {
@@ -100,10 +70,10 @@ export default {
},
galleriaService: null,
created() {
- this.galleriaService = new GalleriaService();
+ this.galleriaService = new PhotoService();
},
mounted() {
- this.galleriaService.getImages().then(data => this.images = data);
+ this.galleriaService.getImages().then(data => this.images = data);
},
computed: {
activeIndex: {
@@ -126,7 +96,7 @@ export default {