Skip to content

Commit c4a456f

Browse files
committed
add assets and readme
1 parent 817ee8e commit c4a456f

File tree

4 files changed

+45
-21
lines changed

4 files changed

+45
-21
lines changed

Assets/home.png

158 KB
Loading

Assets/leaderboard.png

188 KB
Loading

README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-
# SwordManager
1+
# [Sword Manager](https://github.com/sk337/SwordManager)
2+
3+
> **100% client sided Sword Battle account manager written in react**
4+
5+
Use Now [here](https://sk337.github.io/SwordManager)
6+
7+
## Run Locally
8+
9+
1. Install Node js
10+
2. Clone the Repository
11+
3. Update Submodules `git submodule update --init` **Required**
12+
4. Install Dependencys with `npm install`
13+
5. Start server with `npm run dev`
14+
6. go to [localhost:5173](http://localhost:5173)
15+
16+
## Contributing
17+
18+
Contributions are Greatly appreciated and can be done at [github.com](https://github.com/sk337/SwordManager)
19+
20+
## contact
21+
22+
* Github: [sk337](https://github.com/sk337)
23+
* Discord: @rf.to
24+
* Replit: [@1gn](https://replit.com/@1gn)

src/Profile.jsx

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import React, { useState, useEffect } from "react";
22
import Nav from "@/components/nav";
33
import { getPubInfo } from "@/utils/login";
4-
import {
5-
Avatar,
6-
AvatarFallback,
7-
AvatarImage,
8-
} from "@/components/ui/avatar";
4+
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
95
import {
106
Card,
117
CardContent,
@@ -14,12 +10,15 @@ import {
1410
CardHeader,
1511
CardTitle,
1612
} from "@/components/ui/card";
13+
import cosmetics from "@/../cosmetics";
1714

18-
import { dateParse } from "@/utils/jsutils";
15+
import { dateParse, prettyNum } from "@/utils/jsutils";
1916

2017
export default function Profile() {
21-
const urlData = new URL("https://"+window.location.hash.replace("#", "q/s"))
22-
console.log(urlData)
18+
const urlData = new URL(
19+
"https://" + window.location.hash.replace("#", "q/"),
20+
);
21+
// console.log(urlData);
2322
if (!urlData.searchParams.get("user")) {
2423
return (
2524
<main>
@@ -43,15 +42,15 @@ export default function Profile() {
4342
fetchUser();
4443
}, []);
4544

46-
4745
if (user && !user.error) {
46+
console.log(user);
4847
return (
4948
<main>
5049
<Nav />
5150
<div className="flex flex-col items-center">
5251
<div className="felx flex-row items-center justify-center p-5">
5352
<h1 className="text-3xl font-bold text-center">Profile</h1>
54-
<Card>
53+
<Card className="w-[400px]">
5554
<CardHeader>
5655
<CardTitle>{user.account.username}</CardTitle>
5756
</CardHeader>
@@ -61,26 +60,28 @@ export default function Profile() {
6160
<AvatarImage src={user.image} />
6261
<AvatarFallback>AV</AvatarFallback>
6362
</Avatar>
64-
<div className="space-y-2">
65-
<p>Joined: {dateParse(user.account.created_at)}</p>
66-
<p>XP: {user.account.xp}</p>
63+
<div>
64+
<p>
65+
<span className="text-sky-500">Joined:</span>{" "}
66+
{dateParse(user.account.created_at)}
67+
</p>
68+
<p>
69+
<span className="text-sky-500">XP:</span> {prettyNum(user.account.xp)}
70+
</p>
6771
</div>
6872
</div>
69-
<p>Level: {user.account.level}</p>
73+
<p><span className="text-sky-500">User Id: </span>{prettyNum(user.account.id)}<br/>{user.account.lastUsernameChange != null ? <span className="text-sky-500">Last Username change: <span className="text-white">{dateParse(user.account.lastUsernameChange)}<br/></span></span> :""}<span className="text-sky-500">Profile Views: </span>{prettyNum(user.account.profile_views)}</p>
7074
</CardContent>
7175
<CardFooter>
7276
<p>More stats coming soon</p>
7377
</CardFooter>
7478
</Card>
75-
7679
</div>
7780
</div>
7881
</main>
7982
);
80-
} else if(user.error){
81-
return (
82-
<p>not found</p>
83-
)
83+
} else if (user.error) {
84+
return <p>not found</p>;
8485
} else {
8586
return (
8687
<main>
@@ -89,4 +90,4 @@ export default function Profile() {
8990
</main>
9091
);
9192
}
92-
}
93+
}

0 commit comments

Comments
 (0)