| <!DOCTYPE html> |
| <html style="overflow: hidden;"> |
| <head> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <style> |
| body, html { |
| margin: 0; |
| background-color: #EFEFEF; |
| font-family: system-ui; |
| } |
| |
| body { |
| height: 3000px; |
| } |
| |
| button { |
| padding: 6px; |
| border-radius: 6px; |
| appearance: none; |
| white-space: normal; |
| width: auto; |
| margin: 4px; |
| border: none; |
| font-size: 1em; |
| cursor: pointer; |
| color: rgb(76, 217, 100); |
| background-color: rgba(76, 217, 100, 0.1); |
| } |
| |
| #fixed { |
| width: 300px; |
| height: 300px; |
| top: calc(50% - 150px); |
| left: calc(50% - 150px); |
| position: fixed; |
| background-color: white; |
| border-radius: 8px; |
| padding: 16px; |
| z-index: 1001; |
| font-size: 14px; |
| } |
| |
| #overlay { |
| position: fixed; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| z-index: 1000; |
| background-color: rgba(100, 100, 100, 0.5); |
| } |
| |
| #content { |
| width: 200px; |
| border: 1px solid black; |
| margin: 0; |
| box-sizing: border-box; |
| } |
| </style> |
| <script> |
| if (window.internals) |
| internals.overrideModalContainerSearchTermForTesting("hello world"); |
| </script> |
| </head> |
| <body style="overflow: hidden;"> |
| <p id="content">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p> |
| <div id="overlay"></div> |
| <div id="fixed"> |
| <p>Hello world</p> |
| <button id="button">Yes</button> |
| </div> |
| <script> |
| button.addEventListener("click", () => { |
| document.body.style.removeProperty("overflow"); |
| document.documentElement.style.removeProperty("overflow"); |
| fixed.remove(); |
| overlay.remove(); |
| }); |
| </script> |
| </body> |
| </html> |