fix(maps): restore score colors for non-article cities, improve hover UX
Non-article cities were fully gray (#9CA3AF), stripping informational value. Now all cities show score-based colors (green/amber/red). Non-article cities are differentiated via lower opacity, dashed border, desaturation, and default cursor (no click handler). Tooltips show scores for all cities — article cities get "Click to explore →", non-article cities get "Coming soon". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -892,6 +892,18 @@
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/* Non-article city markers: faded + dashed border, no click affordance */
|
||||
.pn-marker--muted {
|
||||
opacity: 0.45;
|
||||
border: 2px dashed rgba(255,255,255,0.6);
|
||||
cursor: default;
|
||||
filter: saturate(0.7);
|
||||
}
|
||||
.pn-marker--muted:hover {
|
||||
transform: none;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.28);
|
||||
}
|
||||
|
||||
/* Small fixed venue dot */
|
||||
.pn-venue {
|
||||
width: 10px;
|
||||
|
||||
@@ -19,11 +19,12 @@
|
||||
return '#DC2626';
|
||||
}
|
||||
|
||||
function makeIcon(size, color) {
|
||||
function makeIcon(size, color, muted) {
|
||||
var s = Math.round(size);
|
||||
var cls = 'pn-marker' + (muted ? ' pn-marker--muted' : '');
|
||||
return L.divIcon({
|
||||
className: '',
|
||||
html: '<div class="pn-marker" style="width:' + s + 'px;height:' + s + 'px;background:' + color + ';opacity:0.82;"></div>',
|
||||
html: '<div class="' + cls + '" style="width:' + s + 'px;height:' + s + 'px;background:' + color + ';"></div>',
|
||||
iconSize: [s, s],
|
||||
iconAnchor: [s / 2, s / 2],
|
||||
});
|
||||
@@ -44,17 +45,20 @@
|
||||
if (!c.lat || !c.lon) return;
|
||||
var size = 10 + 36 * Math.sqrt((c.padel_venue_count || 1) / maxV);
|
||||
var hasArticle = c.has_article !== false;
|
||||
var color = hasArticle ? scoreColor(c.market_score) : '#9CA3AF';
|
||||
var color = scoreColor(c.market_score);
|
||||
var pop = c.population >= 1000000
|
||||
? (c.population / 1000000).toFixed(1) + 'M'
|
||||
: (c.population >= 1000 ? Math.round(c.population / 1000) + 'K' : (c.population || ''));
|
||||
var tip = '<strong>' + c.city_name + '</strong><br>'
|
||||
+ (c.padel_venue_count || 0) + ' venues'
|
||||
+ (pop ? ' · ' + pop : '');
|
||||
+ (pop ? ' · ' + pop : '')
|
||||
+ '<br><span style="color:' + color + ';font-weight:600;">Score ' + Math.round(c.market_score) + '/100</span>';
|
||||
if (hasArticle) {
|
||||
tip += '<br><span style="color:' + color + ';font-weight:600;">Score ' + Math.round(c.market_score) + '/100</span>';
|
||||
tip += '<br><span style="color:#94A3B8;font-size:0.75rem;">Click to explore →</span>';
|
||||
} else {
|
||||
tip += '<br><span style="color:#94A3B8;font-size:0.75rem;">Coming soon</span>';
|
||||
}
|
||||
var marker = L.marker([c.lat, c.lon], { icon: makeIcon(size, color) })
|
||||
var marker = L.marker([c.lat, c.lon], { icon: makeIcon(size, color, !hasArticle) })
|
||||
.bindTooltip(tip, { className: 'map-tooltip', direction: 'top', offset: [0, -Math.round(size / 2)] })
|
||||
.addTo(map);
|
||||
if (hasArticle) {
|
||||
|
||||
Reference in New Issue
Block a user