File tree Expand file tree Collapse file tree 3 files changed +86
-0
lines changed Expand file tree Collapse file tree 3 files changed +86
-0
lines changed Original file line number Diff line number Diff line change 1+ const password = document . getElementById ( "password" ) ;
2+ const bg = document . querySelector ( ".background-image" ) ;
3+
4+ password . addEventListener ( "input" , ( e ) => {
5+ const input = e . target . value ;
6+ const length = input . length ;
7+ const blurness = 20 - length * 2 ;
8+ bg . style . filter = `blur(${ blurness } px)` ;
9+ } ) ;
Original file line number Diff line number Diff line change 1+ < html lang ="en ">
2+ < head >
3+ < meta charset ="UTF-8 " />
4+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6+ < title > Password Strength Background</ title >
7+ < link rel ="stylesheet " href ="style.css " />
8+ </ head >
9+ < body >
10+ < div class ="background-image "> </ div >
11+
12+ < div class ="container ">
13+ < input type ="email " id ="email " placeholder ="Enter Email " />
14+ < input type ="password " id ="password " placeholder ="Enter Password " />
15+ < button type ="submit "> Submit</ button >
16+ </ div >
17+
18+ < script src ="app.js "> </ script >
19+ </ body >
20+ </ html >
Original file line number Diff line number Diff line change 1+ * {
2+ margin : 0 ;
3+ padding : 0 ;
4+ box-sizing : border-box;
5+ font-family : sans-serif;
6+ }
7+
8+ body {
9+ display : flex;
10+ flex-direction : column;
11+ justify-content : center;
12+ align-items : center;
13+ height : 100vh ;
14+ overflow : hidden;
15+ margin : 0 ;
16+ }
17+
18+ .container {
19+ width : 40% ;
20+ height : 40% ;
21+ background : # 1c1c1c ;
22+ display : flex;
23+ flex-direction : column;
24+ justify-content : center;
25+ align-items : center;
26+ }
27+
28+ .container input {
29+ padding : 10px 20px ;
30+ margin-bottom : 20px ;
31+ width : 80% ;
32+ outline : none;
33+ }
34+
35+ .container button {
36+ padding : 10px 20px ;
37+ border : none;
38+ background : transparent;
39+ background : crimson;
40+ width : 150px ;
41+ color : # fff ;
42+ cursor : pointer;
43+ }
44+
45+ .background-image {
46+ background-image : url ("https://images8.alphacoders.com/601/thumb-1920-601705.jpg" );
47+ background-repeat : no-repeat;
48+ background-position : center;
49+ background-size : cover;
50+ position : absolute;
51+ top : -20px ;
52+ bottom : -20px ;
53+ left : -20px ;
54+ right : -20px ;
55+ z-index : -1 ;
56+ filter : blur (20px );
57+ }
You can’t perform that action at this time.
0 commit comments