HTML5 Rocks

HTML5 Rocks

HTML5 Rocks

Posts & Tutorials

Format:

Audience:

Technology:

Recent Articles

Avoiding Unnecessary Paints

May 8, 2013 By Paul Lewis Paul Lewis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported render painting
performance nuts_and_bolts
Understand how paints affect your performance.

CSS Paint Times and Page Render Weight

April 12, 2013 By Colt McAnlis Colt McAnlis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported css render
performance
Understand how different CSS property combinations can influence the paint-time of your page.

CSS Masking

April 4, 2013 By Dirk Schulze Dirk Schulze Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported css
graphics nuts_and_bolts
Using clipping and masking from CSS.

Easy High DPI Images

March 28, 2013 By Boris Smus Boris Smus Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported mobile css images
graphics multimedia nuts_and_bolts
This article describes a way to do as little work as possible, yet still serve beautiful images for both high and low DPI screens.

Shadow DOM 201: CSS and Styling

March 15, 2013 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webcomponents shadowdom
nuts_and_bolts semantics
Learn about CSS styling options in Shadow DOM.

Case Study: Find Your Way to Oz

Feb. 5, 2013 By unit9 com unit9 com Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webaudio webgl getusermedia shaders
nuts_and_bolts multimedia
How we made a Magical Chrome Experiment.

Shadow DOM 101

Jan. 4, 2013 By Dominic Cooney Dominic Cooney Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webcomponents shadowdom
nuts_and_bolts semantics
Learn how to use Shadow DOM to separate content from presentation.

Play safely in sandboxed IFrames

Jan. 4, 2013 By Mike West Mike West Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported security xss sandbox iframe
nuts_and_bolts
Learn how to run IFramed content in a sandbox, greatly reducing the risk associated with third-party widgets, and your own application's code.

Scrolling Performance

Dec. 20, 2012 By Paul Lewis Paul Lewis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported
performance nuts_and_bolts
This article explains scrolling performance and how to avoid large repaints.

Parallaxin'

Dec. 20, 2012 By Paul Lewis Paul Lewis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported
performance nuts_and_bolts
An investigation into the parallax effect and common pitfalls in implementation.

Making 100,000 Stars

Nov. 28, 2012 By Michael Chang Michael Chang Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webgl CSS 3D audio
multimedia
A case study using THREE.js to visualize space.

Using the PageVisibility API

Oct. 25, 2012 By Joe Marini Joe Marini Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported
nuts_and_bolts performance
An introduction to the PageVisibility API in HTML5.

Performance Tips for JavaScript in V8

Oct. 11, 2012 By Chris Wilson Chris Wilson Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported JavaScript
performance nuts_and_bolts
Techniques for improving JavaScript performance in web applications, particularly when running in Chrome's V8 engine.

Screensharing a browser tab in HTML5?

Sept. 21, 2012 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported streaming screensharing mutationobservers binary
nuts_and_bolts connectivity
Techniques for screensharing the contents of a browser tab.

Asynch JS: The Power Of $.Deferred

Aug. 29, 2012 By Jeremy Chone Jeremy Chone Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported performance xhr javascript
nuts_and_bolts
A discussion about how to use asynchronous techniques in HTML5.

High DPI Canvas

Aug. 25, 2012 By Paul Lewis Paul Lewis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported
graphics nuts_and_bolts
High density displays are here on many devices. The canvas element deals with that in different ways in different browsers - find out how.

High DPI Images for Variable Pixel Densities

Aug. 22, 2012 By Boris Smus Boris Smus Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported mobile css
graphics multimedia nuts_and_bolts
Techniques for delivering the best quality images as quickly and efficiently as possible.

Writing an AngularJS App with Socket.IO

July 27, 2012 By Brian Ford Brian Ford Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported angular node socketio websockets
business connectivity
Create a chat application with AngularJS, Socket.IO, and Node.js.

Getting Started with WebRTC

July 23, 2012 By Sam Dutton Sam Dutton Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported audio video realtime
multimedia connectivity
Plugin-free, realtime communication of video, audio and data using WebRTC.

WebGL Orthographic 3D

June 20, 2012 By Gregg Tavares Gregg Tavares Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported 3D webgl
graphics
How orthographic 3D transforms work in WebGL.

An Introduction to Content Security Policy

June 15, 2012 By Mike West Mike West Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported xss security csp eval business
nuts_and_bolts
Mitigate the risk of cross-site scripting attacks by whitelisting trusted origins with a Content Security Policy.

Leaner, Meaner, Faster Animations with requestAnimationFrame

May 28, 2012 By Paul Lewis Paul Lewis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported animations
performance nuts_and_bolts graphics
Let's take requestAnimationFrame to the next level and use it for debouncing resize events. We'll also dig into how to debug performance and smooth out your code.

Understanding CSS Filter Effects

May 25, 2012 By Alex Danilo Alex Danilo Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported css filters
graphics
Learn how CSS filters work, their performance impact and what each filter effect does.

Profiling your WebGL Game with the about:tracing flag

May 24, 2012 By Lilli Thompson Lilli Thompson Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webgl gaming devtools internals
nuts_and_bolts performance graphics
The about:tracing tool provides the insight that helps you avoid hasty workarounds aimed at performance improvement, but which are essentially well-intentioned guesswork. You’ll save a lot of time and energy, get a clearer picture of what Chrome is doing with each frame, and use this information to optimize your game.

A non-responsive approach to building cross-device webapps

April 24, 2012 By Boris Smus Boris Smus Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported mobile
nuts_and_bolts
Responsive design is great for changing the styling of your UIs depending on screen size, but as your projects increase in complexity, you may want to serve custom versions of your client depending on what kind of device your visitors are using. This article covers classifying visitor's devices into device classes, and serving the appropriate version, while maximizing code reuse between versions.

Case Study: A Tale of An HTML5 Game with Web Audio

April 24, 2012 By Z Goddard Z Goddard Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webaudio gaming
multimedia
Gradient Studios ported their award-winning Fieldrunners game to HTML5. This article chronicles their journey in utilizing the Web Audio API to implement sound for Fieldrunners.

WebGL Transforms

April 18, 2012 By Gregg Tavares Gregg Tavares Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported 3D webgl
graphics
How 3D transforms work and how you can use them in WebGL.

Creating a Mobile-First Responsive Web Design

April 16, 2012 By Brad Frost Brad Frost Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported mobile
performance
Responsive web design gives web creators some tools for making layouts that respond to any screen size. This article uses fluid grids, flexible images and media queries to get the layout looking great regardless of the size of the device's screen dimensions.

Introduction to JavaScript Source Maps

March 21, 2012 By Ryan Seddon Ryan Seddon Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported devtools
performance
Have you ever found yourself wishing you could keep your client-side code readable and more importantly debuggable even after you've combined and minified it, without impacting performance? Well now you can through the magic of source maps.

Developing Game Audio with the Web Audio API

Feb. 28, 2012 By Boris Smus Boris Smus Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported gaming webaudio
multimedia
Varied intensity background music, overlapping sound effects and randomization, sound source and listener spatialization (and directional sound cones), room effects via convolution, detect and prevent clipping, and implement dynamics compression. Including interactive inline demos!

Case Study: Building Technitone.com

Feb. 27, 2012 By gskinnerdot com gskinnerdot com Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported audio webgl webaudio
graphics multimedia
How Technitone.com was built with the Web Audio API, WebGL, WebSockets, and a decent amount of magic.

Capturing Audio & Video in HTML5

Feb. 22, 2012 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported getusermedia
multimedia
How to capture audio and video using the navigator.getUserMedia() API.

Case Study: Bouncy Mouse

Feb. 18, 2012 By Eric Karl Eric Karl Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webaudio gaming
Bouncy Mouse is a slingshot platformer by Munkadoo Games. This article talks about porting the game to HTML5 and WebAudio.

WebGL Fundamentals

Feb. 9, 2012 By Gregg Tavares Gregg Tavares Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webgl
graphics
Fundamentals of using WebGL as a 2D drawing API and using shaders for image processing.

Getting Started With the Track Element

Feb. 8, 2012 By Sam Dutton Sam Dutton Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported accessibility audio video
multimedia
The track element provides a simple, standardized way to add subtitles and captions to video and audio, but can also be used with other kinds of timed data, to improve searchability and enable deep linking.

Migrating your WebSQL DB to IndexedDB

Dec. 5, 2011 By Ido Green Ido Green Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported business indexeddb
offline
A look at what it would take to port a WebSQL based application to IndexedDB.

Using CORS

Oct. 26, 2011 By Monsur Hossain Monsur Hossain Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported cors xhr2
nuts_and_bolts
An introduction to Cross Origin Resource Sharing (CORS), which gives scripts the ability to make cross-origin XHRs.

The Synchronous FileSystem API for Workers

Oct. 25, 2011 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported filesystem workers
storage file_access
The HTML5 FileSystem API offers an synchronous version to be used in the context of Web Workers. The tutorial introduces the Synchronous API, and gives practical examples of using it.

Getting Started with Web Audio API

Oct. 14, 2011 By Boris Smus Boris Smus Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported gaming webaudio
multimedia
A gentle introduction to loading and playing, cross-fading, and filtering sound using the Web Audio API.

Introduction to Raphaël.js

Sept. 8, 2011 By James Williams James Williams Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported svg raphaeljs
graphics
Learn how to use Raphaël.js to create cross-platform SVG scenes.

Multi-touch Web Development

Aug. 21, 2011 By Boris Smus Boris Smus Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported mobile
Introduction on touch events for mobile devices.

Improving HTML5 Canvas Performance

Aug. 16, 2011 By Boris Smus Boris Smus Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported gaming canvas
graphics performance
Ten tips to make your canvas applications and games faster. Every technique is backed up by a performance test.

Integrating Canvas into your Web App

Aug. 5, 2011 By David Tong David Tong Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported canvas
graphics
Use the HTML5 canvas element to create, edit, open, export images and tips on how these techniques can be applied to an existing web application.

HTML5 vs Native: The Mobile App Debate

June 3, 2011 By Michael Mahemoff Michael Mahemoff Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported mobile
There are still compelling reasons to go native, and clearly, many developers are indeed going that route. This article is a debate on native versus web. We'll examine each point in favor of native, then we'll let the web come in and give its best defense.

Making Forms Fabulous with HTML5

June 2, 2011 By Jan Kleinert Jan Kleinert Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported forms
semantics
Take advantage of improved forms support in HTML5 to build better forms, more easily.

An Introduction to Shaders

June 2, 2011 By Paul Lewis Paul Lewis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webgl gaming shaders
graphics
Want to learn about WebGL shaders but don't know where to start? I'm here to help!

Getting Started with Three.js

June 2, 2011 By Paul Lewis Paul Lewis Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported canvas webgl gaming
graphics
Three.js is a powerful engine for doing native 3D work in your browser. But how do you get going?

Working Off the Grid with HTML5 Offline

June 1, 2011 By Paul Kinlan Paul Kinlan Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported business mobile
offline
This article covers practical techniques and examples for handling connectivity flakiness.

Rendering HTML5 in older browsers with Google Chrome Frame

May 30, 2011 By Malte Ubl Malte Ubl Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported chromeframe
HTML5 adds a multitude of new awesome tools to the web developer toolbox. Google Chrome Frame helps bringing these features to older browsers. This article will tell you how to use Chrome Frame on your site.

New Tricks in XMLHttpRequest2

May 27, 2011 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported binary xhr2
nuts_and_bolts
There has been a slew of improvements to our old friend XMLHttpRequest for working with different types of data. This tutorial covers the new hotness.

Image Filters with Canvas

May 25, 2011 By Ilmari Heikkinen Ilmari Heikkinen Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported canvas
graphics
A quick guide to writing custom image filters with <canvas>.

Chrome Experiments Demo Harness

May 25, 2011 By Ilmari Heikkinen Ilmari Heikkinen Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported canvas wegl
graphics
Experiences from building a kiosk-style demo station with HTML and WebGL.

This End Up: Using Device Orientation

April 29, 2011 By Pete LePage Pete LePage Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported device devicemotion deviceorientation mobile
Learn how to use device orientation and device motion events to tell when your computer is moving.

"Mobifying" Your HTML5 Site

March 3, 2011 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported mobile
A guide on how to create a mobile version of an existing HTML5 website. This study looks at what was required to make html5rocks.com friendly to mobile users.

Typographic effects in canvas

March 1, 2011 By Michael Deal Michael Deal Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported webfonts canvas
graphics
Effects in canvas inner/outer shadows, neon-glows, reflections, space-age, pattern/gradient overlays, stereoscopic imaging, and other text/vector-effects...

SVG Puzzle

Jan. 18, 2011 By Eric Bidelman Eric Bidelman svg
graphics
Solve the puzzle! Hover over the correct area to place tiles, click to rotate.

Orientation Physics

Jan. 18, 2011 By Eric Bidelman Eric Bidelman deviceorientation video canvas
multimedia
Break up a video into lots of boxes and move them around by titling your machine.

WebGL Globe

Jan. 18, 2011 By Paul Irish Paul Irish webgl CSS 3D video
graphics
A WebGL sphere of news stories. Open stories by clicking. When you find the video, hit p to play.

ASCII Art

Jan. 18, 2011 By Malte Ubl Malte Ubl websockets
performance
Synchronized ASCII art video via WebSockets. All current viewers see the same video frame at the same time. Move your mouse over the video to change the color.

Exploring the FileSystem APIs

Jan. 4, 2011 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported filewriter filesystem
file_access storage
The FileSystem APIs give applications the ability to read/write files and directories in a secure, sandboxed file system on a user's local machine.

A Simple TODO list using HTML5 IndexedDB

Dec. 20, 2010 By Paul Kinlan Paul Kinlan Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported business indexeddb
storage
IndexedDB represents the future of query-able client-side storage. This tutorial presents a real world application implementing the basics of the IndexedDB API.

Stream Updates with Server-Sent Events

Nov. 30, 2010 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported eventsource
performance
The EventSource API is designed for receiving push notifications from a server, removing the need for client-size XHR polling.

Quick hits with the Flexible Box Model

Oct. 5, 2010 By Paul Irish Paul Irish Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported css
presentation
An introduction to flexbox, an alternative CSS layout scheme based on vboxes and hboxes.

Client-Side Storage

Oct. 1, 2010 By Michael Mahemoff Michael Mahemoff Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported business webdatabase filesystem indexeddb
offline storage
An overview of client-side storage techniques: Web Storage (local/session storage), Web SQL Database, Indexed Database, Filesystem.

Native HTML5 Drag and Drop

Sept. 30, 2010 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported dnd filereader
Drag-and-drop is yet another first class citizen in HTML5! This article explains how to enhance your web applications by adding native DnD functionality.

3D and CSS

Sept. 7, 2010 By Paul Kinlan Paul Kinlan Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported 3D CSS
graphics presentation
Learn how to build exciting 3D user interfaces using the power of CSS.

Video Cube

Aug. 13, 2010 By Paul Irish Paul Irish video canvas CSS
presentation
Build a cube of ASCII reflecting a video in realtime and reposition the view.

Slideshow

Aug. 13, 2010 By Ernest Delgado Ernest Delgado CSS
presentation
A minimal version of the HTML5 Slide Deck, ready for you to adapt to your uses.
Aug. 13, 2010 By Eiji Kitamura Eiji Kitamura CSS
presentation
Image gallery in a carousel UI. Page through the images quickly, and click to view full size.

Video PiP

Aug. 13, 2010 By Paul Irish Paul Irish video canvas
multimedia
Use Picture-in-picture to swap between two video sources while enjoying a color glow effect. Custom pause, mute and progress bar.

Podcast Player

Aug. 13, 2010 By Eric Bidelman Eric Bidelman audio CSS
multimedia
Load in podcast feeds dynamically, then listen to episodes in a custom player UI. The player UI is a semi-opaque skin on top of the background color.

HTML5 Video

Aug. 3, 2010 By Ernest Delgado Ernest Delgado Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported video
multimedia
Video is one of the most interesting and widely supported features of HTML5. This tutorial covers the mechanics of incorporating native video into your site (without a plugin) and gives interesting examples of using the >video< tag.

Quick guide to webfonts via @font-face

Aug. 2, 2010 By Paul Irish Paul Irish Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported CSS webfonts
presentation
Webfonts give new typographic freedom to designers while retaining scalability and accessibility.

Auditing Your Web App For Speed

July 28, 2010 By Seth Ladd Seth Ladd Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported devtools
performance
The Audit Panel is an excellent tool for examining latency in your web apps. It offers customized recommendations to enhance performance and reduce latency.

The Basics of Web Workers

July 26, 2010 By Eric Bidelman Eric Bidelman Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported workers
performance
Web Workers are a means of spawning background scripts in your application, giving thread-like message passing for handling computationally intensive tasks.

Best Practices for a Faster Web App with HTML5

June 18, 2010 By Paul Irish Paul Irish Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported business appcache webdatabase
performance offline
How to effectively use features from HTML5 to improve the performance and responsiveness of your app.

Using the Notifications API

Feb. 24, 2010 By Ernest Delgado Ernest Delgado Operaunsupported IEunsupported Safariunsupported Firefoxunsupported Chromesupported notifications
Learn the notification basics creating a twitter notification