From a21b7baa36880e1b7dd6ef9eeea1ea5130f9f2ff Mon Sep 17 00:00:00 2001 From: HikeMap User Date: Sun, 11 Jan 2026 08:15:51 -0600 Subject: [PATCH] Remove building animation, make buildings 200% taller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removed animated building height feature for better performance - Set building heights to 2x their normal values for a more dramatic look 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- index.html | 60 ++---------------------------------------------------- 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/index.html b/index.html index 6d4fc6d..40ae446 100644 --- a/index.html +++ b/index.html @@ -4421,8 +4421,8 @@ id: 'buildings-3d', type: 'fill-extrusion', source: 'openmaptiles', 'source-layer': 'building', minzoom: 13, paint: { 'fill-extrusion-color': colors.buildings, - 'fill-extrusion-height': ['get', 'render_height'], - 'fill-extrusion-base': ['get', 'render_min_height'], + 'fill-extrusion-height': ['*', 2, ['get', 'render_height']], + 'fill-extrusion-base': ['*', 2, ['get', 'render_min_height']], 'fill-extrusion-opacity': 0.85 } } : { @@ -5334,62 +5334,6 @@ map.on('rotate', updateFogOfWar); map.on('pitch', updateFogOfWar); - // ===================== - // ANIMATED BUILDINGS - // ===================== - let buildingAnimationEnabled = true; // Set to false to disable - let buildingAnimationId = null; - const buildingAnimationSpeed = 0.003; // How fast buildings breathe - - function animateBuildings(timestamp) { - if (!buildingAnimationEnabled) return; - - // Two multipliers 180° out of phase: when one grows, the other shrinks - // Range: 100% to 150% - const sinVal = Math.sin(timestamp * buildingAnimationSpeed); - const multiplierA = 1 + (sinVal + 1) * 0.25; // 1.0 → 1.5 - const multiplierB = 1 + (-sinVal + 1) * 0.25; // 1.5 → 1.0 (inverted) - - // Alternate based on floor of height being even/odd - if (map.getLayer('buildings-3d')) { - map.setPaintProperty('buildings-3d', 'fill-extrusion-height', [ - '*', - ['get', 'render_height'], - ['case', - ['==', ['%', ['floor', ['get', 'render_height']], 2], 0], - multiplierA, - multiplierB - ] - ]); - } - - buildingAnimationId = requestAnimationFrame(animateBuildings); - } - - // Start the animation - if (buildingAnimationEnabled) { - buildingAnimationId = requestAnimationFrame(animateBuildings); - } - - // Function to toggle building animation - function toggleBuildingAnimation() { - buildingAnimationEnabled = !buildingAnimationEnabled; - if (buildingAnimationEnabled) { - buildingAnimationId = requestAnimationFrame(animateBuildings); - console.log('Building animation enabled'); - } else { - if (buildingAnimationId) { - cancelAnimationFrame(buildingAnimationId); - buildingAnimationId = null; - } - // Reset to normal height - if (map.getLayer('buildings-3d')) { - map.setPaintProperty('buildings-3d', 'fill-extrusion-height', ['get', 'render_height']); - } - console.log('Building animation disabled'); - } - } - // NOTE: initFogOfWar() is called lazily from updateFogOfWar() to avoid // temporal dead zone issues with navMode variable