Skip to content

Commit 39f763f

Browse files
committed
Fix: Locate-Button im Picker neutrales Blau, Spinner-Animation beim Orten
1 parent 4d42daa commit 39f763f

4 files changed

Lines changed: 21 additions & 9 deletions

File tree

assets/build/vectormaps.css

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,23 @@
128128
background: #215978;
129129
}
130130

131-
#vm-locate-btn {
132-
background: #3a7d44;
131+
#vm-locate-btn.locating svg {
132+
display: none;
133+
}
134+
135+
#vm-locate-btn.locating::after {
136+
content: '';
137+
display: inline-block;
138+
width: 12px;
139+
height: 12px;
140+
border: 2px solid rgba(255,255,255,0.4);
141+
border-top-color: #fff;
142+
border-radius: 50%;
143+
animation: vm-locate-spin 0.7s linear infinite;
133144
}
134145

135-
#vm-locate-btn:hover {
136-
background: #2d6135;
146+
@keyframes vm-locate-spin {
147+
to { transform: rotate(360deg); }
137148
}
138149

139150
.vm-modal-footer {

assets/build/vectormaps.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,12 @@ class VectorMapPicker {
354354
alert('Ihr Browser unterstützt keine Geolokalisierung.');
355355
return;
356356
}
357+
const locateSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><line x1="12" y1="2" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="22"/><line x1="2" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="22" y2="12"/></svg>';
357358
const btn = document.getElementById('vm-locate-btn');
358-
if (btn) btn.innerHTML = '...';
359+
if (btn) btn.classList.add('locating');
359360
navigator.geolocation.getCurrentPosition(
360361
(pos) => {
361-
if (btn) btn.innerHTML = '<i class="rex-icon rex-icon-crosshairs"></i>';
362+
if (btn) { btn.classList.remove('locating'); btn.innerHTML = locateSvg; }
362363
const { latitude: lat, longitude: lng } = pos.coords;
363364
if (this.map) {
364365
this.map.flyTo({ center: [lng, lat], zoom: 15 });
@@ -368,7 +369,7 @@ class VectorMapPicker {
368369
}
369370
},
370371
() => {
371-
if (btn) btn.innerHTML = '<i class="rex-icon rex-icon-crosshairs"></i>';
372+
if (btn) { btn.classList.remove('locating'); btn.innerHTML = locateSvg; }
372373
alert('Standort konnte nicht ermittelt werden. Bitte Berechtigung im Browser prüfen.');
373374
},
374375
{ timeout: 8000, maximumAge: 60000 }

0 commit comments

Comments
 (0)