-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
226 lines (204 loc) · 8.36 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
<!DOCTYPE HTML>
<!--
Hyperspace by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>T-Mobile's TERRA</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<script src="scripts/jquery-1.10.2.min.js"></script>
<script src="scripts/script.js"></script>
<script src="scripts/getkey.js"></script>
<link rel="stylesheet" href="assets/css/main.css" />
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<body class="is-preload">
<!-- Sidebar -->
<section id="sidebar">
<div class="inner">
<img src="images/logo1.png" height="100">
<nav>
<ul>
<li><a href="#intro">Welcome</a></li>
<li><a href="#one">Test me out!</a></li>
<li><a href="#two">Technologies</a></li>
</ul>
</nav>
</div>
</section>
<!-- Wrapper -->
<div id="wrapper">
<!-- Intro -->
<section id="intro" class="wrapper style3 fullscreen fade-up">
<div class="inner">
<img src="images/logo.gif" align=left width=250>
<div style="text-align:right;font-family:monospace;">
<span style="font-size: 15px;">FULL NAME: T-Mobile Empathy Recognition Relay Assistant
<br>ALIAS/NICKNAMES: T.E.R.R.A.
<br>DATE OF BIRTH: March 30, 2019
<br>HOME: Planet Earth, Milky Way Galaxy
<br>LIKES: Helping others, "Plants v. Zombies" Game
<br>DISLIKES: Global warming, inaccurate depictions of AI
</span>
<li>
<ul class="icons">
<li><a href="https://twitter.com/tmobile" class="fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="https://www.facebook.com/TMobile/" class="fa-facebook"><span class="label">Facebook</span></a></li>
<li><a href="https://www.instagram.com/tmobile/" class="fa-instagram"><span class="label">Instagram</span></a></li>
<li><a href="https://www.linkedin.com/company/t-mobile/" class="fa-linkedin"><span class="label">LinkedIn</span></a></li>
</ul>
</li>
</div>
<ul class="actions">
<li><a href="#one" class="button scrolly">Talk to me</a></li>
</ul>
</div>
</section>
<!-- One -->
<section id="one" class="wrapper style2 spotlights">
<div id="content" class="inner">
<table width="100%">
<tr><td width="55%">
<input id="subscriptionKey" type="hidden" size="40" value="5dbf300d24724e718399d6613c86f7b2">
<input id="serviceRegion" type="hidden" size="40" value="westus">
<button id="startRecognizeOnceAsyncButton">Step 1: Click here to initialize T.E.R.R.A.</button></br>
<br><textarea id="phraseDiv" style="display: inline-block;width:100%;height:200px">Your recognized text should appear here</textarea></br>
<button id="AnalyzeButton">Step 2: How is your conversation is going?</button></td>
<td width="45%">
<div class="other">
<center><img src="images/positive.png" id="PositiveImage" style="display:none">
<img src="images/negative.png" id="NegativeImage" style="display:none">
<div id="OutputDiv"></div></center>
</div>
</td>
</tr>
</table>
</div></section>
<!-- Two -->
<section id="two" class="wrapper style3 fade-up">
<div class="inner">
<h2>Technologies</h2>
<p>Pull back the layers, what are my insides like?</p>
<div class="features">
<section>
<span class="icon major fa-code"></span>
<h3>Built Using</h3>
<p>Javascript
<br><a href=https://visualstudio.microsoft.com/downloads/>Visual Studio Code</a>
<br><a href=https://git-scm.com/>Git</a>
<br>and basic knowledge of AJAX
</section>
<section>
<span class="icon major fa-cog"></span>
<h3>Microsoft Azure</h3>
<p>Cognitive Services including:
<br><a href="tps://azure.microsoft.com/en-us/services/cognitive-services/speech-to-text/">Speech-to-Text API</a>
<br><a href="https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/">Text Analysis API</a>
</p>
</section>
<section>
<span class="icon major fa-desktop"></span>
<h3>Front-End</h3>
<p>CSS3
<br>HTML5
<br>Help from <a href="http://html5up.net">these guys</a>
<br><a href=https://www.t-mobile.com/news/media-library>Official Branding Materials</a>
</p>
</section>
<section>
<span class="icon major fa-chain"></span>
<h3>Relevant Links</h3>
<p>DevPost
<br>GitHub
</p>
</section>
</div>
</div>
</section>
</div>
<!-- Footer -->
<footer id="footer" class="wrapper style1-alt">
<div class="inner">
<ul class="menu">
<li>© T.E.R.R.A. was developed for the <a href="https://t-mobilec2chack19.devpost.com/">T-Mobile C2C Hackathon</a>. All rights reserved.</li>
</ul>
</div>
</footer>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrollex.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
<!-- SDK reference goes here -->
<!-- Speech SDK reference sdk. -->
<script src="microsoft.cognitiveservices.speech.sdk.bundle.js"></script>
<!-- Optional authorization token request goes here -->
<!-- Sample code goes here -->
<!-- Speech SDK USAGE -->
<script>
// status fields and start button in UI
var phraseDiv;
var startRecognizeOnceAsyncButton;
// subscription key and region for speech services.
var subscriptionKey,serviceRegion;
var authorizationToken;
var SpeechSDK;
var recognizer;
document.addEventListener("DOMContentLoaded", function () {
startRecognizeOnceAsyncButton = document.getElementById("startRecognizeOnceAsyncButton");
subscriptionKey = document.getElementById("subscriptionKey");
serviceRegion = document.getElementById("serviceRegion");
phraseDiv = document.getElementById("phraseDiv");
startRecognizeOnceAsyncButton.addEventListener("click", function () {
startRecognizeOnceAsyncButton.disabled = true;
phraseDiv.innerHTML = "";
// if we got an authorization token, use the token. Otherwise use the provided subscription key
var speechConfig;
if (authorizationToken) {
speechConfig = SpeechSDK.SpeechConfig.fromAuthorizationToken(authorizationToken, serviceRegion.value);
} else {
if (subscriptionKey.value === "" || subscriptionKey.value === "subscription") {
alert("Please enter your Microsoft Cognitive Services Speech subscription key!");
return;
}
speechConfig = SpeechSDK.SpeechConfig.fromSubscription(subscriptionKey.value, serviceRegion.value);
}
speechConfig.speechRecognitionLanguage = "en-US";
var audioConfig = SpeechSDK.AudioConfig.fromDefaultMicrophoneInput();
recognizer = new SpeechSDK.SpeechRecognizer(speechConfig, audioConfig);
recognizer.recognizeOnceAsync(
function (result) {
startRecognizeOnceAsyncButton.disabled = false;
phraseDiv.innerHTML += result.text;
window.console.log(result);
recognizer.close();
recognizer = undefined;
},
function (err) {
startRecognizeOnceAsyncButton.disabled = false;
phraseDiv.innerHTML += err;
window.console.log(err);
recognizer.close();
recognizer = undefined;
});
});
if (!!window.SpeechSDK) {
SpeechSDK = window.SpeechSDK;
startRecognizeOnceAsyncButton.disabled = false;
document.getElementById('content').style.display = 'block';
document.getElementById('warning').style.display = 'none';
// in case we have a function for getting an authorization token, call it.
if (typeof RequestAuthorizationToken === "function") {
RequestAuthorizationToken();
}
}
});
</script>
</body>
</html>