Skip to content

Commit

Permalink
Merge branch 'development' into power
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonXLF committed Jun 23, 2023
2 parents 3228e5c + 114ca6c commit 13eac5d
Show file tree
Hide file tree
Showing 27 changed files with 1,198 additions and 1,035 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,44 +166,6 @@ jobs:
- name: Build SCSS
run: pnpm scss

deploy-production:
name: deploy (production)
if: |
github.ref == 'refs/heads/production'
&& github.repository_owner == 'SkyCryptWebsite'
&& github.event_name != 'pull_request'
needs: [typescript, rollup, scss]
runs-on: ubuntu-latest
steps:
- name: SSH and Deploy to Production
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
port: ${{ secrets.VPS_PORT }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_KEY }}
script_stop: true
script: ~/deploy-production.sh

deploy-development:
name: deploy (development)
if: |
github.ref == 'refs/heads/development'
&& github.repository_owner == 'SkyCryptWebsite'
&& github.event_name != 'pull_request'
needs: [typescript, rollup, scss]
runs-on: ubuntu-latest
steps:
- name: SSH and Deploy to Development
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
port: ${{ secrets.VPS_PORT }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_KEY }}
script_stop: true
script: ~/deploy-development.sh

package-container:
name: package container
if: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ You can now run `pnpm start` to start it. You will be able to access the site on
- [FurfSky Reborn](https://hypixel.net/threads/4101579) by The Reborn Team
- [RNBW+](https://hypixel.net/threads/3470904) by rainbowcraft2
- [Hypixel Skyblock Pack](https://hypixel.net/threads/2103515) by Packs HQ
- [Hypixel Plus](https://hypixel.net/threads/4174260) by ic22487
- [Vanilla+](https://hypixel.net/threads/2147652) by TBlazeWarriorT
- [Worlds and Beyond](https://hypixel.net/threads/3597207) by Skeletony\_
- [Default Minecraft Textures](https://www.minecraft.net/) by Mojang
Expand Down
2 changes: 1 addition & 1 deletion common/constants/enchantments.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const MAX_ENCHANTS = new Set([
"Spiked Hook VI",
"Strong Mana X",
"Sugar Rush III",
"Sunder VI",
"Sunder V",
"Syphon V",
"Tabasco III",
"Thorns III",
Expand Down
2 changes: 2 additions & 0 deletions common/constants/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const RARITIES = [
"supreme",
"special",
"very_special",
"admin",
];

/** @typedef {"0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"a"|"b"|"c"|"d"|"e"|"f"} ColorCode */
Expand All @@ -28,4 +29,5 @@ export const RARITY_COLORS = {
supreme: "4",
special: "c",
very_special: "c",
admin: "4",
};
54 changes: 19 additions & 35 deletions common/formatting.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,44 +79,28 @@ export function renderLore(text) {
/**
* @param {number} number the number to be formatted
* @param {boolean} floor rounds down if true, up if false
* @param {number} rounding power of ten of the number of digits you want after the decimal point
* @param {number} decimals number of decimal places
*
* @returns {string} formatted number
*
* @example formatNumber(123456798, true, 10) = "123.4M"
* @example formatNumber(123456798, true, 100) = "123.45M"
* @example formatNumber(123456798, true, 1 = "123.4M"
* @example formatNumber(123456798, true, 2) = "123.45M"
*/
export function formatNumber(number, floor, rounding = 10) {
if (number < 1000) {
return String(Math.floor(number));
} else if (number < 10000) {
if (floor) {
return (Math.floor((number / 1000) * rounding) / rounding).toFixed(rounding.toString().length - 1) + "K";
} else {
return (Math.ceil((number / 1000) * rounding) / rounding).toFixed(rounding.toString().length - 1) + "K";
}
} else if (number < 1000000) {
if (floor) {
return Math.floor(number / 1000) + "K";
} else {
return Math.ceil(number / 1000) + "K";
}
} else if (number < 1000000000) {
if (floor) {
return (Math.floor((number / 1000 / 1000) * rounding) / rounding).toFixed(rounding.toString().length - 1) + "M";
} else {
return (Math.ceil((number / 1000 / 1000) * rounding) / rounding).toFixed(rounding.toString().length - 1) + "M";
}
} else if (floor) {
return (
(Math.floor((number / 1000 / 1000 / 1000) * rounding * 10) / (rounding * 10)).toFixed(
rounding.toString().length
) + "B"
);
} else {
return (
(Math.ceil((number / 1000 / 1000 / 1000) * rounding * 10) / (rounding * 10)).toFixed(rounding.toString().length) +
"B"
);

export function formatNumber(number, floor = false, decimals = 2) {
if (number === undefined) return 0;

if (floor === true) {
number = Math.floor(number);
}

if (number < 1000) return number.toLocaleString();

const abbrev = ["", "K", "M", "B", "T"];
const unformattedNumber = Math.abs(number);

const abbrevIndex = Math.floor(Math.log10(unformattedNumber) / 3);
const shortNumber = (unformattedNumber / Math.pow(10, abbrevIndex * 3)).toFixed(decimals);

return `${shortNumber}${abbrev[abbrevIndex]}`;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"sharp": "^0.30.7",
"sitemap": "^7.1.1",
"skinview3d": "^2.2.1",
"skyhelper-networth": "^1.11.8",
"skyhelper-networth": "^1.12.10",
"tippy.js": "^6.3.7",
"twemoji": "^14.0.2",
"upng-js": "^2.1.0",
Expand Down
Loading

0 comments on commit 13eac5d

Please sign in to comment.