@@ -29,6 +29,8 @@ export default function MapGuessrModal({ isOpen, onClose }) {
2929 }
3030 } }
3131 animationDuration = { 300 }
32+ closeOnEsc = { true }
33+ closeOnOverlayClick = { false }
3234 >
3335 < div className = "mapguessr-container" >
3436 { /* Header with close button */ }
@@ -51,7 +53,8 @@ export default function MapGuessrModal({ isOpen, onClose }) {
5153 title = "MapGuessr"
5254 frameBorder = "0"
5355 allowFullScreen
54- allow = "geolocation; microphone; camera"
56+ allow = "geolocation; microphone; camera; fullscreen"
57+ sandbox = "allow-same-origin allow-scripts allow-popups allow-forms allow-modals allow-presentation"
5558 />
5659 </ div >
5760 </ div >
@@ -64,19 +67,21 @@ export default function MapGuessrModal({ isOpen, onClose }) {
6467 flex-direction: column;
6568 background: #000;
6669 position: relative;
70+ font-family: inherit;
6771 }
6872
6973 .mapguessr-header {
7074 display: flex;
7175 justify-content: space-between;
7276 align-items: center;
7377 padding: 15px 20px;
74- background: rgba(0, 0, 0, 0.9 );
78+ background: rgba(0, 0, 0, 0.95 );
7579 backdrop-filter: blur(10px);
7680 border-bottom: 1px solid rgba(255, 255, 255, 0.1);
7781 position: relative;
7882 z-index: 1000;
7983 min-height: 60px;
84+ flex-shrink: 0;
8085 }
8186
8287 .mapguessr-title {
@@ -85,6 +90,7 @@ export default function MapGuessrModal({ isOpen, onClose }) {
8590 font-size: 24px;
8691 font-weight: bold;
8792 text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
93+ font-family: inherit;
8894 }
8995
9096 .mapguessr-close-btn {
@@ -101,6 +107,8 @@ export default function MapGuessrModal({ isOpen, onClose }) {
101107 font-size: 18px;
102108 transition: all 0.3s ease;
103109 backdrop-filter: blur(10px);
110+ font-family: inherit;
111+ user-select: none;
104112 }
105113
106114 .mapguessr-close-btn:hover {
@@ -109,40 +117,59 @@ export default function MapGuessrModal({ isOpen, onClose }) {
109117 transform: scale(1.05);
110118 }
111119
120+ .mapguessr-close-btn:active {
121+ transform: scale(0.95);
122+ }
123+
112124 .mapguessr-iframe-container {
113125 flex: 1;
114126 width: 100%;
115- height: calc(100vh - 60px);
116127 position: relative;
117128 overflow: hidden;
129+ min-height: 0; /* Important for flex child */
118130 }
119131
120132 .mapguessr-iframe {
121133 width: 100%;
122134 height: 100%;
123135 border: none;
124136 display: block;
137+ background: #000;
125138 }
126139
127140 /* Mobile optimizations */
128141 @media (max-width: 768px) {
129142 .mapguessr-header {
130- padding: 10px 15px ;
131- min-height: 50px ;
143+ padding: 12px 16px ;
144+ min-height: 54px ;
132145 }
133146
134147 .mapguessr-title {
135148 font-size: 20px;
136149 }
137150
138151 .mapguessr-close-btn {
139- width: 35px ;
140- height: 35px ;
152+ width: 36px ;
153+ height: 36px ;
141154 font-size: 16px;
142155 }
156+ }
143157
144- .mapguessr-iframe-container {
145- height: calc(100vh - 50px);
158+ /* Small mobile screens */
159+ @media (max-width: 480px) {
160+ .mapguessr-header {
161+ padding: 10px 12px;
162+ min-height: 48px;
163+ }
164+
165+ .mapguessr-title {
166+ font-size: 18px;
167+ }
168+
169+ .mapguessr-close-btn {
170+ width: 32px;
171+ height: 32px;
172+ font-size: 14px;
146173 }
147174 }
148175
@@ -152,7 +179,7 @@ export default function MapGuessrModal({ isOpen, onClose }) {
152179 overflow: hidden;
153180 }
154181
155- /* Global modal styles */
182+ /* Global modal styles to prevent scrolling */
156183 :global(.mapguessr-modal) {
157184 overflow: hidden !important;
158185 }
@@ -162,10 +189,25 @@ export default function MapGuessrModal({ isOpen, onClose }) {
162189 padding: 0 !important;
163190 }
164191
165- /* Hide default scrollbars */
166- :global(body.ReactModal__Body--open ) {
192+ /* Prevent body scroll when modal is open */
193+ :global(body:has(.mapguessr-modal) ) {
167194 overflow: hidden;
168195 }
196+
197+ /* Handle iOS viewport issues */
198+ @supports (-webkit-touch-callout: none) {
199+ .mapguessr-container {
200+ height: 100vh;
201+ height: -webkit-fill-available;
202+ }
203+ }
204+
205+ /* Prevent zoom on iOS */
206+ @media screen and (-webkit-min-device-pixel-ratio: 0) {
207+ .mapguessr-iframe {
208+ -webkit-overflow-scrolling: touch;
209+ }
210+ }
169211 ` } </ style >
170212 </ Modal >
171213 ) ;
0 commit comments