-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
125 lines (107 loc) · 6.25 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat - iCodeThis.com</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;1,100;1,200&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<link href="styles.css" rel="stylesheet" media="all" type="text/css">
</head>
<body>
<div id="main">
<div class="container">
<div>
<h1>Build your page</h1>
Complete actions to unlock new features along the way.<br>
On average, complete pages get 30% more traffic.
<br>
<br>
<br>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<br>
<small id="total">5 remaining to complete.</small>
</div>
<div>
<h2>Checklist</h2>
<label class="checkbox" for="Industry">
Industry<input type="checkbox" id="Industry" onclick="toggleCheckbox()" checked>
<span class="checkmark"></span>
</label>
<label class="checkbox" for="WebsiteURL">
Website URL<input type="checkbox" id="WebsiteURL" onclick="toggleCheckbox()" checked>
<span class="checkmark"></span>
</label>
<label class="checkbox" for="CompanySize">
Company size<input type="checkbox" id="CompanySize" onclick="toggleCheckbox()" checked>
<span class="checkmark"></span>
</label>
<label class="checkbox" for="Description">
Description<input type="checkbox" id="Description" onclick="toggleCheckbox()">
<span class="checkmark"></span>
</label>
<label class="checkbox" for="Logo">
Logo<input type="checkbox" id="Logo" onclick="toggleCheckbox()">
<span class="checkmark"></span>
</label>
<label class="checkbox" for="Location">
Location<input type="checkbox" id="Location" onclick="toggleCheckbox()" checked>
<span class="checkmark"></span>
</label>
<label class="checkbox" for="CustomButton">
Custom button<input type="checkbox" id="CustomButton" onclick="toggleCheckbox()">
<span class="checkmark"></span>
</label>
<label class="checkbox" for="OnSiteSEO">
On Site SEO<input type="checkbox" id="OnSiteSEO" onclick="toggleCheckbox()">
<span class="checkmark"></span>
</label>
<label class="checkbox" for="PageSpeed">
Page speed<input type="checkbox" id="PageSpeed" onclick="toggleCheckbox()">
<span class="checkmark"></span>
</label>
<script>
const colors = [ '#141829', '#4864f8', '#4a6ff5', '#4b7bf0', '#4d8bea', '#4f9ce5', '#52aade', '#54bad8', '#55c8d4', '#56d2d0' ];
document.querySelector('.container > div:first-of-type > span:nth-of-type(1)').style.backgroundColor = colors[1];
document.querySelector('.container > div:first-of-type > span:nth-of-type(2)').style.backgroundColor = colors[2];
document.querySelector('.container > div:first-of-type > span:nth-of-type(3)').style.backgroundColor = colors[3];
document.querySelector('.container > div:first-of-type > span:nth-of-type(4)').style.backgroundColor = colors[4];
function toggleCheckbox() {
let totalCheckboxes = document.querySelectorAll('input[type="checkbox"]').length;
let checkboxes = document.querySelectorAll('input[type="checkbox"]:checked').length;
let deleteSpan = checkboxes;
let totalUnchecked = totalCheckboxes - checkboxes;
if(checkboxes > 0) {
document.querySelector('.container > div:first-of-type > span:nth-of-type('+ checkboxes + ')').style.backgroundColor = colors[checkboxes];
if(checkboxes != totalCheckboxes)
document.querySelector('.container > div:first-of-type > span:nth-of-type('+ (checkboxes+1) + ')').style.backgroundColor = colors[0];
}
else if(checkboxes == 0) {
document.querySelector('.container > div:first-of-type > span:nth-of-type(1)').style.backgroundColor = colors[0];
}
let msg = '';
if(checkboxes == 0)
msg = 'Please make your selection.';
else if (checkboxes == totalCheckboxes)
msg = 'Your selection is now complete!';
else if (checkboxes > 0)
msg = (totalCheckboxes - checkboxes) + ' remaining to complete.';
document.getElementById("total").innerHTML = msg;
}
</script>
</div>
</div>
</div>
</body>
</html>