-
Notifications
You must be signed in to change notification settings - Fork 0
/
parallax.html
124 lines (118 loc) · 2.58 KB
/
parallax.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Scripted Pixels' Parrallax</title>
<style type="text/css">
/* setup the very basis for the document */
body {
text-align:center;
font-family:helvetica;
font-size: 16px;
background: #FA4E06;
padding-top: 50px;
}
a {
color: #f0f0f0;
text-decoration: none;
}
.container {
clear: both;
display: block;
margin: 0 auto;
width: 100%;
height: 9000px;
position: relative;
}
/* ANIMATIONS */
.object, .objectContainer a {
-webkit-transition: all 0.35s ease-in-out;
-moz-transition: all 0.35s ease-in-out;
-ms-transition: all 0.35s ease-in-out;
-o-transition: all 0.35s ease-in-out;
transition: all 0.35s ease-in-out;
}
.objectContainer {
width: 200px;
height: 200px;
display: block;
position: absolute;
top: 0;
left: 0;
}
.objectContainer .object {
display: block;
width: 100%;
height: 100%;
}
.objectContainer:hover .object {
margin: 2.5%;
height: 95%;
width: 95%;
border-radius: 100px;
-webkit-transform: rotate(100deg);
-moz-transform: rotate(100deg);
-ms-transform: rotate(100deg);
-o-transform: rotate(100deg);
transform: rotate(100deg);
}
.objectContainer a {
position: absolute;
bottom: -200px;
left: 0;
opacity: 0;
width: 100%;
line-height: 200px;
text-align: center;
vertical-align: middle;
}
.objectContainer:hover a {
opacity: 1;
bottom: 0;
}
/* LOCATIONS */
.objectContainer.first {
top: 200px;
left: 100px;
}
.objectContainer.second {
top: 600px;
left: 350px;
}
/* COLORS */
#red.object {
background: #e7222f;
}
#brown.object {
background: #796959;
}
#dGrey.object {
background: #363635;
}
#Grey.object {
background: #6f6f6e;
}
</style>
</head>
<body>
<div class="container">
<div class="objectContainer first">
<div id="red" class="object"></div>
<a href="#" >A link </a>
</div>
<div class="objectContainer second">
<div id="brown" class="object"></div>
<a href="#" >A link </a>
</div>
</div>
<!-- jQuery library (served from Google) -->
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/detectmobilebrowser.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<!-- TOUCH EVENTS -->
<script src="js/jquery.tappable.js"></script>
<script src="js/parallax.js"></script>
</body>
</html>