npm-moa-gallery
Version:
2 lines (1 loc) • 7.36 kB
JavaScript
import"blueimp-gallery/css/blueimp-gallery.min.css";import"blueimp-gallery/js/blueimp-gallery-fullscreen.js";import"blueimp-gallery/js/blueimp-gallery-video.js";import"blueimp-gallery/js/blueimp-gallery-youtube.js";import e from"blueimp-gallery/js/blueimp-gallery.js";var t={name:"BlueMapGallery",props:{images:{type:Array,default:function(){return[]}},options:{type:Object,default:function(){return{}}},carousel:{type:Boolean,default:!1},index:{type:Number},id:{type:String,default:"blueimp-gallery"}},data:function(){return{instance:null}},watch:{index:function(e){this.carousel||(null!==e?this.open(e):(this.instance&&this.instance.close(),this.$emit("close")))}},mounted:function(){this.carousel&&this.open()},destroyed:function(){null!==this.instance&&(this.instance.destroyEventListeners(),this.instance.close(),this.instance=null)},methods:{open:function(t){var i=this;void 0===t&&(t=0);var n=void 0!==e.Gallery?e.Gallery:e,a=Object.assign({toggleControlsOnReturn:!1,toggleControlsOnSlideClick:!1,closeOnSlideClick:!1,carousel:this.carousel,container:"#"+this.id,index:t,onopen:function(){return i.$emit("onopen")},onopened:function(){return i.$emit("onopened")},onslide:this.onSlideCustom,onslideend:function(e,t){return i.$emit("onslideend",{index:e,slide:t})},onslidecomplete:function(e,t){return i.$emit("onslidecomplete",{index:e,slide:t})},onclose:function(){return i.$emit("close")},onclosed:function(){return i.$emit("onclosed")}},this.options);this.carousel&&(a.container=this.$el),this.instance=n(this.images,a)},onSlideCustom:function(e,t){this.$emit("onslide",{index:e,slide:t});var i=this.images[e];if(void 0!==i){var n=i.description,a=this.instance.container.find(".description");n&&(a.empty(),a[0].appendChild(document.createTextNode(n)))}}}};var i=function(e,t,i,n,a,o,s,l,r,d){"boolean"!=typeof s&&(r=l,l=s,s=!1);var c,u="function"==typeof i?i.options:i;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,a&&(u.functional=!0)),n&&(u._scopeId=n),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,r(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=c):t&&(c=s?function(){t.call(this,d(this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),c)if(u.functional){var p=u.render;u.render=function(e,t){return c.call(t),p(e,t)}}else{var m=u.beforeCreate;u.beforeCreate=m?[].concat(m,c):[c]}return i},n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var a=document.head||document.getElementsByTagName("head")[0],o={};var s=function(e){return function(e,t){return function(e,t){var i=n?t.media||"default":e,s=o[i]||(o[i]={ids:new Set,styles:[]});if(!s.ids.has(e)){s.ids.add(e);var l=t.source;if(t.map&&(l+="\n/*# sourceURL="+t.map.sources[0]+" */",l+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",t.media&&s.element.setAttribute("media",t.media),a.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(l),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var r=s.ids.size-1,d=document.createTextNode(l),c=s.element.childNodes;c[r]&&s.element.removeChild(c[r]),c.length?s.element.insertBefore(d,c[r]):s.element.appendChild(d)}}}(e,t)}},l=i({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"blueimp-gallery blueimp-gallery-controls",class:{"blueimp-gallery-carousel":e.carousel},attrs:{id:e.id}},[i("div",{staticClass:"slides"}),e._v(" "),i("h3",{staticClass:"title"}),e._v(" "),i("p",{staticClass:"description"}),e._v(" "),i("a",{staticClass:"prev"},[e._t("prev",[e._v("‹")])],2),e._v(" "),i("a",{staticClass:"next"},[e._t("next",[e._v("›")])],2),e._v(" "),e.carousel?e._e():i("a",{staticClass:"close"},[e._t("close",[e._v("X")])],2),e._v(" "),e.carousel?e._e():i("ol",{staticClass:"indicator"}),e._v(" "),e.carousel?e._e():i("a",{staticClass:"play-pause"})])},staticRenderFns:[]},function(e){e&&e("data-v-042c19f6_0",{source:".blueimp-gallery>.description[data-v-042c19f6]{position:absolute;top:30px;left:15px;color:#fff;display:none}.blueimp-gallery-controls>.description[data-v-042c19f6]{display:block}.blueimp-gallery>.next[data-v-042c19f6],.blueimp-gallery>.prev[data-v-042c19f6]{color:#fff!important;background:0 0;border:0;opacity:.8;font-size:90px;font-weight:100}.blueimp-gallery>.close[data-v-042c19f6],.blueimp-gallery>.title[data-v-042c19f6]{color:#fff!important;opacity:.7}",map:void 0,media:void 0})},t,"data-v-042c19f6",!1,void 0,s,void 0),r=i({render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return null!=e.images&&e.images.length>0?i("div",{staticClass:"inner-banner-outer pt-0"},[e.images.length>=5?i("div",{staticClass:"col-12 img-main"},[i("div",{staticClass:"row"},[i("BlueMapGallery",{attrs:{images:e.images,index:e.index},on:{close:function(t){e.index=null}}}),e._v(" "),i("div",{staticClass:"col-6 p-0 img-left",style:{backgroundImage:"url("+e.images[0].href+")"},on:{click:function(t){e.index=0}}}),e._v(" "),i("div",{staticClass:"col-md-6 col-sm-12 p-0"},[i("div",{staticClass:"row m-0"},e._l(4,function(t){return i("div",{key:t,staticClass:"col-md-6 col-sm-12 p-0 img-right",style:{backgroundImage:"url("+e.images[t].href+")"},on:{click:function(i){e.index=t}}})}),0)])],1)]):i("div",{staticClass:"p-0 col-12 img-main"},[i("BlueMapGallery",{attrs:{images:e.images,index:e.index},on:{close:function(t){e.index=null}}}),e._v(" "),i("div",{staticClass:"img-left",style:{backgroundImage:"url("+e.images[0].href+")"},on:{click:function(t){e.index=0}}})],1),e._v(" "),i("div",{staticClass:"col-12 text-right more-btn-main"},[i("button",{staticClass:"btn more-btn",on:{click:function(t){e.index=0}}},[e._v("View Photos")])])]):e._e()},staticRenderFns:[]},function(e){e&&e("data-v-2f4d08ea_0",{source:".img-right[data-v-2f4d08ea]{opacity:1;height:350px;background-repeat:no-repeat;background-size:cover;background-position:center;transition:all .5s ease;border:solid 1px #000}.img-left[data-v-2f4d08ea]:hover,.img-right[data-v-2f4d08ea]:hover{cursor:pointer;opacity:.8}.img-left[data-v-2f4d08ea]{height:700px;opacity:1;background-repeat:no-repeat;background-position:center;background-size:cover;border:solid 1px #000}.img-sect[data-v-2f4d08ea]{width:100%;padding-top:70px;padding-bottom:50px;border-top:4px solid rgba(0,166,127,.2);float:left;width:100%}.img-main[data-v-2f4d08ea]{background-color:#000}.more-btn-main[data-v-2f4d08ea]{position:relative;top:-83px;right:20px}.more-btn[data-v-2f4d08ea]:hover{background:#00a59c;color:#fff}.more-btn[data-v-2f4d08ea]{padding:10px 33px;background:#383838;color:#fff;font-weight:900;font-size:18px;text-transform:capitalize}",map:void 0,media:void 0})},{name:"Gallery",props:{images:{type:Array,default:function(){return[]}}},data:function(){return{index:null}},components:{BlueMapGallery:l},methods:{}},"data-v-2f4d08ea",!1,void 0,s,void 0);function d(e){d.installed||(d.installed=!0,e.component("Gallery",r))}var c={install:d},u=null;"undefined"!=typeof window?u=window.Vue:"undefined"!=typeof global&&(u=global.Vue),u&&u.use(c),r.install=d;export default r;