Giter Site home page Giter Site logo

paribhandarkar / random-color-generator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This project dynamically generates and displays unique hex codes for 30 divs using JavaScript

Home Page: https://paribhandarkar.github.io/random-color-generator/

HTML 22.95% JavaScript 49.04% CSS 28.01%
30-days-of-code 30dayscodechallenge 30daysofcode 30daysofjavascript color-generator css html javascript random-color-generator random-generation

random-color-generator's Introduction

Random Color Generator

I recently completed a JavaScript project where I created a web page with a container that held 30 small color containers, each with a randomly generated hex code. I used JavaScript to create the color containers and loop through them to generate the hex codes and assign them to the containers. I also used JavaScript to style each container to have a background color matching its respective hex code. It was a fun and educational project that helped me develop my JavaScript skills, and I learned about new concepts like createElement() and querySelectorAll().

Demo

You can try out the application by visiting this link.

Technologies Used

  • HTML
  • CSS
  • JavaScript

Getting Started

To get started with this project, clone the repository and open the index.html file in your preferred web browser.

New Things I Learned

During this JavaScript project, I had the opportunity to learn some new concepts that are highly useful when working with HTML elements. Specifically, I learned how to use createElement() to dynamically create new HTML elements like **div**s and **p**s and appendChild() to add them to an existing parent element.

Moreover, I was able to utilize querySelectorAll() to select multiple elements with a specified class name and then loop through them using forEach(), performing an action on each element. This allowed me to efficiently update the content and layout of the web page.

Overall, these concepts are highly valuable for creating dynamic and engaging web pages, and I am excited to continue expanding my knowledge of JavaScript and web development.

Challenges I faced

One of the challenges I faced during this project was creating 30 divs dynamically using JavaScript without assigning them unique class or ID. It was difficult to target specific divs when assigning hex codes or making other changes to the page. I had to find other ways to select the divs, like using querySelectorAll() to uniquely identify each div. It required some experimentation and creative problem-solving, but I was eventually able to find a solution that worked for the project's needs.

Screenshot (32)

random-color-generator's People

Contributors

paribhandarkar avatar

Watchers

 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.