|
2 | 2 | <html> |
3 | 3 | <head> |
4 | 4 | <meta charset="UTF-8" /> |
5 | | - <meta name="viewport" content="width=device-width,initial-scale=1" /> |
| 5 | + <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" /> |
6 | 6 | <link rel="stylesheet" href="options.build.css" /> |
7 | 7 | <script defer src="sidepanel.build.js"></script> |
8 | 8 | <style> |
|
157 | 157 | background-color: #a6e22e; |
158 | 158 | } |
159 | 159 | .hidden { display: none !important; } |
| 160 | + /* iOS Safari extension popup sizing. |
| 161 | + iPad: min-height added via JS for popover auto-sizer. |
| 162 | + iPhone: native half-sheet / full-sheet behavior. |
| 163 | + See: W3C WebExtensions #692, Apple Forums 670733, 698319, 697155. */ |
| 164 | + @media (pointer: coarse) and (hover: none) { |
| 165 | + .sidepanel-layout { |
| 166 | + height: 100%; |
| 167 | + } |
| 168 | + } |
160 | 169 | @media (prefers-reduced-motion: reduce) { |
161 | 170 | *, *::before, *::after { |
162 | 171 | animation-duration: 0.01ms !important; |
|
168 | 177 | </head> |
169 | 178 |
|
170 | 179 | <body> |
| 180 | + <script> |
| 181 | + // iOS Safari extension popup fixes. |
| 182 | + // iPad: popover — fix viewport width + add min-height for auto-sizer. |
| 183 | + // iPhone: sheet — set explicit pixel height so layout fills the sheet. |
| 184 | + // innerWidth > 500 distinguishes iPad (820px) from iPhone (375-430px). |
| 185 | + (function() { |
| 186 | + if (!window.matchMedia('(pointer: coarse) and (hover: none)').matches) return; |
| 187 | + if (window.innerWidth > 500) { |
| 188 | + // iPad: fix viewport scaling |
| 189 | + var vp = document.querySelector('meta[name="viewport"]'); |
| 190 | + if (vp) vp.setAttribute('content', 'width=380,initial-scale=1,shrink-to-fit=no'); |
| 191 | + // iPad popover needs min-height so Safari auto-sizer allocates enough space |
| 192 | + var s = document.createElement('style'); |
| 193 | + s.textContent = '.sidepanel-layout{min-height:580px}'; |
| 194 | + document.head.appendChild(s); |
| 195 | + } |
| 196 | + })(); |
| 197 | + |
| 198 | + // iOS: hide tab bar and locked footer when virtual keyboard is open. |
| 199 | + (function() { |
| 200 | + if (!window.visualViewport) return; |
| 201 | + var threshold = 0.75; |
| 202 | + window.visualViewport.addEventListener('resize', function() { |
| 203 | + var kbOpen = window.visualViewport.height < window.innerHeight * threshold; |
| 204 | + var tabs = document.querySelector('.sidepanel-tabs'); |
| 205 | + var footer = document.getElementById('locked-footer'); |
| 206 | + if (tabs) tabs.style.display = kbOpen ? 'none' : ''; |
| 207 | + if (footer) footer.style.display = kbOpen ? 'none' : ''; |
| 208 | + }); |
| 209 | + })(); |
| 210 | + </script> |
171 | 211 | <div class="sidepanel-layout"> |
172 | 212 | <!-- LOCKED STATE --> |
173 | 213 | <div id="locked-view" class="hidden" style="display:flex;flex-direction:column;height:100%;"> |
|
221 | 261 | </svg> |
222 | 262 | </button> |
223 | 263 | </div> |
224 | | - <label class="flex items-center gap-3 cursor-pointer" style="padding:4px 0;"> |
| 264 | + <label class="flex items-center justify-between cursor-pointer" style="padding:4px 0;"> |
| 265 | + <span style="color:#f8f8f2;font-size:14px;">Allow Nostr access while locked</span> |
225 | 266 | <span class="toggle-switch"> |
226 | 267 | <input id="nostr-access-toggle" type="checkbox" /> |
227 | 268 | <span class="toggle-slider"></span> |
228 | 269 | </span> |
229 | | - <span style="color:#f8f8f2;font-size:14px;">Allow Nostr access while locked</span> |
230 | 270 | </label> |
231 | 271 | <p id="nostr-access-status" style="color:#b0b0a8;font-size:0.8rem;margin-top:6px;line-height:1.4;"></p> |
232 | 272 | </div> |
233 | 273 | </div> |
234 | 274 | </div> |
235 | | - <div style="flex-shrink:0;padding:12px 16px;border-top:1px solid #49483e;background:#3e3d32;text-align:center;font-size:0.75rem;"> |
| 275 | + <div id="locked-footer" style="flex-shrink:0;padding:12px 16px;border-top:1px solid #49483e;background:#3e3d32;text-align:center;font-size:0.75rem;"> |
236 | 276 | <a id="footer-home-link" href="https://nostrkey.com" style="color:#b0b0a8;text-decoration:none;cursor:pointer;">NostrKey.com</a> |
237 | 277 | <span style="color:#49483e;margin:0 6px;">|</span> |
238 | 278 | <a id="footer-terms-link" href="https://nostrkey.com/terms.html" style="color:#b0b0a8;text-decoration:none;cursor:pointer;">Ts & Cs</a> |
@@ -515,18 +555,23 @@ <h2 class="section-title">Nostr Keys</h2> |
515 | 555 | <h2 class="section-title">Security</h2> |
516 | 556 | <button id="settings-security-btn" class="button w-full mb-2">Master Password</button> |
517 | 557 | <button id="settings-autolock-btn" class="button w-full">Auto-lock Settings</button> |
518 | | - <label class="flex items-center gap-3 cursor-pointer" style="padding:4px 0;margin-top:8px;"> |
519 | | - <input id="frame-protection-toggle" type="checkbox" |
520 | | - style="width:18px;height:18px;accent-color:#a6e22e;" /> |
| 558 | + <label class="flex items-center justify-between cursor-pointer" style="padding:4px 0;margin-top:8px;"> |
521 | 559 | <span style="color:#f8f8f2;font-size:14px;">Block cross-origin frames</span> |
| 560 | + <span class="toggle-switch"> |
| 561 | + <input id="frame-protection-toggle" type="checkbox" /> |
| 562 | + <span class="toggle-slider"></span> |
| 563 | + </span> |
522 | 564 | </label> |
523 | 565 | <p id="frame-protection-status" style="color:#b0b0a8;font-size:0.8rem;margin-top:4px;"></p> |
524 | 566 | </div> |
525 | 567 | <div class="section-card"> |
526 | 568 | <h2 class="section-title">Sync</h2> |
527 | | - <label class="flex items-center gap-3 cursor-pointer" style="padding:4px 0;"> |
528 | | - <input id="sync-toggle" type="checkbox" style="width:18px;height:18px;accent-color:#a6e22e;" /> |
| 569 | + <label class="flex items-center justify-between cursor-pointer" style="padding:4px 0;"> |
529 | 570 | <span style="color:#f8f8f2;font-size:14px;">Sync across devices</span> |
| 571 | + <span class="toggle-switch"> |
| 572 | + <input id="sync-toggle" type="checkbox" /> |
| 573 | + <span class="toggle-slider"></span> |
| 574 | + </span> |
530 | 575 | </label> |
531 | 576 | <p id="sync-status-text" style="color:#b0b0a8;font-size:0.8rem;margin-top:4px;"></p> |
532 | 577 | </div> |
|
0 commit comments