-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditorv1.html
More file actions
124 lines (121 loc) · 2.87 KB
/
editorv1.html
File metadata and controls
124 lines (121 loc) · 2.87 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html>
<head>
<script src="./nml1.js"></script>
</head>
<body>
<div id="splitview">
<textarea id="editor" placeholder="input here"></textarea>
<div class="resizer" id="dragbar1"></div>
<div id="highlight"></div>
<div class="resizer" id="dragbar2"></div>
<div id="preview"></div>
</div>
</body>
</html>
<script>
function update() {
code = document.getElementById("editor").value;
let rt = new NMLc(code);
document.getElementById("preview").innerHTML = "";
document.getElementById("preview").appendChild(rt.getHTML());
}
update();
codearea = document.getElementById("editor")
codearea.oninput = update;
codearea.onkeypress = update;
</script>
<style>
#splitview {
position: absolute;
display: flex;
left: 0;top: 0;
margin: 0;
padding: 0;
width: 100%;
height: 100vh;
}
#splitview .resizer {
width: 0px;
padding-right: 5px;
padding-left: 5px;
background-color: black;
background:linear-gradient(to right, rgba(0,0,0,0) 30%, black, rgba(0,0,0,0) 70%)
}
#editor {
padding: 10px;
width: 400px;
height: calc(100% - 20px);
border: none;
resize: none;
outline: none;
font-family: monospace;
}
#highlight {
padding: 10px;
width: 400px;
height: calc(100% - 20px);
}
#preview {
padding: 10px;
width: calc(100% - 400px - 400px);
height: calc(100% - 20px);
}
</style>
<style>
/* NML */
.nml h1,.nml h2,.nml h3,.nml h4,.nml h5 {
margin: 10px;
margin-left: 0px;
}
.nml {
font-family: serif;
}
.nml code {
font-family: monospace;
display: inline-block;
}
.nml img{
max-height: 30vh;
width: 100%;
min-width: 100px;
}
.nml table {
border: 1px solid;
border-collapse: collapse;
min-width: 100px;
width: 40%;
}
.nml td {
border: 1px solid;
}
</style>
<style>
/* NML PALE BLUE */
.nml.page {
background-color: rgba(97, 215, 224, 0.1);
padding: 10px;
border-radius: 10px;
}
.nml h1,.nml h2,.nml h3,.nml h4,.nml h5 {
background: linear-gradient(to top, rgba(110, 139, 220, 0.3) 0%, rgba(0,0,0,0) 10%);
}
.nml h1:first-of-type {
background: linear-gradient(to right top, rgba(86, 115, 188, 0.3) 0%, rgba(0,0,0,0) 70%);
border-radius: 5px;
padding: 5px;
}
.nml pre {
margin: 20px;
}
.nml code {
background-color: rgb(226, 233, 241);
padding: 10px;
border-radius: 5px;
border: 1px solid rgb(151, 168, 194);
}
.nml td {
border-color: rgb(90, 119, 163);
padding: 2px;
}
</style>