Last active
July 17, 2019 16:45
-
-
Save shelbyKiraM/1923b94e316abfdaa91a8be95e68ca1a to your computer and use it in GitHub Desktop.
Bot message for California law
This file contains 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
<?php if (preg_match('/bot.php/', $_SERVER['REQUEST_URI'])) : //hi | |
?><!DOCTYPE html><html><head><title>Bot message</title></head> | |
<body><br /><br /></div><?php endif; ?><script> | |
function loadStyle(href, callback){ | |
// avoid duplicates | |
for(var i = 0; i < document.styleSheets.length; i++){ | |
if(document.styleSheets[i].href == href){ | |
return; | |
} | |
} | |
var head = document.getElementsByTagName('head')[0]; | |
var link = document.createElement('link'); | |
link.rel = 'stylesheet'; | |
link.type = 'text/css'; | |
link.href = href; | |
if (callback) { link.onload = function() { callback() } } | |
head.appendChild(link); | |
} | |
loadStyle('https://cdn.jsdelivr.net/npm/hack-font@3/build/web/hack-subset.css'); | |
function hider(el) { | |
var element = document.getElementById('bot'); | |
element.className += ' hide'; | |
document.cookie='hidebot=1; expires=Sun, 1 Jan 2119 00:00:00 UTC; path=/' | |
} | |
</script> | |
<div onClick="hider(this);" class="bot<?php if($_COOKIE['hidebot'] == 1) echo ' hide'; ?>" id="bot"> | |
The contents of this site may be written by a bot!</div> | |
<style> | |
#bot { | |
color: #eee; | |
position: fixed; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
text-align: center; | |
font-size: 10px; | |
font: 2vw "Hack", monospace; | |
background-color: rgba(0, 0, 0, 0.75); | |
padding: 5vw; | |
} | |
.hide { display: none; } | |
@media (max-device-width: 420px) { | |
#bot { | |
font-size: 4vw; | |
} | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment