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

MNG-88_StartButtonActivation #12

Merged
merged 7 commits into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<body>

<div id="app">
<!-- <div id="app">
mariusz-sm marked this conversation as resolved.
Show resolved Hide resolved

<div id="loading-view">
<p>Please wait a bit, we are looking for the Poké Flute to wake up Snorlax to fight.</p>
Expand All @@ -23,9 +23,9 @@
TypeScript Mangos project for CodersCamp2020
</footer>

</div>
</div> -->

<template id="starting-page-template">
<!-- <template id="starting-page-template"> -->
mariusz-sm marked this conversation as resolved.
Show resolved Hide resolved
<div id="starting-page">
<div id="header-with-enter-name-manu">
<div class="headerWrapper">
Expand Down Expand Up @@ -54,7 +54,7 @@
</ul>
</div>
</div>
</template>
<!-- </template> -->

<template id="info-modal-template">
<div class="popupScreen">
Expand Down
18 changes: 14 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
//Uncomment to see the choose pokemon page
//const newTemplate = document.querySelector('#choose-page-template')!;
//const app = document.querySelector('#app')!;
//app.innerHTML = newTemplate.innerHTML
import { activateStart } from './activateStart';
mariusz-sm marked this conversation as resolved.
Show resolved Hide resolved

// Activate start button when both players set names
const player1NameInput = document.querySelector('#enter-player1-name') as HTMLInputElement;
const player2NameInput = document.querySelector('#enter-player2-name') as HTMLInputElement;
const startButton = document.querySelector("#start-game-btn") as HTMLDivElement;

player1NameInput.addEventListener("keyup", () => {
activateStart(player1NameInput, player2NameInput, startButton)
})

player2NameInput.addEventListener("keyup", () => {
activateStart(player1NameInput, player2NameInput, startButton)
})
4 changes: 1 addition & 3 deletions styles/SASS/_start-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@
padding-top: 15%;

&:hover {
background-color: $color-bg;
color: $color-text;

@include dropshadow
}

}
Expand Down
Loading