UNPKG

@geoblink/design-system

Version:

Geoblink Design System for Vue.js

1 lines 3.51 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["components/GeoMarquee"]=t():e["components/GeoMarquee"]=t()}(window,function(){return n={},e.m=t={77:function(e,t,n){e.exports=n("rRAc")},"KHd+":function(e,t,n){"use strict";function o(e,t,n,o,i,r,a,u){var s,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(s=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__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=s):i&&(s=u?function(){i.call(this,this.$root.$options.shadowRoot)}:i),s)if(c.functional){c._injectStyles=s;var d=c.render;c.render=function(e,t){return s.call(t),d(e,t)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,s):[s]}return{exports:e,options:c}}n.d(t,"a",function(){return o})},rRAc:function(e,t,n){"use strict";n.r(t);var o={name:"GeoMarquee",status:"ready",release:"4.0.0",props:{duration:{type:Number,default:7}},data:function(){return{isHovering:!1,containerWidth:null,contentWidth:null}},computed:{animationPlayState:function(){return this.isHovering?"running":"paused"},slotsNeeded:function(){var e=this.contentWidth||0;return(this.containerWidth||0)<e?[0,1]:[0]},animationParams:function(){return 1===this.slotsNeeded.length?{}:{animationPlayState:this.animationPlayState,animationDuration:"".concat(this.duration,"s"),animationName:"marquee-animation",animationIterationCount:"infinite",animationTimingFunction:"linear"}}},mounted:function(){var e=this;this.$nextTick().then(function(){e.$refs["marquee-content"][0]&&e.$el&&(e.contentWidth=e.$refs["marquee-content"][0].getBoundingClientRect().width,e.containerWidth=e.$el.getBoundingClientRect().width)})},updated:function(){this.$refs["marquee-content"][0]&&this.$el&&(this.contentWidth=this.$refs["marquee-content"][0].getBoundingClientRect().width,this.containerWidth=this.$el.getBoundingClientRect().width)}},i=n("KHd+"),r=Object(i.a)(o,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"geo-marquee",on:{mouseenter:function(t){e.isHovering=!0},mouseleave:function(t){e.isHovering=!1}}},e._l(e.slotsNeeded,function(t){return n("div",{key:t,ref:"marquee-content",refInFor:!0,staticClass:"geo-marquee__text-content",style:e.animationParams},[e._t("default")],2)}),0)},[],!1,null,null,null);t.default=r.exports}},e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(o,i,function(e){return t[e]}.bind(null,i));return o},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="/",e(e.s=77);function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t,n});