-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
274 lines (270 loc) · 18.3 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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>slotMachine</title>
<meta itemprop="image" content="img/machine.jpg">
<meta property="og:image" content="img/machine.jpg">
<meta name="twitter:image" content="img/machine.jpg">
<link rel="apple-touch-icon" sizes="100x100" href="img/logo.png">
<link rel="shortcut icon" href="img/logo.png" type="image/x-icon">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="css/main.min.css">
</head>
<body>
<div id="app" class="fixed inset-0 w-full">
<div id="slotMachineOutBox" class="absolute p-2">
<p v-show="currentID > 0" id="slotMachineID" style="display: none;" class="absolute text-white">slot777-{{ currentID }}</p>
<div id="slotMachine" class="pb-1 h-4/5 text-center">
<div class="relative inline-block h-full">
<img class="h-full" src="img/bg_reel.png" alt="reel">
<div id="slotReels" class="absolute z-10 flex justify-center items-center overflow-hidden">
<slot-reel ref="reel1" @stopped="reelStopped" :value="1" :max-speed="speed"></slot-reel>
<slot-reel ref="reel2" @stopped="reelStopped" :value="2" :max-speed="speed"></slot-reel>
<slot-reel ref="reel3" @stopped="reelStopped" :value="3" :max-speed="speed"></slot-reel>
<slot-line ref="winline"></slot-line>
</div>
</div>
</div>
<div id="slotButton" class="p-0.5 md:p-1 h-1/5 rounded">
<div class="p-0.5 md:p-1 flex items-end w-full h-full rounded-t-sm">
<div class="mr-2 w-2/5 h-full" :class="{'opacity-50 pointer-events-none': onload}">
<div class="pb-0.5 md:pb-1 flex items-center w-full h-1/3">
<p class="slot-title mr-1 font-bold whitespace-nowrap">下注</p>
<div class="slot-input flex items-center w-full h-full">
<button class="h-full text-white" :class="{'opacity-50 pointer-events-none': bet <= 5}"
:disabled="bet <= 5" @click="bet = bet - 5">
<svg xmlns="http://www.w3.org/2000/svg" class="h-full" fill="none"
viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
</svg>
</button>
<input type="tel" class="w-full h-full text-center" v-model="bet">
<button class="h-full text-white"
:class="{'opacity-50 pointer-events-none': bet + 5 > totalBet}"
:disabled="bet + 5 > totalBet" @click="bet = bet + 5">
<svg xmlns="http://www.w3.org/2000/svg" class="h-full" fill="none"
viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" />
</svg>
</button>
</div>
</div>
<div class="slot-menu flex justify-between items-center w-full h-2/3">
<button class="slot-btn relative mr-0.5 md:mr-1 h-full" :disabled="double == 1"
:class="{'opacity-50': double != 1}" @click="double = 1">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">1倍</p>
</button>
<button class="slot-btn relative mr-0.5 md:mr-1 h-full" :disabled="double == 2"
:class="{'opacity-50': double != 2}" @click="double = 2">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">2倍</p>
</button>
<button class="slot-btn relative mr-0.5 md:mr-1 h-full" :disabled="double == 5"
:class="{'opacity-50': double != 5}" @click="double = 5">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">5倍</p>
</button>
<button class="slot-btn relative mr-0.5 md:mr-1 h-full" :disabled="double == 10"
:class="{'opacity-50': double != 10}" @click="double = 10">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">10倍</p>
</button>
<button class="slot-btn relative h-full" :disabled="double == 20"
:class="{'opacity-50': double != 20}" @click="double = 20">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">20倍</p>
</button>
</div>
</div>
<button id="slotBet" class="slot-btn relative z-10 w-1/5 rounded-full overflow-hidden"
:class="{'filter brightness-75 cursor-no-drop': onload || totalBet < bet * double}"
:disabled="onload || totalBet < bet * double" @click="start()">
<img class="w-full" src="img/btn_bet.png" alt="bet">
<p v-if="!onload"
class="absolute inset-0 flex justify-center items-center font-bold rounded-full">開始</p>
<p v-if="onload"
class="absolute inset-0 flex justify-center items-center font-bold rounded-full animate-spin">
<svg xmlns="http://www.w3.org/2000/svg" style="transform: rotateY(-180deg);"
class="w-1/2 h-1/2" fill="none" viewBox="0 0 24 24" stroke="currentColor"
stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
</svg>
</p>
</button>
<div class="ml-2 w-2/5 h-full">
<div class="pb-0.5 md:pb-1 flex items-center w-full h-1/3">
<svg xmlns="http://www.w3.org/2000/svg" class="slot-title mr-1 h-full" fill="none"
viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M9 8l3 5m0 0l3-5m-3 5v4m-3-5h6m-6 3h6m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<div class="slot-input flex-1 flex items-center h-full">
<input type="tel" class="w-full h-full text-center" v-model="totalBet" readonly>
</div>
</div>
<div class="slot-menu flex justify-around items-center w-full h-2/3">
<button class="slot-btn relative mr-0.5 md:mr-1 h-full" :class="{'opacity-50': !onRepeat}"
@click="onRepeat = !onRepeat">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">重複</p>
</button>
<button class="slot-btn relative mr-0.5 md:mr-1 h-full" :class="{'opacity-50': !onSpeedUp}"
@click="onSpeedUp = !onSpeedUp">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">加速</p>
</button>
<button class="slot-btn relative mr-0.5 md:mr-1 h-full" @click="recordShow = !recordShow">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">紀錄</p>
</button>
<button class="slot-btn relative mr-0.5 md:mr-1 h-full"
:class="{'opacity-50 cursor-no-drop': onload}" :disabled="onload" @click="reset()">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">重置</p>
</button>
<button class="slot-btn relative h-full" @click="onClose()">
<img class="h-full object-contain" src="img/btn.png" alt="slot-btn">
<p class="absolute inset-0 flex justify-center items-center font-bold">關閉</p>
</button>
</div>
</div>
</div>
</div>
</div>
<div v-show="isScreen" style="display: none;" id="screenBox" class="fixed inset-0 z-50 bg-gray-700">
<svg xmlns="http://www.w3.org/2000/svg" class="absolute top-1/2 left-1/2 w-1/3 xl:w-1/4 h-max text-white"
fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z" />
</svg>
</div>
<div v-show="recordShow" id="recordModal" style="display: none;"
class="modal absolute inset-0 z-20 w-full overflow-y-auto">
<div
class="modal-title fixed top-0 left-0 w-full flex justify-center items-center h-8 md:h-10 lg:h-12 text-white text-center">
<div class="container relative mx-2 text-base lg:text-lg lg:font-bold">
歷史紀錄
<button class="modal-back absolute top-1/2 right-0" @click="recordShow = !recordShow">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 lg:h-8" fill="none" viewBox="0 0 24 24"
stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</button>
</div>
</div>
<div class="modal-content mt-8 md:mt-10 lg:mt-12 w-full">
<div class="container mx-auto p-2">
<table class="w-full text-white text-center">
<thead>
<tr>
<th class="p-1"><span class="hidden md:inline">日期</span><span>時間</span></th>
<th class="p-1">ID</th>
<th class="p-1">下注<span class="mx-1">/</span>倍率</th>
<th class="p-1">輸贏<span class="mx-1">/</span>金額</th>
<th class="p-1">備註</th>
</tr>
</thead>
<tbody v-if="recordData.length > 0" class="text-sm lg:text-base">
<tr v-for="(record, index) in recordData" :key="index">
<td class="p-1"><span class="hidden md:inline mr-2">{{ record.date }}</span><span>{{
record.time }}</span></td>
<td class="p-1">{{ record.id }}</td>
<td class="p-1">{{ record.bet }}<span class="mx-1">/</span>{{ record.double }}</td>
<td class="p-1" :class="record.winLoss ? 'text-blue-400' : 'text-red-600'">{{ record.winLoss ? '贏' : '輸' }}<span class="mx-1">/</span>{{
record.winBet }}</td>
<td class="p-1">
<button @click="getDetails(record)">詳情</button>
</td>
</tr>
</tbody>
<tbody v-else class="text-sm lg:text-base">
<tr>
<td colspan="5" class="p-1">查無資料</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div v-show="detailsData.length > 0" id="detailsModal" style="display: none;"
class="modal absolute inset-0 z-30 w-full overflow-y-auto">
<div v-if="detailsData.length > 0"
class="modal-title fixed top-0 left-0 w-full flex justify-center items-center h-8 md:h-10 lg:h-12 text-white text-center">
<div class="container relative mx-2 text-base lg:text-lg lg:font-bold">
<span class="mr-1">{{ detailsData[0].id }}</span><span>詳細</span>
<button class="modal-back absolute top-1/2 right-0" @click="detailsData = []">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 lg:h-8" fill="none" viewBox="0 0 24 24"
stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</button>
</div>
</div>
<div v-if="detailsData.length > 0" class="modal-content mt-8 md:mt-10 lg:mt-12 w-full">
<div class="container mx-auto p-2">
<table class="w-full text-white text-center">
<tbody v-if="recordData.length > 0" class="text-sm lg:text-base">
<tr>
<td class="p-1">日期</td>
<td class="p-1">{{ detailsData[0].date }}</td>
</tr>
<tr>
<td class="p-1">時間</td>
<td class="p-1">{{ detailsData[0].time }}</td>
</tr>
<tr>
<td class="p-1">下注</td>
<td class="p-1">{{ detailsData[0].bet }}</td>
</tr>
<tr>
<td class="p-1">倍率</td>
<td class="p-1">{{ detailsData[0].double }}</td>
</tr>
<tr>
<td class="p-1">實際下注</td>
<td class="p-1">{{ detailsData[0].bet * detailsData[0].double }}</td>
</tr>
<tr>
<td class="p-1">輸贏金額</td>
<td class="p-1" :class="detailsData[0].winLoss ? 'text-blue-400' : 'text-red-600'">{{ detailsData[0].winBet }}</td>
</tr>
<tr>
<td class="p-1">輸贏</td>
<td class="p-1" :class="detailsData[0].winLoss ? 'text-blue-400' : 'text-red-600'">{{ detailsData[0].winLoss ? '贏' : '輸' }}</td>
</tr>
<tr>
<td class="p-1">原始版面</td>
<td class="p-1">
<div class="mx-auto flex justify-center items-center flex-wrap w-24 h-24">
<img v-for="(item, index) in detailsData[0].details.reel" :key="index" class="w-1/3" :src=`img/${item}.png` :alt="item">
</div>
</td>
</tr>
<tr v-if="detailsData[0].details.win.length > 0">
<td class="p-1">連線</td>
<td class="p-1">
<div v-for="(item, index1) in detailsData[0].details.win" :key="index1">
<div class="mx-auto flex justify-center items-center">
<img class="w-8" v-for="(tail, index2) in item.tail" :key="index2" :src=`img/${tail}.png` :alt="tail">
<span class="mx-1">贏 :</span><span>{{ item.winBet }}</span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.14/vue.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>