Compare commits

..

No commits in common. "main" and "1.1.12" have entirely different histories.
main ... 1.1.12

7 changed files with 11 additions and 41 deletions

View file

@ -7,8 +7,7 @@ node_modules
.env.* .env.*
!.env.example !.env.example
# Ignore files for PNPM, NPM, YARN and BUN # Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml pnpm-lock.yaml
package-lock.json package-lock.json
yarn.lock yarn.lock
bun.lockb

View file

@ -28,15 +28,12 @@ jobs:
- name: ⬇️ Checkout Repository - name: ⬇️ Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: ⚙️ Update website debug info - name: Update debug.json with Git info
run: | run: |
export TAG=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///') export TAG=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///')
export SHA=$(echo "${{ github.sha }}") export SHA=$(echo "${{ github.sha }}")
echo 'sed -i "s|\"commit\": \"unavailable\"|\"commit\": \"$SHA\"|" /workspace/sangelo/website/static/assets/debug.json' sed -i "s|\"commit\": \"\"|\"commit\": \"$SHA\"|" /workspace/sangelo/website/static/assets/debug.json
sed -i "s|\"commit\": \"unavailable\"|\"commit\": \"$SHA\"|" /workspace/sangelo/website/static/assets/debug.json || echo "Failed to plant debug info into debug.json. (commit hash)" sed -i "s|\"tag\": \"\"|\"tag\": \"$TAG\"|" /workspace/sangelo/website/static/assets/debug.json
echo 'sed -i "s|\"tag\": \"unavailable\"|\"tag\": \"$TAG\"|" /workspace/sangelo/website/static/assets/debug.json'
sed -i "s|\"tag\": \"unavailable\"|\"tag\": \"$TAG\"|" /workspace/sangelo/website/static/assets/debug.json || echo "Failed to plant debug info into debug.json. (git tag)"
echo "Successfully planted debug info into debug.json"
- name: 🐋 Build Container - name: 🐋 Build Container
run: | run: |

View file

@ -7,8 +7,7 @@ node_modules
.env.* .env.*
!.env.example !.env.example
# Ignore files for PNPM, NPM, YARN and BUN # Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml pnpm-lock.yaml
package-lock.json package-lock.json
yarn.lock yarn.lock
bun.lockb

View file

@ -289,7 +289,7 @@
{#if showDebugInfo} {#if showDebugInfo}
<div class="debug-ct"> <div class="debug-ct">
<div class="debug-info"> <div class="debug-info">
Commit: <pre>{commitHash}</pre> <p>Commit Hash: </p><pre>{commitHash}</pre>
</div> </div>
<div class="debug-info"> <div class="debug-info">
<p>Git Tag: </p><pre>{gitTag}</pre> <p>Git Tag: </p><pre>{gitTag}</pre>

View file

@ -198,7 +198,6 @@
p, pre { p, pre {
margin: 0; margin: 0;
text-wrap: nowrap;
} }
} }
} }

View file

@ -1,5 +1,4 @@
{ {
"__comment__": "Do not edit file directly, this will be populated by the build script.", "commit": "",
"commit": "unavailable", "tag": ""
"tag": "unavailable"
} }

View file

@ -1,14 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<!-- <!--
(c) Sangelo 2024 (c) Sangelo
v1.0.2
----------------
Simple countdown webpage that can be used as a startpage Simple countdown webpage that can be used as a startpage
You can feed the date the counter should be counting down to in the URL like this: You can feed the date the counter should be counting down to in the URL like this:
http://<countdown>/?date=YYYY-MM-DDTHH:MM:SS http://<countdown>/?date=YYYY-MM-DDTHH:MM:SS
or you can display the current time using ?time parameter like this:
http://<countdown>/?time
--> -->
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
@ -50,7 +46,6 @@
const countdownElement = document.getElementById("countdown"); const countdownElement = document.getElementById("countdown");
const countdownDate = getDateFromUrl(); const countdownDate = getDateFromUrl();
const showCurrentTime = getTimeFromUrl();
function updateCountdown() { function updateCountdown() {
const now = new Date().getTime(); const now = new Date().getTime();
@ -76,16 +71,6 @@
requestAnimationFrame(updateCountdown); requestAnimationFrame(updateCountdown);
} }
function updateTime() {
const now = new Date();
const hours = formatWithLeadingZeros(now.getHours(), 2);
const minutes = formatWithLeadingZeros(now.getMinutes(), 2);
const seconds = formatWithLeadingZeros(now.getSeconds(), 2);
countdownElement.innerHTML = `${hours}:${minutes}:${seconds}`;
requestAnimationFrame(updateTime);
}
function getDateFromUrl() { function getDateFromUrl() {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const dateParam = urlParams.get('date'); const dateParam = urlParams.get('date');
@ -98,16 +83,8 @@
return new Date("1970-01-01T00:00:00").getTime(); return new Date("1970-01-01T00:00:00").getTime();
} }
function getTimeFromUrl() { requestAnimationFrame(updateCountdown);
const urlParams = new URLSearchParams(window.location.search);
return urlParams.has('time');
}
if (showCurrentTime) {
requestAnimationFrame(updateTime);
} else {
requestAnimationFrame(updateCountdown);
}
</script> </script>
</body> </body>
</html> </html>