-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
314 lines (282 loc) · 14.3 KB
/
Copy pathindex.html
File metadata and controls
314 lines (282 loc) · 14.3 KB
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<style>
.full {
width: 100%;
height: 100%;
background-color: black;
}
.full2 {
width: 100%;
height: 100%;
}
.full3 {
width: 100%;
height: 50%;
}
#zoneselectheader {
height: 72px;
}
#zonemapheader {
height: 46px;
}
#zoneselectmain {
overflow-x: hidden;
overflow-y: auto;
}
.v-btn-toggle .v-btn {
width: 100%;
height: 100%;
white-space: nowrap;
overflow: hidden;
padding: 0px;
}
.actionButtons {
position: absolute;
top: 66px;
right: 20px;
}
</style>
</head>
<body>
<div id="app">
<v-app>
<v-app-bar app dark dense id="header" class="primary">
<v-toolbar-title class="headline text-uppercase">
<span>{{title}}</span>
</v-toolbar-title>
<template v-slot:extension>
<v-tabs align-with-title v-model="mms.tab">
<v-tab>エリア選択</v-tab>
<v-tab v-for="item in mms.openedZones" :key="item.NameWithInstance" :class="item.Class">
{{item.NameWithInstance}}
<v-spacer></v-spacer>
<v-icon dark small right @click="removeTab(item)">
mdi-close-circle
</v-icon>
</v-tab>
</v-tabs>
</template>
</v-app-bar>
<v-main>
<v-layout class="pa-0 full2">
<div v-show="mms.tab==0" id="zoneselect" class="full2">
<v-container fluid grid-list-md class="py-0 md-0 full2">
<v-layout row wrap class="full2">
<v-flex id="zoneselectheader" class="py-0 full2" xs12>
<v-switch v-model="mms.showAll" class="py-0" label="全エリア"></v-switch>
</v-flex>
<v-flex xs12 id="zoneselectmain" class="py-0">
<v-card v-for="region in mms.regions" :key="region.Name">
<v-layout row wrap>
<v-flex v-if="mms.showAll" xs12>
<h3>{{region.Name}}</h3>
</v-flex>
<template v-for="(item,i) in region.ZoneInstances">
<v-flex v-if="mms.showAll || item.Filter" :key="item.ID2" xs6 sm4 md4>
<v-card :class="region.Class" class="pa-2" @click="addTab(item)">
<v-badge :value="item.Cache.progress" color="green"
:content="item.Cache.progress" inline>
<span>{{item.NameWithInstance}}</span>
</v-badge>
</v-card>
</v-flex>
</template>
</v-layout>
</v-card>
</v-flex>
</v-layout>
</v-container>
</div>
<div v-show="mms.tab>0" id="zonemap" class="full">
<v-layout id="zonemapheader" row wrap no-gutters class="full2">
<v-col xs4 v-if="mms.zoneInstance.Type!=2">
<v-row align="center" justify="center" text dark block
class="ma-0 full2 red white--text">{{mms.zoneInstance.Mobs[0].Name}}</v-row>
</v-col>
<v-col xs4 v-else>
<v-row align="center" justify="center" text dark block
class="ma-0 full3 red white--text">{{mms.zoneInstance.Mobs[0].Name}}</v-row>
<v-row align="center" justify="center" text dark block
class="ma-0 full3 blue-grey white--text">{{mms.zoneInstance.Mobs2[0].Name}}</v-row>
</v-col>
<v-col xs4 v-if="mms.zoneInstance.Type==0">
<v-row align="center" justify="center" text dark block
class="ma-0 full2 yellow black--text">{{mms.zoneInstance.Mobs[1].Name}}</v-row>
</v-col>
<v-col xs4 v-else>
<v-row align="center" justify="center" text dark block
class="ma-0 full3 yellow black--text">{{mms.zoneInstance.Mobs[1].Name}}</v-row>
<v-row align="center" justify="center" text dark block
class="ma-0 full3 green black--text">{{mms.zoneInstance.Mobs[2].Name}}</v-row>
</v-col>
<v-col xs4 v-if="mms.zoneInstance.Type==0">
<v-row align="center" justify="center" text dark block
class="ma-0 full2 blue white--text">{{mms.zoneInstance.Mobs[2].Name}}</v-row>
</v-col>
<v-col xs4 v-else>
<v-row align="center" justify="center" text dark block
class="ma-0 full3 blue white--text">{{mms.zoneInstance.Mobs[3].Name}}</v-row>
<v-row align="center" justify="center" text dark block
class="ma-0 full3 purple white--text">{{mms.zoneInstance.Mobs[4].Name}}</v-row>
</v-col>
</v-layout>
<canvas id="canvas"></canvas>
<div class="actionButtons">
<v-btn color="red" dark small fab @click="focusMap">
<v-icon>mdi-image-filter-center-focus</v-icon>
</v-btn>
<v-btn color="green" dark small fab @click="toggleInfo">
<v-icon>mdi-information</v-icon>
</v-btn>
<v-dialog v-model="confirmation" width="400">
<template v-slot:activator="{ on }">
<v-btn color="orange" dark small fab @click="confirmation=true">
<v-icon>mdi-notification-clear-all</v-icon>
</v-btn>
</template>
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
チェック状態の初期化
</v-card-title>
<v-card-text>
Sモブ討伐直後などにチェック状態を初期化します。<br />
Sモブが出現しないポイントにはあらかじめチェックが付きます。<br />
やり直しはできませんが、本当に進めて良いですか?
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="secondary" text @click="confirmation=false">
キャンセル
</v-btn>
<v-btn color="primary" text @click="reset()">
リセットする
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</div>
</v-layout>
</v-main>
<v-footer app id="footer" class="primary darken">
<v-layout justify-center row wrap>
<v-flex primary text-center white--text xs12>
<small>記載されている会社名・製品名・システム名などは、各社の商標、または登録商標です。</small>
</v-flex>
</v-layout>
</v-footer>
</v-app>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
<script src="utils.js"></script>
<script src="data.js"></script>
<script>
new Vue({
el: '#app',
vuetify: new Vuetify(),
data: {
mms: new MobMapService(),
mapCanvas: null,
dialog: false,
confirmation: false
},
computed: {
title() {
return this.tab == 0 ?
'エリア選択' : this.tab-1 < this.mms.openedZones.length ?
(this.mms.openedZones[this.tab - 1]).NameWithInstanceProgress : '';
},
tab() {
return this.mms.tab;
},
tabCount() {
return this.mms.openedZones.length
}
},
mounted: function () {
document.body.style.mozUserSelect = document.body.style.webkitUserSelect = document.body.style.userSelect = 'none';
this.mapCanvas = new MobMapCanvas(document.getElementById('canvas'));
window.addEventListener("resize", this.onResize);
this.$nextTick(() => {
const elHtml = document.getElementsByTagName('html')[0]
elHtml.style["overflow-y"] = 'hidden'
this.onResize()
})
},
beforeDestroy() {
window.removeEventListener("resize", this.onResize);
},
methods: {
addTab(zone) {
this.mms.openZone(zone);
},
removeTab(zone) {
this.mms.closeZone(zone);
},
onResize() {
const width = window.innerWidth
const height = window.innerHeight
if (this.tab > 0) {
const offsetHeightHeader = document.getElementById('header').offsetHeight
const offsetHeightZoneMapHeader = document.getElementById('zonemapheader').offsetHeight
const offsetHeightFooter = document.getElementById('footer').offsetHeight
const offsetHeights = offsetHeightHeader + offsetHeightZoneMapHeader + offsetHeightFooter
console.log('onResize', height, offsetHeights, offsetHeightHeader, offsetHeightZoneMapHeader, offsetHeightFooter);
this.mapCanvas.setSize(width, height - offsetHeights + 1)
}
else {
const offsetHeightHeader = document.getElementById('header').offsetHeight
const offsetHeightZoneStatusHeader = document.getElementById('zoneselectheader').offsetHeight
const offsetHeightFooter = document.getElementById('footer').offsetHeight
const offsetHeights = offsetHeightHeader + offsetHeightZoneStatusHeader + offsetHeightFooter
console.log('onResize', height, offsetHeights, offsetHeightHeader, offsetHeightZoneStatusHeader, offsetHeightFooter);
document.getElementById('zoneselectmain').style.height = `${height - offsetHeights + 1}px`
}
},
focusMap() {
this.mapCanvas.focusRegion()
this.mapCanvas.draw()
},
toggleInfo() {
this.mapCanvas.showInfo = !this.mapCanvas.showInfo
this.mapCanvas.draw()
},
reset() {
this.confirmation = false
this.mms.zoneInstance.Cache.reset()
this.mapCanvas.draw()
},
forceAreaChange() {
console.log(this.tab)
if (this.tab > 0) {
const newZoneInstance = this.mms.openedZones[this.tab - 1];
if (this.mms.zoneInstance.ID2 != newZoneInstance.ID2) {
this.mms.zoneInstance = newZoneInstance;
this.mapCanvas.setArea(newZoneInstance);
}
}
this.$nextTick(() => {
this.onResize()
})
}
},
watch: {
tab() {
this.forceAreaChange()
},
tabCount() {
this.forceAreaChange()
}
}
})
</script>
</body>
</html>