Skip to content

Instantly share code, notes, and snippets.

@kilomeow
Created February 22, 2022 17:24
Show Gist options
  • Save kilomeow/40e5855a47b5e3a776124ba203bc9897 to your computer and use it in GitHub Desktop.
Save kilomeow/40e5855a47b5e3a776124ba203bc9897 to your computer and use it in GitHub Desktop.
<div id="adult-confirm">
<div class="blackout"></div>
<div class="popup">
<p>Нажимая на кнопку я подтверждаю что достиг_ла совершеннолетнего возраста</p>
<button onclick="adultConfirm()">Подтверждаю</button>
</div>
</div>
<script>
const adultConfirm = () => document.getElementById('adult-confirm').style.display = 'none'
</script>
<style>
#adult-confirm .blackout {
position: absolute;
left: 0;
top: 0;
margin: 0;
width: 100%;
height: 100%;
background-color: black;
opacity: 0.5;
pointer-events: none;
z-index: 100;
}
#adult-confirm .popup {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
max-width: 30em;
background-color: white;
border-radius: 0.5em;
z-index: 101;
}
#adult-confirm .popup > p {
font-weight: 500;
margin: 1em;
margin-bottom: 0;
}
#adult-confirm .popup > button {
float: right;
margin: 1em;
border: none;
border-radius: 0.25em;
color: white;
background-color: black;
font-size: 1em;
padding: 0.5em;
cursor: pointer;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment