50projects50days/password-strength-background/script.js

10 lines
306 B
JavaScript
Raw Normal View History

2020-10-07 15:50:17 +00:00
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)`
})