-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
37 lines (28 loc) · 945 Bytes
/
app.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
import elmsScroll from "./funciones/scroll_behavior.js";
import { formBehavior, validarForms } from "./funciones/forms_behavior.js";
import fn from "./funciones/navbar_behavior.js";
import randomLink from "./funciones/random_footer_link.js";
const d = document;
window.addEventListener('scroll', function () {
elmsScroll();
});
d.addEventListener('click', (e) => {
const obj = e.target;
if (obj.matches('.nav__toggle') ||
obj.matches('.nav__toggle__line')) {
fn.expandirNavbar();
} else if (fn.probarToTop(obj)) {
fn.contraerNavbar(e);
} else if (obj.matches('.form__field')) {
formBehavior(obj);
} else if (obj.matches('.form__btn')) {
validarForms(obj);
}
});
window.addEventListener('resize', () => {
if (window.innerWidth >= 850) {
d.querySelector('.nav').style.height = 'fit-content';
}
});
setInterval(() => randomLink(), 5000);
randomLink();