-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup.html
98 lines (93 loc) · 2.97 KB
/
backup.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Markup</title>
<link rel="stylesheet" href="styles.css" />
<!-- font awesome -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<!-- React -->
<script
crossorigin
src="https://unpkg.com/react@17/umd/react.development.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"
></script>
<!-- Babel -->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"
integrity="sha512-kp7YHLxuJDJcOzStgd6vtpxr4ZU9kjn77e6dBsivSz+pUuAuMlE2UTdKB7jjsWT84qbS8kdCWHPETnP/ctrFsA=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<!-- Marked -->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.2/marked.min.js"
integrity="sha512-hzyXu3u+VDu/7vpPjRKFp9w33Idx7pWWNazPm+aCMRu26yZXFCby1gn1JxevVv3LDwnSbyKrvLo3JNdi4Qx1ww=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
</head>
<body>
<!-- body -->
<div id="app"></div>
<div>
<div id="markdown_editor">
<textarea
name="editor"
id="editor"
oninput="previewData()"
class="editor"
></textarea>
</div>
<div id="preview">
{/* preview data using iframe */}
<iframe id="output-frame"></iframe>
</div>
</div>
<script>
// get editor value
function previewData() {
var editor = document.getElementById("editor").value;
var iframe = document.getElementById("output-frame");
iframe.src = "data:text/html;charset=utf-8," + encodeURI(editor);
}
</script>
<!-- create a react script -->
<script type="text/babel">
// create a react component
function App() {
return (
<></>
// <div>
// <div id="markdown_editor">
// <textarea
// name="editor"
// id="editor"
// oninput="previewData()"
// class="editor"
// ></textarea>
// </div>
// <div id="preview">
// {/* preview data using iframe */}
// <iframe id="output-frame"></iframe>
// </div>
// </div>
);
}
// render the react component
ReactDOM.render(<App />, document.querySelector("#app"));
</script>
<!-- <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script> -->
</body>
</html>