Skip to content

Commit

Permalink
feat: update page title
Browse files Browse the repository at this point in the history
  • Loading branch information
ridemountainpig committed Sep 8, 2023
1 parent 05a4ea7 commit 776b54a
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 88 deletions.
29 changes: 14 additions & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"

# Maintain dependencies for yarn
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
# Maintain dependencies for yarn
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
2 changes: 1 addition & 1 deletion .github/workflows/ThemeList.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
schedule:
- cron: "0 */24 * * *"
workflow_dispatch:

jobs:
make-request:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ app.get(["/:userId/:themeName", "/:userId"], async (req, res) => {
domain: process.env.DOMAIN,
userId: req.params.userId,
theme: getTheme(
req.params.themeName ? req.params.themeName : "serika_dark"
req.params.themeName ? req.params.themeName : "serika_dark",
),
userData: await getUserData(req.params.userId),
svgUrl: `${process.env.DOMAIN}/generate-svg/${req.params.userId}/${req.params.themeName}?lbpb=true`,
Expand Down Expand Up @@ -103,7 +103,7 @@ app.get("/generate-svg/:userId/:themeName", async (req, res) => {
theme,
badge,
leaderBoards,
personalBests
personalBests,
);
res.set("Content-Type", "image/svg+xml");
res.send(svg);
Expand Down
38 changes: 19 additions & 19 deletions public/script/generateSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
const imagePath = `public/image/userImg/${userData.discordId}-${userData.discordAvatar}.png`;
await downloadUserImg(
`https://cdn.discordapp.com/avatars/${userData.discordId}/${userData.discordAvatar}.png?size=256`,
imagePath
imagePath,
);

// Convert the image file to base64
Expand Down Expand Up @@ -349,12 +349,12 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
}
if (pbWords[words[i]].wpm != "-") {
pbWords[words[i]].wpm = Math.round(
parseFloat(pbWords[words[i]].wpm)
parseFloat(pbWords[words[i]].wpm),
);
}
if (pbWords[words[i]].acc != "-") {
pbWords[words[i]].acc = Math.floor(
parseFloat(pbWords[words[i]].acc)
parseFloat(pbWords[words[i]].acc),
);
}
}
Expand All @@ -378,8 +378,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbTime["15"].acc}${
pbTime["15"].acc == "-" ? "" : "%"
}
pbTime["15"].acc == "-" ? "" : "%"
}
</div>
</div>
<div class="mx-2 w-26 flex-col items-center justify-center">
Expand All @@ -394,8 +394,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbTime["30"].acc}${
pbTime["30"].acc == "-" ? "" : "%"
}
pbTime["30"].acc == "-" ? "" : "%"
}
</div>
</div>
<div class="mx-2 w-26 flex-col items-center justify-center">
Expand All @@ -410,8 +410,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbTime["60"].acc}${
pbTime["60"].acc == "-" ? "" : "%"
}
pbTime["60"].acc == "-" ? "" : "%"
}
</div>
</div>
<div class="mx-2 w-26 flex-col items-center justify-center">
Expand All @@ -426,8 +426,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbTime["120"].acc}${
pbTime["120"].acc == "-" ? "" : "%"
}
pbTime["120"].acc == "-" ? "" : "%"
}
</div>
</div>
</div>
Expand All @@ -452,8 +452,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbWords["10"].acc}${
pbWords["10"].acc == "-" ? "" : "%"
}
pbWords["10"].acc == "-" ? "" : "%"
}
</div>
</div>
<div class="mx-2 w-26 flex-col items-center justify-center">
Expand All @@ -468,8 +468,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbWords["25"].acc}${
pbWords["25"].acc == "-" ? "" : "%"
}
pbWords["25"].acc == "-" ? "" : "%"
}
</div>
</div>
<div class="mx-2 w-26 flex-col items-center justify-center">
Expand All @@ -484,8 +484,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbWords["50"].acc}${
pbWords["50"].acc == "-" ? "" : "%"
}
pbWords["50"].acc == "-" ? "" : "%"
}
</div>
</div>
<div class="mx-2 w-26 flex-col items-center justify-center">
Expand All @@ -500,8 +500,8 @@ async function getSvg(userData, theme, badge, leaderBoards, personalbests) {
<div class="py-1 text-center font-mono text-2xl font-medium tracking-wider"
style="color: ${theme.textColor};">
${pbWords["100"].acc}${
pbWords["100"].acc == "-" ? "" : "%"
}
pbWords["100"].acc == "-" ? "" : "%"
}
</div>
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions public/script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $("#createNowBtn").click(function () {
{
scrollTop: targetElement.offset().top,
},
800
800,
);
});

Expand Down Expand Up @@ -62,7 +62,7 @@ $("#generateReadmeBtn").click(function () {
}
$("#previewReadmeLink").attr(
"href",
`https://monkeytype.com/profile/${monkeytypeName}`
`https://monkeytype.com/profile/${monkeytypeName}`,
);
$("#previewReadmeImg").attr("src", url);
updateReadmeCode();
Expand Down Expand Up @@ -96,11 +96,11 @@ function initialReadmeBtn(buttonId, buttonState) {
if (!buttonState) {
$(buttonId).removeClass("bg-slate-100 text-gray-400");
$(buttonId).addClass(
"bg-nord-light-green text-nord-light-bg opacity-60"
"bg-nord-light-green text-nord-light-bg opacity-60",
);
} else {
$(buttonId).removeClass(
"bg-nord-light-green text-nord-light-bg opacity-60"
"bg-nord-light-green text-nord-light-bg opacity-60",
);
$(buttonId).addClass("bg-slate-100 text-gray-400");
}
Expand Down Expand Up @@ -137,7 +137,7 @@ function showBorder(themeName) {
$(`#${themeListState.themeName}`).css("border", "");
$(`#${themeListState.themeName}`).css(
"border-color",
themeListState.borderColor
themeListState.borderColor,
);
}
$(`#${themeName}`).css("border", `4px solid ${borderColor}`);
Expand Down Expand Up @@ -259,7 +259,7 @@ async function themeList() {
themeList[i]["bgColor"],
themeList[j]["bgColor"],
themeList[i]["name"],
themeList[j]["name"]
themeList[j]["name"],
)
) {
let temp = themeList[i];
Expand All @@ -280,8 +280,8 @@ async function themeList() {
onclick="showBorder('${themeList[i]["name"]}')">
<div class="col-span-5 flex justify-center items-center tracking-wider font-medium h-full"
style="color: ${themeList[i]["mainColor"]};">${themeList[i][
"name"
].replace(/_/g, " ")}</div>
"name"
].replace(/_/g, " ")}</div>
</div>
`;
$("#themeListContainer").append(html);
Expand Down
8 changes: 4 additions & 4 deletions public/script/monkeytypeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function getFaviconTheme() {
name: themesData[i].name,
bgColor: themesData[i].bgColor,
mainColor: themesData[i].mainColor,
}
};
faviconData[i] = data;
}

Expand Down Expand Up @@ -108,7 +108,7 @@ async function getMonkeyTypeThemesByName(themeName) {
.then((data) => {
let cssData = data.substring(
data.indexOf("{"),
data.indexOf("}") + 1
data.indexOf("}") + 1,
);

cssData = cssData
Expand Down Expand Up @@ -146,14 +146,14 @@ async function getMonkeyTypeBadgesData() {
const content = atob(data.content);
let badgesData = content.slice(
content.search("{"),
content.search("};") + 1
content.search("};") + 1,
);
badgesData = badgesData
.replace(/(\w+)\s*:/g, '"$1":')
.replace(/,(\s*[\]}])/g, "$1")
.replace(
/(\w+:)|(\w+ :)/g,
(matchedStr) => '"' + matchedStr.replace(/:/g, "") + '":'
(matchedStr) => '"' + matchedStr.replace(/:/g, "") + '":',
)
.replace(/\"/g, '"')
.replace(/\"animation\"/g, "animation");
Expand Down
Loading

0 comments on commit 776b54a

Please sign in to comment.