🎱 Magic 8 Ball

Today we'll learn the basics of HTML, CSS, and JS while making a Magic 8 Ball. Here's a simple example below, but you'll add your own flair and make it your own.

Starter HTML

Every page starts the same way. Copy this into your own index.html file and build inside the body.

<!DOCTYPE html>
<html lang="en">
<head>
    <title>My Magical 8 Ball</title>
    <link rel="stylesheet" href="styles.css">
    <script src="script.js" defer></script>
</head>

<body>
    <!-- Your HTML goes in here -->
</body>
</html>

Our Goals

  1. Build the ball
    1. Add a header
    2. Add a magic eight ball - can be an image, or a circle
    3. Add a container for where the answers will go
    4. Add a description of the game
  2. Add styles
    1. Background color
    2. Round it into a circle
    3. Give the answer a glow
  3. Add actions
    1. Make a list of possible answers
    2. Pick a random one when the ball is clicked
    3. Show the answer on the screen
  4. Challenges
    1. Add more answers to the list
    2. Change the ball's colors
    3. Add a CSS animation
    4. Count how many times you've asked