Skip to content

Commit 4a86c0b

Browse files
committed
style: white bg for clusters + improve country bubble layout
1 parent 82b0d5e commit 4a86c0b

File tree

3 files changed

+20
-33
lines changed

3 files changed

+20
-33
lines changed

app/components/CountryBubbles.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,30 +143,32 @@ function createMarkerElement(country: CountryHotspot): HTMLElement {
143143
144144
const container = document.createElement('div')
145145
container.style.cssText = `
146-
display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px;
146+
display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 12px;
147147
background: white; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
148148
outline: 1.5px solid rgb(0 0 0 / 0.2); outline-offset: -1.5px;
149149
`
150150
151-
// Flag container with rounded corners (original icon size, clipped)
152-
const flagContainer = document.createElement('span')
153-
flagContainer.style.cssText = 'flex-shrink: 0; border-radius: 4px; overflow: hidden; display: flex;'
151+
// Row 1: Flag + Country name
152+
const row1 = document.createElement('div')
153+
row1.style.cssText = 'display: flex; align-items: center; gap: 4px;'
154154
155-
const textContainer = document.createElement('div')
156-
textContainer.style.cssText = 'display: flex; flex-direction: column; text-align: left;'
155+
const flagContainer = document.createElement('span')
156+
flagContainer.style.cssText = 'flex-shrink: 0; border-radius: 2px; overflow: hidden; display: flex;'
157157
158158
const nameSpan = document.createElement('span')
159159
nameSpan.style.cssText = 'font-size: 14px; color: #1f2937; line-height: 1.25; font-weight: 600;'
160160
nameSpan.textContent = country.name
161161
162+
row1.appendChild(flagContainer)
163+
row1.appendChild(nameSpan)
164+
165+
// Row 2: Location count
162166
const countSpan = document.createElement('span')
163167
countSpan.style.cssText = 'font-size: 12px; color: #374151; line-height: 1.25;'
164168
countSpan.className = 'location-count'
165169
166-
textContainer.appendChild(nameSpan)
167-
textContainer.appendChild(countSpan)
168-
container.appendChild(flagContainer)
169-
container.appendChild(textContainer)
170+
container.appendChild(row1)
171+
container.appendChild(countSpan)
170172
button.appendChild(container)
171173
172174
// Load icon from bundled package
@@ -280,12 +282,10 @@ function flyToCountry(country: CountryHotspot) {
280282
translate-x="-1/2" translate-y="-1/2"
281283
@click="flyToCountry(bubble)"
282284
>
283-
<div flex="~ items-center gap-8" outline="~ offset--1.5 1.5 neutral/20" p-8 rounded-12 bg-neutral-0 shadow-lg>
284-
<!-- Navigation icon with background -->
285-
<div flex="~ items-center justify-center" rounded-full bg-neutral-100 shrink-0 size-32 :style="{ transform: `rotate(${bubble.edge!.arrowAngle}deg)` }">
286-
<Icon name="i-tabler:navigation-filled" text-neutral-600 size-16 />
287-
</div>
288-
<div flex="~ col" text-left>
285+
<div flex="~ items-center gap-6" outline="~ offset--1.5 1.5 neutral/20" p-8 rounded-12 bg-neutral-0 shadow-lg>
286+
<!-- Navigation icon -->
287+
<Icon name="i-tabler:navigation-filled" text-neutral-700 shrink-0 size-13 :style="{ transform: `rotate(${bubble.edge!.arrowAngle}deg)` }" />
288+
<div flex="~ col gap-2" text-left>
289289
<div flex="~ items-center gap-4">
290290
<span rounded-2 flex shrink-0 overflow-hidden>
291291
<Icon :name="bubble.flagIcon" size-16 />

app/pages/index.vue

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -256,19 +256,6 @@ main {
256256
--uno: bg-neutral-100 transition-colors;
257257
}
258258
259-
/* Attribution position - match MapControls margins */
260-
.maplibregl-ctrl-bottom-left {
261-
left: 12px;
262-
bottom: 12px;
263-
}
264-
265-
@media (min-width: 768px) {
266-
.maplibregl-ctrl-bottom-left {
267-
left: 16px;
268-
bottom: 16px;
269-
}
270-
}
271-
272259
/* Style compact attribution */
273260
.maplibregl-ctrl-attrib {
274261
background: rgba(255, 255, 255, 0.9);

app/utils/map-style.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export function getMapStyle(origin: string): StyleSpecification {
411411
'minzoom': 6,
412412
'maxzoom': 9, // Hide clusters above zoom 8
413413
'paint': {
414-
'circle-color': NIMIQ_COLORS.darkblue,
414+
'circle-color': NIMIQ_COLORS.white,
415415
'circle-radius': [
416416
'step',
417417
['get', 'point_count'],
@@ -421,8 +421,8 @@ export function getMapStyle(origin: string): StyleSpecification {
421421
500,
422422
22, // 500+ locations
423423
],
424-
'circle-stroke-width': 2,
425-
'circle-stroke-color': NIMIQ_COLORS.white,
424+
'circle-stroke-width': 1.5,
425+
'circle-stroke-color': 'rgba(0, 0, 0, 0.2)',
426426
},
427427
},
428428
// Cluster count labels
@@ -442,7 +442,7 @@ export function getMapStyle(origin: string): StyleSpecification {
442442
'text-ignore-placement': true,
443443
},
444444
'paint': {
445-
'text-color': NIMIQ_COLORS.white,
445+
'text-color': NIMIQ_COLORS.darkblue,
446446
},
447447
},
448448

0 commit comments

Comments
 (0)