5
5
< head >
6
6
< meta charset ="UTF-8 ">
7
7
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
8
- < title > Login Page </ title >
8
+ < title > SignUpPage </ title >
9
9
< link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css ">
10
10
< link rel ="stylesheet " href ="{% static 'CSS/account.css' %} ">
11
11
< link rel ="shortcut icon " href ="{% static 'images/logo.png' %} " type ="image/x-icon ">
12
+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css " crossorigin ="anonymous ">
12
13
</ head >
13
14
< body >
14
15
< div class ="brand ">
@@ -35,74 +36,24 @@ <h2>SignUp</h2>
35
36
< label for ="name "> Email:</ label >
36
37
< input type ="email " class ="form-control " id ="email " name ="email " placeholder ="Enter your email " required >
37
38
</ div >
38
- < div class ="form-group ">
39
+ < div class ="form-group password-container ">
39
40
< label for ="password "> Password:</ label >
40
- < input type ="password " class ="form-control " id ="password " name ="password " placeholder ="Create Password " pattern ="^(?=.*[A-Z])(?=.*[a-z])(?=.*[^A-Za-z0-9]).{6,}$ " required >
41
+ < div class ="pass-container ">
42
+ < input type ="password " class ="form-control password-input " id ="password " name ="password " placeholder ="Enter your password " pattern ="^(?=.*[A-Z])(?=.*[a-z])(?=.*[^A-Za-z0-9]).{6,}$ " required >
43
+ < i class ="fas fa-eye eye-icon " onclick ="togglePassword() "> </ i >
44
+ </ div >
41
45
</ div >
42
46
< div class ="form-group ">
43
- < label for ="password2 "> Password:</ label >
44
- < input type ="password " class ="form-control " id ="password2 " name ="password2 " placeholder ="Confirm Password " pattern =" ^(?=.*[A-Z])(?=.*[a-z])(?=.*[^A-Za-z0-9]).{6,}$ " required >
47
+ < label for ="password2 "> Confirm Password:</ label >
48
+ < input type ="password " class ="form-control password-input " id ="password2 " name ="password2 " placeholder ="Confirm Password " required >
45
49
</ div >
46
- < button type ="submit " class ="btn btn-primary btn-block "> Submit</ button >
50
+ < button id =" signup " type ="submit " class ="btn btn-primary btn-block "> Submit</ button >
47
51
</ form >
48
52
< p style ="color:#075e54; text-decoration: underline; "> < a href ="/accounts/login "> Login</ a > </ p >
49
53
</ div >
50
54
</ div >
51
55
52
- < script >
53
- document . querySelector ( "button" ) . addEventListener ( "click" , function ( e ) {
54
- const password = document . getElementById ( 'password' ) . value ;
55
- const password2 = document . getElementById ( 'password2' ) . value ;
56
- if ( password === password2 ) {
57
- if ( password . length < 6 || ! / [ A - Z ] / . test ( password ) || ! / [ a - z ] / . test ( password ) || ! / [ ^ A - Z a - z 0 - 9 ] / . test ( password ) ) {
58
- e . preventDefault ( )
59
- document . querySelector ( '.status_post' ) . innerText = "Password must contain atleast 6 characters, 1 upper, lowercase and a special character"
60
- document . querySelector ( '.status_post' ) . style . display = "block"
61
-
62
- setTimeout ( ( ) => {
63
-
64
- document . querySelector ( '.status_post' ) . style . display = "none"
65
- } , 4000 ) ;
66
-
67
- }
68
- } else {
69
- e . preventDefault ( )
70
- document . querySelector ( '.status_post' ) . innerText = "Passwords don't match!"
71
- document . querySelector ( '.status_post' ) . style . display = "block"
72
-
73
- setTimeout ( ( ) => {
74
-
75
- document . querySelector ( '.status_post' ) . style . display = "none"
76
- } , 3000 ) ;
77
- }
78
- } )
79
- function isStrongPassword ( password ) {
80
- // Check for a minimum length of 6 characters
81
- if ( password . length < 6 ) {
82
- return false ;
83
- }
84
-
85
- // Check for at least one uppercase letter
86
- if ( ! / [ A - Z ] / . test ( password ) ) {
87
- return false ;
88
- }
89
-
90
- // Check for at least one lowercase letter
91
- if ( ! / [ a - z ] / . test ( password ) ) {
92
- return false ;
93
- }
94
-
95
- // Check for at least one special character (not alphanumeric)
96
- if ( ! / [ ^ A - Z a - z 0 - 9 ] / . test ( password ) ) {
97
- return false ;
98
- }
99
-
100
- // If all checks pass, the password is strong
101
- return true ;
102
- }
103
-
104
- </ script >
105
-
56
+ < script src ="{% static 'Javascript/accounts.js' %} "> </ script >
106
57
< script src ="https://code.jquery.com/jquery-3.5.1.slim.min.js "> </ script >
107
58
< script src ="
https://cdn.jsdelivr.net/npm/@popperjs/[email protected] /dist/umd/popper.min.js "
> </ script >
108
59
< script src ="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js "> </ script >
0 commit comments