GithubHelp home page GithubHelp logo

dannycallaghan / drag-and-drop-canvas-backbone-game Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 632 KB

A drag and drop face creator game, built with Backbone and Canvas.

JavaScript 82.03% CSS 17.97%

drag-and-drop-canvas-backbone-game's Introduction

drag-and-drop-canvas-backbone-game

Catchy name, huh?

This was originally a technical test I did for a prospective client. The brief was simply to create a drag and drop 'photofit' type app. Bonus points were given if you could make it responsive (I did), using a mv(c) JavaScript framework (I did), and allow the completed face to be downloaded (it does).

Viewing the (results of the) test

Navigate to the following GitHub Page in your browser of choice:

http://dannycallaghan.github.io/drag-and-drop-canvas-backbone-game/

Viewing the (results of the) test locally

  1. Clone the repo, or download and extract the zip.
  2. Navigate to dist/ and open index.html in your browser of choice*.
  3. Alternatively, run 'grunt --force' (excuse the mixed tabs and spaces warnings!) in the root of the project to create a new build and open the very latest dist/index.html.

*Note that, due to the security restrictions of canvas.toDataURL, the download functionality will not work from the file system (viewing the app as file://...), and will need to be placed in a local HTTP server. It'll fail gracefully, and everything else will work, but just to be aware.

Interpreting the brief

Due to the complexity of creating images for a 'real' Police like PhotoFit, and the mention of 'cartoon' in the brief, I've creating something resembling more of a PhotoFit game. I hope this is OK. It also meant that my 3 year old daughter did some testing, and usually you have to pay for QA people :)

Chosen Technologies

I used Yeoman/Bower/Grunt to create/scaffold the app, just because I find this the easiest way to begin a project, and it takes care of such things as minification, which I would want to implement anyway.

I've used Require.JS to load the JavaScript, as I believe - for most things - AMD loading is best.

I've used Backbone mainly to look after the views. I find it the easiest way of injecting and administering chunks of HTML (views).

I've used jQuery because I'm very familiar with it, and I'm doing a fair bit of DOM work. I'm using Underscore.js alongside this as it's brilliant and it's a dependency of Backbone anyway.

I've used ThreeDubMedia's jquery.event (http://threedubmedia.com/code/event/drag) patch for the dragging and dropping. Adds a little more functionality to what's available out of the box with jQuery. This just came up after a Google, never used it before.

I've used HTML5's Canvas API to create the image at the end. There is a dusting of HTML5 tags and attributes used in the markup.

For the UI, I included Bootstrap (nee Twitter Bootstrap) as I'm a big fan, and it makes rapid prototyping much easier (and nicer to look at). I also came across ([http://designmodo.github.io/Flat-UI/](Flat UI "Flat UI")) last week and - as I'm a sucker for trends, in this case flat design - I used that too (it sits on top of Bootstrap, almost as a theme).

Responsive

As requested, the app is responsive. Perhaps not beautifully, due to time constraints and lack of a designer :) , but it is responsive.

Browsers

As there was no mention of browsers in the brief, I've built this to work with the latest versions.

drag-and-drop-canvas-backbone-game's People

Contributors

dannycallaghan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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