chore: initial import

This commit is contained in:
dasemu committed 2026-11-16 21:41:00 +01:00
commit d90cf2ddd8
6 files changed
+272

No files matched your search

+69
View File
@@ -0,0 +1,69 @@
<!doctype html>
<html lang="es"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Logo animation</title>
<style>
html,body{margin:0;height:100%;background:#111;overflow:hidden;font-family:system-ui,sans-serif}
#wrap{position:absolute;inset:0 0 56px 0;overflow:hidden}
#stage{position:absolute;left:0;top:0;width:1920px;height:1080px;overflow:hidden;transform-origin:0 0}
.scene{position:absolute;inset:0;overflow:hidden}
#bar{position:absolute;left:0;right:0;bottom:0;height:56px;display:flex;align-items:center;gap:14px;padding:0 16px;box-sizing:border-box;color:#eee;background:#1b1b1b}
#bar button{background:#333;color:#eee;border:0;border-radius:8px;padding:8px 14px;font-size:15px;cursor:pointer}
#seek{flex:1}
#time{font-variant-numeric:tabular-nums;min-width:96px;text-align:right;font-size:14px}
#stage { --ground:#FBF6EC; --main:#DD0000; --second:#2B1414; --accent:#F7CF00; color:var(--second); font-family:var(--sans, system-ui, sans-serif) }
.ground { position:absolute; inset:0; background:var(--ground) }
.words { position:absolute; margin:0; display:flex; flex-direction:column; gap:24px } .words > * { margin:0 }
.line { font-family:var(--display, var(--sans, system-ui, sans-serif)); font-size:84px; line-height:1.05; font-weight:700 } .sub { font-size:36px }
.art { position:absolute; overflow:visible }
.lg-red { fill:var(--main); fill-rule:evenodd }
.lg-yel { fill:var(--accent) }
.lg-dr { fill:var(--main) }
.lg-dy { fill:var(--accent); stroke:color-mix(in srgb, var(--second) 35%, transparent); stroke-width:1.5 }
.lg-spark { fill:none; stroke:var(--accent); stroke-width:9; stroke-linecap:round }
</style></head><body>
<div id="wrap"><div id="stage"></div></div>
<div id="bar"><button id="pp">Pause</button><input id="seek" type="range" min="0" max="1000" value="0"><span id="time">0.00 / 5.00 s</span></div>
<script>
const MODS = {"logo.json": "{\"w\":963,\"h\":1193,\"red\":[\"M421 0L417 10L414 25L413 56L410 69L403 81L382 102L376 106L373 106L364 95L359 109L355 110L353 108L353 96L357 74L353 52L347 52L341 60L333 83L332 143L325 163L315 173L303 180L290 182L288 180L288 165L283 166L261 192L233 217L226 232L204 248L183 259L177 260L162 242L159 243L158 267L161 273L161 278L154 299L163 314L176 324L191 327L194 324L193 313L197 309L203 309L207 311L213 311L215 309L213 296L219 290L269 272L272 275L257 291L197 347L174 363L163 367L147 365L141 359L140 352L143 342L142 331L140 331L132 339L123 341L116 335L108 321L102 314L93 312L91 314L91 317L97 324L99 329L102 358L107 373L111 379L120 387L130 392L141 392L160 388L184 376L206 360L240 329L270 310L300 295L318 294L324 299L321 307L313 315L301 316L300 320L302 325L300 327L295 327L288 324L286 327L286 340L283 343L267 343L267 350L275 363L286 375L296 373L300 378L301 388L304 389L307 387L313 373L319 366L323 367L331 376L334 374L334 361L328 349L326 340L328 335L344 318L355 303L386 276L401 269L416 254L425 252L440 259L443 262L451 280L459 291L460 305L464 315L464 340L473 356L469 371L469 388L473 397L481 407L482 419L486 429L486 435L479 442L465 449L456 449L448 446L432 436L423 428L422 416L418 405L411 397L401 391L385 391L376 393L376 396L386 409L386 412L384 414L381 414L370 404L340 404L333 407L331 412L331 421L335 422L342 417L348 418L352 422L356 438L371 447L371 452L363 459L351 477L351 482L353 484L368 477L373 478L381 485L396 485L422 479L428 479L440 484L446 489L448 493L449 511L456 515L467 517L473 525L476 525L479 522L478 489L488 486L495 477L499 479L501 483L500 495L486 515L486 519L488 521L495 520L502 516L505 516L507 518L500 553L500 564L496 568L467 566L450 556L439 552L433 544L431 532L432 523L435 518L435 510L425 502L413 497L409 499L409 501L416 508L416 512L411 519L411 525L413 528L412 537L410 539L407 539L395 532L392 532L376 541L371 546L372 552L379 553L387 559L398 560L405 564L405 566L397 573L389 585L389 592L391 595L398 592L409 594L419 584L430 584L433 588L433 602L428 606L429 610L435 610L448 604L450 602L450 594L453 589L456 589L469 597L478 606L481 612L481 619L477 623L468 626L471 628L483 628L485 632L476 642L467 657L469 679L477 694L476 701L472 703L458 694L449 691L449 693L456 700L456 713L449 725L440 734L428 739L423 743L415 740L404 740L396 731L382 709L382 701L376 671L385 662L400 652L405 651L411 647L413 627L410 621L407 618L405 619L406 628L403 632L388 632L381 641L372 643L369 639L370 628L366 624L347 615L339 613L336 614L337 619L341 623L340 637L347 649L347 654L344 656L339 652L325 652L312 656L310 660L319 667L322 675L325 678L334 678L344 687L344 692L334 702L324 702L323 705L330 713L336 716L342 716L351 711L354 711L357 716L356 732L352 746L346 754L339 752L330 744L327 745L329 752L341 767L342 773L326 790L326 797L321 807L309 818L301 819L294 812L283 807L279 802L278 796L285 773L283 754L284 746L290 738L309 726L309 714L312 706L312 701L306 690L299 682L296 683L298 690L292 695L287 694L283 690L281 685L277 682L272 681L270 683L270 689L262 698L262 703L265 711L265 721L262 727L252 739L243 746L240 758L237 761L230 761L228 764L229 768L233 772L252 768L258 775L256 808L240 835L241 837L248 838L257 847L267 865L269 877L266 880L258 880L244 875L243 878L249 883L264 889L293 890L314 883L329 883L340 897L347 916L347 949L338 972L329 980L312 983L302 988L295 987L285 981L276 979L268 975L260 967L251 951L246 932L237 908L235 892L230 880L225 873L225 847L222 835L221 813L200 764L191 753L184 741L173 730L164 724L149 718L138 716L131 718L119 728L107 748L105 748L100 743L100 740L103 737L96 734L85 733L83 731L83 728L72 732L60 742L57 741L70 710L70 707L68 707L66 704L70 693L73 676L70 670L71 658L74 656L100 674L111 674L111 671L102 656L91 622L86 594L85 565L83 557L79 552L75 553L71 558L51 596L39 603L30 616L12 632L0 646L0 654L2 655L14 654L30 650L37 656L38 664L33 682L33 690L36 703L32 714L30 734L25 749L28 768L28 782L35 790L55 806L54 814L58 818L82 832L80 834L80 837L95 837L110 833L112 835L111 836L114 837L121 828L126 815L128 813L131 813L133 810L135 789L140 782L148 784L158 794L157 798L155 796L153 797L161 810L171 821L175 830L176 849L174 851L169 842L167 842L166 845L169 863L175 879L185 918L184 924L177 918L171 906L170 908L181 940L190 957L192 971L195 978L211 999L221 1021L245 1044L265 1058L262 1061L255 1061L255 1063L273 1071L300 1071L348 1054L371 1040L374 1040L376 1042L376 1047L371 1055L377 1051L390 1034L399 1016L411 980L432 957L443 950L448 949L450 951L450 957L444 976L431 997L414 1015L418 1015L445 1005L461 996L488 972L506 948L517 939L533 936L535 938L535 941L525 955L505 973L497 977L497 979L511 976L535 964L557 946L575 917L586 905L588 905L588 913L579 932L579 934L581 934L597 911L611 883L629 858L633 849L638 829L656 791L667 783L675 781L680 786L687 803L685 817L672 838L640 873L635 882L634 888L638 887L655 870L669 867L680 871L690 882L695 897L695 906L692 921L688 929L676 945L617 999L595 1016L595 1019L598 1021L608 1021L622 1017L632 1009L671 992L690 992L705 996L721 1005L730 1014L735 1028L736 1039L731 1073L726 1090L702 1136L683 1180L682 1192L684 1192L690 1179L759 1109L808 1042L859 961L868 942L875 916L887 894L890 885L901 830L901 791L90Line truncated
const SCENES = [{id:'trace',dur:2},{id:'fill',dur:1.8},{id:'hold',dur:1.2}];
const DURATION = SCENES.reduce((a,s)=>a+s.dur,0);
const W=1920,H=1080,stage=document.getElementById('stage');
/* helpers (same math as the original runtime) */
const clamp01=x=>x<0?0:x>1?1:x, seg=(t,a,b)=>clamp01((t-a)/(b-a)), lerp=(a,b,p)=>a+(b-a)*p;
const eo=x=>1-Math.pow(1-clamp01(x),3);
const eio=x=>{x=clamp01(x);return x<.5?4*x*x*x:1-Math.pow(-2*x+2,3)/2};
const eob=(x,c1=1.4)=>{x=clamp01(x);const c3=c1+1;return 1+c3*Math.pow(x-1,3)+c1*Math.pow(x-1,2)};
function rng(seed){let s=seed>>>0;return()=>{s=(s*1664525+1013904223)>>>0;return s/4294967296}}
function h(html){const t=document.createElement('template');t.innerHTML=String(html).trim();return t.content.firstElementChild}
const base={W,H,seg,lerp,eo,eio,eob,rng,clamp01,h,json:n=>JSON.parse(MODS[n])};
/* shared.js defines window.LOGO */
new Function('kit',MODS['shared.js']).call(window,Object.assign({},base,{stage}));
/* scenes */
let start=0;const defs={};
SCENES.forEach(s=>{
const box=document.createElement('div');box.className='scene';stage.appendChild(box);
const kit=Object.assign({},base,{stage:box,start,dur:s.dur,scene:(id,def)=>{defs[id]=def}});
new Function('kit',MODS['scene-'+s.id+'.js'])(kit);
defs[s.id].init(kit);defs[s.id].box=box;defs[s.id].kit=kit;defs[s.id].t0=start;
start+=s.dur;
});
function render(t){
t=Math.max(0,Math.min(DURATION,t));
let i=0,acc=0;for(;i<SCENES.length-1&&t>=acc+SCENES[i].dur;i++)acc+=SCENES[i].dur;
SCENES.forEach((s,k)=>{defs[s.id].box.style.display=k===i?'':'none'});
const d=defs[SCENES[i].id];d.render(t-acc,d.kit);
}
/* fit + transport */
function fit(){const w=document.getElementById('wrap'),k=Math.min(w.clientWidth/W,w.clientHeight/H);
stage.style.transform='scale('+k+')';stage.style.left=((w.clientWidth-W*k)/2)+'px';stage.style.top=((w.clientHeight-H*k)/2)+'px'}
addEventListener('resize',fit);fit();
const pp=document.getElementById('pp'),seek=document.getElementById('seek'),tl=document.getElementById('time');
let playing=true,t=0,last=performance.now();
function show(){render(t);seek.value=Math.round(t/DURATION*1000);tl.textContent=t.toFixed(2)+' / '+DURATION.toFixed(2)+' s'}
function loop(now){if(playing){t+=(now-last)/1000;if(t>=DURATION)t=0}last=now;show();requestAnimationFrame(loop)}
pp.onclick=()=>{playing=!playing;pp.textContent=playing?'Pause':'Play'};
seek.oninput=()=>{t=seek.value/1000*DURATION;playing=false;pp.textContent='Play'};
addEventListener('keydown',e=>{if(e.code==='Space'){e.preventDefault();pp.click()}});
requestAnimationFrame(loop);
</script></body></html>