Created
July 28, 2016 09:38
-
-
Save mohammedhanine/485d1158120f27dccc823ae9cfc56dd2 to your computer and use it in GitHub Desktop.
Cookie Console Prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Bootstrap 101 Template</title> | |
<style> | |
/* - cookies-notify */ | |
.cookies-console{ | |
direction:ltr; | |
position: fixed; | |
left: auto; | |
right: 0; | |
bottom: 0; | |
z-index: 1001; | |
padding: 15px 5px 15px 5px; | |
height: auto; | |
opacity: 1; | |
max-width: 380px; | |
min-height: 110px; | |
background: #000; | |
color: #ccc; | |
font: 12px/1.2 Menlo, Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;; | |
} | |
.cookies-console a{ | |
color: inherit; | |
text-decoration: underline; | |
} | |
.cookies-console input{ | |
color: inherit !important; | |
background: inherit !important; | |
border: 0 !important; | |
display: inline !important; | |
width: inherit !important; | |
padding: 0 !important; | |
box-shadow: inherit !important; | |
} | |
.console-error{ | |
color: #C30606; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="cookies-console" style="display:none"> | |
<p>Cookies help us improve our web content and deliver personalised content. By using this web site, you agree to our use of cookies.</p> | |
<p>Type `man cookies' to <a href="/privacy/">learn more</a> or `exit' to close.</p> | |
<div class="console-alert"></div> | |
<p class="console-prompt">root# <input type="text" value=""/></p> | |
</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.2/js.cookie.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready( function() { | |
$('.cookies-console').click(function() { | |
$( ".cookies-console input" ).focus(); | |
}); | |
$('.cookies-console input').keypress(function (e) { | |
if (e.which == 13 && !e.shiftKey) { | |
if($(this).val().toLowerCase()=='exit'){ | |
$('.cookies-console').fadeOut('slow'); | |
Cookies.set('eucookie',1 ); | |
$(this).val(''); | |
} else if ($(this).val().toLowerCase()=='man cookies'){ | |
$(location).attr("href", '/privacy/'); | |
}else{ | |
$('.console-alert').html('<p>root# '+$(this).val()+'</p><p class="console-error">bash: '+$(this).val()+': Command not found</p>') | |
$(this).val(''); | |
} | |
return false; | |
} | |
}); | |
if (!Cookies.get('eucookie')) { | |
$('.cookies-console').show('slow'); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment