Here, I made one for you:
Put this before </head>:
Code:
<style>
.gfy_tsd_hidden {
display: none;
}
#gfy_tsd_overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: gray;
z-index: 500;
opacity: 0.7;
overflow-y: hidden;
}
#gfy_tsd_modal_container {
background-color: white;
padding: 1rem 2rem;
top: 30%;
width: 70%;
position: relative;
margin: 0 auto;
border-radius: 5px;
box-shadow: 0px 0px 5px 5px #504d4d;
}
#gfy_tsd_modal_title {
margin-top: 5px;
font-weight: bold;
font-size: x-large;
color: black;
}
#gfy_tsd_modal_text {
margin-top: 10px;
font-size: normal;
}
#gfy_tsd_buttons_container {
margin-top: 15px;
display: flex;
flex-direction: row;
gap: 15px;
}
#gfy_tsd_buttons_container button {
padding: 1rem 2rem;
border: 0;
color: white;
}
#gfy_tsd_buttons_container button.accept {
background-color: green;
}
#gfy_tsd_buttons_container button.deny {
background-color: red;
}
</style>
And put this before </body>:
Code:
<div id="gfy_tsd_overlay" class="gfy_tsd_hidden">
<div id="gfy_tsd_modal_container">
<p id="gfy_tsd_modal_title">Agreement that you are over 18 years old</p>
<p id="gfy_tsd_modal_text">By clicking on the "I Agree" button, and by entering this website you agree with conditions and certify under penalty of perjury that you are an adult.</p>
<div id="gfy_tsd_buttons_container">
<button id="gfy_tsd_accept" class="accept" type="button">I Agree</button>
<button id="gfy_tsd_deny" class="deny" type="button">No</button>
</div>
</div>
</div>
<script>
(() => {
if (!localStorage.getItem('age_agg')) {
document.getElementById('gfy_tsd_overlay').classList.remove('gfy_tsd_hidden');
}
document.getElementById('gfy_tsd_accept').onclick = () => {
localStorage.setItem('age_agg', 'yes');
document.getElementById('gfy_tsd_overlay').classList.add('gfy_tsd_hidden');
}
document.getElementById('gfy_tsd_deny').onclick = () => {
window.location.href = 'google.com';
}
})();
</script>