- 1. Introduction
- 2. Forms
- 2.1. New attributes for input fields : placeholder, pattern, autofocus CSS pseudo classes...
- 2.2. Selecting files and directory
- 2.3. Date, time, etc.
- 2.4. Color
- 2.5. Number
- 2.6. Range
- 2.7. Email
- 2.8. Tel
- 2.9. Url, search, voice recognition
- 2.10. The new <output> field
- 2.11. The new <datalist> element
- 2.12. Declare <input> fields out of the <form></form>
- 3. Drag'n'drop and File API
- 3.1. Access file details (name, size, type) :
- 3.2. Instant preview dropped images
- 4. Canvas
- 4.1. Simple examples
- 4.2. Shadows
- 4.3. Gradients
- 4.4. Clipping/using mask to draw only a part of the canvas
- 4.5. Track mouse events
- 4.6. Stack canvases in layers
- 4.7. Images
- 4.8. 2D Transformations
- 4.9. Save canvas content
- 4.10. Access pixels inside a canvas
- 5. Video
- 5.1. Basic usage
- 5.2. Change properties on the fly (size, position, angle etc.)
- 6. Video capture
- 6.1. Display webcam stream in a video element
- 6.2. Apply CSS effects on a video element with live webcam
- 6.3. Take a snapshot from the live webcam stream
- 6.4. Other demos
Introduction
In this part of the tutorial, you will discover interactive examples (you will be able to change the code and see the results interactively) of HTML features. Some APIs or features are not yet available on every web browser, so you may need to try switch from one browser to another in order to run all the examples.
Forms
Excellent, detailed presentations with lots of examples of HTML5 forms by:
New attributes for input fields : placeholder, pattern, autofocus CSS pseudo classes...
Selecting files and directory
- Use of the new "multiple" attribute for selecting several files at a time. In addition, uses the HTML5 File API for reading pictures and preview them : http://jsbin.com/ozacel/2/edit
- Use of the new "directory" attribute for selecting a directory. Works only in webkit-based browsers (Chrome, Safari) : http://jsbin.com/iyixaf/3/edit
Note that in the example the attribute is named "webkitdirectory" instead of "directory" as this is still an experimental implementation.
Url, search, voice recognition
The new <datalist> element
- Try this example that shows a <datalist> element in action for autocompleting an input field without the need of JavaScript code : http://jsbin.com/uwozih/2/edit
Declare <input> fields out of the <form></form>
Drag'n'drop and File API
Access file details (name, size, type) :
Instant preview dropped images
- Simple "drag images and instant preview"example : http://jsbin.com/ewarak/2/edit
- Same example but this time we added two input fields : one for selecting multiple files (<input type="file" multiple/>) and one for selecting a directory. Notice that both dropped files or selected files can be processed by the same piece of code for instant preview : http://jsbin.com/orurip/11/edit
Canvas
Good references :
Clipping/using mask to draw only a part of the canvas
Stack canvases in layers
- This example shows how we create two canvases one on top of another. Mouse draws in the canvas at the back, while the mouse position is displayed in the front canvas. Each the mouse moves, the front canvas is cleared before redrawing the mouse position, while the back canvas remains intact. Try it : http://jsbin.com/ogehin/2/edit
2D Transformations
- Try this example that shows how to translate/rotate/scale objects + how to save/restore the current context in a stack : http://jsbin.com/azacaf/3/edit
Access pixels inside a canvas
Video
Change properties on the fly (size, position, angle etc.)
Video special effects : incrustation / blue screening