Commit dbbf2469 authored by timel's avatar timel

refactor: 75%

parent 2c8593f1
#life-bar-container { .container {
position: fixed; position: fixed;
display: flex; display: flex;
top: 0; top: 0;
......
import "./index.scss"; import styles from "./index.module.scss";
import { Progress } from "antd"; import { Progress } from "antd";
import classNames from "classnames"; import classNames from "classnames";
...@@ -56,7 +56,7 @@ export const LifeBar: React.FC = () => { ...@@ -56,7 +56,7 @@ export const LifeBar: React.FC = () => {
}, [currentPlayer]); }, [currentPlayer]);
return ( return (
<div id="life-bar-container"> <div className={styles.container}>
<LifeBarItem <LifeBarItem
active={!matStore.isMe(currentPlayer)} active={!matStore.isMe(currentPlayer)}
name={snapPlayer.getOpPlayer().name ?? "?"} name={snapPlayer.getOpPlayer().name ?? "?"}
...@@ -99,22 +99,24 @@ const LifeBarItem: React.FC<{ ...@@ -99,22 +99,24 @@ const LifeBarItem: React.FC<{
}} }}
> >
<div <div
className={classNames("life-bar", { className={classNames(styles["life-bar"], {
"life-bar-activated": active, "life-bar-activated": active,
})} })}
> >
<div className="name">{name}</div> <div className={styles.name}>{name}</div>
<div className="life">{<AnimatedNumbers animateToNumber={life} />}</div> <div className={styles.life}>
{<AnimatedNumbers animateToNumber={life} />}
</div>
</div> </div>
{active && ( {active && (
<div className="timer-container"> <div className={styles["timer-container"]}>
<Progress <Progress
type="circle" type="circle"
percent={Math.floor((timeLimit / 240) * 100)} percent={Math.floor((timeLimit / 240) * 100)}
strokeWidth={20} strokeWidth={20}
size={14} size={14}
/> />
<div className="timer-text">{timeText}</div> <div className={styles["timer-text"]}>{timeText}</div>
</div> </div>
)} )}
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment