Casual_blog/content/whoami/contact_me.md

75 lines
1.8 KiB
Markdown
Raw Normal View History

+++
title = 'Contact me'
draft = false
+++
Chat with me on:
2024-05-21 05:52:25 +00:00
- XMPP: [casual@pwned.life](xmpp://casual@pwned.life)
Or write your message here (with contact information) and I will contact you:
<!--more-->
{{< 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();
2024-03-28 22:32:34 +00:00
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 >}}