mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-04 02:34:13 +02:00
highlight player dot/spec on hover
This commit is contained in:
parent
04ae714282
commit
3644dbda6e
7 changed files with 355 additions and 298 deletions
|
|
@ -8,6 +8,8 @@ export interface PlayerProp {
|
|||
height: number;
|
||||
};
|
||||
scale: number;
|
||||
onHover: (userId: number) => void;
|
||||
highlighted: boolean;
|
||||
}
|
||||
|
||||
const healthMap = {
|
||||
|
|
@ -51,12 +53,15 @@ export function Player(props: PlayerProp) {
|
|||
const rotate = () => `rotate(${270 - props.player.angle})`;
|
||||
|
||||
return <g
|
||||
onmouseover={() => props.onHover(props.player.info.userId)}
|
||||
onmouseout={() => props.onHover(0)}
|
||||
transform={transform()}>
|
||||
<polygon points="-6,14 0, 16 6,14 0,24" fill="white"
|
||||
opacity={imageOpacity()}
|
||||
transform={rotate()}/>
|
||||
<circle r={16} stroke-width={1.5} stroke="white" fill={teamColor()}
|
||||
opacity={alpha()}/>
|
||||
<circle r={16} stroke-width={props.highlighted ? 5 : 1.5} stroke="white" fill={teamColor()}
|
||||
opacity={alpha()}
|
||||
/>
|
||||
{getClassImage(props.player, imageOpacity())}
|
||||
</g>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue