diff --git a/CardSearching.html b/CardSearching.html new file mode 100644 index 0000000..e929a60 --- /dev/null +++ b/CardSearching.html @@ -0,0 +1,123 @@ + + + + + + + + + Card Searching in Bootstrap & JS + + + + + + + +

Product Searching

+ + + + + +
+ + +
+ +
+ + + + + + \ No newline at end of file diff --git a/Consumer.js b/Consumer.js new file mode 100644 index 0000000..3cab36a --- /dev/null +++ b/Consumer.js @@ -0,0 +1,100 @@ +// filter array +let filterarray =[]; + +// gallery card array + +let galleryarray = [ + { + id:1, + name : "organic", + src: "organic.jpeg", + desc : "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eligendi, delectus." + }, + { + id:2, + name : "common", + src: "common.jpeg", + desc : "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eligendi, delectus." + }, + { + id:3, + name : "meat processing", + src: "meat.jpeg", + desc : "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eligendi, delectus." + }, + { + id:4, + name : "rice", + src: "rice.jpeg", + desc : "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eligendi, delectus." + }, + { + id:5, + name : "onion", + src: "onion.jpeg", + desc : "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eligendi, delectus." + }, + { + id:6, + name : "wheat", + src: "wheat.jpeg", + desc : "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eligendi, delectus." + } + ]; + + + +showgallery(galleryarray); + + +// create function to show card + + +function showgallery(curarra){ + document.getElementById("card").innerText = ""; + for(var i=0;i +
+

${curarra[i].name}

+ + +

${curarra[i].desc}

+ + +
+
+ ` + } + +} + +// For Live Searching Product + +document.getElementById("myinput").addEventListener("keyup",function(){ + let text = document.getElementById("myinput").value; + + filterarray= galleryarray.filter(function(a){ + if(a.name.includes(text)){ + return a.name; + } + + }); + if(this.value==""){ + showgallery(galleryarray); + } + else{ + if(filterarray == ""){ + document.getElementById("para").style.display = 'block' + document.getElementById("card").innerHTML = ""; + } + else{ + + showgallery(filterarray); + document.getElementById("para").style.display = 'none' + } + } + +}); + + diff --git a/README.md b/README.md index ea6f800..7727d19 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -# Hackathon1.0 \ No newline at end of file +# PLANT-DISEASE-CLASSIFIER-WEB-APP-TENSORFLOWJS + +Tools and Technologies used 😇:- + +1. Tensorflow (for training the model in Google colab) +2. Tensorflow.js (Embedding the model for client-side/browser inference) +3. Javascript +4. Python +5. HTML and CSS + +Video Demonstration 😇 :- + + + +

You can access the project online HERE

+ diff --git a/app.js b/app.js new file mode 100644 index 0000000..a549010 --- /dev/null +++ b/app.js @@ -0,0 +1,127 @@ +const btn = document.querySelector('.talk'); +const content = document.querySelector('.content'); + +function speak(sentence) { + const text_speak = new SpeechSynthesisUtterance(sentence); + + text_speak.rate = 1; + text_speak.pitch = 1; + + window.speechSynthesis.speak(text_speak); +} + +function wishMe() { + var day = new Date(); + var hr = day.getHours(); + + if(hr >= 0 && hr < 12) { + speak("Good Morning Boss"); + } + + else if(hr == 12) { + speak("Good noon Boss"); + } + + else if(hr > 12 && hr <= 17) { + speak("Good Afternoon Boss"); + } + + else { + speak("Good Evening Boss"); + } +} + +window.addEventListener('load', ()=>{ + speak("Activating Inertia"); + speak("Going online"); + wishMe(); +}) + +const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; +const recognition = new SpeechRecognition(); + +recognition.onresult = (event) => { + const current = event.resultIndex; + const transcript = event.results[current][0].transcript; + content.textContent = transcript; + speakThis(transcript.toLowerCase()); +} + +btn.addEventListener('click', ()=>{ + recognition.start(); +}) + +function speakThis(message) { + const speech = new SpeechSynthesisUtterance(); + + speech.text = "I did not understand what you said please try again"; + + if(message.includes('hey') || message.includes('hello')) { + const finalText = "Hello Boss"; + speech.text = finalText; + } + + else if(message.includes('TOMATO BLIGHT') || message.includes('potato_early_blight')) { + const finalText = "EK AADMI"; + speech.text = finalText; + } + + else if(message.includes('name')) { + const finalText = "My name is Inertia"; + speech.text = finalText; + } + + else if(message.includes('open google')) { + window.open("https://google.com", "_blank"); + const finalText = "Opening Google"; + speech.text = finalText; + } + + else if(message.includes('open instagram')) { + window.open("https://instagram.com", "_blank"); + const finalText = "Opening instagram"; + speech.text = finalText; + } + + else if(message.includes('what is') || message.includes('who is') || message.includes('what are')) { + window.open(`https://www.google.com/search?q=${message.replace(" ", "+")}`, "_blank"); + const finalText = "This is what i found on internet regarding " + message; + speech.text = finalText; + } + + else if(message.includes('wikipedia')) { + window.open(`https://en.wikipedia.org/wiki/${message.replace("wikipedia", "")}`, "_blank"); + const finalText = "This is what i found on wikipedia regarding " + message; + speech.text = finalText; + } + + else if(message.includes('time')) { + const time = new Date().toLocaleString(undefined, {hour: "numeric", minute: "numeric"}) + const finalText = time; + speech.text = finalText; + } + + else if(message.includes('date')) { + const date = new Date().toLocaleString(undefined, {month: "short", day: "numeric"}) + const finalText = date; + speech.text = finalText; + } + + else if(message.includes('calculator')) { + window.open('Calculator:///') + const finalText = "Opening Calculator"; + speech.text = finalText; + } + + else { + window.open(`https://www.google.com/search?q=${message.replace(" ", "+")}`, "_blank"); + const finalText = "I found some information for " + message + " on google"; + speech.text = finalText; + } + + speech.volume = 1; + speech.pitch = 1; + speech.rate = 1; + + window.speechSynthesis.speak(speech); +} \ No newline at end of file diff --git a/bot.css b/bot.css new file mode 100644 index 0000000..4c0c6e2 --- /dev/null +++ b/bot.css @@ -0,0 +1,119 @@ +@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@100;200;300;400;500;600;700&display=swap"); + +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: "Roboto Mono", monospace; +} + +.navbar ul { + list-style: none; + padding-top: 6px; +} + +.navbar ul li { + background: none; + border: 2px solid rgba(59, 233, 10, 0.258); + width: 120px; + height: 40px; + text-align: center; + float: right; + position: relative; + line-height: 35px; + border-radius: 10px; + padding-top: 0px; +} + +.navbar ul li a { + text-decoration: none; + color: rgb(3, 2, 2); + font-size: 13px; + display: block; + border-radius: 10px; +} + +.navbar ul li a:hover { + background-color: none; + color: rgb(26, 255, 0); + border-radius: 10px; +} + +.navbar ul ul { + display: none; + font-size: 18px; + position: absolute; +} +.main { + min-height: 100vh; + position: relative; + width: 100%; + background: #000; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.main .image-container { + padding: 10px; +} + +.main .image-container .image { + width: 100%; + display: flex; + align-items: center; + justify-content: center; +} + +.main .image-container .image img { + width: 170px; + align-items: center; +} + +.main .image-container h1 { + color: #00bcd4; + text-align: center; + margin-bottom: 10px; + font-size: 40px; +} + +.main .image-container p { + color: #324042; + text-align: center; + margin-bottom: 40px; +} + +.main .input { + display: flex; + justify-content: center; + align-items: center; + width: 40vw; + height: 50px; + border-radius: 20px; + background: rgb(202 253 255 / 50%); +} + +.main .input .talk { + background: transparent; + outline: none; + border: none; + width: 50px; + height: 50px; + display: flex; + justify-content: center; + align-items: center; + font-size: 15px; + cursor: pointer; +} + +.main .input .talk i { + font-size: 20px; + color: #aed0d0; +} + +.main .input .content { + color: #aed0d0; + font-size: 15px; + margin-right: 20px; +} \ No newline at end of file diff --git a/bot.html b/bot.html new file mode 100644 index 0000000..1f7fb92 --- /dev/null +++ b/bot.html @@ -0,0 +1,56 @@ + + + + + + + + INERTIA - Virtual Assistant + + + + + + + + + + +