separate js

This commit is contained in:
Alexander Popov 2021-02-25 07:46:59 +03:00
parent 561acea707
commit a87d2c7f75
Signed by: iiiypuk
GPG Key ID: 398FC73478D97286
4 changed files with 53 additions and 13 deletions

View File

@ -93,6 +93,8 @@
}
</script>
<script type="text/javascript" src="_media/js/game.js?v=2"></script>
<script type="text/javascript" src="js/pageStatistics.js?v=1"></script>
<script type="text/javascript" src="js/pageCredits.js?v=1"></script>
<script type="text/javascript" src="js/game.js?v=2"></script>
</body>
</html>

View File

@ -6,18 +6,6 @@ const keyboardLayouts = {
'ruQwertyKeyboard' : 'йцукеёнгшщзхъфывапролджэячсмитьбю'.toUpperCase()
}
const pageCredits = '\
<p class="text-center">Font F5.6 by\
<a href="http://dotcolon.net/">DOT COLON</a>\
</p>\
\
<p class="text-center">UI by\
<a href="https://jenil.github.io/chota/">chota.css</a>\
</p>\
';
const pageStatistics = '';
const words = [
'google', 'speed', 'design', 'forest', 'forever', 'love',
'horizon', 'defect'

11
js/pageCredits.js Normal file
View File

@ -0,0 +1,11 @@
'use strict';
const pageCredits = '\
<p class="text-center">Font F5.6 by\
<a href="http://dotcolon.net/">DOT COLON</a>\
</p>\
\
<p class="text-center">UI by\
<a href="https://jenil.github.io/chota/">chota.css</a>\
</p>\
';

39
js/pageStatistics.js Normal file
View File

@ -0,0 +1,39 @@
'use stheadict';
const pageStatistics = '\
<table>\
<caption>User statistics</caption>\
<thead>\
<tr>\
<th>Name</th>\
<th>Value</th>\
</tr>\
</thead>\
<tbody>\
<tr>\
<th>Всего игр</th>\
<th id="stTotalGames">0</th>\
</tr>\
<tr>\
<th>Отгаданных слов</th>\
<th id="stWinWords">0</th>\
</tr>\
<tr>\
<th>% побед</th>\
<th id="stWinPercentage">0</th>\
</tr>\
<tr>\
<th>Всего букв нажато</th>\
<th id="stLetterClick">0</th>\
</tr>\
<tr>\
<th>Букв отгадано</th>\
<th id="stWinLetter">0</th>\
</tr>\
<tr>\
<th>Процент верных букв</th>\
<th id="stWinLetterPercent">0</th>\
</tr>\
</tbody>\
</table>\
';