-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.html
More file actions
140 lines (121 loc) · 5.68 KB
/
Copy pathcontact.html
File metadata and controls
140 lines (121 loc) · 5.68 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us</title>
<link rel="icon" href="./files/logo.png">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Paytone+One&family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/boxicons@latest/css/boxicons.min.css">
</head>
<body class="contactbody">
<nav>
<img src="./files/logo.png" class="logo" alt="Logo" title="FirstFlight Travels">
<ul class="navbar">
<li>
<a href="./index.html">Home</a>
<a href="./index.html#locations">Locations</a>
<a href="./index.html#package">Packages</a>
<a href="./about.html">About Us</a>
<a href="./contact.html">Contact Us</a>
</li>
</ul>
<button id="signout-btn" class="signout-btn" style="height: 40px; width: 100px; margin: 20px; color: rgb(21, 74, 74); font-size: 18px;
padding: auto 30px;
border-radius: 4px;
font-weight: 500;
border:none; " onclick={handleSignOut()}>SIGN OUT</button>
</nav>
<section class="contact">
<div class="contact-form">
<h1>Contact <span>Us</span></h1>
<p>We are always out there to help you! Fill out the form given below and get a reply from us within 2
business days.</p>
<form name="register-user">
<input type="text" name="myname" placeholder="Your Name" required>
<input type="email" name="email" placeholder="Your E-mail" required>
<input type="text" name="subject" placeholder="What brings you here?" required>
<textarea name="message" cols="30" rows="10" placeholder="Your Message" required></textarea>
<input type="submit" value="Submit" class="submit-btn">
</form>
</div>
</section>
<!-- Footer -->
<section class="footer">
<div class="foot">
<div class="footer-content">
<div class="footlinks">
<h4>Quick Links</h4>
<ul>
<li><a href="./register.html">Register</a></li>
<li><a href="./about.html">About Us</a></li>
<li><a href="./contact.html">Contact Us</a></li>
</ul>
</div>
<div class="footlinks">
<h4>Connect</h4>
<div class="social">
<a href=""><i class='bx bxl-facebook'></i></a>
<a href="https://www.instagram.com/vivek_.l8" target="_blank"><i
class='bx bxl-instagram'></i></a>
<a href="https://www.linkedin.com/in/vivekparmar1812" target="_blank"><i
class='bx bxl-linkedin'></i></a>
<a href=""><i class='bx bxl-youtube'></i></a>
<a href="https://github.com/VivekParmar-18" target="_blank"><i class='bx bxl-github'></i></a>
<a href=""><i class='bx bxs-map'></i></a>
</div>
</div>
</div>
</div>
<div class="end">
<p>Copyright © 2022 Firstflight Travels All Rights Reserved.<br>Website developed by: Vivek Parmar</p>
</div>
</section>
<script>
const action_url = "https://script.google.com/macros/s/AKfycbzoHIGvOXoOi77J7UtPijvdSqZwqpGOO8tdnuG5eb1_j2fGiq6Za6Hx_xtGz1vN5Vc-/exec";
const formRegister = document.forms["register-user"];
// const proxyUrl = 'https://cors-anywhere.herokuapp.com/'
formRegister.addEventListener("submit", async (e) => {
e.preventDefault();
console.log(new FormData(formRegister));
await fetch(action_url, {
method: "POST",
body: new FormData(formRegister),
}).then((response) => {
console.log(response)
alert("We look forward to hearing from you and will respond as soon as possible.", response);
formRegister.reset();
window.location.href = "./index.html"
}).catch((error) => {
console.log(error);
alert(error.message);
})
})
window.onload = function () {
if (localStorage.getItem("login") === "true") {
document.getElementById("signout-btn").style.display = "block";
document.getElementById("signout-btn").textContent = "SIGN OUT";
} else if (localStorage.getItem("login") === "false") {
document.getElementById("signout-btn").style.display = "block"
document.getElementById("signout-btn").textContent = "LOGIN";
}
}
function handleSignOut() {
let text = document.getElementById("signout-btn").textContent;
console.log(text)
if (text === "LOGIN") {
window.location.href = "./login.html"
} else if (text === "SIGN OUT") {
document.getElementById("signout-btn").textContent = "LOGIN";
localStorage.setItem("login", false);
}
}
</script>
</body>
</html>