-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
153 lines (121 loc) Β· 3.65 KB
/
index.js
File metadata and controls
153 lines (121 loc) Β· 3.65 KB
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
//rectangle//
document.addEventListener('DOMContentLoaded', () => {
setTimeout(function () {
box_title_text.style.top = '40%';
box_title_text.style.opacity = '100%';
rectangle1.style.opacity = '100%';
}, 1100);
setTimeout(function () {
plas.style.opacity = '100%';
}, 1100);
setTimeout(function () {
rectangle2.style.opacity = '100%';
}, 1200);
setTimeout(function () {
move.style.opacity = '100%';
}, 1400);
setTimeout(function () {
rectangle3.style.opacity = '100%';
}, 1500);
setTimeout(function () {
rectangle3.style.boxShadow = '0px 0px 30px 1px #F87474';
//window.location.href = '#location';
}, 1700);
});
//show up site btn//
window.addEventListener('scroll', () => {
if (window.scrollY > 300) {
box_up.style.opacity = '100%';
box_up.style.left = '20px';
} else {
box_up.style.opacity = '0';
box_up.style.left = '-50px';
}
if (window.scrollY > 300) {
}
});
//slider//
var index_photo = 0;
var time = 1;
function next() {
index_photo++;
if (index_photo == 0)
positionimg.style.marginLeft = 305 + "px";
if (index_photo == 1)
positionimg.style.marginLeft = 0 + "px";
if (index_photo == 2)
positionimg.style.marginLeft = -610 + "px";
time = 0;
setTimeout(function () {
time = 1;
}, 2000);
}
function prev() {
index_photo--;
if (index_photo == 0)
positionimg.style.marginLeft = 305 + "px";
if (index_photo == 1)
positionimg.style.marginLeft = 0 + "px";
if (index_photo == 2)
positionimg.style.marginLeft = -610 + "px";
time = 0;
setTimeout(function () {
time = 1;
}, 2000);
}
function process() {
if (index_photo > 2) {
index_photo = 0;
positionimg.style.marginLeft = 305 + "px";
}
if (index_photo < 0) {
index_photo = 2;
positionimg.style.marginLeft = -610 + "px";
}
if (index_photo == 0) {
document.getElementById('d1').style.background = "white";
document.getElementById('d2').style.background = "rgb(130, 130, 130)";
document.getElementById('d3').style.background = "rgb(130, 130, 130)";
}
if (index_photo == 1) {
document.getElementById('d2').style.background = "white";
document.getElementById('d3').style.background = "rgb(130, 130, 130)";
document.getElementById('d1').style.background = "rgb(130, 130, 130)";
}
if (index_photo == 2) {
document.getElementById('d3').style.background = "white";
document.getElementById('d2').style.background = "rgb(130, 130, 130)";
document.getElementById('d1').style.background = "rgb(130, 130, 130)";
}
if (index_photo == 0)
positionimg.style.marginLeft = 305 + "px";
if (index_photo == 1)
positionimg.style.marginLeft = 0 + "px";
if (index_photo == 2)
positionimg.style.marginLeft = -610 + "px";
}
setInterval(process, 100);
function Time() {
if (time == 1) {
index_photo++;
if (index_photo == 0)
positionimg.style.marginLeft = 305 + "px";
if (index_photo == 1)
positionimg.style.marginLeft = 0 + "px";
if (index_photo == 2)
positionimg.style.marginLeft = -610 + "px";
}
}
setInterval(Time, 8000);
document.getElementById('d1').addEventListener('click', (e) => {
index_photo = 0;
time = 1;
});
document.getElementById('d2').addEventListener('click', (e) => {
index_photo = 1;
time = 1;
});
document.getElementById('d3').addEventListener('click', (e) => {
index_photo = 2;
time = 1;
});