forked from jdomizz/hydra-element
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (44 loc) · 1.18 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><hydra-element></title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🍬</text></svg>">
<style>
body {
margin: 0;
font-family: monospace;
background-color: #242427;
}
textarea {
width: 100%;
height: 100%;
z-index: 1;
position: fixed;
color: #d6bb21;
background: transparent;
border: 0;
}
textarea:focus {
outline: none;
}
hydra-element {
width: 100%;
height: 100vh;
display: flex;
}
</style>
<script defer>
const keypressHandler = (event) => {
if (event.key === '\n') {
document.querySelector('hydra-element').code = document.querySelector('textarea').value
}
}
</script>
<script type="module" src="./index.js"></script>
</head>
<body onkeypress="keypressHandler(event)">
<textarea name="editor" spellcheck="false"></textarea>
<hydra-element></hydra-element>
</body>
</html>