-
Notifications
You must be signed in to change notification settings - Fork 1
/
april-25th-bridge.html
195 lines (159 loc) · 6.7 KB
/
april-25th-bridge.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>April 25th Bridge | Eat & Travel</title>
<link rel="stylesheet" href="stylesheets/reveal.css">
<link rel="stylesheet" href="stylesheets/example.css" />
<link rel="stylesheet" href="stylesheets/pushy.css" />
<link rel="stylesheet" href="stylesheets/april_25th_bridge.css" />
<link rel="stylesheet" href="stylesheets/april_25th_bridge_animation.css" />
</head>
<body>
<!-- Pushy Menu -->
<nav class="pushy pushy-left">
<img src="images/eatntravel_white.png" alt="eatntravel" width="100" style="width:100px;margin:auto;" >
<p>
Eat & Travel is a restaurant in your town!
</p>
<a href="#" class="big-link" data-reveal-id="myModal">
Menu
</a>
</nav>
<!-- Site Overlay -->
<div class="site-overlay"></div>
<div class="container">
<!-- Menu Button -->
<div class="menu-btn" style="top:0px;">☰</div>
<div id="top_layer" class="scroll">
<div id="intro_title">
<img id="logo" src="images/eatntravel_white.png" alt="eatntravel_white" width="200">
<h1>April 25th Bridge</h1>
</div>
<div id="instructions">
<span id="arrow">»</span>
</div>
<div id="first_frame">
<ol id="bridge_still_frame_list" class="frame-list">
<li class="active"></li>
</ol>
</div>
<div id="second_frame" class="blackdrop">
<p>
This bridge was completed in 1966 and was originally named after the dictator Salazar. The name of the bridge was changed after the revolution of April 25, 1974. The bridge is often compared to the Golden Gate Bridge in San Francisco.
Upon completion, the bridge had the longest central span in Europe, and the deepest foundations in the world.
</p>
</div>
<div id="fourth_frame">
<ol id="bridge_marina_frame_list" class="frame-list">
<li class="active"></li>
</ol>
</div>
<div id="sixth_frame">
<ol id="bridge_sailboat_frame_list" class="frame-list">
<li class="active"></li>
</ol>
</div>
<div id="sixth_frame_text" class="blackdrop">
<p>
The large statue of Christ overlooking the Tagus was inspired by the similar statue in Rio de Janeiro.
The monument was built in 1959 as a thanks to God for Portugal having been spared during World War II.
</p>
</div>
<div id="conclusion" class="blackdrop">
<p>This is the end.</p>
</div>
</div>
<div id="middle_layer" class="scroll">
<div id="third_frame">
<img src="images/april_25th_bridge/web_IMG_5915.JPG" alt="IMG_5915" height="768">
</div>
<div id="seventh_frame">
<img src="images/april_25th_bridge/web_IMG_6438.JPG" alt="IMG_6438" height="768">
</div>
</div>
<div id="back_layer" class="scroll">
<div id="fifth_frame">
<img src="images/april_25th_bridge/web_IMG_5892.JPG" alt="IMG_5892" height="768">
</div>
</div>
</div>
<div id="myModal" class="reveal-modal">
<h1>Reveal Modal Goodness</h1>
<p>This is a default modal in all its glory, but any of the styles here can easily be changed in the CSS.</p>
<a class="close-reveal-modal">×</a>
</div>
<script type="text/javascript" src="javascripts/vendor/jquery.js"></script>
<script type="text/javascript" src="javascripts/vendor/modernizr-2.6.2.min.js"></script>
<script type="text/javascript" src="javascripts/vendor/jquery.jInvertScroll.js"></script>
<script type="text/javascript" src="javascripts/vendor/pushy.js"></script>
<script type="text/javascript" src="javascripts/vendor/jquery.reveal.js"></script>
<script type="text/javascript">
(function($) {
var frame_count = 169;
function create_frames(id, count)
{
var frameList = $(id);
for(var i = 0; i < frame_count; i++) { // the first <li> is already on the page
var li = $('<li/>')
.appendTo(frameList);
}
}
create_frames('#bridge_still_frame_list', 102);
create_frames('#bridge_marina_frame_list', 105);
create_frames('#bridge_sailboat_frame_list', 170);
var $win = $(window),
$currentFrames = $('.frame-list li'),
isFirefox = navigator.userAgent.match(/Firefox/) !== null;
var animationHandler = function() {
// quick fix to disable turn animation in Firefox
if ( isFirefox == false) {
//frameHandler();
}
};
//$(document).scroll(animationHandler); // don't need this because the jInvertScroll has it's own scroll event
$win.resize(animationHandler);
function activateNextFrame(currentFrameList, totalFrames, newFrameIndex){
if (newFrameIndex >= 0 && newFrameIndex < totalFrames) {
console.log(newFrameIndex);
var nextFrame = newFrameIndex;
currentFrameList
.removeClass('active')
.eq(nextFrame).addClass('active');
}
}
function frameHandler(percent) {
var w = percent * 1000;
var startAnimation = 0;
$('#intro_title').css('opacity', 100 - (percent * 200));
if (w < 188){
currentFrames = $('#bridge_still_frame_list li');
frame_count = 102;
} else if ((w > 238) && (w < 543)){
currentFrames = $('#bridge_marina_frame_list li');
frame_count = 105;
} else if (w > 600) {
currentFrames = $('#bridge_sailboat_frame_list li');
frame_count = 170;
}
var speed = 1.8;
var v = w / speed;
var choice = Math.ceil(v) - (Math.floor(Math.ceil(v)/frame_count)) * frame_count;
if (w < 188){
activateNextFrame(currentFrames, frame_count, choice);
} else if ((w > 238) && (w < 543)){
activateNextFrame(currentFrames, frame_count, choice);
} else if ((w > 600) && (w < 800)) {
activateNextFrame(currentFrames, frame_count, choice);
}
}
$.jInvertScroll(['.scroll','.menu-btn'], // an array containing the selector(s) for the elements you want to animate
{
height: 6000, // optional: define the height the user can scroll, otherwise the overall length will be taken as scrollable height
onScroll: frameHandler
});
$('.menu-btn').css('position','fixed'); // this needs to be applied after scrolling is applied, otherwise the btn races to the right
}(jQuery));
</script>
</body>
</html>