-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscriptli.js
More file actions
26 lines (21 loc) · 854 Bytes
/
scriptli.js
File metadata and controls
26 lines (21 loc) · 854 Bytes
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
const btnPopup = document.querySelector('.btnLogin-popup');
const cover_box = document.querySelector('.cover_box');
const loginLink = document.querySelector('.login-link');
const iconClose = document.querySelector('.icon-close');
const registerLink = document.querySelector('.register-link');
function activateCoverBox() {
cover_box.classList.add('active');
}
function deactivateCoverBox() {
cover_box.classList.remove('active');
}
function activatePopup() {
cover_box.classList.add('active-popup');
}
function deactivateCoverPopup() {
cover_box.classList.remove('active-popup');
}
registerLink.addEventListener('click', activateCoverBox);
loginLink.addEventListener('click', deactivateCoverBox);
btnPopup.addEventListener('click', activatePopup);
iconClose.addEventListener('click', deactivateCoverPopup);