diff --git a/plugin-designs/upg-neighbor/src/campaigns.vue b/plugin-designs/upg-neighbor/src/campaigns.vue index 8bc1e0d3e..280785341 100644 --- a/plugin-designs/upg-neighbor/src/campaigns.vue +++ b/plugin-designs/upg-neighbor/src/campaigns.vue @@ -112,7 +112,9 @@ function frame() { const lngs = pts.map((g) => g.lng), lats = pts.map((g) => g.lat) const w = mapContainer.value?.clientWidth || 0, h = mapContainer.value?.clientHeight || 0 // The panel covers the left 440px on wide screens, the bottom 55% on a phone: frame what you can see. - const padding = w > 760 ? { top: 60, bottom: 60, left: 440, right: 60 } : { top: 40, bottom: Math.round(h * 0.55) + 20, left: 30, right: 30 } + // In a right-to-left locale the panel sits on the right, so the wide padding moves with it. + const rtl = !!mapContainer.value && getComputedStyle(mapContainer.value).direction === 'rtl' + const padding = w > 760 ? { top: 60, bottom: 60, left: rtl ? 60 : 440, right: rtl ? 440 : 60 } : { top: 40, bottom: Math.round(h * 0.55) + 20, left: 30, right: 30 } try { m.stop() m.fitBounds([[Math.min(...lngs), Math.min(...lats)], [Math.max(...lngs), Math.max(...lats)]], { padding, maxZoom: 5.5, duration: 900 }) @@ -161,7 +163,7 @@ onBeforeUnmount(() => destroy()) useShadowStyles(` .cp-root { position:absolute; inset:0; background:#f6f7f9; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; color:#1f2937; } .cp-map { position:absolute; inset:0; } - .cp-panel { position:absolute; top:10px; left:10px; bottom:10px; width:420px; z-index:20; display:flex; flex-direction:column; + .cp-panel { position:absolute; top:10px; inset-inline-start:10px; bottom:10px; width:420px; z-index:20; display:flex; flex-direction:column; background:#fff; border:1px solid #d9dee6; border-radius:12px; box-shadow:0 6px 20px rgba(0,20,60,.12); overflow:hidden; } .cp-head { padding:12px 14px 10px; border-bottom:1px solid #eef0f4; } .cp-head p { margin:0 0 8px; font-size:12.5px; line-height:1.4; color:#4b5563; } @@ -171,7 +173,7 @@ useShadowStyles(` .cp-btn { border:1px solid ${NAVY}; background:${NAVY}; color:#fff; border-radius:8px; padding:7px 10px; font:600 12px/1 inherit; cursor:pointer; } .cp-btn.ghost { background:#fff; color:${NAVY}; } .cp-body { flex:1 1 0; overflow-y:auto; } - .cp-row { display:block; width:100%; text-align:left; border:0; border-bottom:1px solid #f1f3f6; background:#fff; padding:10px 14px; cursor:pointer; font:inherit; color:inherit; } + .cp-row { display:block; width:100%; text-align:start; border:0; border-bottom:1px solid #f1f3f6; background:#fff; padding:10px 14px; cursor:pointer; font:inherit; color:inherit; } .cp-row:hover, .cp-row:focus-visible { background:#f5f8ff; } .cp-row b { font-size:14px; } .cp-bar { display:flex; gap:10px; margin-top:4px; font-size:12px; color:#4b5563; flex-wrap:wrap; } @@ -180,6 +182,7 @@ useShadowStyles(` .cp-where { font-size:11.5px; color:#6b7280; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .cp-brief { padding:12px 14px 16px; } .cp-back { border:0; background:none; color:${NAVY}; font:600 12px/1 inherit; cursor:pointer; padding:0 0 8px; } + .cp-back::before { content:'← '; } [dir="rtl"] .cp-back::before { content:'→ '; } .cp-title { font:700 18px/1.2 inherit; margin:0 0 4px; } .cp-big { display:flex; gap:10px; margin:10px 0; } .cp-big div { flex:1; border-radius:10px; padding:10px; font-size:12px; line-height:1.3; } @@ -189,11 +192,11 @@ useShadowStyles(` .cp-res span.yes { border-color:#9fd3b0; color:#0b5e33; background:#eaf7ef; } .cp-brief h3 { font:700 13px/1.2 inherit; margin:14px 0 6px; } .cp-line { display:flex; justify-content:space-between; gap:8px; font-size:12.5px; padding:5px 0; border-bottom:1px solid #f1f3f6; } - .cp-line button { border:0; background:none; padding:0; font:inherit; color:${NAVY}; cursor:pointer; text-align:left; } + .cp-line button { border:0; background:none; padding:0; font:inherit; color:${NAVY}; cursor:pointer; text-align:start; } .cp-note { padding:14px; color:#6b7280; font-size:13px; line-height:1.45; } .cp-hover { position:absolute; z-index:25; pointer-events:none; background:rgba(0,27,68,.92); color:#fff; font-size:12px; line-height:1.3; padding:5px 8px; border-radius:6px; max-width:260px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } - .cp-maperr { position:absolute; right:12px; top:12px; z-index:15; background:#fff; border:1px solid #d9dee6; border-radius:8px; padding:8px 12px; font-size:13px; color:#6b7280; } - @media (max-width:760px) { .cp-panel { top:auto; left:6px; right:6px; bottom:6px; width:auto; height:55%; } } + .cp-maperr { position:absolute; inset-inline-end:12px; top:12px; z-index:15; background:#fff; border:1px solid #d9dee6; border-radius:8px; padding:8px 12px; font-size:13px; color:#6b7280; } + @media (max-width:760px) { .cp-panel { top:auto; inset-inline:6px; bottom:6px; width:auto; height:55%; } } `, 'upgn-campaigns') @@ -236,7 +239,7 @@ useShadowStyles(`
{{ $t('neighbor.about.why') }}