Skip to content

Commit f0a0201

Browse files
committed
Merge
2 parents ca148b8 + cf7535b commit f0a0201

File tree

7 files changed

+75
-99
lines changed

7 files changed

+75
-99
lines changed

_config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ subtitle: Where the coders belong
44
email: info@dvcoders.com
55
description: DVCoders club website
66
baseurl: "" # the subpath of your site, e.g. /blog/
7-
url: "http://dvcoders.com" # the base hostname & protocol for your site
7+
url: "https://dvcoders.com" # the base hostname & protocol for your site
88
twitter_username: dvcoders
99
github_username: dvcoders
10+
# facebook_username :
1011
footer_note: dvcoders 2015
1112
collections:
1213
- projects

_sass/_base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url(http://fonts.googleapis.com/css?family=Raleway:400,300,100);
1+
@import url(https://fonts.googleapis.com/css?family=Raleway:400,300,100);
22

33
/**
44
* Reset some basic elements

_sass/_vtimeline.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ Modules - reusable parts of our design
9494
margin-left: -12px;
9595
margin-top: -12px;
9696
}
97-
.cd-timeline-img.cd-picture {
97+
.cd-timeline-block:nth-child(3n+0) .cd-timeline-img{
9898
background: #75ce66;
9999
}
100-
.cd-timeline-img.cd-movie {
100+
.cd-timeline-block:nth-child(3n+1) .cd-timeline-img{
101101
background: #c03b44;
102102
}
103-
.cd-timeline-img.cd-location {
103+
.cd-timeline-block:nth-child(3n+2) .cd-timeline-img{
104104
background: #f0ca45;
105105
}
106106
@media only screen and (min-width: 1170px) {

event.html

Lines changed: 0 additions & 74 deletions
This file was deleted.

events.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
layout: page
3+
title: Events
4+
subtitle: Definitely not a waste of time
5+
permalink: /events/
6+
javascript: [jquery-1.11.2.min.js, modernizr.js, events.js]
7+
---
8+
<section id="cd-timeline" class="cd-container">
9+
10+
</section> <!-- cd-timeline -->

project.html renamed to projects.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
layout: page
3-
title: Project
3+
title: Projects
44
subtitle: Do a thing
5-
permalink: /project/
5+
permalink: /projects/
66
---
77

88
<div class="projects">

scripts/events.js

Lines changed: 57 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,58 @@
1-
jQuery(document).ready(function($){
2-
var $timeline_block = $('.cd-timeline-block');
3-
4-
//hide timeline blocks which are outside the viewport
5-
$timeline_block.each(function(){
6-
if($(this).offset().top > $(window).scrollTop()+$(window).height()*0.75) {
7-
$(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
8-
}
9-
});
10-
11-
//on scolling, show/animate timeline blocks when enter the viewport
12-
$(window).on('scroll', function(){
13-
$timeline_block.each(function(){
14-
if( $(this).offset().top <= $(window).scrollTop()+$(window).height()*0.75 && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) {
15-
$(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
16-
}
17-
});
18-
});
1+
$(document).ready(function($) {
2+
$.ajax({
3+
url: 'https://api.dvcoders.com/events?start=' + Date.now(),
4+
method: 'GET',
5+
success: function(data) {
6+
var results = data.result;
7+
8+
var newHtml;
9+
results.forEach(function(result) {
10+
newHtml =
11+
'<div class="cd-timeline-block">' +
12+
'<div class="cd-timeline-img"></div>' +
13+
'<div class="cd-timeline-content">' +
14+
'<h2>' + result.title + '</h2>' +
15+
'<p>' + result.location + '</p>' +
16+
'<p>' + result.description + '</p>' +
17+
'<span class="cd-date">' + formatDate(result.start, result.end) + '</span>' +
18+
'</div>' +
19+
'</div>';
20+
$('#cd-timeline').append(newHtml);
21+
});
22+
23+
var timeline_block = $('.cd-timeline-block');
24+
25+
//hide timeline blocks which are outside the viewport
26+
timeline_block.each(function() {
27+
if ($(this).offset().top > $(window).scrollTop() + $(window).height() * 0.75) {
28+
$(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
29+
}
30+
});
31+
32+
//on scolling, show/animate timeline blocks when enter the viewport
33+
$(window).on('scroll', function() {
34+
timeline_block.each(function() {
35+
if ($(this).offset().top <= $(window).scrollTop() + $(window).height() * 0.75 && $(this).find('.cd-timeline-img').hasClass('is-hidden')) {
36+
$(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
37+
}
38+
});
39+
});
40+
41+
42+
function formatDate(startMillis, endMillis) {
43+
var formatted;
44+
var start = new Date(startMillis);
45+
var end = new Date(endMillis);
46+
47+
formatted = start.toDateString().substring(4, 10) + " "; // Include only the month and date
48+
formatted += start.toTimeString().substring(0, 5) + " - "; // Include only the hours:minutes
49+
if (end.getDate() > start.getDate()) { // If it ends on a different day, include the day
50+
formatted += end.toDateString().substring(4, 10) + " ";
51+
}
52+
formatted += end.toTimeString().substring(0, 5);
53+
54+
return formatted;
55+
}
56+
}
57+
});
1958
});

0 commit comments

Comments
 (0)