From 83841ce3d3ea7688dd2c301166718569066083a6 Mon Sep 17 00:00:00 2001 From: Quinten0508 <55107945+Quinten0508@users.noreply.github.com> Date: Fri, 5 Jul 2024 23:01:40 +0200 Subject: [PATCH] * updated links * added spaceweather everything * hidden sidebar on mobile / mobile layout fix --- TODO.html | 9 ++ assets/icons/compass.svg | 47 +++++++ assets/icons/debian.gif | Bin 0 -> 904 bytes assets/scripts/spaceweather.js | 46 +++++++ index.html | 41 +++++-- links.html | 163 ++++++++++++++++++------- style.css | 216 +++++++++++++++++++++++---------- 7 files changed, 402 insertions(+), 120 deletions(-) create mode 100644 assets/icons/compass.svg create mode 100644 assets/icons/debian.gif create mode 100644 assets/scripts/spaceweather.js diff --git a/TODO.html b/TODO.html index 7fc0fa2..e4dbb72 100644 --- a/TODO.html +++ b/TODO.html @@ -88,6 +88,15 @@ --- ## Make a short bio (scary!) + + --- + ## Space weather! + * https://services.swpc.noaa.gov/images/animations/ovation/north/latest.jpg + * fetch new image every 10min to new API :3 + * some one sentence forecast from https://services.swpc.noaa.gov as well + * + + --- ## Add fun animations to the background Comets, twinkling stars, other animated pixel dithering waves or something idk! diff --git a/assets/icons/compass.svg b/assets/icons/compass.svg new file mode 100644 index 0000000..bc6a631 --- /dev/null +++ b/assets/icons/compass.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/debian.gif b/assets/icons/debian.gif new file mode 100644 index 0000000000000000000000000000000000000000..1f617c843d90ae670aac8198ebaf7676b4853224 GIT binary patch literal 904 zcmV;319$vKNk%w1VORhk0K@XE5T4OOWIi;MXArKf+DLIrK?-6m-X39z_7;LK&hN5rGeLT3W?(rV?V-qM*@;0uf?&u+P%ZI=~`) zVkwiyBFTnuIM#Or)~@8G_64xCuKIW11MDb5RV#0cF8@C85zPI|U5}Q%GW1 z36-558sb5~7t9+@1*Fl@6i3w^S38y)fsm686bVOEP`aorkf1_sNGP%L=*qE$j!eb6 zBaqp&M%azed(XsuGo#{=nR$LIcn~L?bOKC`(w>WO)c^fZ0I>2WJFBaL~nd0SClk7I;lS_+c;0 z4G+gjGT0`z4=j}yn|nut-^+&&fKUOI@67=YlYg)o`0)n3%MS>^IX-Y6C1<}#-GjUU zBghd@0Ru)9P{9NKox$1vc=z1^zyq!U@Ld4_wAWuzmBi2zeuLc*plcEx_#0FsJ^|GO z4}8~vgcU4dA$}wjL&0_{@W%rYI3Ne%a8N+lnT5!O0zm)`(6{1uUc5L2F@3;b;}9J( zC}02rR9Pj6FfBOTix3`JL6RfhXhJ|Uy6|KS z0dur)W)8mLwB?9Pab^UBV*G~Q4fMfcr;>T5kOgEY{D}j7zxnnheGb6afPfCLa@Y+c z`i7iuUb-0Ok~7fI9aZTOS7epEVMb-F&%s1w7U>1>KmhwtscV}<5Mk`G$R>;ItFSfe eY@S6ZEA6z@R%`7Iwb)*f?Y7)@>n#x>00294Idgje literal 0 HcmV?d00001 diff --git a/assets/scripts/spaceweather.js b/assets/scripts/spaceweather.js new file mode 100644 index 0000000..b4e189f --- /dev/null +++ b/assets/scripts/spaceweather.js @@ -0,0 +1,46 @@ +document.addEventListener('DOMContentLoaded', function() { + const ovationImage = document.getElementById('spaceweather-ovation'); + const forecast = document.getElementById('spaceweather-forecast'); + const overview = document.getElementById('spaceweather-overview'); + const toggleButton = document.getElementById('spaceweather-button'); + let isNorthOvation = true; + + async function fetchSpaceWeatherText() { + try { + const response = await fetch('https://quinten0508.com/api/spaceweather/3-day-forecast.txt'); + if (!response.ok) throw new Error('Network response was not ok'); + const text = await response.text(); + forecast.textContent = text; + } catch (error) { + console.error('Error fetching space weather text:', error); + } + } + + function fetchSpaceWeatherImage() { + const imageUrl = isNorthOvation + ? 'https://quinten0508.com/api/spaceweather/ovation-north.jpg' + : 'https://quinten0508.com/api/spaceweather/ovation-south.jpg'; + + ovationImage.src = imageUrl; + } + + function fetchOverviewImage() { + overview.src = 'https://quinten0508.com/api/spaceweather/overview.gif'; + } + + toggleButton.addEventListener('click', function() { + isNorthOvation = !isNorthOvation; + fetchSpaceWeatherImage(); + }); + + // Fetch text and images immediately on load + fetchSpaceWeatherText(); + fetchSpaceWeatherImage(); + fetchOverviewImage(); + + // Fetch images every 10 minutes + setInterval(() => { + fetchSpaceWeatherImage(); + fetchOverviewImage(); + }, 600000); +}); \ No newline at end of file diff --git a/index.html b/index.html index 994bb72..67f1ad3 100644 --- a/index.html +++ b/index.html @@ -6,13 +6,14 @@ +
- +
+

Space Weather

+ +
+
+

Source: Space Weather Prediction Center (NOAA)

+

+
+                    
+
+ + +
+ + +
+ + +

titleee

@@ -109,14 +133,14 @@
-
@@ -138,5 +162,6 @@ - + + \ No newline at end of file diff --git a/links.html b/links.html index 0b4e575..4dd8757 100644 --- a/links.html +++ b/links.html @@ -8,24 +8,38 @@ @@ -33,7 +47,7 @@
-