-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
191 lines (178 loc) · 6.68 KB
/
Copy pathindex.html
File metadata and controls
191 lines (178 loc) · 6.68 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TileLoom — a free word-tile game</title>
<meta name="description" content="TileLoom: a free, open-source crossword tile game. Play against the computer or pass-and-play with a friend.">
<meta name="theme-color" content="#1d2430">
<link rel="manifest" href="manifest.webmanifest">
<link rel="apple-touch-icon" href="icons/apple-touch-icon.png">
<script>
// Apply saved theme/skin before first paint to avoid a flash
try {
var t = localStorage.getItem('tileloom-theme');
if (t) document.documentElement.dataset.theme = t;
var k = localStorage.getItem('tileloom-skin');
if (k) document.documentElement.dataset.skin = k;
} catch (e) {}
</script>
<link rel="stylesheet" href="style.css">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='18' fill='%23e8b04b'/><text x='50' y='68' font-size='58' text-anchor='middle' font-family='Georgia' font-weight='bold' fill='%233a2c14'>T</text></svg>">
</head>
<body>
<header>
<h1>Tile<span>Loom</span></h1>
<div class="header-buttons">
<button id="btn-looks" class="ghost" title="Theme and board colors">🎨</button>
<button id="btn-stats" class="ghost" title="Statistics">📊</button>
<button id="btn-sound" class="ghost" title="Toggle sound">🔊</button>
<button id="btn-new" class="ghost">New Game</button>
</div>
</header>
<main>
<section class="side left">
<div class="scorecard" id="player-0">
<div class="pname" id="p0-name">Player 1</div>
<div class="pscore" id="p0-score">0</div>
</div>
<div class="scorecard" id="player-1">
<div class="pname" id="p1-name">Player 2</div>
<div class="pscore" id="p1-score">0</div>
</div>
<div class="bag">Tiles in bag: <b id="bag-count">–</b></div>
<div class="checker">
<input id="check-input" type="text" placeholder="Check a word…" maxlength="15" autocomplete="off">
<button id="check-btn">?</button>
<div id="check-result"></div>
</div>
</section>
<section class="center">
<div id="status">Welcome to TileLoom.</div>
<div id="board" aria-label="game board"></div>
<div id="rack" aria-label="your tiles"></div>
<div class="controls">
<button id="btn-play" class="primary">Play</button>
<button id="btn-recall">Recall</button>
<button id="btn-shuffle">Shuffle</button>
<button id="btn-swap">Swap</button>
<button id="btn-pass">Pass</button>
<button id="btn-share" style="display:none">Share Link</button>
</div>
</section>
<section class="side right">
<h2>Moves</h2>
<ul id="history"></ul>
</section>
</main>
<!-- New game -->
<div class="overlay hidden" id="overlay-newgame">
<div class="dialog">
<h2>TileLoom</h2>
<p>Build words on the board, crossword-style. Premium squares multiply your score; using all 7 tiles earns a +40 bonus.</p>
<div class="mode-label">Play vs Computer</div>
<div class="dialog-buttons">
<button id="btn-diff-easy">Easy</button>
<button id="btn-diff-medium" class="primary">Medium</button>
<button id="btn-diff-hard">Hard</button>
</div>
<div class="mode-label">Play together</div>
<div class="dialog-buttons">
<button id="btn-mode-local">Two Players (pass & play)</button>
<button id="btn-mode-link">Play a Friend by Link</button>
</div>
<p class="mode-note">Link play needs no accounts: after each move you get
a link that holds the whole game — send it over any messenger.</p>
<button id="newgame-cancel" class="ghost small">Cancel</button>
</div>
</div>
<!-- Blank tile picker -->
<div class="overlay hidden" id="overlay-blank">
<div class="dialog">
<h2>Choose a letter for the blank</h2>
<div id="blank-grid"></div>
<button id="blank-cancel" class="ghost small">Cancel</button>
</div>
</div>
<!-- Handover (pass & play) -->
<div class="overlay hidden" id="overlay-handover">
<div class="dialog">
<h2 id="handover-text">Pass the device</h2>
<p>Make sure the other player isn't peeking!</p>
<div class="dialog-buttons">
<button id="btn-handover-ready" class="primary">I'm ready</button>
</div>
</div>
</div>
<!-- Appearance -->
<div class="overlay hidden" id="overlay-looks">
<div class="dialog">
<h2>Appearance</h2>
<div class="mode-label">Theme</div>
<div class="choice-row" id="theme-row">
<button data-theme="dark">Dark</button>
<button data-theme="light">Light</button>
</div>
<div class="mode-label">Board</div>
<div class="choice-row" id="skin-row">
<button data-skin="classic"><span class="skin-dot" style="background:#1f5249"></span>Classic</button>
<button data-skin="ocean"><span class="skin-dot" style="background:#1d3f5e"></span>Ocean</button>
<button data-skin="ember"><span class="skin-dot" style="background:#4d2e24"></span>Ember</button>
</div>
<div class="dialog-buttons">
<button id="looks-close" class="primary">Done</button>
</div>
</div>
</div>
<!-- Statistics -->
<div class="overlay hidden" id="overlay-stats">
<div class="dialog">
<h2>Your stats</h2>
<div id="stats-body"></div>
<div class="dialog-buttons">
<button id="stats-close" class="primary">Close</button>
<button id="stats-reset">Reset stats</button>
</div>
</div>
</div>
<!-- Share link (link play) -->
<div class="overlay hidden" id="overlay-share">
<div class="dialog">
<h2>Your move is in!</h2>
<p id="share-hint">Send this link to your opponent — it contains the whole game.</p>
<input id="share-url" readonly>
<div class="dialog-buttons">
<button id="share-copy" class="primary">Copy link</button>
<button id="share-native" hidden>Share…</button>
<button id="share-close">Close</button>
</div>
</div>
</div>
<!-- Game over -->
<div class="overlay hidden" id="overlay-gameover">
<div class="dialog">
<h2>Game over</h2>
<p id="gameover-text"></p>
<div class="dialog-buttons">
<button id="btn-again" class="primary">Play again</button>
<button id="btn-share-result" style="display:none">Share result</button>
</div>
</div>
</div>
<footer>
TileLoom is a free, original word game. Dictionary: public-domain ENABLE list.
</footer>
<script src="words.js"></script>
<script src="engine.js"></script>
<script src="ai.js"></script>
<script src="sound.js"></script>
<script src="stats.js"></script>
<script src="link.js"></script>
<script src="ui.js"></script>
<script>
if ('serviceWorker' in navigator && location.protocol !== 'file:') {
navigator.serviceWorker.register('sw.js');
}
</script>
</body>
</html>