Skip to content

Commit

Permalink
completed psb
Browse files Browse the repository at this point in the history
  • Loading branch information
tsr-kairi committed Jul 12, 2021
1 parent a99f90d commit 0bbedb3
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Day 39 - Password Strength Background/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const password = document.getElementById("password");
const background = document.getElementById("background");

password.addEventListener("input", (e) => {
const input = e.target.value;
const length = input.length;
const blurValue = 20 - length * 2;
background.style.filter = `blur(${blurValue}px)`;
});
52 changes: 52 additions & 0 deletions Day 39 - Password Strength Background/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/0.0.0-insiders.4a070ac/tailwind.min.css"
integrity="sha512-vJu7D5BpjnNXVpLBrl9LKLvmXBNjiLwge8EOZ/YS9XwiChpfKLAlydwIZvoJaDE3LI/kr3goH0MzDzNbBgyoOQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link rel="stylesheet" href="./style.css" />
<title>Password Strength Background</title>
</head>
<body>
<div class="background" id="background"></div>
<div class="bg-white rounded p-10 text-center shadow-md">
<h1 class="text-3xl">Image Password Strength</h1>
<p class="text-sm text-gray-700">Change the password to see the effect</p>
<div class="my-4 text-left">
<label for="email" class="text-gray-900">Email: </label>
<input
type="text"
class="border block w-full p-2 mt-2 rounded"
id="email"
placeholder="Enter Email"
/>
</div>

<div class="my-4 text-left">
<label for="password" class="text-gray-900">Password: </label>
<input
type="password"
class="border block w-full p-2 mt-2 rounded"
id="password"
placeholder="Enter Password"
/>
</div>

<button
class="bg-black text-white py-2 mt-4 inline-block w-full rounded"
type="submit"
>
Submit
</button>
</div>

<script src="./app.js"></script>
</body>
</html>
28 changes: 28 additions & 0 deletions Day 39 - Password Strength Background/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
*::after,
*::before {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
height: 100vh;
overflow: hidden;
margin: 0;
}

.background {
background: url("https://images.unsplash.com/photo-1556745757-8d76bdb6984b")
no-repeat center center/cover;
position: absolute;
top: -20px;
bottom: -20px;
left: -20px;
right: -20px;
z-index: -1;
filter: blur(20px);
}

0 comments on commit 0bbedb3

Please sign in to comment.