Added an age gate:

main
NA 2023-12-04 14:59:43 +00:00
parent 00f8b78ead
commit 320ee8caa0
10 changed files with 114 additions and 6 deletions

View File

@ -19,6 +19,15 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="container">

View File

@ -17,6 +17,15 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="container">

View File

@ -17,7 +17,15 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="container">

View File

@ -26,6 +26,35 @@ body {
padding-bottom: 10px;
}
#age_gate_blur {
display: none; /* Set to display: flex; when visible */
z-index: 999;
position: fixed;
height: 100vh;
width: 100vw;
justify-content: center;
align-items: center;
background-color: rgba(0, 0, 0, 0.61);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
#age_gate_blur div {
justify-content: center;
text-align: center;
padding: 10px;
border: 2px solid;
background-color: rgb(169, 85, 238);
}
#age_gate_blur div button {
margin-top: 5px;
font-size: large;
}
/* Start of background shit */
.mobile_background {

View File

@ -17,7 +17,15 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="container">

View File

@ -18,7 +18,15 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="gallery_overlay" id="gallery_overlay">

View File

@ -17,8 +17,17 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="container">
<div style="text-align: center;">

12
js/age_gate_blur.js Normal file
View File

@ -0,0 +1,12 @@
const should_display_age_gate = localStorage.getItem("should_display_age_gate");
if (should_display_age_gate != "false") {
let age_gate = document.getElementById("age_gate_blur");
age_gate.style.display = "flex";
}
function hide_age_gate() {
localStorage.setItem("should_display_age_gate", "false");
let age_gate = document.getElementById("age_gate_blur");
age_gate.style.display = "none";
}

View File

@ -17,7 +17,15 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="container">

View File

@ -17,7 +17,15 @@
<body>
<div class="mobile_background"></div>
<div id="age_gate_blur">
<div>
<h2>This website contains pornography:</h2>
<button onclick="hide_age_gate()">I am 18+</button>
<br>
<a href="https://google.com"><button>Get me outta here:</button></a>
</div>
<script src="/js/age_gate_blur.js" type="text/javascript"></script>
</div>
<iframe src="/templates/header.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>
<div class="container"></div>