-
Notifications
You must be signed in to change notification settings - Fork 0
/
SignUp.html
151 lines (119 loc) · 5.36 KB
/
SignUp.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
<html>
<head>
<title>Register - CollabHub</title>
</head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="form.css">
<style>
.pfpcontain {
display: flex;
justify-content: center;
align-items: center;
padding-bottom: 20px;
}
#pfp {
width: 100px;
height: 100px;
border-radius: 50%;
}
#openimg{
display: none;
}
.bi {
border-radius: 50%;
padding: 5px;
background-color: #f8f8f8;
transform: rotate(270deg);
color: rgb(102, 102, 102);
}
#chngpic{
position: absolute;
top: 23%;
left: 52%;
transition: all .5s;
}
#chngpic:hover {
background-color: #ededed;
transform: rotate(270deg) translate(3px,0);
}
</style>
<body>
<div class="form">
<h1 id="title">Sign Up:</h1>
<form action="SignUp_auth.php" method="post" enctype="multipart/form-data">
<div class="pfpcontain">
<img id="pfp" src="blank-pfp.png" for="pfp" ></img>
<div class="bi bi-pencil-fill" id="chngpic" onclick="openfile()"></div>
<input type="file" id="openimg" accept="image/*" name="uimg" onchange="loadFile(event)">
</div>
<input class="inp" type="text" placeholder="User Name" name="uname" >
<input class="inp" type="text" placeholder="Institute Name" name="inst" >
<input class="inp" type="text" placeholder="Department Name" name="dept" >
<input class="inp" type="email" placeholder="Email" name="email" pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{1,63}$" >
<input class="inp" type="number" placeholder="Mobile No." name="mobno" >
<input class="inp" type="text" placeholder="State" name="state">
<input class="inp" type="text" placeholder="City" name="city">
<div class="passcontain">
<input class="inp" type="password" placeholder="Password" id="typepass" name="pass" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" required>
<div id="hidepass" onclick="togglePass()"><i id="eye" class="bi-eye-slash"></i></div>
</div>
<div class="radios">
<label class="radele" for="student">
<input class="type" id="student" type="radio" name="utype" value="students" checked>Student
</label>
<label class="radele" for="faculty">
<input class="type" id="faculty" type="radio" name="utype" value="faculties">Faculty
</label>
</div>
<input class="inp" id="sem" placeholder="Semester" type="number" name="sem">
<input class="inp" id="post" placeholder="Post" type="text" name="post" style="display: none;">
<input class="inp" id="btn" type="submit" value="Sign up">
</form>
</div>
</body>
<script>
const student = document.getElementById('student');
const faculty = document.getElementById('faculty');
const sem = document.getElementById('sem');
const post = document.getElementById('post');
student.addEventListener('change', function() {
if (student.checked) {
sem.style.display = 'block';
sem.setAttribute('required','');
post.style.display = 'none';
post.removeAttribute('required','');
post.value = "";
}
});
faculty.addEventListener('change', function() {
if (faculty.checked) {
post.style.display = 'block';
post.setAttribute('required','');
sem.style.display = 'none';
sem.removeAttribute('required','');
sem.value = "";
}
});
const fileUploadDiv = document.getElementById('chngpic');
const fileInput = document.getElementById('openimg');
fileUploadDiv.addEventListener('click', function() {
fileInput.click();
});
let loadFile = function (event) {
let image = document.getElementById("pfp");
image.src = URL.createObjectURL(event.target.files[0]);
};
function togglePass() {
let temp = document.getElementById("typepass");
let hide = document.getElementById("hidepass");
if (temp.type === "password") {
temp.type = "text";
hide.innerHTML = `<i class="bi-eye" id="eye"></i>`;
}
else {
temp.type = "password";
hide.innerHTML = `<i class="bi-eye-slash" id="eye"></i>`;
}
}
</script>
</html>