-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
101 lines (97 loc) · 2.64 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
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>HTML 5 Boilerplate</title>
<!--link rel="stylesheet" href="style.css"--!>
<style>
body {
background:black;
}
.container {
height: 100vh;
}
.container img {
max-width: 100%;
max-height: 100%;
display: block;
margin: 0 auto;
}
.custom-field::after {
content: attr(aria-label);
}
.custom-field input {
border: none;
-webkit-appearance: none;
-ms-appearance: none;
-moz-appearance: none;
appearance: none;
background: rgba(224,255,232, .5);
padding: 12px;
border-radius: 3px;
position:fixed;
left:50%;
top:50%;
z-index:10000;
font-size: 50px;
}
button {
display:none;}
</style>
</head>
<body>
<div class="container">
<img id="logo" src="output_test.svg"/>
</div>
<div class="input">
{
<label class="custom-field" >
<input type="text" id="exec" size="100">
<button id="myButton" onclick="buttonCode()">Submit</button>
</label>
}
</div>
<script>
// load logo inline for animation on hover
const loadLogo = async () => {
// get logo, parse source text, and insert text into doc
document.write(await (await fetch("output_test.svg")).text());
// remove fallback img logo
document.querySelector("img#logo").remove();
console.log("AAAAAAAAAA");
};
loadLogo();
document.getElementById("exec")
.addEventListener("keyup", function(event) {
event.preventDefault();
loadLogo();
if (event.keyCode === 13) {
document.getElementById("myButton").click();
}
});
function buttonCode()
{
let text = document.getElementById("exec").value;
let data = {element: text};
fetch("http://127.0.0.1:5000/exec", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(data)
},
{
mode: 'no-cors',
method: 'post',
url: `http://127.0.0.1:5000/`,
credentials: 'include'
}
).then(res => {
window.location.reload();
console.log("Request complete! response:", res);
});
}
</script>
<!--script src="index.js"></script--!>
</body>
</html>