@seresweb/website-component 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/horizontal-viewer.cjs +1 -1
- package/dist/cjs/image-indicator.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/swiper-normal.cjs +1 -1
- package/dist/cjs/video.cjs +1 -1
- package/dist/css/horizontal-viewer.css +1 -1
- package/dist/css/swiper-vehicle.css +1 -1
- package/dist/css/video.css +1 -1
- package/dist/es/horizontal-viewer.mjs +1 -1
- package/dist/es/image-indicator.mjs +1 -1
- package/dist/es/index.mjs +1 -1
- package/dist/es/swiper-normal.mjs +1 -1
- package/dist/es/video.mjs +221 -194
- package/dist/index-BVX78e_m.cjs +1 -0
- package/dist/index-C6ZSfMR8.js +561 -0
- package/dist/index.css +1 -1
- package/dist/scss/horizontal-viewer.scss +16 -1
- package/dist/scss/swiper-vehicle.scss +2 -2
- package/dist/scss/video.scss +11 -0
- package/dist/types/components/horizontal-viewer/pc-viewer.vue.d.ts +6 -1
- package/dist/types/components/horizontal-viewer/type.d.ts +2 -0
- package/dist/types/components/image-indicator/type.d.ts +1 -0
- package/dist/types/components/video/type.d.ts +10 -1
- package/dist/types/components/video/video-wrapper.vue.d.ts +6 -6
- package/dist/types/components/video/video.vue.d.ts +186 -34
- package/package.json +1 -1
- package/dist/index-CM1T0AYM.js +0 -536
- package/dist/index-DL7IXrBi.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-BVX78e_m.cjs");exports.ScHorizontalViewer=e.ScHorizontalViewer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-BVX78e_m.cjs");exports.ScImageIndicator=e.ScImageIndicator;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./accordion-info-panel.cjs"),d=require("./animated-number.cjs"),u=require("./drawer.cjs"),m=require("./dropdown.cjs"),p=require("./gradual-highlight.cjs"),c=require("../index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./accordion-info-panel.cjs"),d=require("./animated-number.cjs"),u=require("./drawer.cjs"),m=require("./dropdown.cjs"),p=require("./gradual-highlight.cjs"),c=require("../index-BVX78e_m.cjs"),w=require("./input.cjs"),f=require("./layz-image.cjs"),I=require("./parameter-box.cjs"),g=require("./radio.cjs"),h=require("../index-DrnEpWXW.cjs"),q=require("./tab-indicator.cjs"),b=require("./video.cjs"),S="@seresweb/website-component",V=(o={})=>{const i=o.prefix||"Sc",e=o.importStyle??"css";return{type:"component",resolve:s=>{if(!s.startsWith(i))return;const n=s.slice(i.length).replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),y=`${S}/dist/es/${n}`;let t;const a=r=>{if(r==="scss")return`${S}/dist/scss/${n}.scss`;if(r==="css")return`${S}/dist/css/${n}.css`};if(typeof e=="function"){const r=e(n);r==="css"||r==="scss"?t=a(r):r===!0&&(t=a("css"))}else(e===!0||e==="css"||e==="scss")&&(t=a(e===!0?"css":e));return{name:s,from:y,sideEffects:t?[t]:void 0}}}},N=[l.ScAccordionInfoPanel,d.ScAnimatedNumber,u.ScDrawer,m.ScDropdown,p.ScGradualHighlight,c.ScHorizontalViewer,c.ScImageIndicator,w.ScInput,f.ScLayzImage,I.ScParameterBox,g.ScRadio,c.ScSwiperNormal,h.ScSwiperVehicle,q.ScTabIndicator,b.ScVideo],P={install:o=>(N.forEach(i=>{o.use(i)}),o)};exports.ScAccordionInfoPanel=l.ScAccordionInfoPanel;exports.ScAnimatedNumber=d.ScAnimatedNumber;exports.ScDrawer=u.ScDrawer;exports.ScDropdown=m.ScDropdown;exports.ScGradualHighlight=p.ScGradualHighlight;exports.ScHorizontalViewer=c.ScHorizontalViewer;exports.ScImageIndicator=c.ScImageIndicator;exports.ScSwiperNormal=c.ScSwiperNormal;exports.ScInput=w.ScInput;exports.ScLayzImage=f.ScLayzImage;exports.ScParameterBox=I.ScParameterBox;exports.ScRadio=g.ScRadio;exports.ScSwiperVehicle=h.ScSwiperVehicle;exports.ScTabIndicator=q.ScTabIndicator;exports.ScVideo=b.ScVideo;exports.ComponentsResolver=V;exports.default=P;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-BVX78e_m.cjs");exports.ScSwiperNormal=e.ScSwiperNormal;
|
package/dist/cjs/video.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("../_vars-CyrPevgT.cjs"),w=require("./layz-image.cjs"),_=["controls","poster","src"],h=e.defineComponent({__name:"video-wrapper",props:{class:{},style:{},playerButtonClass:{},playerButtonText:{default:"PLAY"},poster:{},url:{},autoPlay:{type:Boolean,default:!0},playable:{type:Boolean,default:!0},multiple:{type:Boolean},urlSmall:{}},emits:["paused"],setup(d,{expose:l,emit:P}){const t=d,C=P,B=/xiaomi|miui/i,g=`${u.PREFIX}-player-wrapper`,y=`${u.PREFIX}-player-is-fullscreen`,k=`${u.PREFIX}-player-close-btn`,m=`${u.PREFIX}-player-icon`,a=e.ref(),s=e.ref(!0),c=e.ref(B.test(navigator.userAgent)?void 0:t.url);let r=null;const n=o=>{var p,i;o.target!==a.value&&((p=a.value)==null||p.pause(),s.value=!!((i=a.value)!=null&&i.paused),C("paused"))},f=o=>{const p=o[0],i=a.value;!i||!t.playable||(p.isIntersecting&&t.autoPlay&&i.paused?(i.play().catch(console.warn),s.value=!1):!p.isIntersecting&&!i.paused&&(i.pause(),s.value=!0))},v=()=>{t.autoPlay&&t.playable&&a.value&&(r=new IntersectionObserver(f,{threshold:.25}),r.observe(a.value))},b=()=>{r==null||r.disconnect(),r=null};return e.watch(()=>t.playable,()=>{b(),e.nextTick(()=>v())}),l({play(){a.value.play(),s.value=a.value.paused},pause(){a.value.pause(),s.value=a.value.paused}}),e.onMounted(()=>{B.test(navigator.userAgent)&&fetch(t.url).then(o=>{if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return o.blob()}).then(o=>{c.value=URL.createObjectURL(o)}).catch(o=>{console.error("获取视频失败:",o)}),v()}),e.onBeforeUnmount(()=>{b()}),(o,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([g,t.class,!s.value&&!t.autoPlay&&y])},[e.createElementVNode("video",{ref_key:"videoRef",ref:a,muted:"",loop:"",playsinline:"","webkit-playsinline":"","x5-video-player-type":"h5",controls:!s.value&&!t.autoPlay,poster:t.poster,src:c.value},null,8,_),!s.value&&!t.autoPlay?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass([k,t.playerButtonClass]),onClick:n},[e.renderSlot(o.$slots,"close",{},()=>[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(m),viewBox:"0 0 1121 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200"},[...p[0]||(p[0]=[e.createElementVNode("path",{d:"M1040.725333 49.005714l-965.485714 965.436953-48.420571-48.469334L992.256 0.487619l48.469333 48.518095z",fill:"#ffffff"},null,-1),e.createElementVNode("path",{d:"M1040.725333 1014.442667l-965.485714-965.485715 48.518095-48.420571L1089.194667 965.973333l-48.469334 48.469334z",fill:"#ffffff"},null,-1)])]))])],2)):e.createCommentVNode("v-if",!0)],2))}}),E=e.defineComponent({__name:"video",props:{class:{},style:{},playerButtonClass:{},playerButtonText:{default:"PLAY"},poster:{default:""},url:{},autoPlay:{type:Boolean,default:!0},playable:{type:Boolean,default:!0},multiple:{type:Boolean},urlSmall:{}},setup(d){const l=d,P=`${u.PREFIX}-player-wrapper`,t=`${u.PREFIX}-player-poster`,C=`${u.PREFIX}-player-btn`,B=`${u.PREFIX}-player-btn-text`,g=`${u.PREFIX}-player-icon`,y=e.ref(),k=e.ref(),m=e.ref(),a=n=>{var f,v;n.stopPropagation(),(f=m.value)==null||f.pause(),(v=k.value)==null||v.play()},s=()=>{var n;(n=m.value)==null||n.play()};let c=null;const r=e.ref(!1);return e.onMounted(()=>{c=new IntersectionObserver(([n])=>{n.isIntersecting&&(r.value=!0)},{threshold:.1}),y.value&&c.observe(y.value)}),e.onUnmounted(()=>{c==null||c.disconnect()}),(n,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[l.autoPlay||l.multiple?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0},l,{url:l.multiple&&l.urlSmall||l.url,ref_key:"autoPlayRef",ref:m}),null,16,["url"])):e.createCommentVNode("v-if",!0),!l.autoPlay||l.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:e.normalizeClass([P,l.class,{"is-multiple":l.multiple}]),style:e.normalizeStyle(l.style)},[l.poster?(e.openBlock(),e.createBlock(e.unref(w.ScLayzImage),{key:0,class:e.normalizeClass(t),src:l.poster,alt:"AITO"},null,8,["src"])):e.createCommentVNode("v-if",!0),e.createElementVNode("button",{ref_key:"btnRef",ref:y,class:e.normalizeClass([C,l.playerButtonClass]),onClick:a},[e.renderSlot(n.$slots,"play",{},()=>[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(g),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200"},[...f[0]||(f[0]=[e.createElementVNode("path",{d:"M671.744 495.616c20.48 12.288 20.48 36.864 0 49.152l-217.088 126.976c-20.48 12.288-45.056-4.096-45.056-24.576V393.216c0-20.48 24.576-36.864 45.056-24.576l217.088 126.976z",fill:"#ffffff"},null,-1),e.createElementVNode("path",{d:"M512 1011.712C237.568 1011.712 12.288 786.432 12.288 512 12.288 237.568 237.568 12.288 512 12.288c274.432 0 499.712 225.28 499.712 499.712 0 274.432-225.28 499.712-499.712 499.712z m0-958.464c-253.952 0-458.752 204.8-458.752 458.752s204.8 458.752 458.752 458.752 458.752-204.8 458.752-458.752-204.8-458.752-458.752-458.752z",fill:"#ffffff"},null,-1)])])),e.createElementVNode("span",{class:e.normalizeClass(B)},e.toDisplayString(l.playerButtonText),1)])],2)],6),r.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createVNode(h,e.mergeProps(l,{autoPlay:!1,ref_key:"vwRef",ref:k,onPaused:s}),null,16)])):e.createCommentVNode("v-if",!0)],64)):e.createCommentVNode("v-if",!0)],64))}});E.install=d=>(d.component("ScVideo",E),d);const I=E;exports.ScVideo=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.sc-horizontal-viewer{width:100vw;height:4000px;color:#fff;background-color:#000;position:relative}.sc-horizontal-viewer__header{width:1400px;margin:0 auto 40px}.sc-horizontal-viewer__header p:nth-of-type(1){color:#caab78;font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Regular;font-size:44px;font-style:normal;font-weight:400;line-height:normal;margin-bottom:16px}.sc-horizontal-viewer__header p:nth-of-type(2){color:#fff;font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Light;font-size:18px;font-style:normal;font-weight:400;line-height:27px}.sc-horizontal-viewer__container{width:100%;height:100vh;box-sizing:border-box;position:sticky;padding-top:160px;top:0;overflow:hidden}.sc-horizontal-viewer__container.has-header{padding-top:80px}.sc-horizontal-viewer__scroller{width:100%;box-sizing:border-box;padding:0 260px;overflow-x:hidden}.sc-horizontal-viewer__content{width:fit-content;display:flex;margin-bottom:40px}.sc-horizontal-viewer__content-item{position:relative;flex-shrink:0;width:1400px}.sc-horizontal-viewer__content-item+.sc-horizontal-viewer__content-item{margin-left:40px}.sc-horizontal-viewer__content-item .sc-picture{height:100%}.sc-horizontal-viewer__content-item-footer{position:absolute;bottom:40px;left:40px;right:40px}.sc-horizontal-viewer__content-item-footer p:nth-of-type(1){font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Regular;font-size:24px;font-style:normal;font-weight:500;line-height:36px;margin-bottom:8px}.sc-horizontal-viewer__content-item-footer p:nth-of-type(2){font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Light;font-size:16px;font-style:normal;font-weight:400;line-height:24px}.sc-horizontal-viewer .has-header .sc-horizontal-viewer__content-item{width:1200px}.sc-horizontal-viewer__pagination{width:1400px;margin:0 auto;display:flex;justify-content:space-between;position:relative}.sc-horizontal-viewer__scrollbar{position:relative;width:100%;height:2px;border-radius:1px;background-color:#fff6}.sc-horizontal-viewer__scrollbar-drag{width:33.33%;position:absolute;height:4px;margin-top:-3px;left:0;border-radius:1px;background-color:#caab78;transition:transform .5s,width .5s}.sc-horizontal-viewer-mb{width:100vw;padding:0 24px;box-sizing:border-box;color:#fff}html[dir=rtl] .sc-horizontal-viewer__content-item+.sc-horizontal-viewer__content-item{margin-left:0;margin-right:40px}
|
|
1
|
+
.sc-horizontal-viewer{width:100vw;height:4000px;color:#fff;background-color:#000;position:relative}.sc-horizontal-viewer__header{width:1400px;margin:0 auto 40px}.sc-horizontal-viewer__header p:nth-of-type(1){color:#caab78;font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Regular;font-size:44px;font-style:normal;font-weight:400;line-height:normal;margin-bottom:16px}.sc-horizontal-viewer__header p:nth-of-type(2){color:#fff;font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Light;font-size:18px;font-style:normal;font-weight:400;line-height:27px}.sc-horizontal-viewer__container{width:100%;height:100vh;box-sizing:border-box;position:sticky;padding-top:160px;top:0;overflow:hidden}.sc-horizontal-viewer__container.has-header{padding-top:80px}.sc-horizontal-viewer__scroller{width:100%;box-sizing:border-box;padding:0 260px;overflow-x:hidden}.sc-horizontal-viewer__content{width:fit-content;display:flex;align-items:stretch;margin-bottom:40px}.sc-horizontal-viewer__content-item{position:relative;flex-shrink:0;width:1400px;min-height:360px;height:min(75vh,900px);max-height:900px;overflow:hidden}.sc-horizontal-viewer__content-item+.sc-horizontal-viewer__content-item{margin-left:40px}.sc-horizontal-viewer__content-item .sc-picture,.sc-horizontal-viewer__content-item .sc-player-wrapper{width:100%;height:100%}.sc-horizontal-viewer__content-item .sc-picture img{width:100%;height:100%;object-fit:cover}.sc-horizontal-viewer__content-item-footer{position:absolute;bottom:40px;left:40px;right:40px}.sc-horizontal-viewer__content-item-footer p:nth-of-type(1){font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Regular;font-size:24px;font-style:normal;font-weight:500;line-height:36px;margin-bottom:8px}.sc-horizontal-viewer__content-item-footer p:nth-of-type(2){font-feature-settings:"liga" off,"clig" off;font-family:HarmonyOS_Sans_Light;font-size:16px;font-style:normal;font-weight:400;line-height:24px}.sc-horizontal-viewer .has-header .sc-horizontal-viewer__content-item{width:1200px}.sc-horizontal-viewer__pagination{width:1400px;margin:0 auto;display:flex;justify-content:space-between;position:relative}.sc-horizontal-viewer__scrollbar{position:relative;width:100%;height:2px;border-radius:1px;background-color:#fff6}.sc-horizontal-viewer__scrollbar-drag{width:33.33%;position:absolute;height:4px;margin-top:-3px;left:0;border-radius:1px;background-color:#caab78;transition:transform .5s,width .5s}.sc-horizontal-viewer-mb{width:100vw;padding:0 24px;box-sizing:border-box;color:#fff}html[dir=rtl] .sc-horizontal-viewer__content-item+.sc-horizontal-viewer__content-item{margin-left:0;margin-right:40px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.sc-swiper-vehicle{position:relative;display:flex;flex-direction:column;align-items:center;width:100%;height:100%}.sc-swiper-vehicle__bg{width:100%;height:100%;position:absolute;left:0;top:0}.sc-swiper-vehicle__main{overflow:hidden;width:100%;height:100%}.sc-swiper-vehicle__main .swiper-slide .sc-picture{width:100%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.sc-swiper-vehicle__text-bg{font-family:HarmonyOS_Sans_Light;font-weight:400;font-size:160px;font-style:normal;text-transform:none;white-space:nowrap;color:transparent;-webkit-background-clip:text;background-clip:text;background-image:linear-gradient(to right,#ffffff40,#ffffff0d);position:absolute;left:50%;top:25%;transform:translate(-50%,-50%)}.sc-swiper-vehicle__indicator{margin-top:22px;display:flex;flex-direction:column;z-index:2}.sc-swiper-vehicle__indicator-control{display:flex;padding:14px 16px;align-items:center;gap:16px;border-radius:100px;background-color:#fff3;margin-bottom:16px}.sc-swiper-vehicle__indicator-control .color-stroke{border-radius:50%;width:24px;height:24px;border:1px solid transparent;position:relative;transition:transform .5s cubic-bezier(0,.5,0,.23);cursor:pointer}.sc-swiper-vehicle__indicator-control .color-stroke.active{transform:scale(1.33);border-color:#fff!important}.sc-swiper-vehicle__indicator-text{font-family:HarmonyOS_Sans_Light;position:relative;
|
|
1
|
+
.sc-swiper-vehicle{position:relative;display:flex;flex-direction:column;align-items:center;width:100%;height:100%}.sc-swiper-vehicle__bg{width:100%;height:100%;position:absolute;left:0;top:0}.sc-swiper-vehicle__main{overflow:hidden;width:100%;height:100%}.sc-swiper-vehicle__main .swiper-slide .sc-picture{width:100%;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.sc-swiper-vehicle__text-bg{font-family:HarmonyOS_Sans_Light;font-weight:400;font-size:160px;font-style:normal;text-transform:none;white-space:nowrap;color:transparent;-webkit-background-clip:text;background-clip:text;background-image:linear-gradient(to right,#ffffff40,#ffffff0d);position:absolute;left:50%;top:25%;transform:translate(-50%,-50%)}.sc-swiper-vehicle__indicator{margin-top:22px;display:flex;flex-direction:column;z-index:2}.sc-swiper-vehicle__indicator-control{display:flex;padding:14px 16px;align-items:center;gap:16px;border-radius:100px;background-color:#fff3;margin-bottom:16px}.sc-swiper-vehicle__indicator-control .color-stroke{border-radius:50%;width:24px;height:24px;border:1px solid transparent;position:relative;transition:transform .5s cubic-bezier(0,.5,0,.23);cursor:pointer}.sc-swiper-vehicle__indicator-control .color-stroke.active{transform:scale(1.33);border-color:#fff!important}.sc-swiper-vehicle__indicator-text{font-family:HarmonyOS_Sans_Light;position:relative;font-weight:400;white-space:nowrap;font-size:16px;line-height:22px;text-align:center;color:#fff}@media (max-width: 768px){.sc-swiper-vehicle__main .swiper-slide .sc-picture.sc-swiper-vehicle__full-height{height:100%}}
|
package/dist/css/video.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.sc-player-wrapper{width:100%;height:100%;position:relative;display:inline-block}.sc-player-wrapper .sc-player-poster{width:100%;height:100%}.sc-player-wrapper video{width:100%;height:100%;object-fit:fill}.sc-player-wrapper .sc-player-btn{position:absolute;bottom:65px;right:47px;z-index:100;color:#fff;cursor:pointer;outline:none;border:0;background-color:transparent}.sc-player-wrapper .sc-player-btn .sc-player-icon{width:50px;height:50px;vertical-align:middle;margin-right:22px}.sc-player-wrapper .sc-player-btn-text{font-family:HarmonyOS_Sans_Regular;font-weight:400;font-size:36px;color:#fff;line-height:42px;text-align:left;font-style:normal;text-transform:none;display:inline-block;vertical-align:middle}body>.sc-player-wrapper{display:none}body>.sc-player-is-fullscreen{display:flex}.sc-player-is-fullscreen{background-color:#000000f9;z-index:10000;position:fixed;top:0;left:0;width:100vw;height:100vh;padding:100px;box-sizing:border-box;display:flex;align-items:center}.sc-player-is-fullscreen video{height:auto}.sc-player-is-fullscreen .sc-player-close-btn{position:absolute;right:40px;top:40px;border:none;outline:none;background-color:transparent;color:#fff;cursor:pointer}@media (max-width: 768px){.sc-player-wrapper video{object-fit:cover}.sc-player-wrapper .sc-player-btn{bottom:20px;right:20px}.sc-player-wrapper .sc-player-btn .sc-player-icon{width:24px;height:24px;margin-right:10px}.sc-player-wrapper .sc-player-btn-text{font-size:16px;line-height:19px;text-align:left;margin-left:0}}.sc-player-is-fullscreen{padding:24px}.sc-player-is-fullscreen .sc-player-close-btn{right:40px;top:40px}.sc-player-is-fullscreen .sc-player-close-btn .sc-player-icon{width:20px;height:20px}html[dir=rtl] .sc-player-wrapper .sc-player-btn{left:47px;right:unset}html[dir=rtl] .sc-player-wrapper .sc-player-btn .sc-player-icon{margin-right:0}html[dir=rtl] .sc-player-wrapper .sc-player-btn-text{margin-right:10px}html[dir=rtl] .sc-player-is-fullscreen .sc-player-close-btn{left:40px;right:unset}@media (max-width: 768px){html[dir=rtl] .sc-player-wrapper .sc-player-btn{bottom:20px;left:20px;right:unset}}
|
|
1
|
+
.sc-player-wrapper{width:100%;height:100%;position:relative;display:inline-block}.sc-player-wrapper.is-multiple{position:absolute;left:0;top:0}.sc-player-wrapper .sc-player-poster{width:100%;height:100%}.sc-player-wrapper video{width:100%;height:100%;object-fit:fill}.sc-player-wrapper .sc-player-btn{position:absolute;bottom:65px;right:47px;z-index:100;color:#fff;cursor:pointer;outline:none;border:0;background-color:transparent}.sc-player-wrapper .sc-player-btn .sc-player-icon{width:50px;height:50px;vertical-align:middle;margin-right:22px}.sc-player-wrapper .sc-player-btn-text{font-family:HarmonyOS_Sans_Regular;font-weight:400;font-size:36px;color:#fff;line-height:42px;text-align:left;font-style:normal;text-transform:none;display:inline-block;vertical-align:middle}body>.sc-player-wrapper{display:none}body>.sc-player-is-fullscreen{display:flex;justify-content:center;align-items:center}.sc-player-is-fullscreen{background-color:#000000f9;z-index:10000;position:fixed;top:0;left:0;width:100vw;height:100vh;padding:100px;box-sizing:border-box;display:flex;align-items:center}.sc-player-is-fullscreen video{height:auto;max-width:calc(100% - 48px);max-height:calc(100% - 48px);object-fit:contain}.sc-player-is-fullscreen .sc-player-close-btn{position:absolute;right:40px;top:40px;border:none;outline:none;background-color:transparent;color:#fff;cursor:pointer}@media (max-width: 768px){.sc-player-wrapper video{object-fit:cover}.sc-player-wrapper .sc-player-btn{bottom:20px;right:20px}.sc-player-wrapper .sc-player-btn .sc-player-icon{width:24px;height:24px;margin-right:10px}.sc-player-wrapper .sc-player-btn-text{font-size:16px;line-height:19px;text-align:left;margin-left:0}}.sc-player-is-fullscreen{padding:24px}.sc-player-is-fullscreen .sc-player-close-btn{right:40px;top:40px}.sc-player-is-fullscreen .sc-player-close-btn .sc-player-icon{width:20px;height:20px}html[dir=rtl] .sc-player-wrapper .sc-player-btn{left:47px;right:unset}html[dir=rtl] .sc-player-wrapper .sc-player-btn .sc-player-icon{margin-right:0}html[dir=rtl] .sc-player-wrapper .sc-player-btn-text{margin-right:10px}html[dir=rtl] .sc-player-is-fullscreen .sc-player-close-btn{left:40px;right:unset}@media (max-width: 768px){html[dir=rtl] .sc-player-wrapper .sc-player-btn{bottom:20px;left:20px;right:unset}}
|
package/dist/es/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { ScAnimatedNumber as p } from "./animated-number.mjs";
|
|
|
3
3
|
import { ScDrawer as S } from "./drawer.mjs";
|
|
4
4
|
import { ScDropdown as l } from "./dropdown.mjs";
|
|
5
5
|
import { ScGradualHighlight as d } from "./gradual-highlight.mjs";
|
|
6
|
-
import { S as u, a as h, b as w } from "../index-
|
|
6
|
+
import { S as u, a as h, b as w } from "../index-C6ZSfMR8.js";
|
|
7
7
|
import { ScInput as y } from "./input.mjs";
|
|
8
8
|
import { ScLayzImage as g } from "./layz-image.mjs";
|
|
9
9
|
import { ScParameterBox as I } from "./parameter-box.mjs";
|
package/dist/es/video.mjs
CHANGED
|
@@ -1,246 +1,273 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { P as
|
|
3
|
-
import { ScLayzImage as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as L, ref as d, watch as A, nextTick as E, onMounted as O, onBeforeUnmount as M, createElementBlock as h, openBlock as r, normalizeClass as f, createElementVNode as y, createCommentVNode as _, renderSlot as V, onUnmounted as U, Fragment as S, createBlock as $, mergeProps as T, normalizeStyle as H, unref as N, toDisplayString as X, Teleport as F, createVNode as Y } from "vue";
|
|
2
|
+
import { P as u } from "../_vars-BV4QQF-p.js";
|
|
3
|
+
import { ScLayzImage as j } from "./layz-image.mjs";
|
|
4
|
+
const D = ["controls", "poster", "src"], z = /* @__PURE__ */ L({
|
|
5
5
|
__name: "video-wrapper",
|
|
6
6
|
props: {
|
|
7
|
-
class: {
|
|
8
|
-
style: {
|
|
9
|
-
playerButtonClass: {
|
|
7
|
+
class: {},
|
|
8
|
+
style: {},
|
|
9
|
+
playerButtonClass: {},
|
|
10
10
|
playerButtonText: { default: "PLAY" },
|
|
11
|
-
poster: {
|
|
12
|
-
url: {
|
|
11
|
+
poster: {},
|
|
12
|
+
url: {},
|
|
13
13
|
autoPlay: { type: Boolean, default: !0 },
|
|
14
|
-
playable: { type: Boolean, default: !0 }
|
|
14
|
+
playable: { type: Boolean, default: !0 },
|
|
15
|
+
multiple: { type: Boolean },
|
|
16
|
+
urlSmall: {}
|
|
15
17
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
emits: ["paused"],
|
|
19
|
+
setup(m, { expose: e, emit: C }) {
|
|
20
|
+
const l = m, k = C, g = /xiaomi|miui/i, x = `${u}-player-wrapper`, w = `${u}-player-is-fullscreen`, B = `${u}-player-close-btn`, b = `${u}-player-icon`, t = d(), s = d(!0), p = d(g.test(navigator.userAgent) ? void 0 : l.url);
|
|
21
|
+
let n = null;
|
|
22
|
+
const o = (a) => {
|
|
23
|
+
var c, i;
|
|
24
|
+
a.target !== t.value && ((c = t.value) == null || c.pause(), s.value = !!((i = t.value) != null && i.paused), k("paused"));
|
|
25
|
+
}, v = (a) => {
|
|
26
|
+
const c = a[0], i = t.value;
|
|
27
|
+
!i || !l.playable || (c.isIntersecting && l.autoPlay && i.paused ? (i.play().catch(console.warn), s.value = !1) : !c.isIntersecting && !i.paused && (i.pause(), s.value = !0));
|
|
28
|
+
}, P = () => {
|
|
29
|
+
l.autoPlay && l.playable && t.value && (n = new IntersectionObserver(v, {
|
|
27
30
|
threshold: 0.25
|
|
28
31
|
// 可根据需求调整可见区域百分比
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
+
}), n.observe(t.value));
|
|
33
|
+
}, I = () => {
|
|
34
|
+
n == null || n.disconnect(), n = null;
|
|
32
35
|
};
|
|
33
|
-
return
|
|
34
|
-
() =>
|
|
36
|
+
return A(
|
|
37
|
+
() => l.playable,
|
|
35
38
|
() => {
|
|
36
|
-
|
|
39
|
+
I(), E(() => P());
|
|
37
40
|
}
|
|
38
|
-
),
|
|
41
|
+
), e({
|
|
39
42
|
play() {
|
|
40
|
-
|
|
43
|
+
t.value.play(), s.value = t.value.paused;
|
|
44
|
+
},
|
|
45
|
+
pause() {
|
|
46
|
+
t.value.pause(), s.value = t.value.paused;
|
|
41
47
|
}
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
if (!
|
|
45
|
-
throw new Error(`HTTP error! status: ${
|
|
46
|
-
return
|
|
47
|
-
}).then((
|
|
48
|
-
|
|
49
|
-
}).catch((
|
|
50
|
-
console.error("获取视频失败:",
|
|
51
|
-
}),
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
}), (
|
|
48
|
+
}), O(() => {
|
|
49
|
+
g.test(navigator.userAgent) && fetch(l.url).then((a) => {
|
|
50
|
+
if (!a.ok)
|
|
51
|
+
throw new Error(`HTTP error! status: ${a.status}`);
|
|
52
|
+
return a.blob();
|
|
53
|
+
}).then((a) => {
|
|
54
|
+
p.value = URL.createObjectURL(a);
|
|
55
|
+
}).catch((a) => {
|
|
56
|
+
console.error("获取视频失败:", a);
|
|
57
|
+
}), P();
|
|
58
|
+
}), M(() => {
|
|
59
|
+
I();
|
|
60
|
+
}), (a, c) => (r(), h(
|
|
55
61
|
"div",
|
|
56
62
|
{
|
|
57
|
-
class:
|
|
63
|
+
class: f([x, l.class, !s.value && !l.autoPlay && w])
|
|
58
64
|
},
|
|
59
65
|
[
|
|
60
|
-
|
|
66
|
+
y("video", {
|
|
61
67
|
ref_key: "videoRef",
|
|
62
|
-
ref:
|
|
68
|
+
ref: t,
|
|
63
69
|
muted: "",
|
|
64
70
|
loop: "",
|
|
65
71
|
playsinline: "",
|
|
66
72
|
"webkit-playsinline": "",
|
|
67
73
|
"x5-video-player-type": "h5",
|
|
68
|
-
controls: !s.value && !
|
|
69
|
-
poster:
|
|
70
|
-
src:
|
|
71
|
-
}, null, 8,
|
|
72
|
-
!s.value && !
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
74
|
+
controls: !s.value && !l.autoPlay,
|
|
75
|
+
poster: l.poster,
|
|
76
|
+
src: p.value
|
|
77
|
+
}, null, 8, D),
|
|
78
|
+
!s.value && !l.autoPlay ? (r(), h(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
key: 0,
|
|
82
|
+
class: f([B, l.playerButtonClass]),
|
|
83
|
+
onClick: o
|
|
84
|
+
},
|
|
85
|
+
[
|
|
86
|
+
V(a.$slots, "close", {}, () => [
|
|
87
|
+
(r(), h("svg", {
|
|
88
|
+
class: f(b),
|
|
89
|
+
viewBox: "0 0 1121 1024",
|
|
90
|
+
version: "1.1",
|
|
91
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
92
|
+
width: "200",
|
|
93
|
+
height: "200"
|
|
94
|
+
}, [...c[0] || (c[0] = [
|
|
95
|
+
y(
|
|
96
|
+
"path",
|
|
97
|
+
{
|
|
98
|
+
d: "M1040.725333 49.005714l-965.485714 965.436953-48.420571-48.469334L992.256 0.487619l48.469333 48.518095z",
|
|
99
|
+
fill: "#ffffff"
|
|
100
|
+
},
|
|
101
|
+
null,
|
|
102
|
+
-1
|
|
103
|
+
/* CACHED */
|
|
104
|
+
),
|
|
105
|
+
y(
|
|
106
|
+
"path",
|
|
107
|
+
{
|
|
108
|
+
d: "M1040.725333 1014.442667l-965.485714-965.485715 48.518095-48.420571L1089.194667 965.973333l-48.469334 48.469334z",
|
|
109
|
+
fill: "#ffffff"
|
|
110
|
+
},
|
|
111
|
+
null,
|
|
112
|
+
-1
|
|
113
|
+
/* CACHED */
|
|
114
|
+
)
|
|
115
|
+
])]))
|
|
116
|
+
])
|
|
117
|
+
],
|
|
118
|
+
2
|
|
119
|
+
/* CLASS */
|
|
120
|
+
)) : _("v-if", !0)
|
|
109
121
|
],
|
|
110
122
|
2
|
|
111
123
|
/* CLASS */
|
|
112
124
|
));
|
|
113
125
|
}
|
|
114
|
-
}),
|
|
126
|
+
}), R = /* @__PURE__ */ L({
|
|
115
127
|
__name: "video",
|
|
116
128
|
props: {
|
|
117
|
-
class: {
|
|
118
|
-
style: {
|
|
119
|
-
playerButtonClass: {
|
|
129
|
+
class: {},
|
|
130
|
+
style: {},
|
|
131
|
+
playerButtonClass: {},
|
|
120
132
|
playerButtonText: { default: "PLAY" },
|
|
121
133
|
poster: { default: "" },
|
|
122
|
-
url: {
|
|
134
|
+
url: {},
|
|
123
135
|
autoPlay: { type: Boolean, default: !0 },
|
|
124
|
-
playable: { type: Boolean, default: !0 }
|
|
136
|
+
playable: { type: Boolean, default: !0 },
|
|
137
|
+
multiple: { type: Boolean },
|
|
138
|
+
urlSmall: {}
|
|
125
139
|
},
|
|
126
|
-
setup(
|
|
127
|
-
const
|
|
128
|
-
var
|
|
129
|
-
|
|
140
|
+
setup(m) {
|
|
141
|
+
const e = m, C = `${u}-player-wrapper`, l = `${u}-player-poster`, k = `${u}-player-btn`, g = `${u}-player-btn-text`, x = `${u}-player-icon`, w = d(), B = d(), b = d(), t = (o) => {
|
|
142
|
+
var v, P;
|
|
143
|
+
o.stopPropagation(), (v = b.value) == null || v.pause(), (P = B.value) == null || P.play();
|
|
144
|
+
}, s = () => {
|
|
145
|
+
var o;
|
|
146
|
+
(o = b.value) == null || o.play();
|
|
130
147
|
};
|
|
131
|
-
let
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
([
|
|
136
|
-
|
|
148
|
+
let p = null;
|
|
149
|
+
const n = d(!1);
|
|
150
|
+
return O(() => {
|
|
151
|
+
p = new IntersectionObserver(
|
|
152
|
+
([o]) => {
|
|
153
|
+
o.isIntersecting && (n.value = !0);
|
|
137
154
|
},
|
|
138
155
|
{ threshold: 0.1 }
|
|
139
|
-
), w.value &&
|
|
140
|
-
}),
|
|
141
|
-
|
|
142
|
-
}), (
|
|
143
|
-
|
|
144
|
-
S($({ key: 0 }, a)),
|
|
156
|
+
), w.value && p.observe(w.value);
|
|
157
|
+
}), U(() => {
|
|
158
|
+
p == null || p.disconnect();
|
|
159
|
+
}), (o, v) => (r(), h(
|
|
160
|
+
S,
|
|
145
161
|
null,
|
|
146
|
-
16
|
|
147
|
-
/* FULL_PROPS */
|
|
148
|
-
)) : (y(), h(
|
|
149
|
-
U,
|
|
150
|
-
{ key: 1 },
|
|
151
162
|
[
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
163
|
+
e.autoPlay || e.multiple ? (r(), $(z, T({ key: 0 }, e, {
|
|
164
|
+
url: e.multiple && e.urlSmall || e.url,
|
|
165
|
+
ref_key: "autoPlayRef",
|
|
166
|
+
ref: b
|
|
167
|
+
}), null, 16, ["url"])) : _("v-if", !0),
|
|
168
|
+
!e.autoPlay || e.multiple ? (r(), h(
|
|
169
|
+
S,
|
|
170
|
+
{ key: 1 },
|
|
158
171
|
[
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
src: a.poster,
|
|
162
|
-
alt: "AITO"
|
|
163
|
-
}, null, 8, ["src"]),
|
|
164
|
-
i(
|
|
165
|
-
"button",
|
|
172
|
+
y(
|
|
173
|
+
"div",
|
|
166
174
|
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
class: p([g, a.playerButtonClass]),
|
|
170
|
-
onClick: s
|
|
175
|
+
class: f([C, e.class, { "is-multiple": e.multiple }]),
|
|
176
|
+
style: H(e.style)
|
|
171
177
|
},
|
|
172
178
|
[
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
179
|
+
e.poster ? (r(), $(N(j), {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: f(l),
|
|
182
|
+
src: e.poster,
|
|
183
|
+
alt: "AITO"
|
|
184
|
+
}, null, 8, ["src"])) : _("v-if", !0),
|
|
185
|
+
y(
|
|
186
|
+
"button",
|
|
187
|
+
{
|
|
188
|
+
ref_key: "btnRef",
|
|
189
|
+
ref: w,
|
|
190
|
+
class: f([k, e.playerButtonClass]),
|
|
191
|
+
onClick: t
|
|
192
|
+
},
|
|
193
|
+
[
|
|
194
|
+
V(o.$slots, "play", {}, () => [
|
|
195
|
+
(r(), h("svg", {
|
|
196
|
+
class: f(x),
|
|
197
|
+
viewBox: "0 0 1024 1024",
|
|
198
|
+
version: "1.1",
|
|
199
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
200
|
+
width: "200",
|
|
201
|
+
height: "200"
|
|
202
|
+
}, [...v[0] || (v[0] = [
|
|
203
|
+
y(
|
|
204
|
+
"path",
|
|
205
|
+
{
|
|
206
|
+
d: "M671.744 495.616c20.48 12.288 20.48 36.864 0 49.152l-217.088 126.976c-20.48 12.288-45.056-4.096-45.056-24.576V393.216c0-20.48 24.576-36.864 45.056-24.576l217.088 126.976z",
|
|
207
|
+
fill: "#ffffff"
|
|
208
|
+
},
|
|
209
|
+
null,
|
|
210
|
+
-1
|
|
211
|
+
/* CACHED */
|
|
212
|
+
),
|
|
213
|
+
y(
|
|
214
|
+
"path",
|
|
215
|
+
{
|
|
216
|
+
d: "M512 1011.712C237.568 1011.712 12.288 786.432 12.288 512 12.288 237.568 237.568 12.288 512 12.288c274.432 0 499.712 225.28 499.712 499.712 0 274.432-225.28 499.712-499.712 499.712z m0-958.464c-253.952 0-458.752 204.8-458.752 458.752s204.8 458.752 458.752 458.752 458.752-204.8 458.752-458.752-204.8-458.752-458.752-458.752z",
|
|
217
|
+
fill: "#ffffff"
|
|
218
|
+
},
|
|
219
|
+
null,
|
|
220
|
+
-1
|
|
221
|
+
/* CACHED */
|
|
222
|
+
)
|
|
223
|
+
])])),
|
|
224
|
+
y(
|
|
225
|
+
"span",
|
|
226
|
+
{
|
|
227
|
+
class: f(g)
|
|
228
|
+
},
|
|
229
|
+
X(e.playerButtonText),
|
|
230
|
+
1
|
|
231
|
+
/* TEXT */
|
|
232
|
+
)
|
|
233
|
+
])
|
|
234
|
+
],
|
|
235
|
+
2
|
|
236
|
+
/* CLASS */
|
|
237
|
+
)
|
|
213
238
|
],
|
|
214
|
-
|
|
215
|
-
/* CLASS */
|
|
216
|
-
)
|
|
239
|
+
6
|
|
240
|
+
/* CLASS, STYLE */
|
|
241
|
+
),
|
|
242
|
+
n.value ? (r(), $(F, {
|
|
243
|
+
key: 0,
|
|
244
|
+
to: "body"
|
|
245
|
+
}, [
|
|
246
|
+
Y(
|
|
247
|
+
z,
|
|
248
|
+
T(e, {
|
|
249
|
+
autoPlay: !1,
|
|
250
|
+
ref_key: "vwRef",
|
|
251
|
+
ref: B,
|
|
252
|
+
onPaused: s
|
|
253
|
+
}),
|
|
254
|
+
null,
|
|
255
|
+
16
|
|
256
|
+
/* FULL_PROPS */
|
|
257
|
+
)
|
|
258
|
+
])) : _("v-if", !0)
|
|
217
259
|
],
|
|
218
|
-
|
|
219
|
-
/*
|
|
220
|
-
),
|
|
221
|
-
o.value ? (y(), x(F, {
|
|
222
|
-
key: 0,
|
|
223
|
-
to: "body"
|
|
224
|
-
}, [
|
|
225
|
-
I(
|
|
226
|
-
R,
|
|
227
|
-
$(a, {
|
|
228
|
-
ref_key: "vwRef",
|
|
229
|
-
ref: l
|
|
230
|
-
}),
|
|
231
|
-
null,
|
|
232
|
-
16
|
|
233
|
-
/* FULL_PROPS */
|
|
234
|
-
)
|
|
235
|
-
])) : L("v-if", !0)
|
|
260
|
+
64
|
|
261
|
+
/* STABLE_FRAGMENT */
|
|
262
|
+
)) : _("v-if", !0)
|
|
236
263
|
],
|
|
237
264
|
64
|
|
238
265
|
/* STABLE_FRAGMENT */
|
|
239
266
|
));
|
|
240
267
|
}
|
|
241
268
|
});
|
|
242
|
-
|
|
243
|
-
const
|
|
269
|
+
R.install = (m) => (m.component("ScVideo", R), m);
|
|
270
|
+
const J = R;
|
|
244
271
|
export {
|
|
245
|
-
|
|
272
|
+
J as ScVideo
|
|
246
273
|
};
|