Giter Site home page Giter Site logo

rainbow-sketchgrid's Introduction

Rainbow Sketchgrid

Overview

An interactive webpage where you can mouse over an unfilled grid of squares and colour them in with a shifting hue.

The grid size may be freely chosen from a 1 by 1 to 100 by 100, and the current sketch can be reset any time.

This project was completed as part of The Odin Project's curriculum.

Usage

The page is hosted on GitHub Pages and can be accessed here.

The page initializes a 16 by 16 grid you can fill. The hue of the colour tiles are filled with is incremented with every tile, so the end result is a 'rainbow' effect appearing in the lines drawn.

The Reset button may be pressed at any time to wipe the board to its initial state, and the Size button will let you set the grid size anywhere from 1 by 1 to 100 by 100. Changing the grid size will reset the current board, even if the same grid size is chosen. Pressing cancel in the prompt will not cause a reset.

Here is the whole app in action:

alt

Summary and Outcomes

This was my first experience using JavaScript alongside HTML and CSS, giving life to the website with DOM manipulation.

  • I created and added a Favicon for the website, and imported external fonts.
  • I used JavaScript functions to organize my code and minimize reiteration.
  • I used EventListeners to check for mouseover events so that tiles could be filled in interactively.
  • I used CSS Grid to position and align the tiles of the Sketchgrid.
    • In addition, I used the CSS calc() function alongside variables to calculate values for the Grid.

Improvement

  • The prompt to change size appears over the grid, which when an option is selected with the mouse, the mouse will be hovering directly above the grid as the prompt will disappear beneath it. This will cause unwanted drawing.
    • Possible solutions include an alternative location and method to input a new size, or making the app require an extra click to focus inside and become interactable.
  • There is no scaling in place. Smaller versions of the app could be made available with smaller window sizes.
  • An option to toggle or change the colour of the tiles filling in would be a good feature to implement.
  • The app lags with too many tiles; possibly the JavaScript could be optimized with use of Objects.

Acknowledgements

Eric Meyer's CSS Reset was used to standardize the viewing experience cross-browser.

The Oswald and Lobster fonts were imported from Google Fonts.

License

This project is licensed under MIT.

rainbow-sketchgrid's People

Contributors

willkip 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.