-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI] Clickable/Tappable Button and Sticks (#26)
* client/Joystick: Move both joysticks with touch. * client: Support clicking and dragging joysticks with the mouse. * client: Handle passing around controllerState to buttons a little better * ui: Show when two buttons are touched at the same time. * README: Mouse/Touchscreen are supported. * ui: Get most buttons to show on mobile screens. * sendComand: Allow updating state. * client: Only keep one ControllerState. * client: Only run command once per press. * client: Bump to 0.6
- Loading branch information
Showing
21 changed files
with
707 additions
and
226 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
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,2 @@ | ||
build/ | ||
node_modules/ |
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 |
---|---|---|
|
@@ -11,7 +11,6 @@ COPY public/ ./public/ | |
COPY tsconfig.json ./ | ||
COPY src/ ./src/ | ||
|
||
|
||
RUN yarn build | ||
|
||
CMD yarn start-prod |
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 |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import React from 'react' | ||
import ControllerButton from '../Controller/ControllerButton' | ||
import classes from './Button.module.css' | ||
|
||
const Button: React.FunctionComponent<any> = (props: any) => { | ||
let classList = classes.Button | ||
if (props.button.pressed) classList += " " + classes.Pressed | ||
return ( | ||
<div className={classList}> | ||
<h1>{props.button.symbol}</h1> | ||
</div> | ||
) | ||
if (props.button.pressed) { | ||
classList += " " + classes.Pressed | ||
} | ||
return <ControllerButton | ||
name={props.button.name} | ||
sendCommand={props.button.sendCommand} | ||
controllerState={props.button.controllerState} | ||
className={classList}> | ||
<h1>{props.button.symbol}</h1> | ||
</ControllerButton> | ||
} | ||
|
||
export default Button |
18 changes: 0 additions & 18 deletions
18
website-client/src/components/Controller/Controller.module.css
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
147 changes: 107 additions & 40 deletions
147
website-client/src/components/Controller/Controller.tsx
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.