-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (66 loc) · 1.87 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Word Couch</title>
</head>
<style>
body {
background-image: url("https://www.incimages.com/uploaded_files/image/970x450/rey-seven-nm-mZ4Cs2I-unsplash_397351.jpg");
}
textarea {
resize: none;
width: 50%;
height: 50vh;
display: block;
text-align: left;
font-size: 14px;
font-family: georgia;
margin: auto;
padding: 15px;
margin-top: 15vh;
border-color: rgb(0, 127, 185);
border-width: 5px;
}
input {
display: block;
margin: auto;
margin-top: 15px;
width: 35%;
height: 20px;
}
#banner {
position: absolute;
margin-top: 8%;
margin-left: 85%;
color: white;
font-family: georgia;
font-size: 24px;
}
</style>
<body>
<textarea id="story" placeholder="Start your story ..." spellcheck="false" ></textarea>
<input placeholder="Paste format code here" id="format" ></input>
<p id="banner" >#NaNoWriMo</p>
</body>
<script>
story = document.getElementById("story")
input = document.getElementById("format")
var parseCode = function()
{
code = input.value.split(",")
flag = false
for ( var i = 0; i < code.length; i++ )
{
if ( flag )
{
story.style[code[i-1]] = code[i]
flag = false
}
if ( i%2 == 0 )
{flag = true}
}
};
input.addEventListener("input", parseCode)
</script>
</html>