Widget:MapResponsive
<style>
.container { display: flex; flex-direction: row; align-items: flex-start; width: 100%; max-width: 1200px; margin: 0 auto; overflow: hidden; box-sizing: border-box; }
/* Side panel */
#sidePanel { flex: 0 0 0; width: 0; min-width: 0; opacity: 0; overflow-x: hidden; overflow-y: auto; max-height: 80vh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: white; border-left: 1px solid #ccc; padding: 0; transform: translateY(-12px); transform-origin: top; box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1); box-sizing: border-box;
transition: flex-basis 0.35s ease, width 0.35s ease, opacity 0.25s ease, transform 0.35s ease, padding 0.35s ease;
/* Scrollbar styling */ scrollbar-width: thin; scrollbar-color: #ccc #f0f0f0; }
#sidePanel.visible { flex: 0 0 280px; width: 280px; opacity: 1; padding: 10px; transform: translateY(0); }
#sidePanel > * { min-width: 0; }
#sidePanel ul { margin: 0; }
/* Custom scrollbar for Webkit browsers */ #sidePanel::-webkit-scrollbar { width: 6px; }
#sidePanel::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
#sidePanel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
#sidePanel::-webkit-scrollbar-thumb:hover { background: #aaa; }
/* Custom bullets for list items */ #sidePanel li .menu-bullet { color: #0645ad; margin-right: 8px; display: inline-block; font-size: 14px; }
#sidePanel li.toggle-item .menu-bullet { display: none; }
/* Image map */
.image-map { position: relative; flex: 1 1 auto; min-width: 0; width: 100%; line-height: 0; box-sizing: border-box;
transition: flex-basis 0.35s ease, width 0.35s ease, transform 0.35s ease;
/* Prevent layout shift */ backface-visibility: hidden; transform: translateZ(0); }
.image-map img { width: 100%; height: auto; display: block; }
.responsive-img { width: 100%; height: auto; display: block; border-radius: 1.2rem; transition: all 0.3s ease; }
/* Floating anchor buttons */
.anchor-btn { position: absolute; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.3); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 3rem; padding: 10px 18px; font-weight: 600; font-size: 0.8rem; color: #004d99; cursor: pointer; white-space: nowrap; font-family: inherit; z-index: 20; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.anchor-btn:hover { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px); transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); }
.anchor-btn:active { transform: translate(-50%, -50%) scale(0.96); }
/* Loading state */
#sidePanel.loading { position: relative; }
#sidePanel.loading::after { content: ; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; border: 2px solid #ccc; border-top-color: #0645ad; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Responsive - Mobile (map on top) */
@media (max-width: 720px) { .container { flex-direction: column !important; }
/* Map on top (first) */ .image-map { order: 1 !important; width: 100%; flex: 1 1 auto; }
/* Panel below map (second) */ #sidePanel { order: 2 !important; width: 100%; max-height: 0; flex: 0 0 auto; border-left: none; border-top: 1px solid #ccc; transform: translateY(0); transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease; }
#sidePanel.visible { flex: 0 0 auto; width: 100%; max-height: 50vh; margin-top: 10px; padding: 10px; opacity: 1; }
.anchor-btn { padding: 6px 12px; font-size: 0.7rem; white-space: nowrap; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
/* Better touch targets for mobile */ .sidepanel-toggle { padding: 4px; min-width: 24px; text-align: center; }
#sidePanel li { margin-bottom: 8px; } }
/* Responsive - Small mobile */
@media (max-width: 480px) { .anchor-btn { padding: 5px 10px; font-size: 0.65rem; }
#sidePanel.visible { max-height: 60vh; padding: 12px; font-size: 14px; }
.container { min-height: 100vh; } } </style>
<img class="responsive-img" src="https://www.familysearch.org/en/wiki/img_auth.php/8/80/World_map_3.jpg" alt="" style="object-fit: cover" />
<button class="anchor-btn" data-key="north_america" data-continent="north-america" style="left: 22%; top: 35%" > North America </button>
<button class="anchor-btn" data-key="south_america" data-continent="south-america" style="left: 30%; top: 75%" > South America </button>
<button class="anchor-btn" data-key="europe" data-continent="europe" style="left: 55%; top: 30%" > Europe </button>
<button class="anchor-btn" data-key="asia" data-continent="asia" style="left: 75%; top: 32%" > Asia </button>
<button class="anchor-btn" data-key="africa" data-continent="africa" style="left: 53%; top: 63%" > Africa </button>
<button class="anchor-btn" data-key="oceania" data-continent="oceania" style="left: 90%; top: 80%" > Australia/Oceania </button>