Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 99979df

Browse files
first commit
0 parents commit 99979df

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

‎index.html‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<!-- CSS Link -->
8+
<link rel="stylesheet" href="style.css" />
9+
<title>HTML, CSS and JavaScript Code Editor</title>
10+
</head>
11+
<body spellcheck="false">
12+
<textarea id="html" placeholder="HTML"></textarea>
13+
<textarea id="css" placeholder="CSS"></textarea>
14+
<textarea id="js" placeholder="JavaScript"></textarea>
15+
<iframe id="code"></iframe>
16+
17+
<script type="text/javascript" src="script.js"></script>
18+
</body>
19+
</html>

‎script.js‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function compile() {
2+
var html = document.getElementById('html');
3+
var css = document.getElementById('css');
4+
var js = document.getElementById('js');
5+
var code = document.getElementById('code').contentWindow.document;
6+
7+
document.body.onkeyup = function () {
8+
code.open();
9+
code.writeln(
10+
html.value +
11+
'<style>' +
12+
css.value +
13+
'</style>' +
14+
'<script>' +
15+
js.value +
16+
'</script>'
17+
);
18+
code.close();
19+
};
20+
}
21+
22+
compile();

‎style.css‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
body {
2+
text-align: center;
3+
}
4+
5+
textarea {
6+
width: 32%;
7+
float: top;
8+
min-height: 250px;
9+
overflow: scroll;
10+
margin: auto;
11+
display: inline-block;
12+
background: #f4f4f9;
13+
outline: none;
14+
font-family: Courier, sans-serif;
15+
font-size: 14px;
16+
}
17+
18+
iframe {
19+
bottom: 0;
20+
position: relative;
21+
width: 100%;
22+
height: 35em;
23+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /