Skip to content

Commit

Permalink
Merge pull request #121 from ubclaunchpad/coloured-buttons
Browse files Browse the repository at this point in the history
Coloured buttons
  • Loading branch information
rmcreyes authored Mar 28, 2020
2 parents 12d30db + 3121dde commit eee4415
Show file tree
Hide file tree
Showing 15 changed files with 714 additions and 334 deletions.
Binary file added public/colourway1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/colourway2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/colourway3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
392 changes: 372 additions & 20 deletions public/index.css

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>UBC Simulator 2</title>

<!-- Import CSS -->
<link href="https://unpkg.com/nes.css@latest/css/nes.min.css" rel="stylesheet" />
<link rel="stylesheet" href="index.css" />
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>UBC Simulator 2</title>

<!-- Import Font -->
<link href="https://fonts.googleapis.com/css?family=VT323&display=swap" rel="stylesheet">
</head>
<body>
<div id="root"></div>
</body>
<script src="../src/index.ts"></script>
</html>
<!-- Import CSS -->
<link href="https://unpkg.com/nes.css@latest/css/nes.min.css" rel="stylesheet" />
<link rel="stylesheet" href="index.css" />

<!-- Import Font -->
<link href="https://fonts.googleapis.com/css?family=VT323&display=swap" rel="stylesheet">
</head>

<body>
<div id="root"></div>
</body>
<script src="../src/index.ts"></script>

</html>
29 changes: 24 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default class App extends React.Component<IProps, IState> {
"imgPath": "",
"choices": [],
"hasBottomBoxBorder": false,
"hasInnerFill": false,
"gamePlayMode": GamePlayMode.Minigame
};

Expand Down Expand Up @@ -148,9 +149,27 @@ export default class App extends React.Component<IProps, IState> {

render() {
let currentEvent: IEvent = this.state.currentEvent;

// some screen resizing things...
const height = 667;
const width = 350;
let scale = (Math.min(
window.innerHeight / height,
window.innerWidth / width
));
scale = Math.floor(scale) >= 1 ? Math.floor(scale) : 1;

let topMargin = (window.innerHeight - 667) / 2;
topMargin = topMargin > 0 ? topMargin : 0;

var style = {
marginTop: topMargin + "px",
transform: "scale(" + scale + ")",
};

return (
<div id="app">
<div id="game-container">
<div id="app" >
<div id="game-container" style={style} className="nes-container is-ubc-alt-blue has-box-shadow">
<Hud
playerStats={this.state.playerStats}
week={this.state.week}
Expand All @@ -164,9 +183,9 @@ export default class App extends React.Component<IProps, IState> {
/>
<section
id="user-interaction-box"
className={currentEvent.hasBottomBoxBorder ? "nes-container is-rounded" : ""}
className={currentEvent.hasBottomBoxBorder ? "nes-container" : ""}
>
<div id="bottom-menu" className="bottom-container">
<div id="bottom-menu" className="bottom-container" style={currentEvent.hasInnerFill ? {} : { border: "none", background: "none" }}>
<p id="prompt" className="this-align-center">
{currentEvent.prompt}
</p>
Expand All @@ -178,7 +197,7 @@ export default class App extends React.Component<IProps, IState> {
</div>
</section>
</div>
</div>
</div >
);
}
}
Loading

0 comments on commit eee4415

Please sign in to comment.