Book description
With 90 detailed hacks, expert web developers Jesse Cravens and Jeff Burtoft demonstrate intriguing uses of HTML5-related technologies. Each recipe provides a clear explanation, screenshots, and complete code examples for specifications that include Canvas, SVG, CSS3, multimedia, data storage, web workers, WebSockets, and geolocation.
You’ll also find hacks for HTML5 markup elements and attributes that will give you a solid foundation for creative recipes that follow. The last chapter walks you through everything you need to know to get your HTML5 app off the ground, from Node.js to deploying your server to the cloud.
Here are just a few of the hacks you’ll find in this book:
- Make iOS-style card flips with CSS transforms and transitions
- Replace the background of your video with the Canvas tag
- Use Canvas to create high-res Retina Display-ready media
- Make elements on your page user-customizable with editable content
- Cache media resources locally with the filesystem API
- Reverse-geocode the location of your web app user
- Process image data with pixel manipulation in a dedicated web worker
- Push notifications to the browser with Server-Sent Events
Table of contents
- HTML5 Hacks
- Preface
-
1. Hacking the Semantic Way
- Hack 1. Simplify Your Doc with the Right <doctype>
- Hack 2. Adopt Common Structures
- Hack 3. Make Your New HTML5 Tags Render Properly in Older Browsers
- Hack 4. Bring Back the <input> Tag
- Hack 5. Easily Implement Form Validation Without JavaScript
- Hack 6. Improve the Usability of Your Forms with New Controls
- Hack 7. Know What’s Going On in Your App with New DOM Events
- Hack 8. Add Rich Context to Your Markup with Custom Data
- Hack 9. Track User Events with Custom Data
- Hack 10. Make Your Page Consumable by Robots and Humans Alike with Microdata
-
2. Hacking with Style
- Hack 11. Use Experimental CSS Features with Browser Prefixes
- Hack 12. Design with Custom Fonts Using Web Fonts
- Hack 13. Use Google Web Fonts for Simple @font-face Implementation
- Hack 14. Use CSS3 Text Effects to Make Your Text Not Suck
- Hack 15. Make Elements Appear Transparent Without Altering the Opacity
- Hack 16. Use Media Queries to Build Responsive Design
- Hack 17. Make Your Web App Respond to Device Orientation Changes
- Hack 18. Take Full Control of Your DOM with Pseudoclasses
- Hack 19. Hack Up Your Sprite and Put Your Images Inline with Image Data URIs
- Hack 20. Build Gradients the Easy Way
- Hack 21. Make Borders Interesting Again, with Border Treatments
- Hack 22. Set Multiple Background Images to the Same Element
- Hack 23. Free Your Page Elements from Their Traditional Space with CSS3 Transforms
- Hack 24. Turn Transforms into Animations with CSS3 Transitions
- Hack 25. Make iOS-Style Card Flips with CSS Transforms and Transitions
- Hack 26. Use Respond.js to Polyfill CSS3 Media Queries in IE
- Hack 27. Control Mobile Layout with the viewport <meta> Tag
-
3. Multimedia Hacking
- Hack 28. Embed Video Directly in Your Application with HTML5 Video
- Hack 29. Choose the Right Codecs for Your Video Files
- Hack 30. Create Custom Video Controls with Video APIs
- Hack 31. Replace the Background of Your HTML5 Video with the <canvas> Tag
- Hack 32. Add Subtitles to Your HTML5 Video Element
- Hack 33. Beautify Your HTML5 Video Cues
- Hack 34. Use the Cuepoint.js Polyfill for Subtitles
- Hack 35. Easily Build Audio-Rich Applications with Buzz
- Hack 36. Simplify Your HTML5 Media with MediaElement.js
-
4. Hacking Your Graphics with Canvas and SVG
- Hack 37. Draw Shapes on Your HTML5 <canvas> Tag
- Hack 38. Apply Styles to Your Canvas Elements
- Hack 39. Style Canvas Elements with Image Files
- Hack 40. Use the HTML5 <canvas> Tag to Create High-Res, Retina-Display-Ready Media
- Hack 41. Accelerate Animation with Canvas Drawings
- Hack 42. Build “Native” Illustrations with Scalable Vector Graphics
- Hack 43. Style SVG Elements with CSS
- Hack 44. Animate Illustrations with SVG
- Hack 45. Embed SVG Directly in Your HTML
-
5. User Interactions
- Hack 46. Make Any Content Draggable Within Your Application
- Hack 47. Update the DOM with a Drag-and-Drop Data Transfer Object
- Hack 48. Drag Files In and Out of Your Web Application
- Hack 49. Make Any Element on Your Page User-Customizable with Editable Content
- Hack 50. Turn Your Web Page into a WYSIWYG Editor
- Hack 51. Take Control of the Browser History Buttons with HTML5 Session History
-
6. Client-Side Data Storage Hacks
- Hack 52. Embed Binary Data in an Inline URL
- Hack 53. Convert a Data URI to a Blob and Append It to Form Data with XHR2
- Hack 54. Use the WebStorage API to Persist User Data
- Hack 55. Polyfill LocalStorage with YepNope.js and Storage.js
- Hack 56. Cache Media Resources Locally with the FileSystem API
- Hack 57. Build a Milestone Calendar with IndexedDB and FullCalendar.js
-
7. Geolocation Hacks
- Hack 58. Use the Geolocation APIs to Display Longitude and Latitude in a Mobile Web Application
- Hack 59. Use Google’s Geocoding API to Reverse-Geocode a User’s Location
- Hack 60. Update a User’s Current Location in a Google Map
- Hack 61. Use the Geoloqi Service to Build a Geofence
- Hack 62. Use the Geoloqi Real-Time Streaming Service to Broadcast a Remote User’s Movement
- Hack 63. Polyfill Geolocation APIs with Webshims
-
8. WebWorker API
- How Browsers Handle JavaScript
- Hack 64. Use the BlobBuilder Interface to Create an Inline Worker
- Hack 65. Perform Heavy Array Computations in a Dedicated Web Worker
- Hack 66. Use a Timer to Send Application State to Workers
- Hack 67. Process Image Data with Pixel Manipulation in a Dedicated Worker
- Hack 68. Use Import Scripts to Make Twitter JSONP Requests
- Hack 69. Connect to Shared Workers Simultaneously from Multiple Browser Windows
-
9. Hacking HTML5 Connectivity
- Hack 70. Use Kaazing’s Remote WebSocket Server to Echo Simple Messages from a Browser
- Hack 71. Build a Blazing-Fast WebSocket Server with Node.js and the ws Module
- Hack 72. Build a Donation Thermometer with Web Sockets, the Pusher API, and PHP
- Hack 73. Build Plug-Ins for jWebSocket
- Hack 74. Push Notifications to the Browser with Server-Sent Events
- Hack 75. Configure Amazon S3 for Cross-Origin Resource Sharing to Host a Web Font
-
Hack 76. Control an HTML5 Slide Deck with Robodeck
- Deck.js
- Node.js and Express
- Establishing Routes
- Building Desktop and Mobile Views
- Public Files
- Polyfill WebSocket Support with Socket.IO
- Adding the Socket.IO Client JavaScript to Our Views
- Adding Geolocation APIs and Reverse Geocoding with the googlemaps Module
- Setup for Mobile and Install of Sencha 2.0
- Communicating from the Remote Control
- Hack 77. Inspect a Socket.IO Connection to Determine If It Is Native or Emulated
- Hack 78. Build a Simple SPDY Server with node-spdy
-
10. Pro HTML5 Application Hacks with Node.js
- HTML5 Application Design Considerations
- Hack 79. Deliver “Hello Html5” to the Browser
- Hack 80. Detect the User Agent String Within the Request Object
- Hack 81. Use Node.js’s Response Object to Respond to the Client with Device-Specific Data
- Hack 82. Use the Node Package Manager to Add a Web Application Framework As a Third-Party Module
- Hack 83. Use the Express Application Generator to Bootstrap Your App
- Hack 84. Build a Custom Module to Handle Routing
- Hack 85. Configure Express to Use a View Engine
- Hack 86. Use Jade Layouts to DRY Up Your Application’s Views
- Hack 87. Use a Jade Partial to Create a Common Navigation Bar in Your Views
- Hack 88. Use Jade Mixins to Populate Your Views with Data
- Hack 89. Set Up Expressive, Dynamic, Robust CSS with Stylus
- Hack 90. Include HTML5 Boilerplate As Your Default Starter Template
- Become an HTML5 Hacker
- Index
- About the Authors
- Colophon
- Copyright
Product information
- Title: HTML5 Hacks
- Author(s):
- Release date: November 2012
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449335083
You might also like
book
HTML5 Unleashed
HTML5 Unleashed is the authoritative guide that covers the key web components driving the future of …
book
The Definitive Guide to HTML5
The Definitive Guide to HTML5 provides the breadth of information you'll need to start creating the …
book
HTML5: 20 Lessons to Successful Web Development
Master HTML and HTML5 in 20 lessons--online video tutorials included! Based on the author's successful online …
book
Using SVG with CSS3 and HTML5
Using Scalable Vector Graphics (SVG) for illustrations only scratches the surface of this format’s potential on …