One commited on
Commit
0f17fe8
·
verified ·
1 Parent(s): dd50090

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +35 -6
index.html CHANGED
@@ -275,9 +275,10 @@ function renderBlobs(){
275
  g=(8+Math.pow(k,1.8)*150)*(0.55+t*0.6);
276
  bl=(34-Math.pow(k,2)*14+k*k*70)*(0.6+t*0.5);
277
  // white-hot core for very hot, deep wax (glowing from within)
278
- if(f>1.4&&t>0.35){
279
- const w=Math.min(1,(f-1.4)/0.8)*Math.min(1,(t-0.35)/0.5)*0.7;
280
- r+=(255-r)*w;g+=(225-g)*w;bl+=(190-bl)*w;
 
281
  }
282
  a=255*Math.min(1,(f-0.52)/0.35);
283
  }else if(f>0.3){ // soft red halo
@@ -289,7 +290,9 @@ function renderBlobs(){
289
  if(lum>1){const s=Math.min(1.45,lum/LUM_L);
290
  r+=(LIGHT.r*s-r)*rgbMix;g+=(LIGHT.g*s-g)*rgbMix;bl+=(LIGHT.b*s-bl)*rgbMix;}
291
  }
292
- d[i*4]=Math.min(255,r);d[i*4+1]=Math.min(255,g);d[i*4+2]=Math.min(255,bl);d[i*4+3]=a;
 
 
293
  }
294
  bctx.putImageData(img,0,0);
295
  }
@@ -418,8 +421,34 @@ function drawGlass(){
418
  g.addColorStop(0,'rgba(255,255,255,0.02)');g.addColorStop(0.15,'rgba(255,255,255,0.22)');
419
  g.addColorStop(0.5,'rgba(255,255,255,0.04)');g.addColorStop(0.85,'rgba(255,255,255,0.16)');g.addColorStop(1,'rgba(255,255,255,0.02)');
420
  ctx.strokeStyle=g;ctx.lineWidth=2.4;ctx.stroke(glass);
421
- const hl=(x,w,a)=>{const gr=ctx.createLinearGradient(x,LIQ_TOP,x,LIQ_BOT);gr.addColorStop(0,'rgba(255,255,255,0)');gr.addColorStop(0.5,`rgba(255,255,255,${a})`);gr.addColorStop(1,'rgba(255,255,255,0)');ctx.fillStyle=gr;ctx.beginPath();ctx.roundRect(x-w/2,LIQ_TOP+14,w,LIQ_BOT-LIQ_TOP-30,w/2);ctx.fill();};
422
- hl(CX-MAX_HW*0.62,7,0.10);hl(CX+MAX_HW*0.55,4,0.05);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
423
  ctx.restore();
424
  }
425
 
 
275
  g=(8+Math.pow(k,1.8)*150)*(0.55+t*0.6);
276
  bl=(34-Math.pow(k,2)*14+k*k*70)*(0.6+t*0.5);
277
  // white-hot core for very hot, deep wax (glowing from within)
278
+ // gradual transition to avoid hard-edged blipping points
279
+ if(f>1.0&&t>0.25){
280
+ const w=Math.min(1,(f-1.0)/1.6)*Math.min(1,(t-0.25)/0.8)*0.45;
281
+ r+=(255-r)*w;g+=(235-g)*w;bl+=(210-bl)*w;
282
  }
283
  a=255*Math.min(1,(f-0.52)/0.35);
284
  }else if(f>0.3){ // soft red halo
 
290
  if(lum>1){const s=Math.min(1.45,lum/LUM_L);
291
  r+=(LIGHT.r*s-r)*rgbMix;g+=(LIGHT.g*s-g)*rgbMix;bl+=(LIGHT.b*s-bl)*rgbMix;}
292
  }
293
+ // soft tone map to prevent overexposure blips (like a camera sensor flattening)
294
+ const tone=v=>v<=230?v:230+25*(1-Math.exp(-(v-230)/8));
295
+ d[i*4]=tone(r);d[i*4+1]=tone(g);d[i*4+2]=tone(bl);d[i*4+3]=a;
296
  }
297
  bctx.putImageData(img,0,0);
298
  }
 
421
  g.addColorStop(0,'rgba(255,255,255,0.02)');g.addColorStop(0.15,'rgba(255,255,255,0.22)');
422
  g.addColorStop(0.5,'rgba(255,255,255,0.04)');g.addColorStop(0.85,'rgba(255,255,255,0.16)');g.addColorStop(1,'rgba(255,255,255,0.02)');
423
  ctx.strokeStyle=g;ctx.lineWidth=2.4;ctx.stroke(glass);
424
+ // subtle curved reflection to suggest glass curvature (skeuomorphic)
425
+ const refl=ctx.createLinearGradient(CX-MAX_HW*0.7,LIQ_TOP,CX-MAX_HW*0.3,LIQ_BOT);
426
+ refl.addColorStop(0,'rgba(255,255,255,0)');
427
+ refl.addColorStop(0.4,'rgba(255,255,255,0.08)');
428
+ refl.addColorStop(0.6,'rgba(255,255,255,0.12)');
429
+ refl.addColorStop(1,'rgba(255,255,255,0)');
430
+ ctx.fillStyle=refl;
431
+ ctx.beginPath();
432
+ // curved highlight on the left side
433
+ ctx.moveTo(CX-MAX_HW*0.75,LIQ_TOP+20);
434
+ ctx.quadraticCurveTo(CX-MAX_HW*0.55,(LIQ_TOP+LIQ_BOT)/2,CX-MAX_HW*0.68,LIQ_BOT-30);
435
+ ctx.lineTo(CX-MAX_HW*0.45,LIQ_BOT-20);
436
+ ctx.quadraticCurveTo(CX-MAX_HW*0.35,(LIQ_TOP+LIQ_BOT)/2,CX-MAX_HW*0.52,LIQ_TOP+30);
437
+ ctx.closePath();
438
+ ctx.fill();
439
+ // subtle right-side reflection
440
+ const refl2=ctx.createLinearGradient(CX+MAX_HW*0.4,LIQ_TOP,CX+MAX_HW*0.7,LIQ_BOT);
441
+ refl2.addColorStop(0,'rgba(255,255,255,0)');
442
+ refl2.addColorStop(0.5,'rgba(255,255,255,0.05)');
443
+ refl2.addColorStop(1,'rgba(255,255,255,0)');
444
+ ctx.fillStyle=refl2;
445
+ ctx.beginPath();
446
+ ctx.moveTo(CX+MAX_HW*0.45,LIQ_TOP+40);
447
+ ctx.quadraticCurveTo(CX+MAX_HW*0.6,(LIQ_TOP+LIQ_BOT)/2,CX+MAX_HW*0.5,LIQ_BOT-40);
448
+ ctx.lineTo(CX+MAX_HW*0.38,LIQ_BOT-35);
449
+ ctx.quadraticCurveTo(CX+MAX_HW*0.48,(LIQ_TOP+LIQ_BOT)/2,CX+MAX_HW*0.36,LIQ_TOP+50);
450
+ ctx.closePath();
451
+ ctx.fill();
452
  ctx.restore();
453
  }
454