Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge development into production #2224

Merged
merged 29 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9b3b4de
fix: black cat stats
metalcupcake5 Apr 5, 2024
1da4bbd
feat: update ghoul pet and add vit/mending stats
metalcupcake5 Apr 6, 2024
57500a4
feat: update giraffe pet and add swing range stat
metalcupcake5 Apr 6, 2024
6fb251f
feat: update golem pet
metalcupcake5 Apr 6, 2024
eb7ef97
feat: update hound pet
metalcupcake5 Apr 6, 2024
4303b64
feat: color certain pet stats
metalcupcake5 Apr 6, 2024
896dc80
feat: update megalodon pet
metalcupcake5 Apr 6, 2024
26c2250
feat: update pigman pet
metalcupcake5 Apr 6, 2024
556baea
chore: remove comment
metalcupcake5 Apr 6, 2024
2f47662
feat: update skeleton pet
metalcupcake5 Apr 6, 2024
0ffeabc
feat: switch mojang api from ashcon to matdoes
metalcupcake5 Apr 6, 2024
82a2735
feat: update snowman pet
metalcupcake5 Apr 6, 2024
054a840
feat: move undead symbol and add arachnal symbol
metalcupcake5 Apr 6, 2024
febb9c4
feat: update spider pet
metalcupcake5 Apr 6, 2024
15278d3
feat: update zombie pet
metalcupcake5 Apr 6, 2024
2128c32
feat: update turtle pet
metalcupcake5 Apr 6, 2024
9500db7
feat: update wither skeleton pet
metalcupcake5 Apr 6, 2024
d6f8923
fix: correct ammonite stats
metalcupcake5 Apr 6, 2024
23fd261
fix: twemojis breaking, feat: add april fools theme
DuckySoLucky Apr 6, 2024
4cdc67b
feat: add credits for wallpaper
DuckySoLucky Apr 6, 2024
12dfa2a
refactor: compress image
DuckySoLucky Apr 6, 2024
2c6b5d5
fix: message for ironamn and bingo profiles
DuckySoLucky Apr 6, 2024
85b0424
feat: add new pet skins
DuckySoLucky Apr 6, 2024
2a8734b
fix: add comma where needed
Shiiyu Apr 6, 2024
4bf867d
Merge pull request #2219 from SkyCryptWebsite/uuid-api
Shiiyu Apr 6, 2024
334323f
Merge pull request #2221 from DuckySoLucky/fixLoadingTimeAndAddAprilF…
Shiiyu Apr 6, 2024
7f4682a
Merge pull request #2222 from DuckySoLucky/fixProifleInfo
Shiiyu Apr 6, 2024
a590fd5
Merge pull request #2223 from DuckySoLucky/featNewPetSKins
Shiiyu Apr 6, 2024
b9842be
Merge pull request #2220 from SkyCryptWebsite/pet-stats
Shiiyu Apr 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions common/constants/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,6 @@ export const STATS_DATA = {
suffix: "",
color: "a",
},
undead: {
name: "Undead",
nameLore: "Undead",
nameShort: "Undead",
nameTiny: "U",
symbol: "༕",
suffix: "",
color: "2",
},
alchemy_wisdom: {
name: "Alchemy Wisdom",
nameLore: "Alchemy Wisdom",
Expand Down Expand Up @@ -360,6 +351,13 @@ export const STATS_DATA = {
nameTiny: "BPC",
symbol: "ൠ",
},
swing_range: {
name: "Swing Range",
nameLore: "Swing Range",
nameShort: "Swing Range",
nameTiny: "SR",
symbol: "Ⓢ",
},
};

export const HIDDEN_STATS = [
Expand All @@ -380,6 +378,8 @@ const symbols = {
soulflow: "⸎",
dungeon_upgrade: "⚚",
dye: "✿",
undead: "༕",
arachnal: "Ж",
};
for (const stat in STATS_DATA) {
symbols[stat] = STATS_DATA[stat].symbol;
Expand Down
2 changes: 1 addition & 1 deletion includes/footer.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@twemoji/api@latest/dist/twemoji.min.js" crossorigin="anonymous"></script>

<script>
window.addEventListener('load', (event) => {
Expand Down
1 change: 1 addition & 0 deletions includes/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<ul>
<li>Resource Pack: <a rel="noreferrer" href="https://www.planetminecraft.com/texture_pack/16x132-dandelion-cute-and-swirly/" target="_blank">Dandelion</a> by <span class="name">Steelfeathers</span></li>
<li>Shaders: <a rel="noreferrer" href="https://sildurs-shaders.github.io/" target="_blank">Sildur's Vibrant Shaders</a> by <span class="name">Sildur</span></li>
<li>April Fools 2024: <a rel="noreferrer" href="https://wall.alphacoders.com/big.php?i=684569" target="_blank">Wallpaper</a> by <span class="name">Tinkerbell</span></li>
</ul>
</li>
<li>Libraries:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
19 changes: 19 additions & 0 deletions public/resources/scss/shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,25 @@
--§f: #929292;
}

.april-fools-2024 {
--§0: #ff1493;
--§1: #ff4500;
--§2: #ff00b3;
--§3: #ff2f7f;
--§4: #4c0b1d;
--§5: #e87da7;
--§6: #d95c8f;
--§7: #fd3995;
--§8: #c556b3;
--§9: #f5b0c7;
--§a: #f9d5e1;
--§b: #8f1f47;
--§c: #4c0b1d;
--§d: #b93e6d;
--§e: #ff69b4;
--§f: #fcf0f5;
}

&:not(.light),
&:not(.light) .nice-colors-auto,
.nice-colors-light {
Expand Down
20 changes: 20 additions & 0 deletions public/resources/themes/april-fools-2024.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "April Fools 2024 Theme",
"author": "DuckySoLucky",
"schema": 2,
"images": {
"bg": "/resources/img/themes/april-fools-2024/bg.webp"
},
"backgrounds": {
"skillbar": { "type": "stripes", "angle": "45deg", "colors": ["#fc46aa", "#F699CD"], "width": 10 },
"maxedbar": { "type": "stripes", "angle": "45deg", "colors": ["#fa86c4", "#F25278"], "width": 10 }
},
"colors": {
"logo": "#fc46aa",
"link": "#fc46aa",
"icon": "#fc46aa",
"hover": "#fc46aa",
"maxed": "#d95c8f",
"gold": "#e87da7"
}
}
1 change: 1 addition & 0 deletions public/resources/ts/elements/theme-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const themeURLs = [
"draconic",
"burning-cinnabar",
"candycane",
"april-fools-2024",
].map((name) => `/resources/themes/${name}.json`);

themeURLs.push(...JSON.parse(localStorage.getItem("customThemeUrls") ?? "[]"));
Expand Down
52 changes: 49 additions & 3 deletions public/resources/ts/stats-defer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { renderLore } from "../../../common/formatting.js";

import { getPlayerStats } from "./calculate-player-stats";
import { RARITY_COLORS } from "../../../common/constants.js";
import { owoifyMessage } from "../../../src/constants/themes/april-fools-2024/index.js";

import("./elements/inventory-view");
import("./elements/guild-button");
Expand Down Expand Up @@ -242,6 +243,8 @@ function fillLore(element: HTMLElement) {
return;
}

const owofiyLore = localStorage.getItem("currentThemeUrl") === "/resources/themes/april-fools-2024.json";

const itemNameString = ((item as Item).tag?.display?.Name ?? item.display_name ?? "???") as string;
const colorCode = itemNameString.match(/^§([0-9a-fklmnor])/i);
if (colorCode && colorCode[1]) {
Expand All @@ -261,6 +264,10 @@ function fillLore(element: HTMLElement) {
itemNameContent.innerHTML = `[Lvl ${(item as Pet).level.level}] ${item.display_name}`;
}

if (owofiyLore === true) {
itemNameContent.innerHTML = owoifyMessage(itemNameContent.innerHTML);
}

if (item.texture_path) {
itemIcon.style.backgroundImage = 'url("' + item.texture_path + '")';
itemIcon.className = "stats-piece-icon item-icon custom-icon";
Expand All @@ -280,9 +287,11 @@ function fillLore(element: HTMLElement) {
if ("lore" in item) {
itemLore.innerHTML = item.lore;
} else if ("tag" in item && Array.isArray(item.tag.display?.Lore)) {
itemLore.innerHTML = item.tag.display.Lore.map(
(line: string) => '<span class="lore-row">' + renderLore(line) + "</span>",
).join("");
itemLore.innerHTML = item.tag.display.Lore.map((line: string) => {
const newLine = owofiyLore ? owoifyMessage(line) : line;

return '<span class="lore-row">' + renderLore(newLine) + "</span>";
}).join("");
} else {
itemLore.innerHTML = "";
}
Expand Down Expand Up @@ -921,3 +930,40 @@ export function formatNumber(number: number, floor: boolean, rounding = 10): str
element.appendChild(node);
});
}

const currentTheme = localStorage.getItem("currentThemeUrl");
if (currentTheme === "/resources/themes/april-fools-2024.json") {
document.querySelectorAll("*").forEach((element) => {
// return lore text color to default color (so it's not pink)
if (element.classList.contains("item-lore")) {
element.classList.add("nice-colors-light");
return;
}

element.classList.add("april-fools-2024");

const owoifyElements = [
"stat-name",
"stat-value",
"stat-sub-header",
"narrow-info-name",
"stat-header",
"inventory-tab-name",
"category-name",
"nav-item",
"text-stats-for",
"pet-name",
"pet-level",
"skill-name",
"kill-entity",
"tier-name",
"skill-name",
"rank-name",
"player-name",
"profile-name",
];
if (owoifyElements.some((owoifyElement) => element.classList.contains(owoifyElement))) {
element.innerHTML = owoifyMessage(element.innerHTML);
}
});
}
8 changes: 8 additions & 0 deletions public/resources/ts/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ function processTheme(theme: Theme): ProcessedTheme {
return processedTheme;
}

const REFRESH_THEMES = ["/resources/themes/april-fools-2024.json"];
export async function loadTheme(themeUrl: string): Promise<void> {
const oldThemeUrl = localStorage.getItem("currentThemeUrl") ?? "";
const theme = await getTheme(themeUrl);

const processedTheme = processTheme(theme);
Expand All @@ -209,6 +211,12 @@ export async function loadTheme(themeUrl: string): Promise<void> {

localStorage.setItem("currentThemeUrl", themeUrl);
localStorage.setItem("processedTheme", JSON.stringify(processedTheme));

if (themeUrl !== oldThemeUrl) {
if (REFRESH_THEMES.includes(themeUrl) || REFRESH_THEMES.includes(oldThemeUrl)) {
location.reload();
}
}
}

window.addEventListener("storage", (event) => {
Expand Down
3 changes: 0 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import * as constants from "./constants.js";
import * as custom_resources from "./custom-resources.js";
import { SitemapStream, streamToPromise } from "sitemap";
import { createGzip } from "zlib";
import twemoji from "twemoji";
import cookieParser from "cookie-parser";

import * as apiRoute from "./routes/api.js";
Expand Down Expand Up @@ -219,8 +218,6 @@ async function getFavoritesFormUUIDs(uuids) {
async function getExtra(page = null, favoriteUUIDs = [], cacheOnly) {
const output = {};

output.twemoji = twemoji;

output.packs = custom_resources.getPacks();

output.isFoolsDay = isFoolsDay;
Expand Down
Loading
Loading