-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9595d86
commit 982733e
Showing
25 changed files
with
619 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
.playerRadar { | ||
position: absolute; | ||
bottom: 0; | ||
height: 25vh; | ||
width: 25vh; | ||
min-width: 10rem; | ||
min-height: 10rem; | ||
background-color: var(--world-ui-color-bg); | ||
} | ||
|
||
.playerRadar canvas { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.playerStats { | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
height: 25vh; | ||
width: 40vh; | ||
min-height: 10rem; | ||
min-width: 15rem; | ||
background-color: var(--world-ui-color-bg); | ||
} | ||
|
||
.playerStatsContainer { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-evenly; | ||
height: 100%; | ||
margin: 1rem; | ||
margin-top: 0; | ||
} | ||
|
||
.playerStatsItem { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
margin-bottom: 0.5rem; | ||
} | ||
|
||
.playerStatsLabel { | ||
font-size: 1rem; | ||
} | ||
|
||
.playerStatsValue { | ||
font-size: 1rem; | ||
} | ||
|
||
@media screen and (max-width: 768px) { | ||
.playerRadar { | ||
height: 15vh; | ||
width: 15vh; | ||
min-height: 8rem; | ||
min-width: 8rem; | ||
bottom: calc(50% - max(15vh / 2, 8rem / 2)); | ||
} | ||
|
||
.playerStats { | ||
height: 15vh; | ||
width: 15vh; | ||
min-height: 8rem; | ||
min-width: 10rem; | ||
left: 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import styles from "./PlayerHUD.module.css"; | ||
|
||
const PlayerControls = ({ gameStart, hudData }: ControlProps): JSX.Element => { | ||
return ( | ||
<div style={{ visibility: gameStart ? "visible" : "hidden" }}> | ||
<div className={styles.playerRadar}> | ||
<canvas id="radar-canvas" className={styles.playerRadarCanvas}></canvas> | ||
</div>{" "} | ||
<div className={styles.playerStats}> | ||
<div className={styles.playerStatsContainer}> | ||
<div className={styles.playerStatsItem}> | ||
<span className={styles.playerStatsLabel}>Aircraft:</span> | ||
<span className={styles.playerStatsValue}>{hudData.name}</span> | ||
</div> | ||
<div className={styles.playerStatsItem}> | ||
<span className={styles.playerStatsLabel}>Speed:</span> | ||
<span className={styles.playerStatsValue}> | ||
{hudData.speed} km/h | ||
</span> | ||
</div> | ||
<div className={styles.playerStatsItem}> | ||
<span className={styles.playerStatsLabel}>Altitude:</span> | ||
<span className={styles.playerStatsValue}> | ||
{hudData.altitude} ft | ||
</span> | ||
</div> | ||
<div className={styles.playerStatsItem}> | ||
<span className={styles.playerStatsLabel}>Bank Angle:</span> | ||
<span className={styles.playerStatsValue}>{hudData.roll}°</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PlayerControls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.