-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathideRealTime.html
54 lines (47 loc) · 1.38 KB
/
ideRealTime.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
<!DOCTYPE html>
<html>
<head>
<title>ideRealTime</title>
<!--FUNCTION HERE-->
<script>
function refresh (){
var textContent = document.getElementById('editor-textarea').value;
document.getElementById('viewer').srcdoc = textContent;
}
</script>
<!--BODY, HTML SHOULD GO TO 100% TO ALLOW DIVS TO REACH 100% HEIGHT-->
<style>
body, html{height:100%;}
*{
padding: 0;
margin: 0;
}
.main{
background: #ecf0f1;
width: 100%;
height: 100%;
display: inline-flex;
}
#editor-textarea{
width: 100%;
height: 95%;
margin: 10px;
padding: 5px;
}
#viewer{
background: white;
border: none;
width: 100%;
height: 95%;
margin: 10px;
border: 1px solid #3498db;
}
</style>
</head>
<body>
<div class="main">
<textarea id = "editor-textarea" onkeyup = "refresh()" placeholder = "Code Goes Here..."></textarea>
<iframe id="viewer"></iframe>
</div>
</body>
</html>