Coookiiiiieeeesss

added a cookie that saves, if you have seen the menu animation before
This commit is contained in:
Jesse James Isler 2022-03-31 22:09:49 +02:00
parent c159ed0f65
commit 3dfaecca41
2 changed files with 112 additions and 1 deletions

71
cookies.php Normal file
View File

@ -0,0 +1,71 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TTT2 Role Overview</title>
<meta name="description" content="All TTT2 Roles halfheartedly documented">
<meta name="author" content="James">
<meta property="og:title" content="TTT2 Role Overview">
<meta property="og:type" content="website">
<meta property="og:url" content="https://ttt.james-things.com">
<meta property="og:description" content="All TTT2 Roles documented halfheartedly">
<meta property="og:image" content="https://e7.pngegg.com/pngimages/710/403/png-clipart-the-embodiment-of-scarlet-devil-team-shanghai-alice-video-game-banjo-tooie-mario-luigi-partners-in-time-marisa-logo-computer-wallpaper.png">
<link rel="icon" href="/favicon.ico">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<!--MATERIALIZE-->
<!--Import jQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<!--My Custom Stylesheet-->
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div class="container center_all_things">
<div class="row">
<div class="col s12">
<div class="blurry">
<div class="card red darken-5 white-text">
<div class="card-content">
<span class="card-title" id="accomplice">Cookie Information</span>
<p>The legal stuff I need to write.</p>
</div>
<ul class="collapsible black-text white">
<li class="active">
<div class="collapsible-header" tabindex="0"><i class="material-icons">help_outline</i>Cooookieeees....</div>
<div class="collapsible-body" style="display: block;">
<pre>
Look dude. I have to warn you that we use cookies.
Like we use one.
Literally the only cookie on this page (not even this, but the one before) is "loaded" and it has the value "true"
Also we already saved it on your device and deleted it as you clicked the button to get to this page... soooo... yeah..
Youre warned about cookies now.
Also if you are reading this on mobile and get triggered that this box is not "100% responsive", then... I dunno, just ignore it.
If you want to you can send me a ticket.
</pre>
</div>
</li>
</div>
</div>
</div>
</div>
</div>
<!--JavaScript at end of body for optimized loading-->
<script type="text/javascript" src="js/materialize.min.js"></script>
</body>
</html>

View File

@ -212,12 +212,52 @@
<!-- Start Tab init --> <!-- Start Tab init -->
<script> <script>
function setCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function closeToasts() {
setCookie('loading','true', 1);
M.Toast.dismissAll()
}
function openCookies() {
location.href = "https://ttt.james-things.com/cookies.php";
}
$(document).ready(function(){ $(document).ready(function(){
$('.collapsible').collapsible(); $('.collapsible').collapsible();
// $('.tabs').tabs(); // $('.tabs').tabs();
$('.sidenav').sidenav(); $('.sidenav').sidenav();
$('.tap-target').tapTarget(); $('.tap-target').tapTarget();
$('.tap-target').tapTarget('open');
// Only show the Menu informer once
var x = getCookie('loading');
if (x) {} else {
$('.tap-target').tapTarget('open');
// Cookie warn
M.toast({html: "By using my page you accept our cookies! <button class='btn-flat waves-effect waves-light toast-action' onclick='closeToasts()'>I don't care</button> <button onclick='openCookies()' class='btn-flat waves-effect waves-light toast-action''>What cookies?</button>", displayLength: "9999999999999999999999999999999"})
}
}); });
</script> </script>
<!-- End Tab init --> <!-- End Tab init -->