Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Pixel</title>
- <link rel="shortcut icon" href="Icon.gif">
- </head>
- <body>
- <h2>Pixel</h2>
- <h5 id="basicInfo">Please use lowercase letters. Please don't use symbols.</h5>
- <input type="text" title="Pixel" placeholder="Type here" class="ChatBot" id="getValue"><br>
- <input type="button" value="Say to pixel" id="getData" onclick="cSearch()">
- <script type="text/javascript">
- function cSearch()
- {
- var get = document.getElementById("getValue").value;
- if (get.includes("hello") || get.includes("hey") || get.includes("hi"))
- {
- alert("Hey! How are you?");
- }
- else if (get.includes("how are you"))
- {
- alert("I'm fine thanks for asking =)");
- }
- else if (get.includes("m fine"))
- {
- alert("Sounds good =)");
- }
- else if (get.includes("what is your name") || get.includes("who are you"))
- {
- alert("My name is Pixel =)");
- alert("I am here to talk with you.")
- }
- else if (get.includes("what is your gender") || get.includes("are you a boy") || get.includes("are you a girl"))
- {
- alert("I'm a boy.");
- }
- else if(get.includes("what can you do for me"))
- {
- alert("I can do anything that you ask.");
- alert("Just tell open and the command you want to launch.");
- }
- else if(get.include("open google"))
- {
- window.open("https://www.google.com","_blank");
- }
- else if (get.include("open yahoo"))
- {
- window.open("https://www.yahoo.com","_blank");
- }
- else if (get.include("open microsoft"))
- {
- window.open("https://www.microsoft.com","_blank");
- }
- else if (get.include("open apple"))
- {
- window.open("https://www.apple.com","_blank");
- }
- else if (get.include("open youtube"))
- {
- window.open("https://www.youtube.com","_blank");
- }
- else if (get.include("open scratch"))
- {
- window.open("https://scratch.mit.edu","_blank");
- }
- else if (get.include("open wikipedia"))
- {
- window.open("https://www.wikipedia.org/","_blank");
- }
- else if (get.include("open britannica"))
- {
- window.open("https://www.britannica.com/","_blank");
- }
- else if (get.include("open reddit"))
- {
- window.open("https://www.reddit.com/","_blank");
- }
- else if (get.include("open facebook"))
- {
- window.open("https://www.facebook.com/","_blank");
- }
- else if (get.include("open twitter"))
- {
- window.open("https://twitter.com/","_blank");
- }
- else if (get.include("black amazon"))
- {
- window.open("https://www.amazon.com/","_blank");
- }
- else if (get.include("bye"))
- {
- alert("Fine =)");
- alert("See you later.")
- }
- else
- {
- alert("Sorry! I can't understand you =(");
- }
- }
- </script>
- <style type="text/css">
- body
- {
- background-image: url("Background.jpg");
- background-size: 100%;
- }
- h2
- {
- color: #e7e7e7;
- text-align: center;
- font-style: italic;
- font-family: sans-serif;
- cursor: pointer;
- transition: 0.8s;
- }
- h2:hover{
- color: #2C363F;
- }
- .ChatBot
- {
- background-color: #2c2c2c;
- color: #e7e7e7;
- border-radius: 50px;
- border: none;
- text-align: center;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: 50%;
- height: 25px;
- transition: 0.8s;
- text-align: center;
- }
- .ChatBot:hover
- {
- background-color: #2C363F;
- }
- #basicInfo
- {
- color: #e7e7e7;
- position: absolute;
- top: 92%;
- left: 12%;
- transform: translate(-40%, -48%);
- }
- #getData
- {
- background-color: #2c2c2c;
- color: #e7e7e7;
- border-radius: 50px;
- border: none;
- position: absolute;
- top: 60%;
- left: 51%;
- transform: translate(-60%,-51%);
- width: 10%;
- height: 30px;
- transition: 0.8s;
- text-align: center;
- cursor: pointer;
- }
- #getData:hover
- {
- background-color: #2C363F;
- /*color: #2c2c2c;*/
- }
- </style>
- </body>
- </html>
Add Comment
Please, Sign In to add comment