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
| function student() {
/* выбор элементов по id */
var circle = document.getElementById("circle");
var rot = document.getElementById("rot");
var imgs = document.getElementById("imgs");
var bord = document.getElementById("bord");
var lbord = document.getElementById("lbord");
/*топор*/
rot.style.transform = "rotate(0deg)";
rot.style.top = "-100px";
rot.style.right = "200px";
rot.style.transformOrigin = "400px 0";
toChange(rot, { transform:"rotate (-40deg)"}, 500, F);
var st;
function F(){
st = setTimeout(function(){toChange(rot, {top:"500px"}, 700)}, 3000, F2);
}
/* установка исходного "положения" элемента */
circle.style.left = "-300px";
/* установка исходного "положения" элемента */
imgs.style.padding = 0;
imgs.style.paddingTop = window.innerHeight + "px";
//imgs.style.paddingRight = "-" + 200 + "px";
imgs.style.overflow = "hidden";
imgs.style.top = 600 + "px";
/* установка исходного "положения" элемента */
bord.getElementsByTagName("p")[0].style.marginLeft = window.innerWidth + "px";
bord.getElementsByTagName("p")[0].style.marginRight = "-" + window.innerWidth + "px";
bord.style.overflow = "hidden";
bord.style.bottom = "-200px";
/* голубой блок */
lbord.style.top = window.innerHeight - 1200 + "px";
for(var i = 0; i < lbord.getElementsByTagName("*").length; i++)lbord.getElementsByTagName("*")[i].style.opacity = "0";
var idTimer, idTimer1, idTimer2 = /* запуск toChange с задержкой 2 секунды */ setTimeout(function(){toChange(lbord, {top:"5px", right:"400px"}, 1000, nextLbord);}, 2000);
function nextLbord(){
for(var i = 0; i < lbord.getElementsByTagName("*").length; i++) toChange(lbord.getElementsByTagName("*")[i], {opacity:"1"}, 700);
clearTimeout(idTimer2);
idTimer1 = setTimeout(function(){toChange(bord, {bottom:"40px"}, 1000, nextBord);}, 1500);
}
function nextBord(){
toChange(bord.getElementsByTagName("p")[0], {marginLeft:"0", marginRight:"0"}, 1000, nextImgs);
clearTimeout(idTimer1);
}
function nextImgs(){
toChange(imgs, {width:"200px",top:"0px"}, 500, nextImgs1_);
}
function nextImgs1_(){
toChange(imgs, {paddingLeft:"5px", paddingRight:"5px", top:"0px"}, 200, nextImgs1);
}
function nextImgs1(){toChange(imgs, {paddingTop:"0"}, 1000, nextCircle);}
function nextCircle(){
toChange(circle, {bottom:"500px", transform: "rotate(390deg)"}, 1000, nextRot);
}
function nextRot(){toChange(rot, {top:"150px"}, 700, nextRot1);}
function nextRot2(){
if(idTimer){clearTimeout(idTimer);}
idTimer = setTimeout(
function(){
toChange(
rot,
{top:(150+(Math.random()*100-50))+"px", transform: "rotate ("+ (Math.random()*40-20) +"deg)"},
Math.random()*500+200,
nextRot2
);
},
Math.random()*3000
);
}
} |