-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
136 lines (122 loc) · 3.19 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/*
* Get this filename with a timestamp on the end, creating the file
* if it doesn't exist. This prevents caching problems.
*/
function get_time_filename($filename) {
if (!file_exists($filename)) {
throw new Exception('File does not exist [' . $filename . ']');
}
$timestamp = filemtime($filename);
$time_filename = pathinfo($filename, PATHINFO_FILENAME) . '_' . $timestamp .
'.' . pathinfo($filename, PATHINFO_EXTENSION);
// Create the file if it doesn't exist.
if (!file_exists($time_filename)) {
copy($filename, $time_filename);
}
return $time_filename;
}
$indexjs_filename = get_time_filename('index.js');
$json = file_get_contents('deadlines.json');
?>
<head>
<title>ICS Deadlines</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Share+Tech+Mono" rel="stylesheet">
<style>
* {
box-sizing: border-box;
}
html {
font-family: 'Open Sans', sans-serif;
}
a {
text-decoration: none;
color: #08f;
}
.box {
padding: 5px;
overflow: auto;
border-top: solid 2px #fff;
max-width: 600px;
font-size: 0.9em;
}
.today {
background-color: #6d6;
}
.weekend {
background-color: #cfc;
}
.due {
background-color: #f4f4f4;
}
.duenow {
background-color: #fc8;
}
.overdue {
background-color: #fbb;
}
.left {
font-family: 'Share Tech Mono', monospace;
}
.left > div {
display: inline-block;
padding: 3px; /* The font has very little padding. */
}
.deadlineLeft {
font-family: 'Share Tech Mono', monospace;
float: left;
padding: 3px 0; /* The font has very little padding. */
width: 110px;
text-align: center;
}
.deadlineRight {
margin-left: 110px;
}
#disclaimer {
font-size: 0.8em;
margin-bottom: 20px;
}
#made {
font-size: 0.8em;
margin-top: 50px;
}
#made > span {
display: inline-block;
display: none;
position: relative;
top: -12px;
width: 0;
font-size: 0.5em;
}
.notice {
font-size: 0.8em;
font-weight: bold;
margin-bottom: 20px;
}
@media (min-width:768px) {
.left {
float: left;
width: 80px;
}
.right {
margin-left: 80px;
}
}
</style>
</head>
<div id="disclaimer">Disclaimer: Do not trust this information under any circumstances.</div>
<div id="complier" class="notice">Prefer dark theme in your editors? Why not try <a href= "../deadline-dark">this</a>?</div>
<div id="main"></div>
<!--
<div id="complier" class="notice">The first four exercises for Complier Design don't have officially assigned deadlines, so their deadlines here are going to be the release date of the following exercise. <br/> Except Exercise 3 and 4. These ones you actually need to submit. </div>
-->
<div id="made">Made with love by JC and <span>mainly</span>Dave <3</div>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js"></script>
<script src="<?=$indexjs_filename?>"></script>
<script>
showDeadlines(<?=$json?>);
</script>