-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtscn2html.html
40 lines (40 loc) · 1000 Bytes
/
tscn2html.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
<style>
* {
padding: 0;
margin: 0;
}
#source, #result {
width: 50%;
height: 100%
}
#button {
width: 5rem;
height: 5rem;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 3em;
}
</style>
<form spellcheck="false"><textarea id="source"></textarea><textarea id="result"></textarea></form>
<button id="button" onclick="convert()">▶️</button>
<script>
var source = document.getElementById('source')
var result = document.getElementById('result')
var process = {
argv: []
}
function require(mod){
return {
readFileSync(file, enc){
return (file == 'test.tscn') ? source.value : ''
},
writeFileSync(file, content){
if(file === 'test.html')
result.value = content
}
}
}
</script>
<script src="tscn2html.js"></script>