-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
12 changed files
with
155 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
lAPI_BASE_URL=http://192.168.0.107:8000/api | ||
API_BASE_URL=http://192.168.0.107:8000/api | ||
CORS=true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -21,6 +21,6 @@ | |
"webpack-dev-server": "^4.13.3" | ||
}, | ||
"dependencies": { | ||
"lit": "^2.7.4" | ||
"lit": "^3.0.1" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,16 +1,62 @@ | ||
import { html, css, LitElement } from "lit"; | ||
import { customElement, property } from "lit/decorators.js"; | ||
import { Authentication } from "../../state/state"; | ||
import { DisplayState } from "../../state/displayState"; | ||
import { StyledElement } from "../style/styled-element"; | ||
import { trigger } from "../../actions/actions"; | ||
import { EnterGame } from "../../actions/game-configuration"; | ||
|
||
@customElement("home-page") | ||
export class HomePage extends LitElement { | ||
static styles = css` | ||
li { | ||
color: blue; | ||
} | ||
`; | ||
static styles = [ | ||
StyledElement.styles, | ||
css` | ||
form, | ||
div { | ||
text-align: center; | ||
} | ||
input { | ||
margin: 10px 0; | ||
} | ||
`, | ||
]; | ||
|
||
@property({ type: Object }) | ||
state!: DisplayState; | ||
|
||
render() { | ||
return html` The is the homepage `; | ||
return html` | ||
<nav-bar .state=${this.state}></nav-bar> | ||
${this.renderPage(this.state.route)} | ||
`; | ||
} | ||
|
||
renderPage(route: string) { | ||
switch (route) { | ||
case "/": | ||
return html` | ||
<form | ||
@submit=${() => | ||
trigger( | ||
new EnterGame( | ||
this.shadowRoot!.getElementById("inputField")!.innerHTML | ||
) | ||
)} | ||
> | ||
<input | ||
type="text" | ||
id="inputField" | ||
placeholder="Enter game room ID" | ||
required | ||
/> | ||
<br /> | ||
<button type="submit">Join room</button> | ||
</form> | ||
<div> | ||
<p>Or</p> | ||
<button>Scan QR Code</button> | ||
</div> | ||
`; | ||
} | ||
} | ||
} |
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,26 @@ | ||
import { LitElement, html, css, CSSResultGroup } from "lit"; | ||
import { customElement } from "lit/decorators.js"; | ||
|
||
export abstract class StyledElement extends LitElement { | ||
static styles = css` | ||
button { | ||
color: black; | ||
font-size: 30px; | ||
background-color: #ffbe0a; | ||
border-radius: 10px; | ||
} | ||
button:hover { | ||
background-color: #ffdf9a; | ||
} | ||
input { | ||
font-size: 20px; | ||
border-radius: 10px; | ||
} | ||
p { | ||
font-size: 20px; | ||
} | ||
`; | ||
} |
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