[verified] feat: expand public animation library across 12 industries

This commit is contained in:
jarvis-at-skic committed 2026-10-25 18:14:35 +00:00
1 parent 3bb9555e6a
commit ecbbcf8ba0
144 files changed
+61323 -187

No files matched your search

+81
View File
@@ -0,0 +1,81 @@
/* Original conceptual teaching scenes. No operational or engineering model. */
(function () {
'use strict';
window.industryRenderers ??= {};
const C={bg:'#101d30',panel:'#182b42',line:'#667c95',ink:'#edf5ff',muted:'#aec1d7',cyan:'#57d4ed',green:'#85e0ad',amber:'#ffd178',red:'#ff8c8c'};
function scene(svg,config,kit,title,subtitle,phases,note){
const {anime,el}=kit, duration=Math.max(3000,Number(config.duration)||6000), unit=duration/6;
const tl=anime.createTimeline({autoplay:false,defaults:{ease:'linear'}});
const E=(tag,a={},text='',p=svg)=>el(tag,a,text,p);
const rect=(x,y,w,h,fill=C.panel,p=svg,extra={})=>E('rect',{x,y,width:w,height:h,rx:8,fill,...extra},'',p);
const text=(x,y,t,size=18,fill=C.ink,p=svg,extra={})=>E('text',{x,y,fill,'font-size':size,'font-family':'system-ui, sans-serif',style:`fill:${fill};font-size:${size}px;font-family:system-ui,sans-serif`,...extra},t,p);
const path=(d,color=C.line,width=3,p=svg,extra={})=>E('path',{d,fill:'none',stroke:color,'stroke-width':width,'stroke-linecap':'round','stroke-linejoin':'round',...extra},'',p);
const circle=(cx,cy,r,fill=C.cyan,p=svg,extra={})=>E('circle',{cx,cy,r,fill,...extra},'',p);
const group=()=>E('g');
const add=(target,props,at=0,len=.75)=>tl.add(target,{...props,duration:unit*len},unit*at);
const reveal=(target,at)=>{target.setAttribute('opacity','0.12');add(target,{opacity:[.12,1]},at);return target;};
const draw=(d,at,color=C.cyan,width=4)=>{const p=path(d,color,width);p.setAttribute('pathLength','1');p.setAttribute('stroke-dasharray','1');p.setAttribute('stroke-dashoffset','1');add(p,{'stroke-dashoffset':[1,0]},at);return p;};
rect(0,0,960,540,C.bg,svg,{rx:0}); text(32,39,title,26);text(32,69,subtitle,17,C.muted);
path('M32 88 H928',C.line,1);
phases.forEach((label,i)=>{const x=32+i*181;rect(x,440,172,44);const bar=rect(x,440,172,4,C.cyan,svg,{rx:0});add(bar,{opacity:[.15,1]},i,.65);text(x+10,469,`${i+1} ${label}`,16);});
text(32,516,note,16,C.muted);
const clock=E('g',{'data-clock':'finite'});add(clock,{opacity:[1,1]},0,6);
return {svg,config,tl,E,rect,text,path,circle,group,add,reveal,draw,C};
}
window.industryRenderers["telecom-congestion-reroute"] = function(svg, config, kit) {
const s=scene(svg,config,kit,'NETWORK / ROUTE AROUND A QUEUE','The destination stays fixed while forwarding shifts to an alternate transit path.',
['Forward','Queue','Detect','Reroute','Deliver'],'Conceptual topology • amber = congested segment • cyan = initial route • green = alternate');
const {rect,text,path,circle,group,add,reveal,draw,C}=s;
const router=(x,y,name)=>{circle(x,y,29,'#25435e',svg,{stroke:C.line,'stroke-width':2});path(`M${x-15} ${y} H${x+15} M${x} ${y-15} V${y+15} M${x+9} ${y-5} L${x+15} ${y} L${x+9} ${y+5} M${x-5} ${y-9} L${x} ${y-15} L${x+5} ${y-9}`,C.muted,2);text(x-29,y+54,name,16);};
// Client, a routed diamond and a destination rack.
rect(39,217,100,68,'#2b465f');rect(48,226,82,46,'#122237');path('M89 286 V302 M65 303 H114',C.muted,4);text(39,328,'Source',17);
path('M140 251 H240 M270 222 L440 151 M499 151 L672 222 M270 280 L440 351 M499 351 L672 280 M701 251 H806',C.line,3);
router(240,251,'Edge A');router(470,141,'Transit B');router(470,361,'Transit C');router(701,251,'Edge D');
rect(814,191,104,134,'#283e53');[205,241,277].forEach(y=>{rect(825,y,82,27,'#101e30');circle(895,y+13,4,C.green);});text(812,355,'Destination',17);
const originalRoute=draw('M140 251 H210 M264 235 L443 153 M498 153 L674 235',0);add(originalRoute,{opacity:[1,.2]},3,1);
const p=circle(156,251,7,C.cyan);add(p,{cx:[156,232]},0,.7);
// Queue slots explicitly expose finite waiting capacity (no implied rates).
const queued=Math.min(4,Math.max(1,Math.round(Number(config.queuePackets)||4)));
text(547,115,'Transit queue',17);[0,1,2,3].forEach(i=>{rect(552+i*28,133,22,20,'#263a4e');if(i<queued){const q=rect(554+i*28,135,18,16,C.amber);reveal(q,1+i*.15);}});
const hot=path('M502 158 L669 231',C.amber,8);reveal(hot,1.7);
const alert=group();path('M734 124 L754 160 H714 Z',C.amber,3,alert);text(730,151,'!',18,C.amber,alert);text(765,151,'Queue pressure',16,C.amber,alert);reveal(alert,2);
// Reroute physically draws through the lower transit rather than recoloring boxes.
draw('M264 269 L443 348 M497 348 L675 269',3,C.green,6);
const alternate=circle(278,278,8,C.green);add(alternate,{cx:[278,442],cy:[278,348]},3,.6);add(alternate,{cx:[442,672],cy:[348,269]},3.6,.7);add(alternate,{cx:[672,807],cy:[269,251]},4.3,.6);
text(338,306,'Alternate transit selected',16,C.green);
draw('M730 251 H808',4,C.green,5);
const receipt=group();rect(48,371,260,44,'#264738',receipt);text(62,399,'Delivered to the same endpoint',16,C.green,receipt);reveal(receipt,4.4);
text(604,405,'Route choice ≠ capacity guarantee',16,C.muted);
return s.tl;
};
window.industryRenderers["telecom-cell-handover"] = function(svg, config, kit) {
const s=scene(svg,config,kit,'MOBILITY / CHANGE ACCESS, KEEP SESSION','Radio attachment changes; the session anchor remains the stable reference.',
['Serve A','Measure','Prepare B','Switch','Release A'],'Conceptual handover • cyan = serving cell • amber = preparation • green = target link');
const {rect,text,path,circle,group,add,reveal,draw,C}=s;
// Two overlapping coverage envelopes and original radio masts.
ELLIPSE();
function ELLIPSE(){s.E('ellipse',{cx:285,cy:326,rx:211,ry:79,fill:'#193e55',stroke:C.cyan,'stroke-width':1});s.E('ellipse',{cx:665,cy:326,rx:211,ry:79,fill:'#203d3c',stroke:C.green,'stroke-width':1});}
function mast(x,name,color){path(`M${x} 178 L${x-30} 316 H${x+30} Z M${x-22} 279 H${x+22} M${x-14} 242 H${x+14} M${x-22} 279 L${x+14} 242 M${x+22} 279 L${x-14} 242`,C.muted,3);circle(x,174,6,color);path(`M${x-19} 153 Q${x-38} 174 ${x-19} 195 M${x+19} 153 Q${x+38} 174 ${x+19} 195`,color,3);text(x-28,345,name,18,color);}
mast(230,'Cell A',C.cyan);mast(730,'Cell B',C.green);
rect(391,112,178,64,'#2b3d59');text(408,139,'Session anchor',18);text(408,163,'Identity retained',16,C.muted);
path('M391 142 H230 V151 M569 142 H730 V151',C.line,2);
text(45,128,'Access changes',16,C.muted);text(45,151,'Session persists',16,C.muted);
path('M305 374 H659 M650 367 L659 374 L650 381',C.line,3);text(374,404,'Direction of travel',16,C.muted);
// Handset moves as one local group; radio lines independently interpolate endpoints.
const phone=group();rect(316,289,36,64,'#e5effb',phone);rect(321,298,26,40,'#173149',phone);circle(334,346,3,'#173149',phone);
const travel=Math.min(320,Math.max(220,Number(config.travelPx)||286)),end=334+travel;
add(phone,{translateX:[0,travel]},.2,4.4);
const a=path('M230 182 L334 290',C.cyan,3);add(a,{d:['M230 182 L334 290',`M230 182 L${end} 290`]},.2,4.4);add(a,{opacity:[1,.16]},3.4,.8);
const b=path('M730 182 L334 290',C.green,4);b.setAttribute('opacity','.08');add(b,{d:['M730 182 L334 290',`M730 182 L${end} 290`]},.2,4.4);add(b,{opacity:[.08,1]},2.5,1);
const measure=group();rect(380,203,196,53,'#3c3c32',measure);text(392,225,'Neighbor measured',16,C.amber,measure);text(392,246,'Target prepared',16,C.amber,measure);reveal(measure,1.4);
draw('M568 174 L695 211',2,C.amber,3);
const context=group();circle(615,151,10,C.amber,context);reveal(context,2.1);add(context,{translateX:[0,90]},2.1,.65);
const switchNote=group();rect(746,366,176,49,'#264738',switchNote);text(757,388,'B serving',17,C.green,switchNote);text(757,407,'A resources freed',16,C.ink,switchNote);reveal(switchNote,4);
text(54,405,'Overlap enables preparation',16,C.muted);
return s.tl;
};
})();