-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathscript.js
40 lines (36 loc) · 1.29 KB
/
script.js
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
function activeScrollpy() {
$('body').scrollspy({
target: ".navbar"
})
}
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function setCard(num, response) {
$(".meetup-link").eq(num).attr("href", response.data[num].link);
$(".caption h3").eq(num).text(response.data[num].name);
$(".caption h4").eq(num).text(response.data[num].venue.name);
$(".caption h5").eq(num).text(response.data[num].venue.address_1);
$(".caption h6").eq(num).text(capitalizeFirstLetter(moment(response.data[num].time).format("dddd, D MMMM, hh:mmA")));
if (response.data[num].venue.name === "EkoSpace") {
$(".thumbnail img").eq(num).attr("src", "./dist/img/ekospace.svg");
} else if (response.data[num].venue.name === "Nuevo AreaTres") {
$(".thumbnail img").eq(num).attr("src", "./dist/img/areatres.svg");
}
}
function nextMeetups() {
$.ajax({
type: "GET",
url: "https://api.meetup.com/FreeCodeCampBA/events?photo-host=public&page=2&sig_id=471f4512414422381c386239397b703d",
data: "data",
dataType: "jsonp",
success: function(response) {
setCard(0, response);
setCard(1, response);
}
});
}
$(function() {
activeScrollpy();
nextMeetups();
});