mirror of
https://github.com/ysoftdevs/cloud-workshop.git
synced 2026-01-11 14:30:32 +01:00
finalize simple game
This commit is contained in:
49
README.md
49
README.md
@@ -26,7 +26,11 @@ Change 4 Czech options to 4 buttons. Replace div tag by button tag and class.
|
||||
|
||||
## 05. Use Twitter style of buttons
|
||||
|
||||
Add CSS class definition to buttons: class="btn btn-default"
|
||||
Add CSS class definition to buttons: class="btn btn-default".
|
||||
|
||||
Fix for C9.io ide to avoid jQuery warning, add /* global $ */
|
||||
|
||||
- https://community.c9.io/t/being-flagged-as-not-defined-in-js-file-when-using-jquery/4231/5
|
||||
|
||||
## 06. Display alert when on button click
|
||||
|
||||
@@ -56,3 +60,46 @@ Display icon which indicates status. Use Twitter Glyphicons.
|
||||
- http://api.jquery.com/addClass/
|
||||
- http://api.jquery.com/removeClass/
|
||||
|
||||
## 11. Add support for more words
|
||||
|
||||
Create two lists of words. One in English and one in Czech.
|
||||
|
||||
var czechWords = [];
|
||||
var englishWords = [];
|
||||
|
||||
## 12. Pick random English word from list
|
||||
|
||||
Select random word and display it on sreen.
|
||||
Use Math.random and Math.floor functions.
|
||||
|
||||
- http://www.w3schools.com/jsref/jsref_random.asp
|
||||
|
||||
## 13. Check correct answer
|
||||
|
||||
Compare index of selected word with primary word and display success or failure.
|
||||
|
||||
## 14. Generate content of buttons
|
||||
|
||||
Define ID for each button and use "for" cycle to display words on buttons
|
||||
|
||||
## 15. Generate new words after selecting correct one
|
||||
|
||||
Run function for generating word again when the word was correct.
|
||||
|
||||
## 16. Add delay before moving starting new round of game
|
||||
|
||||
Use setTimeout function to invoke new game after selecting word.
|
||||
|
||||
- http://stackoverflow.com/questions/10860171/run-function-after-delay
|
||||
|
||||
## 17. Fade out status message
|
||||
|
||||
Use fadeOut function to remove message from display.
|
||||
|
||||
- http://api.jquery.com/fadeOut/
|
||||
|
||||
## 18. Display message evan after fadeout
|
||||
|
||||
Bring back message tag using "show" function.
|
||||
|
||||
- http://stackoverflow.com/questions/13228696/re-displaying-after-fadeout
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* global $ */
|
||||
function buttonClickHandler(event) {
|
||||
alert("Clicked");
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* global $ */
|
||||
function buttonClickHandler(event) {
|
||||
alert("Clicked: " + event.target.textContent);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* global $ */
|
||||
function buttonClickHandler(event) {
|
||||
var message;
|
||||
if (event.target.textContent == "slovo") {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* global $ */
|
||||
function buttonClickHandler(event) {
|
||||
var message;
|
||||
if (event.target.textContent == "slovo") {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* global $ */
|
||||
function buttonClickHandler(event) {
|
||||
var message;
|
||||
if (event.target.textContent == "slovo") {
|
||||
|
||||
Reference in New Issue
Block a user