Repository navigation
Expand file tree
/
Copy pathreport.js
More file actions
187 lines (187 loc) · 24.4 KB
/
Copy pathreport.js
File metadata and controls
187 lines (187 loc) · 24.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
'use strict';
const data = window.BLACKWALL_REPORT;
const el = id => document.getElementById(id);
const svg = name => { const s=document.createElementNS('http://www.w3.org/2000/svg','svg'); const u=document.createElementNS('http://www.w3.org/2000/svg','use'); s.classList.add('icon'); s.setAttribute('aria-hidden','true'); u.setAttribute('href','icons.svg#'+name); s.append(u); return s; };
const time = n => '+' + String(n).padStart(9,'0') + ' µs';
const checkpoints = data.report_kind === 'generic-probe' ? ['main-reset'] : data.report_kind === 'frame-experiment' ? (data.scenario === 'stimulus-driven-boot-reset' ? ['boot-reset','main-reset'] : ['main-reset']) : ['boot-reset','boot-main','boot-manager','stock-handoff','main-reset','ui-dispatch','renderer-entry'];
const reached = new Set(data.points.map(p=>p.name));
const done = checkpoints.filter(x=>reached.has(x)).length;
const expectedStop = data.scenario === 'unknown-boot-marker';
const summary = data.report_kind === 'generic-probe' ? data.status_label : data.report_kind === 'frame-experiment' ? (data.passed ? 'Frame captured' : 'Frame not verified') : data.boundary === 'host-error' ? 'Execution failed' : expectedStop ? (data.passed ? 'Expected rejection' : 'Rejection validation failed') : (data.passed ? 'Verified' : 'Validation failed');
el('report-status').textContent = summary;
el('report-status').title = 'Scenario assessment; not hardware certification';
const ranges = document.querySelector('input[type=range]');
const timeAvailable = data.time_available !== false;
ranges.min=0; ranges.max=String(Math.max(data.virtual_us,1)); ranges.value=ranges.max;
ranges.disabled=!timeAvailable; el('play').disabled=!timeAvailable;
const image=document.querySelector('.guest');
image.alt=data.report_kind==='generic-probe' && data.first_frame ? 'First detailed guest framebuffer captured by the emulator' : 'Final guest framebuffer captured by the emulator';
let enhanced = Boolean(data.enhanced);
let activeFrame = null;
const frames = data.frames || [];
function showFrameMode() {
const src = activeFrame ? (enhanced ? activeFrame.enhanced : activeFrame.raw) : (enhanced ? 'screen-enhanced.png' : 'screen.png');
if (image.getAttribute('src') !== src) image.src = src;
if (data.report_kind==='generic-probe') image.alt=enhanced ? 'Contrast-adjusted A8 buffer preview' : (data.first_frame ? 'First detailed raw A8 buffer' : 'Final raw A8 buffer');
el('frame-mode').textContent = enhanced ? 'View raw' : 'View adjusted';
el('frame-mode').title = enhanced ? 'Showing contrast-adjusted A8 preview' : 'Showing raw A8 buffer';
}
if (data.screen) {el('frame-controls').hidden=false; el('frame-mode').hidden=!data.enhanced; showFrameMode();}
el('frame-mode').>
if (!data.screen) { image.hidden=true; const note=document.createElement('p'); note.className='empty-frame'; note.textContent='NO DISPLAY DATA'; image.after(note); }
const frameEventText = data.report_kind==='generic-probe' && data.first_frame ? '[RUN END] First detailed framebuffer displayed; capture time unknown' : ['frame-experiment','generic-probe'].includes(data.report_kind) ? '[FRAME] Final framebuffer captured; first draw time unknown' : '[FRAME] 576 × 288 guest framebuffer';
const events = [
...(data.device_events || []).map(p=>({us:p.time_us,text:p.text})),
...(data.firmware_events || []).map(p=>({us:p.time_us,text:`[UART1 / LINE END] ${p.text}`})),
...(data.uart_tx || []).map(p=>({us:p.time_us,text:`[UART0 TX / CAPTURE] ${p.data}`})),
...data.points.filter(p=>Number.isInteger(p.time_us)).map(p=>({us:p.time_us,text:`[BOOT] ${p.name} · PC 0x${p.pc.toString(16)}`})),
...frames.map((f,i)=>({us:f.time_us,text:`[FRAME] ${i+1}/${frames.length} · 576 × 288`})),
...(data.timed || []).map(p=>({us:p.time_us,text:p.text})),
...data.replies.map(p=>({us:p.time_us, text:`[${p.direction}] ${p.channel} ${p.data}`})),
...(data.screen ? (timeAvailable ? [{us:data.virtual_us,text:frameEventText}] : []) : ['frame-experiment','generic-probe'].includes(data.report_kind) ? (data.time_available ? [{us:data.virtual_us,text:'[RUN END] Observation ended; failure time unknown'}] : []) : [{us:data.virtual_us,text:'[STOP] '+(data.boundary==='host-error'?'Host execution failed':expectedStop?'Unknown boot marker · strict boundary':(data.failure || 'Capture ended'))}])
].sort((a,b)=>a.us-b.us);
const formatEvents = () => [...events.filter(e=>e.us<=Number(ranges.value)).map(e=>`${time(e.us)} ${e.text}`), ...(data.screen && !timeAvailable ? [frameEventText+' · time unavailable'] : [])].join('\n');
function update(){
const current=Number(ranges.value);
el('clock').textContent=timeAvailable ? (current/1e6).toFixed(3)+' / '+(data.virtual_us/1e6).toFixed(3)+' s' : 'Time unavailable';
el('events').textContent=formatEvents();
updateStages(current);
const logBody=document.querySelector('.log-body');
logBody.scrollTop=logBody.scrollHeight;
const openLog=panel.querySelector('pre[data-timeline-log]');
if(openLog){openLog.textContent=formatEvents();openLog.scrollTop=openLog.scrollHeight;}
if(data.screen){
activeFrame=frames.filter(f=>f.time_us<=current).at(-1) || null;
const ready=!timeAvailable || (frames.length ? Boolean(activeFrame) : current>=data.virtual_us);
image.style.visibility=ready?'visible':'hidden';el('frame-wait').hidden=ready;el('frame-controls').hidden=!ready;
if(ready) showFrameMode();
}
}
ranges.>
let timer; el('play'). if(Number(ranges.value)>=data.virtual_us)ranges.value=0; el('play').replaceChildren(svg('pause')); timer=setInterval(()=>{ranges.value=Math.min(data.virtual_us,Number(ranges.value)+100000);update();if(Number(ranges.value)>=data.virtual_us){clearInterval(timer);timer=null;el('play').replaceChildren(svg('play'));}},100);};
const panels={Emulator:['simulator'],Firmware:['chip'],Tools:['tools'],Logs:['logs'],'Touch compare':['timeline']};
const panel=el('panel');
function formatIdentityValue(key,value){
if((key==='shared_static_inspection'||key==='reference_comparison')&&typeof value==='string'){
try{value=JSON.parse(value);}catch(_error){}
}
return value!==null&&typeof value==='object' ? '\n'+JSON.stringify(value,null,2) : String(value);
}
function show(name){el('section').textContent=name; for(const b of el('tabs').children)b.setAttribute('aria-pressed',b.dataset.name===name); panel.replaceChildren();panel.hidden=name==='Emulator';if(panel.hidden)return;if(name==='Touch compare'){renderTouchComparison();return;}const h=document.createElement('h2');h.textContent=name;const pre=document.createElement('pre');if(name==='Firmware')pre.textContent=(data.identity_title || 'Pinned stock 2.4 boot / main')+'\n'+Object.entries(data.identity).map(([k,v])=>`${k}: ${formatIdentityValue(k,v)}`).join('\n');else if(name==='Tools')pre.textContent=`${summary}\nScenario: ${data.scenario}\nBoundary: ${data.boundary}\nObserved checkpoints: ${done}/${checkpoints.length}\n\nCapture coverage:\n${(data.trace_quality || []).map(x=>JSON.stringify(x)).join('\n') || 'No timestamped UART capture'}\n\nUntimed packets:\n${(data.untimed_packets || []).join('\n') || 'None'}\n\n${data.limitations.join('\n')}`;else {pre.dataset.timelineLog='true';pre.textContent=formatEvents();}panel.append(h,pre);if(name==='Logs')pre.scrollTop=pre.scrollHeight;}
function renderTouchComparison(){
const comparison=data.touch_comparison||{};
const heading=document.createElement('h2');heading.textContent='Virtual tou
8000
ch frame comparison';panel.append(heading);
const note=document.createElement('p');note.textContent=comparison.note||'Virtual input acceptance is not proof of firmware handling. Time co-occurrence does not establish causation.';panel.append(note);
const manualOptions=data.manual_frames||[];const hasFrameChoices=manualOptions.length>=2||comparison.available;
let enhancedView=false;
if(hasFrameChoices){const label=document.createElement('label');label.className='contrast-toggle';const toggle=document.createElement('input');toggle.type='checkbox';label.append(toggle,document.createTextNode(' Enhanced preview · same normalization across observed frames; counts and masks use raw values'));panel.append(label);toggle.>
const frameImage=(imageNode,frame)=>{imageNode.dataset.rawSrc=frame.image;imageNode.dataset.enhancedSrc=frame.enhanced||frame.image;imageNode.src=enhancedView?imageNode.dataset.enhancedSrc:imageNode.dataset.rawSrc;};
if(comparison.accepted&&Number.isSafeInteger(comparison.tick)){
const event=document.createElement('p');event.textContent=`${comparison.event_label||'Virtual touch'} accepted at raw tick ${comparison.tick}.`;panel.append(event);
if(comparison.available){
const grid=document.createElement('div');grid.className='touch-frames';
for(const [label,frame] of [['Before',comparison.before],['After',comparison.after]]){const figure=document.createElement('figure');const imageNode=document.createElement('img');frameImage(imageNode,frame);imageNode.alt=`${label} virtual display frame`;const caption=document.createElement('figcaption');caption.textContent=`${label}: raw tick ${frame.ticks}, sequence ${frame.sequence}`;figure.append(imageNode,caption);grid.append(figure);}
const diff=document.createElement('figure');const diffImage=document.createElement('img');diffImage.src='touch-difference.png';diffImage.alt='Changed pixels in white';const diffCaption=document.createElement('figcaption');diffCaption.textContent=`Difference mask · ${comparison.different_pixels} raw changed pixels`;diff.append(diffImage,diffCaption);grid.append(diff);
if(comparison.final){const last=document.createElement('figure');const lastImage=document.createElement('img');frameImage(lastImage,comparison.final);lastImage.alt='Final virtual display frame';const lastCaption=document.createElement('figcaption');lastCaption.textContent=`Final: raw tick ${comparison.final.ticks}`;last.append(lastImage,lastCaption);grid.append(last);const finalDiff=document.createElement('figure');const finalImage=document.createElement('img');finalImage.src='touch-final-difference.png';finalImage.alt='Changed pixels at end of observation in white';const finalCaption=document.createElement('figcaption');finalCaption.textContent=`Final difference mask · ${comparison.final_different_pixels} raw changed pixels`;finalDiff.append(finalImage,finalCaption);grid.append(finalDiff);}
panel.append(grid);if(Number.isInteger(comparison.control_different_pixels)){const control=document.createElement('p');control.textContent=`No-input control: ${comparison.control_different_pixels} raw changed pixels over its observation window.`;panel.append(control);}
}else{
const missing=document.createElement('p');missing.textContent=`Automatic input-aligned comparison unavailable: ${comparison.before?'no strictly later frame was recorded':'no strictly earlier frame was recorded'} (frames at the same tick are excluded). Use the manual two-frame comparison below; it does not establish input impact.`;panel.append(missing);
}
}else{const missing=document.createElement('p');missing.textContent='No verified accepted-touch tick is available for automatic alignment. Use the manual two-frame comparison below.';panel.append(missing);}
const manual=document.createElement('section');manual.className='manual-touch';const title=document.createElement('h3');title.textContent='Manual two-frame comparison';manual.append(title);
const options=manualOptions;
if(options.length>=2){
const warning=document.createElement('p');warning.textContent='Select two of the first three verified recorded frames. Pairwise pixel differences were prepared with the report so this works from a local file. The difference mask and changed-pixel count use raw frame values. The comparison does not establish event ordering, firmware handling, or causation.';manual.append(warning);
const selectors=[];
for(const label of ['Frame A','Frame B']){const row=document.createElement('label');row.textContent=label;const select=document.createElement('select');for(const frame of options){const option=document.createElement('option');option.value=String(frame.sequence);option.textContent=`Sequence ${frame.sequence} · raw tick ${frame.ticks}`;select.append(option);}row.append(select);manual.append(row);selectors.push(select);}
selectors[1].selectedIndex=1;
const button=document.createElement('button');button.type='button';button.textContent='Compare selected frames';manual.append(button);const output=document.createElement('p');output.setAttribute('aria-live','polite');manual.append(output);const views=document.createElement('div');views.className='touch-frames';manual.append(views);
button. first=Number(selectors[0].value),second=Number(selectors[1].value);if(first===second){output.textContent='Choose two different recorded frames.';return;}const a=options.find(f=>f.sequence===first),b=options.find(f=>f.sequence===second);const pair=(data.manual_comparisons||[]).find(p=>p.first_sequence===Math.min(first,second)&&p.second_sequence===Math.max(first,second));if(!pair){output.textContent='This frame pair is unavailable.';return;}output.textContent=`${pair.different_pixels} of 165,888 raw pixels changed · A raw tick ${a.ticks}, sequence ${a.sequence} · B raw tick ${b.ticks}, sequence ${b.sequence}. Manual comparison only; no input-impact claim.`;for(const [label,frame] of [['Frame A',a],['Frame B',b]]){const figure=document.createElement('figure');const imageNode=document.createElement('img');frameImage(imageNode,frame);imageNode.alt=label;const caption=document.createElement('figcaption');caption.textContent=`${label} · raw tick ${frame.ticks}, sequence ${frame.sequence}`;figure.append(imageNode,caption);views.append(figure);}const figure=document.createElement('figure');const imageNode=document.createElement('img');imageNode.src=pair.difference_image;imageNode.alt='Difference mask, white marks changed pixels';const caption=document.createElement('figcaption');caption.textContent='Raw difference mask · white marks changed pixels';figure.append(imageNode,caption);views.append(figure);};
}else{
const warning=document.createElement('p');warning.textContent='Fewer than two verified frames are available in this report. Choose two raw 576 × 288 (165,888-byte) grayscale framebuffer files. This visual comparison does not establish event ordering, firmware handling, or causation.';manual.append(warning);
const fields=[];for(const label of ['Frame A','Frame B']){const row=document.createElement('label');row.textContent=label+' raw frame (.bin)';const input=document.createElement('input');input.type='file';input.accept='.bin,application/octet-stream';row.append(input);const ticks=document.createElement('input');ticks.type='number';ticks.min='0';ticks.step='1';ticks.placeholder='Recorded raw tick (optional)';ticks.setAttribute('aria-label',label+' recorded raw tick');row.append(ticks);manual.append(row);fields.push({input,ticks});}
const button=document.createElement('button');button.type='button';button.textContent='Compare frames';manual.append(button);const output=document.createElement('p');output.setAttribute('aria-live','polite');manual.append(output);const views=document.createElement('div');views.className='touch-frames';manual.append(views);button. arrays=await Promise.all(fields.map(async f=>{if(!f.input.files[0])throw Error('Select both raw frame files.');const b=new Uint8Array(await f.input.files[0].arrayBuffer());if(b.length!==576*288)throw Error('Each frame must contain exactly 165,888 bytes.');return b;}));let changed=0;for(let i=0;i<arrays[0].length;i++)if(arrays[0][i]!==arrays[1][i])changed++;output.textContent=`${changed} of 165,888 pixels changed. Tick labels: ${fields.map(f=>f.ticks.value||'unprovided').join(' and ')}. Manual comparison only; no input-impact claim.`;const mask=new Uint8Array(arrays[0].length);for(let i=0;i<mask.length;i++)mask[i]=arrays[0][i]===arrays[1][i]?0:255;for(const [name,bytes] of [['Frame A',arrays[0]],['Frame B',arrays[1]],['Difference (white = changed)',mask]]){const figure=document.createElement('figure');const canvas=document.createElement('canvas');canvas.width=576;canvas.height=288;canvas.setAttribute('aria-label',name);const context=canvas.getContext('2d');const rgba=context.createImageData(576,288);for(let i=0;i<bytes.length;i++){rgba.data[i*4]=bytes[i];rgba.data[i*4+1]=bytes[i];rgba.data[i*4+2]=bytes[i];rgba.data[i*4+3]=255;}context.putImageData(rgba,0,0);const caption=document.createElement('figcaption');caption.textContent=name;figure.append(canvas,caption);views.append(figure);}}catch(error){output.textContent=error.message;}};
}
panel.append(manual);
}
for(const [name,[icon]] of Object.entries(panels)){const b=document.createElement('button');b.dataset.name=name;b.append(svg(icon),name);b.>
const stagesList=el('stages-list');
const pointTime=name=>data.points.find(p=>p.name===name && Number.isInteger(p.time_us))?.time_us;
const timedEvent=prefix=>(data.timed||[]).find(p=>p.text.startsWith(prefix))?.time_us;
const firmwareTime=part=>(data.firmware_events||[]).find(p=>p.text.includes(part))?.time_us;
const stages=data.stages || [
{name:'Reset vector entry',at:pointTime('boot-reset'),soc:true},
{name:'Runtime initialization entry',at:pointTime('boot-crt'),soc:true},
{name:'FPU initialization entry',at:pointTime('boot-fpu'),soc:true},
{name:'C data initialization entry',at:pointTime('boot-c-init'),soc:true},
{name:'Bootloader main entry',at:pointTime('boot-main'),soc:true},
{name:'Board initialization entry',at:pointTime('boot-board-init'),soc:true},
{name:'NOR interface initialized (log)',at:firmwareTime('Nor flash mSPI interface initialized'),nor:true},
{name:'Filesystem boot count (log)',at:firmwareTime('littlefs_init)boot_count')},
{name:'Boot manager entry',at:pointTime('boot-manager'),soc:true},
{name:'Stock main handoff',at:pointTime('stock-handoff'),soc:true},
{name:'Main reset entry',at:pointTime('main-reset'),soc:true},
{name:'IMU modeled service trigger',at:(data.device_events||[]).find(p=>p.device==='IMU')?.time_us},
{name:'BLE initialization (log)',at:firmwareTime('am_devices_em9305_init status')},
{name:'Virtual touch accepted',at:timedEvent('[INPUT]')},
{name:'UART0 response received',at:data.replies.find(p=>Number.isInteger(p.time_us))?.time_us},
{name:'UI dispatch entry',at:pointTime('ui-dispatch'),soc:true},
{name:'Renderer entry',at:pointTime('renderer-entry'),soc:true},
{name:'Display frame observed',at:frames[0]?.time_us ?? (data.screen ? data.virtual_us : undefined)}
];
if(!['frame-experiment','generic-probe'].includes(data.report_kind))stages.sort((a,b)=>(a.at ?? Infinity)-(b.at ?? Infinity));
if(expectedStop || (!data.passed && data.report_kind !== 'generic-probe')){stages.push(data.report_kind === 'frame-experiment' ? {name:data.failure || 'Execution validation boundary',observedUntimed:true,stopped:true} : {name:expectedStop?'Boot metadata boundary':(data.failure || 'Execution validation boundary'),at:data.virtual_us,stopped:true});}
const stageNodes=stages.map(item=>{const li=document.createElement('li');li.className='stage';const dot=document.createElement('span');dot.className='dot';dot.setAttribute('aria-hidden','true');const body=document.createElement('span');const title=document.createElement('strong');title.textContent=item.name;const meta=document.createElement('small');body.append(title,meta);li.append(dot,body);stagesList.append(li);return {li,meta};});
let latestStage=-1;
const visualWindowUs=700000;
const visualSources=[
{key:'SoC',side:'Back',material:'Blackwall observed SoC',times:[...data.points.map(p=>p.time_us),...(data.firmware_events||[]).map(p=>p.time_us),...(data.uart_tx||[]).map(p=>p.time_us),...(data.timed||[]).filter(p=>p.text.startsWith('[TRACE]')).map(p=>p.time_us),...frames.map(p=>p.time_us)]},
{key:'NOR',side:'Front',material:'Blackwall observed NOR',times:(data.firmware_events||[]).filter(p=>p.text.toLowerCase().includes('norflash')).map(p=>p.time_us)},
{key:'Touch*',side:'Front',material:'Blackwall observed Touch',times:(data.timed||[]).filter(p=>p.text.startsWith('[INPUT]')).map(p=>p.time_us)},
{key:'IMU*',side:'Back',material:'Blackwall illustrative IMU',times:(data.device_events||[]).filter(p=>p.device==='IMU').map(p=>p.time_us)},
{key:'BLE*',side:'Back',material:'Blackwall illustrative BLE',times:(data.firmware_events||[]).filter(p=>/em9305|ble fw ver/i.test(p.text)).map(p=>p.time_us)},
{key:'Display*',side:'Front',material:'Blackwall illustrative Display',times:frames.map(p=>p.time_us)}
];
let recentComponents=[];
let observedComponents=[];
const componentList=el('component-list');
const componentButtons=visualSources.map(item=>{
const button=document.createElement('button');
button.type='button';button.className='component-badge';button.textContent=item.key;
<
5EB5
/div> button.title=item.key+(item.key.includes('*')?' · illustrative position':' · approximate sample position')+' · highlight inferred from recorded virtual events, not measured physical activity';
button.setAttribute('aria-label',button.title);
button.>
componentList.append(button);return button;
});
function updateStages(current){
const eligible=stages.map((x,i)=>({x,i})).filter(({x})=>Number.isInteger(x.at)&&x.at<=current);
const currentIndex=eligible.length ? eligible.at(-1).i : -1;
const terminal=current>=data.virtual_us;
stages.forEach((item,i)=>{
let state='pending',label='Pending';
if(Number.isInteger(item.at) && item.at<=current){
if(item.stopped && terminal){state='stopped';label=expectedStop?'Expected stop':'Validation failed';}
else if(i===currentIndex && !terminal){state='current';label='Latest observed';}
else {state='observed';label='Observed';}
} else if(item.unverified){label=terminal?(item.unverified==='not-observed'?'Not observed':'Unverified'):'Pending';}
else if(item.observedUntimed){state=terminal?(item.stopped?'stopped':'observed'):'pending';label=terminal?(item.stopped?'Failure reported · time unavailable':'Observed · time unavailable'):'Time unavailable';}
else if(terminal && !Number.isInteger(item.at)){label='Not observed';}
stageNodes[i].li.dataset.state=state;
stageNodes[i].meta.textContent=label+(Number.isInteger(item.at)&&item.at<=current?' · '+time(item.at):'');
});
if(currentIndex!==latestStage){latestStage=currentIndex;if(currentIndex>=0){const target=stageNodes[currentIndex].li;stagesList.scrollTop=target.offsetTop-stagesList.offsetTop-stagesList.clientHeight/2+target.offsetHeight/2;}}
observedComponents=visualSources.filter(item=>item.times.some(t=>Number.isInteger(t)&&t<=current));
recentComponents=observedComponents.filter(item=>item.times.some(t=>Number.isInteger(t)&&t<=current&¤t-t<=visualWindowUs));
componentButtons.forEach((button,i)=>{const item=visualSources[i];button.dataset.state=recentComponents.includes(item)?'recent':observedComponents.includes(item)?'observed':'pending';});
el('board-component').textContent='Event-based highlights';
el('board-component').title='Highlights indicate recorded virtual events associated with components, not measured physical activity. Pulsing indicates an event in the past 0.7 seconds; duration is not measured. * indicates illustrative placement.';
el('board-component').dataset.active=observedComponents.length?'true':'false';
}
const boards=[el('board-front-model'),el('board-back-model')];
const materialsByBoard=new Map();
for(const board of boards)board.addEventListener('load',()=>{materialsByBoard.set(board,board.model?.materials || []);});
const reduced=window.matchMedia('(prefers-reduced-motion: reduce)');
function animateSoc(now){for(const materials of materialsByBoard.values()){for(const item of visualSources){const material=materials.find(m=>m.name===item.material);if(material){const glow=recentComponents.includes(item) ? (reduced.matches ? .14 : .06+.08*(1+Math.sin(now/550))) : observedComponents.includes(item) ? .09 : 0;material.setEmissiveFactor([0,glow*3,0]);}}}requestAnimationFrame(animateSoc);}
requestAnimationFrame(animateSoc);
el('board-toggle'). bare=e.currentTarget.getAttribute('aria-pressed')!=='true';e.currentTarget.setAttribute('aria-pressed',String(bare));for(const board of boards){materialsByBoard.delete(board);board.src=bare?'board-model-bw590/g2-temple-board.glb':'board-model-bw590/g2-temple-assembly.glb';}};
show('Emulator'); update();
You can’t perform that action at this time.