|
32 | 32 | .ol-out { min-width:46px; text-align:right; } |
33 | 33 | .ol-net { min-width:54px; text-align:right; } |
34 | 34 | #source-bar { bottom:6px; left:12px; padding:4px 12px; font-size:10px; color:#778899; } |
| 35 | + |
| 36 | + /* panel show/hide toggle (phone) */ |
| 37 | + #ui-toggle { display:none; position:fixed; bottom:10px; left:50%; transform:translateX(-50%); |
| 38 | + z-index:1100; padding:7px 15px; border-radius:18px; background:rgba(255,255,255,0.95); |
| 39 | + box-shadow:0 2px 8px rgba(0,0,0,.18); border:1px solid #ccd5dd; color:#334; |
| 40 | + font-size:11px; font-weight:600; cursor:pointer; } |
| 41 | + body.panels-off .panel { display:none !important; } |
| 42 | + |
| 43 | + /* tablet */ |
| 44 | + @media (max-width: 900px) { |
| 45 | + #controls { width:206px; } |
| 46 | + .legend-panel { width:208px; } |
| 47 | + #origin-legend { width:230px; } |
| 48 | + #title-bar { max-width:300px; } |
| 49 | + } |
| 50 | + /* phone */ |
| 51 | + @media (max-width: 600px) { |
| 52 | + #title-bar { top:8px; left:8px; right:8px; max-width:none; padding:8px 12px; } |
| 53 | + #title-bar h2 { font-size:13px; } |
| 54 | + #title-bar p { display:none; } |
| 55 | + #controls { top:auto; bottom:8px; left:8px; width:calc(50% - 12px); padding:9px 10px; } |
| 56 | + #controls label { font-size:9px; margin-bottom:3px; } |
| 57 | + #controls select { font-size:12px; padding:5px 6px; margin-bottom:9px; } |
| 58 | + #controls .hint { display:none; } |
| 59 | + .legend-panel { top:auto; bottom:8px; right:8px; left:auto; width:calc(50% - 12px); |
| 60 | + max-height:58vh; padding:8px 10px; font-size:10.5px; } |
| 61 | + #origin-legend { width:calc(50% - 12px); } |
| 62 | + .legend-panel h4 { font-size:10px; } |
| 63 | + .legend-cap { font-size:8px; } |
| 64 | + .ol-row { font-size:10px; gap:5px; margin-bottom:3px; } |
| 65 | + .ol-sw { width:11px; height:11px; } |
| 66 | + .ol-out { min-width:38px; } .ol-net { min-width:44px; } |
| 67 | + #source-bar { display:none; } |
| 68 | + #ui-toggle { display:block; } |
| 69 | + } |
35 | 70 | </style> |
36 | 71 | </head> |
37 | 72 | <body> |
@@ -67,6 +102,7 @@ <h4 id="dir-legend-title">Direction</h4> |
67 | 102 | <div style="font-size:9px; color:#9aa3ad; margin-top:5px;">inter-regional transfers · 2025</div> |
68 | 103 | </div> |
69 | 104 | <div id="source-bar" class="panel">Source: ISTAT — DCIS_MIGRAZIONI (28_185_DF_DCIS_MIGRAZIONI_1), 2025 (provisional)</div> |
| 105 | +<button id="ui-toggle" type="button">Hide panels</button> |
70 | 106 |
|
71 | 107 | <script src="https://cdn.jsdelivr.net/gh/gjrichter/ixmaps-flat@master/ixmaps.js"></script> |
72 | 108 | <script> |
@@ -214,6 +250,13 @@ <h4 id="dir-legend-title">Direction</h4> |
214 | 250 | update(false); |
215 | 251 | }, 130)); |
216 | 252 |
|
| 253 | +// phone-only panel toggle |
| 254 | +var uiToggle = document.getElementById("ui-toggle"); |
| 255 | +uiToggle.addEventListener("click", function(){ |
| 256 | + var off = document.body.classList.toggle("panels-off"); |
| 257 | + uiToggle.textContent = off ? "Show panels" : "Hide panels"; |
| 258 | +}); |
| 259 | + |
217 | 260 | // init |
218 | 261 | NSV = nsvFromSlider(+slider.value); |
219 | 262 | refreshReadout(); |
|
0 commit comments