File size: 2,528 Bytes
b75f547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//Swiper slider
var swiper = new Swiper(".bg-slider-thumbs", {
    loop: true,
    spaceBetween: 0,
    slidesPerView: 0,
});
var swiper2 = new Swiper(".bg-slider", {
    loop: true,
    spaceBetween: 0,
    thumbs: {
        swiper: swiper,
    },
});

//Navigation bar effects on scroll
window.addEventListener("scroll", function(){
	const header = document.querySelector("header");
	header.classList.toggle("sticky", window.scrollY > 0);
});

//Responsive navigation menu toggle
const menuBtn = document.querySelector(".nav-menu-btn");
const closeBtn = document.querySelector(".nav-close-btn");
const navigation = document.querySelector(".navigation");

menuBtn.addEventListener("click", () => { 
	navigation.classList.add("active"); 
});

closeBtn.addEventListener("click", () => { 
	navigation.classList.remove("active");
});

//Transition Jump anchor links
var jumpLink1 = document.getElementById("jump-link1");

jumpLink1.addEventListener("click", function(e) {
  e.preventDefault();
  var target = document.querySelector(this.getAttribute("href"));
  var targetOffset = target.offsetTop;
  window.scrollTo({top: targetOffset, behavior: "smooth"});
});

var jumpLink2 = document.getElementById("jump-link2");

jumpLink2.addEventListener("click", function(e) {
  e.preventDefault();
  var target = document.querySelector(this.getAttribute("href"));
  var targetOffset = target.offsetTop;
  window.scrollTo({top: targetOffset, behavior: "smooth"});
});

var jumpLink3 = document.getElementById("jump-link3");

jumpLink3.addEventListener("click", function(e) {
  e.preventDefault();
  var target = document.querySelector(this.getAttribute("href"));
  var targetOffset = target.offsetTop;
  window.scrollTo({top: targetOffset, behavior: "smooth"});
});

var jumpLink4 = document.getElementById("jump-link4");

jumpLink4.addEventListener("click", function(e) {
  e.preventDefault();
  var target = document.querySelector(this.getAttribute("href"));
  var targetOffset = target.offsetTop;
  window.scrollTo({top: targetOffset, behavior: "smooth"});
});

var inpt = document.getElementById("email-inpt");

inpt.addEventListener("focus", function() {
    document.getElementById("contain-pass").style.display = "none";
    document.getElementById("contain-mail").style.display = "block";
});

var pass = document.getElementById("pass-inpt");

pass.addEventListener("focus", function() {
    document.getElementById("contain-pass").style.display = "block";
    document.getElementById("contain-mail").style.display = "none";
});