-
Notifications
You must be signed in to change notification settings - Fork 0
/
calendar.html
113 lines (99 loc) · 2.57 KB
/
calendar.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
<style>
.base {
margin: 0;
padding: 0;
width: 480px;
height: 100%;
background-color: #eee;
}
.container {
margin: 0 0rem;
}
.events {
margin: 1rem 2rem 0;
}
.container img {
width: 100%;
}
.container h1 {
font-size: 1.8em;
}
.container h2 {
font-size: 1.4em;
}
li, ul {
list-style: none;
margin: 0;
padding: 0;
}
li {
margin-bottom: 0.5em;
border-bottom: 1px solid grey;
padding-bottom: 0.5em;
font-weight: bold;
}
.right {
float: right;
}
body, html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
font-family: Verdana;
}
</style>
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="base">
<div class="container">
<img src="img/TAP Lab Black.png">
<div class="events">
<h1>Upcoming Events</h1>
<ul></ul>
</div>
</div>
<script src="js/ical.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/moment-with-locales.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax("https://api.meetup.com/taplab/events?photo-host=public&page=20&sig_id=214914845&sig=475f82fa5e574c2634c853f970f2555751d8c126", {
crossDomain: true,
dataType: 'jsonp',
headers: {
'Access-Control-Allow-Headers': 'x-requested-with'
}
}).done(function(response){
if (response.meta.status == 200) {
$.each(response.data, function(idx, activity) {
if (idx >= 5) return false;
var name = activity.name;
var start = moment(activity.time);
var finish = moment(activity.time + activity.duration);
var html = "<h2>" + name + "</h2><span>" + start.format("ddd, D MMM") + "</span>";
html += '<span class="right">' + start.format("ha")
if (finish.isValid()) {
html += " - " + finish.format("ha") ;
}
html += "</span>"
var node = $("<li>").html(html);
$('.events ul').append(node);
})
}
});
})
</script>
</body>
</html>