highlight ubered players
All checks were successful
CI / checks (push) Successful in 1m1s

This commit is contained in:
Robin Appelman 2025-06-26 01:43:09 +02:00
commit c96f2e6b7b
5 changed files with 39 additions and 8 deletions

View file

@ -51,6 +51,9 @@ export function Player(props: PlayerProp) {
const imageOpacity = () => props.player.health === 0 ? 0 : (1 + alpha()) / 2;
const transform = () => `translate(${scaledX()} ${scaledY()}) scale(${1 / props.scale})`;
const rotate = () => `rotate(${270 - props.player.angle})`;
const filter = () => props.player.ubered ? ((props.player.team === Team.Red) ? 'url(#sofGlowRed)' : 'url(#sofGlowBlue)') : '';
console.log(props.player);
return <g
onmouseover={() => props.onHover(props.player.info.userId)}
@ -59,8 +62,10 @@ export function Player(props: PlayerProp) {
<polygon points="-6,14 0, 16 6,14 0,24" fill="white"
opacity={imageOpacity()}
transform={rotate()}/>
<circle r={16} stroke-width={props.highlighted ? 4 : 1.5} stroke="white" fill={teamColor()}
<circle r={16} stroke-width={props.highlighted ? 4 : 1.5} stroke="white"
fill={teamColor()}
opacity={alpha()}
filter={filter()}
/>
{getClassImage(props.player, imageOpacity())}
</g>