window.addEventListener('load', function () { const assets = { core: 'astronomica_core', bandcamp: 'portal_bandcamp', facebook: 'portal_facebook', youtube: 'portal_youtube', live: 'portal_live', website: 'portal_website', spotify: 'portal_spotify' }; const links = { spotify: 'https://open.spotify.com/artist/65YoyncmQRBIgr7X7Oix1q?si=rqnk-TFgRY610Ut0RY47wg', youtube: 'https://www.youtube.com/channel/UCq2wY_AIfUaJ04Z5KnmKCiw', bandcamp: 'https://wadeblacksastronomica.bandcamp.com/', website: 'https://astronomicarock.com/', facebook: 'https://www.facebook.com/astronomica.official', live: 'https://astronomicauniverse.app/#live' }; function setStageHeight() { const h = window.visualViewport ? window.visualViewport.height : window.innerHeight; document.documentElement.style.setProperty('--astro-vh', `${h}px`); } function getCarrdImageUrl(id) { const wrapper = document.getElementById(id); const img = wrapper ? wrapper.querySelector('img') : null; return img ? (img.getAttribute('data-src') || img.getAttribute('src')) : null; } function setPulseCoordinates() { const isMobile = window.innerWidth <= 736; const coords = isMobile ? { spotify: [27, 15, 43, 32], youtube: [73, 15, 57, 32], website: [25, 56, 43, 47], bandcamp: [75, 56, 57, 47], facebook: [25, 76, 45, 58], live: [75, 76, 55, 58] } : { spotify: [27, 24, 44, 42], youtube: [73, 24, 56, 42], website: [16, 51, 41, 50], bandcamp: [84, 51, 59, 50], facebook: [30, 82, 44, 60], live: [70, 82, 56, 60] }; Object.entries(coords).forEach(([name, values]) => { const line = document.querySelector(`.pulse-${name}`); if (!line) return; line.setAttribute('x1', values[0]); line.setAttribute('y1', values[1]); line.setAttribute('x2', values[2]); line.setAttribute('y2', values[3]); }); } setStageHeight(); if (window.visualViewport) { window.visualViewport.addEventListener('resize', setStageHeight); window.visualViewport.addEventListener('scroll', setStageHeight); } window.addEventListener('resize', setStageHeight); const stage = document.getElementById('astro-universe-stage'); Object.entries(assets).forEach(([name, id]) => { const url = getCarrdImageUrl(id); if (!url) return; const img = document.createElement('img'); img.src = url; img.alt = name; img.className = name === 'core' ? 'astro-core-image' : `astro-portal astro-${name}`; if (name !== 'core') { img.addEventListener('click', function () { window.open(links[name], '_blank', 'noopener,noreferrer'); }); } stage.appendChild(img); }); setPulseCoordinates(); window.addEventListener('resize', setPulseCoordinates); function refreshAstroLayout() { setStageHeight(); setPulseCoordinates(); const core = document.querySelector('.astro-core-image'); if (core) { core.style.top = window.innerWidth <= 736 ? '37%' : '50%'; core.style.animation = 'none'; core.offsetHeight; core.style.animation = ''; } } setTimeout(refreshAstroLayout, 450); }); Upcoming live streams and shows will be announced here