Upload index.html
Browse files- index.html +141 -54
index.html
CHANGED
|
@@ -1192,6 +1192,55 @@ g.o3d-hl .o3d-q{filter:brightness(1.6)}
|
|
| 1192 |
@media (prefers-reduced-motion:reduce){.o3d-fold,.o3d-fold-card{transition:none!important}}
|
| 1193 |
@media print{.o3d-fold{display:none}}
|
| 1194 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1195 |
</head>
|
| 1196 |
<body>
|
| 1197 |
<div class="app">
|
|
@@ -2978,6 +3027,7 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 2978 |
const tiltKpis=()=>kpiHost&&kpiHost.querySelectorAll('.kpi:not(.o3d-tilt)').forEach(c=>tilt(c,7));
|
| 2979 |
if(kpiHost){tiltKpis();new MutationObserver(tiltKpis).observe(kpiHost,{childList:true});}
|
| 2980 |
|
|
|
|
| 2981 |
/* ---------- 4. Agentgegevens ---------- */
|
| 2982 |
const ORDER=['data','identity','history','analysis','insight','verify','privacy','report','quality'];
|
| 2983 |
const NAME={conductor:'Conductor',data:'Data',identity:'Identity',history:'History',analysis:'Analysis',insight:'Trend',verify:'Verification',privacy:'Privacy',report:'Report',quality:'Quality'};
|
|
@@ -2991,7 +3041,7 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 2991 |
const slabs=new Map();
|
| 2992 |
const columns=[...stage.querySelectorAll('.next-agent-column')];
|
| 2993 |
columns.forEach(col=>col.classList.add('o3d-col'));
|
| 2994 |
-
ORDER.forEach(id=>{const c=card(id);if(!c)return;
|
| 2995 |
const s=document.createElement('div');s.className='o3d-slab';s.setAttribute('aria-hidden','true');
|
| 2996 |
s.style.setProperty('--accent',accent(id));
|
| 2997 |
s.innerHTML='<i class="f l"></i><i class="f r"></i><i class="f t"></i><i class="f b"></i>';
|
|
@@ -3004,8 +3054,9 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3004 |
for(const [id,s] of slabs){const t=getComputedStyle(card(id)).transform;s.style.transform=t==='none'?'':t;}
|
| 3005 |
if(now<slabUntil)slabRaf=requestAnimationFrame(slabTick);}
|
| 3006 |
function kickSlabs(ms=700){slabUntil=Math.max(slabUntil,performance.now()+ms);if(!slabRaf)slabRaf=requestAnimationFrame(slabTick);}
|
| 3007 |
-
stage.querySelectorAll('.next-agent-card').forEach(c=>tilt(c,5,()=>kickSlabs(600)));
|
| 3008 |
|
|
|
|
| 3009 |
/* ---------- 5b. 3D-modellen per agent (CSS 3D, geen afbeeldingen) ---------- */
|
| 3010 |
const M=(()=>{
|
| 3011 |
const div=(cls)=>{const d=document.createElement('i');d.className=cls;return d;};
|
|
@@ -3014,6 +3065,8 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3014 |
function group(tr){const g=div('m3g');if(tr)g.style.transform=tr;return g;}
|
| 3015 |
function box(w,h,d,tr,o={}){
|
| 3016 |
const g=group(tr),k=o.k??1,c=o.c;
|
|
|
|
|
|
|
| 3017 |
const col=p=>c?`color-mix(in srgb,${c} ${Math.round(p)}%,#08131f)`:shade(p*k);
|
| 3018 |
g.append(face(w,h,`translateZ(${d/2}px)`,o.front||col(78)),face(w,h,`rotateY(180deg) translateZ(${d/2}px)`,col(48)),
|
| 3019 |
face(d,h,`rotateY(90deg) translateZ(${w/2}px)`,col(62)),face(d,h,`rotateY(-90deg) translateZ(${w/2}px)`,col(55)),
|
|
@@ -3042,16 +3095,16 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3042 |
}
|
| 3043 |
function ring(R,n,seg,thick,tr,o={}){
|
| 3044 |
const g=group(tr);
|
| 3045 |
-
for(let i=0;i<n;i++){const a=i*360/n;g.append(box(2*R*Math.sin(Math.PI/n)+.8,thick,thick,`rotateZ(${a}deg) translateY(${-R}px)`,o));}
|
| 3046 |
return g;
|
| 3047 |
}
|
| 3048 |
const builders={
|
| 3049 |
-
data:()=>{const g=group();[-10,0,10].forEach((y,i)=>{g.append(prism(
|
| 3050 |
-
if(i<2)g.append(prism(
|
| 3051 |
g.classList.add('m-glowbands');return g;},
|
| 3052 |
-
identity:()=>{const g=group();g.append(ring(8,
|
| 3053 |
-
history:()=>{const g=group();g.append(prism(
|
| 3054 |
-
for(let i=0;i<12;i+
|
| 3055 |
const hands=group('translateZ(3.2px)');const hh=div('m-hand hour');const mh=div('m-hand min');
|
| 3056 |
hh.append(box(2,7,1,'translateY(-3.5px)',{c:'#ffffff'}));mh.append(box(1.4,10,1,'translateY(-5px)',{c:'#ffffff'}));
|
| 3057 |
hands.append(hh,mh);g.append(hands);return g;},
|
|
@@ -3059,22 +3112,22 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3059 |
[[ -10,10],[0,17],[10,24]].forEach(([x,h],i)=>{const bar=div('m-bar');bar.style.setProperty('--d',i*.25+'s');
|
| 3060 |
bar.append(box(7,h,7,`translate3d(${x}px,${10.5-h/2}px,0)`,{k:1.05}));g.append(bar);});return g;},
|
| 3061 |
insight:()=>{const g=group();g.append(pyramid(15,14,false,'translateY(0px)'),pyramid(15,14,true,'translateY(0px)'));
|
| 3062 |
-
g.append(ring(15,
|
| 3063 |
verify:()=>{const g=group('rotateX(-8deg)');g.append(prism(6,14,9,'',{top:'radial-gradient(circle,#08131f 0 26%,color-mix(in srgb,var(--accent) 92%,#fff) 29% 100%)'}));
|
| 3064 |
-
g.append(prism(
|
| 3065 |
privacy:()=>{const g=group();g.append(pyramid(13,15,false,''),pyramid(13,15,true,''));
|
| 3066 |
-
g.append(ring(13,
|
| 3067 |
report:()=>{const g=group('rotateY(-10deg)');
|
| 3068 |
[[-5,-3,-5],[0,0,0],[5,3,5]].forEach(([x,y,z],i)=>g.append(box(22,28,1.2,`translate3d(${x}px,${y}px,${z}px)`,
|
| 3069 |
{front:i===2?'repeating-linear-gradient(180deg,#f4f8ff 0 3px,#f4f8ff 3px,color-mix(in srgb,var(--accent) 55%,#f4f8ff) 3px 4.4px,#f4f8ff 4.4px 6.5px)':'#dfe7f3',top:'#f4f8ff',k:.8})));
|
| 3070 |
return g;},
|
| 3071 |
-
quality:()=>{const g=group('rotateX(90deg)');g.append(prism(
|
| 3072 |
-
for(let i=0;i<
|
| 3073 |
-
g.append(prism(
|
| 3074 |
};
|
| 3075 |
return builders;
|
| 3076 |
})();
|
| 3077 |
-
ORDER.forEach(id=>{const c=card(id);if(!c||!M[id])return;
|
| 3078 |
const icon=c.querySelector('.next-agent-icon');if(!icon)return;
|
| 3079 |
icon.classList.add('o3d-bay');
|
| 3080 |
const m=document.createElement('div');m.className='o3d-m m-'+id;m.setAttribute('aria-hidden','true');
|
|
@@ -3085,15 +3138,16 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3085 |
rot.append(mini,mdl);
|
| 3086 |
const sh=document.createElement('div');sh.className='o3d-m-shadow';
|
| 3087 |
m.append(sh,rot);icon.appendChild(m);
|
|
|
|
| 3088 |
});
|
| 3089 |
|
| 3090 |
// reflectie van de onderste kaart per kolom
|
| 3091 |
const reflections=[];
|
| 3092 |
-
columns.forEach(col=>{
|
| 3093 |
const cards=[...col.querySelectorAll(':scope > .agent')];const last=cards.at(-1);if(!last)return;
|
| 3094 |
const box=document.createElement('div');box.className='o3d-reflect';box.setAttribute('aria-hidden','true');col.appendChild(box);
|
| 3095 |
const item={col,last,box,t:0};reflections.push(item);
|
| 3096 |
-
new MutationObserver(()=>{clearTimeout(item.t);item.t=setTimeout(()=>refreshReflection(item),
|
| 3097 |
});
|
| 3098 |
function refreshReflection(item){
|
| 3099 |
const {last,box}=item;
|
|
@@ -3103,9 +3157,13 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3103 |
clone.classList.remove('o3d-tilt','o3d-hover','o3d-receive','o3d-warn-recv','completed-pulse');
|
| 3104 |
clone.querySelectorAll('[aria-live]').forEach(n=>n.removeAttribute('aria-live'));
|
| 3105 |
clone.style.height=last.offsetHeight+'px';
|
|
|
|
| 3106 |
box.replaceChildren(clone);
|
| 3107 |
}
|
| 3108 |
-
|
|
|
|
|
|
|
|
|
|
| 3109 |
|
| 3110 |
/* ---------- 6. Communicatielagen ---------- */
|
| 3111 |
const host=stage.querySelector('.network-links')||stage;
|
|
@@ -3124,9 +3182,12 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3124 |
[['0%','#ffffff'],['28%',color],['70%',color],['100%','#0a1424']].forEach(([o,c],i)=>g.appendChild(mk('stop',{offset:o,'stop-color':c,'stop-opacity':i===3?'.9':'1'})));
|
| 3125 |
(where||defs).appendChild(g);gradCache.set(k,'url(#'+id+')');return gradCache.get(k);
|
| 3126 |
}
|
| 3127 |
-
const
|
| 3128 |
-
|
| 3129 |
-
|
|
|
|
|
|
|
|
|
|
| 3130 |
|
| 3131 |
const routes=new Map(),sockets=new Map(),portPos=new Map();
|
| 3132 |
const state={active:new Set(),done:new Set(),ctx:new Set(),pending:new Set(),warn:new Set(),lastDone:null,agent:new Map(),inbound:new Map(),outbound:new Map(),warnFrom:new Map()};
|
|
@@ -3147,43 +3208,62 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3147 |
}
|
| 3148 |
function port(cards,id,frac){const c=cards[id];const p={x:c.inX,y:c.r.top+c.r.height*frac};portPos.set(id+'|'+frac,p);return p;}
|
| 3149 |
function pathFor(cards,from,to){
|
|
|
|
| 3150 |
if(from==='conductor'){
|
| 3151 |
const p2=port(cards,to,.5),ang=Math.atan2(p2.y-conductorC.y,p2.x-conductorC.x);
|
| 3152 |
const p1={x:conductorC.x+Math.cos(ang)*conductorC.r,y:conductorC.y+Math.sin(ang)*conductorC.r};
|
| 3153 |
const s=cards[to].left?-1:1,bend=Math.max(26,Math.abs(p2.x-p1.x)*.5);
|
| 3154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3155 |
}
|
| 3156 |
-
|
| 3157 |
-
|
| 3158 |
-
|
| 3159 |
-
|
| 3160 |
-
|
| 3161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3162 |
function build(){
|
| 3163 |
layoutAll();
|
| 3164 |
const cards=geometry();if(!cards)return;
|
| 3165 |
-
for(const s of [low,top])s.setAttribute('viewBox',`0 0 ${W} ${H}`);
|
| 3166 |
-
|
| 3167 |
-
const ordered=[...ROUTES].sort((x,y)=>(x[0]==='conductor')-(y[0]==='conductor'));
|
|
|
|
|
|
|
|
|
|
| 3168 |
for(const [from,to] of ordered){
|
| 3169 |
-
|
| 3170 |
-
const
|
| 3171 |
const g=mk('g',{},'o3d-route '+(from==='conductor'?'spoke':'link'));
|
| 3172 |
g.style.setProperty('--c',accent(from==='conductor'?to:from));
|
| 3173 |
const parts={};for(const cls of ['sh','body','groove','flow','hl']){parts[cls]=mk('path',{d},cls);g.appendChild(parts[cls]);}
|
| 3174 |
routeLayer.appendChild(g);
|
| 3175 |
const hit=mk('path',{d},'o3d-hit');hit.dataset.key=key;hitLayer.appendChild(hit);
|
| 3176 |
-
|
| 3177 |
-
routes.set(key,{g,hit,path:parts.groove,len,from,to});
|
| 3178 |
-
}
|
| 3179 |
-
for(const [k,p] of portPos){
|
| 3180 |
-
const id=k.split('|')[0],g=mk('g',{transform:`translate(${p.x} ${p.y})`},'o3d-socket');
|
| 3181 |
-
g.style.setProperty('--c',accent(id));
|
| 3182 |
-
g.append(mk('circle',{r:6.4},'ring'),mk('circle',{r:3.6},'hole'),mk('circle',{r:2.2},'led'));
|
| 3183 |
-
socketLayer.appendChild(g);
|
| 3184 |
-
if(!sockets.has(id))sockets.set(id,[]);sockets.get(id).push({g,frac:+k.split('|')[1],p});
|
| 3185 |
}
|
| 3186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3187 |
}
|
| 3188 |
function paint(){
|
| 3189 |
for(const [key,r] of routes){
|
|
@@ -3224,14 +3304,16 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3224 |
const r=routes.get(key);if(!r||!r.len){resolve();return;}
|
| 3225 |
const color=opt.color,pkt=packet(color,opt.size||1,opt.ack),label=opt.label?tag(color,opt.label[0],opt.label[1]):null;
|
| 3226 |
let hit=null;
|
| 3227 |
-
if(opt.rec){hit=mk('circle',{r:14},'o3d-pkt-hit');hit.addEventListener('click',e=>{e.stopPropagation();openInspector(opt.rec,e);});
|
| 3228 |
const dur=motionOn()?(opt.dur||(fast()?420:1250)):1;
|
| 3229 |
flights.push({r,reverse,pkt,label,hit,start:performance.now()+(opt.delay||0),dur,resolve,opt});
|
| 3230 |
loop();
|
| 3231 |
});
|
| 3232 |
}
|
|
|
|
|
|
|
| 3233 |
function place(f,t){
|
| 3234 |
-
const L=f.r.len,u=f.reverse?1-t:t,p=f.r
|
| 3235 |
const ang=Math.atan2(q.y-p.y,q.x-p.x)*180/Math.PI;
|
| 3236 |
f.pkt.setAttribute('transform',`translate(${p.x.toFixed(1)} ${p.y.toFixed(1)}) rotate(${ang.toFixed(1)})`);
|
| 3237 |
f.pos={x:p.x,y:p.y};
|
|
@@ -3241,10 +3323,15 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3241 |
f.label.setAttribute('transform',`translate(${x.toFixed(1)} ${y.toFixed(1)})`);}
|
| 3242 |
return p;
|
| 3243 |
}
|
| 3244 |
-
let raf=0;
|
|
|
|
| 3245 |
function loop(){if(!raf)raf=requestAnimationFrame(tick);}
|
|
|
|
| 3246 |
function tick(now){
|
| 3247 |
-
raf=0;
|
|
|
|
|
|
|
|
|
|
| 3248 |
for(let i=flights.length-1;i>=0;i--){
|
| 3249 |
const f=flights[i];if(now<f.start){f.pkt.setAttribute('opacity','0');continue;}
|
| 3250 |
const t=Math.min(1,(now-f.start)/f.dur),p=place(f,ease(t));
|
|
@@ -3258,7 +3345,7 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3258 |
for(const a of ambient){
|
| 3259 |
if(!ambOn){a.g.setAttribute('opacity','0');continue;}
|
| 3260 |
const ph=((now/(4200+a.i*370)+a.i*.19)%1),r=a.r;
|
| 3261 |
-
const pt=
|
| 3262 |
a.g.setAttribute('transform',`translate(${pt.x.toFixed(1)} ${pt.y.toFixed(1)})`);
|
| 3263 |
a.g.setAttribute('opacity',String((Math.min(1,ph*8,(1-ph)*8)*(running()?.25:.6)).toFixed(2)));
|
| 3264 |
}
|
|
@@ -3295,7 +3382,7 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3295 |
}
|
| 3296 |
function dispatchFromQueue(id){
|
| 3297 |
const q=queue.find(x=>x.id===id&&!x.leaving);if(!q)return 0;
|
| 3298 |
-
const r=routes.get('conductor>'+id);const to=r&&r.len?
|
| 3299 |
q.leaving=true;q.from=q.pos||{x:conductorC.x,y:conductorC.y};q.to=to;q.t0=performance.now();
|
| 3300 |
if(q.layer!==queueFront){queueFront.appendChild(q.g);q.layer=queueFront;}
|
| 3301 |
updateQueueLabel();loop();return motionOn()?(fast()?160:380):0;
|
|
@@ -3563,14 +3650,14 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3563 |
|
| 3564 |
|
| 3565 |
/* ---------- 13b. Uitlegmodus: tags met lijntjes ---------- */
|
| 3566 |
-
const explainLayer=mk('g',{},'o3d-explain');top.
|
| 3567 |
let explainOn=false;
|
| 3568 |
const exBtn=document.createElement('button');exBtn.type='button';exBtn.className='next-motion-button o3d-explain-btn';
|
| 3569 |
exBtn.setAttribute('aria-pressed','false');exBtn.textContent='ⓘ Toon uitleg';
|
| 3570 |
const motionBtn=$id('nextMotionToggle');motionBtn?motionBtn.before(exBtn):stage.querySelector('.next-network-actions')?.appendChild(exBtn);
|
| 3571 |
exBtn.addEventListener('click',()=>{explainOn=!explainOn;stage.classList.toggle('o3d-explaining',explainOn);
|
| 3572 |
exBtn.setAttribute('aria-pressed',String(explainOn));exBtn.textContent=explainOn?'ⓘ Verberg uitleg':'ⓘ Toon uitleg';renderExplain(true);});
|
| 3573 |
-
function routePt(key,frac){const r=routes.get(key);if(!r||!r.len)return null;
|
| 3574 |
function highlight(target,on){
|
| 3575 |
if(!target)return;
|
| 3576 |
if(target.startsWith('route:')){const r=routes.get(target.slice(6));r&&r.g.classList.toggle('o3d-hl',on);}
|
|
@@ -3703,7 +3790,7 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3703 |
xvLines.innerHTML=d+dots.join('');
|
| 3704 |
xvRaf=requestAnimationFrame(xvTick);
|
| 3705 |
}
|
| 3706 |
-
ORDER.forEach(id=>{const bay=card(id)?.querySelector('.o3d-bay');if(!bay)return;
|
| 3707 |
bay.setAttribute('role','button');bay.tabIndex=0;bay.title='Klik om de lagen van deze agent open te klappen';bay.setAttribute('aria-label','Lagen van '+NAME[id]+' Agent openklappen');bay.setAttribute('aria-expanded','false');
|
| 3708 |
bay.addEventListener('click',e=>{e.stopPropagation();toggleFold(id);});
|
| 3709 |
bay.addEventListener('keydown',e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();toggleFold(id);}});
|
|
@@ -3721,7 +3808,7 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3721 |
{key:'out',title:'UITVOER',glyph:'⇡',tint:'var(--accent)'}
|
| 3722 |
];
|
| 3723 |
const folds=new Map();
|
| 3724 |
-
ORDER.forEach(id=>{const c=card(id);if(!c)return;
|
| 3725 |
const f=document.createElement('div');f.className='o3d-fold';f.style.setProperty('--accent',accent(id));f.setAttribute('aria-hidden','true');
|
| 3726 |
const inner=document.createElement('div');inner.className='o3d-fold-inner';
|
| 3727 |
FOLD.forEach((L,i)=>{const p=document.createElement('section');p.className='o3d-fold-card';p.style.setProperty('--i',i);p.style.setProperty('--tint',L.tint);p.dataset.layer=L.key;
|
|
@@ -3747,7 +3834,7 @@ requestAnimationFrame(nextBuildGraph);
|
|
| 3747 |
f.classList.toggle('open',open);f.setAttribute('aria-hidden',String(!open));
|
| 3748 |
card(id).classList.toggle('o3d-folded-open',open);
|
| 3749 |
card(id).querySelector('.o3d-bay')?.setAttribute('aria-expanded',String(open));
|
| 3750 |
-
|
| 3751 |
}
|
| 3752 |
new MutationObserver(()=>{folds.forEach((f,id)=>{if(f.classList.contains('open'))fillFold(id);});})
|
| 3753 |
.observe(stage.querySelector('.next-network-layout'),{subtree:true,attributes:true,attributeFilter:['class']});
|
|
|
|
| 1192 |
@media (prefers-reduced-motion:reduce){.o3d-fold,.o3d-fold-card{transition:none!important}}
|
| 1193 |
@media print{.o3d-fold{display:none}}
|
| 1194 |
</style>
|
| 1195 |
+
<style id="orchestra-3d-perf">
|
| 1196 |
+
/* ---------- Prestaties: geen dure filters op bewegende lagen ---------- */
|
| 1197 |
+
.next-orchestra #networkSvg{display:none!important}
|
| 1198 |
+
.o3d-route .sh{filter:none!important;opacity:.4}
|
| 1199 |
+
.o3d-route.on .groove,.o3d-route.pending .groove,.o3d-route.warn .groove,.o3d-route.o3d-hl .groove{filter:none!important}
|
| 1200 |
+
.o3d-route.on .body,.o3d-route.pending .body{stroke:color-mix(in srgb,var(--c) 28%,#1a3150)}
|
| 1201 |
+
.o3d-route.warn .body{stroke:#4a2f1e}
|
| 1202 |
+
.o3d-pkt .glow{filter:none!important;opacity:.3}
|
| 1203 |
+
.o3d-tag rect,.o3d-socket .ring,.o3d-ex-label rect:first-child,.o3d-ex-label .sw,.o3d-socket.on .led,.o3d-socket.hl .led{filter:none!important}
|
| 1204 |
+
.m3f{box-shadow:none!important}
|
| 1205 |
+
.o3d-m-shadow{filter:none!important}
|
| 1206 |
+
/* modellen draaien alleen als de agent actief is of onder de muis */
|
| 1207 |
+
.o3d-m-rot{animation:none!important;transform:rotateX(-20deg) rotateY(-32deg) scale(.95)}
|
| 1208 |
+
.next-orchestra .agent.active .o3d-m-rot,.next-orchestra .agent:hover .o3d-m-rot{animation:o3dMSpin 4s linear infinite!important}
|
| 1209 |
+
.m-hand{animation-play-state:paused!important}
|
| 1210 |
+
.next-orchestra .agent.active .m-hand{animation-play-state:running!important}
|
| 1211 |
+
.o3d-reflect .o3d-m,.o3d-reflect .o3d-glare{display:none!important}
|
| 1212 |
+
.o3d-reflect{filter:none!important}
|
| 1213 |
+
/* buiten beeld: alles stil */
|
| 1214 |
+
.o3d-off *,.o3d-off *::before,.o3d-off *::after{animation-play-state:paused!important}
|
| 1215 |
+
/* automatische lichte modus bij een trage browser */
|
| 1216 |
+
.o3d-lite .o3d-floor,.o3d-lite .o3d-route .flow,.o3d-lite .o3d-base::before{animation:none!important}
|
| 1217 |
+
.o3d-lite .o3d-reflect,.o3d-lite .o3d-glare,.o3d-lite .o3d-m-shadow{display:none!important}
|
| 1218 |
+
.o3d-lite .o3d-ring.r4,.o3d-lite .o3d-core{animation:none!important}
|
| 1219 |
+
.o3d-lite .next-agent-column .agent .agent-symbol{animation:none!important}
|
| 1220 |
+
.o3d-lite .o3d-xv{backdrop-filter:none}
|
| 1221 |
+
.o3d-move{will-change:transform;contain:strict}
|
| 1222 |
+
.o3d-top.o3d-move{z-index:5}
|
| 1223 |
+
/* lopende streepjes alleen in actieve buizen */
|
| 1224 |
+
.o3d-route .flow{animation:none!important}
|
| 1225 |
+
.o3d-route.on .flow,.o3d-route.pending .flow,.o3d-route.warn .flow{animation:o3dFlow .9s linear infinite!important}
|
| 1226 |
+
.o3d-lite .o3d-route.on .flow,.o3d-lite .o3d-route.pending .flow{animation:none!important}
|
| 1227 |
+
|
| 1228 |
+
/* stilstaande modellen als afbeelding; het echte 3D-model alleen bij actief of onder de muis */
|
| 1229 |
+
.o3d-snap{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;object-fit:contain}
|
| 1230 |
+
.o3d-bay.has-snap .o3d-m{display:none}
|
| 1231 |
+
.next-orchestra .agent.active .o3d-bay.has-snap .o3d-m,.next-orchestra .agent:hover .o3d-bay.has-snap .o3d-m{display:block}
|
| 1232 |
+
.next-orchestra .agent.active .o3d-bay .o3d-snap,.next-orchestra .agent:hover .o3d-bay .o3d-snap{display:none}
|
| 1233 |
+
|
| 1234 |
+
/* agenten weer plat: geen vleugels, geen extra ruimte voor reflecties */
|
| 1235 |
+
.next-agent-column-left,.next-agent-column-right{transform:none!important}
|
| 1236 |
+
.next-network-layout{perspective:none!important;padding-bottom:9px!important}
|
| 1237 |
+
.next-network-layout::after{display:none}
|
| 1238 |
+
|
| 1239 |
+
/* gyroscoopringen: metaallook met randkleuren in plaats van een zwaar masker */
|
| 1240 |
+
.o3d-ring{background:none!important;-webkit-mask:none!important;mask:none!important;filter:none!important;
|
| 1241 |
+
border-style:solid!important;border-color:#e3ecfa #6b7d9c #2f3d57 #a9b9d4!important}
|
| 1242 |
+
.o3d-ring.r4{border-color:rgba(170,190,240,.5)!important}
|
| 1243 |
+
</style>
|
| 1244 |
</head>
|
| 1245 |
<body>
|
| 1246 |
<div class="app">
|
|
|
|
| 3027 |
const tiltKpis=()=>kpiHost&&kpiHost.querySelectorAll('.kpi:not(.o3d-tilt)').forEach(c=>tilt(c,7));
|
| 3028 |
if(kpiHost){tiltKpis();new MutationObserver(tiltKpis).observe(kpiHost,{childList:true});}
|
| 3029 |
|
| 3030 |
+
const AGENT3D=false; // 3D en uitklappen in de agentkaarten uitgeschakeld voor een vloeiende weergave
|
| 3031 |
/* ---------- 4. Agentgegevens ---------- */
|
| 3032 |
const ORDER=['data','identity','history','analysis','insight','verify','privacy','report','quality'];
|
| 3033 |
const NAME={conductor:'Conductor',data:'Data',identity:'Identity',history:'History',analysis:'Analysis',insight:'Trend',verify:'Verification',privacy:'Privacy',report:'Report',quality:'Quality'};
|
|
|
|
| 3041 |
const slabs=new Map();
|
| 3042 |
const columns=[...stage.querySelectorAll('.next-agent-column')];
|
| 3043 |
columns.forEach(col=>col.classList.add('o3d-col'));
|
| 3044 |
+
if(AGENT3D)ORDER.forEach(id=>{const c=card(id);if(!c)return;
|
| 3045 |
const s=document.createElement('div');s.className='o3d-slab';s.setAttribute('aria-hidden','true');
|
| 3046 |
s.style.setProperty('--accent',accent(id));
|
| 3047 |
s.innerHTML='<i class="f l"></i><i class="f r"></i><i class="f t"></i><i class="f b"></i>';
|
|
|
|
| 3054 |
for(const [id,s] of slabs){const t=getComputedStyle(card(id)).transform;s.style.transform=t==='none'?'':t;}
|
| 3055 |
if(now<slabUntil)slabRaf=requestAnimationFrame(slabTick);}
|
| 3056 |
function kickSlabs(ms=700){slabUntil=Math.max(slabUntil,performance.now()+ms);if(!slabRaf)slabRaf=requestAnimationFrame(slabTick);}
|
| 3057 |
+
if(AGENT3D)stage.querySelectorAll('.next-agent-card').forEach(c=>tilt(c,5,()=>kickSlabs(600)));
|
| 3058 |
|
| 3059 |
+
const SNAPS={};
|
| 3060 |
/* ---------- 5b. 3D-modellen per agent (CSS 3D, geen afbeeldingen) ---------- */
|
| 3061 |
const M=(()=>{
|
| 3062 |
const div=(cls)=>{const d=document.createElement('i');d.className=cls;return d;};
|
|
|
|
| 3065 |
function group(tr){const g=div('m3g');if(tr)g.style.transform=tr;return g;}
|
| 3066 |
function box(w,h,d,tr,o={}){
|
| 3067 |
const g=group(tr),k=o.k??1,c=o.c;
|
| 3068 |
+
if(o.lite){const col=p=>c?`color-mix(in srgb,${c} ${Math.round(p)}%,#08131f)`:shade(p*k);
|
| 3069 |
+
g.append(face(w,h,`translateZ(${d/2}px)`,col(78)),face(w,d,`rotateX(90deg) translateZ(${h/2}px)`,col(96),'top'),face(d,h,`rotateY(90deg) translateZ(${w/2}px)`,col(60)));return g;}
|
| 3070 |
const col=p=>c?`color-mix(in srgb,${c} ${Math.round(p)}%,#08131f)`:shade(p*k);
|
| 3071 |
g.append(face(w,h,`translateZ(${d/2}px)`,o.front||col(78)),face(w,h,`rotateY(180deg) translateZ(${d/2}px)`,col(48)),
|
| 3072 |
face(d,h,`rotateY(90deg) translateZ(${w/2}px)`,col(62)),face(d,h,`rotateY(-90deg) translateZ(${w/2}px)`,col(55)),
|
|
|
|
| 3095 |
}
|
| 3096 |
function ring(R,n,seg,thick,tr,o={}){
|
| 3097 |
const g=group(tr);
|
| 3098 |
+
for(let i=0;i<n;i++){const a=i*360/n;g.append(box(2*R*Math.sin(Math.PI/n)+.8,thick,thick,`rotateZ(${a}deg) translateY(${-R}px)`,Object.assign({lite:true},o)));}
|
| 3099 |
return g;
|
| 3100 |
}
|
| 3101 |
const builders={
|
| 3102 |
+
data:()=>{const g=group();[-10,0,10].forEach((y,i)=>{g.append(prism(10,12,6,`translateY(${y}px)`));
|
| 3103 |
+
if(i<2)g.append(prism(10,10.5,2,`translateY(${y+5}px)`,{sideBg:()=>'color-mix(in srgb,var(--accent) 70%,#fff)',top:'color-mix(in srgb,var(--accent) 60%,#fff)'}));});
|
| 3104 |
g.classList.add('m-glowbands');return g;},
|
| 3105 |
+
identity:()=>{const g=group();g.append(ring(8,8,0,3,'translateX(-5px)'),ring(8,8,0,3,'translateX(5px) rotateY(90deg)',{k:.85}));return g;},
|
| 3106 |
+
history:()=>{const g=group();g.append(prism(12,13,4,'rotateX(90deg)'));
|
| 3107 |
+
for(let i=0;i<12;i+=3)g.append(box(1.4,i%3?2.4:4,1,`translateZ(2.6px) rotateZ(${i*30}deg) translateY(-10px)`,{c:'#e8f2ff'}));
|
| 3108 |
const hands=group('translateZ(3.2px)');const hh=div('m-hand hour');const mh=div('m-hand min');
|
| 3109 |
hh.append(box(2,7,1,'translateY(-3.5px)',{c:'#ffffff'}));mh.append(box(1.4,10,1,'translateY(-5px)',{c:'#ffffff'}));
|
| 3110 |
hands.append(hh,mh);g.append(hands);return g;},
|
|
|
|
| 3112 |
[[ -10,10],[0,17],[10,24]].forEach(([x,h],i)=>{const bar=div('m-bar');bar.style.setProperty('--d',i*.25+'s');
|
| 3113 |
bar.append(box(7,h,7,`translate3d(${x}px,${10.5-h/2}px,0)`,{k:1.05}));g.append(bar);});return g;},
|
| 3114 |
insight:()=>{const g=group();g.append(pyramid(15,14,false,'translateY(0px)'),pyramid(15,14,true,'translateY(0px)'));
|
| 3115 |
+
g.append(ring(15,10,0,1.6,'rotateX(72deg)',{c:'#cfe8ff'}));return g;},
|
| 3116 |
verify:()=>{const g=group('rotateX(-8deg)');g.append(prism(6,14,9,'',{top:'radial-gradient(circle,#08131f 0 26%,color-mix(in srgb,var(--accent) 92%,#fff) 29% 100%)'}));
|
| 3117 |
+
g.append(prism(8,5,10.5,'',{sideBg:l=>`color-mix(in srgb,var(--accent) ${Math.round(20+20*l)}%,#050b14)`,top:'#050b14'}));return g;},
|
| 3118 |
privacy:()=>{const g=group();g.append(pyramid(13,15,false,''),pyramid(13,15,true,''));
|
| 3119 |
+
g.append(ring(13,10,0,1.8,'rotateY(90deg) rotateX(8deg)',{c:'#ffd6ea'}));return g;},
|
| 3120 |
report:()=>{const g=group('rotateY(-10deg)');
|
| 3121 |
[[-5,-3,-5],[0,0,0],[5,3,5]].forEach(([x,y,z],i)=>g.append(box(22,28,1.2,`translate3d(${x}px,${y}px,${z}px)`,
|
| 3122 |
{front:i===2?'repeating-linear-gradient(180deg,#f4f8ff 0 3px,#f4f8ff 3px,color-mix(in srgb,var(--accent) 55%,#f4f8ff) 3px 4.4px,#f4f8ff 4.4px 6.5px)':'#dfe7f3',top:'#f4f8ff',k:.8})));
|
| 3123 |
return g;},
|
| 3124 |
+
quality:()=>{const g=group('rotateX(90deg)');g.append(prism(10,11,6,''));
|
| 3125 |
+
for(let i=0;i<8;i++)g.append(box(4,6,4.5,`rotateY(${i*45}deg) translateZ(12.5px)`,{lite:true}));
|
| 3126 |
+
g.append(prism(6,3.6,7,'',{sideBg:()=>'#0a1626',top:'#050b14'}));return g;}
|
| 3127 |
};
|
| 3128 |
return builders;
|
| 3129 |
})();
|
| 3130 |
+
if(AGENT3D)ORDER.forEach(id=>{const c=card(id);if(!c||!M[id])return;
|
| 3131 |
const icon=c.querySelector('.next-agent-icon');if(!icon)return;
|
| 3132 |
icon.classList.add('o3d-bay');
|
| 3133 |
const m=document.createElement('div');m.className='o3d-m m-'+id;m.setAttribute('aria-hidden','true');
|
|
|
|
| 3138 |
rot.append(mini,mdl);
|
| 3139 |
const sh=document.createElement('div');sh.className='o3d-m-shadow';
|
| 3140 |
m.append(sh,rot);icon.appendChild(m);
|
| 3141 |
+
if(SNAPS[id]){const im=document.createElement('img');im.className='o3d-snap';im.alt='';im.decoding='async';im.src=SNAPS[id];icon.appendChild(im);icon.classList.add('has-snap');}
|
| 3142 |
});
|
| 3143 |
|
| 3144 |
// reflectie van de onderste kaart per kolom
|
| 3145 |
const reflections=[];
|
| 3146 |
+
if(AGENT3D)columns.forEach(col=>{
|
| 3147 |
const cards=[...col.querySelectorAll(':scope > .agent')];const last=cards.at(-1);if(!last)return;
|
| 3148 |
const box=document.createElement('div');box.className='o3d-reflect';box.setAttribute('aria-hidden','true');col.appendChild(box);
|
| 3149 |
const item={col,last,box,t:0};reflections.push(item);
|
| 3150 |
+
new MutationObserver(()=>{clearTimeout(item.t);item.t=setTimeout(()=>refreshReflection(item),450);}).observe(last,{subtree:true,childList:true,attributes:true,attributeFilter:['class']});
|
| 3151 |
});
|
| 3152 |
function refreshReflection(item){
|
| 3153 |
const {last,box}=item;
|
|
|
|
| 3157 |
clone.classList.remove('o3d-tilt','o3d-hover','o3d-receive','o3d-warn-recv','completed-pulse');
|
| 3158 |
clone.querySelectorAll('[aria-live]').forEach(n=>n.removeAttribute('aria-live'));
|
| 3159 |
clone.style.height=last.offsetHeight+'px';
|
| 3160 |
+
clone.querySelectorAll('.o3d-m,.o3d-glare,.o3d-flash').forEach(n=>n.remove());
|
| 3161 |
box.replaceChildren(clone);
|
| 3162 |
}
|
| 3163 |
+
function positionReflection(item){const {last,box}=item;const nx=last.nextElementSibling,below=nx&&nx.classList&&nx.classList.contains('o3d-fold')&&nx.classList.contains('open')?nx:last;
|
| 3164 |
+
box.style.left=last.offsetLeft+'px';box.style.width=last.offsetWidth+'px';box.style.top=(below.offsetTop+below.offsetHeight+5)+'px';box.style.opacity=below===last?'':'0';
|
| 3165 |
+
if(!box.firstChild)refreshReflection(item);}
|
| 3166 |
+
const layoutAll=()=>{placeSlabs();reflections.forEach(positionReflection);kickSlabs(80);};
|
| 3167 |
|
| 3168 |
/* ---------- 6. Communicatielagen ---------- */
|
| 3169 |
const host=stage.querySelector('.network-links')||stage;
|
|
|
|
| 3182 |
[['0%','#ffffff'],['28%',color],['70%',color],['100%','#0a1424']].forEach(([o,c],i)=>g.appendChild(mk('stop',{offset:o,'stop-color':c,'stop-opacity':i===3?'.9':'1'})));
|
| 3183 |
(where||defs).appendChild(g);gradCache.set(k,'url(#'+id+')');return gradCache.get(k);
|
| 3184 |
}
|
| 3185 |
+
const lowBack=mk('svg',{preserveAspectRatio:'none','aria-hidden':'true'},'o3d-low o3d-move');const lowMove=mk('svg',{preserveAspectRatio:'none','aria-hidden':'true'},'o3d-low o3d-move');
|
| 3186 |
+
host.insertBefore(lowBack,low);host.appendChild(lowMove);
|
| 3187 |
+
const topMove=mk('svg',{preserveAspectRatio:'none','aria-hidden':'true'},'o3d-top o3d-move');stage.appendChild(topMove);
|
| 3188 |
+
const queueBack=mk('g');const routeLayer=mk('g');const pktLayer=mk('g');lowBack.append(queueBack);low.append(routeLayer);lowMove.append(pktLayer);
|
| 3189 |
+
const socketLayer=mk('g');const queueFront=mk('g');const fxLayer=mk('g');const hitLayer=mk('g');const tagLayer=mk('g');const pktHitLayer=mk('g');
|
| 3190 |
+
top.append(socketLayer,hitLayer);topMove.append(queueFront,fxLayer,tagLayer,pktHitLayer);
|
| 3191 |
|
| 3192 |
const routes=new Map(),sockets=new Map(),portPos=new Map();
|
| 3193 |
const state={active:new Set(),done:new Set(),ctx:new Set(),pending:new Set(),warn:new Set(),lastDone:null,agent:new Map(),inbound:new Map(),outbound:new Map(),warnFrom:new Map()};
|
|
|
|
| 3208 |
}
|
| 3209 |
function port(cards,id,frac){const c=cards[id];const p={x:c.inX,y:c.r.top+c.r.height*frac};portPos.set(id+'|'+frac,p);return p;}
|
| 3210 |
function pathFor(cards,from,to){
|
| 3211 |
+
let P;
|
| 3212 |
if(from==='conductor'){
|
| 3213 |
const p2=port(cards,to,.5),ang=Math.atan2(p2.y-conductorC.y,p2.x-conductorC.x);
|
| 3214 |
const p1={x:conductorC.x+Math.cos(ang)*conductorC.r,y:conductorC.y+Math.sin(ang)*conductorC.r};
|
| 3215 |
const s=cards[to].left?-1:1,bend=Math.max(26,Math.abs(p2.x-p1.x)*.5);
|
| 3216 |
+
P=[p1,{x:p1.x+Math.cos(ang)*bend*.6,y:p1.y+Math.sin(ang)*bend*.6},{x:p2.x-s*bend,y:p2.y},p2];
|
| 3217 |
+
}else{
|
| 3218 |
+
const A=cards[from],B=cards[to],pa=port(cards,from,.78),pb=port(cards,to,.22);
|
| 3219 |
+
if(A.left===B.left){const bulge=A.inward*(30+Math.abs(pb.y-pa.y)*.16);P=[pa,{x:pa.x+bulge,y:pa.y},{x:pb.x+bulge,y:pb.y},pb];}
|
| 3220 |
+
else{const dx=Math.abs(pb.x-pa.x);P=[pa,{x:pa.x+A.inward*dx*.42,y:pa.y},{x:pb.x+B.inward*dx*.42,y:pb.y},pb];}
|
| 3221 |
}
|
| 3222 |
+
return P;
|
| 3223 |
+
}
|
| 3224 |
+
const dOf=P=>`M ${P[0].x.toFixed(1)} ${P[0].y.toFixed(1)} C ${P[1].x.toFixed(1)} ${P[1].y.toFixed(1)}, ${P[2].x.toFixed(1)} ${P[2].y.toFixed(1)}, ${P[3].x.toFixed(1)} ${P[3].y.toFixed(1)}`;
|
| 3225 |
+
function sampleBezier(P,N){
|
| 3226 |
+
// gelijkmatig over de lengte: eerst fijn bemonsteren, dan herverdelen
|
| 3227 |
+
const M=N*3,raw=[],acc=[0];
|
| 3228 |
+
for(let i=0;i<=M;i++){const t=i/M,u=1-t,a=u*u*u,b=3*u*u*t,c=3*u*t*t,d=t*t*t;
|
| 3229 |
+
raw.push(a*P[0].x+b*P[1].x+c*P[2].x+d*P[3].x,a*P[0].y+b*P[1].y+c*P[2].y+d*P[3].y);
|
| 3230 |
+
if(i)acc.push(acc[i-1]+Math.hypot(raw[i*2]-raw[i*2-2],raw[i*2+1]-raw[i*2-1]));}
|
| 3231 |
+
const L=acc[M],out=[];let j=0;
|
| 3232 |
+
for(let i=0;i<=N;i++){const target=L*i/N;while(j<M-1&&acc[j+1]<target)j++;
|
| 3233 |
+
const seg=acc[j+1]-acc[j]||1,k=(target-acc[j])/seg;out.push(raw[j*2]+(raw[j*2+2]-raw[j*2])*k,raw[j*2+1]+(raw[j*2+3]-raw[j*2+1])*k);}
|
| 3234 |
+
return {L,out};
|
| 3235 |
+
}
|
| 3236 |
+
let builtKeys='';
|
| 3237 |
function build(){
|
| 3238 |
layoutAll();
|
| 3239 |
const cards=geometry();if(!cards)return;
|
| 3240 |
+
for(const s of [low,top,lowBack,lowMove,topMove])s.setAttribute('viewBox',`0 0 ${W} ${H}`);
|
| 3241 |
+
portPos.clear();
|
| 3242 |
+
const ordered=[...ROUTES].sort((x,y)=>(x[0]==='conductor')-(y[0]==='conductor')).filter(([f,t])=>(f==='conductor'||cards[f])&&cards[t]);
|
| 3243 |
+
const keys=ordered.map(r=>r.join('>')).join(',');
|
| 3244 |
+
const light=keys===builtKeys&&routes.size;
|
| 3245 |
+
if(!light){routeLayer.replaceChildren();hitLayer.replaceChildren();routes.clear();}
|
| 3246 |
for(const [from,to] of ordered){
|
| 3247 |
+
const key=from+'>'+to,P=pathFor(cards,from,to),d=dOf(P),{L,out}=sampleBezier(P,80);
|
| 3248 |
+
if(light){const r=routes.get(key);r.g.querySelectorAll('path').forEach(p=>p.setAttribute('d',d));r.hit.setAttribute('d',d);r.len=L;r.samples=out;continue;}
|
| 3249 |
const g=mk('g',{},'o3d-route '+(from==='conductor'?'spoke':'link'));
|
| 3250 |
g.style.setProperty('--c',accent(from==='conductor'?to:from));
|
| 3251 |
const parts={};for(const cls of ['sh','body','groove','flow','hl']){parts[cls]=mk('path',{d},cls);g.appendChild(parts[cls]);}
|
| 3252 |
routeLayer.appendChild(g);
|
| 3253 |
const hit=mk('path',{d},'o3d-hit');hit.dataset.key=key;hitLayer.appendChild(hit);
|
| 3254 |
+
routes.set(key,{g,hit,path:parts.groove,len:L,from,to,samples:out,N:80});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3255 |
}
|
| 3256 |
+
builtKeys=keys;
|
| 3257 |
+
if(light&&sockets.size){for(const [id,list] of sockets)list.forEach(s=>{const p=portPos.get(id+'|'+s.frac);if(p){s.p=p;s.g.setAttribute('transform',`translate(${p.x.toFixed(1)} ${p.y.toFixed(1)})`);}});}
|
| 3258 |
+
else{socketLayer.replaceChildren();sockets.clear();
|
| 3259 |
+
for(const [k,p] of portPos){
|
| 3260 |
+
const id=k.split('|')[0],g=mk('g',{transform:`translate(${p.x} ${p.y})`},'o3d-socket');
|
| 3261 |
+
g.style.setProperty('--c',accent(id));
|
| 3262 |
+
g.append(mk('circle',{r:6.4},'ring'),mk('circle',{r:3.6},'hole'),mk('circle',{r:2.2},'led'));
|
| 3263 |
+
socketLayer.appendChild(g);
|
| 3264 |
+
if(!sockets.has(id))sockets.set(id,[]);sockets.get(id).push({g,frac:+k.split('|')[1],p});
|
| 3265 |
+
}}
|
| 3266 |
+
buildRail();paint();if(!light)buildAmbient();if(explainOn)renderExplain(false);
|
| 3267 |
}
|
| 3268 |
function paint(){
|
| 3269 |
for(const [key,r] of routes){
|
|
|
|
| 3304 |
const r=routes.get(key);if(!r||!r.len){resolve();return;}
|
| 3305 |
const color=opt.color,pkt=packet(color,opt.size||1,opt.ack),label=opt.label?tag(color,opt.label[0],opt.label[1]):null;
|
| 3306 |
let hit=null;
|
| 3307 |
+
if(opt.rec){hit=mk('circle',{r:14},'o3d-pkt-hit');hit.addEventListener('click',e=>{e.stopPropagation();openInspector(opt.rec,e);});pktHitLayer.appendChild(hit);}
|
| 3308 |
const dur=motionOn()?(opt.dur||(fast()?420:1250)):1;
|
| 3309 |
flights.push({r,reverse,pkt,label,hit,start:performance.now()+(opt.delay||0),dur,resolve,opt});
|
| 3310 |
loop();
|
| 3311 |
});
|
| 3312 |
}
|
| 3313 |
+
function at(r,u){u=Math.max(0,Math.min(1,u));const s=r.samples;if(!s||!s.length)return {x:0,y:0};const fi=u*r.N,i=Math.min(r.N-1,Math.floor(fi)),k=fi-i;
|
| 3314 |
+
return {x:s[i*2]+(s[i*2+2]-s[i*2])*k,y:s[i*2+1]+(s[i*2+3]-s[i*2+1])*k};}
|
| 3315 |
function place(f,t){
|
| 3316 |
+
const L=f.r.len,u=f.reverse?1-t:t,p=at(f.r,u),q=at(f.r,u+(f.reverse?-1:1)*2/Math.max(L,1));
|
| 3317 |
const ang=Math.atan2(q.y-p.y,q.x-p.x)*180/Math.PI;
|
| 3318 |
f.pkt.setAttribute('transform',`translate(${p.x.toFixed(1)} ${p.y.toFixed(1)}) rotate(${ang.toFixed(1)})`);
|
| 3319 |
f.pos={x:p.x,y:p.y};
|
|
|
|
| 3323 |
f.label.setAttribute('transform',`translate(${x.toFixed(1)} ${y.toFixed(1)})`);}
|
| 3324 |
return p;
|
| 3325 |
}
|
| 3326 |
+
let raf=0,offscreen=false;
|
| 3327 |
+
if('IntersectionObserver' in window)new IntersectionObserver(es=>{es.forEach(e=>{offscreen=!e.isIntersecting;stage.classList.toggle('o3d-off',offscreen);lastT=0;if(!offscreen)loop();});}).observe(stage);
|
| 3328 |
function loop(){if(!raf)raf=requestAnimationFrame(tick);}
|
| 3329 |
+
let lastT=0,slowFrames=0,frames=0;
|
| 3330 |
function tick(now){
|
| 3331 |
+
raf=0;if(offscreen){return;}
|
| 3332 |
+
if(lastT){const dt=now-lastT;frames++;if(dt>34&&dt<400)slowFrames++;
|
| 3333 |
+
if(frames>=120){if(slowFrames>45&&!stage.classList.contains('o3d-lite')){stage.classList.add('o3d-lite');}frames=0;slowFrames=0;}}
|
| 3334 |
+
lastT=now;
|
| 3335 |
for(let i=flights.length-1;i>=0;i--){
|
| 3336 |
const f=flights[i];if(now<f.start){f.pkt.setAttribute('opacity','0');continue;}
|
| 3337 |
const t=Math.min(1,(now-f.start)/f.dur),p=place(f,ease(t));
|
|
|
|
| 3345 |
for(const a of ambient){
|
| 3346 |
if(!ambOn){a.g.setAttribute('opacity','0');continue;}
|
| 3347 |
const ph=((now/(4200+a.i*370)+a.i*.19)%1),r=a.r;
|
| 3348 |
+
const pt=at(r,ph);
|
| 3349 |
a.g.setAttribute('transform',`translate(${pt.x.toFixed(1)} ${pt.y.toFixed(1)})`);
|
| 3350 |
a.g.setAttribute('opacity',String((Math.min(1,ph*8,(1-ph)*8)*(running()?.25:.6)).toFixed(2)));
|
| 3351 |
}
|
|
|
|
| 3382 |
}
|
| 3383 |
function dispatchFromQueue(id){
|
| 3384 |
const q=queue.find(x=>x.id===id&&!x.leaving);if(!q)return 0;
|
| 3385 |
+
const r=routes.get('conductor>'+id);const to=r&&r.len?at(r,0):{x:conductorC.x,y:conductorC.y};
|
| 3386 |
q.leaving=true;q.from=q.pos||{x:conductorC.x,y:conductorC.y};q.to=to;q.t0=performance.now();
|
| 3387 |
if(q.layer!==queueFront){queueFront.appendChild(q.g);q.layer=queueFront;}
|
| 3388 |
updateQueueLabel();loop();return motionOn()?(fast()?160:380):0;
|
|
|
|
| 3650 |
|
| 3651 |
|
| 3652 |
/* ---------- 13b. Uitlegmodus: tags met lijntjes ---------- */
|
| 3653 |
+
const explainLayer=mk('g',{},'o3d-explain');top.appendChild(explainLayer);
|
| 3654 |
let explainOn=false;
|
| 3655 |
const exBtn=document.createElement('button');exBtn.type='button';exBtn.className='next-motion-button o3d-explain-btn';
|
| 3656 |
exBtn.setAttribute('aria-pressed','false');exBtn.textContent='ⓘ Toon uitleg';
|
| 3657 |
const motionBtn=$id('nextMotionToggle');motionBtn?motionBtn.before(exBtn):stage.querySelector('.next-network-actions')?.appendChild(exBtn);
|
| 3658 |
exBtn.addEventListener('click',()=>{explainOn=!explainOn;stage.classList.toggle('o3d-explaining',explainOn);
|
| 3659 |
exBtn.setAttribute('aria-pressed',String(explainOn));exBtn.textContent=explainOn?'ⓘ Verberg uitleg':'ⓘ Toon uitleg';renderExplain(true);});
|
| 3660 |
+
function routePt(key,frac){const r=routes.get(key);if(!r||!r.len)return null;return at(r,frac);}
|
| 3661 |
function highlight(target,on){
|
| 3662 |
if(!target)return;
|
| 3663 |
if(target.startsWith('route:')){const r=routes.get(target.slice(6));r&&r.g.classList.toggle('o3d-hl',on);}
|
|
|
|
| 3790 |
xvLines.innerHTML=d+dots.join('');
|
| 3791 |
xvRaf=requestAnimationFrame(xvTick);
|
| 3792 |
}
|
| 3793 |
+
if(AGENT3D)ORDER.forEach(id=>{const bay=card(id)?.querySelector('.o3d-bay');if(!bay)return;
|
| 3794 |
bay.setAttribute('role','button');bay.tabIndex=0;bay.title='Klik om de lagen van deze agent open te klappen';bay.setAttribute('aria-label','Lagen van '+NAME[id]+' Agent openklappen');bay.setAttribute('aria-expanded','false');
|
| 3795 |
bay.addEventListener('click',e=>{e.stopPropagation();toggleFold(id);});
|
| 3796 |
bay.addEventListener('keydown',e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();toggleFold(id);}});
|
|
|
|
| 3808 |
{key:'out',title:'UITVOER',glyph:'⇡',tint:'var(--accent)'}
|
| 3809 |
];
|
| 3810 |
const folds=new Map();
|
| 3811 |
+
if(AGENT3D)ORDER.forEach(id=>{const c=card(id);if(!c)return;
|
| 3812 |
const f=document.createElement('div');f.className='o3d-fold';f.style.setProperty('--accent',accent(id));f.setAttribute('aria-hidden','true');
|
| 3813 |
const inner=document.createElement('div');inner.className='o3d-fold-inner';
|
| 3814 |
FOLD.forEach((L,i)=>{const p=document.createElement('section');p.className='o3d-fold-card';p.style.setProperty('--i',i);p.style.setProperty('--tint',L.tint);p.dataset.layer=L.key;
|
|
|
|
| 3834 |
f.classList.toggle('open',open);f.setAttribute('aria-hidden',String(!open));
|
| 3835 |
card(id).classList.toggle('o3d-folded-open',open);
|
| 3836 |
card(id).querySelector('.o3d-bay')?.setAttribute('aria-expanded',String(open));
|
| 3837 |
+
setTimeout(schedule,320);setTimeout(schedule,720);
|
| 3838 |
}
|
| 3839 |
new MutationObserver(()=>{folds.forEach((f,id)=>{if(f.classList.contains('open'))fillFold(id);});})
|
| 3840 |
.observe(stage.querySelector('.next-network-layout'),{subtree:true,attributes:true,attributeFilter:['class']});
|