Commit count!
This commit is contained in:
parent
c863ea1363
commit
c10ee88e74
3 changed files with 20 additions and 6 deletions
17
index.js
17
index.js
|
@ -45,6 +45,8 @@ if (!fs.existsSync(path.join(staticpath, 'cached'))) {
|
|||
|
||||
var randomQuotes = config.quotes
|
||||
|
||||
var commitCount = "300+"
|
||||
|
||||
function get_img_url(activity, size = "large_image") {
|
||||
|
||||
if ("assets" in activity) {
|
||||
|
@ -225,7 +227,7 @@ async function pageUpdate() {
|
|||
var currentPercent = (Date.now() - activity.timestamps.start) / (activity.timestamps.end - activity.timestamps.start) * 100
|
||||
addedHTML += `
|
||||
<div class="chip activity col-md-6 testing">
|
||||
<img src="${get_img(activity)}" title="${activity.assets.large_text || activity.assets.small_text}">
|
||||
<img src="${get_img(activity)}" title="${activity.assets.large_text || activity.assets.small_text || activity.state || ""}">
|
||||
<p>
|
||||
Listening to <span style="color: limegreen;">${activity.name}</span>
|
||||
<br> Song: ${activity.details || " "}
|
||||
|
@ -364,6 +366,8 @@ async function pageUpdate() {
|
|||
html = html.replace("{OPPOSITE_BRANCH}", "Beta")
|
||||
}
|
||||
|
||||
html = html.replace("{COMMIT_COUNT}", commitCount)
|
||||
|
||||
html = html.replace("{UPTIME}", gameTimeFormatter((Date.now() - uptime) / 1000))
|
||||
html = html.replace("{LAST_LANYARD}", gameTimeFormatter((Date.now() - lastLanyardUpdate) / 1000) + ' ago')
|
||||
html = html.replace("{QUOTE_COUNT}", randomQuotes.length)
|
||||
|
@ -449,4 +453,13 @@ app.use((req, res, next) => {
|
|||
<h1>404</h1>
|
||||
<p>Uh oh... I think your lost? There's nothing here :P</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("<b>") + 3, commits.lastIndexOf("</b>"))
|
||||
commitCount = commits
|
||||
}
|
||||
|
||||
updateCommits()
|
|
@ -22,6 +22,7 @@
|
|||
<body>
|
||||
<h1>Welcome to Violet's Purgatory</h1>
|
||||
<p style="white-space: pre-wrap;">{RANDOM_QUOTE}</p>
|
||||
<p style="">{COMMIT_COUNT} Commits</p>
|
||||
<div class="fadediv">
|
||||
<div class="container-fluid row" id="card">
|
||||
<h2>Violet</h2>
|
||||
|
|
|
@ -93,7 +93,7 @@ a {
|
|||
}
|
||||
|
||||
.chip:hover {
|
||||
background-color: rgb(65, 28, 101);
|
||||
background-color: rgb(10, 0, 25);
|
||||
transform: scale(1);
|
||||
/* font-size: 1.35rem; */
|
||||
border-color: white;
|
||||
|
@ -101,7 +101,7 @@ a {
|
|||
}
|
||||
|
||||
.chip:hover > .smallimg {
|
||||
background-color: rgb(65, 28, 101);
|
||||
background-color: rgb(10, 0, 25);
|
||||
}
|
||||
|
||||
.activity {
|
||||
|
@ -131,12 +131,12 @@ a {
|
|||
height: 64px;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 74px;
|
||||
left: 72px;
|
||||
border-radius: 50px;
|
||||
background: black;
|
||||
padding: 5px;
|
||||
/* border: 2px gray solid; */
|
||||
transform: scale(0.8);
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
.activity>.smallimg:hover {
|
||||
|
|
Loading…
Reference in a new issue