Files
maps/frontend/index.html
Dongho Kim c9678f28ba update
2025-12-04 06:09:04 +09:00

220 lines
5.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Maps</title>
<style>
body {
margin: 0;
overflow: hidden;
background-color: #1a1a1a;
font-family: system-ui, -apple-system, sans-serif;
}
canvas {
width: 100vw;
height: 100vh;
display: block;
}
#ui-container {
position: absolute;
top: 20px;
right: 20px;
display: flex;
flex-direction: column;
gap: 10px;
background: rgba(0, 0, 0, 0.5);
padding: 10px;
border-radius: 8px;
backdrop-filter: blur(5px);
color: white;
}
.control-group {
display: flex;
flex-direction: column;
gap: 5px;
}
button {
background: #333;
color: white;
border: 1px solid #555;
padding: 8px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
button:hover {
background: #444;
}
button:active {
background: #222;
}
#debug-info {
position: absolute;
bottom: 20px;
left: 20px;
color: rgba(255, 255, 255, 0.7);
font-size: 12px;
pointer-events: none;
background: rgba(0, 0, 0, 0.5);
padding: 5px 10px;
border-radius: 4px;
}
#compass {
position: absolute;
top: 20px;
left: 20px;
width: 60px;
height: 60px;
background: rgba(0, 0, 0, 0.6);
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.2);
backdrop-filter: blur(5px);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
pointer-events: none;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
z-index: 100;
}
.direction {
position: absolute;
font-size: 14px;
font-family: monospace;
}
.n {
top: 4px;
color: #ff5555;
}
.s {
bottom: 4px;
color: #ddd;
}
.e {
right: 6px;
color: #ddd;
}
.w {
left: 6px;
color: #ddd;
}
.compass-center {
width: 4px;
height: 4px;
background: white;
border-radius: 50%;
}
.compass-arrow {
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 20px solid #ff5555;
transform: translate(-50%, -100%);
}
</style>
</head>
<body>
<div id="compass">
<div class="direction n">N</div>
<div class="direction e">E</div>
<div class="direction s">S</div>
<div class="direction w">W</div>
<div class="compass-arrow"></div>
<div class="compass-center"></div>
</div>
<div id="labels"></div>
<style>
#labels {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
overflow: hidden;
}
.label {
position: absolute;
transform: translate(-50%, -50%);
color: #333;
text-shadow: 0 0 3px white, 0 0 3px white, 0 0 3px white;
font-family: sans-serif;
white-space: nowrap;
pointer-events: none;
font-weight: 600;
}
.label-country {
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
color: #222;
}
.label-city {
font-size: 12px;
font-weight: 600;
color: #333;
}
</style>
<div id="ui-container">
<div class="control-group">
<button id="btn-zoom-in">+</button>
<button id="btn-zoom-out">-</button>
</div>
<div class="control-group">
<label for="zoom-slider" style="font-size: 12px;">Zoom</label>
<input type="range" id="zoom-slider" min="0" max="100" value="50">
</div>
<button id="btn-location">📍 My Location</button>
</div>
<div id="debug-info">
Zoom: <span id="debug-zoom">--</span> | Pos: <span id="debug-pos">--</span>
</div>
<script type="module">
import init from './wasm.js?v=fixed_labels_v6';
async function run() {
try {
await init();
console.log("WASM initialized");
} catch (e) {
console.error("Failed to initialize WASM:", e);
}
}
run();
</script>
</body>
</html>