Skip to content

Commit 4bc9595

Browse files
author
Nicholas Melhado
committed
league page, legends league specific
0 parents  commit 4bc9595

File tree

180 files changed

+11679
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+11679
-0
lines changed

README.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<div align="center">
2+
<img alt="League Page logo" src="https://storage.googleapis.com/nfl-player-data/League%20Page.png" width="100px" />
3+
4+
**(Unofficial) Sleeper League Page Template**
5+
6+
7+
Generate a custom league page for your Sleeper fantasy football league in just a few steps
8+
</div>
9+
10+
11+
![League Page demo](https://storage.googleapis.com/nfl-player-data/league-page-demo.png)
12+
13+
## [Live demo](https://www.legendsleagueff.com/)
14+
-----------
15+
<div align="center">
16+
<i>If you and your league like League Page, please consider supporting the project (and encouraging your leaguemates to too!)</i><br>
17+
<a href="https://www.buymeacoffee.com/nmelhado" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" style="height: 60px !important; width: 217px !important;" width="217px" height="60px" ></a>
18+
</div>
19+
20+
## Features
21+
- Up-to-date league information
22+
- Easy to navigate trade and waiver history
23+
- Awards and accolades
24+
- Records and rankings for every season
25+
- Current season power rankings
26+
- Previous drafts and upcoming draft preview
27+
- Season matchups
28+
- Manager bio pages
29+
- League constitution
30+
- Helpful fantasy football resources and news<br><br>
31+
- Built using [Svelte](https://svelte.dev/docs) and [SvelteKit](https://kit.svelte.dev/docs)
32+
- League information generated from [Sleeper API](https://docs.sleeper.app/)
33+
34+
35+
## Roadmap
36+
- [ ] Playoff matchups and current bracket
37+
- [ ] Dynasty power rankings
38+
- [ ] Hyperlink all manager references
39+
- [ ] Fix all css issues when actively resizing the window
40+
<!-- - [x] ~~performance optimizations~~ -->
41+
42+
## Some real-life League Pages
43+
- [Legends League](https://www.legendsleagueff.com/)
44+
45+
### 1. Setup your own League Page
46+
- Fork this repo
47+
- Replace `your_league_id` with your Sleeper league ID in `/src/lib/utils/helperFunctions/leagueData.js`:
48+
![league ID instructions](https://storage.googleapis.com/nfl-player-data/league_id_instructions.png)
49+
- Fill out the information in `/src/routes/managers/managers.js`
50+
![manager object](https://storage.googleapis.com/nfl-player-data/managersObj.png)
51+
![manager rendering](https://storage.googleapis.com/nfl-player-data/managerRendering.png)
52+
- Fill out the manager to roster ID mapping object in `/src/lib/utils/rosterManagers.js` (fill out the appropriate managers array number for each roster ID)
53+
- Customize your league constitution `/src/routes/constitution/index.svelte` (remember to adjust the table of contents accordingly)
54+
- Write your homepage text (league intro/bio) `/src/routes/index.svelte` (remember to adjust the table of contents accordingly)
55+
![homepage text](https://storage.googleapis.com/nfl-player-data/homepage_text.png)
56+
-----------
57+
## For local developing [npm](https://docs.npmjs.com/getting-started/what-is-npm):
58+
59+
npm install
60+
npm run dev --
61+
npm run dev -- --host` (to test on other devices locally)
62+
## To deploy on [Vercel](https://vercel.com/):
63+
- Push up your changes
64+
- [Link your github repo to Vercel](https://vercel.com/guides/deploying-svelte-with-vercel#step-2:-deploying-your-svelte-app-with-vercel)
65+
- That's it!
66+
67+
<!-- ## Development
68+
see [CONTRIBUTING.md](.github/CONTRIBUTING.md) -->

_helper/vite-workaround.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import path from "path";
2+
import fs from "fs";
3+
4+
function removeFiles(startPath, filter) {
5+
if (!fs.existsSync(startPath)) {
6+
console.log("no dir ", startPath);
7+
return;
8+
}
9+
10+
var files = fs.readdirSync(startPath);
11+
for (var i = 0; i < files.length; i++) {
12+
var filename = path.join(startPath, files[i]);
13+
var stat = fs.lstatSync(filename);
14+
if (stat.isDirectory()) {
15+
removeFiles(filename, filter); //recurse
16+
} else if (filename.indexOf(filter) >= 0) {
17+
console.log("-- removing file: ", filename);
18+
fs.unlinkSync(filename);
19+
}
20+
}
21+
}
22+
function removeSourceMaps(startPath) {
23+
if (!fs.existsSync(startPath)) {
24+
console.log("no dir ", startPath);
25+
return;
26+
}
27+
28+
var files = fs.readdirSync(startPath);
29+
for (var i = 0; i < files.length; i++) {
30+
var filename = path.join(startPath, files[i]);
31+
var stat = fs.lstatSync(filename);
32+
if (stat.isDirectory()) {
33+
removeSourceMaps(filename); //recurse
34+
} else if (filename.endsWith(".js")) {
35+
let fileContent = fs.readFileSync(filename).toString();
36+
let result = fileContent.replace(/^\/\/# sourceMappingURL=.+$/gm, "");
37+
if (result !== fileContent) {
38+
console.log("-- removing SourceMap link: ", filename);
39+
fs.writeFileSync(filename, result);
40+
}
41+
}
42+
}
43+
}
44+
45+
console.log("Starting Vite Workaround Script");
46+
removeFiles("node_modules/@material", ".js.map");
47+
removeSourceMaps("node_modules/@material");

jsconfig.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"$lib/*": ["src/lib/*"]
6+
}
7+
},
8+
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
9+
}

0 commit comments

Comments
 (0)