From 737c788c76f645f490e42a0844ca3637cffa259e Mon Sep 17 00:00:00 2001 From: Bingus_Violet Date: Thu, 8 Feb 2024 17:28:17 -0600 Subject: [PATCH] Working commit count --- index.js | 11 +---------- pageUpdater.js | 15 ++++++++++++++- static/style.css | 4 +++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index acbb255..b6da12b 100644 --- a/index.js +++ b/index.js @@ -180,13 +180,4 @@ app.use((req, res, next) => {

404

Uh oh... I think your lost? There's nothing here :P

`) -}) - -async function updateCommits() { - var codebergResponse = await (await fetch(`https://codeberg.org/Bingus_Violet/Violets-Purgatory/src/branch/${process.env.BRANCH || "origin"}`)).text() - var commits = codebergResponse.substring(0, codebergResponse.indexOf("Commits")) - commits = commits.substring(commits.lastIndexOf("") + 3, commits.lastIndexOf("")) - commitCount = commits -} - -updateCommits() \ No newline at end of file +}) \ No newline at end of file diff --git a/pageUpdater.js b/pageUpdater.js index c87469a..980884f 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -4,6 +4,8 @@ fs = require('fs') var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json'))) var highlightedWords = config.highlightedWords +var commitCount = "300+" + function makeStars() { var html = "" @@ -49,6 +51,8 @@ function converter(html) { html = html.replaceAll("{BG_EFFECT}", makeStars()) + html = html.replaceAll("{COMMIT_COUNT}", commitCount) + return html } @@ -68,4 +72,13 @@ module.exports = { middleWare: function(req, res, next) { res.send(data) } } -} \ No newline at end of file +} + +async function updateCommits() { + var codebergResponse = await (await fetch(`https://codeberg.org/Bingus_Violet/Violets-Purgatory/src/branch/${process.env.BRANCH || "origin"}`)).text() + var commits = codebergResponse.substring(0, codebergResponse.indexOf("Commits")) + commits = commits.substring(commits.lastIndexOf("") + 3, commits.lastIndexOf("")) + commitCount = commits +} + +updateCommits() \ No newline at end of file diff --git a/static/style.css b/static/style.css index f32d3bc..ab42fbc 100644 --- a/static/style.css +++ b/static/style.css @@ -52,11 +52,13 @@ hr { font-size: 2.75rem; color: rgb(215, 80, 255); display: block; + padding-top: 5px; + line-height: 2.2rem; } .note { color: gray; - font-size: 0.9rem; + font-size: 1rem; } @keyframes mainText {