// ------------------------------------------------------------------------ // lens-overlay.js - Returns an SVG string for the event overlay inside // the big ScopeReticle. // // Rendered INSIDE the lens clip path, BELOW the glass shine/shade layers. // cx, cy = lens centre coords; lensR = lens radius. // // To add a new overlay for an event: add another 'if (...)' block below // that matches by event.emoji or event.id and returns an SVG fragment // string. Return null when no overlay applies. // ------------------------------------------------------------------------ export function getLensOverlaySVG(event, cx, cy, lensR) { if (!event) return null; const id = event.id; if (event.emoji === '☄️') { return [ '', '', '', '', '', '', '', ].join(''); } if (id.includes('solar-eclipse')) { const cx_ = cx, cy_ = cy - 20; return '' + '' + '' + '' + '' + '' + ''; } if (id.includes('lunar-eclipse')) { const cx_ = cx, cy_ = cy - 30; return '' + '' + '' + '' + '' + '' + ''; } if (event.emoji === '🪐' && event.id.includes('conjunction')) { return '' + '' + ''; } if (event.emoji === '🔴') { return '' + '' + ''; } if (id === 'stargazing') { const pts = [[cx-50,cy-55,1.8],[cx+40,cy-65,1.4],[cx-20,cy-70,1.0],[cx+65,cy-40,1.6],[cx-60,cy-30,1.2],[cx+50,cy-55,1.0],[cx-35,cy-45,1.4],[cx+20,cy-50,1.8],[cx-75,cy-50,1.0]]; const dots = pts.map(function(s){return '';}).join(''); return '' + dots + ''; } if (id === 'perfect-sunset') { return '' + '' + '' + '' + '' + ''; } if (id === 'heat-spike') { return '' + '' + ''; } if (id === 'storm') { const sl = [-55,-30,-5,20,45,65].map(function(x){ return ''; }).join(''); return '' + sl + ''; } 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]; return ''; }).join(''); return '' + fc + ''; } return null; }