-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze.html
135 lines (134 loc) · 4.23 KB
/
analyze.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<title>ANALYZE - Madhav</title>
<link rel="stylesheet" href="style.css">
<style>
article{
padding: 20px;
}
#input-field{
margin-top: 10px;
padding:20px;
width:100%;
resize:none;
background:transparent;
backdrop-filter:blur(10px);
color:white;
border-radius:20px;
border: 1px solid rgba(255, 255, 255, 0.3);
box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
transition: all 0.3s;
}
#input-field:focus{
transform: scale(1.1);
}
#submit-btn{
display: block;
margin-left: auto;
padding: 10px 30px;
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
cursor: pointer;
border-radius: 10px;
backdrop-filter: blur(5px);
box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
transition: all 0.3s;
}
#submit-btn:hover{
transform: scale(1.1);
}
.progress-bar{
position: relative;
margin: 30px auto;
height:50px;
max-width: 600px;
border: 1px solid white;
background-image: linear-gradient(to right, red, yellow, green);
border-radius: 10px;
overflow: hidden;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.3);
transition: transform 1s;
cursor: pointer;
}
.progress-bar:hover{
transform: scale(1.1);
}
#progress-fill{
position: absolute;
height: 100%;
width: 100%;
right: 0;
background-color: white;
transition: width 1s;
}
.header-ul{
display:none;
}
header{
background-image: url(./images/white_lines.png);
background-repeat:no-repeat;
margin-left: auto;
margin-right:50px;
cursor:pointer;
}
</style>
</head>
<body>
<header>
<ul class="header-ul">
<li><a href="/">MADHAV</a></li>
<li><a href="analyze.html">ANALYZE</a></li>
<li><a href="music.html">MUSIC</a></li>
<li><a href="news.html">NEWS</a></li>
<li><a href="game.html">GAME</a></li>
<li><a href="about.html">ABOUT US</a></li>
</ul>
</header>
<main style="flex-grow:1">
<article>
<div style="margin:auto; max-width: 600px;">
<label for="input-label">Describe your day, yourself, feelings, events, etc.</label>
<textarea id="input-field" rows="8"></textarea>
<button type="button" id="submit-btn">Analyze</button>
</div>
<div class="progress-bar">
<div id="progress-fill"></div>
</div>
<p id="response"></p>
</article>
</main>
</body>
<script src="jquery-3.7.1.min.js"></script>
<script>
document.querySelector("header").addEventListener("click", function() {
var headerUl = document.querySelector(".header-ul");
var head = document.querySelector("header");
if (headerUl.style.display === "none") {
headerUl.style.display = "flex";
head.style.backgroundImage = "none";
} else {
headerUl.style.display = "none";
}
});
$(document).ready(function(){
$("#submit-btn").click(function(e){
response = $("#input-field").val();
$.post({
url: "http://localhost:5000/process_commute2",
data: {response: response},
dataType: "text"
}).done(function(response){
response = JSON.parse(response)
progress = (response[0]/180)*100
$("#progress-fill").css("width", progress+"%")
$("#response").html(response[1])
});
})
})
</script>
</html>