Skip to content

This repository houses a collection of JavaScript scripts designed to generate captivating canvas art. By leveraging HTML5 canvas functionality, these scripts produce mesmerizing fractal patterns and intricate shapes, providing users with a dynamic and interactive platform for artistic expression.

gurjeetsinghvirdee/Canvas-Art-Generator-in-JavaScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canvas Art Generator in JavaScript

This JavaScript project provides a versatile canvas art generator capable of creating mesmerizing fractal patterns and intricate shapes. With three distinct scripts - fractal.js, fractal_branch.js, and star_shape.js - users can effortlessly generate stunning visual effects on the canvas.

Usage

  1. HTML Setup: Ensure your HTML file includes a canvas element:

    <canvas id="canvas1"></canvas>
    <button id="randomizeButton">Randomize</button>
  2. Script Inclusion: Include the JavaScript files in your HTML file:

    <script src="fractal.js"></script>
    <script src="fractal_branch.js"></script>
    <script src="star_shape.js"></script>
  3. Run: Open the HTML file in a compatible web browser.

  4. Interact: Click the "Randomize" button to generate diverse fractal patterns.

Scripts Overview

1. fractal.js

  • Description: Generates fractal patterns with branches.
  • Features:
    • Control depth, number of branches, scale, spread, color, and line width.
    • Provides a button to randomize pattern.

2. fractal_branch.js

  • Description: Renders fractal patterns with branches.
  • Features:
    • Customize size, number of sides, maximum level, scale, spread, and branches.
    • Renders pattern directly on window load.

3. star_shape.js

  • Description: Draws intricate star-shaped patterns.
  • Features:
    • Customize size, number of sides, and rotation.
    • Renders shape directly on window load.

Customization

  • Parameter Adjustments: Modify parameters like size, sides, level, scale, spread, color, and line width within each script.
  • HTML Modifications: Adjust canvas dimensions or add controls as needed.

Compatibility

  • Ensure compatibility with modern web browsers supporting HTML5 canvas and JavaScript.
  • Responsive design adapts canvas to different screen sizes.

Notes

  • Utilizes HTML5 canvas API for dynamic shape rendering.
  • "Randomize" button allows users to explore various fractal patterns.

Feel free to explore and modify the scripts to unleash your creativity and craft captivating canvas art!

About

This repository houses a collection of JavaScript scripts designed to generate captivating canvas art. By leveraging HTML5 canvas functionality, these scripts produce mesmerizing fractal patterns and intricate shapes, providing users with a dynamic and interactive platform for artistic expression.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published