add modal(Popup) at the beginning of game #7#23
add modal(Popup) at the beginning of game #7#23ManishSheela wants to merge 2 commits intoContriHUB:mainfrom
Conversation
There was a problem hiding this comment.
go through my comment on this same issue on someone else PR. link
index.html
Outdated
| <button onclick="setTimer(),closeModel()">Easy</button> | ||
| <button onclick="setTimer(),closeModel()">Medium</button> | ||
| <button onclick="setTimer(),closeModel()">Hard</button> | ||
| </div> | ||
| <!-- Levels section end --> | ||
| <i class="fas fa-times" onclick="closeModel()"></i> |
There was a problem hiding this comment.
no need to call multiple functions from the button on click. Just call a generic function and pass level as its parameter
index.js
Outdated
| let counter = 0; | ||
| const timer = document.querySelector("#timer"); | ||
| //increasing the counter | ||
| function inter() { |
index.js
Outdated
| const box = document.getElementById("model"); | ||
| const prevent_box = document.getElementById("prevent-box"); | ||
| prevent_box.style.display = "block"; | ||
| box.style.transition = "all 0.5s"; |
There was a problem hiding this comment.
this property must be set in css file
index.js
Outdated
| const box = document.getElementById("model"); | ||
| const prevent_box = document.getElementById("prevent-box"); |
There was a problem hiding this comment.
these you you are using in close modal also , so better to declare them on the top one time
|
@ManishSheela are you working on this issue? |
|
@ManishSheela you want to continue with PR, otherwise I can assign this issue to someone else |
|
@dev-lovedeep I'm not working on this issue. Please assign this to someone else. |
|
you are very close to completing the issue..but if you really want I can close it |
|
you are very close to completing the issue..but if you really want I can close it. Let me know |
|
@dev-lovedeep I think I resolved the issue. Updating in some time |
|
@dev-lovedeep made changes ! |
index.js
Outdated
| prevent_box.onclick = ()=>{ | ||
| alert(`Oops...! \nChoose your Game level by clicking the Start Game button !`); | ||
| } |
There was a problem hiding this comment.
instead of giving an alert, you can just open the modal to choose the level
index.js
Outdated
| function closeModel(level) { | ||
| if (level != 0) { | ||
| setTimer(); | ||
| prevent_box.classList.add("prevent-condition-none"); | ||
| } | ||
|
|
||
| else { | ||
| prevent_box.classList.remove("prevent-condition-none"); | ||
| } | ||
| box.classList.remove("box-condition"); |
There was a problem hiding this comment.
I have merged a PR that implements the game level. It accepts levels using the prompt. Just connect the buttons you have created with that code and remove merge conflicts
|
reopening this issue |
|
i fixed the issue |
@ManishSheela ok reassigning back to you, but it has already been 6 days, complete it quickly. |
|
Issue is resolved now, you may check. |
dev-lovedeep
left a comment
There was a problem hiding this comment.
remove the merge conflicts and then i will merge this PR
| document.getElementById("start-btn").addEventListener("click", function () { | ||
| removeChild(); | ||
| counter = 0; | ||
| clearInterval(interval); | ||
| timer.innerHTML = "<b>" + 0 + "</b>"; | ||
| popup_box.classList.add("popupBox"); | ||
| }); |
There was a problem hiding this comment.
the game screen is completely empty at starting, so put the start game button at the center of the screen
then you can delete this remove child function
There was a problem hiding this comment.
Here removeChild function is for deleting previously stored cards because every time user chooses a new level, the cards merge with previous cards
71b5737 to
d0224af
Compare
|
I am unable to resolve the conflicts since the change in the latest commit and my code is very different and complicated. |
Fixed #7