-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
91 lines (77 loc) · 2.12 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
body {
height: 100vh;
width: 100vw;
display: flex;
align-items: center;
justify-content: center;
font-family: sans-serif;
color: #333;
font-size: 18px;
background: whitesmoke;
}
form {
display: flex;
flex-direction: column;
padding: 22px;
border: 1px dashed whitesmoke;
background: white;
border-radius: 5px;
}
form > * {
margin-bottom: 15px;
border: 1px solid transparent;
padding-left: 5px;
}
form > input,
form > textarea {
padding: 14px 7px;
font-size: 18px;
background: whitesmoke;
font-weight: 300;
margin-bottom: 17px;
font-family: inherit;
}
form > button {
padding: 15px 22px;
font-size: inherit;
background: #F2F2F2;
border: 1px solid white;
border-radius: 5px;
background: darkcyan;
color: white;
width: fit-content;
}
</style>
</head>
<body>
<form action="" method="POST">
<label for="name">Name</label>
<input type="text" name="name" placeholder="Your Name">
<label for="email">Email</label>
<input type="text" name="email" placeholder="your_email@yahoo.com">
<label for="message">Message</label>
<textarea id="message" name="message" cols="30" rows="10" placeholder="Write your message below"></textarea>
<button>Submit</button>
</form>
<script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
<script>
$('form').on('submit', function(e) {
e.preventDefault();
console.log( $(this).serialize() )
let data = $(this).serialize();
$.ajax({
url: "https://v1.nocodeapi.com/punch__lines/telegram/LUYPxptDJWdtRcCT",
data: data,
method: "post",
success: (res) => $('button').html('Message Sent!')
}).fail( err => $('button').html('Something bad happened') );
})
</script>
</body>
</html>