Add files via upload
This commit is contained in:
parent
036d3ad751
commit
6df8045d5f
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>BuddyStart</title>
|
||||
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="text-align: center; width:75%;">
|
||||
<div style="text-align: center; width:300px;">
|
||||
<h3 id="response">Hello!</h3>
|
||||
<img src="https://vignette.wikia.nocookie.net/theofficalsovietronalds/images/9/97/9a3a58293fc74ca81bad0b9ce8072c11.png/revision/latest/scale-to-width-down/180?cb=20160912162144">
|
||||
<input id="search" type="text" style="width: 300px;" placeholder="Search the web!">
|
||||
</div>
|
||||
<div id="buttons" style="width: 50%;">
|
||||
<button type="button" id = "1" onclick="Joke()">Tell me a joke</button>
|
||||
<button type="button" id = "2" onclick="Games()">Play a game</button>
|
||||
<button type="button" id = "3" onclick="window.open('https://youtube.com')">Watch a video</button>
|
||||
<button type="button" id = "4" onclick="Social()">Socialize with Friends</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<style>
|
||||
div {
|
||||
margin: 0 auto;
|
||||
}
|
||||
button{
|
||||
width: 200px;
|
||||
background-color: blueviolet;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function Joke(){
|
||||
var jokes = ["Why did the javascript heap close shop? — It ran out of memory.", "A programmer puts two glasses on his bedside table before going to sleep. A full one, in case he gets thirsty, and an empty one, in case he doesn't.", "How did you make your friend rage? — I implemented a greek question mark in his JavaScript code.", "Why do Java programmers hate communism? — They don't want to live in a classless society."]
|
||||
alert(jokes[Math.floor(Math.random() * 4)])
|
||||
document.getElementById("response").innerHTML = "Hope you enjoyed the joke!"
|
||||
}
|
||||
document.getElementById('search').addEventListener('keypress', function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
window.location.href="https://duckduckgo.com/?q=" + document.getElementById("search").value
|
||||
}
|
||||
});
|
||||
function Games(){
|
||||
document.getElementById("buttons").innerHTML = '<button type="button" onclick="window.open(\'https://chess.com\')">Chess</button>\n <button type="button" id = "3" onclick="window.open(\'https://worldofsolitaire.com\')">Solitare</button>\n <button type="button" id = "3" onclick="Reverse()">Back</button>';
|
||||
document.getElementById("response").innerHTML = "Let's play a game!";
|
||||
}
|
||||
function Reverse(){
|
||||
document.getElementById("buttons").innerHTML = '<button type="button" id = "1" onclick="Joke()">Tell me a joke</button>\n <button type="button" id = "2" onclick="Games()">Play a game</button>\n <button type="button" id = "3" onclick="window.open(\'https://youtube.com\')">Watch a video</button>\n <button type="button" id = "4" onclick="Social()">Socialize with Friends</button>';
|
||||
document.getElementById("response").innerHTML = "Ok, maybe next time!";
|
||||
}
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue