Commit 757b25a4 by Jason Williams

Adding index.html

parent 813e324a
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="https://fonts.googleapis.com/css?family=Lora" rel="stylesheet">
<style type="text/css">
* {margin: 0; padding: 0; border: 0;}
html {font-family: 'Lora', serif;}
h1 {font-weight: normal; text-align: center; font-size: 8vh;}
p {text-align: center; font-size: 2vh;}
a, a:visited {color: #06C;}
a:hover {color: #B83C00;}
p#preamble {margin-top: 42.5vh;}
p#randoms {margin-top: 3vh;}
p#smallprint {display: none; position: fixed; bottom: 1vh; left: 1vh; color: #888;}
p#edit {position: fixed; top: 1vh; right: 1vh; font-size: 1.5vh;}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">
var data = {};
var peopleCount = 0;
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
$(function() {
google.script.run.withSuccessHandler(function(v) {
data = JSON.parse(v);
peopleCount = data.people.length;
if (Math.floor((today % 1.2096e9) / 8.64e7) > 0) {
$('h1#decider').html("Nobody*");
daysuntil = 14 - Math.floor((today % 1.2096e9) / 8.64e7);
if (daysuntil == 1) $('span#countdown').html('1 day');
else $('span#countdown').html(daysuntil + ' days');
$('span#nextdecider').html(data.people[Math.floor((today.valueOf() + (daysuntil * 8.64e7))/1.2096e9 % peopleCount)]);
$('p#smallprint').show();
} else $('h1#decider').html(data.people[Math.floor(today/1.2096e9) % peopleCount]);
}).getJSONData();
$('a#rotationperson').click(function(e) {
e.preventDefault();
$('p#preamble').html('Today\'s Lunch Location Decider:');
if (Math.floor((today % 1.2096e9) / 8.64e7) > 0) {
$('h1#decider').html("Nobody*");
daysuntil = 14 - Math.floor((today % 1.2096e9) / 8.64e7);
if (daysuntil == 1) $('span#countdown').html('1 day');
else $('span#countdown').html(daysuntil + ' days');
$('span#nextdecider').html(data.people[Math.floor((today.valueOf() + (daysuntil * 8.64e7))/1.2096e9 % peopleCount)]);
$('p#smallprint').show();
} else $('h1#decider').html(data.people[Math.floor(today/1.2096e9) % peopleCount]);
});
$('a#randomperson').click(function(e) {
e.preventDefault();
$('p#smallprint').hide();
$('p#preamble').html('A Randomly Selected Decider:');
$('h1#decider').html(data.people[Math.floor(Math.random() * peopleCount)]);
});
$('a#randomrestaurant').click(function(e) {
e.preventDefault();
$('p#smallprint').hide();
$('p#preamble').html('A Randomly Selected Eatery:');
$('h1#decider').html(data.places[Math.floor(Math.random() * data.places.length)]);
});
});
</script>
</head>
<body>
<p id="preamble">Today's Lunch Location Decider:</p>
<h1 id="decider">Loading...</h1>
<p id="randoms"><a id="rotationperson" href="#">Use the Normal Rotation</a> | <a id="randomperson" href="#">Pick a Random Person</a> | <a id="randomrestaurant" href="#">Pick a Random Restaurant</a></p>
<p id="smallprint">* Today is not a team lunch day. In <span id="countdown"></span> <span id="nextdecider"></span> will be deciding.</p>
<p id="edit"><a href="https://drive.google.com/open?id=1gTOzek6wmNtGG6AzNKNzLYo8oXh_aStQ4CLsIx-OwJs">Edit People &amp; Places</a></p>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment