-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
138 lines (131 loc) · 3.54 KB
/
index.html
File metadata and controls
138 lines (131 loc) · 3.54 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
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>WebCoder</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="header">
<div class="header_main">
<a href="index.html" class="logo">WebCoder</a>
<div class="controls">
<input type="radio" name="control" id="_c1" onclick="handle(this);" value="1" />
<label for="_c1">
<span>CSS</span>
</label>
<input type="radio" name="control" id="_c2" onclick="handle(this);" value="2" />
<label for="_c2">
<span>HTML</span>
</label>
<input type="radio" name="control" id="_c3" onclick="handle(this);" value="3" checked />
<label for="_c3">
<span>HTML & CSS</span>
</label>
<input type="radio" name="control" id="_c4" onclick="handle(this);" value="4" />
<label for="_c4">
<span>RESULT</span>
</label>
</div>
</div>
</div>
<div class="content">
<iframe src="./webcoder.html" id="f1"></iframe>
</div>
<div class="coder" id="coder">
<div class="wrap">
<div class="cssbox" id="cssbox">
<textarea id="css1" spellcheck="false">
.logo{
padding:20px;
font-size:33pt;
text-align:center;
color:rgba(0, 0, 0, 0.5);
font-weight:bolder;
text-shadow: 2px 1px 2px #E07474;
background:url('download.png') rgba(163, 70, 70, 0.9);
box-shadow:8px 8px 8px 1px #571212;
margin:100px auto;
width:250px;
}
body{
background-color:white;
background-image: linear-gradient(90deg, rgba(142, 145, 83, 0.5) 50%, rgba(0, 0, 0, 0) 50%),
linear-gradient(rgba(201, 179, 67, 0.5) 50%, rgba(0, 0, 0, 0) 50%);
background-size:50px 50px;
}
.chat{
left:200px;
position:relative;
width:80px;
height:20px;
background-color:#ab00ff;
padding:7px;
border-radius:3px;
box-shadow:3px 3px 4px 1px gray;
-webkit-transform:rotate(-24deg);
-moz-transform:rotate(-25deg);
}
.chat:before{
content:" ";
position:absolute;
left:-13px;
border-right:15px solid #ab00ff;
border-top:10px solid transparent;
border-bottom:10px solid transparent;
}
</textarea>
</div>
<div class="htmlbox" id="htmlbox">
<textarea id="html1" spellcheck="false">
<p class="logo">WebCoder</p>
<div class="chat">chat me!</div>
</textarea>
</div>
</div>
</div>
<script>
document.getElementById("f1").onload = function render(){
document.getElementById("html1").onkeyup = function(){
window.frames[0].document.getElementById("b1").innerHTML = document.getElementById("html1").value;
};
document.getElementById("css1").onkeyup = function(){
window.frames[0].document.getElementById("s1").innerHTML = document.getElementById("css1").value;
};
};
function handle(r){
var coder = document.getElementById("coder");
var frm = document.getElementById("f1");
var cssdiv = document.getElementById("cssbox");
var htmldiv = document.getElementById("htmlbox");
if(r.value == 1){
cssdiv.style.width = "100%";
cssdiv.style.display = "inline-block";
htmldiv.style.display = "none";
frm.style.height = "calc(100% - 210px)";
coder.style.height = "200px";
return;
}else
if(r.value == 2){
cssdiv.style.display = "none";
htmldiv.style.display = "inline-block";
htmldiv.style.width = "100%";
frm.style.height = "calc(100% - 210px)";
coder.style.height = "200px";
return;
}else
if(r.value == 3){
cssdiv.style.display = htmldiv.style.display = "inline-block";
cssdiv.style.width = htmldiv.style.width = "calc(50% - 5px)";
frm.style.height = "calc(100% - 210px)";
coder.style.height = "200px";
return;
}
if(r.value == 4){
coder.style.height = "0px";
frm.style.height = "100%";
return;
}
}
</script>
</html>