Skip to content

Commit

Permalink
voice_search_added_to_all_interm_pages
Browse files Browse the repository at this point in the history
  • Loading branch information
shruti-sen2004 committed Apr 15, 2024
1 parent 2c264af commit 2c1c9dc
Show file tree
Hide file tree
Showing 6 changed files with 591 additions and 6 deletions.
99 changes: 98 additions & 1 deletion SBH(intermediate Pages)/indexIntermediateCyber.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h3>DDOS Attack</h3>
</div>
</section>
<script src="script.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"></script>

<!-- Accessibility Mode Button -->
<div class="accessibility-button hover-speak" onclick="toggleAccessibilityMenu()"
Expand All @@ -88,13 +89,14 @@ <h3>DDOS Attack</h3>
<li><button class="hover-speak" onclick="toggleScreenReader()" id="screenReaderButton"
onmouseover="speakText('click here to change the screen reader mode')" onmouseleave="stopSpeaking()">Enable
Screen Reader</button></li>
<li><button onclick="toggleKeyboardNavigation()">Enable Keyboard Navigation</button></li>
<li><button onclick="toggleVoiceRecognition()" id="voiceRecognitionButton">Enable Voice Recognition</button></li>
</ul>
</div>

<script>
// accessibility js
var screenReaderEnabled = false;
var voiceRecognitionEnabled = false;

function toggleAccessibilityMenu() {
var menu = document.getElementById("accessibilityMenu");
Expand Down Expand Up @@ -127,6 +129,101 @@ <h3>DDOS Attack</h3>
function stopSpeaking() {
window.speechSynthesis.cancel();
}

function toggleVoiceRecognition() {
voiceRecognitionEnabled = !voiceRecognitionEnabled;
var menuButton = document.getElementById("voiceRecognitionButton");
if (voiceRecognitionEnabled) {
startVoiceRecognition();
menuButton.innerText = "Disable voice recognition";
} else {
stopVoiceRecognition();
menuButton.innerText = "Enaable voice recognition";
toggleAccessibilityMenu();
}
}

function startVoiceRecognition() {
if (annyang) {
annyang.start();
speakText("Voice recognition enabled");
}
}

function stopVoiceRecognition() {
if (annyang) {
annyang.abort();
speakText("Voice recognition disabled");
}
}

// Voice commands
if (annyang) {
var commands = {
'enable voice recognition': toggleVoiceRecognition,
'disable voice recognition': toggleVoiceRecognition,
'play quiz on cyber security': function() {
playquiz();
speakText('redirecting to Cyber Security quiz');
},
'play video one': function() {
playvideo1();
speakText('playing video on Basics of Cyber Security');
},
'play video two': function() {
playvideo2();
speakText('playing video on Ethical Hacking');
},
'play video three': function() {
playvideo3();
speakText('playing video on penetration Testing');
},
'play video four': function() {
playvideo4();
speakText('playing video on Cross-Site Scripting');
},
'play video five': function() {
playvideo5();
speakText('Playing video on Kali Linux Basics');
},
'play video six': function() {
playvideo6();
speakText('playing video on DDOS Attack');
},
};

annyang.addCommands(commands);
annyang.debug(true);

function playquiz() {
var url = '/Quizzes/indexquiz2cybersecurity.html';
window.location.href = url;
}
function playvideo1() {
var url = 'https://www.youtube.com/watch?v=njPY7pQTRWg';
window.location.href = url;
}
function playvideo2() {
var url = 'https://www.youtube.com/watch?v=cKEf8H9cQGM';
window.location.href = url;
}
function playvideo3() {
var url = 'https://www.youtube.com/watch?v=dqm-Lv03AN4';
window.location.href = url;
}
function playvideo4() {
var url = 'https://youtu.be/N-O4w6PynGY?si=vZ2jk4KyIt08B28D';
window.location.href = url;
}
function playvideo5() {
var url = 'https://youtu.be/l77LuRue_lM?si=LsXJyV1oTGhuoZR0';
window.location.href = url;
}
function playvideo6() {
var url = 'https://youtu.be/PTJ6UZz1pPQ?si=90laKqYcPheckEAp';
window.location.href = url;
}
}
</script>
</body>
</html>
101 changes: 100 additions & 1 deletion SBH(intermediate Pages)/indexIntermediateJSPage.HTML
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@
<li><button class="hover-speak" onclick="toggleScreenReader()" id="screenReaderButton"
onmouseover="speakText('click here to change the screen reader mode')" onmouseleave="stopSpeaking()">Enable
Screen Reader</button></li>
<li><button onclick="toggleKeyboardNavigation()">Enable Keyboard Navigation</button></li>
<li><button onclick="toggleVoiceRecognition()" id="voiceRecognitionButton">Enable Voice Recognition</button></li>
</ul>
</div>


<script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"></script>
<script>
// accessibility js
var screenReaderEnabled = false;
var voiceRecognitionEnabled = false;


function toggleAccessibilityMenu() {
var menu = document.getElementById("accessibilityMenu");
Expand Down Expand Up @@ -129,6 +133,101 @@ function speakText(text) {
function stopSpeaking() {
window.speechSynthesis.cancel();
}

function toggleVoiceRecognition() {
voiceRecognitionEnabled = !voiceRecognitionEnabled;
var menuButton = document.getElementById("voiceRecognitionButton");
if (voiceRecognitionEnabled) {
startVoiceRecognition();
menuButton.innerText = "Disable voice recognition";
} else {
stopVoiceRecognition();
menuButton.innerText = "Enaable voice recognition";
toggleAccessibilityMenu();
}
}

function startVoiceRecognition() {
if (annyang) {
annyang.start();
speakText("Voice recognition enabled");
}
}

function stopVoiceRecognition() {
if (annyang) {
annyang.abort();
speakText("Voice recognition disabled");
}
}

// Voice commands
if (annyang) {
var commands = {
'enable voice recognition': toggleVoiceRecognition,
'disable voice recognition': toggleVoiceRecognition,
'play quiz on js': function() {
playquiz();
speakText('redirecting to JS quiz');
},
'play video one': function() {
playvideo1();
speakText('playing video on Variables and datatypes');
},
'play video two': function() {
playvideo2();
speakText('playing video on Strings in JS');
},
'play video three': function() {
playvideo3();
speakText('playing video on Array in JS');
},
'play video four': function() {
playvideo4();
speakText('playing video on Classes and Objects in JS');
},
'play video five': function() {
playvideo5();
speakText('Playing video on Functions in JS');
},
'play video six': function() {
playvideo6();
speakText('playing video on Events in JS');
},
};

annyang.addCommands(commands);
annyang.debug(true);

function playquiz() {
var url = '/Quizzes/indexquiz1JS.html';
window.location.href = url;
}
function playvideo1() {
var url = 'https://youtu.be/Q4p8vRQX8uY?si=jf8hldSNHRBfOUrY';
window.location.href = url;
}
function playvideo2() {
var url = 'https://youtu.be/fozwNnFunlo?si=zZTIGMMZSho7dM3J';
window.location.href = url;
}
function playvideo3() {
var url = 'https://youtu.be/cejBux2gtEE?si=FSCNpKKobH8Hut64';
window.location.href = url;
}
function playvideo4() {
var url = 'https://youtu.be/N-O4w6PynGY?si=vZ2jk4KyIt08B28D';
window.location.href = url;
}
function playvideo5() {
var url = 'https://youtu.be/a_gwOwkbhZ0?si=sWuNj6_c0FSYfp7m';
window.location.href = url;
}
function playvideo6() {
var url = 'https://youtu.be/d4PN2rJD98g?si=bdHFVSMfmtOAOogO';
window.location.href = url;
}
}
</script>
</body>
</html>
99 changes: 98 additions & 1 deletion SBH(intermediate Pages)/index_intermediate(APT).html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ <h3>Mixture and Alligation</h3>
</div>
</section>
<script src="script.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"></script>

<!-- Accessibility Mode Button -->
<div class="accessibility-button hover-speak" onclick="toggleAccessibilityMenu()"
Expand All @@ -87,13 +88,14 @@ <h3>Mixture and Alligation</h3>
<li><button class="hover-speak" onclick="toggleScreenReader()" id="screenReaderButton"
onmouseover="speakText('click here to change the screen reader mode')" onmouseleave="stopSpeaking()">Enable
Screen Reader</button></li>
<li><button onclick="toggleKeyboardNavigation()">Enable Keyboard Navigation</button></li>
<li><button onclick="toggleVoiceRecognition()" id="voiceRecognitionButton">Enable Voice Recognition</button></li>
</ul>
</div>

<script>
// accessibility js
var screenReaderEnabled = false;
var voiceRecognitionEnabled = false;

function toggleAccessibilityMenu() {
var menu = document.getElementById("accessibilityMenu");
Expand Down Expand Up @@ -126,6 +128,101 @@ <h3>Mixture and Alligation</h3>
function stopSpeaking() {
window.speechSynthesis.cancel();
}

function toggleVoiceRecognition() {
voiceRecognitionEnabled = !voiceRecognitionEnabled;
var menuButton = document.getElementById("voiceRecognitionButton");
if (voiceRecognitionEnabled) {
startVoiceRecognition();
menuButton.innerText = "Disable voice recognition";
} else {
stopVoiceRecognition();
menuButton.innerText = "Enaable voice recognition";
toggleAccessibilityMenu();
}
}

function startVoiceRecognition() {
if (annyang) {
annyang.start();
speakText("Voice recognition enabled");
}
}

function stopVoiceRecognition() {
if (annyang) {
annyang.abort();
speakText("Voice recognition disabled");
}
}

// Voice commands
if (annyang) {
var commands = {
'enable voice recognition': toggleVoiceRecognition,
'disable voice recognition': toggleVoiceRecognition,
'play quiz on aptitude': function() {
playquiz();
speakText('redirecting to Aptitude quiz');
},
'play video one': function() {
playvideo1();
speakText('playing video on Fraction and Decimals');
},
'play video two': function() {
playvideo2();
speakText('playing video on Simplification');
},
'play video three': function() {
playvideo3();
speakText('playing video on Indices and Surds');
},
'play video four': function() {
playvideo4();
speakText('playing video on Permutation and Combination');
},
'play video five': function() {
playvideo5();
speakText('Playing video on Probability');
},
'play video six': function() {
playvideo6();
speakText('playing video on Mixture and Alligation');
},
};

annyang.addCommands(commands);
annyang.debug(true);

function playquiz() {
var url = '/Quizzes/indexquiz5aptitude.html';
window.location.href = url;
}
function playvideo1() {
var url = 'https://youtu.be/tnc9ojITRg4?si=HvhcCD6lL9GuBHqf';
window.location.href = url;
}
function playvideo2() {
var url = 'https://youtu.be/ZuMJFleXmiw?si=KJynMMSl_UeewRPG';
window.location.href = url;
}
function playvideo3() {
var url = 'https://youtu.be/jAbpPTpz2bQ?si=1VAVzAI6_3CGU2mz';
window.location.href = url;
}
function playvideo4() {
var url = 'https://youtu.be/ETiRE7N7pEI?si=Ta0E4Nyn3Z0ZoU8J';
window.location.href = url;
}
function playvideo5() {
var url = 'https://youtu.be/ximxxERGSUc?si=F9VQ0A8QK5t291UZ';
window.location.href = url;
}
function playvideo6() {
var url = 'https://youtu.be/OKSJDDAyqP0?si=3diTn4X6RScydVzs';
window.location.href = url;
}
}
</script>
</body>
</html>
Loading

0 comments on commit 2c1c9dc

Please sign in to comment.