Browse Source

Add Map Theme Editor with save/load functionality

- Enhanced maplibre-test.html into a full theme editor
- Added 6 preset themes (Fantasy Dark, Enchanted Forest, Desert Oasis, etc.)
- Save custom themes with names to localStorage
- Load saved themes with color preview dots
- "Set as Active Game Theme" applies colors to HikeMap
- index.html now reads active theme from localStorage on load
- Real-time preview of color changes on the map

Access at /maplibre-test.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
master
HikeMap User 4 weeks ago
parent
commit
405ab5be99
  1. 17
      index.html
  2. 981
      maplibre-test.html

17
index.html

@ -4375,8 +4375,8 @@
// ===================== // =====================
// FANTASY MAP STYLE // FANTASY MAP STYLE
// ===================== // =====================
// Default fantasy colors (can be customized via settings)
const mapColors = {
// Default fantasy colors (can be customized via Theme Editor)
const defaultMapColors = {
land: '#1a1a2e', land: '#1a1a2e',
water: '#0f3460', water: '#0f3460',
roads: '#e94560', roads: '#e94560',
@ -4384,6 +4384,19 @@
parks: '#1b4332' parks: '#1b4332'
}; };
// Load active theme from localStorage (set by Theme Editor)
let mapColors = { ...defaultMapColors };
try {
const savedTheme = localStorage.getItem('hikemap_active_theme');
if (savedTheme) {
const parsed = JSON.parse(savedTheme);
mapColors = { ...defaultMapColors, ...parsed };
console.log('Loaded custom map theme:', mapColors);
}
} catch (e) {
console.log('Using default map colors');
}
// Build the fantasy map style // Build the fantasy map style
function buildFantasyStyle(colors, use3dBuildings = true) { function buildFantasyStyle(colors, use3dBuildings = true) {
return { return {

981
maplibre-test.html
File diff suppressed because it is too large
View File

Loading…
Cancel
Save