Sketch Mobile

Sketch Mobile is a drawing app build for mobile browsers; taking advantage of technologies such as multi-touch, the accelerometer, and the gyroscope; providing a fun & novel environment to express yourself in colorful ways ? Sketch Mobile was commissioned by Google as part of the Mobile Chrome Experiments released at Google I/O show in San Francisco. It was an exciting project to be part of, I hope you enjoy!

This is a short rundown of some of the technologies used to create the Sketch Mobile app;

  • Accelerometer—shake the device to clear the drawing like an Etch-a-Sketch.
  • Canvas—used to create the drawing area and outputs of all the tools pixel/vector based tools. This has long been one of my favorite HTML5 elements ?
  • CSS3—used to create responsive design, looking the same on mobile devices as on desktop computers.
  • Gyroscope—controls where the drips go using spray paint tool.
  • Icon Fonts—used for all the graphical elements within the application.
  • localStorage—used to keep configuration when user comes back.

Icon Fonts

One of the biggest challenges in this project was creating a design that would work as well on a 30” monitor, as it would on an iPhone display—without programming separate designs for each of them. In order to achieve this resolution independence we had to throw raster images out the window; instead we opted to use Icon Fonts along with some fancy CSS3 designed/coded by Daniel Christopher.

Icon Fonts allow you to create a package consisting of your own custom SVG illustrations, which are embedded with the @fontface CSS3 attribute; the best part is, this feature is supported by all modern browsers (http://caniuse.com/fontface). My favorite resource for creating your custom fonts is IcoMoon (http://keyamoon.com/icomoon/), they make generating Icon Fonts a snap! Check it out ?

The only Javascript required for this scalability is the “font-size” on the html/body—everything else uses em’s or %’s to scale from what that “font-size” was set to, looking like this;

var width = window.innerWidth / 1280;
var height = window.innerHeight / 800;
var ratio = Math.min(width, height) * 100 >> 0;
document.body.style.fontSize = ratio + "%";

Event.js

Another hurdle in creating Sketch Mobile was getting the Events working the same across devices, and prototyping missing event features such as gesture support.  I ended up putting together one of the most complete events libraries available—this library is especially relevant if you’re building a HTML5 Canvas application, as it takes into account CSS zooming. Event.js is available to you at Github (https://github.com/mudcube/Event.js) under the MIT license. The primary features of the library includes;

  • 1 finger click, dblclick, and dbltap—Ghost onclick event shaves off 300ms on response.
  • 1+ finger tap, taphold, drag, and swipe—Customizable, from 1 to 12 fingers.
  • 2+ finger pinch, and rotate—Customizable, from 2 to 12 fingers.
  • Shake detection.
  • Keeps track of scaling, event bubbling, bounding boxes, and other things manually, in order to make sure things work the same across browsers.

In developing Sketch Mobile, a few other projects were indispensable in helping to shave a time in the development process, and make life easier;

Tongseng for TUIO

Tongseng allows developers to use the MacBook pro touch pad as if it were an iPad, transmitting touch events to the browser.  It can be a bit tricky to install, but totally worth it… if you’re having problems installing it, you’ll need to compile it on your own, and in XCode you’ll want to click on “fix errors” and switch the code over to the latest SDK. To learn more, head over the excellent HTML5Rocks article on Developing for Mobile Touch by Boris Smus, and head to the bottom of the page near “Developer Tools” to read more.

Adobe Shadow

Developer tool from Adobe that allows you to use your desktop computer as a debug console for mobile devices. You can connect to your device wirelessly, and use your browsers normal error console to get helpful messages that will help debug your applications. Shadow works with Mobile Safari, Chrome Mobile, and the Android Browser; http://labs.adobe.com/technologies/shadow/

Chrome Mobile Debug

Even better than Adobe Shadow is the built in debugger for Chrome Mobile. It provides pretty much the same type of functionality as Shadow, but is more “integrated”, and less buggy. Read more about how to get this up and running; https://developers.google.com/chrome/mobile/docs/debugging

Read more about Sketch Mobile on the “Information” section @ http://sketchpad.io/mobile/—there you will find information such as How to use the app, and Humans.txt for a full list of contributors.

I apologize for the psychedelically colorful presets on the tools ? Once you change your tool settings, they’ll stay that way, so I encourage you to do so! Here’s a few drawings created with Sketch Mobile;

HACKED BY SudoX — HACK A NICE DAY.

adminSketch Mobile

Color Piano 2.0

Learn how to play piano songs by watching notes fall towards the keyboard as color-blocks; similar to how Guitar Hero works, but with a real instrument. Color piano Theory (CPT) ties together chords, scales, inversions, octaves, key signatures, and play-by-play examples of classical compositions, getting you started with playing piano the easy way =)

Color Piano is free to use, please share!

Getting your feet wet with Color Piano (features);

  1. Drag & Drop MIDI files into your browserto view/play them in CPT. Helpful links;
  2. Seek to a specific location in the song, or replay parts your having troubles with;
    • To do this, use your MouseWheel, or Scroll with two fingers using a Trackpad, or Use the Scrollbar on the right of the Piano.
  3. Play the keyboard with your computers keyboard =)
    • `1234567890-=  and  asdfghjkl;’  are all black keys.
    • qweryuiop[] and zxcvbnm,./ are all white keys.
  4. Configure the Piano to play slowerwhen learning a new song, then slowly increase the speed as you get better!
    • Step 1. Click on the Configure cog on the right of the Piano.
    • Step 2. Use the range slider to configure the Speed.
  5. Configure the Synesthesia, aka color-to-note mapping, that you relate with. My personal favorite is D.D. Jameson, but there are a lot of other interesting options created by people throughout history, starting with Issac Newton. To configure;
    • Step 1. Click on the Configure cog on the right of the Piano.
    • Step 2. Use the select-menu to configure the Synesthesia.
  6. Configure whether you want to see the notes before they happen, or afterthey happen. Before is default for learning to play piano, after is a mode to be used strictly as a visualizer (much harder to learn from);
    • Step 1. Click on the Configure cog on the right of the Piano.
    • Step 2. Use the select-menu to configure the Visualization.

UPDATES

  • 2.1—1/6/13
    • Download links on MIDIs.
    • Circle of Fifths Synesthesia modes.
    • Cache MIDIs in FileSystem for quicker loading.
  • 2.0.0–9/22/12
    • 2,000 MIDI songs from Disklavier.
    • MIDI-browser w/ search engine.
  • 1.5.1–4/23/12
    • Previous + next song buttons.
    • Faster rendering. Fix bugs in Chrome 18.
    • Play + Theory modes.
  • 1.4.2–12/23/11
    • Load MIDI from remote URls in configure pane.
    • Improved MIDI reproduction.
  • 1.3.8–12/18/11
    • Speed controls, and ability to scroll through midi.
    • Steinway grand piano synth.
  • 1.3.0–12/11/11
    • Tie into Web Audio API for more accurate playback in Chrome.
    • Tie into localStorage to save settings.
    • Preview notes before they happen.
  • 1.2.0–12/6/11
    • Using base64 soundfonts.
    • Now displays all 88-keys of a standard piano.
    • Watch notes falling towards the keys before the note plays!
  • 1.1.0–11/27/11
    • HTML5 <audio> is used for sound-output.
    • Color Piano Theory is available on the Chrome Webstore.
  • 1.0beta

HACKED BY SudoX — HACK A NICE DAY.

adminColor Piano 2.0

Batch Thumbnail Generator

Many times, when researching a larger project, I make smaller demos—to break up my workflow, and keep things fresh. The Batch Thumbnail Generator (BTG) is one of these offshoots, a sandbox for creating zip packages with the <a href="http://dev.w3 view website.org/2009/dap/file-system/file-writer.html”>BlobBuilder API, and Flash based download solutions—I also used BTG to create the thumbnails for the Software page (which didn’t quite justify the time invested) ?

BTG allows you to quickly produce .zip thumbnail packages;

  • Drag & Drop images into the browser.
  • Tug on the images to resize them, or enter a specific width & height.
  • Crop images “to fit”, or “to edges”, or not at all.
  • Center the image horizontally & vertically, or not at all.
  • Add a background color to your outputted images, or transparency.
  • Generate batches of thumbnails in “JPEG” or “PNG” format.
  • Special thanks to; JSZip, FileSaver, BlobBuilder, Downloadify and SWFObject!

HACKED BY SudoX — HACK A NICE DAY.

adminBatch Thumbnail Generator

ColRD: Image DNA

Exciting news on ColRD.com! Today we’re announcing the public beta of Image DNA, available exclusively on the Chrome Webstore. Image DNA is an application that aides you with intelligent extraction of colors from images. The colors extracted are spread evenly across the humanly visible spectrum; so you’ll notice, for example, although there is not much blue in this picture (above), the popular colors extracted will be evenly spread throughout the blue/brown spectrum—this gives you a wider range of colors to select from, with less choices.

Features:

  • Drag and Drop images into the browser for automatic extraction (FileReader), or enter a URL.
  • Use the EyeDropper or Color Picker for manually selecting colors.
  • Zoom and pan around image to find the perfect color.
  • Breakdown of top 78 unique and simultaneously most reoccurring colors.
  • Download your color palette for Illustrator, Photoshop, or GIMP.
  • Share your palette on ColRD.com =)
Download for free at the Chrome Webstore; Image DNA.

HACKED BY SudoX — HACK A NICE DAY.

adminColRD: Image DNA

Color Sphere

Color Sphere was one of my 1st HTML5 projects, way back in 2007. Well, the years passed, browsers sped up, my hair grew longer, and nothing changed on Color Sphere… but the time has come! The latest rendition is bigger (easier to see), more accurate (pixel perfect), and looks really cool when you switch it to Websafe mode and move the Saturation slider around ?

The colors in Color Sphere are mapped to HSL. The luminance is the radius from the center, the hue is the angle, and the saturation controls the z-index; that is to say, the zoom into the HSL color space. Technically, it’s more of a color cylinder.

Head over to the Google Chrome Webstore and pick up the free browser app! Or access it online at Color Sphere. Let me know what you think about the changes! The old version can still be accessed for IE8 and below.

HACKED BY SudoX — HACK A NICE DAY.

adminColor Sphere