mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
5.2 KiB
JavaScript
2 lines
5.2 KiB
JavaScript
/*! For license information please see 3886.1e06f960.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["3886"],{7987:function(e,a,t){"use strict";t.r(a);var l=t("10859");t("97441");let i=l.Z;a.default=i},10859:function(e,a,t){"use strict";t("82116"),t("17989"),t("61557");var l=t("80681"),i=t("11848"),r=t("57122"),u=t("24129"),n=t("99497"),o=t("38588"),d=t("54369"),s=t("22300"),v=(0,l._)("div",{class:"video"},null,-1),m=(0,l._)("div",{class:"video"},null,-1);a.Z=(0,l.aZ)({__name:"index",setup(e){var a=(0,d.q)({"zh-CN":{barrage:"\u5F39\u5E55",play:"\u5F00\u59CB",pause:"\u6682\u505C",videoBarrage:"\u6A21\u4EFF\u89C6\u9891\u5F39\u5E55",lightweight:"\u8F7B\u91CF",customizable:"\u53EF\u5B9A\u5236\u7684",mobile:"\u79FB\u52A8\u7AEF",library:"\u7EC4\u4EF6\u5E93"},"en-US":{barrage:"barrage",play:"play",pause:"pause",videoBarrage:"Imitate video barrage",lightweight:"Lightweight",customizable:"Customizable",mobile:"Mobile",library:"Library"}}),t=[{id:100,text:a("lightweight")},{id:101,text:a("customizable")},{id:102,text:a("mobile")},{id:103,text:"Vue"},{id:104,text:a("library")},{id:105,text:"VantUI"},{id:106,text:"666"}],p=(0,i.iH)([...t]),c=()=>{p.value.push({id:Math.random(),text:"Barrage"})},y=(0,i.iH)([...t]),f=(0,i.iH)(),g=()=>{y.value.push({id:Math.random(),text:"Barrage"})},[b,S]=(0,s.OT)(!1);return(0,l.YP)(b,()=>{var e,a;b.value?null===(e=f.value)||void 0===e||e.play():null===(a=f.value)||void 0===a||a.pause()}),(e,t)=>{var d=(0,l.up)("demo-block");return(0,l.wg)(),(0,l.iD)(l.HY,null,[(0,l.Wm)(d,{title:(0,i.SU)(a)("basicUsage")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(u.ZP),{modelValue:p.value,"onUpdate:modelValue":t[0]||(t[0]=e=>p.value=e)},{default:(0,l.w5)(()=>[v]),_:1},8,["modelValue"]),(0,l.Wm)((0,i.SU)(o.ZP),{style:{"margin-top":"10px"}},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(n.ZP),{onClick:c,type:"primary",size:"small"},{default:(0,l.w5)(()=>[(0,l.Uk)((0,r.zw)((0,i.SU)(a)("barrage")),1)]),_:1})]),_:1})]),_:1},8,["title"]),(0,l.Wm)(d,{title:(0,i.SU)(a)("videoBarrage")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(u.ZP),{modelValue:y.value,"onUpdate:modelValue":t[1]||(t[1]=e=>y.value=e),ref_key:"videoBarrage",ref:f,"auto-play":!1},{default:(0,l.w5)(()=>[m]),_:1},8,["modelValue"]),(0,l.Wm)((0,i.SU)(o.ZP),{style:{"margin-top":"10px"}},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(n.ZP),{onClick:g,type:"primary",size:"small",disabled:!(0,i.SU)(b)},{default:(0,l.w5)(()=>[(0,l.Uk)((0,r.zw)((0,i.SU)(a)("barrage")),1)]),_:1},8,["disabled"]),(0,l.Wm)((0,i.SU)(n.ZP),{onClick:t[2]||(t[2]=e=>(0,i.SU)(S)()),size:"small"},{default:(0,l.w5)(()=>[(0,l.Uk)((0,r.zw)((0,i.SU)(b)?(0,i.SU)(a)("pause"):(0,i.SU)(a)("play")),1)]),_:1})]),_:1})]),_:1},8,["title"])],64)}}})},24129:function(e,a,t){"use strict";var l=t("63112"),i=t("11711"),r=(0,l.n)(i.Z);a.ZP=r},10023:function(e,a,t){"use strict";t.d(a,{F:function(){return r}});var l=t("80681"),i=t("12308");function r(e){var a=(0,l.FN)();a&&(0,i.l7)(a.proxy,e)}},11711:function(e,a,t){"use strict";t("82116"),t("17989"),t("61557"),t("96245"),t("37232"),t("70629"),t("24836"),t("41712"),t("80855"),t("10502"),t("7978"),t("66746"),t("17530"),t("87604"),t("57024"),t("22175"),t("85322"),t("47897"),t("48943"),t("43356"),t("66786"),t("14529"),t("31564"),t("8649");var l=t("73839"),i=t("80681"),r=t("11848"),u=t("10023"),n=t("78335"),o=t("62568"),d={top:(0,n.SI)(10),rows:(0,n.SI)(4),duration:(0,n.SI)(4e3),autoPlay:n.J5,delay:(0,n.qM)(300),modelValue:(0,n.Ce)()},[s,v]=(0,o.do)("barrage");a.Z=(0,i.aZ)({name:s,props:d,emits:["update:modelValue"],setup(e,a){var{emit:t,slots:n}=a,o=(0,r.iH)(),d=v("item"),s=(0,r.iH)(0),m=[],p=function(a){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.delay,l=document.createElement("span");return l.className=d,l.innerText=String(a),l.style.animationDuration="".concat(e.duration,"ms"),l.style.animationDelay="".concat(t,"ms"),l.style.animationName="van-barrage",l.style.animationTimingFunction="linear",l},c=(0,r.iH)(!0),y=(0,r.iH)(e.autoPlay),f=(a,l)=>{var i,{id:r,text:u}=a,n=p(u,c.value?l*e.delay:void 0);!e.autoPlay&&!1===y.value&&(n.style.animationPlayState="paused"),null===(i=o.value)||void 0===i||i.append(n),s.value++;var d=(s.value-1)%+e.rows*n.offsetHeight+ +e.top;n.style.top="".concat(d,"px"),n.dataset.id=String(r),m.push(n),n.addEventListener("animationend",()=>{t("update:modelValue",[...e.modelValue].filter(e=>String(e.id)!==n.dataset.id))})},g=(e,a)=>{var t=new Map(a.map(e=>[e.id,e]));e.forEach((e,a)=>{t.has(e.id)?t.delete(e.id):f(e,a)}),t.forEach(e=>{var a=m.findIndex(a=>a.dataset.id===String(e.id));a>-1&&(m[a].remove(),m.splice(a,1))}),c.value=!1};(0,i.YP)(()=>e.modelValue.slice(),(e,a)=>g(null!=e?e:[],null!=a?a:[]),{deep:!0});var b=(0,r.iH)({});return(0,i.bv)((0,l._)(function*(){var a;b.value["--move-distance"]="-".concat(null===(a=o.value)||void 0===a?void 0:a.offsetWidth,"px"),yield(0,i.Y3)(),g(e.modelValue,[])})),(0,u.F)({play:()=>{y.value=!0,m.forEach(e=>{e.style.animationPlayState="running"})},pause:()=>{y.value=!1,m.forEach(e=>{e.style.animationPlayState="paused"})}}),()=>{var e;return(0,i.Wm)("div",{class:v(),ref:o,style:b.value},[null===(e=n.default)||void 0===e?void 0:e.call(n)])}}})},97441:function(e,a,t){"use strict";t.r(e.exports={})},50551:function(e,a,t){"use strict";t.r(e.exports={})}}]); |