From caa422fd052262710d821a508a76c2f187156718 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <1152958806@qq.com> Date: Sun, 27 Aug 2023 22:32:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E7=BD=AE=E4=B8=BB=E9=A2=98=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/js/custom.js | 506 ++++++ templates/assets/js/main.js | 2 +- templates/assets/libs/dplayer/DPlayer.min.js | 1 + templates/assets/libs/dplayer/dplayer.html | 80 + templates/assets/libs/hls/hls.min.js | 1 + templates/assets/zhheo/custom.css | 1711 +++++++++++++++++- templates/assets/zhheo/zhheoblog.css | 442 +---- templates/modules/layouts/layout.html | 2 + templates/photos.html | 4 +- 9 files changed, 2306 insertions(+), 443 deletions(-) create mode 100644 templates/assets/js/custom.js create mode 100644 templates/assets/libs/dplayer/DPlayer.min.js create mode 100644 templates/assets/libs/dplayer/dplayer.html create mode 100644 templates/assets/libs/hls/hls.min.js diff --git a/templates/assets/js/custom.js b/templates/assets/js/custom.js new file mode 100644 index 00000000..9f503b71 --- /dev/null +++ b/templates/assets/js/custom.js @@ -0,0 +1,506 @@ +/* 获取直属子元素 */ +function getChildren(el, className) { + for (let item of el.children) if (item.className === className) return item; + return null; +} + + +// 跳转链接的卡片 +document.addEventListener("DOMContentLoaded", () => { + + customElements.define( + "hao-introduction-card", + class HaoIntroductionCard extends HTMLElement { + constructor() { + super(); + this.options = { + link: this.getAttribute("link") || 'https://0206.ink/', + img: this.getAttribute("img"), + tip: this.getAttribute("tip") || '小标题', + cardTitle: this.getAttribute("cardTitle") || '标题', + logo: this.getAttribute("logo"), + title: this.getAttribute("title"), + subTitle: this.getAttribute("subTitle"), + }; + let style1 = '' + let style2 = '' + if(this.options.logo==null && this.options.title==null && this.options.subTitle==null){ + style1 = 'height:416px' + style2 = 'height:100%;border-radius:15px' + } + let innerHTMLs = ` +
${$1}
+${$2
+ .trim()
+ .replace(/^(
)|(
)$/g, "")}
${str[1]}
${str[1]}
${str[1]}
+R.pts&&(T=Math.max(Math.min(T,R.pts-R.dts),-1*x)),R.dts A;if(I||O<-1){I?o.b.warn("AVC: "+C(O,!0)+" ms ("+O+"dts) hole between fragments detected, filling it"):o.b.warn("AVC: "+C(-O,!0)+" ms ("+O+"dts) overlapping between fragments detected"),u=S;var P=f[0].pts-O;f[0].dts=u,f[0].pts=P,o.b.log("Video: First PTS/DTS adjusted: "+C(P,!0)+"/"+C(u,!0)+", delta: "+C(O,!0)+" ms")}}M&&M<75&&(u=Math.max(0,u));for(var U=0,N=0,B=0;B 0?q-1:q].dts;if(ie.stretchShortVideoTrack){var ne=ie.maxBufferHole,se=Math.floor(ne*h),oe=(n?y+n*h:this.nextAudioPts)-z.pts;oe>se?((s=oe-ae)<0&&(s=ae),o.b.log("It is approximately "+C(oe,!1)+" ms to the next segment; using duration "+C(s,!1)+" ms for the last video frame.")):s=ae}else s=ae}X=Math.round(z.pts-z.dts),g.push({size:$,duration:s,cts:X,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:z.key?2:1,isNonSync:z.key?0:1}})}this.nextAvcDts=c+s;var le=e.dropped;if(e.nbNalu=0,e.dropped=0,g.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var de=g[0].flags;de.dependsOn=2,de.isNonSync=0}e.samples=g,d=D.moof(e.sequenceNumber++,u,e),e.samples=[];var ue={data1:d,data2:l,startPTS:y/h,endPTS:(b+s)/h,startDTS:u/h,endDTS:this.nextAvcDts/h,type:"video",hasAudio:!1,hasVideo:!0,nb:g.length,dropped:le};return this.observer.trigger(i.a.FRAG_PARSING_DATA,ue),ue}},t.remuxAudio=function(e,t,r,n){var s,l,d,u,c,h,f=e.inputTimeScale,g=e.timescale,p=f/g,v=(e.isAAC?1024:1152)*p,m=this._initPTS,y=!e.isAAC&&this.typeSupported.mpeg,b=y?0:8,T=e.samples,E=[],S=this.nextAudioPts;if(r|=T.length&&S&&(n&&Math.abs(t-S/f)<.1||Math.abs(T[0].pts-S-m)<20*v),T.forEach((function(e){e.pts=e.dts=F(e.pts-m,t*f)})),0!==(T=T.filter((function(e){return e.pts>=0}))).length){if(r||(S=n?Math.max(0,t*f):T[0].pts),e.isAAC)for(var _=this.config.maxAudioFramesDrift,R=0,A=S;R 0&&V 0&&((l=w.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(l=j.subarray()),N+=Y*l.length);else if(V<-12){o.b.log("drop overlapping AAC sample, expected/parsed/delta: "+C(S,!0)+" ms / "+C(H,!0)+" ms / "+C(-V,!0)+" ms"),N-=j.byteLength;continue}H=S}if(c=H,!(N>0))return;N+=b;try{d=new Uint8Array(N)}catch(e){return void this.observer.trigger(i.a.ERROR,{type:a.b.MUX_ERROR,details:a.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:N,reason:"fail allocating audio mdat "+N})}y||(new DataView(d.buffer).setUint32(0,N),d.set(D.types.mdat,4));for(var W=0;W
/gi,"\n")}nt.prototype={parse:function(e){var t=this;function r(){var e=t.buffer,r=0;for(e=ct(e);r