vendor files

This commit is contained in:
Serguei Bezverkhi
2018-01-09 13:57:14 -05:00
parent 558bc6c02a
commit 7b24313bd6
16547 changed files with 4527373 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta charset="utf-8">
<meta content="width=device-width" name="viewport">
<link href="style.css" rel="stylesheet">
<title>Guestbook</title>
</head>
<body>
<div id="header">
<h1>Guestbook</h1>
</div>
<div id="guestbook-entries">
<p>Waiting for database connection...</p>
</div>
<div>
<form id="guestbook-form">
<input autocomplete="off" id="guestbook-entry-content" type="text">
<a href="#" id="guestbook-submit">Submit</a>
</form>
</div>
<div>
<p><h2 id="guestbook-host-address"></h2></p>
<p><a href="env">/env</a>
<a href="info">/info</a></p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="script.js"></script>
</body>
</html>

View File

@ -0,0 +1,46 @@
$(document).ready(function() {
var headerTitleElement = $("#header h1");
var entriesElement = $("#guestbook-entries");
var formElement = $("#guestbook-form");
var submitElement = $("#guestbook-submit");
var entryContentElement = $("#guestbook-entry-content");
var hostAddressElement = $("#guestbook-host-address");
var appendGuestbookEntries = function(data) {
entriesElement.empty();
$.each(data, function(key, val) {
entriesElement.append("<p>" + val + "</p>");
});
}
var handleSubmission = function(e) {
e.preventDefault();
var entryValue = entryContentElement.val()
if (entryValue.length > 0) {
entriesElement.append("<p>...</p>");
$.getJSON("rpush/guestbook/" + entryValue, appendGuestbookEntries);
}
return false;
}
// colors = purple, blue, red, green, yellow
var colors = ["#549", "#18d", "#d31", "#2a4", "#db1"];
var randomColor = colors[Math.floor(5 * Math.random())];
(function setElementsColor(color) {
headerTitleElement.css("color", color);
entryContentElement.css("box-shadow", "inset 0 0 0 2px " + color);
submitElement.css("background-color", color);
})(randomColor);
submitElement.click(handleSubmission);
formElement.submit(handleSubmission);
hostAddressElement.append(document.URL);
// Poll every second.
(function fetchGuestbook() {
$.getJSON("lrange/guestbook").done(appendGuestbookEntries).always(
function() {
setTimeout(fetchGuestbook, 1000);
});
})();
});

View File

@ -0,0 +1,61 @@
body, input {
color: #123;
font-family: "Gill Sans", sans-serif;
}
div {
overflow: hidden;
padding: 1em 0;
position: relative;
text-align: center;
}
h1, h2, p, input, a {
font-weight: 300;
margin: 0;
}
h1 {
color: #BDB76B;
font-size: 3.5em;
}
h2 {
color: #999;
}
form {
margin: 0 auto;
max-width: 50em;
text-align: center;
}
input {
border: 0;
border-radius: 1000px;
box-shadow: inset 0 0 0 2px #BDB76B;
display: inline;
font-size: 1.5em;
margin-bottom: 1em;
outline: none;
padding: .5em 5%;
width: 55%;
}
form a {
background: #BDB76B;
border: 0;
border-radius: 1000px;
color: #FFF;
font-size: 1.25em;
font-weight: 400;
padding: .75em 2em;
text-decoration: none;
text-transform: uppercase;
white-space: normal;
}
p {
font-size: 1.5em;
line-height: 1.5;
}