Implementing Translation & Tweaking Mobile

This commit is contained in:
Denis 2015-01-10 13:53:49 +02:00
parent 8718179db1
commit e6f82fcaa8
7 changed files with 289 additions and 265 deletions

View file

@ -1,131 +1,133 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Hagman</title>
<meta charset="utf-8">
<meta http-equiv="author" content="Niutenisu">
<meta name="description" content="Hangman!">
<meta name="keywords" content="hangman, game, free, online">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="../styles/normalize.css">
<link rel="stylesheet" type="text/css" href="../styles/styles.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="../sound/ion.sound.min.js"></script>
<script src="../js/words.js"></script>
<script src="../js/hangman.js"></script>
<script src="../js/main_en.js"></script>
</head>
<body>
<div id="content">
<h1>Hangman!</h1>
<div id="game" class="game" style="display: none;">
<div class="mobile">
<h3>Try to guess the word: <span class="word"></span></h3>
<h4>Type the letter here:</h4>
<input name="mobile" type="text">
<h4 class="litera_msg" style="display: none;">You pressed "<span class="litera" style="color: red;"></span>
<span class="litera_msg2"></span></h4>
<h4 class="litere" style="color: red;"></h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animals from EU</option>
<option value="tari_eu">Country from EU</option>
<option value="firme">Companies</option>
<option value="ldp">Programming Languages</option>
</select>
<button class="">Switch</button>
</div>
<div id="left">
<h2>Try to guess the word: <span class="word"></span></h2>
<h3>Type a key, any key!</h3>
<br>
<h4 class="litera_msg" style="display: none;">You typed "<span class="litera red" style="color: red;"></span>"
<span class="litera_msg2"></span></h4>
<br>
<br>
<br>
<h4>Instructions:</h4>
<p>Try to guess the word, you have 6 tries before you lose.</p>
<br>
<br>
<h4 class="litere red"></h4>
<br>
<br>
<h4>Cuvinte:</h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animals from EU</option>
<option value="tari_eu">Country from EU</option>
<option value="firme">Companies</option>
<option value="ldp">Programming Languages</option>
</select>
<button class="">Switch</button>
</div>
<div id="gamewon">
<p>Click the image to play again!</p>
<img src="../img/win.png" alt="Winner!" title="YOU'RE WINNER!">
</div>
<div id="gameover">
<p>Click the image to play again!</p>
<p>The word was: <span class="red" id="lose_word"></span>
</p>
<img src="../img/lose.png" alt="Loser!" title="YOU'RE LOSER!">
</div>
<div id="right">
<img id="hang" src="../img/hang.png">
<img id="human" src="../img/6.png">
<br>
<h3 id="incercari_msg">Life: <span id="incercari">6</span></h3>
</div>
</div>
</div>
<footer>
<div class="footer-content">
<p>
<span>Hangman</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>
</footer>
<script>
// Sound initialization
ion.sound({
sounds: [{
name: "button_tiny",
volume: 0.8,
preload: true
}, {
name: "ta_da",
volume: 0.8,
preload: true
}, {
name: "sad_trombone",
volume: 0.8,
preload: true
}],
volume: 0.5,
path: "../sound/sounds/",
preload: true
});
</script>
<!--
<script type="text/javascript">
if (window.jQuery) {
// jQuery is loaded
alert("jQuery is loaded");
} else {
// jQuery is not loaded
alert("jQuery is not loaded");
</script>
}-->
</body>
</html>
<head>
<title>Hagman</title>
<meta charset="utf-8">
<meta http-equiv="author" content="Niutenisu">
<meta name="description" content="Hangman!">
<meta name="keywords" content="hangman, game, free, online">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="../styles/normalize.css">
<link rel="stylesheet" type="text/css" href="../styles/styles.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="../sound/ion.sound.min.js"></script>
<script src="../js/words.js"></script>
<script src="../js/hangman.js"></script>
<script src="../js/main_en.js"></script>
</head>
<body>
<div id="content">
<h1>Hangman!</h1>
<div id="game" class="game" style="display: none;">
<div class="mobile">
<h3>Try to guess the word: <span class="word"></span></h3>
<h4>Type the letter here:</h4>
<input name="mobile" type="text">
<h4 class="litera_msg" style="display: none;">You pressed "<span class="litera" style="color: red;"></span>
<span class="litera_msg2"></span></h4>
<h4 class="litere" style="color: red;"></h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animals from EU</option>
<option value="tari_eu">Country from EU</option>
<option value="firme">Companies</option>
<option value="ldp">Programming Languages</option>
</select>
<button class="">Switch</button>
</div>
<div id="left">
<h2>Try to guess the word: <span class="word"></span></h2>
<h3>Type a key, any key!</h3>
<br>
<h4 class="litera_msg" style="display: none;">You typed "<span class="litera red" style="color: red;"></span>"
<span class="litera_msg2"></span></h4>
<br>
<br>
<br>
<h4>Instructions:</h4>
<p>Try to guess the word, you have 6 tries before you lose.</p>
<br>
<br>
<h4 class="litere red"></h4>
<br>
<br>
<h4>Cuvinte:</h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animals from EU</option>
<option value="tari_eu">Country from EU</option>
<option value="firme">Companies</option>
<option value="ldp">Programming Languages</option>
</select>
<button class="">Switch</button>
</div>
<div id="gamewon">
<p>Click the image to play again!</p>
<img src="../img/win.png" alt="Winner!" title="YOU'RE WINNER!">
</div>
<div id="gameover">
<p>Click the image to play again!</p>
<p>The word was: <span class="red" id="lose_word"></span>
</p>
<img src="../img/lose.png" alt="Loser!" title="YOU'RE LOSER!">
</div>
<div id="right">
<img id="hang" src="../img/hang.png">
<img id="human" src="../img/6.png">
<br>
<h3 id="incercari_msg">Life: <span id="incercari">6</span></h3>
</div>
</div>
</div>
<footer>
<div class="footer-content">
<p>
<span>Hangman</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 class="language_menu">
<a href="#">
<img src="../img/usa.png" alt="English Language" title="English" />
</a>
<a href="../index.html">
<img src="../img/ro.png" alt="Romanian Language" title="Romana" />
</a>
</div>
</footer>
<script>
// Sound initialization
ion.sound({
sounds: [{
name: "button_tiny",
volume: 0.8,
preload: true
}, {
name: "ta_da",
volume: 0.8,
preload: true
}, {
name: "sad_trombone",
volume: 0.8,
preload: true
}],
volume: 0.5,
path: "../sound/sounds/",
preload: true
});
</script>
<!--
<script type="text/javascript">
if (window.jQuery) {
// jQuery is loaded
alert("jQuery is loaded");
} else {
// jQuery is not loaded
alert("jQuery is not loaded");
</script>
}-->
</body>
</html>

BIN
src/img/ro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

BIN
src/img/usa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 536 B

View file

@ -1,131 +1,133 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Spanzuratoarea</title>
<meta charset="utf-8">
<meta http-equiv="author" content="Niutenisu">
<meta name="description" content="Spanzuratoarea in limba romana!">
<meta name="keywords" content="spanzuratoarea, joc, gratuit, romana">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="styles/normalize.css">
<link rel="stylesheet" type="text/css" href="styles/styles.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="sound/ion.sound.min.js"></script>
<script src="js/words.js"></script>
<script src="js/hangman.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div id="content">
<h1>Spanzuratoarea!</h1>
<div id="game" class="game" style="display: none;">
<div class="mobile">
<h3>Incearca sa ghicesti cuvantul: <span class="word"></span></h3>
<h4>Introdu aici litera:</h4>
<input name="mobile" type="text">
<h4 class="litera_msg" style="display: none;">Ai apasat pe "<span class="litera" style="color: red;"></span>
<span class="litera_msg2"></span></h4>
<h4 class="litere" style="color: red;"></h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animale din Europa</option>
<option value="tari_eu">Tari din Europa</option>
<option value="firme">Companii</option>
<option value="ldp">Limbaje de programare</option>
</select>
<button class="">Schimba</button>
</div>
<div id="left">
<h2>Incearca sa ghicesti cuvantul: <span class="word"></span></h2>
<h3>Apasa pe o litera de pe tastatura!</h3>
<br>
<h4 class="litera_msg" style="display: none;">Ai apasat pe "<span class="litera red" style="color: red;"></span>"
<span class="litera_msg2"></span></h4>
<br>
<br>
<br>
<h4>Instructiuni:</h4>
<p>Incearca sa ghicesti cuvantul! Ai 6 incercari pana cand vei fi spanzurat</p>
<br>
<br>
<h4 class="litere red"></h4>
<br>
<br>
<h4>Cuvinte:</h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animale din Europa</option>
<option value="tari_eu">Tari din Europa</option>
<option value="firme">Companii</option>
<option value="ldp">Limbaje de programare</option>
</select>
<button class="">Schimba</button>
</div>
<div id="gamewon">
<p>Da-i click pe imagine pentru a juca din nou!</p>
<img src="./img/win.png" alt="Winner!" title="YOU'RE WINNER!">
</div>
<div id="gameover">
<p>Da-i click pe imagine pentru a juca din nou!</p>
<p>Cuvantul era: <span class="red" id="lose_word"></span>
</p>
<img src="./img/lose.png" alt="Loser!" title="YOU'RE LOSER!">
</div>
<div id="right">
<img id="hang" src="./img/hang.png">
<img id="human" src="./img/6.png">
<br>
<h3 id="incercari_msg">Incercari ramase: <span id="incercari">6</span></h3>
</div>
</div>
</div>
<footer>
<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>
</footer>
<script>
// Sound initialization
ion.sound({
sounds: [{
name: "button_tiny",
volume: 0.8,
preload: true
}, {
name: "ta_da",
volume: 0.8,
preload: true
}, {
name: "sad_trombone",
volume: 0.8,
preload: true
}],
volume: 0.5,
path: "sound/sounds/",
preload: true
});
</script>
<!--
<script type="text/javascript">
if (window.jQuery) {
// jQuery is loaded
alert("jQuery is loaded");
} else {
// jQuery is not loaded
alert("jQuery is not loaded");
</script>
}-->
</body>
</html>
<head>
<title>Spanzuratoarea</title>
<meta charset="utf-8">
<meta http-equiv="author" content="Niutenisu">
<meta name="description" content="Spanzuratoarea in limba romana!">
<meta name="keywords" content="spanzuratoarea, joc, gratuit, romana">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="styles/normalize.css">
<link rel="stylesheet" type="text/css" href="styles/styles.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="sound/ion.sound.min.js"></script>
<script src="js/words.js"></script>
<script src="js/hangman.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div id="content">
<h1>Spanzuratoarea!</h1>
<div id="game" class="game" style="display: none;">
<div class="mobile">
<h3>Incearca sa ghicesti cuvantul: <span class="word"></span></h3>
<h4>Introdu aici litera:</h4>
<input name="mobile" type="text">
<h4 class="litera_msg" style="display: none;">Ai apasat pe "<span class="litera" style="color: red;"></span>
<span class="litera_msg2"></span></h4>
<h4 class="litere" style="color: red;"></h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animale din Europa</option>
<option value="tari_eu">Tari din Europa</option>
<option value="firme">Companii</option>
<option value="ldp">Limbaje de programare</option>
</select>
<button class="">Schimba</button>
</div>
<div id="left">
<h2>Incearca sa ghicesti cuvantul: <span class="word"></span></h2>
<h3>Apasa pe o litera de pe tastatura!</h3>
<br>
<h4 class="litera_msg" style="display: none;">Ai apasat pe "<span class="litera red" style="color: red;"></span>"
<span class="litera_msg2"></span></h4>
<br>
<br>
<br>
<h4>Instructiuni:</h4>
<p>Incearca sa ghicesti cuvantul! Ai 6 incercari pana cand vei fi spanzurat</p>
<br>
<br>
<h4 class="litere red"></h4>
<br>
<br>
<h4>Cuvinte:</h4>
<select name="lista_cuvinte" class="change_words">
<option value="animale_eu">Animale din Europa</option>
<option value="tari_eu">Tari din Europa</option>
<option value="firme">Companii</option>
<option value="ldp">Limbaje de programare</option>
</select>
<button class="">Schimba</button>
</div>
<div id="gamewon">
<p>Da-i click pe imagine pentru a juca din nou!</p>
<img src="./img/win.png" alt="Winner!" title="YOU'RE WINNER!">
</div>
<div id="gameover">
<p>Da-i click pe imagine pentru a juca din nou!</p>
<p>Cuvantul era: <span class="red" id="lose_word"></span>
</p>
<img src="./img/lose.png" alt="Loser!" title="YOU'RE LOSER!">
</div>
<div id="right">
<img id="hang" src="./img/hang.png">
<img id="human" src="./img/6.png">
<br>
<h3 id="incercari_msg">Incercari ramase: <span id="incercari">6</span></h3>
</div>
</div>
</div>
<footer>
<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 class="language_menu">
<a href="en/">
<img src="img/usa.png" alt="English Language" title="English" />
</a>
<a href="#">
<img src="img/ro.png" alt="Romanian Language" title="Romana" />
</a>
</div>
</div>
</footer>
<script>
// Sound initialization
ion.sound({
sounds: [{
name: "button_tiny",
volume: 0.8,
preload: true
}, {
name: "ta_da",
volume: 0.8,
preload: true
}, {
name: "sad_trombone",
volume: 0.8,
preload: true
}],
volume: 0.5,
path: "sound/sounds/",
preload: true
});
</script>
<!--
<script type="text/javascript">
if (window.jQuery) {
// jQuery is loaded
alert("jQuery is loaded");
} else {
// jQuery is not loaded
alert("jQuery is not loaded");
</script>
}-->
</body>
</html>

View file

@ -11,7 +11,7 @@
<link rel="stylesheet" type="text/css" href="./styles.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="../sound/ion.sound.min.js"></script>
<script src="../words.js"></script>
<script src="words.js"></script>
<script src="./game.js"></script>
</head>
<body>

7
src/m/words.js Normal file
View file

@ -0,0 +1,7 @@
var animale_eu = ["pisica", "caine", "lup", "vulpe", "urs", "caprioara", "vaca", "cal", "oaie", "sobolan", "soarece"];
var tari_eu = ["romania", "moldova", "germania", "spania", "franta", "rusia","italia", "elvetia", "suedia", "norvegia"];
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", "perl", "lua"];

View file

@ -4,11 +4,11 @@
}
html, body {
height: 100%;
}
body {
background-color: #eef7fb;
}
h1 {
margin: 0;
text-align: center;
text-overflow: ellipsis;
-webkit-text-stroke: 1px #375449;
@ -30,7 +30,7 @@ h3, h5 {
color: #3b7998;
}
footer, #content:after {
height: 50px;
height: 30px;
}
a {
text-decoration: none;
@ -48,12 +48,24 @@ footer {
color: #c9e7f3;
background-color: #8aa3c8;
}
.language_menu a, img {
padding: 1px;
margin: 1px auto;
display: inline;
}
.language_menu {
display: inline;
padding: 2px;
height: 18px;
width: auto;
}
.game p {
color: #448aae;
}
.game {
padding: 30px;
margin: 20px 80px 20px;
margin: 0 80px;
height: 400px;
border: solid 5px black;
background-color: #C9E7F3;
@ -64,8 +76,8 @@ footer {
#content {
min-height: 100%;
/* equal to footer height */
margin-bottom: -50px;
top: 0;
margin-bottom: -30px;
}
#left {
float: left;
@ -146,6 +158,7 @@ margin-bottom: -50px;
right: 108px;
}
.footer-content {
display: inline;
margin: 0px 10px 0px 10px;
padding-top: 15px;
}