Wednesday, June 11, 2014

Changes 6/11/14

jQuery:

  • Finally figured out how to programmatically create canvas elements
  • Got width of images that were not actually visible on the page by using vanilla Javascript to create image objects and set source, then use natural width [1]
  • Began looking at switching the shaker class over to canvas

Code:

  1.  img = new Image();
     img.src = imgurl
     img.naturalWidth // equals whatever the width of the base image is

Tuesday, June 10, 2014

Changes 6/10/14

jQuery:

  • Began process of converting shaking mlg elements to canvas after this successful test
  • Didn't get very far though

Thursday, June 5, 2014

Changes 6/5/14

jQuery:

  • Reworked the mlg element creation, as there was repeated code between the hitmarker creation and mlgElement creation.  I moved the shared code into a placeImage function, which takes an object which holds parameters.
  • Changed the shaker from shaking the body to shaking only the mlgElements.
  • Moved the mlg toggle button's onclick into the code, defining it with a jQuery event.
  • Added a github repo for the website.

Wednesday, June 4, 2014

Changes June 4, 2014

jQuery:

  • Continued trying to figure out why the mlg toggle button press doesn't always fire, but I couldn't really figure it out.  I think it might have to do with lag in the browser due to the shaking and element fading.

Tuesday, June 3, 2014

Changes 6/3/14

jQuery:

  • Fixed a bug where I had put setInterval(generateMLGElement(), 500);, which did not generate elements after the interval.  I'm not really sure why, but changing it to setInterval(function() {generateMLGElement()}, 500); fixed the problem.
  • I also began investigating a problem where the button press does not always stop or start the shakes and element fades.  As far as I can tell the onclick method of the button does not always fire when the button has been pressed.
  • Figured out that jQuery does use css selectors, and the reason it wasn't working for me was I had used the selector button.mlg to try to select a button I had never set to the mlg class.  By adding the class in html, everything worked fine.