forked from amnond/jscrab
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
144 lines (144 loc) · 6.78 KB
/
index.html
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
<!DOCTYPE html>
<html class="loading" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<title>Vietboard Game : Ô Chữ Tiếng Việt</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-2843793-11"></script>
<script>
// GA
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-2843793-11');
// Browser check
window.g_isSupported = Array.prototype.indexOf
&& document.querySelector
&& window.addEventListener
&& typeof window.console==='object'
&& window.DOMTokenList
&& typeof window.JSON==='object'
&& typeof window.localStorage==='object';
(function() {
// Load translation
var sLang = localStorage['lang']==='vi' ? 'vi' : 'en';
var script = document.createElement('script');
script.src = 'lang/' + sLang + '_translate.js';
document.head.appendChild(script);
document.documentElement.lang = sLang; // HTML5 compliance
if (!g_isSupported) return;
// Toggle mobile layout
window.g_isMobile = window.outerWidth < window.outerHeight;
document.documentElement.classList.toggle('mobile', g_isMobile);
// Load tileset
window.g_tilesets = [
'Arima Madurai',
'Baloo 2',
'Barriecito',
'Bellota',
'Bellota Text',
'Calistoga',
'Charm',
'Dancing Script',
'Farsan',
'Grenze Gotisch',
'Itim',
'Lalezar',
'Lobster',
'Mali',
'MuseoModerno',
'Pangolin',
'Patrick Hand',
'Red Rose',
'Rowdies',
'Saira Stencil One',
'Sriracha',
'Yeseva One'
];
window.g_tileset = localStorage['tileset'];
var sFamily = g_tilesets.indexOf(g_tileset)>-1 ? g_tileset : 'Maven+Pro:wght@500';
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'https://fonts.googleapis.com/css2?family=' + sFamily + '&display=swap';
document.head.appendChild(link);
var style = document.createElement('style');
style.textContent = '.drag{font-family:\'' + (sFamily.indexOf('Maven')===0 ? 'Maven Pro' : sFamily) + '\', Arial, sans-serif}';
// Load bonuses layout
window.g_layouts = [
'Classic',
'WWF',
'Basketball',
'Flower Garden',
'Heart',
'Mario Star',
'Poké Ball',
'Smiley',
'Snowflake',
'Yin Yang',
'Random'
];
window.g_layout = localStorage['layout'] || 'default';
// Render bonus tiles
var aBonusTiles = [
['ST', 'be74d2'], // Inverse of player tile
['DL', '60b57c'], // #6021 Pale Green (bigchill.com)
['DW', 'feb81c'], // Super Mario star
['TL', '43abc9'], // Lighter Alice (visme.co)
['TW', 'cd594a'] // Lighter Ruby (visme.co)
];
var sSvg = '<svg width="50" height="50" version="1.1" viewBox="0 0 50 50" xmlns="http://www.w3.org/2000/svg"><path d="m49.913 18.967c-0.28268-0.85924-1.2317-1.7819-9.1735-2.7538-3.1633-0.38736-6.2996-0.63386-7.5178-0.71838-0.4442-1.1903-1.6086-4.2328-2.9143-7.2542-3.2912-7.5993-4.4824-8.2402-5.3439-8.2402-0.85476 0-2.0528 0.64091-5.3708 8.2543-1.3192 3.0214-2.497 6.0781-2.9546 7.2542-1.2115 0.077469-4.3074 0.30989-7.4371 0.67612-7.8813 0.93671-8.837 1.9016-9.1197 2.7327-0.047113 0.14086-0.080765 0.2958-0.080765 0.47892 0 0.94375 0.94225 2.6552 5.9025 7.4162 2.3489 2.2537 4.7584 4.3807 5.7006 5.2047-0.30287 1.2396-1.0567 4.423-1.6893 7.6979-0.76053 3.8947-1.0297 6.2189-1.0297 7.6486 0 1.5776 0.32979 2.0565 0.67977 2.3383 0.71342 0.55639 1.9922 0.76064 9.0052-3.3806 2.7931-1.648 5.4785-3.3947 6.5217-4.0849 1.0297 0.68317 3.6882 2.4087 6.4477 4.0356 6.9256 4.099 8.2514 3.944 8.9447 3.4792 0.41055-0.27468 0.77399-0.74655 0.77399-2.4087 0-1.4438-0.26922-3.775-1.0163-7.6486-0.63939-3.3172-1.4134-6.5781-1.7162-7.8318 0.93552-0.80994 3.3113-2.8946 5.6333-5.1061 4.9132-4.6976 5.842-6.3739 5.842-7.3176-0.0067-0.17607-0.03365-0.32398-0.08749-0.47188" stroke-width=".068849" fill="%23__COLOR__"/>';
var sSvgText = '<text x="50%" y="58%" dominant-baseline="middle" text-anchor="middle" fill="%23fff" font-family="Trebuchet MS, sans-serif" font-size="15px" font-weight="bold" letter-spacing="-.5px">__TEXT__</text>';
var sCss = '';
for (var i=0; i<aBonusTiles.length; ++i) {
sCss += 'table.board td.' + aBonusTiles[i][0] + '{background-image:url(\'data:image/svg+xml;utf8,' +
sSvg.replace('__COLOR__', aBonusTiles[i][1]) +
(i>0 ? sSvgText.replace('__TEXT__', aBonusTiles[i][0]) : '') +
'</svg>\')}';
}
style.textContent += sCss;
document.head.appendChild(style);
})();
</script>
<link rel="stylesheet" href="css/style.css">
<link rel="apple-touch-icon" sizes="180x180" href="../favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../favicon/favicon-16x16.png">
<link rel="manifest" href="../favicon/site.webmanifest">
<link rel="mask-icon" href="../favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="../favicon/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Vietboard">
<meta name="application-name" content="Vietboard">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="../favicon/browserconfig.xml">
<meta name="theme-color" content="#d4c462">
<meta name="description" content="Vietboard is a Vietnamese Scrabble-type word game (Ô Chữ Tiếng Việt) played against the computer.">
<meta property="og:title" content="Vietboard Game">
<meta property="og:locale" content="en_VN">
<meta property="og:description" content="Vietboard is a Vietnamese Scrabble-type word game (Ô Chữ Tiếng Việt) played against the computer.">
<meta property="og:url" content="https://www.vietboard.org/play/">
<meta property="og:site_name" content="Vietboard">
<link rel="canonical" href="https://www.vietboard.org/play/">
<script type="application/ld+json">{"@type":"WebSite","headline":"Vietboard Game","url":"https://www.vietboard.org/play/","name":"Vietboard Game","description":"Vietboard is a Vietnamese Scrabble-type word game (Ô Chữ Tiếng Việt) played against the computer.","@context":"https://schema.org"}</script>
</head>
<body>
<div id="app"></div>
<audio id="sound" src="sounds/tileonboard.mp3" preload="auto"></audio>
<div id="modal-mask"></div>
<div id="modal-container" role="dialog">
<div id="modal-inner">
<div id="modal-content"></div>
</div>
</div>
<script src="lang/vi_wordlist.js"></script>
<script src="lang/vi_defs.js"></script>
<script src="lang/vi_letters.js"></script>
<script src="src/redipsdrag.js"></script>
<script src="src/bonuses.js"></script>
<script src="src/ui.js"></script>
<script src="src/engine.js"></script>
<script src="src/events.js"></script>
<script src="src/changelog.js"></script>
</body>
</html>