-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
229 lines (191 loc) · 5.49 KB
/
index.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Slider/Banner</title>
<link href="https://fonts.googleapis.com/css?family=Oswald&subset=latin-ext" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-family: 'oswald', serif;
font-size: 10px;
}
.team {
width: 100%;
height: 100vh;
background-color: #ccc;
position: relative;
overflow: hidden;
}
.team img.color {
position: absolute;
bottom: 0;
right: -5%;
height: 36%;
z-index: 1;
animation: color 4s linear infinite;
}
.team img.gray {
position: absolute;
bottom: 0;
left: -70%;
height: 110%;
opacity: 0.2;
animation: gray 4s linear infinite;
}
.team .member {
position: absolute;
top: 10%;
left: 0;
width: 100%;
text-align: center;
text-transform: uppercase;
letter-spacing: 2px;
animation: text 4s linear infinite;
}
.team h1 {
font-size: 4rem;
color: #00BA61;
text-shadow: 1px 1px black;
}
.team h2 {
font-size: 2.2rem;
}
@media(orientation:landscape) {
.team img.color {
right: 3%;
height: 56%;
}
.team img.gray {
bottom: -10%;
left: -15%;
height: 130%;
}
.team .member {
width: 60%;
right: 0;
left: auto;
}
}
@media (min-width: 1025px) {
.team h1 {
font-size: 8rem;
}
.team h2 {
font-size: 5rem;
}
}
@keyframes color {
0% {
transform: translateX(0);
opacity: 0;
}
1% {
opacity: 0;
}
13% {
opacity: 1;
}
87% {
opacity: 1;
}
99% {
opacity: 0
}
100% {
transform: translateX(-5%);
opacity: 0;
}
}
@keyframes gray {
0% {
transform: translateX(0) scale(1);
opacity: 0;
}
1% {
opacity: 0;
}
13% {
opacity: .2;
}
87% {
opacity: .2;
}
99% {
opacity: 0
}
100% {
transform: translateX(5%) scale(1.1);
opacity: 0;
}
}
@keyframes text {
0% {
transform: scale(1);
opacity: 0;
}
1% {
opacity: 0;
}
13% {
opacity: 1;
}
87% {
opacity: 1;
}
99% {
opacity: 0
}
100% {
transform: scale(1.1);
opacity: 0;
}
}
</style>
</head>
<body>
<section class="team">
<img src="img/s1.png" alt="dziewczyna 1 kolor" class="color">
<img src="img/s1a.png" alt="dziewczyna 1 szara" class="gray">
<div class="member">
<h1>Anna Baugart</h1>
<h2>Programistka JS</h2>
</div>
</section>
<script>
console.log(window.innerWidth);
let active = 0;
const time = 4000;
// Pobieramy 4 elementy na których pracujemy
const colorImgHtml = document.querySelector('.color');
const grayImgHtml = document.querySelector('.gray');
const h1Html = document.querySelector('.member h1');
const h2Html = document.querySelector('.member h2');
console.log(document.body.clientHeight);
//Informacje w tablicach o elementach podmienianych
const colorImages = ['img/s1.png', 'img/s2.png', 'img/s3.png'];
const grayImages = ['img/s1a.png', 'img/s2a.png', 'img/s3a.png'];
const names = ['Anna Baugart', 'Marek Feliksiak', 'Arek Pawłowicz'];
const professions = ['Programistka JS', 'UX i UI Designer', 'Front-End Developer'];
const colors = ['#00BA61', '#65959A', '#1E3359'];
let changeImage = () => {
active++;
if (active == colorImages.length) {
active = 0;
}
colorImgHtml.src = colorImages[active];
grayImgHtml.src = grayImages[active];
h1Html.style.color = colors[active];
h1Html.textContent = names[active];
h2Html.textContent = professions[active];
}
setInterval(changeImage, time);
</script>
</body>
</html>