-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing free version of ChatGPT to make apps
- Loading branch information
Showing
3 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Joke Teller</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Random Joke Generator</h1> | ||
<div id="joke" class="joke-container"> | ||
Click the button to hear a joke! | ||
</div> | ||
<button onclick="tellJoke()">Tell Me a Joke</button> | ||
</div> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const jokes = [ | ||
"Why don't scientists trust atoms? Because they make up everything!", | ||
"I told my wife she was drawing her eyebrows too high. She looked surprised.", | ||
"Why don't skeletons fight each other? They don't have the guts.", | ||
"What do you call fake spaghetti? An impasta!", | ||
"Why was the math book sad? Because it had too many problems." | ||
]; | ||
|
||
function tellJoke() { | ||
const randomIndex = Math.floor(Math.random() * jokes.length); | ||
const joke = jokes[randomIndex]; | ||
document.getElementById('joke').innerText = joke; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.container { | ||
text-align: center; | ||
background-color: white; | ||
padding: 20px; | ||
border-radius: 10px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
h1 { | ||
color: #333; | ||
} | ||
|
||
.joke-container { | ||
margin: 20px 0; | ||
font-size: 1.2em; | ||
color: #555; | ||
} | ||
|
||
button { | ||
background-color: #007BFF; | ||
color: white; | ||
padding: 10px 20px; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
font-size: 1em; | ||
} | ||
|
||
button:hover { | ||
background-color: #0056b3; | ||
} |