-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimation.js
More file actions
54 lines (49 loc) · 864 Bytes
/
animation.js
File metadata and controls
54 lines (49 loc) · 864 Bytes
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
var big=1;
var fade=20;
var color1=0;
var color2=0;
var color3=0;
var x=0,y=0;
function proceed(){
setInterval(rotate,1000);
$("#size").on("click",size);
setInterval(fadeout,100);
}
function rotate(){
color1+=70;
color2+=130;
color3+=160;
if (color1>255) color1=color1%255;
if (color2>255) color2=color2%255;
if (color3>255) color3=color3%255;
$("#first").css("background-color","rgb("+color1+","+color2+","+color3+")");
}
function size(){
if (big==1){
$("#size").html("Small");
$("#second").animate({
width:"300px",
height:"300px"
});
big=0;
}
else{
$("#size").html("Big");
$("#second").animate({
width:"150px",
height:"150px"
});
big=1;
}
}
function fadeout(){
if (fade>=10){
$("#fourth").css("opacity","-=.1");
}
else if (fade>=0){
$("#fourth").css("opacity","+=.1");
}
else fade=21;
--fade;
}
$(proceed)