From 68eed012d33dbb731108b616b5e0717723b82539 Mon Sep 17 00:00:00 2001 From: Nadir Technologies Date: Wed, 29 Nov 2023 16:15:12 +0000 Subject: [PATCH] Bug fixes and About page --- about.html | 44 +++++++++++++++++++++ about.js | 16 ++++++++ index.html | 11 ++++-- script.js | 111 ++++++++++++++++++++++++++++++++++------------------- 4 files changed, 140 insertions(+), 42 deletions(-) create mode 100644 about.html create mode 100644 about.js diff --git a/about.html b/about.html new file mode 100644 index 0000000..a17e41d --- /dev/null +++ b/about.html @@ -0,0 +1,44 @@ + + + + + + Image Viewer + + + + + + + +
+
+

Loading...

+

+
+ +
+ + + +
+
+ + + + diff --git a/about.js b/about.js new file mode 100644 index 0000000..0666953 --- /dev/null +++ b/about.js @@ -0,0 +1,16 @@ +const username = 'Nadir-Software'; +const repo = 'images'; + +fetch(`https://api.github.com/repos/${username}/${repo}/commits?per_page=1`) + .then(response => { + const totalCount = response.headers.get('Link').match(/page=(\d+)>; rel="last"/)[1]; + return response.json().then(data => { + const latestCommitMessage = data[0].commit.message; + console.log(`Total commit count: ${totalCount}`); + console.log(`Latest commit message: ${latestCommitMessage}`); + + document.getElementById("version").innerText = `Version ${totalCount} Release Notes`; + document.getElementById("whats-new").innerText = latestCommitMessage; + }); +}) +.catch(error => console.error('Error fetching data:', error)); \ No newline at end of file diff --git a/index.html b/index.html index 9ab685a..344044b 100644 --- a/index.html +++ b/index.html @@ -11,10 +11,15 @@