Compare commits
6 Commits
d6f4dd8c19
...
renovate/a
Author | SHA1 | Date | |
---|---|---|---|
6f7b6ff41c | |||
47b8116fd7 | |||
394e65d0da | |||
58149a8061 | |||
2fc7257929 | |||
c64f38eec7 |
42
README.md
42
README.md
@ -1,36 +1,16 @@
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
# Scoresaber PP to Rank Overlay
|
||||
|
||||
## Getting Started
|
||||
Nothing fancy, just made this for me and a friend but feel free to use it. </br>
|
||||
The text is white, so it you won't be able to see it. It will show up on OBS though.
|
||||
|
||||
First, run the development server:
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
```
|
||||
Usage: <https://ss-pp-to-rank-overlay.fascinated.cc/?id=YOUR_SCORESABER_ID&rank=1&started=START_TIME_IN_MILIS> </br>
|
||||
Example:
|
||||
<https://ss-pp-to-rank-overlay.fascinated.cc/?id=76561198449412074&rank=1000&started=1700575968398>
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
- ID: Your scoresaber ID
|
||||
- Rank: The rank you want to get to
|
||||
- Started: The time you started the song in miliseconds. You can get this at <https://www.unixtimestamp.com>
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||
You can remove the &started= part if you don't want the day counter.
|
||||
|
45
pnpm-lock.yaml
generated
45
pnpm-lock.yaml
generated
@ -27,7 +27,7 @@ devDependencies:
|
||||
version: 18.2.16
|
||||
autoprefixer:
|
||||
specifier: ^10.0.1
|
||||
version: 10.4.16(postcss@8.4.31)
|
||||
version: 10.4.18(postcss@8.4.31)
|
||||
eslint:
|
||||
specifier: ^8
|
||||
version: 8.54.0
|
||||
@ -519,15 +519,15 @@ packages:
|
||||
has-symbols: 1.0.3
|
||||
dev: true
|
||||
|
||||
/autoprefixer@10.4.16(postcss@8.4.31):
|
||||
resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==}
|
||||
/autoprefixer@10.4.18(postcss@8.4.31):
|
||||
resolution: {integrity: sha512-1DKbDfsr6KUElM6wg+0zRNkB/Q7WcKYAaK+pzXn+Xqmszm/5Xa9coeNdtP88Vi+dPzZnMjhge8GIV49ZQkDa+g==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
postcss: ^8.1.0
|
||||
dependencies:
|
||||
browserslist: 4.22.1
|
||||
caniuse-lite: 1.0.30001563
|
||||
browserslist: 4.23.0
|
||||
caniuse-lite: 1.0.30001594
|
||||
fraction.js: 4.3.7
|
||||
normalize-range: 0.1.2
|
||||
picocolors: 1.0.0
|
||||
@ -574,15 +574,15 @@ packages:
|
||||
fill-range: 7.0.1
|
||||
dev: true
|
||||
|
||||
/browserslist@4.22.1:
|
||||
resolution: {integrity: sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==}
|
||||
/browserslist@4.23.0:
|
||||
resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==}
|
||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
caniuse-lite: 1.0.30001563
|
||||
electron-to-chromium: 1.4.589
|
||||
node-releases: 2.0.13
|
||||
update-browserslist-db: 1.0.13(browserslist@4.22.1)
|
||||
caniuse-lite: 1.0.30001594
|
||||
electron-to-chromium: 1.4.693
|
||||
node-releases: 2.0.14
|
||||
update-browserslist-db: 1.0.13(browserslist@4.23.0)
|
||||
dev: true
|
||||
|
||||
/busboy@1.6.0:
|
||||
@ -612,6 +612,11 @@ packages:
|
||||
|
||||
/caniuse-lite@1.0.30001563:
|
||||
resolution: {integrity: sha512-na2WUmOxnwIZtwnFI2CZ/3er0wdNzU7hN+cPYz/z2ajHThnkWjNBOpEPP4n+4r2WPM847JaMotaJE3bnfzjyKw==}
|
||||
dev: false
|
||||
|
||||
/caniuse-lite@1.0.30001594:
|
||||
resolution: {integrity: sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==}
|
||||
dev: true
|
||||
|
||||
/chalk@4.1.2:
|
||||
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
||||
@ -762,8 +767,8 @@ packages:
|
||||
esutils: 2.0.3
|
||||
dev: true
|
||||
|
||||
/electron-to-chromium@1.4.589:
|
||||
resolution: {integrity: sha512-zF6y5v/YfoFIgwf2dDfAqVlPPsyQeWNpEWXbAlDUS8Ax4Z2VoiiZpAPC0Jm9hXEkJm2vIZpwB6rc4KnLTQffbQ==}
|
||||
/electron-to-chromium@1.4.693:
|
||||
resolution: {integrity: sha512-/if4Ueg0GUQlhCrW2ZlXwDAm40ipuKo+OgeHInlL8sbjt+hzISxZK949fZeJaVsheamrzANXvw1zQTvbxTvSHw==}
|
||||
dev: true
|
||||
|
||||
/emoji-regex@9.2.2:
|
||||
@ -866,8 +871,8 @@ packages:
|
||||
is-symbol: 1.0.4
|
||||
dev: true
|
||||
|
||||
/escalade@3.1.1:
|
||||
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
|
||||
/escalade@3.1.2:
|
||||
resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==}
|
||||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
@ -1818,8 +1823,8 @@ packages:
|
||||
- babel-plugin-macros
|
||||
dev: false
|
||||
|
||||
/node-releases@2.0.13:
|
||||
resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==}
|
||||
/node-releases@2.0.14:
|
||||
resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
|
||||
dev: true
|
||||
|
||||
/normalize-path@3.0.0:
|
||||
@ -2524,14 +2529,14 @@ packages:
|
||||
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
|
||||
dev: true
|
||||
|
||||
/update-browserslist-db@1.0.13(browserslist@4.22.1):
|
||||
/update-browserslist-db@1.0.13(browserslist@4.23.0):
|
||||
resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
dependencies:
|
||||
browserslist: 4.22.1
|
||||
escalade: 3.1.1
|
||||
browserslist: 4.23.0
|
||||
escalade: 3.1.2
|
||||
picocolors: 1.0.0
|
||||
dev: true
|
||||
|
||||
|
@ -53,21 +53,41 @@ export default function Home() {
|
||||
setInterval(updateRank, 1000 * 60 * 1); // update every minute
|
||||
}, [mounted, updateRank]);
|
||||
|
||||
if (!playerId || !rank) {
|
||||
return (
|
||||
<main className="text-xl p-2 text-black">
|
||||
<p>
|
||||
Usage:{" "}
|
||||
<span className="text-blue-500">
|
||||
<a href="https://git.fascinated.cc/Fascinated/scoresaber-pp-to-rank-overlay#usage">
|
||||
https://git.fascinated.cc/Fascinated/scoresaber-pp-to-rank-overlay#usage
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
if (!ppDiff) {
|
||||
return (
|
||||
<main className="text-xl p-2 text-white">
|
||||
<p>Calculating...</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="text-xl text-white">
|
||||
{!playerId && <p>Invalid player ID</p>}
|
||||
{!rank && <p>Invalid rank</p>}
|
||||
{!ppDiff && <p>Calculating...</p>}
|
||||
{ppDiff && (
|
||||
<div className="flex gap-1 flex-col p-2">
|
||||
<p>
|
||||
{formatNumber(ppDiff, 2)}pp until rank {formatNumber(rank)}
|
||||
</p>
|
||||
{startedAt && (
|
||||
<p>Day {getDaysSince(new Date(Number(startedAt))) + 1}</p>
|
||||
<p>
|
||||
Day {formatNumber(getDaysSince(new Date(Number(startedAt))) + 1)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user