There is a new edition of this book available! Click here for more information.
HTML5 for Masterminds
Revised 2nd Edition
ISBN: 978-1500429126

How to take advantage of HTML5 to create amazing websites and revolutionary applications

HTML5 for Masterminds leads the reader step by step to gain essential knowledge and to master complex subjects introduced by HTML5. After reading this book, you will know how to structure your documents with HTML, how to style them with CSS and how to work with the most powerful JavaScript APIs. This book is not an introduction, but instead a complete course that will teach you how to build compelling websites and amazing web applications from scratch.
Table of Contents
Chapter 1 - HTML5 Documents
1.1 Basic Components
1.2 A Brief Introduction to HTML
Tags and Elements
Attributes
Traditional Elements
1.3 Global Structure
<!DOCTYPE>
<html>
<head>
<body>
<meta>
<title>
<link>
1.4 Body Structure
Organization
<header>
<nav>
<section>
<aside>
<footer>
1.5 Deep Inside the Body
<article>
<hgroup>
<figure> and <figcaption>
<details> and <summary>
1.6 New and Old Elements
<mark>
<small>
<cite>
<address>
<wbr>
<time>
<data>
1.7 New and Old Attributes
The data-* Attribute
Reversed
Ping and Download
Translate
Contenteditable
Spellcheck
Chapter 2 - CSS Styling and Box Models
2.1 CSS and HTML
2.2 A Brief Introduction to CSS
CSS Rules
Properties
Inline Styles
Embedded Styles
External Files
References
Referencing by Keyword
Referencing by the Id Attribute
Referencing by the Class Attribute
Referencing by Any Attribute
Referencing by Pseudo-Classes
New Selectors
2.3 Applying CSS to Our Document
Box Models
2.4 Traditional Box Model
HTML Document
Universal Selector *
Headings
Declaring New HTML5 Elements
Centering the Body
Creating the Main Box
The Header
Navigation Bar
Section and Aside
Footer
Finishing Touches
Box-Sizing
2.5 Flexible Box Model
Flex Container
HTML Document
Display
Axes
Flex Property
Flex-Direction
Order
Justify-Content
Align-Items
Align-Self
Flex-Wrap
Align-Content
Chapter 3 - CSS3 Properties
3.1 The New Rules
CSS3 Goes Crazy
HTML Document
Border-Radius
Box-Shadow
Text-Shadow
@font-face
Linear Gradient
Radial Gradient
RGBA
HSLA
Outline
Border-Image
Background
Columns
Filters
3.2 Transform
Transform: Scale
Transform: Rotate
Transform: Skew
Transform: Translate
Transforming All at Once
Dynamic Transformations
3D Transformations
3.3 Transitions
3.4 Animations
Chapter 4 - JavaScript
4.1 A Brief Introduction to JavaScript
The Language
Variables
Conditionals and Loops
Functions and Anonymous Functions
Objects
Constructors
The Window Object
The Document Object
4.2 An Introduction to Events
Event Attributes
Event Properties
The AddEventListener() Method
4.3 Incorporating JavaScript
Inline
Embedded
External File
4.4 New Selectors
QuerySelector()
QuerySelectorAll()
MatchesSelector()
4.5 Interacting with the Document
JavaScript Styles
Classlist
Accessing Attributes
Dataset
Create and Erase Elements
InnerHTML, OuterHTML and InsertAdjacentHTML
4.6 APIs
Native APIs
External APIs
4.7 Errors and Debugging
Console
console.log()
Error Event
Chapter 5 - Forms and Forms API
5.1 HTML Forms
The <form> Element
The <input> Element
More Form Elements
Form Submit
5.2 New Input Types
Email Type
Search Type
URL Type
Tel Type
Number Type
Range Type
Date Type
Week Type
Month Type
Time Type
Datetime Type
Datetime-local Type
Color Type
5.3 New Attributes
Autocomplete Attribute
Novalidate and Formnovalidate Attributes
Placeholder Attribute
Required Attribute
Multiple Attribute
Autofocus Attribute
Pattern Attribute
Form Attribute
5.4 New Form Elements
The <datalist> Element
The <progress> Element
The <meter> Element
The <output> Element
5.5 New Pseudo-Classes
Valid and Invalid
Optional and Required
In-range and Out-of-range
5.6 Forms API
SetCustomValidity()
The Invalid Event and the CheckValidity() Method
Real-Time Validation with ValidityState
Validity Constraints
Chapter 6 - Video and Audio
6.1 Video with HTML5
The <video> Element
Attributes for the <video> Element
Video Formats
6.2 Audio with HTML5
The <audio> Element
6.3 Closed Captioning
The <track> Element
6.4 Programming a Media Player
Designing a Video Player
Application
Events
Script
Methods
Properties
Code at Work
Chapter 7 - Text Track API
7.1 TextTrack API
Reading Tracks
Reading Cues
Adding New Tracks
Chapter 8 - Fullscreen API
8.1 No More Windows
Going Fullscreen
Fullscreen Styles
Chapter 9 - Stream API
9.1 Capturing Media
Accessing the Webcam
MediaStreamTrack objects
Stop() Method
Chapter 10 - Canvas API
10.1 Graphics for the Web
The <canvas> Element
GetContext()
10.2 Drawing on Canvas
Drawing Rectangles
Colors
Gradients
Creating Paths
Line Styles
Text
Shadows
Transformations
Restoring Status
GlobalCompositeOperation
10.3 Processing Images
DrawImage()
Image Data
Cross-Origin
Extracting Data
Patterns
10.4 Animations on Canvas
Elemental Animations
Professional Animations
10.5 Processing Video on Canvas
Video on Canvas
Real-Life Application
Chapter 11 - WebGL and Three.js
11.1 Canvas in 3D
11.2 Three.js
Renderer
Scene
Camera
Meshes
Geometric Primitives
Materials
Implementation
Transformations
Lights
Textures
UV Mapping
Canvas Textures
Video Textures
Loading 3D Models
3D Animations
Chapter 12 - Pointer Lock API
12.1 New Mouse Pointer
Mouse Capture
PointerLockElement
MovementX and MovementY
Chapter 13 - Drag and Drop API
13.1 Drag and Drop for the Web
Events
DataTransfer
Dragenter, Dragleave and Dragend
Selecting a Valid Source
SetDragImage()
Files
Chapter 14 - Web Storage API
14.1 Two Storage Systems
14.2 sessionStorage
Data Storage Implementation
Creating Data
Reading Data
Deleting Data
14.3 localStorage
Storage Event
Chapter 15 - IndexedDB API
15.1 Structuring Data
Database
Objects and Object Stores
Indexes
Transactions
Object Stores' Methods
15.2 Implementing IndexedDB
HTML Document
Opening the Database
Object Stores and Indexes
Adding Objects
Getting Objects
Finishing the Code and Testing
15.3 Listing Data
Cursors
Changing Order
15.4 Deleting Data
15.5 Searching Data
Chapter 16 - File API
16.1 File Storage
16.2 Processing the User's Files
HTML Document
Reading Files
File Properties
Blobs
Events
16.3 Creating Files
HTML Document
The Hard Drive
Creating Files
Creating Directories
Listing Files
Handling Files
Moving
Copying
Deleting
16.4 File Content
Writing Content
Adding Content
Reading Content
16.5 Access to Files
16.6 File System in Real Life
Chapter 17 - Geolocation API
17.1 Finding Your Location
HTML Document
GetCurrentPosition(location)
GetCurrentPosition(location, error)
GetCurrentPosition(location, error, configuration)
WatchPosition(location, error, configuration)
Practical Uses with Google Maps
Chapter 18 - History API
18.1 History Interface
Navigating the Web
New Methods
Fake URLs
State Property
Real-Life Example
Chapter 19 - Offline API
19.1 Cache Manifest
The Manifest File
Categories
Comments
Using the Manifest File
19.2 Offline API
Errors
Online and Offline
Cache Process
Progress
Updating the Cache
Chapter 20 - Page Visibility API
20.1 The Visibility State
Current State
A Better Experience
Full Detector
Chapter 21 - Ajax Level 2
21.1 XMLHttpRequest
Retrieving Data
Response Properties
Events
Sending Data
Cross-Origin Requests
Uploading Files
Real-Life Application
Chapter 22 - Web Messaging API
22.1 Cross Document Messaging
Posting a Message
Communicating with an iFrame
Filters and Cross-Origin
Chapter 23 - WebSocket API
23.1 WebSockets
WebSocket Server
Installing and Running a WS Server
Constructor
Methods
Properties
Events
HTML Document
Initiating Communication
Full Application
Chapter 24 - WebRTC API
24.1 Here Comes the Revolution
The Old Paradigm
The New Paradigm
Requisites
Peer Connection
ICE Candidate
Offer and Answer
SessionDescription
Media Streams
Events
The End
24.2 Implementing WebRTC
Signaling Server
ICE Servers
HTML Document
JavaScript Code
Real-Life Application
24.3 Data Channels
Creating Data Channels
Sending Data
Chapter 25 - Web Audio API
25.1 Audio Node Structure
Audio Nodes
Audio Context
Audio Sources
Connecting Nodes
25.2 Sounds for the Web
Two Basic Nodes
Loops and Times
Creating AudioNodes
AudioParam
GainNode
DelayNode
BiquadFilterNode
DynamicsCompressorNode
ConvolverNode
PannerNode and 3D Sound
AnalyserNode
Chapter 26 - Web Workers API
26.1 Doing the Hard Work
Creating a Worker
Sending and Receiving Messages
Detecting Errors
Terminating Workers
Synchronous APIs
Importing Scripts
Shared Worker
Conclusion
Working for the World
The Alternatives
Modernizr
Libraries
Google Chrome Frame
Working for the Cloud
APIs Not Included
What You Should Know
Final Words from the Author
Get This Book Now!
HTML5 for Masterminds
How to take advantage of HTML5 to create amazing websites and revolutionary applications

HTML5 for Masterminds leads the reader step by step to gain essential knowledge and to master complex subjects introduced by HTML5. After reading this book, you will know how to structure your documents with HTML, how to style them with CSS and how to work with the most powerful JavaScript APIs. This book is not an introduction, but instead a complete course that will teach you how to build compelling websites and amazing web applications from scratch.
Other Books in this Series
iOS Apps for Masterminds
How to take advantage of Swift 4 to create insanely great apps for iPhones and iPads

iOS Apps for Masterminds leads the reader step by step to master the complex subjects required to create applications for iPhones and iPads. After reading this book, you will know how to program in Swift, how to design user interfaces, and how to work with the most powerful frameworks available for the construction of modern applications. This book is a complete course that will teach you how to build insanely great applications from scratch...