-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcustom.js
executable file
·229 lines (211 loc) · 7.08 KB
/
custom.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// Eventify, Responsive HTML5 Event Template - Version 1.1 //
// Javascripts //
$(document).ready(function () {
// Top Bar //
$('.top-bar nav').addClass('hidden');
$('.menu-link').on('click', function (
e) {
e.preventDefault();
$('.top-bar nav').toggleClass(
'hidden');
});
$(window).scroll(function () {
if ($(window).scrollTop() <= 50) {
$('.top-bar').removeClass('alt')
} else {
$('.top-bar').addClass('alt')
}
});
$(window).load(function () {
if ($(window).scrollTop() <= 30) {
$('.top-bar').removeClass('alt')
} else {
$('.top-bar').addClass('alt')
}
});
//
$('#mainnav .nav a').click(function (e) {
e.preventDefault();
var des = $(this).attr('href');
if ($('.navbar').hasClass(
'in')) {
$('.navbar .btn-navbar').trigger(
'click');
}
goToSectionID(des);
})
// Local Scroll //
$('#mainnav li').localScroll({
duration: 1000
});
$('.logo').localScroll({
duration: 1000
});
// One Page Nav //
$('.top-bar').onePageNav({
currentClass: 'current',
filter: ':not(.external)'
});
// Calculate the viewport height //
var viewHeight = $(window).height();
$("#intro").css({
'height': viewHeight
});
$(window).on('resize', function () {
var viewHeight = $(window).height();
$("#intro").css({
'height': viewHeight
});
});
// Flexslider
// Can also be used with $(document).ready()
$('.flexslider').flexslider({
animation: "slide"
});
// Tabs //
$('#schedule-tabs a').click(function (e) {
e.preventDefault();
$(this).tab('show');
})
// Tooltip //
$("[rel=tooltip]").tooltip();
$("[data-rel=tooltip]").tooltip();
//.parallax(xPosition, speedFactor, outerHeight) options:
//xPosition - Horizontal position of the element
//inertia - speed to move relative to vertical scroll. Example: 0.1 is one tenth the speed of scrolling, 2 is twice the speed of scrolling
//outerHeight (true/false) - Whether or not jQuery should use it's outerHeight option to determine when a section is in the viewport
$('#intro').parallax("50%", 0.1);
$('#venue').parallax("50%", 0.02);
// Carousel //
$(".speakers-carousel").carousel({
dispItems: 1,
direction: "horizontal",
pagination: false,
loop: false,
autoSlide: false,
autoSlideInterval: 5000,
delayAutoSlide: 2000,
effect: "slide",
animSpeed: "slow"
});
// Toggle //
$('.toggle-item-title').click(function () {
$(this).next().slideToggle();
$(this).toggleClass(
'ui-state-active');
});
// Countdown //
$('#countdown').countdown({
until: new Date(2015, 10 - 1, 22), // new Date(year, mth - 1, day, hr, min, sec) - date/time to count down to
// or numeric for seconds offset, or string for unit offset(s):
// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
// until: '-1m +1d', for demo
timezone: -4, // The timezone (hours or minutes from GMT) for the target times, or null for client local
layout: '{d<}<div class="span3"><div class="digit-container">{dn}<span class="label-container">{dl}</span></div></div>{d>}{h<}<div class="span3"><div class="digit-container">{hn}<span class="label-container">{hl}</span></div></div>{h>}{m<}<div class="span3"><div class="digit-container">{mn}<span class="label-container">{ml}</span></div></div>{m>}{s<}<div class="span3"><div class="digit-container">{sn}<span class="label-container">{sl}</span></div></div>{s>}',
timeSeparator: '', // Separator for time periods
isRTL: false, // True for right-to-left languages, false for left-to-right
format: 'dHMS', // Format for display - upper case for always, lower case only if non-zero,
// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
alwaysExpire: true, // True to trigger onExpiry even if never counted down
onExpiry: liftOff // Callback when the countdown expires -
// receives no parameters and 'this' is the containing division
});
// Functions if countdown timer runs out:
function liftOff() {
$('.hasCountdown').css({
display: 'none'
});
$('#countdown').addClass('hidden');
$('#register-button').addClass('hidden');
$('.register-title').addClass('hidden');
$('.register-box').append('<h2>We are at capacity and can no longer accept registrations.</h2>');
$('.register-box').append('<button class="btn btn-large btn-primary disabled" disabled="true" id="register-button">Sold Out</button>');
}
// Twitter Feed //
$('.tweet').twittie({
dateFormat: '%B %d, %Y',
template: '<div class="date">{{date}}</div> {{tweet}}',
count: 3, // define the number of tweets to be displayed, if it's one, read the lines below
hideReplies: true
});
// if you want to display only one tweet, please remove the following lines:
// if so, don't forget you need to change style.css line 1036 display property to display: block;
setInterval(function () {
var item = $('.tweet ul').find('li:first');
item.animate({
'opacity': '0'
}, 1000, function () {
$(this).detach().appendTo('.tweet ul').removeAttr('style');
});
}, 12000);
// Contact Form //
$('#contactform').validationEngine();
// send the form by ajax when sumbitted
$('#contactform').submit(function(e){
e.preventDefault();
var submitUrl = $(this).attr('action');
$.ajax({
url: submitUrl,
type: 'POST',
data: $(this).serialize(),
dataType: "json",
beforeSend: function () {
$('#submit').attr('disabled', 'disabled');
$('#ErrorMsgs').fadeOut('slow').html('<div class="alert alert-info">Checking...<a href="#" class="close">×</a></div>').fadeIn('slow');
},
success: function(data) {
if(data.status === 'success'){
$('#contactform')[0].reset();
}
$('#ErrorMsgs').html(data.message).fadeIn('slow');
$('#submit').removeAttr('disabled');
}
});
return false;
});
// Google Map //
$('#map_canvas').gmap({
'center': new google.maps.LatLng(46.2094934, 6.1354851), // Change this to your desired latitude and longitude
'zoom': 17,
'mapTypeControl': false,
'navigationControl': false,
'streetViewControl': false,
'styles': [{
stylers: [{
gamma: 0.60
}, {
hue: "#5DBEB2"
}, {
invert_lightness: false
}, {
lightness: 2
}, {
saturation: -20
}, {
visibility: "on"
}]
}]
});
var image = {
url: '/templates/tf/images/marker.png', // Define the map marker file here
// This marker is 51 pixels wide by 63 pixels tall.
size: new google.maps.Size(51, 63),
// The origin for this image is 0,0.
origin: new google.maps.Point(0, 0),
// The anchor for this image is the base of the flagpole at 26,63.
anchor: new google.maps.Point(26, 63)
};
$('#map_canvas').gmap().bind('init', function () {
$('#map_canvas').gmap('addMarker', {
'id': 'marker-1',
'position': '46.2094934, 6.1354851',
'bounds': false,
'icon': image
}).click(function () {
$('#map_canvas').gmap('openInfoWindow', {
'content': '<h4>Soft-Shake</h4><p><strong>@HEPIA</strong><br>Rue de la Prairie 4, 1202 Genève</p>'
}, this);
});
});
// end
})