1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
<!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>
|