Upload index.html
Browse files- 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 |
-
|
| 279 |
-
|
| 280 |
-
|
|
|
|
| 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 |
-
|
|
|
|
|
|
|
| 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 |
-
|
| 422 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|