-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
582 lines (534 loc) · 40.4 KB
/
Copy pathindex.html
File metadata and controls
582 lines (534 loc) · 40.4 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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>钓鱼佬Mike的钓鱼宝典 (颜值详尽版)</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Zcool+KuaiLe&display=swap" rel="stylesheet">
<style>
/* 全局字体与背景 */
body {
background: radial-gradient(circle at top, #1e293b, #0f172a, #020617);
color: #e2e8f0;
font-family: "Segoe UI", system-ui, sans-serif;
padding-bottom: 90px;
-webkit-tap-highlight-color: transparent;
}
/* 隐藏滚动条但保留功能 */
::-webkit-scrollbar { width: 0px; background: transparent; }
/* 玻璃拟态顶部栏 */
.glass-header {
background: rgba(15, 23, 42, 0.85);
backdrop-filter: blur(16px);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}
/* 游戏化卡片 */
.fish-card {
background: rgba(30, 41, 59, 0.6);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 16px;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}
.fish-card:active { transform: scale(0.98); background: rgba(30, 41, 59, 0.8); }
/* Mike 专属金标 */
.mike-badge {
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
color: white;
padding: 2px 8px;
border-radius: 6px;
font-size: 0.65rem;
font-weight: 900;
box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* 图片容器 */
.fish-img-box {
width: 60px; height: 60px;
background: #0f172a;
border-radius: 14px;
overflow: hidden;
border: 2px solid rgba(255,255,255,0.1);
position: relative;
flex-shrink: 0;
box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}
.fish-img-box img { width: 100%; height: 100%; object-fit: cover; }
/* 价格标签 */
.price-tag {
background: rgba(16, 185, 129, 0.2);
color: #6ee7b7;
border: 1px solid rgba(16, 185, 129, 0.4);
font-family: monospace;
padding: 2px 6px;
border-radius: 6px;
font-size: 0.7rem;
font-weight: bold;
}
/* 鱼竿标签 */
.badge { padding: 3px 8px; border-radius: 8px; font-size: 0.65rem; font-weight: 800; display: inline-flex; align-items: center; }
.rod-ice-light { background: linear-gradient(to right, #0ea5e9, #0284c7); color: white; box-shadow: 0 2px 5px rgba(14, 165, 233, 0.4); }
.rod-ice-heavy { background: linear-gradient(to right, #ef4444, #b91c1c); color: white; box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4); }
.rod-river-light { background: linear-gradient(to right, #22c55e, #15803d); color: white; box-shadow: 0 2px 5px rgba(34, 197, 94, 0.4); }
.rod-river-heavy { background: linear-gradient(to right, #eab308, #a16207); color: white; box-shadow: 0 2px 5px rgba(234, 179, 8, 0.4); }
.rod-common { background: #475569; color: #cbd5e1; }
/* 按钮美化 */
.btn-glass {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
backdrop-filter: blur(4px);
transition: all 0.2s;
}
.btn-glass:active { background: rgba(255, 255, 255, 0.1); transform: scale(0.95); }
/* 天气按钮特效 */
.weather-btn {
border-radius: 12px;
font-weight: bold;
transition: all 0.2s;
border: 2px solid transparent;
position: relative;
overflow: hidden;
}
.weather-btn.active { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.weather-btn-sun.active { background: #f97316; border-color: #fdba74; color: white; box-shadow: 0 0 15px rgba(249, 115, 22, 0.5); }
.weather-btn-fog.active { background: #64748b; border-color: #94a3b8; color: white; }
.weather-btn-snow.active { background: #2563eb; border-color: #60a5fa; color: white; box-shadow: 0 0 15px rgba(37, 99, 235, 0.5); }
.weather-btn-storm.active { background: #4f46e5; border-color: #818cf8; color: white; box-shadow: 0 0 15px rgba(79, 70, 229, 0.5); }
/* 模态框 */
.modal-mask { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.2s ease; }
.modal-content { background: #1e293b; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); animation: zoomIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* 裁切区域 */
#cropper-canvas-container {
width: 100%; height: 100%; overflow: auto; position: relative; cursor: crosshair;
background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 20px 20px;
}
.crop-box { position: absolute; border: 2px solid #fbbf24; background: rgba(251, 191, 36, 0.2); pointer-events: none; z-index: 50; box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); }
</style>
</head>
<body>
<div id="app" class="max-w-md mx-auto min-h-screen flex flex-col relative overflow-hidden">
<div class="absolute top-0 left-1/2 -translate-x-1/2 w-full h-64 bg-blue-500/10 blur-[100px] rounded-full pointer-events-none"></div>
<header class="glass-header p-4 sticky top-0 z-50 rounded-b-3xl">
<div class="flex justify-between items-center mb-4">
<div>
<h1 class="text-xl font-bold text-white tracking-wide flex items-center gap-2">
🎣 钓鱼宝典
<span class="mike-badge">Mike V15.1</span>
</h1>
<p class="text-[10px] text-blue-300 opacity-80 mt-0.5">私は最高です!Winter Edition</p>
</div>
<div class="text-right">
<div class="text-2xl font-mono font-bold text-blue-400 drop-shadow-md">{{ currentTimeStr }}</div>
<button @click="showHelp = true" class="text-[10px] bg-white/10 hover:bg-white/20 px-3 py-1 rounded-full mt-1 transition flex items-center gap-1 ml-auto border border-white/20">
<span>📖</span> 秘籍
</button>
</div>
</div>
<div class="grid grid-cols-3 gap-3 mb-4">
<button @click="showMap = true" class="btn-glass text-xs font-bold py-3 rounded-xl flex flex-col items-center gap-1 text-blue-200">
<span class="text-lg">🗺️</span> 地图
</button>
<button @click="showAddFish = true" class="btn-glass text-xs font-bold py-3 rounded-xl flex flex-col items-center gap-1 text-green-300">
<span class="text-lg">➕</span> 加新鱼
</button>
<button @click="toggleMode" :class="['text-xs font-bold py-3 rounded-xl flex flex-col items-center gap-1 transition', viewMode === 'all' ? 'bg-indigo-600 text-white shadow-lg' : 'btn-glass text-purple-300']">
<span class="text-lg">{{ viewMode === 'all' ? '🔙' : '📚' }}</span>
{{ viewMode === 'all' ? '回首页' : '全图鉴' }}
</button>
</div>
<div v-if="viewMode === 'live'">
<div class="bg-black/40 rounded-2xl p-3 mb-4 border border-white/5 relative overflow-hidden flex justify-between items-center px-4">
<div>
<div class="text-[10px] text-gray-400 uppercase tracking-widest">Current Time</div>
<div class="text-lg font-bold text-white">{{ gamePeriod }}</div>
</div>
<div class="text-right">
<div class="text-[10px] text-gray-400 uppercase tracking-widest">Refresh In</div>
<div class="text-lg font-mono font-bold text-yellow-400">{{ minutesLeft }} <span class="text-xs">min</span></div>
</div>
<div class="absolute bottom-0 left-0 h-1 bg-white/10 w-full">
<div :style="{ width: (10 - minutesLeft) * 10 + '%' }" class="h-full bg-blue-500 transition-all duration-1000"></div>
</div>
</div>
<div v-if="weather" class="mb-3 flex items-center justify-between text-xs px-2 animate-pulse">
<span class="text-blue-300">🔍 正在筛选: <b>{{ formatGamePeriod(gamePeriod) }}</b> + <b>{{ weather }}</b></span>
<span class="bg-blue-600/30 text-blue-200 px-2 py-0.5 rounded-full border border-blue-500/30">{{ filteredList.length }} 条鱼</span>
</div>
<div class="grid grid-cols-4 gap-2">
<button @click="weather = '晴天'" :class="['weather-btn weather-btn-sun py-3 text-xs', weather === '晴天' ? 'active' : 'bg-slate-800 text-gray-400']">☀️ 晴天</button>
<button @click="weather = '雾天'" :class="['weather-btn weather-btn-fog py-3 text-xs', weather === '雾天' ? 'active' : 'bg-slate-800 text-gray-400']">🌫️ 雾天</button>
<button @click="weather = '小雪'" :class="['weather-btn weather-btn-snow py-3 text-xs', weather === '小雪' ? 'active' : 'bg-slate-800 text-gray-400']">❄️ 小雪</button>
<button @click="weather = '大雪'" :class="['weather-btn weather-btn-storm py-3 text-xs', weather === '大雪' ? 'active' : 'bg-slate-800 text-gray-400']">🌨️ 大雪</button>
</div>
</div>
</header>
<main class="flex-1 p-4 overflow-y-auto space-y-4">
<div v-if="viewMode === 'live' && (!weather || filteredList.length === 0)" class="flex flex-col items-center justify-center py-20 opacity-50">
<div class="text-6xl mb-4 grayscale">🎣</div>
<p class="text-sm font-bold" v-if="!weather">请先选择上方的天气</p>
<p class="text-sm font-bold" v-else>当前条件无特殊鱼类</p>
</div>
<div v-else v-for="(group, locName) in groupedList" :key="locName" class="animate-fade-in-up">
<div class="flex items-center gap-2 mb-3 px-1">
<div class="w-1 h-4 bg-yellow-500 rounded-full"></div>
<h2 class="text-sm font-bold text-white flex-1 shadow-black drop-shadow-md">{{ locName }}</h2>
<span v-if="locName.includes('冰洞')" class="text-[10px] bg-blue-500/20 text-blue-200 px-2 py-0.5 rounded border border-blue-500/30">需破冰</span>
</div>
<div v-for="fish in group" :key="fish.name" class="fish-card p-3 mb-3 flex gap-4 items-center relative overflow-hidden group">
<div class="fish-img-box">
<img :src="getImageSrc(fish.name)" @error="handleImgError(fish.name)">
<div v-if="missingImages[fish.name]" class="absolute inset-0 bg-slate-900/90 flex flex-col items-center justify-center cursor-pointer z-10" @click="openCropper(fish.name)">
<span class="text-lg animate-bounce">✂️</span>
<span class="text-[8px] text-yellow-500 font-bold">补图</span>
</div>
</div>
<div class="flex-1 min-w-0">
<div class="flex justify-between items-start mb-1">
<h3 class="font-bold text-white text-base truncate">{{ fish.name }}</h3>
<div class="flex items-center gap-1">
<span v-if="fish.isCustom" class="text-[8px] bg-green-500/20 text-green-400 px-1.5 py-0.5 rounded border border-green-500/30" @click="deleteCustomFish(fish.name)">自建 🗑️</span>
<span :class="['badge shrink-0', getRodStyle(fish.rodType)]">{{ getRodName(fish.rodType) }}</span>
</div>
</div>
<div class="flex flex-col gap-1.5">
<div class="price-tag self-start">💰 {{ fish.price }}</div>
<div class="text-[10px] text-slate-400 font-mono bg-black/20 px-1.5 py-0.5 rounded self-start">
🕒 {{ fish.originalTime || fish.periods.join(', ') }}
</div>
</div>
</div>
</div>
</div>
</main>
<div v-if="showHelp" class="modal-mask z-[220]" @click="showHelp = false">
<div class="modal-content w-[90%] max-w-md p-6 rounded-2xl max-h-[80vh] overflow-y-auto" @click.stop>
<h3 class="text-xl font-extrabold text-white mb-4 border-b border-gray-600/50 pb-2 flex items-center gap-2">
<span>📖</span> 钓鱼佬Mike的独家秘籍
</h3>
<div class="space-y-4 text-sm text-gray-300">
<div class="bg-blue-500/10 p-3 rounded-lg border-l-4 border-blue-500">
<h4 class="font-bold text-blue-300 mb-1 text-base">⚡ 玄学爆率时刻</h4>
<p class="leading-relaxed">
现实时间每10分钟切换一次时段(如 10分、20分)。<br>
<span class="text-yellow-400 font-bold">重点技巧:</span>在时间交替的瞬间(例如从19分跳到20分时),游戏内时间切换,此时下竿的<span class="text-yellow-400 font-bold">稀有鱼爆率极高</span>!建议卡点抛竿。
</p>
</div>
<div class="bg-red-500/10 p-3 rounded-lg border-l-4 border-red-500">
<h4 class="font-bold text-red-300 mb-1 text-base">⚠️ 严守三大铁律</h4>
<p>想要钓到图鉴上的鱼,必须同时满足三个条件:</p>
<ul class="list-disc pl-4 mt-1 space-y-1 opacity-90">
<li><span class="text-white font-bold">天气:</span>必须和游戏内左上角天气一致。</li>
<li><span class="text-white font-bold">地点:</span>必须在指定区域(如冰洞、沉船)。</li>
<li><span class="text-white font-bold">鱼竿:</span>轻竿只能钓轻竿鱼,重竿只能钓重竿鱼。</li>
</ul>
<p class="text-xs mt-2 text-red-300/70">*条件不对,神仙也钓不上来。</p>
</div>
<div class="bg-green-500/10 p-3 rounded-lg border-l-4 border-green-500">
<h4 class="font-bold text-green-300 mb-1 text-base">🛠️ 如何添加与补图</h4>
<ul class="list-disc pl-4 mt-1 space-y-2 opacity-90">
<li>
<span class="text-white font-bold">加新鱼:</span>点击首页【➕ 加新鱼】,填好数据会自动保存到浏览器缓存,永久有效。
</li>
<li>
<span class="text-white font-bold">补图片:</span>点击缺图卡片上的【✂️ 补图】,上传你的全图鉴长图,框选后下载。
</li>
<li class="text-yellow-200/90">
<span class="font-bold">⚠️ 重要:</span>下载的图片(xxx.jpg)必须手动<span class="font-bold border-b border-yellow-200">拖进本网页所在的文件夹里</span>,否则下次打开还是没图!
</li>
</ul>
</div>
</div>
<button @click="showHelp = false" class="w-full bg-slate-700/50 hover:bg-slate-700 text-white font-bold py-3 rounded-xl mt-6 border border-white/10 transition">大师悟了 (关闭)</button>
</div>
</div>
<div v-if="showMap" class="modal-mask z-[210]" @click="showMap = false">
<div class="relative w-full h-full p-4 flex items-center justify-center">
<img src="./map.jpg" class="max-w-full max-h-full object-contain rounded-lg shadow-2xl" @click.stop>
<button class="absolute top-6 right-6 bg-black/50 text-white w-8 h-8 rounded-full">✕</button>
</div>
</div>
<div v-if="showAddFish" class="modal-mask z-[210]" @click="showAddFish = false">
<div class="modal-content w-[85%] max-w-sm p-5 rounded-2xl" @click.stop>
<h3 class="text-lg font-bold text-white mb-4 flex items-center gap-2"><span class="bg-green-600 w-1 h-4 rounded"></span> 添加新图鉴</h3>
<div class="space-y-3">
<input v-model="newFish.name" placeholder="鱼的名字" class="w-full bg-slate-900 border border-slate-700 rounded-lg p-3 text-sm text-white focus:border-blue-500 outline-none">
<div class="flex gap-2">
<select v-model="newFish.loc" class="flex-1 bg-slate-900 border border-slate-700 rounded-lg p-3 text-sm text-white outline-none">
<option value="冰洞">冰洞</option><option value="河湾">河湾</option><option value="沉船">沉船</option>
<option value="巨石">巨石</option><option value="码头">码头</option><option value="河中央">河中央</option><option value="岸边">岸边</option><option value="全水域">全水域</option>
</select>
<select v-model="newFish.rodType" class="flex-1 bg-slate-900 border border-slate-700 rounded-lg p-3 text-sm text-white outline-none">
<option value="common">通用</option>
<option value="ice_light">冰轻</option><option value="ice_heavy">冰重</option>
<option value="river_light">路轻</option><option value="river_heavy">路重</option>
</select>
</div>
<input v-model="newFish.price" placeholder="价格范围" class="w-full bg-slate-900 border border-slate-700 rounded-lg p-3 text-sm text-white outline-none">
<div class="bg-slate-900/50 p-3 rounded-lg border border-slate-700/50">
<div class="text-[10px] text-gray-400 mb-2 font-bold uppercase">Active Weather</div>
<div class="grid grid-cols-4 gap-2">
<label v-for="w in ['晴天','雾天','小雪','大雪']" :class="['text-center py-2 rounded-md text-xs font-bold transition', newFish.weather.includes(w) ? 'bg-blue-600 text-white' : 'bg-slate-800 text-gray-500']">
<input type="checkbox" :value="w" v-model="newFish.weather" class="hidden"> {{w.replace('天','')}}
</label>
</div>
</div>
<div class="bg-slate-900/50 p-3 rounded-lg border border-slate-700/50">
<div class="text-[10px] text-gray-400 mb-2 font-bold uppercase">Active Time</div>
<div class="grid grid-cols-3 gap-2">
<label v-for="p in ['凌晨','清晨','上午','下午','黄昏','深夜']" :class="['text-center py-2 rounded-md text-xs font-bold transition', newFish.periods.includes(p) ? 'bg-indigo-600 text-white' : 'bg-slate-800 text-gray-500']">
<input type="checkbox" :value="p" v-model="newFish.periods" class="hidden"> {{p}}
</label>
</div>
</div>
<button @click="saveNewFish" class="w-full bg-gradient-to-r from-green-600 to-green-500 hover:from-green-500 hover:to-green-400 text-white font-bold py-3 rounded-xl shadow-lg mt-2 active:scale-95 transition">保存数据</button>
</div>
</div>
</div>
<div v-if="showCropper" class="modal-mask z-[250]" @click="showCropper = false">
<div class="modal-content w-[95%] h-[90%] rounded-xl flex flex-col overflow-hidden" @click.stop>
<div class="p-3 bg-slate-900 border-b border-slate-700 flex justify-between items-center shrink-0">
<h3 class="font-bold text-white">✂️ 正在补图:<span class="text-yellow-400">{{ currentCropFish }}</span></h3>
<button @click="showCropper = false" class="bg-slate-700 px-3 py-1 rounded text-xs">关闭</button>
</div>
<div class="p-2 bg-slate-800 flex gap-2 items-center text-xs shrink-0 border-b border-slate-700 overflow-x-auto">
<input type="file" id="cropperInput" class="hidden" @change="loadCropperImage">
<button onclick="document.getElementById('cropperInput').click()" class="bg-blue-600 text-white px-3 py-1.5 rounded font-bold shrink-0 whitespace-nowrap">📂 上传长图</button>
<div class="w-px h-6 bg-slate-600 mx-1"></div>
<span class="shrink-0 text-gray-400">宽:</span> <input type="range" v-model="cropW" min="40" max="300" class="w-20 accent-yellow-500">
<span class="shrink-0 text-gray-400">高:</span> <input type="range" v-model="cropH" min="40" max="300" class="w-20 accent-green-500">
</div>
<div class="flex-1 bg-black relative overflow-hidden" id="cropper-container">
<div v-if="!cropperImg" class="absolute inset-0 flex items-center justify-center text-gray-500 flex-col gap-2">
<span class="text-4xl">🖼️</span>
<span>请先点左上角上传图鉴长图</span>
</div>
<div id="cropper-canvas-container" v-show="cropperImg" @mousemove="moveCropBox" @click="executeCrop" @mouseleave="hideCropBox">
<canvas id="cropperCanvas"></canvas>
<div id="cropBox" class="crop-box" :style="{width: cropW+'px', height: cropH+'px'}"></div>
</div>
</div>
</div>
</div>
</div>
<script>
const { createApp, ref, computed, onMounted, onUnmounted, nextTick } = Vue;
// --- 数据区 ---
const rawData = [
{ name: "飞机头", loc: "冰洞", rodType: "ice_light", weather: ["晴天", "雾天"], periods: ["清晨", "深夜"] },
{ name: "粗红线", loc: "冰洞", rodType: "ice_light", weather: ["雾天", "小雪"], periods: ["清晨", "黄昏"] },
{ name: "路易鱼", loc: "冰洞", rodType: "ice_light", weather: ["晴天", "大雪"], periods: ["清晨", "下午"] },
{ name: "美髯公", loc: "沉船", rodType: "river_heavy", weather: ["晴天", "雾天"], periods: ["清晨", "凌晨"] },
{ name: "海底豚", loc: "沉船", rodType: "river_heavy", weather: ["雾天", "小雪"], periods: ["清晨", "凌晨"] },
{ name: "钱袋", loc: "沉船", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["清晨", "凌晨"] },
{ name: "戒指", loc: "沉船", rodType: "river_light", weather: ["晴天", "雾天", "小雪", "大雪"], periods: ["清晨", "深夜", "凌晨"] },
{ name: "不明化石", loc: "沉船", rodType: "river_heavy", weather: ["晴天", "大雪"], periods: ["清晨", "深夜"] },
{ name: "狗头鱼", loc: "巨石", rodType: "river_heavy", weather: ["雾天", "小雪", "大雪"], periods: ["清晨", "黄昏"] },
{ name: "娃娃鱼", loc: "巨石", rodType: "river_heavy", weather: ["晴天", "雾天"], periods: ["清晨", "凌晨"] },
{ name: "奇怪的东西", loc: "巨石", rodType: "river_heavy", weather: ["晴天", "雾天", "小雪", "大雪"], periods: ["清晨", "凌晨"] },
{ name: "奇怪的东西", loc: "沉船", rodType: "river_heavy", weather: ["小雪", "大雪"], periods: ["深夜"] },
{ name: "果冻鱼", loc: "巨石", rodType: "river_heavy", weather: ["小雪", "大雪"], periods: ["清晨", "深夜"] },
{ name: "拷贝鱼", loc: "码头", rodType: "river_heavy", weather: ["晴天", "雾天"], periods: ["清晨", "凌晨"] },
{ name: "地包天鱼", loc: "码头", rodType: "river_heavy", weather: ["雾天", "小雪", "大雪"], periods: ["清晨", "深夜"] },
{ name: "骗子鱼", loc: "码头", rodType: "river_heavy", weather: ["雾天", "小雪", "大雪"], periods: ["清晨", "深夜"] },
{ name: "鬼虎鱼", loc: "河湾", rodType: "river_heavy", weather: ["小雪", "大雪"], periods: ["清晨", "黄昏"] },
{ name: "雷鳗", loc: "河湾", rodType: "river_heavy", weather: ["晴天", "雾天"], periods: ["清晨", "凌晨"] },
{ name: "冰溜子鱼", loc: "河中央", rodType: "river_light", weather: ["雾天", "大雪"], periods: ["清晨", "深夜"] },
{ name: "蓝眼泪", loc: "冰洞", rodType: "ice_light", weather: ["小雪", "大雪"], periods: ["上午", "下午"] },
{ name: "筷子鳝", loc: "冰洞", rodType: "ice_heavy", weather: ["晴天", "小雪"], periods: ["上午"] },
{ name: "筷子鳝", loc: "冰洞", rodType: "ice_heavy", weather: ["晴天", "大雪"], periods: ["黄昏", "深夜"] },
{ name: "泥猴子", loc: "冰洞", rodType: "ice_light", weather: ["晴天", "小雪"], periods: ["上午", "下午"] },
{ name: "不明的机械", loc: "沉船", rodType: "river_heavy", weather: ["小雪", "大雪"], periods: ["上午", "凌晨"] },
{ name: "猪鼻鱼", loc: "巨石", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["上午", "黄昏"] },
{ name: "夜明珠", loc: "巨石", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["上午", "下午"] },
{ name: "粉丝虾", loc: "码头", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["上午", "下午"] },
{ name: "芭蕾蓬蓬鱼", loc: "河中央", rodType: "river_light", weather: ["晴天"], periods: ["上午", "下午"] },
{ name: "甲方满意鱼", loc: "河中央", rodType: "river_light", weather: ["晴天"], periods: ["上午", "下午"] },
{ name: "拟岩鱼", loc: "河中央", rodType: "river_light", weather: ["晴天", "雾天", "小雪"], periods: ["上午", "下午"] },
{ name: "光斑鱼", loc: "河中央", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["上午", "黄昏"] },
{ name: "熔岩鱼", loc: "河中央", rodType: "river_heavy", weather: ["晴天"], periods: ["上午", "黄昏"] },
{ name: "幻光鱼", loc: "岸边", rodType: "river_light", weather: ["晴天"], periods: ["上午", "下午"] },
{ name: "大师龟", loc: "岸边", rodType: "river_light", weather: ["晴天", "小雪"], periods: ["上午", "下午"] },
{ name: "牡丹鱼", loc: "岸边", rodType: "river_light", weather: ["晴天"], periods: ["上午", "黄昏"] },
{ name: "流浪剑客", loc: "岸边", rodType: "river_light", weather: ["晴天"], periods: ["上午", "下午"] },
{ name: "罗汉鱼", loc: "岸边", rodType: "river_heavy", weather: ["晴天", "雾天"], periods: ["上午", "下午"] },
{ name: "水法老", loc: "冰洞", rodType: "ice_heavy", weather: ["雾天", "小雪"], periods: ["下午", "黄昏"] },
{ name: "大罐子鱼", loc: "冰洞", rodType: "ice_heavy", weather: ["晴天", "小雪"], periods: ["下午", "黄昏"] },
{ name: "辐射鲈", loc: "码头", rodType: "river_heavy", weather: ["晴天", "雾天", "小雪"], periods: ["下午", "黄昏"] },
{ name: "发财鲤", loc: "河湾", rodType: "river_heavy", weather: ["晴天", "雾天"], periods: ["下午"] },
{ name: "视觉系", loc: "河中央", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["下午", "凌晨"] },
{ name: "狼蛛蟹", loc: "岸边", rodType: "river_light", weather: ["雾天", "小雪", "大雪"], periods: ["下午", "黄昏"] },
{ name: "金蛙", loc: "岸边", rodType: "river_light", weather: ["晴天"], periods: ["下午", "黄昏"] },
{ name: "平凡鱼", loc: "岸边", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["下午", "黄昏"] },
{ name: "烟花鱼", loc: "岸边", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["下午", "黄昏"] },
{ name: "嘟嘟鱼", loc: "冰洞", rodType: "ice_heavy", weather: ["晴天", "小雪"], periods: ["黄昏"] },
{ name: "教练鱼", loc: "河湾", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["黄昏", "深夜"] },
{ name: "鬼牙鱼", loc: "冰洞", rodType: "ice_heavy", weather: ["雾天", "小雪"], periods: ["深夜", "凌晨"] },
{ name: "鳅鳅鱼", loc: "冰洞", rodType: "ice_light", weather: ["晴天", "雾天"], periods: ["深夜", "凌晨"] },
{ name: "七星刀", loc: "冰洞", rodType: "ice_heavy", weather: ["晴天", "雾天"], periods: ["深夜", "凌晨"] },
{ name: "鬼刀鱼", loc: "沉船", rodType: "river_heavy", weather: ["雾天", "小雪"], periods: ["深夜", "凌晨"] },
{ name: "冰河鲟", loc: "沉船", rodType: "river_heavy", weather: ["雾天", "小雪", "大雪"], periods: ["深夜", "凌晨"] },
{ name: "黄鸭叫", loc: "巨石", rodType: "river_heavy", weather: ["晴天", "雾天"], periods: ["深夜", "凌晨"] },
{ name: "保洁鱼", loc: "河湾", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["深夜", "凌晨"] },
{ name: "呆呆鲶", loc: "河湾", rodType: "river_heavy", weather: ["雾天", "小雪"], periods: ["深夜", "凌晨"] },
{ name: "鳄霸鱼", loc: "河湾", rodType: "river_heavy", weather: ["小雪", "大雪"], periods: ["深夜", "凌晨"] },
{ name: "拳击虾", loc: "岸边", rodType: "river_light", weather: ["晴天", "雾天"], periods: ["深夜", "凌晨"] }
];
function mergeFishData(data) {
const map = {};
data.forEach(item => {
const key = item.name + '|' + item.loc;
if (!map[key]) { map[key] = { ...item }; }
else {
item.periods.forEach(p => { if (!map[key].periods.includes(p)) map[key].periods.push(p); });
item.weather.forEach(w => { if (!map[key].weather.includes(w)) map[key].weather.push(w); });
}
});
return Object.values(map);
}
const defaultFish = mergeFishData(rawData);
createApp({
setup() {
const currentTimeStr = ref("");
const minutesLeft = ref(0);
const gamePeriod = ref("WAIT...");
const weather = ref("");
const showMap = ref(false);
const showAddFish = ref(false);
const showHelp = ref(false);
const viewMode = ref("live");
const missingImages = ref({});
const tempImages = ref({});
const customFishList = ref([]);
const fishDatabase = computed(() => [...defaultFish, ...customFishList.value]);
const newFish = ref({ name: "", loc: "冰洞", rodType: "common", price: "???", weather: [], periods: [] });
const showCropper = ref(false);
const currentCropFish = ref("");
const cropperImg = ref(null);
const cropW = ref(100);
const cropH = ref(70);
const updateTime = () => {
const now = new Date();
currentTimeStr.value = now.toLocaleTimeString('zh-CN', { hour12: false });
const minutes = now.getMinutes();
let left = 10 - (minutes % 10);
if (now.getSeconds() === 0 && minutes % 10 === 0) left = 10;
minutesLeft.value = left;
const periodIndex = Math.floor(minutes / 10);
const periodMap = ["凌晨", "清晨", "上午", "下午", "黄昏", "深夜"];
gamePeriod.value = `${periodMap[periodIndex]} (${["00-10", "10-20", "20-30", "30-40", "40-50", "50-00"][periodIndex]})`;
};
const loadCustomFish = () => {
const saved = localStorage.getItem('mike_fish_data_v1');
if(saved) customFishList.value = JSON.parse(saved);
};
const saveNewFish = () => {
if(!newFish.value.name) return alert("请输入鱼的名字");
if(newFish.value.weather.length === 0 || newFish.value.periods.length === 0) return alert("必须勾选至少一个天气和时段,否则它永远不会出现在实时列表中!");
const fishToAdd = { ...newFish.value, isCustom: true };
customFishList.value.push(fishToAdd);
localStorage.setItem('mike_fish_data_v1', JSON.stringify(customFishList.value));
newFish.value = { name: "", loc: "冰洞", rodType: "common", price: "???", weather: [], periods: [] };
showAddFish.value = false;
alert("✅ 添加成功!\n注意:它只会在你勾选的时间和天气下显示。");
};
const deleteCustomFish = (name) => {
if(confirm(`确定要删除 "${name}" 吗?`)) {
customFishList.value = customFishList.value.filter(f => f.name !== name);
localStorage.setItem('mike_fish_data_v1', JSON.stringify(customFishList.value));
}
};
const getImageSrc = (name) => {
if (tempImages.value[name]) return tempImages.value[name];
return `./${name}.jpg`;
};
const handleImgError = (name) => { missingImages.value[name] = true; };
const openCropper = (name) => {
currentCropFish.value = name;
showCropper.value = true;
nextTick(() => { if (cropperImg.value) drawCropperCanvas(); });
};
const loadCropperImage = (e) => {
const reader = new FileReader();
reader.onload = (evt) => {
const img = new Image();
img.onload = () => { cropperImg.value = img; drawCropperCanvas(); };
img.src = evt.target.result;
};
reader.readAsDataURL(e.target.files[0]);
};
const drawCropperCanvas = () => {
const canvas = document.getElementById('cropperCanvas');
const ctx = canvas.getContext('2d');
canvas.width = cropperImg.value.width;
canvas.height = cropperImg.value.height;
ctx.drawImage(cropperImg.value, 0, 0);
document.getElementById('cropper-canvas-container').style.width = cropperImg.value.width + 'px';
document.getElementById('cropper-canvas-container').style.height = cropperImg.value.height + 'px';
};
const moveCropBox = (e) => {
if (!cropperImg.value) return;
const box = document.getElementById('cropBox');
const x = e.clientX - document.getElementById('cropperCanvas').getBoundingClientRect().left;
const y = e.clientY - document.getElementById('cropperCanvas').getBoundingClientRect().top;
box.style.display = 'block';
box.style.left = (x - cropW.value/2) + 'px';
box.style.top = (y - cropH.value/2) + 'px';
};
const hideCropBox = () => { document.getElementById('cropBox').style.display = 'none'; };
const executeCrop = (e) => {
if (!cropperImg.value) return;
const canvas = document.getElementById('cropperCanvas');
const x = e.clientX - canvas.getBoundingClientRect().left - cropW.value/2;
const y = e.clientY - canvas.getBoundingClientRect().top - cropH.value/2;
const tempCanvas = document.createElement('canvas');
tempCanvas.width = cropW.value; tempCanvas.height = cropH.value;
tempCanvas.getContext('2d').drawImage(canvas, x, y, cropW.value, cropH.value, 0, 0, cropW.value, cropH.value);
const base64 = tempCanvas.toDataURL('image/jpeg', 0.9);
const link = document.createElement('a');
link.download = `${currentCropFish.value}.jpg`;
link.href = base64;
link.click();
tempImages.value[currentCropFish.value] = base64;
missingImages.value[currentCropFish.value] = false;
showCropper.value = false;
};
const filteredList = computed(() => {
if (viewMode.value === 'all') return fishDatabase.value;
if (!weather.value) return [];
return fishDatabase.value.filter(fish => fish.periods.some(p => gamePeriod.value.includes(p)) && fish.weather.includes(weather.value));
});
const groupedList = computed(() => {
const g = {}; filteredList.value.forEach(f => { if(!g[f.loc]) g[f.loc]=[]; g[f.loc].push(f); }); return g;
});
const getRodStyle = (t) => t==='common'?'rod-common':(t.includes('light')?(t.includes('ice')?'rod-ice-light':'rod-river-light'):(t.includes('ice')?'rod-ice-heavy':'rod-river-heavy'));
const getRodName = (t) => t==='common'?'通用':(t.includes('light')?'轻竿':'重竿');
const formatGamePeriod = (s) => s.split(' ')[0];
let timer;
onMounted(() => {
updateTime();
loadCustomFish();
timer = setInterval(updateTime, 1000);
});
onUnmounted(() => clearInterval(timer));
return {
currentTimeStr, gamePeriod, minutesLeft, weather, filteredList, groupedList,
showMap, viewMode, toggleMode:()=>viewMode.value=viewMode.value==='live'?'all':'live',
fishDatabase, getRodStyle, getRodName, formatGamePeriod,
getImageSrc, handleImgError, missingImages,
showCropper, openCropper, currentCropFish, cropperImg, loadCropperImage,
cropW, cropH, moveCropBox, hideCropBox, executeCrop,
showAddFish, newFish, saveNewFish, deleteCustomFish,
showHelp
};
}
}).mount('#app');
</script>
</body>
</html>