-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
169 lines (152 loc) · 7.6 KB
/
Copy pathindex.html
File metadata and controls
169 lines (152 loc) · 7.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Hangman — guess the phrase one letter at a time before the drawing is finished.">
<meta name="theme-color" content="#0B2239">
<link rel="stylesheet" href="./styles/fonts.css">
<link rel="stylesheet" href="./styles/styles.css">
<link rel="manifest" href="./manifest.webmanifest">
<link rel="apple-touch-icon" href="./icon-192.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Hangman">
<link rel="icon" href="./icon-192.png" type="image/png">
<title>Hangman</title>
</head>
<body>
<main class="sheet">
<header class="sheet__head">
<h1 class="sheet__title">Hangman</h1>
<p class="sheet__sub">Guess correctly, spare yourself.</p>
</header>
<section class="stage" aria-label="Gallows">
<svg class="gallows" viewBox="0 0 150 190" role="img"
aria-labelledby="gallows-label">
<title id="gallows-label">The gallows, drawn one part per wrong guess</title>
<!-- dimension line: this is a structure, so it gets measured -->
<g class="gallows__dim">
<path d="M14 25 V185" />
<path d="M9 25 H19" />
<path d="M9 185 H19" />
</g>
<!-- structure: always drawn -->
<g class="gallows__frame">
<path d="M26 185 H112" />
<path d="M50 185 V25" />
<path d="M50 25 H120" />
<path d="M120 25 V45" />
</g>
<!-- figure: one part revealed per wrong guess -->
<g class="gallows__figure">
<circle data-part="1" pathLength="1" cx="120" cy="56" r="11" />
<path data-part="2" pathLength="1" d="M120 67 V115" />
<path data-part="3" pathLength="1" d="M120 78 L102 96" />
<path data-part="4" pathLength="1" d="M120 78 L138 96" />
<path data-part="5" pathLength="1" d="M120 115 L104 145 M120 115 L136 145" />
</g>
<!-- stamped when the gallows never gets built -->
<defs>
<!-- worn rubber never prints solid: punch ink out -->
<filter id="stamp-speckle" x="-10%" y="-10%"
width="120%" height="120%">
<feTurbulence type="fractalNoise" baseFrequency="0.22"
numOctaves="4" seed="9" result="t" />
<feColorMatrix in="t" type="matrix"
values="0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 -1.5 1.05" />
</filter>
<mask id="stamp-worn">
<rect x="0" y="0" width="150" height="190" fill="#fff" />
<rect x="0" y="0" width="150" height="190"
filter="url(#stamp-speckle)" />
</mask>
<!-- ragged edges, as if pressed by hand -->
<filter id="stamp-rough">
<feTurbulence type="fractalNoise" baseFrequency="0.09"
numOctaves="3" seed="4" result="n" />
<feDisplacementMap in="SourceGraphic" in2="n" scale="2"
xChannelSelector="R" yChannelSelector="G" />
</filter>
</defs>
<g class="gallows__stamp" aria-hidden="true">
<!-- Knocks out the linework beneath. Same colour as the
sheet, so there is no visible seam -- it only clears
a space. Roughened so the lines it cuts terminate
raggedly rather than on a machined edge. -->
<g class="gallows__stamp-back" filter="url(#stamp-rough)">
<rect x="16" y="76" width="120" height="56"
transform="rotate(-14 78 104)" />
</g>
<g class="gallows__stamp-ink"
mask="url(#stamp-worn)" filter="url(#stamp-rough)">
<g transform="rotate(-14 78 104)">
<rect x="16" y="76" width="120" height="56"
stroke-width="4" fill="none" />
<text x="76" y="101" text-anchor="middle"
class="stamp__word">VOID</text>
<path d="M23 110 H129" stroke-width="1.6" />
<text x="76" y="125" text-anchor="middle"
class="stamp__legend">SUPERSEDED</text>
</g>
</g>
</g>
</svg>
</section>
<section class="panel">
<div id="puzzle" class="puzzle" aria-hidden="true"></div>
<p id="puzzle-sr" class="sr-only" role="status" aria-live="polite"></p>
<p id="verdict" class="verdict" role="status" aria-live="polite"></p>
<dl class="block">
<div class="block__cell">
<dt class="block__label">Guesses left</dt>
<dd class="block__value">
<span id="tally" class="tally" aria-hidden="true"></span>
<span id="remaining" class="block__count"></span>
</dd>
</div>
<div class="block__cell block__cell--wide">
<dt class="block__label">Missed</dt>
<dd id="missed" class="block__value block__value--missed">—</dd>
</div>
</dl>
</section>
<section class="keys" aria-label="Letter keyboard">
<div id="keyboard" class="keys__grid"></div>
<div class="controls">
<div class="setup">
<div class="setup__row">
<fieldset class="scale">
<legend class="scale__legend">Difficulty</legend>
<div id="scale" class="scale__track"></div>
</fieldset>
<fieldset class="scale">
<legend class="scale__legend">Words</legend>
<div id="wordscale" class="scale__track"></div>
</fieldset>
</div>
<p id="setup-note" class="scale__note"></p>
</div>
<button id="reset" class="cta" type="button">New game</button>
</div>
</section>
</main>
<script src="./scripts/request.js" defer></script>
<script src="./scripts/hangman.js" defer></script>
<script src="./scripts/app.js" defer></script>
<script>
// Relative path, so this survives the repo being renamed or served
// from a different sub-path.
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('sw.js').catch(() => {
/* offline support simply won't be available */
})
})
}
</script>
</body>
</html>