-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
76 lines (74 loc) · 2.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CodeMirror Example</title>
<!-- Include CodeMirror Stylesheet -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.63.1/codemirror.min.css">
<!-- Include CodeMirror JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.63.1/codemirror.min.js"></script>
<!-- Include CodeMirror JavaScript Mode -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.63.1/mode/htmlmixed/htmlmixed.min.js"></script>
<!-- Include CodeMirror JavaScript Theme -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.63.1/theme/material.min.css">
<style>
/* Style for CodeMirror and Result display */
html, body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#editor-container {
display: flex;
height: 100%;
}
#code-editor {
flex: 1;
height: 100%;
}
#result-container {
flex: 1;
height: 100%;
overflow: auto;
padding: 10px;
}
#verify-button {
margin-top: 10px;
padding: 10px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
</style>
</head>
<body>
<div id="editor-container">
<!-- CodeMirror Editor -->
<textarea id="code-editor"><!-- Write your HTML code here --></textarea>
<!-- Verify Button -->
<div id="result-container">
<button id="verify-button" onclick="verify()">Verify</button>
</div>
</div>
<script>
// Initialize CodeMirror Editor
var editor = CodeMirror.fromTextArea(document.getElementById("code-editor"), {
mode: "htmlmixed",
theme: "material",
lineNumbers: true,
lineWrapping: true,
autofocus: true
});
// Function to verify code
function verify() {
var code = editor.getValue();
// You can perform verification logic here
alert("Verifying code...");
}
</script>
</body>
</html>