dsh-boot-suite 2.13.21 → 2.15.15
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/CHANGELOG.md +113 -0
- package/README.md +9 -2
- package/lib/client.js +445 -23
- package/lib/host-startup.js +196 -3
- package/lib/host-wallpaper.js +32 -11
- package/lib/splash.js +270 -0
- package/package.json +2 -2
- package/templates/division-bigfish-codex/app.js +255 -0
- package/templates/division-bigfish-codex/assets/egg-bg.png +0 -0
- package/templates/division-bigfish-codex/assets/voice-full-plus.wav +0 -0
- package/templates/division-bigfish-codex/assets/voice-line1.wav +0 -0
- package/templates/division-bigfish-codex/assets/voice-line2.wav +0 -0
- package/templates/division-bigfish-codex/assets/voice-line3.wav +0 -0
- package/templates/division-bigfish-codex/assets/voice-line4.wav +0 -0
- package/templates/division-bigfish-codex/assets/voice-orig1.wav +0 -0
- package/templates/division-bigfish-codex/assets/voice-orig3.wav +0 -0
- package/templates/division-bigfish-codex/assets/voice-reconnect.wav +0 -0
- package/templates/division-bigfish-codex/assets/whale-badge-line.png +0 -0
- package/templates/division-bigfish-codex/config.js +24 -0
- package/templates/division-bigfish-codex/index.html +1 -0
- package/templates/division-bigfish-codex/motion.js +30 -0
- package/templates/division-bigfish-codex/preview-easteregg.mp4 +0 -0
- package/templates/division-bigfish-codex/preview-normal.mp4 +0 -0
- package/templates/division-bigfish-codex/render.html +1 -0
- package/templates/division-bigfish-codex/style.css +18 -0
- package/templates/division-bigfish-codex/template.json +10 -0
- package/templates/division-bigfish-codex/voice-env.js +1 -0
- package/templates/division-bigfish-codex/voice.js +10 -0
- package/templates/division-bigfish-codex//344/272/244/346/216/245-Codex/347/211/210/346/216/245/345/205/245/346/226/271/346/241/210.md +207 -0
- package/templates/division-bigfish-codex//346/217/222/344/273/266/346/216/245/345/205/245/345/245/221/347/272/246.md +177 -0
- package/test/smoke-client.mjs +4 -4
- package/test/smoke-host.mjs +23 -1
- package/test/smoke-package.mjs +89 -1
- package/test/smoke-splash.mjs +2 -0
- package/test/smoke-wallpaper-client.mjs +1 -1
- package/test/smoke-wallpaper-host.mjs +7 -1
- package/tools/README.md +1 -1
- package/tools/install.ps1 +7 -4
- package/tools/make-upgrade-helper.mjs +20 -0
- package/tools/stage-local.mjs +158 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
const $=id=>document.getElementById(id),defaults=JSON.parse(JSON.stringify(CONFIG));let cfg={...CONFIG};try{Object.assign(cfg,JSON.parse(localStorage.getItem('division-editable')||'{}'))}catch{}if(!cfg.motionRevision){cfg.loadingStart=CONFIG.loadingStart;}if((cfg.motionRevision||0)<3){cfg.voiceWidth=154;cfg.motionRevision=3;}let t=+(CONFIG.startAt||0),playing=false,base=0,last=0,env=null,url=null,ctx=null,loadId=0;const audio=$('audio');
|
|
2
|
+
function arc(r,a,b){b=Math.min(b,a+359.99);const p=d=>[r*Math.cos(d*Math.PI/180),r*Math.sin(d*Math.PI/180)];return `M${p(a)}A${r},${r} 0 ${b-a>180?1:0} 1 ${p(b)}`}
|
|
3
|
+
function path(r,a,b,color,w){return `<path d="${arc(r,a,b)}" fill="none" stroke="${color}" stroke-width="${w}"/>`}
|
|
4
|
+
$('ticks').innerHTML=Array.from({length:180},(_,i)=>`<path d="M0 -${i%5?199:197}V-207" transform="rotate(${i*2})" stroke="${i%5?'#261d0b':'#49300e'}" stroke-width="${i%5?1.8:2.4}"/>`).join('');
|
|
5
|
+
$('outer').innerHTML=path(215,5,170,'#231b0a',1)+path(214,181,350,'#543707',1)+path(178,0,100,'#100e06',19)+path(178,116,220,'#161105',19)+path(178,235,345,'#100e06',19);
|
|
6
|
+
$('middle').innerHTML=[-87,33,153].map(a=>path(105,a,a+113,'#2d210d',23)+path(118,a,a+113,'#5c3a0e',1)).join('');
|
|
7
|
+
$('inner').innerHTML=path(79,3,245,'#6d4713',2)+path(75,255,358,'#39270b',2)+path(82,-90,-82,'#ded8bf',3)+path(84,20,48,'#b2711c',2);
|
|
8
|
+
$('markers').innerHTML=[0,120,240].map(a=>`<g transform="rotate(${a})"><path d="M-10 -165H10M-17 -172v-5h5M17 -172v-5h-5" fill="none" stroke="#77776d" stroke-width="2"/></g>`).join('')+'<path d="M-252 -3l-6 4 6 4M252 -3l6 4-6 4M-4 -235l4-6 4 6" fill="#555"/>';
|
|
9
|
+
$('pages').innerHTML=Array.from({length:5},(_,i)=>`<rect x="${1215+i*17}" y="320" width="12" height="13" fill="${i?'#444':'#c77917'}"/>`).join('');
|
|
10
|
+
function settings(){for(const [id,key] of [['username','username'],['heading','title'],['body','description']])$(id).value=cfg[key];$('title').textContent=cfg.title;$('description').textContent=cfg.description;$('gap').value=(cfg.voiceY||908)-853}
|
|
11
|
+
var tips=(Array.isArray(cfg.tips)&&cfg.tips.length)?cfg.tips:[{title:cfg.title,description:cfg.description}];
|
|
12
|
+
var tipIndex=0,lastLoaded=false;
|
|
13
|
+
function setTip(i){var it=tips[i]||tips[0]||{};try{$('title').textContent=it.title||'';$('description').textContent=it.description||''}catch(e){}}
|
|
14
|
+
function persist(){try{localStorage.setItem('division-editable',JSON.stringify(cfg))}catch{}}
|
|
15
|
+
for(const [id,key] of [['username','username'],['heading','title'],['body','description']])$(id).oninput=()=>{cfg[key]=$(id).value;persist();$('title').textContent=cfg.title;$('description').textContent=cfg.description;render()};
|
|
16
|
+
$('gap').oninput=()=>{cfg.voiceY=853+ +$('gap').value;persist();render()};
|
|
17
|
+
function progress(time){const a=cfg.progress;if(time<=a[0][0])return a[0][1];for(let i=1;i<a.length;i++)if(time<=a[i][0])return a[i-1][1]+(a[i][1]-a[i-1][1])*(time-a[i-1][0])/(a[i][0]-a[i-1][0]);return a.at(-1)[1]}
|
|
18
|
+
var __voiceMeasure=null;
|
|
19
|
+
function voiceTextWidth(text,fs,ls,weight){
|
|
20
|
+
try{
|
|
21
|
+
var g=$('voice');var svg=g&&g.ownerSVGElement;if(!svg)return String(text||'').length*fs*0.82;
|
|
22
|
+
if(!__voiceMeasure){__voiceMeasure=document.createElementNS('http://www.w3.org/2000/svg','text');__voiceMeasure.setAttribute('opacity','0');__voiceMeasure.setAttribute('x','-4000');__voiceMeasure.setAttribute('y','-4000');svg.appendChild(__voiceMeasure);}
|
|
23
|
+
var m=__voiceMeasure;
|
|
24
|
+
m.setAttribute('font-family',"'DIN Alternate','Bahnschrift','Microsoft YaHei',sans-serif");
|
|
25
|
+
m.setAttribute('font-weight',weight||'700');
|
|
26
|
+
m.setAttribute('letter-spacing',String(ls||0));
|
|
27
|
+
m.setAttribute('font-size',String(fs));
|
|
28
|
+
m.textContent=text||'';
|
|
29
|
+
return m.getComputedTextLength();
|
|
30
|
+
}catch(e){return String(text||'').length*fs*0.82}
|
|
31
|
+
}
|
|
32
|
+
function renderVoiceRow(g,se,h,sub,visible){
|
|
33
|
+
if(!g)return;
|
|
34
|
+
var baseY=cfg.voiceY,s=(cfg.voiceWidth||520)/1920;
|
|
35
|
+
var iconW=270*s,gap=34*s,dshFs=178*s,dshLs=18*s,barW=4.5*s,barGap=29.2*s,subFs=dshFs,subGap=subFs*2;
|
|
36
|
+
var dshW=voiceTextWidth('DSH',dshFs,dshLs,'700');
|
|
37
|
+
var waveW=19*barGap+barW;
|
|
38
|
+
var subW=sub?voiceTextWidth(sub,subFs,0,'400'):0;
|
|
39
|
+
var total=iconW+gap+dshW+gap+waveW+(subW?gap+subGap+subW:0);
|
|
40
|
+
while(total>1860&&subW&&subFs>dshFs*0.7){subFs-=2*s;subW=voiceTextWidth(sub,subFs,0,'400');total=iconW+gap+dshW+gap+waveW+gap+subGap+subW}
|
|
41
|
+
var x=960-total/2;
|
|
42
|
+
var dshX=x+iconW+gap,waveX=dshX+dshW+gap,subX=waveX+waveW+subGap;
|
|
43
|
+
var bars=h.map(function(v,i){return '<rect x="'+(i*barGap).toFixed(2)+'" y="'+(baseY-(v*s)/2).toFixed(1)+'" width="'+barW.toFixed(2)+'" height="'+(v*s).toFixed(1)+'" rx="'+(1.1*s).toFixed(2)+'" fill="#efeee5"/>'}).join('');
|
|
44
|
+
g.innerHTML='<image href="assets/whale-badge-line.png" x="'+x+'" y="'+(baseY-iconW/2)+'" width="'+iconW+'" height="'+iconW+'" preserveAspectRatio="xMidYMid meet"/><text x="'+dshX+'" y="'+baseY+'" dominant-baseline="central" font-family="\'DIN Alternate\',\'Bahnschrift\',\'Microsoft YaHei\',sans-serif" font-size="'+dshFs+'" font-weight="700" letter-spacing="'+dshLs+'" fill="#e8e5d9">DSH</text><g transform="translate('+waveX+' 0)">'+bars+'</g>';
|
|
45
|
+
g.setAttribute('transform','translate(0 0)');
|
|
46
|
+
g.style.opacity=visible;
|
|
47
|
+
if(se){if(se.textContent!==sub)se.textContent=sub||'';se.setAttribute('x',String(subX));se.setAttribute('y',String(baseY));se.setAttribute('text-anchor','start');se.setAttribute('dominant-baseline','central');se.setAttribute('font-size',String(subFs));se.style.opacity=(visible&&sub)?1:0}
|
|
48
|
+
}
|
|
49
|
+
function render(){
|
|
50
|
+
const m=HUDMotion.state(t,cfg.loadingStart),loading=m.load,p=progress(t);
|
|
51
|
+
lastLoaded=m.load;
|
|
52
|
+
/* v2.15.12:结尾等配音时 t 冻结在 duration,波形/圆环改用连续时钟 rt,动画不中断 */
|
|
53
|
+
const waitSec=((window.__VTIME__==null)&&window.__WAIT_START__>0&&t>=cfg.duration-0.03)?(performance.now()-window.__WAIT_START__)/1000:0;
|
|
54
|
+
const rt=t+waitSec;
|
|
55
|
+
$('rings').style.opacity=m.opacity;$('rings').removeAttribute('transform');
|
|
56
|
+
$('outer').setAttribute('transform',`scale(${m.outerScale}) rotate(${rt*5})`);$('outer').style.opacity=m.outerOpacity;
|
|
57
|
+
$('ticks').setAttribute('transform',`scale(${m.outerScale*m.outerPulse})`);$('ticks').style.opacity=m.outerOpacity;
|
|
58
|
+
$('outerPulse').setAttribute('r',210*m.outerScale*m.outerPulse);$('outerPulse').style.opacity=m.outerOpacity*(.16+.2*Math.pow(Math.max(0,Math.sin(rt*6.54)),8));
|
|
59
|
+
$('markers').setAttribute('transform',`scale(${.66+.34*m.expand})`);$('markers').style.opacity=m.opacity;
|
|
60
|
+
$('inner').setAttribute('transform',`rotate(${-rt*12})`);$('middle').removeAttribute('transform');
|
|
61
|
+
$('pulse').setAttribute('r',m.innerPulse);$('pulse').style.opacity=m.pulseOpacity;
|
|
62
|
+
$('pulseTrail').setAttribute('r',Math.max(2,m.innerPulse-5));$('pulseTrail').style.opacity=m.pulseOpacity*.33;
|
|
63
|
+
$('tip').style.opacity=m.tipOpacity*m.flicker;$('tip').setAttribute('transform',`translate(0 ${-7*(1-m.tipReveal)}) scale(1 ${.96+.04*m.tipReveal})`);
|
|
64
|
+
$('percent').textContent=loading&&m.percentOpacity>0?Math.round(p)+'%':'';$('percent').style.opacity=m.percentOpacity;
|
|
65
|
+
const sweep=m.solidRing*359+(1-m.solidRing)*(loading?Math.max(.01,p*3.6):265);
|
|
66
|
+
$('progressArc').setAttribute('d',arc(98,-90,-90+sweep));$('progressArc').setAttribute('stroke',m.solidRing>.1?'#f99508':loading?'#f29420':'#9c5c10');
|
|
67
|
+
$('progressArc').setAttribute('transform',`rotate(${loading||m.solidRing>.9?0:(rt*110)%360})`);
|
|
68
|
+
$('status').textContent=loading?'加载中':'连接中:'+cfg.username;$('status').style.opacity=m.opacity*m.labelOpacity;
|
|
69
|
+
$('statusArrow').style.opacity=m.opacity*m.labelOpacity;
|
|
70
|
+
$('statusDots').style.opacity=m.opacity*m.labelOpacity*(.35+.65*Math.abs(Math.sin(rt*4)));
|
|
71
|
+
let VT=(window.__VTIME__!=null)?+window.__VTIME__:(t<=9.2?t-3.4:5.8+(t-9.2)/1.5);VT+=waitSec;let vh=null,vOn=false,sub="";
|
|
72
|
+
/* v2.15.14:重连接提示音独占一整行(图标+DSH+波形+中文),播完才恢复后续配音 */
|
|
73
|
+
const cueOn=!!(window.__DSH_CUE__&&performance.now()<(window.__DSH_CUE_UNTIL__||0));
|
|
74
|
+
if(cueOn){
|
|
75
|
+
sub=window.__DSH_CUE__;
|
|
76
|
+
vh=Array.from({length:20},(_,k)=>4+Math.min(360,Math.abs(Math.sin(rt*7+k*0.55))*300));
|
|
77
|
+
vOn=true;
|
|
78
|
+
}else{
|
|
79
|
+
const vsched=(window.__VSCHED__&&window.__VSCHED__.length)?window.__VSCHED__:(window.VOICE_SCHED||[]).map(function(s){var atV=(s.at<=9.2)?s.at-3.4:5.8+(s.at-9.2)/1.5;return{key:s.key,at:atV,dur:s.dur};});
|
|
80
|
+
for(const s of vsched){if(VT>=s.at-0.02&&VT<s.at+s.dur&&(!window.__DSH_AUDIO_ON__||window.__DSH_ACTIVE_VOICE__===s.key)){sub=(cfg.voice&&cfg.voice.subs&&cfg.voice.subs[s.key])||"";const e=(window.VOICE_ENV||{})[s.key];if(e&&e.length){const vt=VT-s.at;vh=Array.from({length:20},(_,k)=>{const st=Math.max(0,vt-(19-k)*0.055);const fi=st/0.008;const ai=Math.min(e.length-1,Math.floor(fi));const af=fi-Math.floor(fi);const a=((e[ai]||0)*(1-af)+(e[Math.min(e.length-1,ai+1)]||0)*af);return 4+Math.min(360,Math.pow(Math.max(0,a),0.9)*360)});vOn=true;}break;}}
|
|
81
|
+
}
|
|
82
|
+
const h=vh||Array(20).fill(4);const voiceVisible=vOn?1:0;renderVoiceRow($('voice'),$('subtitle'),h,sub,voiceVisible);$('seek').value=t;$('time').textContent=(t-(+cfg.startAt||0)).toFixed(2)+' / '+(cfg.duration-(+cfg.startAt||0)).toFixed(2)+' s';
|
|
83
|
+
}
|
|
84
|
+
function syncAudio(){if(!env)return;const at=t- +$('voiceStart').value;if(at<0||at>=env.duration){audio.pause();return}if(Math.abs(audio.currentTime-at)>.12)audio.currentTime=at;if(playing&&audio.paused)audio.play().catch(()=>{$('audioInfo').textContent='请点击播放以启用音频。'});if(!playing)audio.pause()}
|
|
85
|
+
function play(){if(t>=cfg.duration)t=+cfg.startAt||0;playing=true;last=performance.now();$('play').textContent='暂停';syncAudio()}
|
|
86
|
+
function pause(){playing=false;audio.pause();$('play').textContent='播放'}
|
|
87
|
+
function seek(v){t=Math.max(+cfg.startAt||0,Math.min(cfg.duration,v));last=performance.now();syncAudio();render()}
|
|
88
|
+
$('play').onclick=()=>playing?pause():play();$('restart').onclick=()=>{seek(+cfg.startAt||0);play()};$('seek').max=cfg.duration;$('seek').min=+cfg.startAt||0;$('seek').oninput=e=>seek(+e.target.value);$('connection').onclick=()=>{pause();seek(+cfg.startAt||0)};$('loading').onclick=()=>{pause();seek(14)};$('fullscreen').onclick=()=>$('stage').requestFullscreen();$('voiceStart').oninput=()=>{syncAudio();render()};
|
|
89
|
+
$('file').onchange=async e=>{const f=e.target.files[0];if(!f)return;const id=++loadId;pause();try{ctx??=new AudioContext();const b=await ctx.decodeAudioData(await f.arrayBuffer());if(id!==loadId)return;const samples=new Float32Array(b.length);for(let c=0;c<b.numberOfChannels;c++){const a=b.getChannelData(c);for(let i=0;i<a.length;i++)samples[i]+=a[i]/b.numberOfChannels}env=VoiceAnimation.envelope(samples,b.sampleRate);if(url)URL.revokeObjectURL(url);url=URL.createObjectURL(f);audio.src=url;$('audioInfo').textContent=f.name+' · '+b.duration.toFixed(1)+' 秒;点击播放试听。';render()}catch{$('audioInfo').textContent='音频无法解码,请使用 MP3、WAV 或 M4A。'}};
|
|
90
|
+
$('reset').onclick=()=>{cfg=JSON.parse(JSON.stringify(defaults));persist();settings();render()};$('save').onclick=()=>{const a=document.createElement('a'),u=URL.createObjectURL(new Blob([JSON.stringify({...cfg,voiceStart:+$('voiceStart').value},null,2)],{type:'application/json'}));a.href=u;a.download='animation-settings.json';a.click();setTimeout(()=>URL.revokeObjectURL(u),1000)};
|
|
91
|
+
function tick(){if(playing){{const now=performance.now();const dt=(now-last)/1000;last=now;const sp=(t>=+cfg.speedStart&&t<+cfg.speedEnd)?(+cfg.speed||1):1;t=Math.min(cfg.duration,t+dt*sp);}if(t>=cfg.duration)pause();syncAudio();render()}if(!playing&&t>=cfg.duration-0.05)render();requestAnimationFrame(tick)}settings();render();tick();
|
|
92
|
+
|
|
93
|
+
$('prevFrame').onclick=()=>{pause();seek(t-1/60)};$('nextFrame').onclick=()=>{pause();seek(t+1/60)};
|
|
94
|
+
/* ===== 跳过按钮(Lead 增加) ===== */
|
|
95
|
+
(function(){var b=document.createElement('div');b.id='skip';b.innerHTML='跳过<span class="arr">▸</span>';b.title='跳过启动动画';b.style.opacity='1';b.style.zIndex='9999';b.style.fontSize='18px';(document.body||document.documentElement).appendChild(b);setTimeout(function(){b.classList.add('show');},500);function skip(){try{document.dispatchEvent(new CustomEvent('dsh-startup-skip'));}catch(e){}try{if(parent&&parent!==window)parent.postMessage({type:'dsh-startup-skip'},'*');}catch(e){}try{if(typeof window.__DSH_SKIP__==='function')window.__DSH_SKIP__();}catch(e){}}b.addEventListener('click',function(e){e.preventDefault();skip();});document.addEventListener('keydown',function(e){if(e.key==='Escape')skip();});})();
|
|
96
|
+
|
|
97
|
+
/* ===== 掉线彩蛋 + 五句配音(Lead v11) ===== */
|
|
98
|
+
(function(){
|
|
99
|
+
var q=new URLSearchParams(location.search), EGG_CHANCE=0.28;
|
|
100
|
+
var eggEl=document.getElementById('egg'), btn=document.getElementById('egg-retry');
|
|
101
|
+
var eggCfg=(cfg.egg||{}), eggFrom=+(eggCfg.min!=null?eggCfg.min:cfg.loadingStart), eggTo=Math.max(eggFrom+1, +(eggCfg.max!=null?eggCfg.max:cfg.duration-0.35));
|
|
102
|
+
/* v2.15.10:掉线时机从「固定 9.2s」改为「进度 0–100%」随机;按百分比反查时间,保证 0%~100% 都可能掉线 */
|
|
103
|
+
function eggTimeForPct(pct){
|
|
104
|
+
var a=cfg.progress||[];
|
|
105
|
+
for(var i=1;i<a.length;i++){
|
|
106
|
+
if(pct<=a[i][1]){
|
|
107
|
+
var p0=a[i-1][1],p1=a[i][1],t0=a[i-1][0],t1=a[i][0];
|
|
108
|
+
return p1===p0?t0:(t0+(t1-t0)*(pct-p0)/(p1-p0));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return +cfg.speedEnd||eggTo;
|
|
112
|
+
}
|
|
113
|
+
var eggAt=(q.get('egg')==='1')?eggFrom:Math.max(eggFrom,Math.min(eggTo,eggTimeForPct(Math.random()*100)));
|
|
114
|
+
var vc=(cfg.voice||{}), mute=q.get('mute')==='1';
|
|
115
|
+
var voiceVol=Number(cfg&&cfg.voiceVolume!=null?cfg.voiceVolume:0.5);if(!isFinite(voiceVol))voiceVol=0.5;voiceVol=Math.max(0,Math.min(1,voiceVol));
|
|
116
|
+
function voiceDuck(on){try{if(parent&&parent!==window)parent.postMessage({type:'dsh-startup-voice',on:!!on},'*')}catch(e){}}
|
|
117
|
+
/* v2.15.10:彩蛋弹出时请宿主截断 BGM;重连后请宿主重新播 */
|
|
118
|
+
function bgmSig(on){try{if(parent&&parent!==window)parent.postMessage({type:'dsh-startup-bgm',on:!!on},'*')}catch(e){}}
|
|
119
|
+
var sched=vc.sched||[[4.6,'orig1',2.65],[8.0,'line1',3.375],[12.8,'line2',3.232],[20.0,'line3',3.300],[25.45,'orig3',2.77]];
|
|
120
|
+
var eggLineAt=+(vc.eggLineAt!=null?vc.eggLineAt:2.0), eggReplayWait=+(vc.eggReplayWait!=null?vc.eggReplayWait:2.0), line4Dur=+(vc.line4Dur||1.911);
|
|
121
|
+
var aud={},played={},activeVoice=null,cueGate=false,cueFailTimer=null;window.__DSH_AUDIO_ON__=!mute;window.__DSH_ACTIVE_VOICE__='';
|
|
122
|
+
sched.forEach(function(e){var k=e[1];if(!mute&&vc[k]){var a=new Audio(vc[k]);a.preload='auto';a.volume=voiceVol;a.addEventListener('ended',function(){if(activeVoice===k){activeVoice=null;window.__DSH_ACTIVE_VOICE__='';}voiceDuck(false)});aud[k]=a;played[k]=false;}});
|
|
123
|
+
if(!mute&&vc.reconnect){var rc=new Audio(vc.reconnect);rc.preload='auto';rc.volume=voiceVol;rc.addEventListener('ended',function(){if(activeVoice==='reconnect'){activeVoice=null;window.__DSH_ACTIVE_VOICE__=''}window.__DSH_CUE__='';window.__DSH_CUE_UNTIL__=0;cueGate=false;voiceDuck(false)});aud.reconnect=rc;played.reconnect=true;}
|
|
124
|
+
/* v2.15.14:重连提示音只播自己这一行;播完(ended)才解除 cueGate,后续 line2/line3/orig3 才允许开始 */
|
|
125
|
+
function playReconnectCue(){if(mute||!aud.reconnect)return;cueGate=true;setTimeout(function(){try{attachVoiceFx('reconnect');aud.reconnect.currentTime=0;aud.reconnect.play().catch(function(){})}catch(e){}activeVoice='reconnect';window.__DSH_ACTIVE_VOICE__='';var txt=(cfg.voice&&cfg.voice.subs&&cfg.voice.subs.reconnect)||'';var d=isFinite(aud.reconnect.duration)&&aud.reconnect.duration>0?aud.reconnect.duration:2.82;window.__DSH_CUE__=txt;window.__DSH_CUE_UNTIL__=performance.now()+d*1000+150;voiceDuck(true);if(cueFailTimer)clearTimeout(cueFailTimer);
|
|
126
|
+
/* 兜底:音频若因自动播放策略被拒,ended 不会触发;到时强制解除门控,避免后续配音全被卡住 */
|
|
127
|
+
cueFailTimer=setTimeout(function(){if(activeVoice==='reconnect'){activeVoice=null;window.__DSH_ACTIVE_VOICE__='';window.__DSH_CUE__='';window.__DSH_CUE_UNTIL__=0;cueGate=false;voiceDuck(false)}},d*1000+1500)},500)}
|
|
128
|
+
if(!mute&&vc.line4){var l4=new Audio(vc.line4);l4.preload='auto';l4.volume=voiceVol;l4.addEventListener('ended',function(){if(activeVoice==='line4'){activeVoice=null;window.__DSH_ACTIVE_VOICE__='';}voiceDuck(false)});aud.line4=l4;played.line4=false;}
|
|
129
|
+
/* v2.15.5:模板内配音效果(与全局 5 个声音效果同参数);只在宿主注入 voiceFx 时生效。 */
|
|
130
|
+
var VOICE_FX_PRESETS={'ai-mech':{hp:130,lp:4200,peak:{f:260,g:4,q:1.0},drive:0.15,ring:0},'robot':{hp:180,lp:3200,peak:{f:1500,g:3,q:0.9},drive:0.35,ring:42},'radio':{hp:420,lp:2800,peak:{f:1800,g:5,q:1.2},drive:0.6,ring:0},'oldtv':{hp:220,lp:2200,peak:null,drive:0.45,ring:0},'dark':{hp:90,lp:1200,peak:{f:180,g:5,q:0.8},drive:0.1,ring:0}};
|
|
131
|
+
var voiceFxMode=String((cfg&&cfg.voiceFx)||'none');
|
|
132
|
+
var fxAC=null,fxDone={};
|
|
133
|
+
function voiceDriveCurve(amount){var k=Math.max(0,Math.min(1,Number(amount)||0))*60,n=1024,curve=new Float32Array(n);for(var i=0;i<n;i++){var x=(i*2)/n-1;curve[i]=((3+k)*x*20*Math.PI/180)/(Math.PI+k*Math.abs(x))}return curve}
|
|
134
|
+
function attachVoiceFx(k){
|
|
135
|
+
if(voiceFxMode==='none'||fxDone[k])return;
|
|
136
|
+
var a=aud[k];if(!a)return;
|
|
137
|
+
var P=VOICE_FX_PRESETS[voiceFxMode];if(!P)return;
|
|
138
|
+
var AC=window.AudioContext||window.webkitAudioContext;if(!AC)return;
|
|
139
|
+
function build(){
|
|
140
|
+
if(fxDone[k])return;
|
|
141
|
+
try{
|
|
142
|
+
var c=fxAC||(fxAC=new AC());var src=c.createMediaElementSource(a);var node=src;
|
|
143
|
+
if(P.hp){var hp=c.createBiquadFilter();hp.type='highpass';hp.frequency.value=P.hp;node.connect(hp);node=hp}
|
|
144
|
+
if(P.lp){var lp=c.createBiquadFilter();lp.type='lowpass';lp.frequency.value=P.lp;node.connect(lp);node=lp}
|
|
145
|
+
if(P.peak){var pk=c.createBiquadFilter();pk.type='peaking';pk.frequency.value=P.peak.f;pk.gain.value=P.peak.g;pk.Q.value=P.peak.q;node.connect(pk);node=pk}
|
|
146
|
+
if(P.drive){var ws=c.createWaveShaper();ws.curve=voiceDriveCurve(P.drive);ws.oversample='2x';node.connect(ws);node=ws}
|
|
147
|
+
if(P.ring){var rg=c.createGain();rg.gain.value=0.55;var osc=c.createOscillator();osc.frequency.value=P.ring;osc.type='sine';var mg=c.createGain();mg.gain.value=0.45;osc.connect(mg);mg.connect(rg.gain);node.connect(rg);node=rg;osc.start()}
|
|
148
|
+
node.connect(c.destination);fxDone[k]=true;
|
|
149
|
+
}catch(e){}
|
|
150
|
+
}
|
|
151
|
+
try{
|
|
152
|
+
if(!fxAC)fxAC=new AC();
|
|
153
|
+
if(fxAC.state==='running')build();
|
|
154
|
+
else fxAC.resume().then(function(){if(fxAC.state==='running')build()}).catch(function(){});
|
|
155
|
+
}catch(e){}
|
|
156
|
+
}
|
|
157
|
+
window.VOICE_SCHED=sched.map(function(e){return{key:e[1],at:e[0],dur:e[2]};});
|
|
158
|
+
var scale=cfg.voiceWidth/1920, eggSvg=null, eggRow=null, eggSub=null;
|
|
159
|
+
function ensureEggVoice(){
|
|
160
|
+
if(eggSvg)return;
|
|
161
|
+
eggSvg=document.createElementNS('http://www.w3.org/2000/svg','svg');
|
|
162
|
+
eggSvg.setAttribute('viewBox','0 0 1920 1080');eggSvg.setAttribute('width','100%');eggSvg.setAttribute('height','100%');
|
|
163
|
+
eggSvg.style.cssText='position:absolute;left:0;top:0;pointer-events:none;z-index:3';
|
|
164
|
+
eggRow=document.createElementNS('http://www.w3.org/2000/svg','g');
|
|
165
|
+
eggSub=document.createElementNS('http://www.w3.org/2000/svg','text');
|
|
166
|
+
eggSub.setAttribute('fill','#e9d6b8');
|
|
167
|
+
eggSub.setAttribute('font-family',"'DIN Alternate','Bahnschrift','Microsoft YaHei',sans-serif");
|
|
168
|
+
eggSvg.appendChild(eggRow);eggSvg.appendChild(eggSub);eggEl.appendChild(eggSvg);
|
|
169
|
+
}
|
|
170
|
+
function eggVoice(vt){
|
|
171
|
+
ensureEggVoice();
|
|
172
|
+
var e=(window.VOICE_ENV||{}).line4||[], vh=Array(20).fill(4);
|
|
173
|
+
if(vt>=0&&vt<line4Dur&&e.length){
|
|
174
|
+
var fi=vt/0.008, ai=Math.min(e.length-1,Math.floor(fi)), af=fi-Math.floor(fi);
|
|
175
|
+
var amp=((e[ai]||0)*(1-af)+(e[Math.min(e.length-1,ai+1)]||0)*af);
|
|
176
|
+
vh=[];for(var k=0;k<20;k++){var tv2=vt-(19-k)*0.06;var f2=tv2/0.008,i2=Math.min(e.length-1,Math.floor(f2));var a2=((e[i2]||0)*(1-(f2-Math.floor(f2)))+(e[Math.min(e.length-1,i2+1)]||0)*(f2-Math.floor(f2)));vh.push(4+Math.min(440,Math.pow(Math.max(0,a2),0.85)*440))}
|
|
177
|
+
}
|
|
178
|
+
var show=(vt>=0&&vt<line4Dur&&window.__DSH_ACTIVE_VOICE__==='line4')?1:0;
|
|
179
|
+
var st=show?((cfg.voice&&cfg.voice.subs&&cfg.voice.subs.line4)||''):'';
|
|
180
|
+
renderVoiceRow(eggRow,eggSub,vh,st,show);
|
|
181
|
+
}
|
|
182
|
+
var shown=false,done=false,rolled=false,v3Ended=false,waitStart=0,v4Timer=null,replayTimer=null,eggShownAt=0;
|
|
183
|
+
var hit=q.get('egg')==='1'||Math.random()<EGG_CHANCE;
|
|
184
|
+
function stopVoice(){voiceDuck(false);activeVoice=null;window.__DSH_ACTIVE_VOICE__='';window.__DSH_CUE__='';window.__DSH_CUE_UNTIL__=0;cueGate=false;if(cueFailTimer){clearTimeout(cueFailTimer);cueFailTimer=null}Object.keys(aud).forEach(function(k){var a=aud[k];try{a.pause();a.currentTime=0}catch(e){}});if(v4Timer){clearTimeout(v4Timer);v4Timer=null}if(replayTimer){clearTimeout(replayTimer);replayTimer=null}}
|
|
185
|
+
function playKey(k,offset){var a=aud[k];if(a&&!played[k]){played[k]=true;attachVoiceFx(k);try{a.currentTime=Math.max(0,offset||0);a.play().catch(function(){});activeVoice=k;window.__DSH_ACTIVE_VOICE__=k}catch(e){}voiceDuck(true);}}
|
|
186
|
+
function resetPlayedAfter(t0){
|
|
187
|
+
Object.keys(played).forEach(function(k){played[k]=false});v3Ended=false;
|
|
188
|
+
/* v2.15.10:重连回到 loadingStart 时,已播完的语音标记为已播、正在播的从断点续播,避免多句同时响起 */
|
|
189
|
+
sched.forEach(function(e){
|
|
190
|
+
var k=e[1],s=e[0],end=e[0]+(e[2]||0);
|
|
191
|
+
if(end<=t0){played[k]=true}
|
|
192
|
+
else if(s<t0){played[k]=true;playKey(k,t0-s)}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function showEgg(){
|
|
196
|
+
if(shown||done)return; shown=true; rolled=true; playing=false;
|
|
197
|
+
stopVoice();
|
|
198
|
+
bgmSig(false);
|
|
199
|
+
eggEl.classList.add('on'); eggEl.setAttribute('aria-hidden','false'); try{document.body.classList.add('egg-on')}catch(e){}
|
|
200
|
+
eggShownAt=performance.now(); eggVoice(-1);
|
|
201
|
+
v4Timer=setTimeout(function(){playKey('line4')},eggLineAt*1000);
|
|
202
|
+
/* v2.15.6:不再自动 reconnect——彩蛋必须等用户点【重新连接】,否则动画会自己往下走、声音叠在一起。 */
|
|
203
|
+
render();
|
|
204
|
+
}
|
|
205
|
+
function eggFrame(sec){showEgg();stopVoice();window.__EGG_T=Math.max(0,sec);eggShownAt=performance.now()-window.__EGG_T*1000;if(sec>=eggLineAt)playKey('line4');eggVoice(window.__EGG_T-eggLineAt);}
|
|
206
|
+
function hideEgg(){eggEl.classList.remove('on');eggEl.setAttribute('aria-hidden','true');try{document.body.classList.remove('egg-on')}catch(e){}shown=false;}
|
|
207
|
+
/* v2.15.14:重连后不再续播断句(原来会把 line1 从半句接着放,和 reconnect 叠在一起)。
|
|
208
|
+
顺序:等待 0.5s → 只播 reconnect(独占一行)→ 播完解除 cueGate → line2/line3/orig3 按时间线继续。 */
|
|
209
|
+
function reconnect(){if(done)return;hideEgg();stopVoice();bgmSig(true);
|
|
210
|
+
Object.keys(played).forEach(function(k){played[k]=true});
|
|
211
|
+
played.line2=false;played.line3=false;played.orig3=false;played.reconnect=true;
|
|
212
|
+
v3Ended=false;
|
|
213
|
+
cueGate=!!(!mute&&aud.reconnect);
|
|
214
|
+
playReconnectCue();
|
|
215
|
+
waitStart=0;window.__WAIT_START__=0;seek(cfg.loadingStart);playing=true;last=performance.now();var pb=document.getElementById('play');if(pb)pb.textContent='暂停';render();}
|
|
216
|
+
function doneEmit(){if(done)return;done=true;try{document.dispatchEvent(new CustomEvent('dsh-startup-done'))}catch(e){}try{if(parent&&parent!==window)parent.postMessage({type:'dsh-startup-done'},'*')}catch(e){}try{if(typeof window.__DSH_DONE__==='function')window.__DSH_DONE__()}catch(e){}}
|
|
217
|
+
/* v2.15.12:不清 __WAIT_START__,让圆环/波形一直转到 iframe 被移除(转场期间不跳帧) */
|
|
218
|
+
function flashDone(){hideEgg();doneEmit();}
|
|
219
|
+
if(btn)btn.addEventListener('click',function(e){e.preventDefault();reconnect();});
|
|
220
|
+
if(aud.orig3)aud.orig3.addEventListener('ended',function(){v3Ended=true});
|
|
221
|
+
(function watch(){
|
|
222
|
+
if(!done){
|
|
223
|
+
if(playing&&!cueGate){sched.forEach(function(e){if(t>=e[0])playKey(e[1]);});}
|
|
224
|
+
if(!rolled&&playing&&!shown&&t>=eggAt){rolled=true;if(hit)showEgg();}
|
|
225
|
+
if(shown){var elap=(window.__EGG_T!=null?window.__EGG_T:(performance.now()-eggShownAt)/1000);eggVoice(elap-eggLineAt);}
|
|
226
|
+
if(!shown&&t>=cfg.duration-0.02){if(!waitStart){waitStart=performance.now();window.__WAIT_START__=waitStart;}var waitVoice=(!mute&&aud.orig3&&!v3Ended&&(performance.now()-waitStart<4000));if(!waitVoice)flashDone();}
|
|
227
|
+
}
|
|
228
|
+
requestAnimationFrame(watch);
|
|
229
|
+
})();
|
|
230
|
+
window.__DSH_APP__={play:play,pause:pause,seek:seek,showEgg:showEgg,eggFrame:eggFrame,flashDone:flashDone};
|
|
231
|
+
})();
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
/* v2.15.3:加载阶段按空格 / 宿主转发 切换下一条 tips;彩蛋卡片打开时不拦截。
|
|
235
|
+
宿主转发用于 iframe 失焦(DSH 聊天输入框把焦点抢走后,模板内收不到空格)。 */
|
|
236
|
+
function nextTip(){
|
|
237
|
+
if(!lastLoaded)return false;
|
|
238
|
+
var card=document.getElementById('egg-card');
|
|
239
|
+
if(card){
|
|
240
|
+
var st=getComputedStyle(card);
|
|
241
|
+
if(st.display!=='none'&&st.visibility!=='hidden'&&card.getBoundingClientRect().width>0)return false;
|
|
242
|
+
}
|
|
243
|
+
tipIndex=(tipIndex+1)%tips.length;
|
|
244
|
+
setTip(tipIndex);
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
document.addEventListener('keydown',function(e){
|
|
248
|
+
if(e.code!=='Space'&&e.key!==' ')return;
|
|
249
|
+
if(nextTip()){e.preventDefault();e.stopPropagation();}
|
|
250
|
+
});
|
|
251
|
+
window.addEventListener('message',function(e){
|
|
252
|
+
var d=e&&e.data;
|
|
253
|
+
if(d&&typeof d==='object'&&d.type==='dsh-tip-next')nextTip();
|
|
254
|
+
});
|
|
255
|
+
setTip(0);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 全景大肥鱼-含彩蛋版 · 可编辑代码动画参数(Lead 2026-11-05 更新)
|
|
2
|
+
window.CONFIG={
|
|
3
|
+
username:'人类与AI的日常',
|
|
4
|
+
title:'什么是「模板」?',
|
|
5
|
+
description:'模板是别人做好的启动动画,一键安装就生效。也可以自己换标题、换台词、换时长。',
|
|
6
|
+
tips:[
|
|
7
|
+
{title:'什么是「模板」?',description:'模板是别人做好的启动动画,一键安装就生效。也可以自己换标题、换台词、换时长。'},
|
|
8
|
+
{title:'操作提示',description:'按 空格 可以切换下一条提示;动画结束会自动进入聊天。'},
|
|
9
|
+
{title:'掉线彩蛋',description:'进度条运行中,有小概率遇到一条「掉线」消息,按提示重连即可继续。'},
|
|
10
|
+
{title:'想自己改?',description:'打开模板编辑器,标题、正文、连接用户名都能改,保存后下次启动生效。'},
|
|
11
|
+
{title:'怎么跳过?',description:'等进度条走完会自动进入聊天;想提前进,按 Esc 或点右上角「跳过」。'}
|
|
12
|
+
],
|
|
13
|
+
duration:25.92,
|
|
14
|
+
startAt:3.4,
|
|
15
|
+
loadingStart:9.2,
|
|
16
|
+
voiceY:908,
|
|
17
|
+
voiceWidth:520,
|
|
18
|
+
speedStart:9.2,
|
|
19
|
+
speed:1.5,
|
|
20
|
+
speedEnd:25.45,
|
|
21
|
+
egg:{}, // v2.15.10:掉线时机在「进度 0–100%」之间随机(app.js 按 loadingStart~speedEnd 计算)
|
|
22
|
+
voice:{subs:{orig1:'警告:检测到新特工登录。',line1:'战术模块传输中,请稍候。',line2:'装备与技能配置已验证。倒计时十秒。',line3:'网络同步完成。正在移交权限。',line4:'警告:特工已离线。',reconnect:'检测到特工重新连接。',orig3:'欢迎回来,特工。很高兴再次见到你。'},orig1:'assets/voice-orig1.wav',line1:'assets/voice-line1.wav',line2:'assets/voice-line2.wav',line3:'assets/voice-line3.wav',orig3:'assets/voice-orig3.wav',line4:'assets/voice-line4.wav',reconnect:'assets/voice-reconnect.wav',sched:[[4.6,'orig1',2.65],[8.0,'line1',3.375],[12.8,'line2',3.232],[20.0,'line3',3.300],[25.45,'orig3',2.77]],eggLineAt: 1.0,line4Dur:1.911},
|
|
23
|
+
progress:[[9.2,0],[10,0],[10.9,0],[11.5,10],[12,29],[13,41],[14,43],[15,43],[20,43],[21,46],[22,51],[23,55],[24,59],[25,63],[25.4,64],[25.45,100],[25.92,100]]
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>全境封锁 · 可编辑代码动画</title><link rel="stylesheet" href="style.css"><style id="dsh-embed-style">html.embed,html.embed body{width:100%;height:100%;margin:0;overflow:hidden;background:#000}html.embed main{display:block!important;width:100%;height:100%}html.embed aside{display:none!important}html.embed #stage{width:100%;height:100%}html.embed #scene{width:100%;height:100%;display:block}</style></head><body><main><div id="stage"><svg id="scene" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><g id="tip"><path d="M615 222v-22q15-17 30 0v22zM620 201h20v18h-20zM626 189h9" fill="none" stroke="#aaa" stroke-width="2"/><text id="title" x="657" y="219" fill="#ccc" font-size="27"></text><path d="M606 232H1316M606 299H1316" stroke="#252525"/><foreignObject x="621" y="240" width="683" height="58"><div xmlns="http://www.w3.org/1999/xhtml" id="description"></div></foreignObject><path d="M596 256v19M1324 256v19" stroke="#999" stroke-width="2"/><rect x="624" y="313" width="45" height="16" fill="#555"/><text x="631" y="324" font-size="13" fill="#ccc">▏</text><text x="681" y="329" font-size="18" fill="#999">下一则</text><g id="pages"></g></g><g transform="translate(960 540)"><g id="rings"><circle id="pulse" r="10" fill="none" stroke="#70491a" stroke-width="2"/><circle id="pulseTrail" r="10" fill="none" stroke="#30250d" stroke-width="9"/><circle id="outerPulse" r="210" fill="none" stroke="#89521b" stroke-width="1"/><g id="ticks"></g><g id="outer"></g><g id="middle"></g><g id="inner"></g><g id="markers"></g><path id="progressArc" fill="none" stroke="#f29420" stroke-width="16"/><circle r="68" fill="none" stroke="#50340b" stroke-width="2"/></g><text id="percent" text-anchor="middle" y="9" fill="#bcbcbc" font-size="29" font-weight="300"></text></g><path id="statusArrow" d="M958 810l5 7 5-7" fill="#555"/><text id="status" x="960" y="853" text-anchor="middle" fill="#757575" font-size="25"></text><g id="statusDots" fill="#888"><rect x="951" y="792" width="3" height="3"/><rect x="960" y="787" width="3" height="3"/><rect x="967" y="796" width="3" height="3"/></g><g id="voice"></g><text id="subtitle" x="960" y="944" text-anchor="middle" fill="#e9d6b8" font-size="24" letter-spacing="1" opacity="0" style="transition:opacity .22s ease;pointer-events:none"></text></svg></div><aside><h1>可编辑代码动画</h1><label>连接用户名<input id="username"></label><label>提示标题<input id="heading"></label><label>提示正文<textarea id="body" rows="4"></textarea></label><div class="buttons"><button id="play">播放</button><button id="restart">从头播放</button><button id="fullscreen">全屏</button></div><label><span id="time">0.00 / 25.90 秒</span><input id="seek" type="range" min="0" max="25.9" step="0.016667" value="0"></label><div class="buttons"><button id="connection">查看连接阶段</button><button id="loading">查看加载阶段</button><button id="prevFrame">上一帧</button><button id="nextFrame">下一帧</button></div><hr><label>导入语音<input id="file" type="file" accept="audio/*"></label><label>语音开始时间(秒)<input id="voiceStart" type="number" min="0" step="0.1" value="9.2"></label><label>语音框距“加载中”的间隔<input id="gap" type="range" min="12" max="100" step="1" value="55"></label><p id="audioInfo">尚未导入语音,波形静止。语音框在加载阶段出现。</p><div class="buttons"><button id="save">保存设置 JSON</button><button id="reset">恢复默认</button></div><p>文字即时生效并保存在当前浏览器。时间轴、圆环和刻度均由参数生成。</p></aside></main><audio id="audio"></audio><div id="egg" aria-hidden="true"><img id="egg-bg" src="assets/egg-bg.png" alt=""><div id="egg-veil"></div><div id="egg-card" role="alertdialog"><div class="egg-head"><span class="egg-badge">!</span><span class="egg-title">错误</span></div><div class="egg-msg">《战术大肥鱼®》服务目前无法使用,请点击重试按钮。<div class="egg-code"><span>DELTA</span><span>C-0-1302</span></div></div><div class="egg-actions"><button id="egg-retry" type="button">重新连接</button></div></div></div><script src="config.js"></script><script src="voice.js"></script><script src="voice-env.js"></script><script src="motion.js"></script><script src="app.js"></script><script>/* DSH_EMBED_PATCH */ (function(){try{var t=window.__DSH_STARTUP_TEMPLATE__||null;var embedded=(window.self!==window.top)||(t&&t.id==="division-bigfish-codex");if(!embedded)return;document.documentElement.classList.add("embed");function setv(id,v){if(!v)return;var el=document.getElementById(id);if(el){el.value=v;el.dispatchEvent(new Event("input",{bubbles:true}));}}if(t){setv("username",t.bigfishUsername);setv("heading",t.bigfishTitle);setv("body",t.bigfishDesc);}var n=0;var iv=setInterval(function(){n++;var b=document.getElementById("play");if(b){b.click();clearInterval(iv);}else if(n>60){clearInterval(iv);}},100);}catch(e){}})();</script></body></html>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Motion reconstruction from the reference's 60 fps timing study.
|
|
2
|
+
// A few editable events and analytic curves, never recorded frame arrays.
|
|
3
|
+
window.HUDMotion={
|
|
4
|
+
events:{firstExpand:.62,hide:3.05,return:4.30,secondExpand:4.82,loading:9.166667,loadingExpand:9.88},
|
|
5
|
+
clamp:v=>Math.max(0,Math.min(1,v)),
|
|
6
|
+
smooth(v){v=this.clamp(v);return v*v*(3-2*v)},
|
|
7
|
+
ease(v){return 1-Math.pow(1-this.clamp(v),3)},
|
|
8
|
+
state(t,loadingStart){
|
|
9
|
+
const e=this.events,load=t>=loadingStart;
|
|
10
|
+
const start=load?loadingStart:t>=e.return?e.return:0;
|
|
11
|
+
const expansion=load?loadingStart+.71:t>=e.return?e.secondExpand:e.firstExpand;
|
|
12
|
+
const age=t-start,expand=this.ease((t-expansion)/(load?1.5:.7));
|
|
13
|
+
const visible=t<e.hide||t>=e.return;
|
|
14
|
+
const intro=t>=e.return?this.smooth(age/.16):1;
|
|
15
|
+
const phase=((t-(start+.65))%1+1)%1;
|
|
16
|
+
const beat=Math.pow(Math.max(0,Math.sin((t-start)*Math.PI*2/.96)),9);
|
|
17
|
+
return {load,age,visible,opacity:visible?intro:0,expand,
|
|
18
|
+
outerOpacity:this.smooth((t-expansion-.12)/.25),
|
|
19
|
+
outerScale:.51+.49*expand,
|
|
20
|
+
outerPulse:1+.012*beat,
|
|
21
|
+
innerPulse:8+66*this.ease(phase/.85),
|
|
22
|
+
pulseOpacity:!load&&t>expansion?(1-this.smooth((phase-.55)/.4))*.6:0,
|
|
23
|
+
solidRing:1-this.smooth((t-expansion)/.28),
|
|
24
|
+
labelOpacity:this.smooth((t-expansion-.25)/.35),
|
|
25
|
+
percentOpacity:load?this.smooth((age-.91)/.16):0,
|
|
26
|
+
tipOpacity:load?this.clamp(age/.12):0,
|
|
27
|
+
tipReveal:load?this.ease(age/.22):0,
|
|
28
|
+
flicker:load&&age<.18?(Math.floor(age*60)%3===0?.45:1):1};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>全境封锁 · 可编辑代码动画</title><link rel="stylesheet" href="style.css"><style>html,body{overflow:hidden;background:#000}main{display:block!important}aside{display:none!important}#stage{width:100vw;height:100vh;display:grid;place-items:center;background:#000}svg{width:100vw!important;height:100vh!important;max-height:none!important;display:block}</style></head><body><main><div id="stage"><svg id="scene" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><g id="tip"><path d="M615 222v-22q15-17 30 0v22zM620 201h20v18h-20zM626 189h9" fill="none" stroke="#aaa" stroke-width="2"/><text id="title" x="657" y="219" fill="#ccc" font-size="27"></text><path d="M606 232H1316M606 299H1316" stroke="#252525"/><foreignObject x="621" y="240" width="683" height="58"><div xmlns="http://www.w3.org/1999/xhtml" id="description"></div></foreignObject><path d="M596 256v19M1324 256v19" stroke="#999" stroke-width="2"/><rect x="624" y="313" width="45" height="16" fill="#555"/><text x="631" y="324" font-size="13" fill="#ccc">▏</text><text x="681" y="329" font-size="18" fill="#999">下一则</text><g id="pages"></g></g><g transform="translate(960 540)"><g id="rings"><circle id="pulse" r="10" fill="none" stroke="#70491a" stroke-width="2"/><circle id="pulseTrail" r="10" fill="none" stroke="#30250d" stroke-width="9"/><circle id="outerPulse" r="210" fill="none" stroke="#89521b" stroke-width="1"/><g id="ticks"></g><g id="outer"></g><g id="middle"></g><g id="inner"></g><g id="markers"></g><path id="progressArc" fill="none" stroke="#f29420" stroke-width="16"/><circle r="68" fill="none" stroke="#50340b" stroke-width="2"/></g><text id="percent" text-anchor="middle" y="9" fill="#bcbcbc" font-size="29" font-weight="300"></text></g><path id="statusArrow" d="M958 810l5 7 5-7" fill="#555"/><text id="status" x="960" y="853" text-anchor="middle" fill="#757575" font-size="25"></text><g id="statusDots" fill="#888"><rect x="951" y="792" width="3" height="3"/><rect x="960" y="787" width="3" height="3"/><rect x="967" y="796" width="3" height="3"/></g><g id="voice"></g></svg></div><aside><h1>可编辑代码动画</h1><label>连接用户名<input id="username"></label><label>提示标题<input id="heading"></label><label>提示正文<textarea id="body" rows="4"></textarea></label><div class="buttons"><button id="play">播放</button><button id="restart">从头播放</button><button id="fullscreen">全屏</button></div><label><span id="time">0.00 / 25.90 秒</span><input id="seek" type="range" min="0" max="25.9" step="0.016667" value="0"></label><div class="buttons"><button id="connection">查看连接阶段</button><button id="loading">查看加载阶段</button><button id="prevFrame">上一帧</button><button id="nextFrame">下一帧</button></div><hr><label>导入语音<input id="file" type="file" accept="audio/*"></label><label>语音开始时间(秒)<input id="voiceStart" type="number" min="0" step="0.1" value="9.2"></label><label>语音框距“加载中”的间隔<input id="gap" type="range" min="12" max="100" step="1" value="55"></label><p id="audioInfo">尚未导入语音,波形静止。语音框在加载阶段出现。</p><div class="buttons"><button id="save">保存设置 JSON</button><button id="reset">恢复默认</button></div><p>文字即时生效并保存在当前浏览器。时间轴、圆环和刻度均由参数生成。</p></aside></main><audio id="audio"></audio><div id="egg" aria-hidden="true"><img id="egg-bg" src="assets/egg-bg.png" alt=""><div id="egg-veil"></div><div id="egg-card" role="alertdialog"><div class="egg-head"><span class="egg-badge">!</span><span class="egg-title">错误</span></div><div class="egg-msg">《战术大肥鱼®》服务目前无法使用,请点击重试按钮。<div class="egg-code"><span>DELTA</span><span>C-0-1302</span></div></div><div class="egg-actions"><button id="egg-retry" type="button">重新连接</button></div></div></div><script src="config.js"></script><script src="voice.js"></script><script src="voice-env.js"></script><script src="motion.js"></script><script src="app.js"></script><script>(function(){var q=new URLSearchParams(location.search);setTimeout(function(){var A=window.__DSH_APP__,s=document.getElementById('seek');if(!A)return;window.__HOLD__=parseFloat(q.get('hold')||'0')||0;window.__VTIME__=q.has('vtime')?parseFloat(q.get('vtime')):null;window.__VSCHED__=q.has('demo')?[{key:'reconnect',at:10.7333,dur:2.821},{key:'line3',at:14.054,dur:3.3},{key:'orig3',at:21.5667,dur:2.77}]:null;window.__DEMO_SCHED__=null;var tv=parseFloat(q.get('t')||'0');if(s){s.value=Math.max(0,Math.min(25.9,tv));s.dispatchEvent(new Event('input',{bubbles:true}));}A.pause();if(q.has('egg')){var et=parseFloat(q.get('eggt')||'0');if(A.eggFrame)A.eggFrame(et);}else if(q.has('play')){A.play();}},240);})();</script></body></html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
*{box-sizing:border-box}body{margin:0;background:#111;color:#bbb;font:14px 'Segoe UI','Microsoft YaHei',sans-serif}main{display:grid;grid-template-columns:minmax(0,1fr) 320px;min-height:100vh}#stage{background:#000;display:grid;align-items:center}svg{width:100%;max-height:100vh;aspect-ratio:16/9}aside{padding:25px;background:#181818;overflow:auto}h1{font-size:19px;color:#ed9a37;margin:0 0 25px}label{display:block;margin:14px 0;font-size:12px}input:not([type=range]),textarea{display:block;width:100%;margin-top:7px;padding:9px;background:#101010;color:#ddd;border:1px solid #424242;font:14px inherit}input[type=range]{display:block;width:100%;accent-color:#df8b26;margin-top:10px}button{padding:8px 10px;background:#29231c;color:#ddd;border:1px solid #685034;cursor:pointer}.buttons{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}p{font-size:12px;line-height:1.8;color:#888}hr{border:0;border-top:1px solid #333;margin:24px 0}#description{color:#a5a5a5;font:19px/1.35 'Microsoft YaHei',sans-serif;overflow:hidden;word-break:break-word;height:58px}#stage:fullscreen{width:100vw;height:100vh}#stage:fullscreen svg{width:100%;height:100%}@media(max-width:900px){main{grid-template-columns:1fr}aside{max-width:700px;width:100%;margin:auto}}
|
|
2
|
+
#skip{position:fixed;top:64px;right:72px;z-index:9;display:flex;align-items:center;gap:8px;padding:8px 14px;background:rgba(0,0,0,.35);border:1px solid rgba(214,208,200,.45);color:#cfcac2;font:15px/1 'Microsoft YaHei',sans-serif;letter-spacing:2px;cursor:pointer;opacity:0;transition:opacity .6s ease;user-select:none}#skip.show{opacity:1}#skip:hover{color:#fff;border-color:#e8a33d;background:rgba(232,163,61,.12)}#skip .arr{color:#e8a33d}
|
|
3
|
+
|
|
4
|
+
/* ===== 掉线彩蛋(Lead 增加) ===== */
|
|
5
|
+
#egg{position:fixed;inset:0;z-index:80;display:none;overflow:hidden;background:#05070a}
|
|
6
|
+
#egg.on{display:block}
|
|
7
|
+
#egg-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:saturate(.85) brightness(.85)}
|
|
8
|
+
#egg-veil{position:absolute;inset:0;background:rgba(6,8,12,.55);backdrop-filter:blur(3px) saturate(.85);-webkit-backdrop-filter:blur(3px) saturate(.85)}
|
|
9
|
+
#egg-card{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(920px,86vw);background:rgba(16,18,20,.93);border:1px solid rgba(255,255,255,.08);box-shadow:0 30px 120px rgba(0,0,0,.6);padding:34px 40px 26px;font-family:'Microsoft YaHei',system-ui,sans-serif;color:#cfcfcf}
|
|
10
|
+
.egg-head{display:flex;align-items:center;gap:16px;border-bottom:1px solid rgba(255,255,255,.12);padding-bottom:18px}
|
|
11
|
+
.egg-badge{width:38px;height:38px;display:flex;align-items:center;justify-content:center;background:#f08a1d;color:#111;font-weight:800;font-size:26px;line-height:1}
|
|
12
|
+
.egg-title{font-size:30px;letter-spacing:2px;color:#f2f2f2}
|
|
13
|
+
.egg-msg{padding:30px 6px 26px;font-size:24px;line-height:1.6;color:#bdbdbd}
|
|
14
|
+
.egg-code{display:flex;justify-content:space-between;align-items:center;background:rgba(120,18,14,.55);border-left:3px solid #a1331f;padding:18px 22px;color:#ff6a5a;font:600 24px/1 Consolas,'Courier New',monospace;letter-spacing:2px}
|
|
15
|
+
.egg-actions{display:flex;justify-content:center;margin-top:30px;border-top:1px solid rgba(255,255,255,.12);padding-top:26px}
|
|
16
|
+
#egg-retry{min-width:280px;padding:14px 26px;background:#15171a;border:1px solid rgba(255,255,255,.35);color:#e8e8e8;font-size:20px;letter-spacing:4px;cursor:pointer}
|
|
17
|
+
#egg-retry:hover{border-color:#f09a2e;color:#fff;background:#1b1d21}
|
|
18
|
+
body.egg-on #skip{display:none!important}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.VOICE_ENV={orig1:[0.0001,0.0001,0.0001,0.0001,0.0002,0.0003,0.0004,0.0006,0.0008,0.001,0.0012,0.0015,0.0018,0.002,0.0021,0.0022,0.0023,0.0025,0.0025,0.0048,0.5385,1.0,0.9163,0.9259,0.9163,0.7415,0.9511,0.7428,0.805,0.6246,0.645,0.6965,0.5494,0.6868,0.6502,0.5746,0.4833,0.4795,0.6005,0.7173,0.8058,0.9394,0.8661,0.8794,0.8136,0.9441,0.8386,0.6179,0.6251,0.5854,0.5628,0.2939,0.4537,0.1775,0.5009,0.1472,0.2068,0.1241,0.1923,0.0656,0.0515,0.0207,0.0112,0.0071,0.0032,0.003,0.0022,0.0016,0.0024,0.0953,0.1134,0.0636,0.0583,0.0314,0.0267,0.0212,0.0151,0.013,0.0088,0.0056,0.0042,0.0026,0.0019,0.0019,0.0017,0.0018,0.0018,0.0018,0.0018,0.0016,0.0018,0.0017,0.0018,0.0017,0.0018,0.0016,0.0018,0.0016,0.0017,0.0017,0.0017,0.0018,0.0018,0.0017,0.0017,0.0018,0.0019,0.0019,0.0019,0.0019,0.0019,0.0019,0.002,0.002,0.0021,0.0022,0.0022,0.0022,0.0022,0.0022,0.0022,0.002,0.0021,0.0022,0.0022,0.0021,0.002,0.002,0.002,0.002,0.0019,0.002,0.0023,0.0664,0.3828,0.5388,0.5116,0.7602,0.6213,0.8188,0.9149,1.0,0.8987,0.8231,0.999,0.9179,0.7335,0.5578,0.7158,0.9722,1.0,1.0,1.0,1.0,1.0,1.0,0.4267,0.829,0.3518,0.5086,0.3628,0.4034,0.4798,0.423,0.5168,0.685,0.8188,0.8741,0.9091,0.6935,1.0,1.0,1.0,1.0,0.9515,0.7963,1.0,1.0,0.4785,0.322,0.2839,0.2335,0.1998,0.3424,0.2739,0.3122,0.5311,0.6661,0.6474,0.724,0.8564,0.8808,0.8541,0.7603,0.7155,0.8889,0.6465,0.3069,0.3512,0.3021,0.0984,0.0373,0.1031,0.1449,0.422,0.2744,0.4003,0.4893,0.4923,0.4588,0.8566,0.8461,0.7947,1.0,0.8869,0.8695,1.0,0.8488,0.7974,1.0,0.9259,0.7126,0.6667,0.4183,0.2996,0.3673,0.1581,0.2822,0.1557,0.2168,0.2514,0.3471,0.3169,0.5505,0.5012,0.3332,0.5797,0.3684,0.3456,0.5683,0.2929,0.5973,0.5541,0.3003,0.5575,0.2384,0.3502,0.1207,0.1557,0.3329,0.3584,0.5449,0.6124,0.3016,0.583,0.1676,0.1896,0.0625,0.0327,0.0114,0.0017,0.0026,0.087,0.1903,0.1397,0.104,0.0572,0.0887,0.3688,0.5606,0.3933,0.8784,0.6974,0.6577,0.7824,0.2876,0.701,0.5407,0.2868,0.3137,0.1005,0.0493,0.0213,0.0107,0.0084,0.0049,0.0026,0.0018,0.0018,0.0055,0.1082,0.036,0.0858,0.2588,0.4609,0.2412,0.3783,0.1795,0.3216,0.2506,0.2508,0.0638,0.1214,0.0544,0.1385,0.0735,0.0304,0.0128,0.1141,0.0528,0.019,0.0225,0.0153,0.0148,0.0075,0.01,0.0028,0.0019,0.0017,0.0018,0.0016,0.0015,0.0014,0.0013,0.0012,0.0011,0.0009,0.0008,0.0006],line1:[0.0,0.0,0.0,0.0001,0.0001,0.0002,0.0002,0.0003,0.0005,0.0006,0.0008,0.001,0.0012,0.0013,0.0014,0.0016,0.0017,0.0018,0.0018,0.0019,0.002,0.0021,0.0385,0.1983,0.1942,0.1342,0.0666,0.0808,0.596,0.9443,0.8056,0.9191,0.97,0.9631,0.956,0.9053,0.8239,0.7944,0.539,0.742,0.6609,0.5075,0.2892,0.1306,0.0572,0.2154,0.057,0.0159,0.007,0.002,0.0032,0.0788,0.1498,0.1728,0.3355,0.8848,0.9738,0.7466,0.4848,0.2372,0.1074,0.0706,0.0073,0.0032,0.0986,0.2831,0.3023,0.0982,0.0973,0.7546,0.9704,1.0,1.0,1.0,1.0,1.0,0.9012,0.6827,0.606,0.7978,0.8176,0.7156,0.8376,0.9792,0.9436,0.6923,0.8797,1.0,0.8104,0.8684,0.8836,1.0,0.9269,0.6563,0.9695,0.9208,0.4631,1.0,0.9632,0.7087,0.8433,0.9102,0.6188,0.4786,0.6287,0.2864,0.512,0.2904,0.1608,0.2481,0.2149,0.152,0.2023,0.3408,0.2553,0.4031,0.6117,0.6129,0.4918,0.7453,0.6907,0.3559,0.7847,0.6673,0.3621,0.5099,0.1127,0.2328,0.0653,0.0387,0.0187,0.1793,0.2225,0.1646,0.1707,0.1583,0.123,0.1255,0.1017,0.0646,0.0816,0.2411,0.7529,0.9251,0.3384,0.9498,0.8745,0.336,0.8114,0.7035,0.5327,0.7831,0.5797,0.6426,0.6905,0.3419,0.7782,0.52,0.5551,0.2613,0.2012,0.1237,0.1819,0.1902,0.1733,0.1987,0.1688,0.1077,0.0781,0.0579,0.0563,0.048,0.0601,0.0568,0.0618,0.0318,0.2273,0.5592,0.9203,0.4043,0.9312,0.8357,0.4114,0.8165,0.4944,0.7394,0.7479,0.3527,0.72,0.2049,0.6547,0.5781,0.5336,0.6456,0.3035,0.8001,0.5779,0.6198,0.5436,0.1732,0.3334,0.1827,0.1672,0.0971,0.0515,0.0385,0.0866,0.1183,0.0535,0.1081,0.0949,0.433,0.5811,0.5069,0.9513,1.0,0.4167,1.0,1.0,0.6271,1.0,0.7607,0.8135,0.9021,0.3962,0.7145,0.425,0.5061,0.2106,0.3166,0.1622,0.1437,0.1056,0.0777,0.14,0.0382,0.0962,0.2008,0.1138,0.4532,0.2486,0.6873,0.4919,0.5186,0.5515,0.2268,0.5155,0.3724,0.3125,0.4503,0.2361,0.628,0.2496,0.137,0.1217,0.1028,0.1094,0.0862,0.1273,0.1385,0.1408,0.1678,0.1478,0.1368,0.1259,0.0975,0.0981,0.0957,0.0952,0.0972,0.0843,0.0975,0.0752,0.0647,0.0613,0.0349,0.0286,0.0278,0.0134,0.0036,0.0026,0.0021,0.0021,0.0022,0.002,0.002,0.002,0.0018,0.002,0.0019,0.002,0.0019,0.002,0.002,0.0021,0.0023,0.0023,0.0025,0.0025,0.0026,0.0026,0.0026,0.0026,0.0024,0.0023,0.0023,0.0023,0.0023,0.0023,0.0021,0.002,0.002,0.002,0.0021,0.0022,0.0023,0.0024,0.1797,0.1473,0.1007,0.0856,0.0503,0.0385,0.0396,0.0788,0.5009,0.8513,1.0,1.0,1.0,1.0,0.9238,0.8866,0.9283,1.0,1.0,0.9872,0.7759,0.9724,0.9567,0.7173,0.3347,0.3108,0.2346,0.1824,0.1408,0.1261,0.1381,0.1153,0.1405,0.1666,0.2187,0.1082,0.0279,0.0051,0.0023,0.1243,0.2101,0.6641,0.6198,1.0,1.0,0.846,0.806,0.8655,0.5233,0.7871,0.815,0.4012,0.7846,0.6153,0.7504,0.7966,0.4851,0.6395,0.3828,0.8898,0.8679,0.4014,0.8315,0.2238,0.348,0.1652,0.2387,0.115,0.1199,0.052,0.1073,0.4089,1.0,0.6124,1.0,0.8141,0.7505,0.5789,0.4636,0.5487,0.3489,0.5501,0.2811,0.4916,0.1949,0.5204,0.2039,0.4978,0.1737,0.1302,0.5011,0.1563,0.2868,0.304,0.1266,0.303,0.1323,0.0908,0.1611,0.1223,0.0752,0.1023,0.0866,0.068],line2:[0.1263,0.0923,0.1249,0.2422,0.6008,0.7646,0.701,0.7328,0.9478,1.0,1.0,0.8104,0.8673,1.0,1.0,1.0,0.9358,0.8325,0.7733,0.9881,0.9824,0.9832,0.9639,0.9254,0.861,0.6143,0.8587,0.9294,0.9398,0.9575,0.7732,0.7441,0.5963,0.9104,0.862,0.4868,0.6367,0.8074,0.5926,0.6795,0.8496,0.4813,0.6794,0.5858,0.2947,0.1864,0.1739,0.1108,0.1222,0.1329,0.1193,0.1455,0.1597,0.1651,0.213,0.2291,0.1625,0.041,0.025,0.0075,0.0061,0.0013,0.125,0.1141,0.0672,0.0345,0.5545,0.9014,0.6392,0.8574,1.0,1.0,0.8918,0.5833,0.9115,0.9565,0.8687,0.6677,0.85,0.857,0.5865,0.4431,0.6054,0.4463,0.4027,0.5825,0.5832,0.2949,0.6096,0.6752,0.2299,0.7045,0.8566,0.9233,0.6219,1.0,1.0,0.9748,0.759,1.0,1.0,0.9746,0.6626,0.8855,0.9019,0.9067,0.5295,0.6861,0.2899,0.218,0.3009,0.5341,0.4994,0.7848,0.8229,0.3552,0.8506,0.6924,0.5398,0.7988,0.467,0.7345,0.6997,0.496,0.7919,0.5148,0.725,0.7082,0.4345,0.6861,0.1651,0.426,0.1324,0.0257,0.0097,0.0743,0.0323,0.0087,0.0386,0.0451,0.0216,0.056,0.1131,0.1565,0.0881,0.1138,0.1553,0.122,0.2985,0.7066,0.766,0.8163,0.8562,0.9203,0.884,0.5249,0.8948,0.9333,0.7788,0.4926,0.8836,0.9131,0.7599,0.5529,0.7996,0.786,0.6126,0.4382,0.7523,0.7274,0.5273,0.6591,0.7992,0.6283,0.5828,0.684,0.2531,0.2596,0.1477,0.1317,0.0347,0.1289,0.2319,0.1702,0.4664,0.2683,0.6178,0.2553,0.52,0.1963,0.4993,0.1806,0.5013,0.2251,0.4434,0.2191,0.0719,0.0919,0.0642,0.0617,0.1138,0.4072,0.1638,0.4832,0.2175,0.2839,0.1041,0.263,0.0571,0.1941,0.2668,0.0561,0.2068,0.0539,0.0316,0.0405,0.0365,0.1205,0.0654,0.0528,0.041,0.029,0.0169,0.0087,0.0064,0.0045,0.0018,0.0019,0.002,0.0021,0.002,0.0019,0.002,0.0019,0.0019,0.0018,0.0019,0.0019,0.0019,0.0018,0.0018,0.0018,0.0019,0.0018,0.0019,0.0019,0.0019,0.0019,0.0019,0.0018,0.0019,0.0019,0.0019,0.0018,0.0019,0.002,0.0021,0.0019,0.0019,0.0019,0.0021,0.0754,0.1671,0.1334,0.1171,0.0641,0.0726,0.0689,0.1424,0.4369,0.7971,0.9657,0.9452,0.9034,0.9303,0.9879,0.9752,1.0,0.9786,0.8517,1.0,1.0,1.0,1.0,1.0,0.9718,0.917,0.8496,0.7501,0.5887,0.4415,0.3136,0.1523,0.1653,0.1564,0.1287,0.1182,0.1031,0.1413,0.1317,0.141,0.1328,0.154,0.1124,0.0743,0.0615,0.8615,1.0,1.0,1.0,0.8402,0.5609,0.8251,0.7251,0.3435,0.36,0.1329,0.0528,0.0123,0.0047,0.0038,0.2205,0.0741,0.101,0.5987,0.8134,0.7051,0.6626,0.9346,0.671,0.7151,0.935,0.6189,0.5622,0.6734,0.1947,0.1888,0.1739,0.1739,0.1983,0.1286,0.095,0.0752,0.0519,0.0422,0.0224,0.1691,0.3061,0.8745,0.9734,0.6531,0.7829,0.8889,0.3048,0.7588,0.8266,0.4511,0.847,0.9282,0.5453,0.8352,1.0,0.7619,0.7099,0.7905,0.8267,0.4757,0.8395,0.8251,0.4953,0.8259,0.9219,0.568,0.7746,0.7735,0.4184,0.6472,0.6225,0.5163,0.5841,0.4345,0.4798,0.187,0.311,0.2067,0.3434,0.0986,0.2568,0.0741,0.1679,0.1527,0.1168,0.1806,0.1833,0.1671,0.1629,0.1806,0.1092,0.1102,0.1087,0.091,0.1049,0.0769,0.0389],line3:[0.4739,0.5403,0.769,0.8315,0.599,0.9651,0.9666,0.9725,0.9733,1.0,0.9345,1.0,1.0,1.0,1.0,1.0,1.0,0.7181,0.2681,0.0708,0.0957,0.0977,0.0188,0.0771,0.0991,0.1502,0.1556,0.2524,0.3294,0.4055,0.53,0.7106,0.8411,0.9634,1.0,0.902,0.9512,0.7769,0.9391,0.8483,0.4816,0.2274,0.0973,0.0819,0.0201,0.0896,0.1048,0.0787,0.1214,0.1781,0.1322,0.1349,0.1362,0.1181,0.1303,0.1406,0.13,0.0677,0.0858,0.3887,0.9595,1.0,1.0,0.9682,0.7178,0.9125,0.8913,0.678,0.3252,0.3987,0.1396,0.0894,0.1237,0.1481,0.0558,0.0433,0.2128,0.5086,0.8104,0.9529,0.921,0.4364,0.862,0.9286,0.765,0.6892,1.0,0.8742,0.5666,0.7921,0.8729,0.7904,0.3739,0.6189,0.4038,0.263,0.2606,0.1816,0.1941,0.1906,0.1698,0.2015,0.477,0.2719,0.7752,0.9306,0.5303,0.8872,0.8053,0.4918,0.8294,0.813,0.524,0.7512,0.472,0.3676,0.28,0.3166,0.2558,0.2199,0.234,0.2279,0.2639,0.205,0.1499,0.1269,0.0607,0.1337,0.3387,0.6543,0.6496,0.4367,0.7446,0.463,0.5527,0.6589,0.294,0.4941,0.2343,0.1104,0.0468,0.1041,0.0676,0.2126,0.0748,0.057,0.1036,0.5637,0.3566,0.631,0.7844,0.4856,0.7394,0.7041,0.4207,0.5725,0.2726,0.1151,0.0438,0.0167,0.0164,0.1163,0.0444,0.052,0.0835,0.1091,0.0544,0.1729,0.5071,0.7668,0.4935,0.8503,0.8144,0.5027,0.6577,0.3208,0.4411,0.3264,0.0883,0.2623,0.1627,0.1823,0.2581,0.2582,0.0539,0.0206,0.004,0.0039,0.002,0.0021,0.0022,0.1181,0.0946,0.0426,0.0321,0.0217,0.0129,0.0095,0.0082,0.004,0.0026,0.0019,0.0022,0.0019,0.002,0.0018,0.0018,0.0017,0.0018,0.0018,0.0018,0.0017,0.0019,0.0018,0.0018,0.0019,0.0019,0.0019,0.0019,0.0018,0.0019,0.0019,0.0018,0.0018,0.0019,0.0019,0.0019,0.0019,0.0019,0.0018,0.0019,0.0019,0.0019,0.0019,0.0018,0.0018,0.0019,0.0019,0.0019,0.0018,0.0019,0.002,0.002,0.0021,0.0022,0.0021,0.0776,0.1456,0.2375,0.1869,0.2045,0.1856,0.2324,0.139,0.171,0.769,1.0,1.0,1.0,0.944,0.7302,0.8298,0.8431,0.8006,0.7902,0.8204,0.7793,0.7422,0.7707,0.6848,0.6543,0.608,0.4241,0.1738,0.1367,0.185,0.1305,0.1612,0.1321,0.1232,0.2006,0.1112,0.0594,0.0493,0.0391,0.04,0.0446,0.035,0.0267,0.2068,0.6649,0.9116,0.9816,0.9408,0.8655,1.0,1.0,1.0,1.0,0.9935,0.5481,0.8504,0.8796,0.8409,0.8236,0.6898,0.6118,0.7621,0.8806,0.9242,0.9126,0.6668,0.8925,0.8667,0.7497,0.6789,0.4089,0.3976,0.3793,0.0995,0.713,0.2162,0.9565,0.9614,0.6063,1.0,1.0,0.7327,1.0,0.9245,0.5899,0.6602,0.6153,0.3143,0.214,0.0627,0.0149,0.0127,0.0657,0.0616,0.0477,0.2805,0.5628,0.6504,0.35,0.5523,0.5689,0.337,0.5897,0.753,0.516,0.7774,0.8492,0.4441,0.7871,0.7036,0.4194,0.5791,0.4052,0.2962,0.2223,0.1669,0.1436,0.1145,0.0924,0.354,0.3207,0.7395,0.7074,0.4676,0.7804,0.6633,0.4726,0.6464,0.2759,0.6128,0.4952,0.3797,0.5024,0.1741,0.1675,0.1655,0.2258,0.2069,0.2009,0.2137,0.2151,0.238,0.1906,0.2306,0.0922,0.0558,0.2709,0.2021,0.3924,0.155,0.2049,0.238,0.0702,0.2354,0.1337,0.1938,0.1058,0.336,0.0509,0.033,0.2012,0.2135,0.0576,0.1946,0.0663,0.0437],orig3:[0.0021,0.0022,0.0603,0.364,0.8812,0.995,1.0,0.9241,1.0,1.0,0.9362,0.7832,1.0,0.9056,0.6994,0.4552,0.201,0.1502,0.0495,0.0198,0.0105,0.3301,0.1792,0.1288,0.6315,1.0,1.0,0.9355,0.9565,1.0,1.0,0.7752,1.0,1.0,0.629,0.4242,0.4304,0.412,0.611,0.9361,0.7838,1.0,1.0,1.0,0.9639,0.9183,0.7546,0.9608,0.9272,0.8556,0.4745,0.7574,0.6907,0.4936,0.371,0.2895,0.1378,0.0459,0.0116,0.0051,0.1051,0.1239,0.0466,0.1332,0.4026,0.2449,0.6052,0.1767,0.6103,0.2147,0.6261,0.3955,0.5212,0.5999,0.3576,0.6966,0.5544,0.4713,0.2005,0.1899,0.1112,0.1285,0.2164,0.2167,0.1453,0.1416,0.139,0.4198,0.3443,0.6316,0.3515,0.7029,0.3081,0.5654,0.2027,0.5744,0.1773,0.4819,0.1726,0.0733,0.0299,0.014,0.0213,0.0122,0.123,0.0404,0.0296,0.0149,0.008,0.0035,0.0036,0.0024,0.0021,0.0022,0.0018,0.0018,0.0018,0.0018,0.0018,0.0017,0.0015,0.0013,0.0011,0.0009,0.0007,0.0006,0.0004,0.0003,0.0002,0.0002,0.0002,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0036,0.0029,0.0024,0.0021,0.0021,0.0021,0.0021,0.0022,0.0022,0.0022,0.0021,0.0021,0.0022,0.0022,0.0022,0.0021,0.0022,0.0022,0.0023,0.0021,0.0021,0.0026,0.2013,0.223,0.6741,1.0,0.8305,1.0,1.0,1.0,1.0,0.8662,0.3611,0.3924,0.4161,0.2584,0.1811,0.1758,0.1617,0.2147,0.3945,0.3753,0.6909,0.7373,0.6675,0.2546,0.4959,0.2623,0.2253,0.1772,0.1823,0.1543,0.1456,0.1705,0.1947,0.1846,0.1619,0.1386,0.1647,0.1136,0.0656,0.4878,0.7934,0.9568,0.9365,0.9009,0.8359,0.7501,0.8254,0.8074,0.7825,0.671,0.5298,0.7286,0.7554,0.653,0.7324,0.9184,0.8069,0.6133,0.8799,0.5618,0.6534,0.8607,0.4575,0.8093,0.7226,0.6047,0.8576,0.4829,0.765,0.3774,0.3997,0.2179,0.2174,0.156,0.1278,0.039,0.0426,0.111,0.0863,0.3823,0.2456,0.4992,0.3847,0.7321,0.3773,0.7386,0.2999,0.5841,0.1466,0.572,0.216,0.4996,0.2202,0.5366,0.3295,0.3753,0.3117,0.0685,0.3998,0.1033,0.1129,0.2601,0.1754,0.0964,0.0847,0.2632,0.2163,0.0832,0.0402,0.0308,0.0327,0.0168,0.0107,0.0043,0.0036,0.0021,0.0021,0.0023,0.0017,0.002,0.0018,0.0016,0.0016,0.0014,0.0013,0.0011,0.0008,0.0006,0.0005,0.0003,0.0002,0.0002,0.0002,0.0,0.0,0.0,0.0],line4:[0.7963,0.9483,0.945,1.0,1.0,1.0,0.9102,0.8071,1.0,0.9657,0.7053,0.7008,0.8104,0.7221,0.3373,0.6507,0.6175,0.4388,0.5028,1.0,1.0,0.5878,0.9445,0.8925,0.5507,0.8882,0.7088,0.4366,0.5746,0.3293,0.5728,0.3599,0.4918,0.2787,0.241,0.303,0.1981,0.2869,0.0936,0.0561,0.0167,0.0077,0.0033,0.0021,0.0031,0.1416,0.1308,0.1062,0.0945,0.0979,0.0831,0.0637,0.0313,0.0226,0.02,0.013,0.0079,0.0113,0.0138,0.0064,0.0025,0.002,0.0018,0.0021,0.002,0.0018,0.0019,0.0018,0.0018,0.0018,0.0018,0.0019,0.0019,0.0019,0.0019,0.0019,0.0019,0.0019,0.0019,0.0018,0.0018,0.0018,0.0018,0.0019,0.0019,0.0019,0.0019,0.0018,0.0018,0.0018,0.0019,0.0019,0.0019,0.0019,0.0019,0.0019,0.0018,0.0017,0.0017,0.0017,0.0017,0.0019,0.0022,0.0452,0.7,0.8009,0.3846,0.8949,0.974,0.9989,1.0,0.8303,0.9855,1.0,1.0,1.0,0.9687,0.8541,1.0,1.0,0.4031,0.3263,0.284,0.1915,0.1647,0.1923,0.2471,0.2194,0.2413,0.5455,0.8149,0.7493,0.5823,0.9185,0.7188,0.4735,0.9284,0.4721,0.7089,0.5178,0.3101,0.188,0.1354,0.2526,0.4903,0.7178,0.7823,0.8577,0.8241,0.83,0.6909,0.9958,0.7902,0.7625,0.7943,0.5597,0.6082,0.3193,0.2453,0.1315,0.0873,0.0729,0.0678,0.0614,0.0722,0.0678,0.0594,0.0425,0.0351,0.0269,0.319,0.7534,0.3704,0.708,0.7355,0.4357,0.8525,0.4621,0.7655,0.7718,0.3273,0.7457,0.2491,0.6586,0.5069,0.4461,0.4787,0.3179,0.3139,0.2314,0.2437,0.1672,0.3019,0.1357,0.2409,0.1967,0.2087,0.275,0.1652,0.1992,0.1487,0.2134,0.111,0.218,0.2918,0.1778,0.1488,0.1183,0.1021,0.079,0.0373,0.0274,0.0205,0.0085,0.0049,0.0026,0.0022,0.0018,0.0018,0.0018,0.0017,0.0016,0.0016,0.0014,0.0012,0.0011,0.0009,0.0007,0.0005,0.0004,0.0003,0.0002,0.0002,0.0001,0.0001,0.0,0.0,0.0],reconnect:[0.0,0.0,0.0,0.0,0.0001,0.0001,0.0001,0.0002,0.0003,0.0004,0.0006,0.0008,0.001,0.0011,0.0013,0.0015,0.0017,0.0018,0.0018,0.0019,0.002,0.0019,0.1628,0.786,0.9118,0.6389,0.761,0.9917,0.844,0.5992,0.884,0.7534,0.2229,0.8145,0.809,0.2855,0.8296,0.7735,0.3111,0.6535,0.8324,0.4738,1.0,0.8488,0.5,0.8933,0.6535,0.5141,0.6004,0.2777,0.5518,0.1608,0.5725,0.4641,0.3876,0.3393,0.4634,0.092,0.3672,0.1287,0.0315,0.017,0.0423,0.044,0.0374,0.0287,0.0155,0.0053,0.0998,0.0814,0.0537,0.0464,0.0414,0.04,0.0267,0.0176,0.0114,0.0092,0.0062,0.0038,0.0028,0.0019,0.0018,0.0019,0.0018,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0018,0.0017,0.0018,0.0018,0.0018,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0017,0.0018,0.0019,0.0019,0.002,0.2126,0.687,0.7877,0.8011,0.8045,0.5129,0.9643,0.917,0.9767,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.6683,0.398,0.328,0.2244,0.156,0.1802,0.3237,0.267,0.2983,0.4717,0.7119,0.9449,1.0,1.0,1.0,1.0,1.0,0.8379,0.7897,0.9681,0.9683,0.9294,0.7306,0.301,0.072,0.1441,0.122,0.0737,0.0532,0.0402,0.0476,0.1963,0.2187,0.2203,0.3883,0.6099,0.8148,0.7401,0.9116,1.0,1.0,1.0,0.8656,0.9762,0.8408,0.4353,0.1574,0.0687,0.0221,0.0066,0.003,0.1262,0.1946,0.0989,0.1126,0.0661,0.4695,0.5228,0.7588,0.8543,0.6717,0.4512,0.898,0.8633,0.6189,0.6592,0.9324,0.7765,0.3989,0.8043,0.7607,0.3405,0.7242,0.55,0.4018,0.3683,0.2141,0.1244,0.0597,0.0366,0.0353,0.1245,0.1396,0.1703,0.129,0.133,0.2278,0.162,0.1474,0.1421,0.102,0.0557,0.4491,0.4793,0.7642,0.6825,0.4749,0.7824,0.7319,0.3117,0.7518,0.6135,0.3224,0.2608,0.1466,0.1844,0.1361,0.3683,0.2254,0.5573,0.5964,0.3358,0.5386,0.2519,0.2059,0.1541,0.0703,0.0272,0.0079,0.012,0.1842,0.2454,0.1266,0.0854,0.0382,0.115,0.3973,0.5549,0.73,0.725,0.8351,0.9555,0.4315,0.9147,0.6367,0.4022,0.2798,0.0909,0.0576,0.0243,0.0152,0.0255,0.0176,0.0115,0.0074,0.0014,0.0024,0.0862,0.0773,0.0908,0.2048,0.3103,0.3357,0.5168,0.4847,0.1898,0.525,0.2774,0.3832,0.443,0.1367,0.0888,0.1019,0.0461,0.0815,0.0603,0.1032,0.0927,0.0718,0.1076,0.0569,0.0542,0.0419,0.0168,0.0161,0.0106,0.0028,0.0024,0.0018,0.0019,0.0018,0.0017,0.0017,0.0017,0.0017,0.0018,0.0017,0.0017,0.0015,0.0013,0.0012,0.001,0.0008,0.0006,0.0005,0.0004,0.0003,0.0002,0.0001,0.0001,0.0,0.0,0.0,0.0]};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
(function(global){
|
|
2
|
+
const duration=151/60, count=20;
|
|
3
|
+
function envelope(samples,rate){const step=Math.round(rate*.008),out=[];let peak=.001;for(let s=0;s<samples.length;s+=step){let sum=0,p=0,n=Math.min(step,samples.length-s);for(let i=0;i<n;i++){let v=Math.abs(samples[s+i]);sum+=v*v;p=Math.max(p,v)}let value=Math.sqrt(sum/n)*.65+p*.35;peak=Math.max(peak,value);out.push(value)}return {values:out,step:step/rate,peak,duration:samples.length/rate}}
|
|
4
|
+
function amplitude(env,t){if(t<0||t>=env.duration)return 0;const i=t/env.step,a=Math.floor(i),f=i-a;return ((env.values[a]||0)*(1-f)+(env.values[a+1]||0)*f)/env.peak}
|
|
5
|
+
function heights(env,t,gain=1){return Array.from({length:count},(_,i)=>{const v=amplitude(env,t+(i-(count-1)/2)*.019);return 4+Math.min(340,Math.pow(Math.max(0,v*gain),.85)*340)})}
|
|
6
|
+
function arc(a,b){const r=135,cx=270,cy=525,rad=x=>x*Math.PI/180;return `M${cx+r*Math.cos(rad(a))},${cy+r*Math.sin(rad(a))}A${r},${r} 0 0 1 ${cx+r*Math.cos(rad(b))},${cy+r*Math.sin(rad(b))}`}
|
|
7
|
+
function foreground(t,h){const reveal=Math.min(1,Math.max(0,(t-.055)/.16)),e=1-Math.pow(1-reveal,3),marker=(1-e)*.07+e;return `<g fill="none" stroke="#ff9700" stroke-width="40">${[-87,33,153].map(a=>`<path d="${arc(a,a+114)}"/>`).join('')}</g><g opacity="${.7*reveal}" fill="#e8e5d9">${[[20,337],[525,337],[20,716],[525,716]].map(([x,y])=>`<rect x="${270+(x-270)*marker-10}" y="${525+(y-525)*marker-10}" width="20" height="20"/>`).join('')}</g><g opacity="${reveal}"><text x="560" y="615" font-family="'DIN Alternate','Bahnschrift','Microsoft YaHei',sans-serif" font-size="178" font-weight="700" letter-spacing="18" fill="#e8e5d9">DSH</text></g><g opacity="${reveal}" fill="#efeee5">${h.map((v,i)=>`<rect x="${1348+i*29.2}" y="${525-v/2}" width="5.5" height="${v}" rx="1.1"/>`).join('')}</g>`}
|
|
8
|
+
function svg(t,h){return `<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080"><rect width="1920" height="1080" fill="black"/>${foreground(t,h)}</svg>`}
|
|
9
|
+
global.VoiceAnimation={envelope,heights,foreground,svg,duration};
|
|
10
|
+
})(typeof window!=='undefined'?window:globalThis);
|