added alt text to spaceweather images via js

This commit is contained in:
Quinten0508 2024-07-27 12:29:06 +02:00
parent ad12cd0f92
commit a51c44307c

View File

@ -22,10 +22,14 @@ document.addEventListener('DOMContentLoaded', function() {
: 'https://quinten0508.com/api/spaceweather/ovation-south.jpg'; : 'https://quinten0508.com/api/spaceweather/ovation-south.jpg';
ovationImage.src = imageUrl; ovationImage.src = imageUrl;
ovationImage.alt = isNorthOvation ? 'Northern Hemisphere Aurora Ovatio visualization'
: 'Southern Hemisphere Aurora Ovation visualization';
} }
function fetchOverviewImage() { function fetchOverviewImage() {
overview.src = 'https://quinten0508.com/api/spaceweather/overview.gif'; overview.src = 'https://quinten0508.com/api/spaceweather/overview.gif';
overview.alt = 'Solar flux and geomagnetic activity graphed'
} }
toggleButton.addEventListener('click', function() { toggleButton.addEventListener('click', function() {