GithubHelp home page GithubHelp logo

creating-circles's Introduction

Creating Circles

Creating Circles

This project teaches how to dynamically generate circles with randomly generated colors and positions within a container upon a button click. It's an excellent introduction to event handling, DOM manipulation, CSS styling, and understanding the basics of randomization in web development.

Setup

To set this project up on GitHub Pages, follow these instructions:

  1. Fork or clone this repository to your GitHub account.
  2. Go to the repository settings on GitHub.
  3. Locate the "Pages" section.
  4. Choose the branch you want to deploy (typically main or master) and select the directory (/ (root) for the project's root folder or /docs if located in the docs folder).
  5. After clicking "Save", GitHub Pages will automatically publish your project. You will receive a URL to access it.

Requirements

The structure of this project combines HTML, CSS, and JavaScript to fulfill the following criteria:

  1. HTML Structure: A container is provided to encompass all generated circles, ensuring they remain within its bounds.

  2. Generation Button: Positioned outside the container, this button triggers the creation of new circles within the specified container.

  3. Dynamic Circle Creation:

    • Each button click leads to the generation of a new circle with a random color and size within the container.
    • The position of each circle is randomized, yet confined within the container boundaries.
  4. Bounding Condition: New circles are only added if they fit within the container's dimensions, preventing overflow and ensuring all circles are visible to the user.

How It Works

The mechanics of this project involve:

  • CSS for the aesthetic design of the container and circles, along with ensuring the circles remain within the container.

  • JavaScript for managing button interactions, producing circles with unique styles, assigning random colors, calculating positions within the container, and verifying the space constraint.

Submission

  1. Fork the repository and clone it to your local machine.
  2. Set up a GitHub Pages link for your project.
  3. Include the GitHub Pages link in your project's LINK.md.
  4. Submit your GitHub repository link.

creating-circles's People

Contributors

cleebenjamin avatar markediahinds avatar castonpursuit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.