8 Commits

Author SHA1 Message Date
68483e10ef chore(deps): update dependency eslint to v9 2024-04-17 00:57:18 +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
5 changed files with 1780 additions and 1469 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
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.

View File

@ -21,7 +21,7 @@
"autoprefixer": "^10.0.1",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"eslint": "^8",
"eslint": "^9.0.0",
"eslint-config-next": "14.0.3"
}
}

3157
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

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
}, [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">
<div className="flex gap-1 flex-col p-2">
<p>
{formatNumber(ppDiff, 2)}pp until rank {formatNumber(rank)}
</p>
{startedAt && (
<p>
{formatNumber(ppDiff, 2)}pp until rank {formatNumber(rank)}
Day {formatNumber(getDaysSince(new Date(Number(startedAt))) + 1)}
</p>
{startedAt && (
<p>Day {getDaysSince(new Date(Number(startedAt))) + 1}</p>
)}
</div>
)}
)}
</div>
</main>
);
}