Skip to content

Instantly share code, notes, and snippets.

@acosonic
Created April 28, 2021 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acosonic/03df18ba00cbcda73616f530fa10e29c to your computer and use it in GitHub Desktop.
Save acosonic/03df18ba00cbcda73616f530fa10e29c to your computer and use it in GitHub Desktop.
Geopattern under construction generic PHP website based on https://github.com/erengy/under-construction meant to be used via wget in public_html folder
<html>
<head>
<title><?php echo($_SERVER['HTTP_HOST']);?></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script> <!-- optional -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/geopattern/1.2.3/js/geopattern.min.js"></script>
<style type="text/css">
html, body {
height: 100%;
}
body {
background-color: #fff;
background: radial-gradient(circle at center, #fff 0%, #f8f8f8 75%, #ebebeb 100%);
color: #222;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 1rem;
line-height: 1.5;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
main {
padding: 1.5rem;
text-align: center;
display:block;
border-radius: 1rem;
background-color: rgba(255,255,255,0.7);
}
h1 {
font-size: 2.5rem;
line-height: 1.1;
margin: 0;
}
@media screen and (max-width: 480px) {
h1 {
font-size: 1.5rem;
}
}
h1::after {
content: "";
background-color: #ffe800;
background: repeating-linear-gradient(45deg, #ffe800, #ffe800 0.5rem, #222 0.5rem, #222 1.0rem);
display: block;
height: 0.5rem;
margin-top: 1rem;
}
p {
margin: 1rem 0 0 0;
}
</style>
</head>
<body id="geopattern">
<main>
<h1><?php echo($_SERVER['HTTP_HOST']);?></h1>
<p>Our website is under construction.</p>
</main>
</body>
<script type="text/javascript">
$('#geopattern').geopattern('<?php echo(guidv4(openssl_random_pseudo_bytes(16))); ?>');
</script>
</html>
<?php
function guidv4($data)
{
assert(strlen($data) == 16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment