Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
inker committed Jul 12, 2024
1 parent ecba67d commit 829305e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/containers/LeagueStage/Matrix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ function Matrix({
return o;
}, [schedule]);

const getMatchdayColor = (index: number) => {
if (index === 0) {
return undefined;
}
const turn = (angleByIndex[index] ?? index) / (numMatchdays - 1);
const deg = turn * 360;
return `lch(50% 100 ${deg})`;
};

const handleTableMouseOver = useCallback(
(e: React.MouseEvent<HTMLTableElement>) => {
const opponentId =
Expand Down Expand Up @@ -253,10 +262,7 @@ function Matrix({
) : (
<span
style={{
color:
matchdayIndex === 0
? undefined
: `lch(50% 100 ${((angleByIndex[matchdayIndex] ?? matchdayIndex) / (numMatchdays - 1)) * 360})`,
color: getMatchdayColor(matchdayIndex),
}}
>
{matchdayIndex + 1}
Expand Down

0 comments on commit 829305e

Please sign in to comment.