Fix wet, windy and storms
This commit is contained in:
fraxle
2026-06-02 15:40:05 +01:00
parent 099f2924d3
commit 91ff762c5f
4 changed files with 145 additions and 13 deletions
+17 -1
View File
@@ -81,13 +81,29 @@ export function getLensOverlaySVG(event, cx, cy, lensR) {
+ '<path d="M ' + (cx-lensR+10) + ' ' + (cy+45) + ' Q ' + (cx-10) + ' ' + (cy+30) + ' ' + (cx+30) + ' ' + (cy+45) + ' Q ' + (cx+65) + ' ' + (cy+60) + ' ' + (cx+lensR-10) + ' ' + (cy+45) + '" fill="none" stroke="rgba(255,100,10,0.5)" stroke-width="2" /></g>';
}
if (id === 'storm') {
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>';
}
if (id === 'wind') {
const wl = [-30,5,40].map(function(y){
return '<path d="M ' + (cx-lensR+12) + ' ' + (cy+y) + ' q 40 -14 80 0 q 30 10 ' + (lensR-10) + ' -2" fill="none" stroke="rgba(170,200,230,0.55)" stroke-width="1.5" stroke-linecap="round" />';
}).join('');
return '<g clip-path="url(#scope-lens-clip)" opacity="0.45">' + wl + '</g>';
}
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('');
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>';
}
if (id === 'frost') {
const fc = [[-50,40],[0,55],[50,40],[-30,65],[30,65]].map(function(p){
var dx=p[0], dy=p[1];