You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.6 KiB

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="index.css">
<link href="img/icon.png" rel="icon" sizes="192x192">
<script defer src="js/cookie.js"></script>
<script defer src="js/visibility.js"></script>
<script defer src="js/index.js"></script>
<script defer src="js/processing.js"></script>
<div id="loadingWrapper">
<div id="progress">
<span>LOADING</span><span class="cursor blink">_</span>
<span class="details"></span>
<div class="barContainer">
<div class="bar"></div>
<p id="status"></p>
<div class="LW _l">
<img src="img/loadingWrapper_left.png">
<div class="LW _r">
<img src="img/loadingWrapper_right.png">
<div id="main">
<p id="output">&nbsp;</p>
<hr id="hr">
<p id="marker" class="triangle"></p>
<div id="left">
<div id="right">
<div id="executive">
<span N="1" class="item green">UI</span>
<span N="2" class="item green">ASSETS</span>
<span N="3" class="item yellow">FUNCTIONS</span>
<span N="4" class="item red">CHATBOT</span>
<span N="#" class="item red">PROCESSING</span>
<span N="#" class="item yellow">MEMORY</span>
<span N="#" class="item green">HEURISTICS</span>
<span N="#" class="item yellow">ENGINEERING</span>
<div id="bottom">
<div id="cmd" contenteditable="false">
<span contenteditable="true"></span>
<input id="submit" type="submit" value="exec">
<div id="cursor" class="blink"></div>
<p id="copyright">Samaritan <span class="version"></span> | Ask for <span style="color: red;">HELP</span></p>
let status = 0;
let recognition = new webkitSpeechRecognition();
recognition.continuous = true;
recognition.interimResults = true;
recognition.lang = 'en-US';
recognition.onresult = event => {
let result = event.results[event.results.length - 1];
let sentence = result[0].transcript;
nlp(sentence, [], result.isFinal);
recognition.onerror = err => {
if(err.error !== 'no-speech'){}
case 'network':
status = 2;
alert(`Voice recongition won't work unless you use Google's official Chrome browser.`);
case 'no-speech':
recognition.onend = () => { if(status === 1) recognition.start(); };
recognition.onstart = () => {
if(status === 1) return;
status = 1;