-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
41 lines (37 loc) · 1.22 KB
/
app.js
File metadata and controls
41 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
window.onload=()=>{
let username_input = document.getElementById("login__username")
let password_input = document.getElementById("login__password")
let username = username_input.value
let password = password_input.value
password_input.oninput = (e)=>{
password = e.target.value
}
username_input.oninput = (e)=>{
username = e.target.value
}
username_input.onfocus=(e)=>{
e.target.parentElement.classList.add("section_focused")
}
username_input.onblur=(e)=>{
if (!e.target.value)
e.target.parentElement.classList.remove("section_focused")
}
password_input.onblur=(e)=>{
if (!e.target.value)
e.target.parentElement.classList.remove("section_focused")
}
password_input.onfocus=(e)=>{
e.target.parentElement.classList.add("section_focused")
}
document.getElementById("login__form").onsubmit =(e)=>{
e.preventDefault()
if (password.length < 4){
alert("Password is too short")
return
}
console.log(username, password)
}
document.getElementById('google_login').onclick = (e)=>{
alert("Coming soon continue with email and password for now")
}
}