import DeviceDetector from "https://cdn.skypack.dev/device-detector-js@2.2.10";
const mpHands = window;
const drawingUtils = window;
const controls = window;
const controls3d = window;
// Usage: testSupport({client?: string, os?: string}[])
// Client and os are regular expressions.
// See: https://cdn.jsdelivr.net/npm/device-detector-js@2.2.10/README.md for
// legal values for client and os
testSupport([
{ client: 'Chrome' },
]);
const utterThis = new SpeechSynthesisUtterance();
const synth = window.speechSynthesis;
let ourText = "";
let j = 0, res = "", diff_res = "", contor = 0,inauntru = 0;
function changeInHtml(data){
if(res == data.result)
j++;
else{
j = 1;
res = data.result;
}
if(j == 3 && (diff_res != res || res == "")){
console.log(data.result)
console.log(inauntru)
if(data.result == "greeting" && contor == 0)
{
addBuffer("Hi everyone,so nice to see you all here today!");
ourText = "Hi everyone,so nice to see you all here today!";
utterThis.text = ourText
synth.speak(utterThis)
contor++;
}
if(data.result == "how" && contor == 1)
{
document.getElementById("p3").innerHTML = " ";
addBuffer("How are you all feeling today?");
ourText = "How are you all feeling today?";
utterThis.text = ourText
synth.speak(utterThis)
contor++;
}
if(data.result == "custom2" && contor == 2)
{
document.getElementById("p3").innerHTML = " ";
addBuffer("Our inability to form deep connections in a world where we are more connected than ever!");
ourText = "Today I wanted to come here and raise some awareness about a big problem everyone encounters. Our inability to form deep connections in a world where we are more connected than ever!";
utterThis.text = ourText
synth.speak(utterThis)
contor++;
}
if(contor > 2)
{
if(data.result != "custom1")
{
if(data.result == "okay" && inauntru == 0)
{
ourText = document.getElementById("p3").innerHTML;
utterThis.text = ourText
synth.speak(utterThis)
document.getElementById("p3").innerHTML = " ";
return;
}
if(data.result == "custom2")
{
addBuffer("Together we can change the world!This is only the beginning!");
}
else
{
addBuffer(data.result);
}
}
if(data.result == "custom1" && inauntru == 0)
{
document.getElementById("p3").innerHTML = " ";
inauntru = 1;
}
else if(data.result == "custom1" && inauntru == 1)
{
ourText = document.getElementById("p3").innerHTML;
utterThis.text = ourText
synth.speak(utterThis)
document.getElementById("p3").innerHTML = " ";
inauntru = 0;
}
}
diff_res = res;
j = 0;
}
}
function addBuffer(data){
document.getElementById("p3").innerHTML += " " + data;
}
function isCorrectData(data){
if(data.result != "no data"){
changeInHtml(data);
document.getElementById("p4").innerHTML = '