-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.html
186 lines (151 loc) · 6.43 KB
/
contact.html
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
layout: default
title: Contact
---
<div id="content-div" class="col-md-12">
<!--Contact Tab-->
<section id="contact" class="bgWhite ofsInBottom">
<!--Contact -->
<div class="contact">
<!--Main title-->
<div class="main-title">
<h1>contact info</h1>
<div class="divider">
{% include zigzag.html size='large' %}
</div>
</div>
<!--End main title-->
<!--Content-->
<div class="content">
<!--Block content-->
<div class="block-content ">
<!--Info-->
<div class="block-info">
<!--Row-->
<div class="row">
<div class="col-md-12">
<div class="info-holder margTMedium">
<!--Address info-->
<div class="address-info">
<p>Feel free to contact me using any of the below
</p>
</div>
<!--End address info-->
<!--Contact info-->
<div class="contact-info tCenter">
<ul>
<li>
<div class="ico"><i class="icon-mail"></i></div>
<p>[email protected] </p></li>
<li>
<div class="ico"><i class="icon-phone"></i></div>
<p>+41 078 848 01 94</p></li>
<li>
<div class="ico"><i class="icon-link"></i></div>
<p><a href="http://fayez.me">fayez.me</a></p></li>
</ul>
</div>
<!--End contact info-->
</div>
</div>
</div>
<!--End row-->
</div>
<!--End info-->
</div>
<!--End block content-->
</div>
<!--End content-->
<!--Main title-->
<div class="main-title">
<h1>send me an email</h1>
<div class="divider">
{% include zigzag.html size='large' %}
</div>
</div>
<!--End main title-->
<!--Content-->
<div class="content">
<!--Block content-->
<div class="block-content ">
<!--Contact-->
<div class="block-contact margBSSmall">
<!--Row-->
<div class="row">
<div class="col-md-12">
<form class="contact-form" id="my-form" action="https://formspree.io/f/xoqzqaoy" method="POST">
<!--Input columns-->
<div class="input-columns clearfix">
<div class="column1">
<div class="column-inner">
<input type="text" placeholder="Name" value="" id="name"
name="name">
</div>
</div>
<!--Column-->
<div class="column2">
<div class="column-inner">
<input type="text" placeholder="Email" value="" id="email"
name="email">
</div>
</div>
<!--End column-->
</div>
<!--End input columns-->
<input type="text" placeholder="Subject" value="" id="subject"
name="subject">
<input type="text" name="_gotcha" style="display:none" />
<textarea name="message" placeholder="Message" id="message" cols="45"
rows="10"></textarea>
<input type="submit" value="send your email" class="but opc-2 submit">
<div class="g-recaptcha" data-sitekey="6LccuMQjAAAAAMowzx5EuS10o16ty9wqf9cbYdks"></div>
</form>
<!--Contact form message-->
<p id="my-form-status"></p>
<!--End contact form message-->
</div>
</div>
<!--End row-->
</div>
<!--End contact-->
</div>
<!--End block content-->
</div>
<!--End content-->
{% include download_cv.html %}
</div>
<!--End contact-->
</section>
<!--End contact tab-->
</div>
<script>
var form = document.getElementById("my-form");
async function handleSubmit(event) {
event.preventDefault();
var status = document.getElementById("my-form-status");
var data = new FormData(event.target);
fetch(event.target.action, {
method: form.method,
body: data,
headers: {
'Accept': 'application/json'
}
}).then(response => {
if (response.ok) {
status.innerHTML = "Your message has been sent. Thank you!";
form.reset();
} else {
response.json().then(data => {
if (Object.hasOwn(data, 'errors')) {
status.innerHTML = data["errors"].map(error => error["message"]).join(", ")
} else {
status.innerHTML = "Sorry your message could not be sent."
}
})
}
}).catch(error => {
status.innerHTML = "Sorry your message could not be sent."
});
}
form.addEventListener("submit", handleSubmit);
</script>