8 Commits

Author SHA1 Message Date
01935f78e9 chore(deps): update dependency @types/node to v20.11.30 2024-03-23 20:59:29 +00:00
47b8116fd7 update readme
All checks were successful
Publish / deploy (push) Successful in 45s
2023-11-22 15:44:16 +00:00
394e65d0da add usage instead of saying missing values
All checks were successful
Publish / deploy (push) Successful in 44s
2023-11-22 15:42:29 +00:00
58149a8061 fix missing values messages
All checks were successful
Publish / deploy (push) Successful in 1m32s
2023-11-22 15:38:04 +00:00
2fc7257929 update readme 2023-11-22 15:37:50 +00:00
c64f38eec7 fix calc message & format day count 2023-11-22 15:30:09 +00:00
Lee
d6f4dd8c19 Merge pull request 'chore: Configure Renovate' (#1) from renovate/configure into master
All checks were successful
Publish / deploy (push) Successful in 44s
Reviewed-on: #1
2023-11-21 17:52:31 +00:00
e691bcfd26 chore(deps): add renovate.json 2023-11-21 15:01:29 +00:00
4 changed files with 51 additions and 45 deletions

View File

@ -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 Usage: <https://ss-pp-to-rank-overlay.fascinated.cc/?id=YOUR_SCORESABER_ID&rank=1&started=START_TIME_IN_MILIS> </br>
npm run dev Example:
# or <https://ss-pp-to-rank-overlay.fascinated.cc/?id=76561198449412074&rank=1000&started=1700575968398>
yarn dev
# or
pnpm dev
# or
bun dev
```
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. You can remove the &started= part if you don't want the day counter.
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.

6
pnpm-lock.yaml generated
View File

@ -18,7 +18,7 @@ dependencies:
devDependencies: devDependencies:
'@types/node': '@types/node':
specifier: ^20 specifier: ^20
version: 20.9.3 version: 20.11.30
'@types/react': '@types/react':
specifier: ^18 specifier: ^18
version: 18.2.38 version: 18.2.38
@ -276,8 +276,8 @@ packages:
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
dev: true dev: true
/@types/node@20.9.3: /@types/node@20.11.30:
resolution: {integrity: sha512-nk5wXLAXGBKfrhLB0cyHGbSqopS+nz0BUgZkUQqSHSSgdee0kssp1IAqlQOu333bW+gMNs2QREx7iynm19Abxw==} resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==}
dependencies: dependencies:
undici-types: 5.26.5 undici-types: 5.26.5
dev: true dev: true

6
renovate.json Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>Fascinated/renovate-config"
]
}

View File

@ -53,21 +53,41 @@ export default function Home() {
setInterval(updateRank, 1000 * 60 * 1); // update every minute setInterval(updateRank, 1000 * 60 * 1); // update every minute
}, [mounted, updateRank]); }, [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 ( return (
<main className="text-xl text-white"> <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"> <div className="flex gap-1 flex-col p-2">
<p> <p>
{formatNumber(ppDiff, 2)}pp until rank {formatNumber(rank)} {formatNumber(ppDiff, 2)}pp until rank {formatNumber(rank)}
</p> </p>
{startedAt && ( {startedAt && (
<p>Day {getDaysSince(new Date(Number(startedAt))) + 1}</p> <p>
Day {formatNumber(getDaysSince(new Date(Number(startedAt))) + 1)}
</p>
)} )}
</div> </div>
)}
</main> </main>
); );
} }