-
Notifications
You must be signed in to change notification settings - Fork 0
/
shadowMove.html
145 lines (135 loc) · 3.57 KB
/
shadowMove.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
<!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' Shadow movement</title>
<style type="text/css">
/* setup the very basis for the document */
body {
text-align:center;
font-family:'Helvetica Neue';
font-weight: lighter;
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, .loader-bg {
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.text {
color: rgba(255, 255, 255, 1);
font-size: 5em;
text-align: center;
font-weight: lighter;
}
.loader {
margin: 50px auto 0;
position: relative;
width: 12rem;
height: 12rem;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.loader-bg {
width: 100%;
height: 100%;
border-radius: 50%;
border: 100px solid rgba(255, 255, 255, 1);
border-radius: 0% 0% 60% 60%;
box-shadow: 0 0 #000;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="container">
<div class="loader">
<div class="text"></div>
<div class="loader-bg"></div>
</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>
var i = 0,
j = 0,
k = 0,
l = 0;
function renderProgress(progress) {
progress = Math.floor(progress);
if(progress<20){
i++;
$(".loader-bg").css('box-shadow', i+'px ' +i+'px ' + 'rgba(0,0,0,0.5)' );
j = i;
}
else if(progress>=20 && progress<40){
j++;
$(".loader-bg").css('box-shadow', '-'+j+'px ' +i+'px ' + 'rgba(0,0,0,0.5)' );
k = j;
}
else if(progress>=40 && progress<60){
k++
$(".loader-bg").css('box-shadow', '-'+k+'px ' + '-'+k+'px ' + 'rgba(0,0,0,0.5)' );
l = k;
}
else if(progress>=60 && progress<=80){
l++;
$(".loader-bg").css('box-shadow', progress+'px ' +progress+'px ' + 'rgba(0,0,0,0.5)' );
}
else if(progress>=80 && progress<=100){
$(".loader-bg").css('box-shadow', progress+'px ' +progress+'px ' + 'rgba(0,0,0,0.5)' );
}
if(progress==100){ }
$(".text").html(progress+"%");
}
function clearProgress() {
// $(".animate-75-100-b, .animate-50-75-b, .animate-25-50-b, .animate-0-25-b").css("transform","rotate(90deg)");
}
var i =0;
var times = 0;
var interval = setInterval(function (){
i++;
times += 1;
if( times >= 100 ) {
// clearProgress();
width = '4px';
clearInterval(interval);
}
renderProgress(i);
},90);
</script>
</body>
</html>