-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
236 lines (215 loc) · 5.52 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>News Classification</title>
<link rel="icon" href="https://images.indianexpress.com/2018/10/fav-icon.png?w=32" sizes="32x32" />
<link rel="icon" href="https://images.indianexpress.com/2018/10/fav-icon.png?w=120" sizes="192x192" />
<link rel="apple-touch-icon" href="https://images.indianexpress.com/2018/10/fav-icon.png?w=120" />
<script>
$(document).ready(function(){
$('#title').focus();
$('#text').autosize();
});
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<style>
* {
outline:none;
border:none;
margin:0px;
padding:0px;
font-family:Courier, monospace;
}
body {
background:#333 url(https://static.tumblr.com/maopbtg/a5emgtoju/inflicted.png) repeat;
}
#paper {
color:#FFF;
font-size:20px;
}
#margin {
margin-left:12px;
margin-bottom:20px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
#text {
width:500px;
overflow:hidden;
background-color:#FFF;
color:#222;
font-family:Courier, monospace;
font-weight:normal;
font-size:24px;
resize:none;
line-height:40px;
padding-left:100px;
padding-right:100px;
padding-top:45px;
padding-bottom:34px;
background-image:url(https://static.tumblr.com/maopbtg/E9Bmgtoht/lines.png), url(https://static.tumblr.com/maopbtg/nBUmgtogx/paper.png);
background-repeat:repeat-y, repeat;
-webkit-border-radius:12px;
border-radius:12px;
-webkit-box-shadow: 0px 2px 14px #000;
box-shadow: 0px 2px 14px #000;
border-top:1px solid #FFF;
border-bottom:1px solid #FFF;
}
#title {
background-color:transparent;
border-bottom:3px solid #FFF;
color:#FFF;
font-size:20px;
font-family:Courier, monospace;
height:28px;
font-weight:bold;
width:220px;
}
#button {
cursor:pointer;
margin-top:20px;
float:right;
height:40px;
padding-left:24px;
padding-right:24px;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;
font-size:20px;
color:#FFF;
text-shadow: 0px -1px 0px #000000;
-webkit-border-radius:8px;
border-radius:8px;
border-top:1px solid #FFF;
-webkit-box-shadow: 0px 2px 14px #000;
box-shadow: 0px 2px 14px #000;
background-color: #62add6;
background-image:url(https://static.tumblr.com/maopbtg/ZHLmgtok7/button.png);
background-repeat:repeat-x;
}
#button:active {
zoom: 1;
filter: alpha(opacity=80);
opacity: 0.8;
}
#button:focus {
zoom: 1;
filter: alpha(opacity=80);
opacity: 0.8;
}
#wrapper {
width:700px;
height:auto;
margin-left:auto;
margin-right:auto;
margin-top:24px;
margin-bottom:100px;
}
#reset {
cursor:pointer;
margin-top:20px;
float:right;
margin-right: 13px;
height:40px;
padding-left:24px;
padding-right:24px;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;
font-size:20px;
color:#FFF;
text-shadow: 0px -1px 0px #000000;
-webkit-border-radius:8px;
border-radius:8px;
border-top:1px solid #FFF;
-webkit-box-shadow: 0px 2px 14px #000;
box-shadow: 0px 2px 14px #000;
background-color: #62add6;
background-image:url(https://static.tumblr.com/maopbtg/ZHLmgtok7/button.png);
background-repeat:repeat-x;
}
#reset:active {
zoom: 1;
filter: alpha(opacity=80);
opacity: 0.8;
}
#reset:focus {
zoom: 1;
filter: alpha(opacity=80);
opacity: 0.8;
}
/* Header/Logo Title */
.header {
padding: 60px;
text-align: center;
background: #1abc9c;
color: white;
font-size: 30px;
}
footer {
text-align: center;
padding: 12px;
background-color: #1cbc9b;
color: white;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div class="header">
<h1><img src="https://static.indianexpress.com/designer/explane/ie/ie-logo6.png" alt="logo" class="CToWUd"></h1>
<p>News Classification Model</p>
</div><br><br><br><br>
<div id="wrapper">
<form id="paper">
<div id="margin">Please enter the news headline...</div>
<textarea placeholder="Enter something here..." id="text" name="headline" rows="4" style="overflow: hidden; word-wrap: break-word; resize: none; height: 160px; "></textarea>
<br>
<input id="button" type="submit" value="Submit">
<input id="reset" type="reset" value="Reset" onClick="window.location.reload()">
<div id="result" style="display:none;"></div>
</form>
</div>
<footer>
<p>Author: Abhishek Dhoundiyal<br>
<a href="mailto:[email protected]">[email protected]</a></p>
</footer>
</body>
<script>
window.addEventListener( "load", function () {
function sendData() {
const XHR = new XMLHttpRequest();
// Bind the FormData object and the form element
const FD = new FormData( form );
// Define what happens on successful data submission
XHR.addEventListener( "load", function(event) {
// alert( event.target.responseText );
document.getElementById('result').style.display = "block";
document.getElementById('result').innerHTML= '';
document.getElementById('result').innerHTML += '<br>'+event.target.responseText;
} );
// Define what happens in case of error
XHR.addEventListener( "error", function( event ) {
alert( 'Oops! Something went wrong.' );
} );
// Set up our request
XHR.open( "POST", "/form" );
// The data sent is what the user provided in the form
XHR.send( FD );
}
// Access the form element...
const form = document.getElementById( "paper" );
// ...and take over its submit event.
form.addEventListener( "submit", function ( event ) {
event.preventDefault();
sendData();
} );
} );
</script>
</html>