-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
171 lines (144 loc) · 4.37 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="en">
<head>
<title>MailDown</title>
<meta charset="UTF-8" />
<link rel="icon" href="favicon.ico" />
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/codemirror.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/mode/markdown/markdown.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/mode/xml/xml.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/lib/codemirror.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/theme/material.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/theme/nord.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/theme/juejin.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/theme/base16-light.min.css" />
<script src="index.js"></script>
<link type="text/css" rel="stylesheet" href="index.css" />
<!-- <style type='text/css'>
* {
padding: 0;
margin: 0;
border: none;
}
html,
body {
background: white;
font-size: 18px;
color: #444;
overflow-x: hidden;
/* overflow: hidden; */
}
.main_layout {
display: grid;
grid-template-columns: 36rem 1fr;
width: 100vw;
height: 100vh;
/* overflow: hidden; */
}
#htmlContainer {
position: fixed;
top: calc(100% - 72px);
right: 0px;
z-index: 999;
width: 100%;
height: 100%;
overflow: hidden;
transition: all 0.35s ease-in-out;
box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.15);
}
#code {
outline: 1px solid red;
height: calc(100% - 48px);
}
.toolbar {
background-color: white;
padding: 1rem;
}
.CodeMirror {
width: 100%;
height: 100%;
}
#toggleContainer {
display: flex;
justify-content: end;
align-items: center;
gap: 1rem;
}
input[type=checkbox] {
height: 0;
width: 0;
visibility: hidden;
}
label {
cursor: pointer;
text-indent: -9999px;
width: 48px;
height: 32px;
box-shadow: inset 0px 0px 0px 1px rgba(0, 0, 0, 0.15);
background: moccasin;
display: block;
border-radius: 20px;
position: relative;
margin: 0px;
padding: 0px;
}
label:after {
content: '';
position: absolute;
top: 4px;
left: 4px;
width: 24px;
height: 24px;
background: white;
border-radius: 16px;
transition: 0.2s;
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.35), 0px 8.71728px 17.2408px rgba(0, 0, 0, 0.0185187), 0px 2.76435px 5.19761px rgba(0, 0, 0, 0.0225848), 0px 1.18477px 2.15882px rgba(0, 0, 0, 0.0264039), 0px 0.409114px 0.780803px rgba(0, 0, 0, 0.04);
}
input:checked+label {
background: PaleGreen;
}
input:checked+label:after {
left: calc(100% - 4px);
transform: translateX(-100%);
}
label:active:after {
width: 32px;
}
</style> -->
</head>
<body>
<div class="main_layout">
<div class="editorContainer">
<textarea id="editor" style="visibility: hidden;"></textarea>
</div>
<div class="renderContainer">
<div class="toolbar">
<div id="toggleContainer">
<input type="checkbox" id="switchElement">
<label id="billString" for="switchElement">Toggle</label>
</div>
</div>
<div id="render"></div>
<div id="code">
<textarea id="htmlCode" style="visibility: hidden;"></textarea>
</div>
</div>
<script type='text/javascript'>
window.addEventListener("load", function () {
let toggleSwitch = () => {
if (document.querySelector('#switchElement').checked) {
document.querySelector("#render").style.display = "none";
document.querySelector("#code").style.display = "block";
} else {
document.querySelector("#render").style.display = "block";
document.querySelector("#code").style.display = "none";
}
}
document.querySelector('#switchElement').onclick = toggleSwitch;
toggleSwitch();
});
</script>
</div>
</body>
</html>