Skip to content

cloudarcKnights/API-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Magic 8 Ball API

This JavaScript code is an implementation of a Magic 8 Ball application that uses a third-party API endpoint to return random answers to questions. The code includes error handling, loading and disable states for the button, and clears the output after a few seconds.

Prerequisites

This application requires a modern web browser with JavaScript enabled.

Getting started

To use this code, you can download it directly or clone the repository using the following command:

Screenshot 2023-05-05 at 9 05 07 AM

Then, you can open the index.html file in your web browser.

Usage

To use the Magic 8 Ball application, follow these steps:

  1. Type your question into the input field.
  2. Click the "Ask" button or press the Enter key.
  3. The Magic 8 Ball will shake and display a random answer to your question.
  4. The output will be cleared after a few seconds.

Customization

You can customize the code by modifying the API_ENDPOINT constant to use a different third-party API endpoint. Additionally, you can modify the showAnswer function to change the way the answer is displayed.

License

This code is licensed under the MIT License. Feel free to use, modify, and distribute it as you see fit. See the LICENSE file for more details.

About

Various API projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published