Giter VIP home page Giter VIP logo

2d_graphic_demo's Introduction

Documentation  

This is my implementation of 2D graphics primitives
Click HERE to take a look.

Implementation of Requirements  

  • Basic Shapes
    • All the numbers displayed on the timer where drawn onto the canvas to meet this requirement.
    • I've decided to implement a digital timer, allowing me to experiment with the polygraphic
      design of each digit.
    • As for Arcs I've decided to implement 2 arcs growing in length as the timer increases.
      • The top arc represents elapsed minutes.
      • The bottom arc represents elapsed seconds.
  • Rendered Text
    • The current date is rendered as test on the top left of the canvas.
  • Image render
    • I've Decided to render an image of a clock, to match the theme of a timer program
  • Loops, Interactivity, Animation
    • In my implementation, all there are inter-connected.
    • First for interactivity, there is a start timer button.
    • Once the button is clicked, Ive add a loop to update the
      current elapsed time.
    • Lastly for the animation, after the elapsed time is updated
      we must also update the UI to reflect this change. Once the UI
      is updated, this creates a digital animation.

Logic  

  • User clicks the Start Timer, the only button on screen.
  • This will trigger a state change and cause a loop to begin.
  • In the loop:
    • Check if the user has clicked Stop Timer
      • If so break loop.
    • We increment the elapsed seconds.
    • Update the UI.

Small Nuances & Reflections  

  • If the user refreshes the page, the loaded image is lost from the DOM.
    • This was due to the .hidden css property previously applied.
  • To handle this I:
    • Alter the html content to remove .hidden css style when the page
      is refreshed.
    • Re-draw the canvas image after the page has reloaded.
  • I was under the impression that HTML, CSS, and JavaScript where the only
    way to add graphics to a UI on the web. Seeing the canvas DOM element definately
    makes me rethink web graphics.
  • I also dindn't realize how interconnected math and computer graphics were. This
    assignment required me to refresh some of my algebra, and knowledge of the cartesian
    plane.
  • Desmos was really helpful in helping me visualize points on a cartesian plane, with a small
    caviot of inversing the y valuse of each point.

Credits  

Thanks For Stopping By 😎

2d_graphic_demo's People

Contributors

abukar-1000 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.