-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
126 lines (109 loc) · 3.95 KB
/
index.html
File metadata and controls
126 lines (109 loc) · 3.95 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Task1</title>
<style>
body {
background-color: rgb(6, 0, 122);
font-size: 30px;
}
.custom-box {
background-color: rgb(170, 255, 247);
height: 740px;
width: 1460px;
margin-top: 24px;
margin-left: 16px;
display: flex;
align-items: center;
flex-direction: column;
border: 4px solid grey;
}
.heading-primary {
color: rgb(255, 46, 81);
font-size: 55px;
margin: 25px auto;
font-weight: bold;
}
.heading-secondary {
color: rgb(255, 46, 81);
font-size: 40px;
margin-bottom: 20px;
font-weight: bold;
}
.text-primary, .demo {
color: #06007a;
font-size: 30px;
font-weight: bold;
}
.input-container {
color: rgb(0, 0, 0);
font-size: 25px;
margin: 15px;
}
.input-field {
display: inline;
width: 240px;
padding-top: 4px;
padding-bottom: 2px;
}
.custom-button {
background-color: rgb(255, 12, 52);
border: 3px solid black;
font-size: 15px;
margin-top: 50px;
margin-bottom: 50px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="custom-box">
<div class="input-container heading-primary">Big Storm</div>
<div class="input-container heading-secondary">Educational website</div>
<div class="input-container text-primary">Sign In and Shine More</div>
<div class="input-container">Name:
<input type="text" placeholder="Enter your Name..." id="new-name" class="input-field">
</div>
<div class="input-container">Email:
<input type="text" placeholder="Enter your Email address..." id="new-email" class="input-field">
</div>
<div class="input-container">Password:
<input type="password" placeholder="Enter your Password..." id="new-password" class="input-field">
</div>
<button class="custom-button" onclick="signIn()">Sign in to continue</button>
<div id="new-demo" class="demo"></div>
</div>
<script>
function passwordValidate() {
let newPassword = document.getElementById('new-password').value;
if (newPassword.length < 8) return false;
let cap = 0;
let small = 0;
let dig = 0;
let special = 0;
function passwordValidate() {
let newPassword = document.getElementById('new-password').value;
let hasUpperCase = /[A-Z]/.test(newPassword);
let hasLowerCase = /[a-z]/.test(newPassword);
let hasDigit = /\d/.test(newPassword);
let hasSpecialChar = /[!@#$%^&*()_+{}\[\]:;<>,.?~\\/-]/.test(newPassword);
if (newPassword.length >= 8 && hasUpperCase && hasLowerCase && hasDigit && hasSpecialChar) {
return true;
}
return false;
}
}
function signIn() {
let newName = document.getElementById('new-name').value;
let newDemo = document.getElementById('new-demo');
if (passwordValidate()) {
newDemo.innerHTML = "Sign In successful!!! Welcome " + newName + ". Learn More with Bigstorm";
} else {
newDemo.innerHTML = "Please enter a valid password (password should be of minimum 8 characters having at least 1 small letter (a-z), 1 capital letter (A-Z), 1 digit (0-9), 1 special character)";
}
}
</script>
</body>
</html>