-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
316 lines (278 loc) · 34.1 KB
/
index.html
File metadata and controls
316 lines (278 loc) · 34.1 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
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Road to Vostok | Database</title>
<style>
:root { --primary: #f2a900; --bg: #0b0b0b; --card-bg: #161616; --text: #b0b0b0; --border: #2a2a2a; --easy: #00ff00; --inter: #ff8c00; --hard: #ff4444; }
* { box-sizing: border-box; transition: 0.2s; }
body { background: var(--bg); color: var(--text); font-family: 'Courier New', Courier, monospace; margin: 0; padding: 1rem; line-height: 1.4; }
header { border-bottom: 2px solid var(--primary); margin-bottom: 2rem; padding-bottom: 1rem; }
h1 { color: var(--primary); font-size: 1.4rem; text-transform: uppercase; margin: 0; }
.nav-bar { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; align-items: center; }
.tab-btn { background: none; border: 1px solid #444; color: #444; padding: 8px 20px; font-weight: bold; cursor: pointer; text-transform: uppercase; font-family: inherit; }
.tab-btn.active { border-color: var(--primary); color: #000; background: var(--primary); }
.filter-btn { background: none; border: 1px solid #444; color: #444; padding: 5px 12px; font-size: 0.7rem; cursor: pointer; text-transform: uppercase; font-family: inherit; }
.filter-btn.active { background: rgba(242, 169, 0, 0.1); border-color: var(--primary); color: var(--primary); }
.stats-panel { background: #1a1a1a; padding: 10px; border: 1px solid var(--border); font-size: 0.8rem; }
.stats-panel span { color: var(--primary); font-weight: bold; }
.trader-header { display: flex; align-items: center; gap: 25px; background: linear-gradient(90deg, rgba(26,26,26,1) 0%, rgba(26,26,26,0) 100%); padding: 15px; border-left: 5px solid var(--primary); margin: 2rem 0 1rem 0; cursor: pointer; }
.trader-portrait { width: 100px; height: 100px; border: 2px solid var(--primary); object-fit: cover; object-position: top; background: #222; }
.trader-info h2 { color: var(--primary); margin: 0; text-transform: uppercase; font-size: 1.4rem; }
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1rem; margin-bottom: 3rem; }
.quest-card { background: var(--card-bg); border: 1px solid var(--border); padding: 1rem; display: flex; flex-direction: column; min-height: 400px; }
.q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.q-title-clickable { color: var(--primary); font-weight: bold; text-transform: uppercase; font-size: 0.85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242, 169, 0, 0.3); }
.q-title-clickable:hover { color: #fff; text-decoration-color: var(--primary); }
.diff { font-size: 0.65rem; font-weight: bold; padding: 2px 5px; border: 1px solid currentColor; }
.diff-easy { color: var(--easy); } .diff-inter { color: var(--inter); } .diff-hard { color: var(--hard); }
.needs-list li, .rewards-list li { font-size: 0.8rem; margin-bottom: 5px; cursor: pointer; }
.item-found { color: #444; text-decoration: line-through; }
.counter-controls { display: inline-flex; align-items: center; gap: 5px; margin-left: 5px; background: #222; padding: 2px 5px; border-radius: 3px; }
.counter-controls button { background: var(--primary); border: none; color: #000; width: 18px; height: 18px; cursor: pointer; font-weight: bold; }
.status-btn { margin-top: auto; background: none; border: 1px solid var(--primary); color: var(--primary); padding: 10px; cursor: pointer; font-weight: bold; width: 100%; font-family: inherit; }
.status-btn:hover { background: var(--primary); color: #000; }
.completed { opacity: 0.2; filter: grayscale(1); }
.event-card { background: #161616; border: 1px solid #2a2a2a; padding: 15px; margin-bottom: 10px; cursor: pointer; }
.event-card:hover { border-color: var(--primary); }
.event-card b { color: var(--primary); }
.toggle-icon { color: var(--primary); font-weight: bold; }
.event-desc { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid #222; color: #888; font-size: 0.85rem; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); backdrop-filter: blur(8px); }
.modal-content { background: var(--card-bg); margin: 5% auto; padding: 25px; border: 1px solid var(--primary); width: 90%; max-width: 1000px; position: relative; max-height: 85vh; overflow-y: auto; }
.close-modal { position: absolute; right: 20px; top: 15px; color: var(--primary); font-size: 2.5rem; cursor: pointer; }
.slider-container { width: 100%; max-width: 400px; margin: 15px 0; border: 1px solid #333; background: #000; }
.slider-img { width: 100%; height: 220px; object-fit: cover; display: block; border-bottom: 1px solid #222; }
.slider-controls { display: flex !important; justify-content: space-between !important; align-items: center !important; padding: 8px 15px !important; background: #111 !important; }
.slider-controls button { background: var(--primary) !important; border: none !important; color: #000 !important; padding: 5px 15px !important; cursor: pointer !important; font-weight: bold !important; font-family: inherit; font-size: 0.7rem; }
.slider-controls span { color: var(--primary); font-size: 0.8rem; font-weight: bold; }
</style>
</head>
<body onload="initApp()">
<div id="traderModal" class="modal">
<div class="modal-content">
<span class="close-modal" onclick="closeModal()">×</span>
<h2 id="modalTraderName" style="color: var(--primary); text-transform: uppercase;"></h2>
<div id="modalTraderLoc" style="font-style: italic; margin: 15px 0; border-left: 2px solid var(--primary); padding-left: 15px;"></div>
<div id="modalPicsGrid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px;">
<div class="pic-box"><span id="label1" style="color:var(--primary); font-size:0.7rem"></span><div id="imgCont1"></div></div>
<div class="pic-box"><span id="label2" style="color:var(--primary); font-size:0.7rem"></span><div id="imgCont2"></div></div>
<div class="pic-box"><span id="label3" style="color:var(--primary); font-size:0.7rem"></span><div id="imgCont3"></div></div>
</div>
</div>
</div>
<header>
<h1>VOSTOK-HELP [DATABASE]</h1>
<div class="nav-bar">
<button id="tab-q" class="tab-btn active" onclick="switchTab('q')">Задания</button>
<button id="tab-e" class="tab-btn" onclick="switchTab('e')">Ивенты</button>
<div id="q-filters" style="display: flex; gap: 5px; margin-left: 10px; border-left: 1px solid #333; padding-left: 15px;">
<button class="filter-btn active" onclick="filterQuests('all', this)">Все</button>
<button class="filter-btn" onclick="filterQuests('easy', this)">Easy</button>
<button class="filter-btn" onclick="filterQuests('inter', this)">Inter</button>
<button class="filter-btn" onclick="filterQuests('hard', this)">Hard</button>
</div>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 15px; gap: 20px;">
<div class="stats-panel" style="margin-top: 0;">КВЕСТЫ: <span id="total-q">0</span> | ГОТОВО: <span id="done-q">0</span> | ОСТАЛОСЬ: <span id="left-q">0</span></div>
<div style="position: relative; width: 350px;">
<input type="text" id="searchInput" placeholder="Поиск задания или предмета..." oninput="handleSearch()" list="searchHints" autocomplete="off" style="background: #1a1a1a; border: 1px solid var(--border); color: var(--primary); padding: 10px; font-family: inherit; width: 100%; outline: none; border-radius: 4px;">
<datalist id="searchHints"></datalist>
</div>
</div>
</header>
<main id="quests-section"></main>
<section id="events-section" style="display:none">
<h2 style="color: var(--primary); text-transform: uppercase; margin-bottom: 20px;">Календарь событий</h2>
<div id="events-list"></div>
</section>
<script>
const tradersData = [
{ id: 'generalist', name: 'Снабженец', loc: 'Village (Деревня)', img: 'generalist.png', pics: ['generalist-base.png', null, null] },
{ id: 'doctor', name: 'Доктор', loc: 'School (Школа) 3 этаж', img: 'doctor.png', pics: ['school-trader.png', 'coridor-doctor.png', 'cabinet-doctor.png'] },
{ id: 'gunsmith', name: 'Оружейник', loc: 'Outpost (Аванпост)', img: 'gunsmith.png', pics: ['gunsmith-base.png', 'gun-rack.png', 'workbench.png'] }
];
const questsDatabase = [
// --- СНАБЖЕНЕЦ (GENERALIST) ---
{ id: 'q_1', trader: 'generalist', title: 'Prime Time', diff: 'easy', needs: ['Toilel Paper (Туалетная бумага)'], rewards: ['Television (Телевизор)'] },
{ id: 'q_2', trader: 'generalist', title: 'Bad Habits', diff: 'easy', needs: ['Cigarettes (Сигареты)', 'Matches (Спички) (20 шт.)'], rewards: ['Alarm Clock (Будильник)'] },
{ id: 'q_3', trader: 'generalist', title: 'Backpains', diff: 'easy', needs: ['Pillow (Подушка)', 'Lotion (Лосьон)', 'Painkill (Обезболивающее)'], rewards: ['Narva Flashlight (Фонарик Нарва)', 'Batteries (Батарейки)'] },
{ id: 'q_4', trader: 'generalist', title: 'Coffee Reserve', diff: 'easy', needs: ['Coffee (Кофе)', 'Coffe Filter (Кофейный фильтр)'], rewards: ['Map (Карта)', 'Mess Kit (Котелок)', 'Water Bottle (Бутылка воды)'] },
{ id: 'q_5', trader: 'generalist', title: 'Sweaty Business', diff: 'inter', needs: ['Deodorant (Дезодорант)', 'Wipes (Влажные салфетки)'], rewards: ['Fishing Vest (Рыбацкий жилет)', 'Fishing Rod(Удочка)','Tackle Box (Ящик для снастей)', 'Knife (Нож) Jaeger 140'] },
{ id: 'q_6', trader: 'generalist', title: 'Handyman', diff: 'inter', needs: ['Lumber (Пиломатериалы)', 'Toolbox (Ящик с инструментами)', 'Bucket (Ведро)', 'Duct Tape (Скотч)', 'Nails (Гвозди)'], rewards: ['Table (Cтол)', 'Cabinet (Тумбочка)', 'Chair (Стул)','Carpet (Ковер)'] },
{ id: 'q_7', trader: 'generalist', title: 'Heavy Lifting', diff: 'hard', needs: ['Beer (Пиво)'], rewards: ['Mosin (Винтовка Мосина)', 'PU Scope (Прицел ПУ)', '7.62x54R (60 шт.)'], target: 6 },
{ id: 'q_8', trader: 'generalist', title: 'Long Range', diff: 'hard', needs: ['KP-31', 'Drum (Барабанный магазин) KP-31'], rewards: ['M78', 'Magazine (Магазин) M78', '.308 (30 шт.)'] },
{ id: 'q_9', trader: 'generalist', title: 'Night Shift', diff: 'hard', needs: ['Battery (Аккумулятор)', 'Battery Cables (Провода прикуривания)', 'Inverter (Инвертор)', 'Jerry Can(Канистра)', 'Oil Filter (Масляный фильтр)'], rewards: ['Casette Player (Кассетный Плеер)', 'Casette (Кассета) - (Radio Hits)'] },
{ id: 'q_10', trader: 'generalist', title: 'The Collector', diff: 'hard', needs: ['Kilju (Брага)'], rewards: ['Attie Key (Ключ от чердака)'] },
// --- ДОКТОР (DOCTOR) ---
{ id: 'q_11', trader: 'doctor', title: 'Nasty Draft', diff: 'easy', needs: ['Duct Tape (Скотч)'], rewards: ['Tissues (Салфетки)'] },
{ id: 'q_12', trader: 'doctor', title: 'Steady Hands', diff: 'easy', needs: ['Cigars (Сигары)'], rewards: ['Thermal Blanket (Термоодеяло)'] },
{ id: 'q_13', trader: 'doctor', title: 'Bookworm', diff: 'easy', needs: ['Books (Книги):', 'Children (Детская)', 'Cooking (Кулинарная)', 'Fishing (Рыбацкая)', 'Religion (Религиозная)'], rewards: ['Medical Cabinet (Медицинский шкаф)'] },
{ id: 'q_14', trader: 'doctor', title: 'Dice Master', diff: 'easy', needs: ['Board Game (Настольная игра)'], rewards: ['Locker (Шкафчик)', 'Trolley tall (Передвижная Полка)'] },
{ id: 'q_15', trader: 'doctor', title: 'Night Surgery', diff: 'inter', needs: ['Polaris (Налобный фонарь Поларис)', 'Batteries (Батарейки)'], rewards: ['Energy Drink (Энергетик)'] },
{ id: 'q_16', trader: 'doctor', title: 'Infections', diff: 'inter', needs: ['Antiseptic (Антисептик)', 'Antibiotics (Антибиотики)'], rewards: ['Bandage (Бинт)', 'Rags (Тряпки)', 'Painkill (Обезболивающее)'] },
{ id: 'q_17', trader: 'doctor', title: 'Hypovolemia', diff: 'inter', needs: ['Saline (Физраствор)'], rewards: ['Water Lock (Гидрозатвор)'], target: 3},
{ id: 'q_18', trader: 'doctor', title: 'Mouth Organ', diff: 'hard', needs: ['Harmonica (Губная гармошка)'], rewards: ['Medkit (Аптечка) (3 шт.)'] },
{ id: 'q_19', trader: 'doctor', title: 'Patient Report', diff: 'hard', needs: ['Patient Report (Отчет о пациенте)'], rewards: ['AFAK'], guide: '<b style="color:var(--primary)">ГДЕ ИСКАТЬ:</b> Школа (Area 05), спортивный зал.<br><br><b style="color:var(--primary)">ИНСТРУКЦИЯ:</b> Пройдите через коридоры к спортзалу. Отчет лежит внутри. Может появится по всей территории зала.<br><br><div class="slider-container"><div class="slider-wrapper"><img id="quest-slide" src="school-trader.png" class="slider-img"></div><div class="slider-controls"><button onclick="changeQuestSlide(-1, event)">←</button><span id="q-slide-num">1 / 3</span><button onclick="changeQuestSlide(1, event)">→</button></div></div>' },
{ id: 'q_20', trader: 'doctor', title: 'Substance', diff: 'hard', needs: ['Oil Sample (Образец масла)'], rewards: ['Classroom Key (Ключ от класса)'], target: 3},
// --- ОРУЖЕЙНИК (GUNSMITH) ---
{ id: 'q_21', trader: 'gunsmith', title: 'Bloodsuckers', diff: 'easy', needs: ['Mosquito Hat (Шляпа с сеткой)'], rewards: ['RK Magazine (7.62x39)', 'Патроны 7.62x39 (30 шт.)'] },
{ id: 'q_22', trader: 'gunsmith', title: 'Warm Meal', diff: 'easy', needs: ['Pea Soup (Гороховый суп)', 'Mustard (Горчица)'], rewards: ['Military Crate (Военный Ящик)', 'Sleeping Bag (Спальник)'] },
{ id: 'q_23', trader: 'gunsmith', title: 'Nordic Trade', diff: 'inter', needs: ['Snus (Снюс)'], rewards: ['M43 (Граната) (3 шт.)'], target: 3 },
{ id: 'q_24', trader: 'gunsmith', title: 'Big Blades', diff: 'inter', needs: ['Skrama 200', 'Skrama 240'], rewards: ['Шлем SSh-39 (II)', 'Field Ration', 'Патроны .223 (30 шт.)', '9x19 (50 шт.)'] },
{ id: 'q_25', trader: 'gunsmith', title: 'Ammo Delivery', diff: 'inter', needs: ['Патроны 4.6x30 (50 шт.)', 'Патроны 9x39 (20 шт.)', 'Патроны 7.62x54R (20 шт.)'], rewards: ['Жилет LVPC (Winter)', 'Armor Plate (IV)'] },
{ id: 'q_26', trader: 'gunsmith', title: 'Weapon Delivery', diff: 'inter', needs: ['KAS-74U', 'KA-M', 'KA-12'], rewards: ['Crate (Special)', 'Target Stand'] },
{ id: 'q_27', trader: 'gunsmith', title: 'Medic', diff: 'hard', needs: ['IFAK'], rewards: ['KM18 (Винтовка)', 'STANAG Магазин', 'ATOG (Прицел)'], target: 3 },
{ id: 'q_28', trader: 'gunsmith', title: 'Home Collection', diff: 'hard', needs: ['SSV (Винтовка)', 'SS Magazine'], rewards: ['Weapon Repair Kit (Ремнабор)'] },
{ id: 'q_29', trader: 'gunsmith', title: 'Everyman\'s Right', diff: 'hard', needs: ['PV7 (ПНВ)'], rewards: ['Sign (Border Zone)'] },
{ id: 'q_30', trader: 'gunsmith', title: 'Hitman', diff: 'hard', needs: ['Flame Beanie (Шапка с пламенем)'], rewards: ['Bunker Key (Ключ от бункера)'] }
];
const eventsData = [
{ day: 1, title: 'Generalist Returns to Village (Снабженец вернуля в Деревню)', place: 'Village (Деревня)', chance: 'Гарантировано', desc: 'Снабженец — мастер на все руки, открывший магазин в старом гараже. После короткого перерыва он снова в деле и готов продавать товары общего назначения.' },
{ day: 2, title: 'Doctor Returns to School (Доктор вернулся в Школу)', place: 'School (Школа)', chance: 'Гарантировано', desc: 'Доктор вернулся в свою импровизированную клинику. Он отлучался, чтобы проведать бабушку, но теперь снова готов лечить выживших и продавать медикаменты.' },
{ day: 3, title: 'Fighter Jets (Реактивные истребители)', place: 'Area 05 (Зона 05)', chance: '~25%', desc: 'Финские военные проводят демонстрацию силы. В небе часто появляются истребители, совершающие громкие нелетальные облеты Зоны 05.' },
{ day: 4, title: 'Missing Cat (Пропавший кот)', place: 'Outpost (Аванпост)', chance: 'Гарантировано', desc: 'Кот бабушки сбежал и попал в беду. Бандиты бросили коробку где-то на территории Аванпоста.<br><br><b style="color:var(--primary)">ПОДСКАЗКА:</b> Ищите вход в бункер, в нем ищите бетонную шахту. Кот сидит на самом дне.<br><br><div class="slider-container"><div class="slider-wrapper"><img id="cat-slide" src="cat1.png" class="slider-img"></div><div class="slider-controls"><button onclick="changeSlide(-1, event)">←</button><span id="slide-num">1 / 5</span><button onclick="changeSlide(1, event)">→</button></div></div>' },
{ day: 5, title: 'Punisher arrives to Area 05 (Каратель прибывает в Зону 05)', place: 'Area 05 (Зона 05)', chance: '~10%', desc: 'Криминальный авторитет Каратель угнал полицейский фургон и патрулирует территорию со своей бандой. Встреча с ними крайне опасна.' },
{ day: 6, title: 'Airdrops Delivered (Доставка воздушной поддержки)', place: 'Area 05 (Зона 05)', chance: '~10%', desc: 'Финские военные возобновили сброс гуманитарной помощи. Внутри можно найти медикаменты, провизию и редкое снаряжение.' },
{ day: 7, title: 'BTR Patrols (Патрулирование БТР)', place: 'Vostok (Главные дороги)', chance: '~25%', desc: 'Военные начали использовать бронетехнику для контроля территории. Армейские БТР с тяжелыми пулеметами патрулируют район Востока.' },
{ day: 8, title: 'Attack Helicopters (Атака вертолетов)', place: 'Border Zone (Пограничная зона)', chance: '~25%', desc: 'Режим демилитаризации нарушен. Ударные вертолеты патрулируют границу, ведя огонь по всем подозрительным целям.' },
{ day: 9, title: 'Helicopter Crash Sites (Вертолеты терпят крушения)', place: 'Area 05 (Зона 05)', chance: '~10%', desc: 'Несколько вертолетов были сбиты. Места крушения содержат очень ценный военный лут, но охраняются сильными отрядами ИИ.' },
{ day: 10, title: 'Gunsmith returns to Outpost (Оружейник возвращается на Аванпост)', place: 'Outpost (Аванпост)', chance: 'Гарантировано', desc: 'Оружейник вернулся в свой бункер после таинственной поездки за границу. Доступна покупка оружия, модулей и выполнение его контрактов.' },
{ day: 20, title: 'Outpost Compromised (Аванпост был обнаружен)', place: 'Outpost (Аванпост)', chance: '~25%', desc: 'Военные БТР начали заходить прямо на территорию Аванпоста. Зона 05 официально признана небезопасной, ситуация накаляется.' },
{ day: 30, title: 'Traders leave Area 05 (Торговцы покинули Зону 05)', place: 'Area 05 (Зона 05)', chance: 'Гарантировано', desc: 'Из-за критической угрозы вторжения войск все ключевые торговцы временно сворачивают дела и покидают Зону 05.' },
{ day: 40, title: 'Traders return to Area 05 (Торговцы вернулись в Зону 05)', place: 'Area 05 (Зона 05)', chance: 'Гарантировано', desc: 'Масштабного вторжения не произошло, ситуация стабилизировалась. Снабженец, Доктор и Оружейник вернулись на свои рабочие места.' },
{ day: 50, title: 'Transmission (Радиосигнал)', place: 'Area 05 (Зона 05)', chance: 'Гарантировано', desc: 'Загадочный сигнал вернулся в эфир, перекрывая все каналы связи. Это финальное событие версии Build 1.' }
];
function initApp() {
const qSec = document.getElementById('quests-section');
tradersData.forEach(t => {
const html = `<div class="trader-header" onclick="openTrader('${t.name}','${t.loc}','${t.pics[0]}','${t.pics[1]}','${t.pics[2]}')">
<img src="${t.img}" class="trader-portrait"><div class="trader-info"><h2>${t.name}</h2><p>Локация: ${t.loc}</p></div></div>
<div id="grid-${t.id}" class="quest-grid"></div>`;
qSec.insertAdjacentHTML('beforeend', html);
});
renderQuests();
initSearchHints();
loadProgress();
updateStats();
}
function renderQuests() {
questsDatabase.forEach(q => {
const grid = document.getElementById(`grid-${q.trader}`);
if(!grid) return;
const needsHTML = q.needs.map((n, i) => q.target ?
`<li>${n} <div class="counter-controls"><button onclick="changeCount(this,-1)">-</button><span class="count-val">0</span>/${q.target}<button onclick="changeCount(this,1)">+</button></div></li>` :
`<li onclick="toggleItem(this,'${q.id}_${i}')">${n}</li>`).join('');
const card = document.createElement('div');
card.className = 'quest-card'; card.id = q.id;
card.innerHTML = `<div class="q-header"><span class="q-title-clickable" onclick="openQuestDetails('${q.id}')">${q.title}</span><span class="diff diff-${q.diff}">${q.diff.toUpperCase()}</span></div>
<div style="flex-grow:1"><span style="font-size:0.7rem;color:#666">НУЖНО:</span><ul class="needs-list">${needsHTML}</ul><span style="font-size:0.7rem;color:#666">НАГРАДА:</span><ul style="color:#fff">${(q.rewards||[]).map(r=>`<li>${r}</li>`).join('')}</ul></div>
<button class="status-btn" onclick="toggleQ('${q.id}')">ВЫПОЛНЕНО</button>`;
grid.appendChild(card);
});
}
function handleSearch() {
const input = document.getElementById('searchInput');
const query = input.value;
const exact = questsDatabase.find(q => q.title === query);
if (exact) { openQuestDetails(exact.id); input.value = ""; input.blur(); document.querySelectorAll('.quest-card, .trader-header').forEach(el => el.style.display = 'flex'); return; }
const low = query.toLowerCase();
document.querySelectorAll('.quest-grid').forEach(grid => {
let hasC = false;
grid.querySelectorAll('.quest-card').forEach(card => {
const q = questsDatabase.find(x => x.id === card.id);
const match = q.title.toLowerCase().includes(low) || q.needs.some(n => n.toLowerCase().includes(low));
card.style.display = match ? 'flex' : 'none'; if(match) hasC = true;
});
grid.previousElementSibling.style.display = hasC ? 'flex' : 'none';
});
}
function openQuestDetails(id) {
const q = questsDatabase.find(x => x.id === id); if (!q) return;
document.getElementById('det-title').innerText = q.title;
document.getElementById('det-diff').innerHTML = `<span class="diff diff-${q.diff}">${q.diff.toUpperCase()}</span>`;
document.getElementById('det-needs').innerHTML = q.needs.map(n => `<li>${n}</li>`).join('');
document.getElementById('det-rewards').innerHTML = (q.rewards||[]).map(r => `<li>${r}</li>`).join('');
const g = document.getElementById('det-guide'); g.innerHTML = q.guide ? q.guide : "Инструкция скоро появится.";
document.getElementById('questDetailsModal').style.display = 'block'; document.body.style.overflow = 'hidden';
}
function switchTab(type) {
document.getElementById('quests-section').style.display = type === 'q' ? 'block' : 'none';
document.getElementById('events-section').style.display = type === 'e' ? 'block' : 'none';
document.getElementById('q-filters').style.display = type === 'q' ? 'flex' : 'none';
document.getElementById('tab-q').className = 'tab-btn ' + (type === 'q' ? 'active' : '');
document.getElementById('tab-e').className = 'tab-btn ' + (type === 'e' ? 'active' : '');
if(type === 'e') renderEvents();
}
function renderEvents() {
const list = document.getElementById('events-list'); if(list.innerHTML !== "") return;
eventsData.forEach(ev => {
const div = document.createElement('div'); div.className = 'event-card';
div.innerHTML = `<div style="display:flex;justify-content:space-between;align-items:center"><span><b>ДЕНЬ ${ev.day}:</b> ${ev.title}</span><span class="toggle-icon">ПОДРОБНЕЕ [+]</span></div>
<div class="event-desc"><p><b>МЕСТО:</b> ${ev.place}</p><p><b>ШАНС:</b> ${ev.chance}</p><p>${ev.desc}</p></div>`;
div.onclick = () => { const d = div.querySelector('.event-desc'); const icon = div.querySelector('.toggle-icon'); const open = d.style.display === 'block'; d.style.display = open ? 'none' : 'block'; icon.innerText = open ? 'ПОДРОБНЕЕ [+]' : 'СКРЫТЬ [-]'; };
list.appendChild(div);
});
}
function toggleQ(id) {
const el = document.getElementById(id); el.classList.toggle('completed');
localStorage.setItem(id, el.classList.contains('completed'));
el.querySelector('.status-btn').innerText = el.classList.contains('completed') ? 'ОТМЕНИТЬ' : 'ВЫПОЛНЕНО';
updateStats();
}
function toggleItem(li, id) { localStorage.setItem(id, li.classList.toggle('item-found')); }
function loadProgress() {
questsDatabase.forEach(q => {
const el = document.getElementById(q.id); if (!el) return;
if (localStorage.getItem(q.id) === 'true') { el.classList.add('completed'); el.querySelector('.status-btn').innerText = 'ОТМЕНИТЬ'; }
el.querySelectorAll('.needs-list li').forEach((li, i) => { if(localStorage.getItem(`${q.id}_${i}`) === 'true') li.classList.add('item-found'); });
const saved = localStorage.getItem(q.id + '_cnt');
if (saved) { const s = el.querySelector('.count-val'); if(s) { s.innerText = saved; if(parseInt(saved) === q.target) s.closest('li').classList.add('item-found'); } }
});
}
function changeCount(btn, val) {
const s = btn.parentNode.querySelector('.count-val'); const c = btn.closest('.quest-card'); const q = questsDatabase.find(x => x.id === c.id);
let curr = Math.max(0, Math.min(q.target, parseInt(s.innerText) + val)); s.innerText = curr;
if(curr === q.target) s.closest('li').classList.add('item-found'); else s.closest('li').classList.remove('item-found');
localStorage.setItem(c.id + '_cnt', curr);
}
function initSearchHints() {
const hints = new Set(); questsDatabase.forEach(q => { hints.add(q.title); (q.needs||[]).forEach(n => hints.add(n)); });
const d = document.getElementById('searchHints'); if(d) { d.innerHTML=''; hints.forEach(h => { const o = document.createElement('option'); o.value = h; d.appendChild(o); }); }
}
function changeSlide(d, e) {
e.stopPropagation(); if(!window.cS) window.cS = 1;
const imgs = ["cat1.png", "cat2.png", "cat3.png", "cat4.png", "cat5.png"];
window.cS += d; if(window.cS > 5) window.cS = 1; if(window.cS < 1) window.cS = 5;
document.getElementById('cat-slide').src = imgs[window.cS - 1];
document.getElementById('slide-num').innerText = window.cS + " / 5";
}
function changeQuestSlide(d, e) {
if (e) e.stopPropagation(); if(!window.qS) window.qS = 1;
const imgs = ["school-trader.png", "gymn-cor.jpg", "gymn.jpg"];
window.qS += d; if(window.qS > 3) window.qS = 1; if(window.qS < 1) window.qS = 3;
document.getElementById('quest-slide').src = imgs[window.qS - 1];
document.getElementById('q-slide-num').innerText = window.qS + " / 3";
}
function filterQuests(lvl, btn) { document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); btn.classList.add('active'); document.querySelectorAll('.quest-card').forEach(card => { const q = questsDatabase.find(x => x.id === card.id); card.style.display = (lvl === 'all' || q.diff === lvl) ? 'flex' : 'none'; }); }
function updateStats() { const t = questsDatabase.length; const d = document.querySelectorAll('.quest-card.completed').length; document.getElementById('total-q').innerText = t; document.getElementById('done-q').innerText = d; document.getElementById('left-q').innerText = t - d; }
function openTrader(n, l, i1, i2, i3) { document.getElementById('modalTraderName').innerText = n; document.getElementById('modalTraderLoc').innerText = l; const imgs = [i1, i2, i3]; const labs = ["ЗДАНИЕ:", "КОРИДОР:", "КАБИНЕТ:"]; imgs.forEach((src, i) => { const lbl = document.getElementById(`label${i+1}`); const cont = document.getElementById(`imgCont${i+1}`); if(src && src !== 'null') { lbl.innerText = labs[i]; cont.innerHTML = `<img src="${src}" style="width:100%;height:200px;object-fit:cover;margin-top:5px">`; lbl.parentElement.style.display = 'block'; } else lbl.parentElement.style.display = 'none'; }); document.getElementById('traderModal').style.display = 'block'; }
function closeModal() { document.getElementById('traderModal').style.display = 'none'; }
function closeQuestModal() { document.getElementById('questDetailsModal').style.display = 'none'; document.body.style.overflow = 'auto'; }
window.addEventListener('click', e => { if(e.target.classList.contains('modal')) { closeModal(); closeQuestModal(); } });
</script>
<div id="questDetailsModal" class="modal">
<div class="modal-content" style="max-width: 900px; border-color: var(--primary);">
<span class="close-modal" onclick="closeQuestModal()">×</span>
<h1 id="det-title" style="color: var(--primary); text-transform: uppercase; margin-bottom: 5px;"></h1>
<div id="det-diff" style="margin-bottom: 25px;"></div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px;">
<div style="background: rgba(255,255,255,0.02); padding: 15px; border: 1px solid #222;"><h3 style="color: var(--primary); font-size: 0.8rem; border-bottom: 1px solid #333; padding-bottom: 5px;">СПИСОК ТРЕБОВАНИЙ</h3><ul id="det-needs" style="line-height: 1.8;"></ul></div>
<div style="background: rgba(255,255,255,0.02); padding: 15px; border: 1px solid #222;"><h3 style="color: var(--primary); font-size: 0.8rem; border-bottom: 1px solid #333; padding-bottom: 5px;">НАГРАДА ЗА ВЫПОЛНЕНИЕ</h3><ul id="det-rewards" style="color: #fff; line-height: 1.8;"></ul></div>
</div>
<div style="margin-top: 25px; padding: 20px; background: #111; border-left: 4px solid var(--primary);"><h3 style="margin: 0 0 10px 0; font-size: 0.8rem; color: #555;">РУКОВОДСТВО ПО ПРОХОЖДЕНИЮ</h3><p id="det-guide" style="color: #999; font-size: 0.9rem; margin: 0;"></p></div>
</div>
</div>
</body>
</html>