CHASING WAYPOINTS
Clocks
UTC
--:--:--
Local
--:--:--
Rally (offset)
--:--:--
UTC offset (hrs):
Apply
=0?pos:neg)}; return c(lat,'N','S')+', '+c(lon,'E','W'); }; const ddm = (lat,lon)=>{ const c=(v,pos,neg)=>{const a=Math.abs(v),d=Math.floor(a),m=(a-d)*60;return d+'° '+m.toFixed(3)+'\\'\\' '+(v>=0?pos:neg)}; return c(lat,'N','S')+', '+c(lon,'E','W'); }; // UI const $ = id => document.getElementById(id); const status = t => $('rcStatus').textContent = t; function renderAll(lat,lon){ $('rcDD').value = dd(lat,lon); $('rcDMS').value = dms(lat,lon); $('rcDDM').value = ddm(lat,lon); status('Converted ✓'); } $('rcConvert').addEventListener('click', ()=>{ const p = parseCoord($('rcIn').value); if(!p){ status('Could not parse. Try: 28.687400, -114.214900'); return; } renderAll(p.lat, p.lon); }); document.querySelectorAll('[data-copy]').forEach(btn=>{ btn.addEventListener('click', ()=>{ const id = btn.getAttribute('data-copy'); const el = document.getElementById(id); el.select(); el.setSelectionRange(0, 99999); navigator.clipboard.writeText(el.value); status('Copied '+id+' ✓'); }); }); })();