-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.html
67 lines (60 loc) · 2.57 KB
/
home.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
<!-- Authors: {Nhu Nguyen, Billie Wei, Annie Lin, Joanne Koong} -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Stak Attak</title>
<meta name="keywords" content="stack overflow, harvard, annie lin, billie wei, joanne koong, nhu nguyen, hackathon">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/static/style.css" />
<noscript>
<link rel="stylesheet" href="/static/skel.css" />
</noscript>
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
</head>
<!--Google Analytics-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-70140809-1', 'auto');
ga('send', 'pageview');
</script>
<body>
<h1><a href="http://www.stakattak.me/">Stak Attak</a></h1>
<div>
<img id="gallery" src="/static/stakattak2.png" alt=""/>
</div>
<p>poetic <a href="http://stackoverflow.com/">stackoverflow</a> answer generator</p>
<p>made by <a href="http://www.anniel.in">annie lin</a>, <a href="http://www.billiewei.com">billie wei</a>, <a href="http://www.joannekoong.com/">joanne koong</a>, <a href="http://www.nhunguyen.me/">nhu nguyen</a></p>
<div id="form" align="center">
<form id="text" method="post">
<input id="sentences" type="number" min="1" placeholder="how many sentences? (larger number = slower response)" required><br>
<div><input id="tag" type="text" placeholder="one word tag to help generate answer (ex. swift)" ng-trim="false" required pattern="^[A-Za-z0-9]{1,25}$"required></div><br>
<input class="button" type="submit" value="Submit"/>
</form>
</div>
<br><br>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
$(document).ready(function(){
$('#form').submit(function(e){
var sentences = $('#sentences').val(),
tags = $('#tag').val(),
url;
e.preventDefault();
if (!(sentences > 0 && sentences < 50)){
$('#text').html('Try a more reasonable number.');
return;
}
var url = '/marks/' + sentences + '/' + tags;
$.getJSON(url, function(data){
$('#text').html(("<b>Result</b>:<br>" + data["answer"].replace(/(\\r\\n|\\n|\\r)/gm," ")).replace(/(\\r\\n|\\n|\\r)/gm," "));
})
});
})
</script>
</body>
</html>