-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
67 lines (47 loc) · 1.9 KB
/
app.js
File metadata and controls
67 lines (47 loc) · 1.9 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
'use strict';
// function clickHandler() {
// alert("something");
// }
function isEmpty(str){
return (str == null) || (str.length == 0);
}
function isEmail() {
resultPicture.innerHTML = '';
// let email = document.getElementById("email").value;
let name = document.getElementById("name").value;
let hair = document.getElementById("hair").value;
let body = document.getElementById("body").value;
let kindOfCat = document.getElementById("kindOfCat");
// let re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i;
// if (re.test(str)) status.innerHTML = "Адрес правильный";
// else status.innerHTML = "Адрес неверный";
// if(isEmpty(str)) status.innerHTML = `Поле пустое + ${str1}`;
if (name.length === 0) {
kindOfCat.innerHTML = `Ты безимянный ${hair.toLowerCase()} ${body.toLowerCase()} кот (или кошка). Котей(ка) без имени, как же так?(((`;
} else {
kindOfCat.innerHTML = `Ты ${hair.toLowerCase()} ${body.toLowerCase()} кот (или кошка) по имени ${name}.`;
}
if (hair === 'Радужный' && body === 'подтянутый') {
resultPicture.innerHTML = document.getElementById('pic1').innerHTML;
}
}
// ТУТ ИДЕТ ТЕСТ ГАЛЕРЕИ
let a = 1;
function test_next() {
current_picture.innerHTML = '';
a++;
if (a === 7) {
a = 1;
}
current_picture.innerHTML = document.getElementById(`pic-test${a}`).innerHTML;
current_picture_left.innerHTML = document.getElementById(`pic-test${a-1}`).innerHTML;
current_picture_right.innerHTML = document.getElementById(`pic-test${a+1}`).innerHTML;
}
function test_prev() {
current_picture.innerHTML = '';
a--;
if (a === 0) {
a = 6;
}
current_picture.innerHTML = document.getElementById(`pic-test${a}`).innerHTML;
}