Tag Archives: HTML5

Drawing a Rotated Image to an HTML5 Canvas

The JavaScript code below, when run, prompts the user to specify an image file to be uploaded, and then displays that image, scaled to 100 x 100 pixels and rotated 45 degrees clockwise in the center of an HTML5 canvas.

Posted in Uncategorized | Tagged , , , , | Leave a comment

Getting Input from Gamepads with HTML5 and JavaScript

The JavaScript program below, when run, will display the current state of all gamepads connected to the user’s system. To see it in action, copy it into an .html file and open that file in a web browser that runs … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Capturing an Image from a Camera with HTML5 and JavaScript

The JavaScript code below, when run, will display a real-time feed of the user’s default camera, and allow the user to click a button to capture a still image from that camera. To see it in action, copy it into … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Recording Sound in JavaScript with MediaRecorder

The JavaScript program below, when run, presents an interface that allows the user to record an audio clip and play it back. To see it in action, copy it into an .html file and open that file in a web … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Positional Audio for a Game in HTML5 with JavaScript

The code below implements a simple example of positional audio in JavaScript using the WebAudio API. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. You’ll need … Continue reading

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

Speech Synthesis in JavaScript with the Web Speech API

The code below uses the Google Speech Synthesis API to say a few simple statements at various speeds and pitches. To see it in action, copy it into an .html file and open that file in a web browser that … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

A FAT12 Disk Image Explorer in JavaScript

The JavaScript code below, when run, presents a file upload button. When the user selects a valid FAT12 disk image and uploads it, the contents of the disk’s root directory will be displayed. The user can then click the Download … Continue reading

Posted in Uncategorized | Tagged , , , , , , | Leave a comment