-
Notifications
You must be signed in to change notification settings - Fork 26
/
board.html
121 lines (105 loc) · 5.18 KB
/
board.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
<!doctype html>
<html lang="en">
<head>
<title>Guess my word - Completion board</title>
<link rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🤔</text></svg>">
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./index.css?version=7" />
<link rel="stylesheet" href="./vue-virtual-scroller.css" />
</head>
<body style="margin: 0px;">
<div id="leaderboard-container">
<div class="leaderboard">
<dynamic-scroller
v-if="leaders.length"
:items="filteredLeaders || leaders"
:min-item-size="18.5"
key-field="name"
:class="'leaderboard-table ' + (hasPlayedThisBoardToday ? 'has-guesses ' : '') + leadersType"
prerender="4">
<template #before>
<header style="padding-top: 8px;">
<h1>
<a href="./" class="home">Guess my word</a>
<select id="difficulty-changer" v-on:change="setDifficulty" v-bind:class="difficulty" v-bind:value="difficulty">
<option value="normal">normal</option>
<option value="hard">hard</option>
</select>
</h1>
<a class="bigger-target" href="./README.html">about</a>
</header>
<h2 style="display: inline-block; margin-right: 15px;">
Completion board for "{{difficulty}}"
<select style="font-size: 0.8em;" v-bind:value="leadersType" v-on:change="toggleLeaderType">
<option value="normal">for Today</option>
<option value="allTime">for All time</option>
</select>
</h2>
<form
v-if="areLeadersLoaded()"
v-on:submit.prevent="onSearch"
style="display: inline-block; margin: 0 15px 15px 0;"
>
<input type="text" placeholder="search names" :value="leaderSearch" v-on:change="updateLeaderSearch"/>
<input type="submit" value="🔎"/>
</form>
<button v-if="filteredLeaders" v-on:click="clearSearch">X</button>
<button v-if="wordCloudData" v-on:click="toggleWordCloud">☁</button>
<div v-if="wordCloudData" id="word-cloud-container"></div>
<div class="error">{{error}}</div>
<div>{{message}}</div>
<div id="leaderboard-header-top"></div>
<div v-if="areLeadersLoaded()" class="header row" id="leaderboard-header">
<div
v-on:click="changeLeaderSort('name')"
class="name-cell cell"
>
<span v-if="sortConfig.key === 'name'" style="margin-left: 5px;">
{{sortConfig.direction === 'descending' ? '▾' : '▴'}}
</span>
{{leaderHeaderFields[0].text}} ({{leaders.length}})
</div>
<div
v-for="field in leaderHeaderFields.slice(1)"
v-on:click="changeLeaderSort(field.key)"
:class="field.key + '-cell cell'"
>
<span v-if="sortConfig.key === field.key" style="margin-left: 5px;">
{{sortConfig.direction === 'descending' ? '▾' : '▴'}}
</span>
{{field.text}}
</div>
</div>
</template>
<template v-slot="{item, index, active}">
<dynamic-scroller-item
:item="item"
:active="active"
:data-index="index"
:class="'row ' + (index % 2 === 0 ? 'even ' : '') + (usedNames.includes(item.name) ? 'my-name' : '')"
>
<div class="name-cell cell" :title="item.name">
{{item.name}}
</div>
<div
v-for="field in leaderHeaderFields.slice(1)"
:class="field.key + '-cell cell '"
:title="item[field.key]"
>
{{field.formatter(item[field.key])}}
</div>
</dynamic-scroller-item>
</template>
</dynamic-scroller>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
<script src="./vue-virtual-scroller.min.js"></script>
<script src="common.js?version=5"></script>
<script src="index.js?version=5"></script><!-- FIXME can get rid of this? -->
<script src="board.js?version=5"></script>
<script src="./wordcloud2.js"></script>
<script src="/assets/js/googleAnalytics.js"></script>
</body>
</html>