-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault1.html
More file actions
54 lines (49 loc) · 2.35 KB
/
default1.html
File metadata and controls
54 lines (49 loc) · 2.35 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Live Code Editor</title>
<link rel="stylesheet" href="default.css">
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
<script src="https://kit.fontawesome.com/d01fd9c369.js" crossorigin="anonymous"></script>
</head>
<body>
<p><b><i class="fa-solid fa-bug"></i> CodeCraft!</b></p>
<header class="header">
<nav class="navbar">
<a href="login.php"><i class="fa-solid fa-right-to-bracket"></i> Log-in</a>
<a href="signup.php" target="_blank"><i class="fa-solid fa-user-plus"></i> Signup</a>
</nav>
</header>
<div class="container">
<div class="left">
<label> <i class="fa-brands fa-html5"></i>HTML</label>
<textarea id="html-code" onkeyup="run()"> </textarea>
<button class="button-851" onclick="download('html-code')"><i class="fa-solid fa-download"></i> HTML</button>
<label> <i class="fa-brands fa-css3-alt"></i>CSS</label>
<textarea id="css-code" onkeyup="run()"> </textarea>
<button class="button-852" onclick="download('css-code')"><i class="fa-solid fa-download"></i> CSS</button>
<label> <i class="fa-brands fa-js"></i>Javascript</label>
<textarea id="java-code" onkeyup="run()"> </textarea>
<button class="button-853" onclick="download('java-code')"><i class="fa-solid fa-download"></i> JavaScript</button>
</div>
<div class="right">
<label class="xyz"><i class="fa-regular fa-circle-play"></i> Output</label>
<iframe id="output"></iframe>
</div>
</div>
<script>
function run(){
let htmlCode = document.getElementById("html-code").value;
let cssCode = document.getElementById("css-code").value;
let jsCode = document.getElementById("java-code").value;
let output = document.getElementById("output");
output.contentDocument.body.innerHTML = htmlCode + "<style>" + cssCode + "</style>";
output.contentWindow.eval(jsCode);
}
function download(id){
alert("Not Available without Log-in");
}
</script>
</body>
</html>