UNPKG

npm-moa-gallery

Version:
1 lines 7.2 kB
var Gallery=function(e,t,n,i,a,o){"use strict";o=o&&o.hasOwnProperty("default")?o.default:o;var s={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(e){var t=this;void 0===e&&(e=0);var n=void 0!==o.Gallery?o.Gallery:o,i=Object.assign({toggleControlsOnReturn:!1,toggleControlsOnSlideClick:!1,closeOnSlideClick:!1,carousel:this.carousel,container:"#"+this.id,index:e,onopen:function(){return t.$emit("onopen")},onopened:function(){return t.$emit("onopened")},onslide:this.onSlideCustom,onslideend:function(e,n){return t.$emit("onslideend",{index:e,slide:n})},onslidecomplete:function(e,n){return t.$emit("onslidecomplete",{index:e,slide:n})},onclose:function(){return t.$emit("close")},onclosed:function(){return t.$emit("onclosed")}},this.options);this.carousel&&(i.container=this.$el),this.instance=n(this.images,i)},onSlideCustom:function(e,t){this.$emit("onslide",{index:e,slide:t});var n=this.images[e];if(void 0!==n){var i=n.description,a=this.instance.container.find(".description");i&&(a.empty(),a[0].appendChild(document.createTextNode(i)))}}}};var l=function(e,t,n,i,a,o,s,l,r,d){"boolean"!=typeof s&&(r=l,l=s,s=!1);var c,u="function"==typeof n?n.options:n;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,a&&(u.functional=!0)),i&&(u._scopeId=i),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 f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return n},r="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var d=document.head||document.getElementsByTagName("head")[0],c={};var u=function(e){return function(e,t){return function(e,t){var n=r?t.media||"default":e,i=c[n]||(c[n]={ids:new Set,styles:[]});if(!i.ids.has(e)){i.ids.add(e);var a=t.source;if(t.map&&(a+="\n/*# sourceURL="+t.map.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",t.media&&i.element.setAttribute("media",t.media),d.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(a),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{var o=i.ids.size-1,s=document.createTextNode(a),l=i.element.childNodes;l[o]&&i.element.removeChild(l[o]),l.length?i.element.insertBefore(s,l[o]):i.element.appendChild(s)}}}(e,t)}},p=l({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"blueimp-gallery blueimp-gallery-controls",class:{"blueimp-gallery-carousel":e.carousel},attrs:{id:e.id}},[n("div",{staticClass:"slides"}),e._v(" "),n("h3",{staticClass:"title"}),e._v(" "),n("p",{staticClass:"description"}),e._v(" "),n("a",{staticClass:"prev"},[e._t("prev",[e._v("‹")])],2),e._v(" "),n("a",{staticClass:"next"},[e._t("next",[e._v("›")])],2),e._v(" "),e.carousel?e._e():n("a",{staticClass:"close"},[e._t("close",[e._v("X")])],2),e._v(" "),e.carousel?e._e():n("ol",{staticClass:"indicator"}),e._v(" "),e.carousel?e._e():n("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})},s,"data-v-042c19f6",!1,void 0,u,void 0),f=l({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return null!=e.images&&e.images.length>0?n("div",{staticClass:"inner-banner-outer pt-0"},[e.images.length>=5?n("div",{staticClass:"col-12 img-main"},[n("div",{staticClass:"row"},[n("BlueMapGallery",{attrs:{images:e.images,index:e.index},on:{close:function(t){e.index=null}}}),e._v(" "),n("div",{staticClass:"col-6 p-0 img-left",style:{backgroundImage:"url("+e.images[0].href+")"},on:{click:function(t){e.index=0}}}),e._v(" "),n("div",{staticClass:"col-md-6 col-sm-12 p-0"},[n("div",{staticClass:"row m-0"},e._l(4,function(t){return n("div",{key:t,staticClass:"col-md-6 col-sm-12 p-0 img-right",style:{backgroundImage:"url("+e.images[t].href+")"},on:{click:function(n){e.index=t}}})}),0)])],1)]):n("div",{staticClass:"p-0 col-12 img-main"},[n("BlueMapGallery",{attrs:{images:e.images,index:e.index},on:{close:function(t){e.index=null}}}),e._v(" "),n("div",{staticClass:"img-left",style:{backgroundImage:"url("+e.images[0].href+")"},on:{click:function(t){e.index=0}}})],1),e._v(" "),n("div",{staticClass:"col-12 text-right more-btn-main"},[n("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:p},methods:{}},"data-v-2f4d08ea",!1,void 0,u,void 0);function m(e){m.installed||(m.installed=!0,e.component("Gallery",f))}var v={install:m},g=null;return"undefined"!=typeof window?g=window.Vue:"undefined"!=typeof global&&(g=global.Vue),g&&g.use(v),f.install=m,e.default=f,e}({},0,0,0,0,blueimp);