Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added responsiveness to HUD #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 101 additions & 30 deletions web/src/hooks/useStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,114 @@ const useStyles = createStyles((theme) => ({
justifyContent: 'center',
alignItems: 'center'
},
compass: {
minimapContainer: {
position: 'absolute',
top: -7,
width: '300px',
height: '25px',
bottom: '5.5vh',
left: '0.75vw',
width: '16.6vw',
height: '18.5vh',
backgroundColor: "none",
border: `2px solid ${theme.colors.dark[4]}`,
padding: '2px',
boxSizing: 'border-box',
borderRadius: theme.radius.sm,
},
compass2: {
minimap: {
width: '100%',
height: '100%',
position: 'relative',
},
heading: {
position: 'absolute',
top: 0,
width: '300px',
height: '50px',
fontSize: '5pt',
top: 2,
right: 5,
color: theme.colors.gray[4],
fontWeight: 700,
fontSize: '1.35vh',
},
compassArrow: {
streetNames: {
position: 'absolute',
top: 0,
width: '5px',
height: '20px',
backgroundColor: 'white',
borderRadius: theme.radius.sm
top: 2,
left: 5,
textAlign: 'right',
},
minimapContainer: {
streetName1: {
color: theme.colors.gray[4],
fontWeight: 700,
textAlign: 'left',
fontSize: '1.35vh',
textTransform: 'uppercase',
},
streetName2: {
color: theme.colors.gray[4],
fontWeight: 500,
fontSize: '1.20vh',
textTransform: 'uppercase',
marginTop: -2,
},
horizontalBar: {
position: 'absolute',
bottom: 60,
left: 14,
width: '320px',
height: '200px',
backgroundColor: "none",
border: `4px solid ${theme.colors.dark[7]}`,
padding: '2px',
boxSizing: 'border-box',
borderRadius: theme.radius.sm,
},
minimap: {
top: '-40px', // Move the bar further up on the screen
right: -1,
width: '100%',
height: '0.75vh',
margin: '12px 0', // Increase margin between bars
backgroundColor: theme.colors.dark[5],
border: `2px solid ${theme.colors.dark[4]}`,
borderRadius: theme.radius.sm,
zIndex: 3, // Ensure it's on top
},
fuelBar: {
height: '100%',
},
}))
backgroundColor: theme.colors.gray[4],
borderRadius: theme.radius.sm,
},
fuelBarOn: {
height: '100%',
backgroundColor: theme.colors.red[6],
borderRadius: theme.radius.sm,
},
nitrousBar: {
height: '100%',
backgroundColor: theme.colors.violet[3],
borderRadius: theme.radius.sm,
},
speed: {
position: 'absolute',
bottom: 5,
right: 5,
fontWeight: 700,
fontSize: '1.85vh',
color: theme.colors.gray[4],
},
gear: {
position: 'absolute',
bottom: 5,
left: 5,
fontWeight: 700,
color: theme.colors.gray[4],
fontSize: '1.85vh',
},
iconGroup: {
position: 'absolute',
bottom: '3vh', // Position the icons above the speed
right: 5,
display: 'flex',
flexDirection: 'column',
gap: '4px', // Small gap between the icons
},
seatbeltIcon: {
color: theme.colors.red[6], // Default red color for seatbelt off
fontSize: '24px',
},
seatbeltIconOn: {
color: theme.colors.green[6], // Green color for seatbelt on
fontSize: '24px',
},
engineIcon: {
color: theme.colors.red[6], // Red color for engine warning
fontSize: '24px',
},
}));

export default useStyles
export default useStyles;
Loading