Improved some things.
This commit is contained in:
Denis 2014-12-31 15:34:17 +02:00
parent e0ef78ba4c
commit 8c344bf5f5
4 changed files with 27 additions and 38 deletions

View file

@ -58,7 +58,7 @@ function newGame(wordList) {
// DOM Elements & Events // DOM Elements & Events
$(document).ready(function() { $(document).ready(function() {
$('.footer-content').append("<p><span>Spanzuratoarea</span> <em>created by</em>" + "<span>@<a href=\"http://www.twitter.com/niutenisu\">Niutenisu</a></span><p>"); //$('.footer-content').append("<p><span>Spanzuratoarea</span> <em>created by</em>" + "<span>@<a href=\"http://www.twitter.com/niutenisu\">Niutenisu</a></span><p>");
var listaCuvinte = localStorage.getItem("listaCuvinte"); var listaCuvinte = localStorage.getItem("listaCuvinte");
if (listaCuvinte != null) { if (listaCuvinte != null) {
@ -74,6 +74,9 @@ $(document).ready(function() {
// eval for transforming string into object ref!!! // eval for transforming string into object ref!!!
newGame(eval($(this).prev().val())); // POSSIBLE EXPLOIT!! newGame(eval($(this).prev().val())); // POSSIBLE EXPLOIT!!
// prev for mobile <3 // prev for mobile <3
/* On the page are two elements that have select[name=lista_cuvinte]
* We use next() for the button and prev() to get the value of the
* sellection. */
}); });
$('#game').fadeIn("slow"); $('#game').fadeIn("slow");
@ -135,7 +138,7 @@ function gameWon() {
$(document).on("keypress", function(e) { $(document).on("keypress", function(e) {
var key = e.keyCode || e.which; var key = e.keyCode || e.which;
if (key == 13) if (key == 13)
window.location.reload(); // Da reset la handlere :-) window.location.reload(); // Reset handlers :-)
}); });
} }

View file

@ -23,54 +23,26 @@
<div id="game" class="game" style="display: none;"> <div id="game" class="game" style="display: none;">
<div class="mobile"> <div class="mobile">
<h3>Incearca sa ghicesti cuvantul: <span class="word"></span></h3> <h3>Incearca sa ghicesti cuvantul: <span class="word"></span></h3>
<h4>Introdu aici litera:</h4> <h4>Introdu aici litera:</h4>
<input name="mobile" type="text"> <input name="mobile" type="text">
<h4 class="litera_msg" style="display: none;">Ai apasat pe "<span class="litera" style="color: red;"></span>
<h4 class="litera_msg" style="display: none;">Ai apasat pe " <span class="litera_msg2"></span></h4>
<span class="litera" style="color: red;"></span>
<span class="litera_msg2"></span>"</h4>
<h4 class="litere" style="color: red;"></h4> <h4 class="litere" style="color: red;"></h4>
<select name="lista_cuvinte" class="change_words"> <select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animale din Europa</option> <option value="animale_eu">Animale din Europa</option>
<option value="tari_eu">Tari din Europa</option> <option value="tari_eu">Tari din Europa</option>
<option value="firme">Companii</option> <option value="firme">Companii</option>
<option value="ldp">Limbaje de programare</option> <option value="ldp">Limbaje de programare</option>
</select> </select>
<button class="">Schimba</button> <button class="">Schimba</button>
</div> </div>
<div id="left"> <div id="left">
<h2>Incearca sa ghicesti cuvantul: <span class="word"></span></h2> <h2>Incearca sa ghicesti cuvantul: <span class="word"></span></h2>
<h3>Apasa pe o litera de pe tastatura!</h3> <h3>Apasa pe o litera de pe tastatura!</h3>
<br> <br>
<h4 class="litera_msg" style="display: none;">Ai apasat pe " <h4 class="litera_msg" style="display: none;">Ai apasat pe "<span class="litera red" style="color: red;"></span>"
<span class="litera_msg2"></span></h4>
<span class="litera red" style="color: red;"></span>
"<span class="litera_msg2"></span>"</h4>
<br> <br>
<br> <br>
<br> <br>
@ -110,7 +82,14 @@
</div> </div>
<footer> <footer>
<div class="footer-content"> <div class="footer-content">
<p>
<span>Spanzuratoarea</span>
<em>created by</em>
<span> @<a href="http://www.twitter.com/niutenisu">Niutenisu</a></span>
</p>
<p class="right">
<span><a href="https://github.com/niutenisu/ro-hangman/" alt="Github" title="Github Project Link">Github</a><span>
</p>
</div> </div>
</footer> </footer>
@ -122,9 +101,9 @@
} else { } else {
// jQuery is not loaded // jQuery is not loaded
alert("jQuery is not loaded"); alert("jQuery is not loaded");
</script> </script>
}--> }-->
</body> </body>
</html> </html>

View file

@ -154,14 +154,21 @@
margin: 0px 10px 0px 10px; margin: 0px 10px 0px 10px;
padding-top: 15px; padding-top: 15px;
} }
.footer-content * {
display: inline;
}
.footer-content span { .footer-content span {
color: #e9f5fa; color: #e9f5fa;
font-weight: bold; font-weight: bold;
} }
.right {
float: right;
margin-right: 20px;
}
.mobile { .mobile {
display: none; display: none;
} }
/* Mobile shit */ /* Mobile CSS */
@media only screen and (max-width: 930px) { @media only screen and (max-width: 930px) {
.mobile { .mobile {

View file

@ -4,4 +4,4 @@ var tari_eu = ["romania", "moldova", "germania", "spania", "franta", "rusia","it
var firme = ["google", "yahoo", "microsoft", "oracle", "amazon", "emag", "ebay", "apple", "siemens", "intel", "toyota", "dacia", "volvo"]; var firme = ["google", "yahoo", "microsoft", "oracle", "amazon", "emag", "ebay", "apple", "siemens", "intel", "toyota", "dacia", "volvo"];
var ldp = ["javascript", "html", "css", "java", "c", "c++", "ruby", "pascal", "lisp", "erlang", "sql", "python"]; var ldp = ["javascript", "html", "css", "java", "c", "c++", "ruby", "pascal", "lisp", "erlang", "sql", "python", "perl", "lua"];