Skip to content

Commit

Permalink
league page, legends league specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Melhado committed Aug 1, 2021
0 parents commit 4bc9595
Show file tree
Hide file tree
Showing 180 changed files with 11,679 additions and 0 deletions.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<div align="center">
<img alt="League Page logo" src="https://storage.googleapis.com/nfl-player-data/League%20Page.png" width="100px" />

**(Unofficial) Sleeper League Page Template**


Generate a custom league page for your Sleeper fantasy football league in just a few steps
</div>


![League Page demo](https://storage.googleapis.com/nfl-player-data/league-page-demo.png)

## [Live demo](https://www.legendsleagueff.com/)
-----------
<div align="center">
<i>If you and your league like League Page, please consider supporting the project (and encouraging your leaguemates to too!)</i><br>
<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>
</div>

## Features
- Up-to-date league information
- Easy to navigate trade and waiver history
- Awards and accolades
- Records and rankings for every season
- Current season power rankings
- Previous drafts and upcoming draft preview
- Season matchups
- Manager bio pages
- League constitution
- Helpful fantasy football resources and news<br><br>
- Built using [Svelte](https://svelte.dev/docs) and [SvelteKit](https://kit.svelte.dev/docs)
- League information generated from [Sleeper API](https://docs.sleeper.app/)


## Roadmap
- [ ] Playoff matchups and current bracket
- [ ] Dynasty power rankings
- [ ] Hyperlink all manager references
- [ ] Fix all css issues when actively resizing the window
<!-- - [x] ~~performance optimizations~~ -->

## Some real-life League Pages
- [Legends League](https://www.legendsleagueff.com/)

### 1. Setup your own League Page
- Fork this repo
- Replace `your_league_id` with your Sleeper league ID in `/src/lib/utils/helperFunctions/leagueData.js`:
![league ID instructions](https://storage.googleapis.com/nfl-player-data/league_id_instructions.png)
- Fill out the information in `/src/routes/managers/managers.js`
![manager object](https://storage.googleapis.com/nfl-player-data/managersObj.png)
![manager rendering](https://storage.googleapis.com/nfl-player-data/managerRendering.png)
- 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)
- Customize your league constitution `/src/routes/constitution/index.svelte` (remember to adjust the table of contents accordingly)
- Write your homepage text (league intro/bio) `/src/routes/index.svelte` (remember to adjust the table of contents accordingly)
![homepage text](https://storage.googleapis.com/nfl-player-data/homepage_text.png)
-----------
## For local developing [npm](https://docs.npmjs.com/getting-started/what-is-npm):

npm install
npm run dev --
npm run dev -- --host` (to test on other devices locally)
## To deploy on [Vercel](https://vercel.com/):
- Push up your changes
- [Link your github repo to Vercel](https://vercel.com/guides/deploying-svelte-with-vercel#step-2:-deploying-your-svelte-app-with-vercel)
- That's it!

<!-- ## Development
see [CONTRIBUTING.md](.github/CONTRIBUTING.md) -->
47 changes: 47 additions & 0 deletions _helper/vite-workaround.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import path from "path";
import fs from "fs";

function removeFiles(startPath, filter) {
if (!fs.existsSync(startPath)) {
console.log("no dir ", startPath);
return;
}

var files = fs.readdirSync(startPath);
for (var i = 0; i < files.length; i++) {
var filename = path.join(startPath, files[i]);
var stat = fs.lstatSync(filename);
if (stat.isDirectory()) {
removeFiles(filename, filter); //recurse
} else if (filename.indexOf(filter) >= 0) {
console.log("-- removing file: ", filename);
fs.unlinkSync(filename);
}
}
}
function removeSourceMaps(startPath) {
if (!fs.existsSync(startPath)) {
console.log("no dir ", startPath);
return;
}

var files = fs.readdirSync(startPath);
for (var i = 0; i < files.length; i++) {
var filename = path.join(startPath, files[i]);
var stat = fs.lstatSync(filename);
if (stat.isDirectory()) {
removeSourceMaps(filename); //recurse
} else if (filename.endsWith(".js")) {
let fileContent = fs.readFileSync(filename).toString();
let result = fileContent.replace(/^\/\/# sourceMappingURL=.+$/gm, "");
if (result !== fileContent) {
console.log("-- removing SourceMap link: ", filename);
fs.writeFileSync(filename, result);
}
}
}
}

console.log("Starting Vite Workaround Script");
removeFiles("node_modules/@material", ".js.map");
removeSourceMaps("node_modules/@material");
9 changes: 9 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"$lib/*": ["src/lib/*"]
}
},
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
Loading

0 comments on commit 4bc9595

Please sign in to comment.