75 lines
1.8 KiB
Markdown
75 lines
1.8 KiB
Markdown
+++
|
|
title = 'Contact me'
|
|
draft = false
|
|
+++
|
|
|
|
Chat with me on:
|
|
- XMPP: casual@pwned.life
|
|
|
|
Or write your message here (with contact information) and I will contact you:
|
|
|
|
|
|
|
|
|
|
{{< rawhtml >}}
|
|
|
|
<style>
|
|
.form-container {
|
|
<!-- border-radius: 10px; -->
|
|
width: 400px; /* Width of the form container */
|
|
margin: 0 auto; /* Center the form container horizontally */
|
|
}
|
|
.form-container label,
|
|
.form-container input {
|
|
display: block;
|
|
margin-bottom: 10px;
|
|
<!-- height: 100px -->
|
|
}
|
|
.form-container button {
|
|
background-color: #333333; /* Gray background color for the button */
|
|
color: #fff; /* Text color for the button */
|
|
padding: 10px 20px;
|
|
border: none;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
.form-container button:hover {
|
|
background-color: #888; /* Darker gray color on hover */
|
|
}
|
|
|
|
</style>
|
|
|
|
<div class="form-container">
|
|
<form id="postForm">
|
|
<textarea rows="5" cols="50" id="textField" name="textField">
|
|
</textarea>
|
|
<!-- <input type="text" id="textField" name="textField"> -->
|
|
<br>
|
|
<button type="button" onclick="sendPostRequest()">Send</button>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
function sendPostRequest() {
|
|
var textFieldData = document.getElementById("textField").value;
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
var url = "https://blog.ca.sual.in/api/message";
|
|
<!-- var url = "http://localhost:1313/apimessage"; -->
|
|
xhr.open("POST", url, true);
|
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
xhr.onreadystatechange = function () {
|
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
console.log(xhr.responseText);
|
|
}
|
|
};
|
|
var data = JSON.stringify({"text": textFieldData, "username": "totaly not a hacker", "gateway": "gateway1"});
|
|
xhr.send(data);
|
|
alert("I got your message, thanks!")
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
{{< /rawhtml >}}
|