-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
65 lines (62 loc) · 2.1 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
require_once 'EverySecond/EverySecond.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>EverySecond</title>
<meta name="keywords" content="every, second, timer, death" />
<meta name="description" content="This demo shows a simple timer that displays, according to WHO stats, how often someone dies." />
<meta name="author" content="Matthew Evans" />
<link rel="stylesheet" href="EverySecond/css/everysecond.css">
<!--[if lte IE 9]><link rel="stylesheet" href="EverySecond/css/everysecond-old.css"><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" href="EverySecond/css/everysecond-older.css"><![endif]-->
<link rel="stylesheet" href="demo.css">
</head>
<body>
<div class="container">
<h1>EverySecond</h1>
<?php
$everySecondGenerator = new EverySecond([
'id' => 'everySecond',
'title' => 'Every Second',
'dataFile' => 'data.json',
'per' => 'Y',
'transitionTime' => 0.2,
'showTime' => 2,
'restingCSS' => [
'transform' => 'translateY(0)',
'opacity' => 0.5
],
'showingCSS' => [
'transform' => 'translateY(-3px)',
'opacity' => 1,
'box-shadow' => '0 25px 50px -20px rgba(0,0,0,0.2)'
],
'template' =>'<div class="es-timer">
<a class="es-timer__body" style="animation: animation_<?=$id?> <?=round($delay, 2)?>s infinite; background: <?=$colour?>;" href="https://en.wikipedia.org/wiki/<?=$url?>" target="_blank">
<h2 class="es-timer__title">
<?=$title?>
</h2>
<div class="es-loading-bar es-timer__loading-bar" style="animation-duration: <?=round($delay, 2)?>s; animation-delay: <?=$showTimeDelay?>s;">
<div class="es-loading-bar__text">Every <?=round($delay, 2)?>s</div>
</div>
</a>
</div>'
]);
$everySecondGenerator->render([
'title' => 0,
'delay' => 1,
'colour' => 2,
'url' => 3
], true);
?>
</div>
<footer>
<p>Matthew Evans 2016.</p>
<p>*Data is NOT live - it is based off of information from the World Health Organisation.</p>
</footer>
</body>
</html>