html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Formate</title>
</head>
<body>
<textarea placeholder="Insert Text"></textarea>
<button onclick="color();" style="top:2%;z-index:6;">Submit</button>
<p></p>
<button onclick="reset();" style="top:15%;">Clear</button>
</body>
</html>
<!-- By @ValentinHacker, don't steal! -->
Enter to Rename, Shift+Enter to Preview
css
css
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
html
{
width:100%;
height:100%;
}
textarea
{
width:45%;
height:25%;
position:fixed;
left:3%;
top:2%;
z-index:5;
}
button
{
width:40%;
left:53%;
position:fixed;
height:10%;
min-height:30px;
z-index:5;
}
p
{
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function color() {
window.scrollBy(window.innerWidth, window.innerHeight);
var text = document.getElementsByTagName("textarea")[0].value+"\n";
for ( var loop = 0; loop <= text.length - 1; loop++) {
var p = document.createElement("span");
document.getElementsByTagName("p")[0].appendChild(p);
p.style.fontSize = Math.round(Math.random() * 40 + 10) + "px";
p.innerHTML = text[loop];
if (text[loop] != " " && text[loop] != "\n" && text[loop] != "\s") {
p.style.color = "#" + Math.floor(Math.random() * 16777216).toString(16);
p.style.background = "#" + Math.floor(Math.random() * 16777216).toString(16);
}//iftext
}//fortext
}//color
function reset() {
document.getElementsByTagName("p")[0].innerHTML = "";
document.getElementsByTagName("textarea")[0].value = "";
}//reset
//credits go to @cheeze for contributing!!! ^_^
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run