-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
52 lines (39 loc) · 2.22 KB
/
script.js
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
42
43
44
45
46
47
48
49
50
51
52
var buttons = document.getElementsByTagName("button");
for (var i = 0; i < buttons.length; i++) {
buttons[i].addEventListener("click", function(event) {
// Check which button was clicked
if (this.textContent.trim() === "Sign Up") {
// Code for "Sign Up" button
document.getElementById('heading').innerText = "Sign Up";
document.getElementById('name').style.display = 'block';
document.getElementById('para').innerHTML = "Password Suggestions <span>Click Here!</span>";
document.getElementById('para').style.transform = 'translateX(-30px)';
// Styling for buttons
const secondButton = document.querySelector('#buttons > :nth-child(2)');
secondButton.style.backgroundColor = '#e8e8e8';
secondButton.style.color = '#868686';
const firstButton = document.querySelector('#buttons > :nth-child(1)');
firstButton.style.backgroundColor = 'green';
firstButton.style.color = 'white';
const buttons = document.querySelector('#buttons');
buttons.style.marginTop = '66px';
// Reset form height and transition class
document.getElementById('form').style.maxHeight = '362px';
} else {
// Code for "Sign In" button
document.getElementById('heading').innerText = "Sign In";
document.getElementById('name').style.display = 'none';
document.getElementById('para').innerHTML = "Forget Password <span>Click Here</span>";
document.getElementById('para').style.transform = 'translateX(-50px)';
// Styling for buttons
const firstButton = document.querySelector('#buttons > :nth-child(1)');
firstButton.style.backgroundColor = '#e8e8e8';
firstButton.style.color = '#868686';
const secondButton = document.querySelector('#buttons > :nth-child(2)');
secondButton.style.backgroundColor = 'green';
secondButton.style.color = 'white';
const buttons = document.querySelector('#buttons');
buttons.style.marginTop = '145px';
}
});
}