From a6bc6f7940da471116d31ad65b4862237dead549 Mon Sep 17 00:00:00 2001 From: Daniel Enesi Date: Fri, 26 Apr 2024 17:37:10 -0500 Subject: [PATCH] more changes. then I will move to gh-pages to add some more features --- events.js | 112 +----------------------------------------------------- setup.js | 30 --------------- 2 files changed, 1 insertion(+), 141 deletions(-) delete mode 100644 setup.js diff --git a/events.js b/events.js index 1b8c571..29d0af2 100644 --- a/events.js +++ b/events.js @@ -58,114 +58,4 @@ STARTBUTTON.onclick=()=>{ alert("Make changes then click START"); } }) -} -// if (!(questions=[...questionslist.children].map(i=>i.querySelector('.question').innerText)).length) return errors.innerHTML = 'No question added, Please add at least one questions to proceed'; -// if (!confirm('Proceed?')) return -// embassy.style.display='flex'; setup.style.display='none'; -// shouldusevideo.checked?you.style.display='none':interviewbox.style.display='none'; -// questionbox.innerText=(currentQuestion=questions[index])//setup non-video -// if (!shouldusevideo.checked) return; -// // while (!voice){} -// loading.loading = 1; -// userMedia = navigator.mediaDevices.getUserMedia({ -// audio: true, video: true, -// facingMode: {exact: "user"} -// }); -// userMedia.then(mediaStream=>{ -// //setup video recording -// stream = mediaStream; -// recorder = new MediaRecorder(mediaStream) -// recorder.ondataavailable=()=>{ -// loading.loading = 1; -// finalFile = new Blob([event.data], {type:"video/mp4"}) -// response.src=URL.createObjectURL(finalFile); -// refresher.style.display='block'; -// responseHolder.style.display='flex'; -// loading.loading = 0; -// } -// recorder.start(); -// video.srcObject = mediaStream; video.muted=true; -// }).catch(error=>{alert('an error occurred, exitting!!'); location.reload()}) -// video.onloadstart=()=>{ -// loading.loading=0; -// video.play(); -// let hours = new Date(Date.now()).getHours(), time; -// if(hours>16){ -// time ='evening' -// }else if(hours>11){ -// time='afternoon' -// }else if(hours>=0){ -// time='morning' -// } -// question = new SpeechSynthesisUtterance(` -// Good ${time}}. Welcome to your interview. -// Please click the repeat button to repeat any asked question, -// and click the forward button to go to the next question.`); -// question.voice =voice//= voices[+getAll('[name=voice]').filter(v=>v.checked)[0].value] -// voice; question.rate=.8; -// speechSynthesis.speak(question); -// question.onstart=()=>say.disabled=forward.disabled=true; -// question.onend = ()=>{setTimeout(()=>!video.paused&&(say.disabled=forward.disabled=false), randBtw(1000, 2500))}; -// // setup q and a -// } - -// } -// answerquestion.onclick=()=>{ -// event.preventDefault(); -// if (!answerbox.reportValidity()) return; -// answers.push(answerbox.value); answerbox.value=''; -// if(index+1>=questions.length){ -// //submit -// embassy.style.display='none' -// responses.style.display='flex'; -// questions.forEach((q, i)=>{ -// let r = responses.insertRow(); -// (r.insertCell()).innerText = q; -// (r.insertCell()).innerText = answers[i] -// }) -// return refresher.style.display='block' -// } -// questionbox.innerText=(currentQuestion = questions[++index]) -// if(index+2>questions.length) answerquestion.innerText='End interview'; -// } -// playorpause.onclick=()=>{ -// if (video.paused) { -// speechSynthesis.resume(); recorder.resume(); video.play(); playorpause.innerText = 'Pause Recording'; -// say.disabled=forward.disabled=false; -// } else { -// speechSynthesis.pause(); recorder.pause(); video.pause();playorpause.innerText = 'Continue Recording'; -// question.onstart(); -// } -// } -// forward.onclick=()=>{ -// question.onstart(); -// if(index>=questions.length){ -// //submit -// question.text = after.value?after.value:after.placeholder; -// speechSynthesis.speak(question) -// question.onend=()=>{ -// embassy.style.display='none' -// stream.getTracks().forEach(i=>i.stop()); -// recorder.stop(); -// } -// return -// } -// question.text=(currentQuestion=questions[index++]); -// speechSynthesis.speak(question) -// if(index+1>questions.length) forward.innerText='End interview'; -// } -// say.onclick=()=>{ -// speechSynthesis.cancel(); -// speechSynthesis.speak(question); -// } -// // addquestion.click() -// //for downloading -// save.onclick=()=>{ -// downloader.href=response.src; -// downloader.click(); -// } -// getAll('[name=voice]').forEach(v=>{ -// v.onchange=()=>{voice=speechSynthesis.getVoices()[+v.value]} -// }) - -// add voice recording to use instead of TALKing out \ No newline at end of file +} \ No newline at end of file diff --git a/setup.js b/setup.js deleted file mode 100644 index 5114720..0000000 --- a/setup.js +++ /dev/null @@ -1,30 +0,0 @@ - - -// // first get the saved questions if any -// let baseli = getS('li'), //the base for adding questions -// questions = localStorage.questions && JSON.parse( -// localStorage.questions), currentQueston -// , index = 0, answers = [], userMedia -// , recorder, stream, voices = speechSynthesis.getVoices() -// , voice, question, downloader = make('a'); -// downloader.download = 'interview.mp4'; -// if (questions) { -// questions.forEach((q,i)=>{ -// makeQuestion(q, 1 + i) -// }) -// } -// function mov() { - -// p.then(mediaStream=>{ -// m = MediaRecorder; -// video.onloadedmetadata = (x)=>{ -// confirm('play?') && video.play(); -// a.push(x) -// } -// MediaRecorder.start(); -// }); - -// p.catch(err=>console.log(err)) -// } -// // startbutton.onclick = mov -// loading.loading = 0;