forked from nmelhado/league-page
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
league page, legends league specific
- Loading branch information
Nicholas Melhado
committed
Aug 1, 2021
0 parents
commit 4bc9595
Showing
180 changed files
with
11,679 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
||
|
||
 | ||
|
||
## [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`: | ||
 | ||
- Fill out the information in `/src/routes/managers/managers.js` | ||
 | ||
 | ||
- 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) | ||
 | ||
----------- | ||
## 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) --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
Oops, something went wrong.