-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
187 lines (179 loc) · 8.38 KB
/
map.html
File metadata and controls
187 lines (179 loc) · 8.38 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Treasurehunter Map</title>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/map.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link rel="icon" type="image/x-icon" href="/images/favicon.ico">
</head>
<body>
<header>
<div class="header-content">
<button class="mobile-menu-toggle" aria-label="Toggle mobile menu">
<i class="fas fa-bars"></i>
</button>
<a href="/" class="logo">Treasurehunter Companion</a>
<nav id="main-nav">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="map.html">Map</a></li>
<li><a href="compendium.html">Compendium</a></li>
<li><a href="wiki.html">Wiki</a></li>
<li><a href="clan.html">Clan</a></li>
<li><a href="#">Market</a></li>
</ul>
</nav>
<div class="user-panel">
<div class="notification-container">
<i id="notification-icon" class="fas fa-bell"></i>
<div id="notification-dropdown" class="dropdown-content">
<div id="notification-list"></div>
</div>
</div>
<button class="user-panel-toggle">
<img id="user-panel-avatar" src="/images/default-avatar.jpg" alt="User Avatar">
<span id="user-panel-username"></span>
<i class="fas fa-chevron-down"></i>
</button>
<div class="user-dropdown">
<a href="/profile">Profile</a>
<a href="/settings">Settings</a>
<a href="#" id="logout-link">Logout</a>
</div>
</div>
</div>
</header>
<main>
<div class="map-header">
<h2>Treasurehunter Map</h2>
</div>
<div id="map-controls">
<button id="zoom-in" class="btn btn-map-control">+</button>
<button id="zoom-out" class="btn btn-map-control">-</button>
<button id="toggle-grid" class="btn btn-map-control">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M20 3H4c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM8 19H5v-3h3v3zm0-4H5v-3h3v3zm0-4H5V8h3v3zm4 8h-3v-3h3v3zm0-4h-3v-3h3v3zm0-4h-3V8h3v3zm3 8h-2v-3h2v3zm0-4h-2v-3h2v3zm0-4h-2V8h2v3z" fill="currentColor"/>
</svg>
</button>
<button id="reset-map-btn" class="btn btn-map-control">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" fill="currentColor"/>
</svg>
</button>
</div>
<div id="map-container">
<canvas id="map"></canvas>
<div id="map-sidebar">
<div id="map-key">
<h3>Map Key</h3>
<ul>
<li><span class="key-color defense"></span> Defense</li>
<li><span class="key-color ingredient-bag"></span> Ingredient Bag</li>
<li><span class="key-color bag"></span> Bag</li>
<li><span class="key-color health"></span> Health</li>
<li><span class="key-color speed"></span> Speed</li>
<li><span class="key-color attack"></span> Attack</li>
<li><span class="key-color craft-chance"></span> Craft Chance</li>
<li><span class="key-color crit-chance"></span> Critical Chance</li>
<li><span class="key-color clan-base"></span> Clan Base</li>
<li><span class="key-color campfire"></span> Campfire</li>
</ul>
</div>
<div id="update-request-button-container">
<button id="open-update-request-modal" class="btn btn-primary">Submit Map Update</button>
</div>
<div id="leaderboard-container">
<h3>Top Contributors</h3>
<ul id="leaderboard-list"></ul>
</div>
</div>
</div>
</main>
<div id="update-request-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3>Submit Map Update Request</h3>
<span class="close">×</span>
</div>
<form id="update-request-form">
<div class="form-group">
<label for="type">Type:</label>
<select id="type" name="type" required></select>
</div>
<div class="form-group">
<label for="label">Label:</label>
<input type="text" id="label" name="label" readonly required>
</div>
<div class="form-group">
<label for="x">X Coordinate:</label>
<input type="number" id="x" name="x" required readonly>
</div>
<div class="form-group">
<label for="y">Y Coordinate:</label>
<input type="number" id="y" name="y" required readonly>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Submit Request</button>
</div>
</form>
</div>
</div>
<footer>
<div class="footer-content">
<div class="footer-logo"><img src="/images/DevCat_Logo.png" alt="DevCat Logo"></div>
<div class="footer-links">
<a href="/index.html">Home</a>
<a href="#">About</a>
<a href="#">Contact</a>
<a href="#">Privacy Policy</a>
</div>
<div class="footer-social">
<a href="https://github.com/DevelopmentCats"><i class="fab fa-github"></i></a>
<a href="#"><i class="fab fa-discord"></i></a>
<a href="#"><i class="fab fa-facebook"></i></a>
</div>
</div>
<div class="footer-bottom">
© 2024 DeveloperCats. All rights reserved.
</div>
</footer>
<div class="loading-animation">
<div class="spinner"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/date-fns@3.6.0/cdn.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uuid@8.3.2/dist/umd/uuid.min.js"></script>
<script type="module">
import { setupMobileNavigation, showLoading, hideLoading, showError } from './js/utils.js';
import logger, { initializeBrowserLogger } from './js/logger.js';
import { isLoggedIn, checkAuth } from './js/auth.js';
import './js/userPanel.js';
import { initMap, setupRealTimeUpdates, cleanupRealTimeUpdates } from './js/map.js';
import './js/update-request.js';
import { loadNotifications } from './js/notifications.js';
async function init() {
await initializeBrowserLogger();
setupMobileNavigation();
initMap();
setupRealTimeUpdates();
logger.info('Map page loaded');
if (isLoggedIn()) {
loadNotifications();
}
checkAuth();
}
init().catch(error => console.error('Initialization error:', error));
// Make functions available globally
window.showLoading = showLoading;
window.hideLoading = hideLoading;
window.showError = showError;
window.addEventListener('unload', () => {
cleanupRealTimeUpdates();
});
</script>
</body>
</html>