-
Notifications
You must be signed in to change notification settings - Fork 1
/
iframe.html
133 lines (131 loc) · 6.54 KB
/
iframe.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="./vendor/bootstrap-reboot.min.css">
<link rel="stylesheet" href="./asset/loading.css.animation.css">
<link rel="stylesheet" href="./feature-board.css">
<link rel="shortcut icon" href="./asset/favicon.ico" />
<title>Feature Board</title>
</head>
<body>
<!--
/*****************************************************
* project: game feature board *
* description: iframe to be embedded *
* author: [email protected] *
* url: https://github.com/horans/game-feature-board *
* update: 180811 *
*****************************************************/
-->
<main id="app" class="gfb-app" :class="{ 'ready': state.init, 'loading': state.wait, 'running': game.running, 'result': state.result, 'submit': state.submit }">
<section class="gfb-main">
<div class="gfb-container" v-if="config">
<div class="gfb-board">
<div class="gfb-action center">
<div class="gfb-label">
<span class="gfb-timer" v-if="game.running"><samp>{{ timer }}s</samp></span>
<span class="gfb-start" v-else @click="startGame">{{ again ? 'Restart' : 'Start Game' }}</span>
</div>
<div class="gfb-label" v-if="!game.running && again">
<span class="gfb-start" @click="hardGame">{{ game.hard ? 'Normal' : 'Hard' }}</span>
</div>
</div>
<div class="gfb-cells-wrapper-outer" @click.self="startGame">
<div class="gfb-cells-wrapper-inner">
<ul class="gfb-cells transition" v-if="game.cells.length > 0">
<li :class="{ 'chosen': item.chosen }" v-for="(item, index) in game.cells" @click="chooseCell(index)" :ref="'cell' + index" :style="'width:' + percent + '%; font-size:' + percent + 'px'">
<div class="gfb-cells-item">
<i class="transition" v-html="item.index === -1 ? config.game.svg : config.feats[item.index].svg"></i>
</div>
</li>
</ul>
<div class="gfb-result transition">
<div class="gfb-image"></div>
<div class="gfb-text center" v-if="config.label && best">
<template v-if="state.submit">
<h2 class="gfb-heading">Thanks for Playing the Game!</h2>
<div class="gfb-desc" v-html="config.label.submitAfter"></div>
</template>
<template v-else>
<h2 class="gfb-heading">Excellent! <br>Your Best Score Is <samp>{{ formatTime(best.time) }}s</samp>!</h2>
<div class="gfb-desc" v-html="config.label.submitBefore"></div>
</template>
</div>
<ul class="gfb-links center" v-if="state.submit">
<li v-for="item in config.links">
<a :href="item.url" target="_parent">{{ item.label }}</a>
</li>
</ul>
<div class="gfb-submit" :class="{ 'error': api.error.msg }" v-else>
<form class="gfb-form" @submit.prevent="apiAction('addScore')">
<button type="submit" class="center">Submit</button>
<input type="email" placeholder="Your Email Address" v-model="api.types.addScore.data.user_email" required :readonly="state.email" />
</form>
<div class="gfb-note">
<template v-if="api.error.msg"><strong>* Error:</strong> {{ api.error.msg }}</template>
<template v-else><strong>* Note:</strong> Your email address will be only used for the award notification.</template>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="gfb-hints">
<div class="gfb-feats-wrapper">
<div class="gfb-title center" v-if="config.label">Features of {{ config.label.product }}</div>
<ul class="gfb-feats">
<li :class="{ 'active': item.active }" v-for="item in config.feats">
<i v-html="item.svg"></i>
<span>{{ item.label }}</span>
<a v-if="item.url" target="_parent" :href="item.url"></a>
</li>
</ul>
</div>
<div class="gfb-scores-wrapper">
<div class="gfb-title center"><br />Your Scores</div>
<ul class="gfb-feats gfb-scores">
<li v-for="(item, index) in game.scores" :class="{ 'best' : (game.scores.length - index) === best.try && game.scores.length > 1 }">
<pre class="dot"> ·</pre>
<samp>{{ formatTime(item.time) }}s</samp>
<small v-if="game.scores.length > 1">
<em v-if="index === 0">Last</em>
<em v-if="item.level === 'hard'">Hard</em>
</small>
</li>
</ul>
<div class="gfb-title center"><br />Top Scores</div>
<ul class="gfb-feats gfb-scores">
<li v-for="(item, index) in game.tops">
<pre>#{{ (index + 1) }}</pre>
<samp>{{ formatTime(item.extension_key) }}s</samp>
<small>
<em v-if="item.level === 'hard'">Hard</em>
</small>
<figure v-if="item.locale" :style="showFlag(item.locale)"></figure>
</li>
</ul>
</div>
</div>
</div>
</section>
<aside class="gfb-loading transition">
<div class="gfb-loading-item transition">
<div class="gfb-loading-line"></div>
<div class="gfb-loading-line"></div>
<div class="gfb-loading-line"></div>
</div>
</aside>
</main>
<!-- vendor -->
<script src="./vendor/vue.min.js"></script>
<script src="./vendor/axios.min.js"></script>
<script src="./vendor/lodash.min.js"></script>
<script src="./vendor/vue-axios.min.js"></script>
<script src="./vendor/webfontloader.js"></script>
<script src="./vendor/es6-promise.auto.min.js"></script>
<!-- inpage -->
<script src="./feature-board.js"></script>
</body>
</html>