-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
40 lines (34 loc) · 1.11 KB
/
script.js
File metadata and controls
40 lines (34 loc) · 1.11 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
// Background Image position manipulator - AboutMe section
var pos = document.documentElement;
pos.addEventListener('mousemove', e => {
// console.log(e.clientX, e.clientY);
pos.style.setProperty('--x', e.clientX + "px");
pos.style.setProperty('--y', e.clientY + "px");
})
// Contact Form
$(function() {
$('#contact').on('submit', function(e) {
e.preventDefault();
console.log('Submitted')
$.ajax({
method: 'POST',
url: 'https://formsubmit.co/ajax/f15594cc77de132498c67c3791dc8773',
dataType: 'json',
accepts: 'application/json',
data: {
Name: $('#name').val(),
Email: $('#email').val(),
Subject: $('#subject').val()
},
success: (data) => {
console.log('sent')
// $('.overlay').toggleClass('.visible');
$('.overlay').css({"visibility":"visible", "opacity":"1"});
setTimeout(() => {
$('.overlay').css({"visibility":"hidden", "opacity":"0"});
}, 4000);
},
error: (err) => console.log(err)
});
})
})