-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converting to tracking rankings by manager (#185)
This PR holds several key changes - Rankings are now tracked by manager (for all time records as well as in the manager page) - This increases the overall accuracy of the Records and Rankings page (as well as the manager pages) - It now uses the league specific avatar (if one exists) - The chart style has been updated to better accommodate more entries (horizontal bars instead of vertical) - Waivers have received a face lift and now look much cleaner and better - Commissioner badge added on the managers pages Preview of changes below: | Old | New | |---|---| | ![old waivers](https://user-images.githubusercontent.com/39418000/211601742-568d71ff-e3e1-4419-8c23-2aed436b46d7.png) | ![new waivers](https://user-images.githubusercontent.com/39418000/211601802-6ec40035-569b-4d58-902e-4fa4d936f6aa.png) | | ![old waivers tr](https://user-images.githubusercontent.com/39418000/211602064-c2617271-12ba-40e9-acc5-ddfc53efb5ff.png) | ![new waivers tr](https://user-images.githubusercontent.com/39418000/211602119-cb56b85f-8f52-481e-86d2-9ee9722b6a2e.png) | | ![old records single](https://user-images.githubusercontent.com/39418000/211602226-72b5d79c-a8c8-40ab-920b-62ff879846e9.png) | ![new records - single](https://user-images.githubusercontent.com/39418000/211602267-cbb9ac26-c7c1-4eb7-8306-2fcc0c4e4776.png) | | ![old records vs](https://user-images.githubusercontent.com/39418000/211602352-814d3daa-a013-4548-bd00-b2fa99f7be89.png) | ![new records vs](https://user-images.githubusercontent.com/39418000/211602397-92b7275e-7ff9-4b05-b1fd-355f67c7bbb6.png) | | ![old chart](https://user-images.githubusercontent.com/39418000/211602484-f59b219a-bda8-4901-8d4c-f3d320453b0e.png) | ![new chart](https://user-images.githubusercontent.com/39418000/211602542-17908108-f74a-4e32-a7f0-b1d9883a6056.png) | __**Due to the enormity of this change, there may be bugs. I have done my best to check the edge conditions, but the scope of this is large enough that I may have missed some**__
- Loading branch information
Showing
82 changed files
with
1,735 additions
and
1,374 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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,156 @@ | ||
<script> | ||
import { getAvatarFromTeamManagers, getTeamNameFromTeamManagers, gotoManager, round } from "./utils/helperFunctions/universalFunctions"; | ||
export let leagueTeamManagers, stat, label, xMin, xMax, secondStat, managerID, rosterID, color, year; | ||
$: user = managerID ? leagueTeamManagers.users[managerID] : null; | ||
</script> | ||
|
||
<style> | ||
:global(.opacity) { | ||
opacity: 0.3; | ||
} | ||
.barParent { | ||
position: relative; | ||
margin-bottom: -10px; | ||
height: 76px; | ||
} | ||
.managerName { | ||
position: absolute; | ||
top: 0; | ||
left: 80px; | ||
} | ||
.teamAvatar { | ||
position: absolute; | ||
left: 20px; | ||
top: 0; | ||
bottom: 0; | ||
height: 40px; | ||
margin: auto; | ||
border-radius: 50%; | ||
border: 2px solid; | ||
z-index: 14; | ||
background-color: #fff; | ||
} | ||
.statBars { | ||
display: flex; | ||
margin: 0 auto; | ||
} | ||
.leftSpacer { | ||
width: 40px; | ||
height: 1px; | ||
display: inline-block; | ||
} | ||
.rightSpacer { | ||
width: 20px; | ||
height: 1px; | ||
display: inline-block; | ||
} | ||
.bars { | ||
flex-grow: 2; | ||
position: relative; | ||
} | ||
.bar { | ||
height: 1.8em; | ||
border-radius: 0 0.9em 0.9em 0; | ||
z-index: 10; | ||
} | ||
.secondBar { | ||
position: absolute; | ||
top: 0; | ||
z-index: 11; | ||
left: 0; | ||
} | ||
.barLabel { | ||
z-index: 12; | ||
vertical-align: text-top; | ||
margin-left: 40px; | ||
} | ||
.vCenter { | ||
display: block; | ||
height: 1.8em; | ||
position: absolute; | ||
width: 100%; | ||
top: 0; | ||
bottom: 0; | ||
margin: auto 0; | ||
} | ||
.clickable { | ||
cursor: pointer; | ||
} | ||
@media (max-width: 600px) { | ||
.barParent { | ||
/* margin-bottom: -10px; */ | ||
height: 57px; | ||
} | ||
.managerName { | ||
left: 60px; | ||
font-size: 0.8em; | ||
} | ||
.teamAvatar { | ||
left: 10px; | ||
height: 30px; | ||
} | ||
.barLabel { | ||
margin-left: 30px; | ||
vertical-align: middle; | ||
font-size: 0.8em; | ||
} | ||
.leftSpacer { | ||
width: 30px; | ||
} | ||
.rightSpacer { | ||
width: 10px; | ||
} | ||
.bar { | ||
height: 1.2em; | ||
border-radius: 0 0.6em 0.6em 0; | ||
} | ||
.vCenter { | ||
height: 1.2em; | ||
} | ||
} | ||
</style> | ||
|
||
<div class="barParent"> | ||
<img alt="team avatar" on:click={() => gotoManager({leagueTeamManagers, managerID, rosterID})} style="border-color: var({color});" class="teamAvatar clickable" src="{user ? `https://sleepercdn.com/avatars/thumbs/${user.avatar}` : getAvatarFromTeamManagers(leagueTeamManagers, rosterID, year)}" /> | ||
<span class="managerName clickable" on:click={() => gotoManager({leagueTeamManagers, managerID, rosterID})}> | ||
{#if user} | ||
{user.display_name} | ||
{:else if rosterID} | ||
{getTeamNameFromTeamManagers(leagueTeamManagers, rosterID, year)} | ||
{/if} | ||
</span> | ||
<div class="vCenter"> | ||
<div class="statBars"> | ||
<div class="leftSpacer" /> | ||
<div class="bars"> | ||
<div class="bar{!secondStat ? '' : ' opacity'}" style="background-color: var({color}); width: {(stat - xMin) / (xMax - xMin == 0 ? 1 : (xMax - xMin)) * 100}%;"> | ||
{#if !secondStat} | ||
<span class="barLabel">{stat}{label}</span> | ||
{/if} | ||
</div> | ||
{#if secondStat} | ||
<div class="bar secondBar" style="background-color: var({color}); width: {(secondStat - xMin) / (xMax - xMin == 0 ? 1 : (xMax - xMin)) * 100}%;"> | ||
<span class="barLabel">{secondStat} of {stat} ({round(secondStat/stat*100)}%)</span> | ||
</div> | ||
{/if} | ||
</div> | ||
<div class="rightSpacer" /> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.