Skip to content

Commit

Permalink
clean up scoreboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nikfrank committed Oct 15, 2017
1 parent 612570f commit 7cee84b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions canon/crib/src/pure/Scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const seStyle = {
zIndex: 10,
};

const trackWidth = 2;
const trackWidth = 5;

const divColor = ({ pts, player })=> ([0,1,2].map( pp=>
Math.min( 255, player !== pp ? 0 : (100 + pts * 6) )
Math.min( 255, (player + pp -1 <= 0) ? 0 : (100 + pts * 6) )
) );

const divPerSE = ({ pts, total, player, color=divColor({pts, player}) }) => {
Expand Down Expand Up @@ -38,11 +38,11 @@ const divPerSE = ({ pts, total, player, color=divColor({pts, player}) }) => {

return {
[edgeDim]: player * trackWidth,
[runDim]: `calc( ${player*trackWidth}px + ${(total % 30) / 0.3}v${thickDim[0]} )`,
[runDim]: `${(total % 30) / 0.3}v${thickDim[0]}`,
[thinDim]: trackWidth,
[thickDim]: `calc( ${pts / 0.3}v${thickDim[0]} - ${2*player*trackWidth + 2}px )`,
[thickDim]: `${pts / 0.3}v${thickDim[0]}`,

border: '1px solid white',
border: `1px dashed rgb(${color[0]}, ${color[1]}, ${color[2]}, 0.375)`,
backgroundColor: `rgb(${color[0]}, ${color[1]}, ${color[2]})`
};
}
Expand Down

0 comments on commit 7cee84b

Please sign in to comment.