idk what did i do
This commit is contained in:
parent
9af8f7d3d6
commit
9111c63691
2 changed files with 53 additions and 15 deletions
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>HTML 5 Boilerplate</title>
|
<title>Vencord EAS</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/beercss@3.5.8/dist/cdn/beer.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/beercss@3.5.8/dist/cdn/beer.min.css" rel="stylesheet">
|
||||||
|
|
||||||
<script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.5.8/dist/cdn/beer.min.js"></script>
|
<script type="module" src="https://cdn.jsdelivr.net/npm/beercss@3.5.8/dist/cdn/beer.min.js"></script>
|
||||||
|
@ -19,31 +19,27 @@
|
||||||
<h3>Vencord EAS Client</h3>
|
<h3>Vencord EAS Client</h3>
|
||||||
<div class="field suffix border" style="margin-bottom: 0px;">
|
<div class="field suffix border" style="margin-bottom: 0px;">
|
||||||
<select id="endpoint">
|
<select id="endpoint">
|
||||||
<option>Get message</option>
|
<option value="get">Get message</option>
|
||||||
<option>🔑 Send message</option>
|
<option value="msg">🔑 Send message</option>
|
||||||
<option>🔑 Clear message</option>
|
<option value="clear">🔑 Clear message</option>
|
||||||
</select>
|
</select>
|
||||||
<i>arrow_drop_down</i>
|
<i>arrow_drop_down</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="field label border" style="margin-top: 5px; margin-bottom: 0px;">
|
<div class="field label border" style="margin-top: 5px; margin-bottom: 0px;">
|
||||||
<input type="password">
|
<input type="password" id="token">
|
||||||
<label>Token (if needed)</label>
|
<label>Token (if needed)</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="field label border" style="margin-top: 5px; margin-bottom: 10px;">
|
<div class="field label border" style="margin-top: 5px; margin-bottom: 10px;">
|
||||||
<input type="text">
|
<input type="text" id="msg">
|
||||||
<label>Message (if needed)</label>
|
<label>Message (if needed)</label>
|
||||||
</div>
|
</div>
|
||||||
<button class="responsive" style="margin-bottom: 20px;">
|
<button class="responsive" onclick="processSend()" style="margin-bottom: 20px;">
|
||||||
<i>rocket</i>
|
<i>rocket</i>
|
||||||
<span>Send</span>
|
<span>Send</span>
|
||||||
</button>
|
</button>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="field textarea label border">
|
<h6>Logs</h6>
|
||||||
<textarea readonly style="width: 100%;" id="log"></textarea>
|
<p id="log"></p>
|
||||||
<label>Logs</label>
|
<script src="index.js"></script>
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
42
front/index.js
Normal file
42
front/index.js
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
const socket = new WebSocket('wss://eas-ws.nin0.dev');
|
||||||
|
|
||||||
|
socket.onopen = function(event) {
|
||||||
|
log("Connection opened")
|
||||||
|
};
|
||||||
|
|
||||||
|
socket.onmessage = function(event) {
|
||||||
|
log("IN: " + event.data)
|
||||||
|
if(event.data.startsWith("MSG ")) {
|
||||||
|
alert(event.data.replace("MSG ", ""))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
socket.onclose = function(event) {
|
||||||
|
alert("Connection has been closed, refresh the page.");
|
||||||
|
};
|
||||||
|
|
||||||
|
function sendMessage(message) {
|
||||||
|
socket.send(message);
|
||||||
|
log("OUT: " + message)
|
||||||
|
}
|
||||||
|
|
||||||
|
function log(message) {
|
||||||
|
const logArea = document.getElementById("log");
|
||||||
|
const newVal = message + "<br/>" + logArea.innerHTML;
|
||||||
|
logArea.innerHTML = newVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
function processSend() {
|
||||||
|
const endpoint = document.getElementById("endpoint").value
|
||||||
|
if(endpoint == "get") {
|
||||||
|
sendMessage("GET")
|
||||||
|
}
|
||||||
|
const token = document.getElementById("token").value
|
||||||
|
const msg = document.getElementById("msg").value
|
||||||
|
if(endpoint == "msg") {
|
||||||
|
sendMessage(`MSG ${token} ${msg}`)
|
||||||
|
}
|
||||||
|
if(endpoint == "clear") {
|
||||||
|
sendMessage(`CLEAR ${token}`)
|
||||||
|
}
|
||||||
|
}
|
Reference in a new issue