Skip to content

Commit 67d8587

Browse files
committed
Few changes for a better mobile experience
1 parent b3f12cc commit 67d8587

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

New/hangman.appcache

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,3 @@ style.php
2424

2525
FALLBACK:
2626
hangman.php offline.php
27-
28-
NETWORK:
29-
*

New/hangman_desktop.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
# Set the cache control header
55
header("Cache-Control: max-age=604800");
66
?>
7-
<!DOCTYPE html><html manifest="hangman.appcache" xmlns="http://www.w3.org/1999/xhtml" lang="en"
7+
<!DOCTYPE html><html manifest="<?php echo $path_parts['dirname']?>/hangman.appcache" xmlns="http://www.w3.org/1999/xhtml" lang="en"
88
xml:lang="en"><head><meta charset="UTF-8" /><meta name="viewport"
99
content="width=device-width,initial-scale=1.0" /><title>Hangman</title><link rel="stylesheet" type="text/css"
1010
href="style.php"/><link rel="stylesheet" type="text/css" href="style_desktop.php"/><link rel="canonical"
1111
href="http://<?php echo $_SERVER['SERVER_NAME'].$path_parts['dirname'] ?>/hangman.php"/><script
12-
type="text/javascript" src="loc_sess_storage_js.php"></script></head><body><h1>Hangman</h1><div id="container"><div id="game"><div
13-
id="hangman_img"><div id="cur_img"></div><div id="rem_chances"></div></div><div id="setup_scores"><ul class="letters"><li
12+
type="text/javascript" src="loc_sess_storage_js.php"></script></head><body><h1>Hangman</h1>
13+
<div id="container"><div id="game"><div id="setup_scores"><ul class="letters"><li
1414
class="newgame" onclick="start_new_game()">New game</li><li id="level_easy" onclick="change_level('easy')">Easy</li><li
1515
id="level_medium" onclick="change_level('medium')">Medium</li><li id="level_hard" onclick="change_level('hard')">Hard</li></ul><dl
16-
class="scores"><dt>Games Score:</dt><dd>Played: <span id="game_played">0</span></dd><dd>Won: <span id="game_won">0</span></dd></dl></div>
17-
<div id="words"><span id="guessword">If you see this text for more than 10 seconds, your browser doesn't
16+
class="scores"><dt>Games Score:</dt><dd>Played: <span id="game_played">0</span></dd><dd>Won: <span id="game_won">0</span></dd></dl>
17+
</div><div id="hangman_img"><div id="cur_img"></div><div id="rem_chances"></div></div><div
18+
id="words"><span id="guessword">If you see this text for more than 10 seconds, your browser doesn't
1819
support javascript and you cannot play :-( <br/>Please visit this page with a browser that supports javascript.</span></div><div
1920
id="keyboard"><ul class="letters"><li id="let_A" onclick="guess_letter('A')">A</li><li id="let_B" onclick="guess_letter('B')">B</li>
2021
<li id="let_C" onclick="guess_letter('C')">C</li><li id="let_D" onclick="guess_letter('D')">D</li><li

New/hangman_mobile.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
name="viewport" content="width=device-width,initial-scale=1.0" /><title>Hangman</title><link rel="stylesheet"
1010
type="text/css" href="style.php"/><link rel="canonical" href="http://<?php
1111
echo $_SERVER['SERVER_NAME'].$path_parts['dirname'] ?>/hangman.php"/><script type="text/javascript"
12-
src="loc_sess_storage_js.php"></script></head><body><h1>Hangman</h1><div id="container"><div id="game"><div id="hangman_img"><div
13-
id="cur_img"></div><div id="rem_chances"></div></div><div id="setup_scores"><ul class="letters"><li
12+
src="loc_sess_storage_js.php"></script></head><body><h1>Hangman</h1><div id="container">
13+
<div id="game"><div id="setup_scores"><ul class="letters"><li
1414
class="newgame" onclick="start_new_game()">New game</li><li id="level_easy" onclick="change_level('easy')">Easy</li><li
1515
id="level_medium" onclick="change_level('medium')">Medium</li><li id="level_hard" onclick="change_level('hard')">Hard</li></ul><dl
1616
class="scores"><dt>Games Score:</dt><dd>Played: <span id="game_played">0</span></dd><dd>Won:
17-
<span id="game_won">0</span></dd></dl></div><div id="words"><span id="guessword">If you see this text for more than 10
17+
<span id="game_won">0</span></dd></dl></div><div id="hangman_img"><div
18+
id="cur_img"></div><div id="rem_chances"></div></div><div id="words"><span id="guessword">If you see this text for more than 10
1819
seconds, your browser doesn't support javascript and you cannot play :-( <br/>Please visit this page with a browser
1920
that supports javascript.</span></div><div id="keyboard"><ul class="letters"><li
2021
id="let_A" onclick="guess_letter('A')">A</li><li id="let_B" onclick="guess_letter('B')">B</li><li

New/style.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@
99
h2{font-size:1.3em}
1010
div{clear:both}
1111
#game{border:1px solid #000}
12-
#hangman_img{min-height:160px;min-width:85px;margin-top:1%;clear:left}
12+
#hangman_img{min-height:160px;min-width:85px;margin-top:1%;clear:right}
1313
#cur_img{min-height:150px}
14-
#words{border-bottom:1px solid #000;font-size:1.5em;padding:1em}
14+
#words{border-bottom:1px solid #000;font-size:1.2em;padding:.5em}
1515
#footer{margin:1%;padding:1%}
1616
#hangman_img,#words,#keyboard{text-align:center}
17-
#setup_scores{text-align:left;clear:right}
18-
#hangman_img,#setup_scores{float:left;width:49%}
17+
#hangman_img,#setup_scores{float:left}
18+
#setup_scores{text-align:left;clear:left;}
1919
ul{list-style-type:none;clear:both;margin:0;padding:0}
2020
#footer ul li,ul.letters li{margin:0}
2121
#footer ul li{padding:.7em 0 .7em 2%}
22-
ul.letters{margin-left:.5em}
23-
ul.letters li{border:2px solid #000;background-color:#F1F1BA;width:1.5em;text-align:center;border-radius:.5em;box-shadow:rgba(0,0,0,0.2) .5em .5em .3em;float:left;margin-right:1em;margin-top:.5em;margin-bottom:.5em;font-weight:700;cursor:pointer;padding:.4em}
22+
ul.letters{margin-left:.2em}
23+
ul.letters li{border:2px solid #000;background-color:#F1F1BA;width:1.5em;text-align:center;border-radius:.5em;box-shadow:rgba(0,0,0,0.2) .5em .5em .3em;float:left;margin-right:.7em;margin-top:.5em;margin-bottom:.5em;font-weight:700;cursor:pointer;padding:.4em}
2424
ul.letters li.levelset{background-color:#D1D154}
2525
ul.letters li.hideletter{background-color:grey;cursor:auto}
2626
.offline ul.letters li{width:auto;float:none;}
2727
#help ul{margin-left:5%;list-style-type:disc}
2828
#setup_scores ul.letters li{width:auto}
2929
#setup_scores ul.letters li.newgame{float:none;clear:both}
30-
dl.scores{font-weight:700;clear:both;margin-left:1em}
31-
dl.scores dd{margin-left:1em}
30+
dl.scores{font-weight:700;clear:both;margin-left:.5em}
31+
dl.scores dd{margin-left:.5em}
3232
span.endgame{font-weight:700}
3333
.offline{text-align:center}
3434

New/style_desktop.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88
#game{float:left;width:65%;clear:left}
99
#help{float:right;width:30%;clear:right}
1010
#footer ul li{border:2px solid #000;background-color:#F2F2BA;text-align:center;border-radius:.5em;box-shadow:rgba(0,0,0,0.2) .5em .5em .3em;float:left;margin:.6em .2em .6em 2em;padding:.2em}
11-
#footer:after{visibility:hidden;display:block;font-size:0;line-height:0;content:" ";clear:both;height:0;width:0}
11+
#footer:after{visibility:hidden;display:block;font-size:0;line-height:0;content:" ";clear:both;height:0;width:0}
12+
#hangman_img,#setup_scores{width:49%}
13+
#words{font-size:1.5em;padding:1em}
14+
dl.scores,dl.scores dd{margin-left:1em}

0 commit comments

Comments
 (0)