-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearn_timeline.html
358 lines (289 loc) · 11.4 KB
/
learn_timeline.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
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<html>
<head>
<link type="text/css" rel="stylesheet" href="learn_timeline.css"/>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js"></script>
<!-- Parallex Scrolling functionality -->
<script>
$(document).ready(function(){
$("#arrow").hover(function(){
$(this).css('opacity', 1);
}, function() {
$(this).css('opacity', 0.5);
});
/* Smooth Scrolling */
$('a[href^="#"]').on('click',function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 900, 'swing', function () {
window.location.hash = target;
});
});
/* Handle parallax scrolling */
var originalTitleTopPos, originalArrowTopPos;
originalTitleTopPos = parseFloat($("#event-title").css('top'));
originalArrowTopPos = parseFloat($("#arrow").css('top'));
var parallax = function(scrolled) {
var newTitleTopPos, newArrowTopPos, titleOpacityPercent, arrowOpacityPercent;
newTitleTopPos = Math.max(originalTitleTopPos + (0.2 * scrolled), originalTitleTopPos);
newArrowTopPos = Math.max(originalArrowTopPos, originalArrowTopPos + (0.2 * scrolled));
titleOpacityPercent = 1 - (scrolled / 750);
arrowOpacityPercent = 0.5 - (scrolled / 750);
$("#event-title").css('top', newTitleTopPos + 'px');
$("#event-title").css('opacity', titleOpacityPercent);
$("#arrow").css('top', newArrowTopPos + 'px');
$("#arrow").css('opacity', arrowOpacityPercent);
}
var togglePicModal = function() {
var visibility, modal;
modal = $("#timeline-picture-modal");
visibility = (modal.css('visibility') == 'visible') ? 'hidden' :'visible';
$("#timeline-picture-modal").css('visibility', visibility);
}
var setUpModal = function(src, caption, profilePic) {
var mainImg, profileImg;
mainImg = $('<img src='+src+' />');
profileImg = $('<img src='+profilePic+' />')
$('#main-image').empty().append(mainImg);
$('#modal-info-panel #image-caption').empty().append(
caption);
$('#ifh-profile-pic').empty().append(profileImg);
togglePicModal();
}
$(window).scroll(function(e){
var scrolled = $(window).scrollTop();
parallax(scrolled);
});
$(".timeline-media-content").click(function(){
var src, caption, profilePic;
src = $(this).attr('src');
caption = $(this).parent().parent().find($(".timeline-text-content")).text();
profilePic = $(this).parent().parent().parent().find($(".timeline-profile-pic-badge")).find("img").attr('src');
setUpModal(src, caption, profilePic);
});
$("#close-timeline-modal").click(function(){
togglePicModal();
});
/* Help with responsiveness */
var addedProfilePic = false;
initializeForWindowSize();
$(window).bind("resize", resizeWindow);
function resizeWindow(e) {
var newWindowWidth = $(window).width();
if (newWindowWidth < 980) {
if (!addedProfilePic) {
addedProfilePic = true;
addProfilePic();
}
}
else {
if (addedProfilePic) {
removeProfilePic();
}
addedProfilePic = false;
}
}
function initializeForWindowSize() {
if ($(window).width() < 980) {
addedProfilePic = true;
addProfilePic();
}
}
function addProfilePic() {
$(".timeline-content-container header").each(function(index){
var newSection = $('<section class="profile-pic-container"></section>');
newSection.append($('<img class="profile-pic" src="images/wedding_photo_1.jpg" />'));
$(this).prepend(newSection);
});
}
function removeProfilePic() {
$(".timeline-content-container header").each(
function(){
$(this).children().first().remove();
});
}
jQuery(document).ready(function() {
//Open the menu
jQuery("#hamburger").click(function() {
//set the width of primary content container -> content should not scale while animating
var contentWidth = jQuery('#content').width();
//set the content with the width that it has originally
jQuery('#content').css('width', contentWidth);
//display a layer to disable clicking and scrolling on the content while menu is shown
jQuery('#contentLayer').css('display', 'block');
//disable all scrolling on mobile devices while menu is shown
jQuery('#mainContainer').bind('touchmove', function(e){e.preventDefault()});
//set margin for the whole container with a jquery UI animation
jQuery("#mainContainer").animate({"marginLeft": ["70%", 'easeOutExpo']}, {
duration: 700
});
});
//close the menu
jQuery("#contentLayer").click(function() {
//enable all scrolling on mobile devices when menu is closed
jQuery('#mainContainer').unbind('touchmove');
//set margin for the whole container back to original state with a jquery UI animation
jQuery("#mainContainer").animate({"marginLeft": ["0", 'easeOutExpo']}, {
duration: 700,
complete: function() {
jQuery('#content').css('width', 'auto');
jQuery('#contentLayer').css('display', 'none');
}
});
});
});
});
</script>
</head>
<body>
<div id="mainContainer">
<div id="hamburger">
<div></div>
<div></div>
<div></div>
</div>
<nav class="mobileNav">
<ul>
<li><a href="#">menuitem 1</a></li>
<li><a href="#">menuitem 2</a></li>
<li><a href="#">menuitem 3</a></li>
<li><a href="#">menuitem 4</a></li>
<li><a href="#">menuitem 5</a></li>
<li><a href="#">menuitem 6</a></li>
</ul>
</nav>
<div id="contentLayer"></div>
<div id="content">
<header id="cover-photo-container" data-type="cover_photo">
<section id="event-title">
<h1> The Proposal </h1>
</section>
<section id="arrow">
<span><a href="#container" ><img id="arrow-img" src="images/down_arrow.png"/></a></span>
</section>
</header>
<div id="container">
<ul class="timeline">
<li>
<article class="timeline-item-container ">
<div class="timeline-profile-pic-badge">
<img src="images/wedding_photo_1.jpg"/>
</div>
<div class="timeline-content-container">
<header>
<!-- <section class="profile-pic-container">
<img class="profile-pic" src="images/wedding_photo_1.jpg"/>
</section> -->
<section><strong> Moti Ogunshina </strong></section>
<section class="date-posted">Shared - May 4, 6:53 pm </section>
</header>
<section class="timeline-text-content">
Someone said something funny
</section>
<section class="timeline-media-container">
<img class="timeline-media-content" src="images/wedding_photo_2.jpg" alt="A posted content"/>
</section>
</div>
</article>
</li>
<li class="timeline-inverted">
<article class="timeline-item-container">
<div class="timeline-profile-pic-badge">
<img src="images/wedding_photo_1.jpg"/>
</div>
<div class="timeline-content-container">
<header>
<span><strong> Moti Ogunshina </strong></span>
<span class="date-posted">Shared - May 4, 6:53 pm </span>
</header>
<section class="timeline-text-content">
<span> Someone said something funny </span>
</section>
<section class="timeline-media-container"></section>
</div>
</article>
</li>
<li>
<article class="timeline-item-container ">
<div class="timeline-profile-pic-badge">
<img src="images/profile_pic.jpg"/>
</div>
<div class="timeline-content-container">
<header>
<!--<img class="profile-pic" src="profile_pic.jpg" alt="The poster's profile picture"/> -->
<span><strong> Moti Ogunshina </strong></span>
<span class="date-posted">Shared - May 4, 6:53 pm </span>
</header>
<section class="timeline-text-content"></section>
<section class="timeline-media-container">
<img class="timeline-media-content" src="images/wedding_photo_2.jpg" alt="A posted content"/>
</section>
</div>
</article>
</li>
<li class="timeline-inverted">
<article class="timeline-item-container ">
<div class="timeline-profile-pic-badge">
<img src="images/profile_pic.jpg"/>
</div>
<div class="timeline-content-container">
<header>
<!--<img class="profile-pic" src="profile_pic.jpg" alt="The poster's profile picture"/> -->
<span><strong> Moti Ogunshina </strong></span>
<span class="date-posted">Shared - May 4, 6:53 pm </span>
</header>
<section class="timeline-text-content"></section>
<section class="timeline-media-container">
<img class="timeline-media-content" src="images/wedding_photo_1.jpg" alt="A posted content"/>
</section>
</div>
</article>
</li>
<li>
<article class="timeline-item-container">
<div class="timeline-profile-pic-badge">
<img src="images/profile_pic.jpg"/>
</div>
<div class="timeline-content-container">
<header>
<span><strong> Moti Ogunshina </strong></span>
<span class="date-posted">Shared - May 4, 6:53 pm </span>
</header>
<section class="timeline-text-content"> Someone said something funny</section>
<section class="timeline-media-container">
</section>
</div>
</article>
</li>
<li class="clearfix" style="float: none;"></li>
</ul>
</div>
<!-- Modal for viewing picures -->
<div id="timeline-picture-modal">
<div id="modal-info-panel">
<div id="info-panel-heading">
<span id="ifh-profile-pic"><img src="images/profile_pic.jpg"/></span>
<div id="posting-info">
<section id="user-name"><strong>Moti Ogunshina</strong></section>
<section id="date-posted">Shared - May 4, 6:50pm</section>
</div>
</div>
<section id="image-caption">
Somebody said something funny
</section>
</div>
<div id="modal-image-panel">
<header>
<img id="close-timeline-modal" src="images/close_button.png"/>
</header>
<section id="main-image"></section>
</div>
</div>
</div>
</div>
</body>
</html>