From 771b75ed71198811a6661a146e3376f0489771d8 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 7 Nov 2024 11:39:54 +0300 Subject: [PATCH] Replace query marker fade animation with css --- app/assets/javascripts/index/query.js | 16 ++++------------ app/assets/stylesheets/common.scss | 8 ++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 7d63280ee8..09e4de31e0 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -289,18 +289,10 @@ OSM.Query = function (map) { .hide(); if (marker) map.removeLayer(marker); - marker = L.circle(latlng, radius, featureStyle).addTo(map); - - $(document).everyTime(75, "fadeQueryMarker", function (i) { - if (i === 10) { - map.removeLayer(marker); - } else { - marker.setStyle({ - opacity: 1 - (i * 0.1), - fillOpacity: 0.5 - (i * 0.05) - }); - } - }, 10); + marker = L.circle(latlng, Object.assign({ + radius: radius, + className: "query-marker" + }, featureStyle)).addTo(map); runQuery(latlng, radius, nearby, $("#query-nearby"), false); runQuery(latlng, radius, isin, $("#query-isin"), true, compareSize); diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index d551462b22..8dba773d87 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -368,6 +368,14 @@ body.small-nav { .leaflet-marker-draggable { cursor: move; } + + .query-marker { + animation: 1500ms forwards query-marker-fade; + + @keyframes query-marker-fade { + to { opacity: 0 } + } + } } #map-ui {