|
|
| (9 intermediate revisions by the same user not shown) |
| Line 2: |
Line 2: |
|
| |
|
| {{#tag:html| | | {{#tag:html| |
| <div id="ageDisclaimerOverlay" class="age-overlay">
| | <script src="https://www.gamebrew.org/images/misc/assets/js/Disclaimer.js"></script> |
| <div class="age-blur"></div> | | <script src="https://www.gamebrew.org/images/misc/assets/js/common.js"></script> |
| <div class="age-popup slide-down">
| |
| <h2>You must be 18+ to view this content</h2>
| |
| <p>This page may contain content intended for mature audiences only.<br>Please confirm that you are 18 years of age or older.</p>
| |
| <div class="btn-group">
| |
| <button id="acceptDisclaimer">I am 18 or older</button>
| |
| <button id="declineDisclaimer">Leave this page</button>
| |
| </div>
| |
| </div>
| |
| </div> | |
| | |
| <script> | |
| function setCookie(name, value, days) {
| |
| const expires = new Date(Date.now() + days * 864e5).toUTCString();
| |
| document.cookie = name + '=' + encodeURIComponent(value) + '; expires=' + expires + '; path=/';
| |
| }
| |
| | |
| function getCookie(name) {
| |
| return document.cookie.split('; ').reduce((r, v) => {
| |
| const parts = v.split('=');
| |
| return parts[0] === name ? decodeURIComponent(parts[1]) : r
| |
| }, '');
| |
| }
| |
| | |
| document.addEventListener("DOMContentLoaded", function () {
| |
| const overlay = document.getElementById("ageDisclaimerOverlay");
| |
| const body = document.body;
| |
| | |
| if (getCookie("ageConfirmed") !== "true") {
| |
| overlay.style.display = "flex";
| |
| body.style.overflow = "hidden";
| |
| requestAnimationFrame(() => {
| |
| document.querySelector(".age-popup").classList.add("slide-active");
| |
| });
| |
| }
| |
| | |
| document.getElementById("acceptDisclaimer").addEventListener("click", function () {
| |
| setCookie("ageConfirmed", "true", 30);
| |
| overlay.style.display = "none";
| |
| body.style.overflow = "";
| |
| });
| |
| | |
| document.getElementById("declineDisclaimer").addEventListener("click", function () {
| |
| window.location.href = "/wiki/Main_Page"; // Customize if needed
| |
| });
| |
| });
| |
| </script> | |
| }} | | }} |