Animated sunscope with day cycle
This commit is contained in:
fraxle
2026-06-06 14:49:56 +01:00
parent 6da2f34b26
commit f22833ee63
7 changed files with 433 additions and 19 deletions
+5 -9
View File
@@ -82,10 +82,8 @@ export function getLensOverlaySVG(event, cx, cy, lensR) {
}
if (id === 'wet') {
const sl = [-55,-30,-5,20,45,65].map(function(x){
return '<line x1="' + (cx+x) + '" y1="' + (cy-lensR+10) + '" x2="' + (cx+x-15) + '" y2="' + (cy+lensR-10) + '" stroke="rgba(140,180,220,0.6)" stroke-width="1" stroke-linecap="round" />';
}).join('');
return '<g clip-path="url(#scope-lens-clip)" opacity="0.45">' + sl + '</g>';
// Rain is now drawn continuously on the scope FX canvas; no static overlay.
return null;
}
if (id === 'wind') {
@@ -96,12 +94,10 @@ export function getLensOverlaySVG(event, cx, cy, lensR) {
}
if (id === 'storm') {
// Driving rain streaks plus a forked lightning bolt.
const sl = [-55,-30,-5,20,45,65].map(function(x){
return '<line x1="' + (cx+x) + '" y1="' + (cy-lensR+10) + '" x2="' + (cx+x-22) + '" y2="' + (cy+lensR-10) + '" stroke="rgba(140,180,220,0.55)" stroke-width="1" stroke-linecap="round" />';
}).join('');
// Driving rain + lightning flashes are drawn on the FX canvas; keep just
// the static forked bolt as the event signifier.
const bolt = '<path d="M ' + (cx+6) + ' ' + (cy-lensR+18) + ' L ' + (cx-14) + ' ' + (cy+8) + ' L ' + (cx-2) + ' ' + (cy+8) + ' L ' + (cx-18) + ' ' + (cy+lensR-14) + ' L ' + (cx+18) + ' ' + (cy-2) + ' L ' + (cx+4) + ' ' + (cy-2) + ' Z" fill="rgba(255,224,120,0.7)" stroke="rgba(255,200,60,0.8)" stroke-width="1" stroke-linejoin="round" />';
return '<g clip-path="url(#scope-lens-clip)" opacity="0.5">' + sl + bolt + '</g>';
return '<g clip-path="url(#scope-lens-clip)" opacity="0.5">' + bolt + '</g>';
}
if (id === 'frost') {