can assign ball to a player, player with ball is surrounded
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
7ab18786cc
commit
7177c07ca0
@ -1,13 +1,26 @@
|
|||||||
import React from "react";
|
import React, {RefObject} from "react";
|
||||||
|
|
||||||
import "../../style/ball.css";
|
import "../../style/ball.css";
|
||||||
|
|
||||||
import Ball from "../../assets/icon/ball.svg?react";
|
import Ball from "../../assets/icon/ball.svg?react";
|
||||||
|
import Draggable from "react-draggable";
|
||||||
|
|
||||||
export function BallPiece() {
|
export interface BallPieceProps {
|
||||||
|
onDrop: () => void
|
||||||
|
pieceRef: RefObject<HTMLDivElement>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function BallPiece({onDrop, pieceRef}: BallPieceProps) {
|
||||||
return (
|
return (
|
||||||
<div className={`ball-div`}>
|
<Draggable
|
||||||
<Ball id={'ball'}/>
|
onStop={onDrop}
|
||||||
</div>
|
nodeRef={pieceRef}
|
||||||
|
position={{x: 0, y: 0}}
|
||||||
|
>
|
||||||
|
<div className={`ball-div`} ref={pieceRef}>
|
||||||
|
<Ball className={'ball'}/>
|
||||||
|
</div>
|
||||||
|
</Draggable>
|
||||||
)
|
)
|
||||||
}
|
}
|
@ -1,8 +1,10 @@
|
|||||||
#ball * {
|
.ball * {
|
||||||
fill: #c5520d;
|
fill: #c5520d;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ball {
|
.ball {
|
||||||
|
pointer-events: all;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue