Skip to content

Commit

Permalink
Merge pull request #514 from harikasayani/hibranch
Browse files Browse the repository at this point in the history
hide functionality added in signup page
  • Loading branch information
khushi-joshi-05 authored May 25, 2024
2 parents a93e6df + ca18133 commit 8d2921b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Css-files/signup1.css
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ body * {
align-items: flex-start;
justify-content: center;
margin: 10px 0px;
position: relative;
}
.icon1{
position: absolute;
top:calc(55%);
left:80.5%;
font-size: 25px;
}

.textfield > input {
Expand Down
1 change: 1 addition & 0 deletions Html-files/scriptsignup.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ function validateEmail(email) {
const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return re.test(email);
}

23 changes: 23 additions & 0 deletions Html-files/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ <h1>SIGN UP</h1>
<title>Sign up</title>
<script src="scriptsignup.js" defer type="module"></script>
<link rel="stylesheet" href="../Css-files/signup1.css">
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<div class="main-login">
Expand All @@ -65,6 +67,9 @@ <h1>SIGN UP</h1>
<div class="textfield">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter Password" required>
<span id="signup-hide">
<i class='icon1 bx bxs-hide'></i>
</span>
</div>
<button type="submit" class="btn-login">Register</button>
</form>
Expand All @@ -73,4 +78,22 @@ <h1>SIGN UP</h1>
</div>
</div>
</body>
<script>
const pswinput=document.getElementById('password');
const toggle=document.getElementById('signup-hide');
toggle.addEventListener("click",function()
{
const pswfield=this.querySelector('i');
if(pswinput.getAttribute("type")=="password")
{
pswinput.setAttribute('type','text');
pswfield.classList.replace("bxs-hide","bxs-show");
}
else
{
pswinput.setAttribute('type','password');
pswfield.classList.replace("bxs-show","bxs-hide");
}
});
</script>
</html>

0 comments on commit 8d2921b

Please sign in to comment.