-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse.js
116 lines (101 loc) · 3.41 KB
/
response.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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Script to open and close sidebar when on tablets and phones
function w3_open() {
document.getElementById("mySidebar").style.display = "block";
document.getElementById("myOverlay").style.display = "block";
}
function w3_close() {
document.getElementById("mySidebar").style.display = "none";
document.getElementById("myOverlay").style.display = "none";
}
// Slideshow Images
var slideIndex = 1;
showDivs(slideIndex, "1");
showDivs(slideIndex, "2");
showDivs(slideIndex, "3");
function currentDiv(n, slideNumber) {
showDivs(slideIndex = n, slideNumber);
}
function showDivs(n, slideNumber) {
var i;
var x = document.getElementsByClassName("mySlides" + slideNumber);
var dots = document.getElementsByClassName("demo" + slideNumber);
if (n > x.length) {slideIndex = 1}
if (n < 1) {slideIndex = x.length}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" w3-opacity-off", "");
}
x[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " w3-opacity-off";
}
var headSlideIndex = 1;
showHeadSlide(headSlideIndex);
function plusSlide(n) {
showHeadSlide(headSlideIndex += n);
}
function showHeadSlide(n) {
var i;
var x = document.getElementsByClassName("headSlide");
if (n > x.length) {headSlideIndex = 1}
if (n < 1) {headSlideIndex = x.length}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[headSlideIndex-1].style.display = "block";
}
// Rooms dropdown butten add event listener
$( "#dropdown-btn-rooms" ).click(function() {
dropdown_blocked = $( "#dropdown-container" ).css('display');
if (dropdown_blocked === "block"){
$( "#dropdown-container" ).css('display', "none")
}else{
$( "#dropdown-container" ).css('display', "block")
}
});
var elements = document.getElementsByClassName('clicked-side');
for (let i = 0; i < elements.length; i++) {
elements[i].addEventListener('click', function() {
w3_close();
});
};
var w = window.matchMedia("(max-width: 700px)");
var vid = document.getElementById("vid");
var source = document.createElement("source");
source.id = "hvid";
source.setAttribute("type", "video/mp4");
vid.appendChild(source);
if (w.matches) {
vid.pause();
source.removeAttribute("src");
source.setAttribute("src", "static/images/videos/casa_modero_verticaal.mp4");
vid.load();
} else {
vid.pause();
source.removeAttribute("src");
source.setAttribute("src", "static/images/videos/casa_modero.mp4");
vid.load();
}
window.addEventListener("resize", function(){
var w = window.matchMedia("(max-width: 700px)");
var vid = document.getElementById("vid");
var source = document.getElementById("hvid");
if (w.matches) {
vid.pause();
source.src = "static/images/videos/casa_modero_verticaal.mp4";
vid.load();
} else {
vid.pause();
source.src = "static/images/videos/casa_modero.mp4";
vid.load();
}
});
const phoneContact = document.getElementById("phoneContact");
phoneContact.addEventListener("click", function() {
phoneContact.textContent = "+39 331 " + "173 1906";
});
const emailContact = document.getElementById("emailContact");
emailContact.addEventListener("click", function() {
emailContact.textContent = "modero.cartosio" + "@" + "gmail.com";
});