diff --git a/www/assets/dizzy.mp4 b/www/assets/dizzy.mp4 new file mode 100644 index 0000000..c4625d8 Binary files /dev/null and b/www/assets/dizzy.mp4 differ diff --git a/www/assets/dizzy.ogv b/www/assets/dizzy.ogv new file mode 100644 index 0000000..a187f1d Binary files /dev/null and b/www/assets/dizzy.ogv differ diff --git a/www/assets/dizzy.webm b/www/assets/dizzy.webm new file mode 100644 index 0000000..588bc3d Binary files /dev/null and b/www/assets/dizzy.webm differ diff --git a/www/assets/remy-and-ellis2.mp4 b/www/assets/remy-and-ellis2.mp4 new file mode 100644 index 0000000..633c472 Binary files /dev/null and b/www/assets/remy-and-ellis2.mp4 differ diff --git a/www/assets/remy-and-ellis2.webm b/www/assets/remy-and-ellis2.webm new file mode 100644 index 0000000..4a67386 Binary files /dev/null and b/www/assets/remy-and-ellis2.webm differ diff --git a/www/canvas-grad/index.html b/www/canvas-grad/index.html new file mode 100644 index 0000000..e5da14b --- /dev/null +++ b/www/canvas-grad/index.html @@ -0,0 +1,77 @@ + + + + +Canvas Gradient + + + + + +Fork me on GitHub + + + + + \ No newline at end of file diff --git a/www/canvas/index.html b/www/canvas/index.html new file mode 100644 index 0000000..6560be7 --- /dev/null +++ b/www/canvas/index.html @@ -0,0 +1,95 @@ + + + + + +HTML5 Demo: Canvas + + + +
+ +
+

Canvas

+
+ +
+ +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
+Fork me on GitHub + + + + + diff --git a/www/classlist/index.html b/www/classlist/index.html new file mode 100644 index 0000000..d7a5af8 --- /dev/null +++ b/www/classlist/index.html @@ -0,0 +1,107 @@ + + + + + +HTML5 Demo: Simple classList manipulation + + + +
+ +
+

Simple classList manipulation

+
+ + +
+

Clicking the buttons below will toggle the class on the bacon ipsum text below, assigning the class with the same name (styles seen below). This is done using the new classList API.

+

Not supported :(

+
<style> 
+  .big { font-size: 30px; }
+  .bold { font-weight: bold; }
+  .pink { background: #FF5E99; color: #fff; }
+</style>
+

Bacon ipsum dolor sit amet pancetta bresaola tenderloin, swine meatball tongue ham boudin t-bone ribeye jerky sausage. Pork loin cow shankle drumstick tri-tip, chicken venison strip steak.

+

Toggle a class: + + + +

+
+ + + + + + + + + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
+Fork me on GitHub + + + + + diff --git a/www/contenteditable/index.html b/www/contenteditable/index.html new file mode 100644 index 0000000..7afb8dc --- /dev/null +++ b/www/contenteditable/index.html @@ -0,0 +1,72 @@ + + + + + +HTML5 Demo: ContentEditable + + + +
+ +
+

ContentEditable

+
+ +
+
+

Any elements with the contenteditable attribute set will have a grey outline as you hover over. Feel free to edit and change their contents. I'm using local storage to maintain your changes.

+
+
+

Go ahead, edit away!

+

Here's a typical paragraph element

+
    +
  1. and now a list
  2. +
  3. with only
  4. +
  5. three items
  6. +
+
+
+ +
+
+ +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
+Fork me on GitHub + + + + + diff --git a/www/css/html5demos.css b/www/css/html5demos.css new file mode 100644 index 0000000..907e64c --- /dev/null +++ b/www/css/html5demos.css @@ -0,0 +1,407 @@ +body { + font: normal 16px/20px "Helvetica Neue", Helvetica, sans-serif; + background: rgb(237, 237, 236); + margin: 0; + padding: 0; +} + +section, header, footer { + display: block; +} + +#wrapper { + max-width: 600px; + margin: 0 auto; + background: #fff url(../images/shade.jpg) repeat-x center bottom; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; + border-top: 1px solid #fff; + padding-bottom: 76px; +} + +h1 { + padding-top: 10px; +} + +h2 { + font-size: 100%; + font-style: italic; +} + +header, +article > *, +footer > * { + margin: 20px; +} + +footer > * { + margin: 20px; + color: #999; +} + +#status { + padding: 5px; + color: #fff; + background: #ccc; +} + +#status.fail { + background: #c00; +} + +#status.success { + background: #0c0; +} + +#status.offline { + background: #c00; +} + +#status.online { + background: #0c0; +} + +/*footer #built:hover:after { + content: '...quickly'; +} +*/ +[contenteditable]:hover:not(:focus) { + outline: 1px dotted #ccc; +} + +abbr { + border-bottom: 0; +} + +abbr[title] { + border-bottom: 1px dotted #ccc; +} + +li { + margin-bottom: 10px; +} + +#promo { + font-size: 90%; + /* background: #333 url(../images/learn-js.jpg) no-repeat left center; */ + /* display: inline-block; */ + /* color: #efefef; */ + text-decoration: none; + cursor: pointer; + /* border: 5px solid #006; */ + height: 160px; +} + +#promo:hover { + border-color: #00f; +} + +#promo img { + width: 100%; + display: block; +} + +#ih5 { + font-size: 90%; + background: #442C0D url(../images/ih5.jpg) no-repeat left center; + display: block; + color: #F7FCE4; + text-decoration: none; + cursor: pointer; + padding: 1px 20px 1px 260px; + border: 5px solid #904200; +} + +#ih5:hover { + border-color: #CF6D3B; +} + +#ffad section { + padding: 20px; +} + +#ffad p { + margin: 10px 10px 10px 100px; +} + +#ffad img { + border: 0; + float: left; + display: block; + margin: 14px 14px 0; +} + +#ffad .definition { + font-style: italic; + font-family: Georgia,Palatino,Palatino Linotype,Times,Times New Roman,serif; +} + +#ffad .url { + text-decoration: underline; +} + +button, input { + font-size: 16px; + padding: 3px; + margin-left: 5px; +} + +#view-source { + display: none; +} + +body.view-source { + margin: 0; + background: #fff; + padding: 20px; +} + +body.view-source > * { + display: none; +} + +body.view-source #view-source { + display: block !important; + margin: 0; +} + +#demos { + width: 560px; + border-collapse: collapse; +} + +#demos .demo { + padding: 5px; +} + +#demos a { + color: #00b; + text-decoration: none; + font-size: 14px; +} + +#demos a:hover { + text-decoration: underline; +} + +#demos tbody tr { + border-top: 1px solid #DCDCDC; +} + + +#demos .demo p { + margin-top: 0; + margin-bottom: 5px; +} + +#demos .support { + width: 126px; +} + +.support span { + cursor: pointer; + overflow: hidden; + float: left; + display: block; + height: 16px; + width: 16px; + text-indent: -9999px; + background-image: url(../images/browsers.gif); + background-repeat: none; + margin-right: 5px; +} + +.support span.selected { + outline: 1px dashed #75784C; +} + +.support span.safari { + background-position: 0 0; +} + +.support span.chrome { + background-position: 16px 0; +} + +.support span.firefox { + background-position: 32px 0; +} + +.support span.ie { + background-position: 48px 0; +} + +.support span.opera { + background-position: 64px 0; +} + +.support span.nightly { + opacity: 0.5; + filter:alpha(opacity=50); +} + +.support span.none { + opacity: 0.1; + filter:alpha(opacity=10); +} + +#demos .tags { + width: 140px; +} + +.tags span { + font-size: 11px; + color: #6E724E; + padding: 2px 5px; + border: 1px solid #D7D999; + background: #FFFFC6; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; + cursor: pointer; +} + +.tags span:hover, +.tags span.selected { + border: 1px solid #75784C; + background: #FF7; + color: #333521; +} + +#tags span { + margin-right: 2px; +} + +#tags { + font-size: 14px; +} + +#html5badge { +/* display: none;*/ + margin-left: -30px; + border: 0; +} + +#html5badge img { + border: 0; +} + +.support span.yourbrowser { + width: 16px; + height: 16px; + background: none; +} + +.support span.yourbrowser.supported { + background: url(../images/yourbrowser.gif) no-repeat top left; +} + +.support span.yourbrowser.not-supported { + background: url(../images/yourbrowser.gif) no-repeat top right; +} + +/** Pretty printing styles. Used with prettify.js. */ +pre { font-size: 14px; } +.str { color: #080; } +.kwd { color: #008; } +.com { color: #800; } +.typ { color: #606; } +.lit { color: #066; } +.pun { color: #660; } +.pln { color: #000; } +.tag { color: #008; } +.atn { color: #606; } +.atv { color: #080; } +.dec { color: #606; } + +#forkme { + display: none; +} + + +@media all and (min-width: 768px) { + body { + margin-top: 40px; + } +} + +/* Carbon Ads */ +#carbonads { + position: fixed; + display: block; + overflow: hidden; + margin-top: -2px; + margin-left: 620px; + padding: 1em; + max-width: 130px; + border: 1px solid hsl(0, 0%, 91%); + background-color: #fbfbfb; + text-align: center; + font-size: 11px; + font-family: Verdana, "Helvetica Neue", Helvetica, sans-serif; + line-height: 1.5; +} + +#carbonads a { + color: inherit; + text-decoration: none; +} + +#carbonads a:hover { + color: inherit; +} + +#carbonads span { + display: block; + overflow: hidden; +} + +.carbon-img { + display: block; + margin: 0 auto 1em; +} + +.carbon-text { + display: block; + margin-bottom: 1em; +} + +.carbon-poweredby { + display: block; + color: #888 !important; + text-transform: uppercase; + letter-spacing: 1px; + font-size: 8px; +} + +@media only screen and (min-width: 320px) and (max-width: 759px) { + #carbonads { + position: relative; + float: none; + margin: 3em auto 1em; + max-width: 330px; + } + #carbonads span { + position: relative; + } + #carbonads > span { + max-width: none; + } + .carbon-img { + float: left; + margin: 0 1em 0 0; + } + .carbon-text { + float: left; + margin-bottom: 0; + max-width: calc(100% - 130px - 1em); + text-align: left; + } + .carbon-poweredby { + position: absolute; + right: 0; + bottom: 0; + display: block; + } +} diff --git a/www/database-rollback/index.html b/www/database-rollback/index.html new file mode 100644 index 0000000..3a9e176 --- /dev/null +++ b/www/database-rollback/index.html @@ -0,0 +1,109 @@ + + + + + +HTML5 Demo: Web SQL Database - rollback test + + + +
+ +
+

Web SQL Database - rollback test

+
+ + +
+
+

This code creates a table called 'foo' and inserts a single row. In a separate transaction, it drops the table then tries to insert in to the table 'foo' - obviously failing. That failure should cause the transaction to rollback, and leave the table 'foo' intact. The next transaction tries to select a row from the 'foo' table. If the rollback succeeds, you should see the status change to 'found rows'.

+

Status:

+
ready
+
+
+ +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
+Fork me on GitHub + + + + + diff --git a/www/database/index.html b/www/database/index.html new file mode 100644 index 0000000..d2f2433 --- /dev/null +++ b/www/database/index.html @@ -0,0 +1,109 @@ + + + + + +HTML5 Demo: Web Database + + + +
+ +
+

Web Database

+
+ + +
+
+

We're using the Web Database API to store my tweets, so there's no Twitter API hit on load.

+

In addition, I'm using the since_id when we make new requests, so I shouldn't be doubling up on tweets.

+

Status: ready

+
+
+
    +
  1. None loaded up yet :-(
  2. +
+
+
+ + + +
+
+ + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
+Fork me on GitHub + + + + + diff --git a/www/dataset/index.html b/www/dataset/index.html new file mode 100644 index 0000000..c91f513 --- /dev/null +++ b/www/dataset/index.html @@ -0,0 +1,105 @@ + + + + + +HTML5 Demo: data-* + + + +
+ +
+

data-*

+
+ + +
+
+

The data-[name] attribute on elements can now be accessed directly via the DOM using element.dataset.[attr].

+

Try openning the Web Console and editing element.dataset directly:
element.dataset.foo = 'bar';

+
+

Not connected

+
+
This element has data
+ + + +
+
[click buttons above to show element html]
+
+ + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
+Fork me on GitHub + + + + + diff --git a/www/demos/canvas.html b/www/demos/canvas.html new file mode 100644 index 0000000..460e883 --- /dev/null +++ b/www/demos/canvas.html @@ -0,0 +1,64 @@ +Canvas +
+ \ No newline at end of file diff --git a/www/demos/classlist.html b/www/demos/classlist.html new file mode 100644 index 0000000..11fc42f --- /dev/null +++ b/www/demos/classlist.html @@ -0,0 +1,75 @@ +Simple classList manipulation + +
+

Clicking the buttons below will toggle the class on the bacon ipsum text below, assigning the class with the same name (styles seen below). This is done using the new classList API.

+

Not supported :(

+
<style> 
+  .big { font-size: 30px; }
+  .bold { font-weight: bold; }
+  .pink { background: #FF5E99; color: #fff; }
+</style>
+

Bacon ipsum dolor sit amet pancetta bresaola tenderloin, swine meatball tongue ham boudin t-bone ribeye jerky sausage. Pork loin cow shankle drumstick tri-tip, chicken venison strip steak.

+

Toggle a class: + + + +

+
+ + + + + + + + + diff --git a/www/demos/contenteditable.html b/www/demos/contenteditable.html new file mode 100644 index 0000000..d0af314 --- /dev/null +++ b/www/demos/contenteditable.html @@ -0,0 +1,41 @@ +ContentEditable +
+
+

Any elements with the contenteditable attribute set will have a grey outline as you hover over. Feel free to edit and change their contents. I'm using local storage to maintain your changes.

+
+
+

Go ahead, edit away!

+

Here's a typical paragraph element

+
    +
  1. and now a list
  2. +
  3. with only
  4. +
  5. three items
  6. +
+
+
+ +
+
+ \ No newline at end of file diff --git a/www/demos/database-rollback.html b/www/demos/database-rollback.html new file mode 100644 index 0000000..abeda62 --- /dev/null +++ b/www/demos/database-rollback.html @@ -0,0 +1,78 @@ +Web SQL Database - rollback test + +
+
+

This code creates a table called 'foo' and inserts a single row. In a separate transaction, it drops the table then tries to insert in to the table 'foo' - obviously failing. That failure should cause the transaction to rollback, and leave the table 'foo' intact. The next transaction tries to select a row from the 'foo' table. If the rollback succeeds, you should see the status change to 'found rows'.

+

Status:

+
ready
+
+
+ \ No newline at end of file diff --git a/www/demos/database.html b/www/demos/database.html new file mode 100644 index 0000000..6aacf2a --- /dev/null +++ b/www/demos/database.html @@ -0,0 +1,78 @@ +Web Database + +
+
+

We're using the Web Database API to store my tweets, so there's no Twitter API hit on load.

+

In addition, I'm using the since_id when we make new requests, so I shouldn't be doubling up on tweets.

+

Status: ready

+
+
+
    +
  1. None loaded up yet :-(
  2. +
+
+
+ + + +
+
+ + \ No newline at end of file diff --git a/www/demos/dataset.html b/www/demos/dataset.html new file mode 100644 index 0000000..6461943 --- /dev/null +++ b/www/demos/dataset.html @@ -0,0 +1,73 @@ + +data-* +
+
+

The data-[name] attribute on elements can now be accessed directly via the DOM using element.dataset.[attr].

+

Try openning the Web Console and editing element.dataset directly:
element.dataset.foo = 'bar';

+
+

Not connected

+
+
This element has data
+ + + +
+
[click buttons above to show element html]
+
+ diff --git a/www/demos/dnd-upload.html b/www/demos/dnd-upload.html new file mode 100644 index 0000000..7b1ceb9 --- /dev/null +++ b/www/demos/dnd-upload.html @@ -0,0 +1,116 @@ +Drag and drop, automatic upload + +
+
+
+ +

File API & FileReader API not supported

+

XHR2's FormData is not supported

+

XHR2's upload progress isn't supported

+

Upload progress: 0

+

Drag an image from your desktop on to the drop zone above to see the browser both render the preview, but also upload automatically to this server.

+
+ diff --git a/www/demos/drag-anything.html b/www/demos/drag-anything.html new file mode 100644 index 0000000..3ebf484 --- /dev/null +++ b/www/demos/drag-anything.html @@ -0,0 +1,127 @@ +Simple Drag and Drop + +
+
+

Instructions: grab anything and drag it in to the drop zone below. I've included some text below, but you can drag urls, bookmarklets, files, anything.

+

Check out the functionality in different browsers, because the same content appears differently when dropped. Something to watch out for in the future.

+

Change the options below to see the difference between the default Text and sniffing for data (not supported in IE I'm afraid).

+

Try also dropping a few files from your desktop on the drop zone and notice the content-type: text/uri-list

+
+ +
+
+ +
+
+
+

Remy Sharp My name is Remy Sharp (@rem on Twitter and my blog). I run a small business in Brighton, UK called Left Logic and am running the Full Frontal JavaScript Conference and I specialise in bespoke front-end development & backend.

+
+
+

Drop here for info about the dragged item

+
+
+ \ No newline at end of file diff --git a/www/demos/drag.html b/www/demos/drag.html new file mode 100644 index 0000000..253b95e --- /dev/null +++ b/www/demos/drag.html @@ -0,0 +1,146 @@ +Drag and drop + +
+

Drag the list items over the dustbin, and drop them to have the bin eat the item

+
+ +
+ diff --git a/www/demos/file-api-simple.html b/www/demos/file-api-simple.html new file mode 100644 index 0000000..966ccde --- /dev/null +++ b/www/demos/file-api-simple.html @@ -0,0 +1,39 @@ +File API (simple) +
+

File API & FileReader API not supported

+

+

Select an image from your machine to read the contents of the file without using a server

+
+
+ diff --git a/www/demos/file-api.html b/www/demos/file-api.html new file mode 100644 index 0000000..99d12f0 --- /dev/null +++ b/www/demos/file-api.html @@ -0,0 +1,39 @@ +File API + +
+
+

File API & FileReader API not supported

+

Drag an image from your desktop on to the drop zone above to see the browser read the contents of the file and use it as the background - without uploading the file to any servers.

+
+ diff --git a/www/demos/geo.html b/www/demos/geo.html new file mode 100644 index 0000000..8c1381b --- /dev/null +++ b/www/demos/geo.html @@ -0,0 +1,57 @@ + +geolocation + +
+

Finding your location: checking...

+
+ diff --git a/www/demos/gum-canvas.html b/www/demos/gum-canvas.html new file mode 100644 index 0000000..3858587 --- /dev/null +++ b/www/demos/gum-canvas.html @@ -0,0 +1,139 @@ +getUserMedia with canvas effects + +
+ + + +

getUserMeda either not supported or not allowed - so instead here's me and my son headbanging.

+
+ + + + \ No newline at end of file diff --git a/www/demos/gum.html b/www/demos/gum.html new file mode 100644 index 0000000..daf406a --- /dev/null +++ b/www/demos/gum.html @@ -0,0 +1,40 @@ +getUserMedia streamed to a video element + +
+ +

getUserMeda either not supported or not allowed - so instead here's me and my son headbanging.

+
+ + diff --git a/www/demos/hidden.html b/www/demos/hidden.html new file mode 100644 index 0000000..6bbb102 --- /dev/null +++ b/www/demos/hidden.html @@ -0,0 +1,11 @@ +Hidden + +
+

Welcome dear HTML5-er. You will be able to read this paragraph, but not the next. The next paragraph has the hidden property set on it. It's a boolean that uses the browsers own stylesheet to hide the element, which is nicer than having to dip in to the style properties in JavaScript.

+

Sadly, your browser doesn't support the hidden property. Useful when you want to quickly do element.hidden. Ah well, back to CSS.

+
+ \ No newline at end of file diff --git a/www/demos/history.html b/www/demos/history.html new file mode 100644 index 0000000..671564b --- /dev/null +++ b/www/demos/history.html @@ -0,0 +1,109 @@ +HTML5 History API + +
+

HTML5 History API not supported

+

Last event fired: (none)

+

To test the History API, click through the urls below. Note that none of these urls point to real pages. JavaScript will intercept these clicks, load data and the browser address bar will appear to change - but this is the History API in action!

+

Use the back and forward buttons in your browser to navigate the history.

+ +

Note: since these urls aren't real, refreshing the page will land on an invalid url.

+
+
+ \ No newline at end of file diff --git a/www/demos/nav-online.html b/www/demos/nav-online.html new file mode 100644 index 0000000..34b6119 --- /dev/null +++ b/www/demos/nav-online.html @@ -0,0 +1,13 @@ +navigator.onLine testing +
+

Current network status: checking...

+

A timer is constantly polling the navigator.onLine property, which is typically switched via File -> Work Offline

+
+ \ No newline at end of file diff --git a/www/demos/non-worker.html b/www/demos/non-worker.html new file mode 100644 index 0000000..7e37044 --- /dev/null +++ b/www/demos/non-worker.html @@ -0,0 +1,96 @@ + Non Worker +
+

Canvas is running whilst an prime number finder runs - this will cause your browser to hang

+

Prime found: 0

+
+
+ diff --git a/www/demos/offline-events.html b/www/demos/offline-events.html new file mode 100644 index 0000000..120018b --- /dev/null +++ b/www/demos/offline-events.html @@ -0,0 +1,45 @@ +on/offline event capture + +
+

Test required here: File -> Work Offline - toggle the value and there should be three list items notifying of online and offline.

+ +

Note that the test shows that window.ononline and window.onoffline doesn't work (which I thought I had read in the specs somewhere...).

+
+ \ No newline at end of file diff --git a/www/demos/offline.html b/www/demos/offline.html new file mode 100644 index 0000000..d4a6dbe --- /dev/null +++ b/www/demos/offline.html @@ -0,0 +1,19 @@ +Online connectivity monitoring +
+

Current network status: checking...

+
    +
    + \ No newline at end of file diff --git a/www/demos/offlineapp.html b/www/demos/offlineapp.html new file mode 100644 index 0000000..662f0a3 --- /dev/null +++ b/www/demos/offlineapp.html @@ -0,0 +1,39 @@ + +Offline Application: using manifest + +
    +

    A good working example is to load this demo up, then disconnection your web connection - the page will still reload. In addition, try this on an iPhone, then set your iPhone to flight mode, and refresh: the page loads.

    +

    Status of cache:

    +

    checking...

    +

    +

    +
    + diff --git a/www/demos/postmessage.html b/www/demos/postmessage.html new file mode 100644 index 0000000..0881980 --- /dev/null +++ b/www/demos/postmessage.html @@ -0,0 +1,32 @@ +postMessage (same domain) + +
    +
    +

    +

    +

    Target iframe:

    + +
    +
    + \ No newline at end of file diff --git a/www/demos/postmessage2.html b/www/demos/postmessage2.html new file mode 100644 index 0000000..5864423 --- /dev/null +++ b/www/demos/postmessage2.html @@ -0,0 +1,30 @@ +postMessage (cross domain) + +
    +
    +

    +

    +

    Target iframe:

    + +
    +
    + diff --git a/www/demos/storage-events.html b/www/demos/storage-events.html new file mode 100644 index 0000000..bdef67b --- /dev/null +++ b/www/demos/storage-events.html @@ -0,0 +1,44 @@ +Storage Events + +
    +
    +

    Directions: open multiple windows or tabs with this demo and change the text below.

    +

    The storage event triggers on the "blurred" windows, giving us a way to communicate across windows using localStorage.

    +
    +

    (this is only echoed on other windows)

    +

    Waiting for data via storage event...

    +
    +
    +
    + diff --git a/www/demos/storage.html b/www/demos/storage.html new file mode 100644 index 0000000..4758e54 --- /dev/null +++ b/www/demos/storage.html @@ -0,0 +1,74 @@ +Storage + +
    +
    +

    Values are stored on keyup

    +

    Content loaded from previous sessions:

    + +
    +
    +
    + + +
    +
    + + +
    + +
    +
    + diff --git a/www/demos/svg-clock.html b/www/demos/svg-clock.html new file mode 100644 index 0000000..fdc54ea --- /dev/null +++ b/www/demos/svg-clock.html @@ -0,0 +1,161 @@ +SVG clock animation + +
    +

    SVG clock animation by David Basoko.

    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + diff --git a/www/demos/template.html b/www/demos/template.html new file mode 100644 index 0000000..3bcbc28 --- /dev/null +++ b/www/demos/template.html @@ -0,0 +1,10 @@ +This is a template example + +
    +

    Instructions or related markup might should appear inside the <article> element, and code in the <script> below.

    +
    + \ No newline at end of file diff --git a/www/demos/two-videos.html b/www/demos/two-videos.html new file mode 100644 index 0000000..89501c2 --- /dev/null +++ b/www/demos/two-videos.html @@ -0,0 +1,103 @@ + +Two videos in sync +
    + + +

    + + 00:00 / loading... + +

    +

    This demo shows two videos running, which we're trying to run in sync. Moving the scrubber should scrub both videos.

    +
    + diff --git a/www/demos/video.html b/www/demos/video.html new file mode 100644 index 0000000..0663fa4 --- /dev/null +++ b/www/demos/video.html @@ -0,0 +1,108 @@ +Video +
    + +

    + + 00:00 / loading... +

    +

    Video loaded: loading...

    +

    Note that (at time of writing) Webkit nightly supports full screen mode, which will add a button above.

    +
    + \ No newline at end of file diff --git a/www/demos/web-socket.html b/www/demos/web-socket.html new file mode 100644 index 0000000..30ae613 --- /dev/null +++ b/www/demos/web-socket.html @@ -0,0 +1,103 @@ +Web Socket + +
    +
    + +
    +

    Not connected

    +

    Users connected: 0

    +

    To test, open two windows with Web Socket support, type a message above and press return.

    +

    The server side code is available here: node-web-socket & server (note that it runs on nodejs)

    + +
    + diff --git a/www/demos/worker.html b/www/demos/worker.html new file mode 100644 index 0000000..6891efc --- /dev/null +++ b/www/demos/worker.html @@ -0,0 +1,39 @@ +Web Worker + +
    +

    This demo shows how main window animation isn't interrupted by Web Workers. Note that the animation does not work in Opera (due to lack of requestAnimationFrame support).

    +

    Use arrow keys to change the direction of the animated square. The square is animated with requestAnimationFrame.

    +
    +
    +
    +

    Click the button below to start or stop the worker.

    +
    +

    Messages from Worker:

    +
    + +
    \ No newline at end of file diff --git a/www/dnd-upload/index.html b/www/dnd-upload/index.html new file mode 100644 index 0000000..e202488 --- /dev/null +++ b/www/dnd-upload/index.html @@ -0,0 +1,148 @@ + + + + + +HTML5 Demo: Drag and drop, automatic upload + + + +
    + +
    +

    Drag and drop, automatic upload

    +
    + + +
    +
    +
    + +

    File API & FileReader API not supported

    +

    XHR2's FormData is not supported

    +

    XHR2's upload progress isn't supported

    +

    Upload progress: 0

    +

    Drag an image from your desktop on to the drop zone above to see the browser both render the preview, but also upload automatically to this server.

    +
    + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/drag-anything/index.html b/www/drag-anything/index.html new file mode 100644 index 0000000..5d64290 --- /dev/null +++ b/www/drag-anything/index.html @@ -0,0 +1,158 @@ + + + + + +HTML5 Demo: Simple Drag and Drop + + + +
    + +
    +

    Simple Drag and Drop

    +
    + + +
    +
    +

    Instructions: grab anything and drag it in to the drop zone below. I've included some text below, but you can drag urls, bookmarklets, files, anything.

    +

    Check out the functionality in different browsers, because the same content appears differently when dropped. Something to watch out for in the future.

    +

    Change the options below to see the difference between the default Text and sniffing for data (not supported in IE I'm afraid).

    +

    Try also dropping a few files from your desktop on the drop zone and notice the content-type: text/uri-list

    +
    + +
    +
    + +
    +
    +
    +

    Remy Sharp My name is Remy Sharp (@rem on Twitter and my blog). I run a small business in Brighton, UK called Left Logic and am running the Full Frontal JavaScript Conference and I specialise in bespoke front-end development & backend.

    +
    +
    +

    Drop here for info about the dragged item

    +
    +
    + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/drag/index.html b/www/drag/index.html new file mode 100644 index 0000000..d3188cf --- /dev/null +++ b/www/drag/index.html @@ -0,0 +1,178 @@ + + + + + +HTML5 Demo: Drag and drop + + + +
    + +
    +

    Drag and drop

    +
    + + +
    +

    Drag the list items over the dustbin, and drop them to have the bin eat the item

    +
    + +
    + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/file-api-simple/index.html b/www/file-api-simple/index.html new file mode 100644 index 0000000..8b045de --- /dev/null +++ b/www/file-api-simple/index.html @@ -0,0 +1,71 @@ + + + + + +HTML5 Demo: File API (simple) + + + +
    + +
    +

    File API (simple)

    +
    + +
    +

    File API & FileReader API not supported

    +

    +

    Select an image from your machine to read the contents of the file without using a server

    +
    +
    + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/file-api/index.html b/www/file-api/index.html new file mode 100644 index 0000000..d180036 --- /dev/null +++ b/www/file-api/index.html @@ -0,0 +1,71 @@ + + + + + +HTML5 Demo: File API + + + +
    + +
    +

    File API

    +
    + + +
    +
    +

    File API & FileReader API not supported

    +

    Drag an image from your desktop on to the drop zone above to see the browser read the contents of the file and use it as the background - without uploading the file to any servers.

    +
    + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/geo/index.html b/www/geo/index.html new file mode 100644 index 0000000..4e74b82 --- /dev/null +++ b/www/geo/index.html @@ -0,0 +1,89 @@ + + + + + +HTML5 Demo: geolocation + + + +
    + +
    +

    geolocation

    +
    + + + +
    +

    Finding your location: checking...

    +
    + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/gum-canvas/index.html b/www/gum-canvas/index.html new file mode 100644 index 0000000..e70eefc --- /dev/null +++ b/www/gum-canvas/index.html @@ -0,0 +1,170 @@ + + + + + +HTML5 Demo: getUserMedia with canvas effects + + + +
    + +
    +

    getUserMedia with canvas effects

    +
    + + +
    + + + +

    getUserMeda either not supported or not allowed - so instead here's me and my son headbanging.

    +
    + + + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/gum/index.html b/www/gum/index.html new file mode 100644 index 0000000..a8e7093 --- /dev/null +++ b/www/gum/index.html @@ -0,0 +1,72 @@ + + + + + +HTML5 Demo: getUserMedia streamed to a video element + + + +
    + +
    +

    getUserMedia streamed to a video element

    +
    + + +
    + +

    getUserMeda either not supported or not allowed - so instead here's me and my son headbanging.

    +
    + + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/hidden/index.html b/www/hidden/index.html new file mode 100644 index 0000000..db000c1 --- /dev/null +++ b/www/hidden/index.html @@ -0,0 +1,42 @@ + + + + + +HTML5 Demo: Hidden + + + +
    + +
    +

    Hidden

    +
    + + +
    +

    Welcome dear HTML5-er. You will be able to read this paragraph, but not the next. The next paragraph has the hidden property set on it. It's a boolean that uses the browsers own stylesheet to hide the element, which is nicer than having to dip in to the style properties in JavaScript.

    +

    Sadly, your browser doesn't support the hidden property. Useful when you want to quickly do element.hidden. Ah well, back to CSS.

    +
    + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/history/index.html b/www/history/index.html new file mode 100644 index 0000000..759fc7f --- /dev/null +++ b/www/history/index.html @@ -0,0 +1,140 @@ + + + + + +HTML5 Demo: HTML5 History API + + + +
    + +
    +

    HTML5 History API

    +
    + + +
    +

    HTML5 History API not supported

    +

    Last event fired: (none)

    +

    To test the History API, click through the urls below. Note that none of these urls point to real pages. JavaScript will intercept these clicks, load data and the browser address bar will appear to change - but this is the History API in action!

    +

    Use the back and forward buttons in your browser to navigate the history.

    + +

    Note: since these urls aren't real, refreshing the page will land on an invalid url.

    +
    +
    + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + + diff --git a/www/images/bin.jpg b/www/images/bin.jpg new file mode 100644 index 0000000..e9df3fa Binary files /dev/null and b/www/images/bin.jpg differ diff --git a/www/images/browsers.gif b/www/images/browsers.gif new file mode 100644 index 0000000..77a96c8 Binary files /dev/null and b/www/images/browsers.gif differ diff --git a/www/images/ih5.jpg b/www/images/ih5.jpg new file mode 100644 index 0000000..0a6d0c3 Binary files /dev/null and b/www/images/ih5.jpg differ diff --git a/www/images/learn-js.jpg b/www/images/learn-js.jpg new file mode 100644 index 0000000..ba2b7be Binary files /dev/null and b/www/images/learn-js.jpg differ diff --git a/www/images/shade.jpg b/www/images/shade.jpg new file mode 100644 index 0000000..fa99f60 Binary files /dev/null and b/www/images/shade.jpg differ diff --git a/www/images/terminal-training.png b/www/images/terminal-training.png new file mode 100644 index 0000000..7cb5314 Binary files /dev/null and b/www/images/terminal-training.png differ diff --git a/www/images/yourbrowser.gif b/www/images/yourbrowser.gif new file mode 100644 index 0000000..02b3c5a Binary files /dev/null and b/www/images/yourbrowser.gif differ diff --git a/www/index.html b/www/index.html new file mode 100644 index 0000000..0c57d32 --- /dev/null +++ b/www/index.html @@ -0,0 +1,268 @@ + + + + + +HTML5 Demos and Examples + + + + + +
    + +
    +

    HTML 5 Demos and Examples

    +
    +
    +

    HTML 5 experimentation and demos I've hacked together. Click on the browser support icon or the technology tag to filter the demos (the filter is an OR filter).

    + +
    + + + +
    +

    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    DemoSupportTechnology
    Stream video and filter with canvas ie: none firefox: nightly opera: live safari: none chrome: live getUserMedia canvas
    Stream video to the browser
    Also works on Opera Mobile 12
    ie: none firefox: nightly opera: live safari: none chrome: live getUserMedia
    Drag and drop and XHR upload ie: nightly firefox: live opera: live safari: live chrome: live file dnd xhr2
    Hidden property ie: none firefox: live opera: live safari: live chrome: live hidden
    Simple class manipulation ie: none firefox: live opera: live safari: live chrome: live classlist
    Storage events ie: live firefox: live opera: live safari: live chrome: live storage
    dataset (data-* attributes) ie: none firefox: live opera: live safari: live chrome: live dataset
    History API using pushState ie: none firefox: live opera: live safari: live chrome: live history
    Browser based file reading Not part of HTML5 ie: none firefox: live opera: live safari: live chrome: live file-api
    Drag files directly into your browser Not directly part of HTML5 ie: none firefox: live opera: live safari: live chrome: live file-api dnd
    Simple chat client ie: none firefox: nightly opera: live safari: live chrome: live websocket
    Two videos playing in sync ie: live firefox: live opera: live safari: live chrome: live video
    Interactive canvas gradients ie: live firefox: live opera: live safari: live chrome: live canvas
    Canvas & Video ie: live firefox: live opera: live safari: live chrome: live video canvas
    Video ie: live firefox: live opera: live safari: live chrome: live video
    Canvas ie: live firefox: live opera: live safari: live chrome: live canvas
    Content Editable ie: live firefox: live opera: live safari: live chrome: live contenteditable storage
    Geolocation Works on Safari Mobile too ie: live firefox: live opera: live safari: live chrome: live geolocation
    postMessage same domain ie: live firefox: live opera: live safari: live chrome: live postMessage
    postMessage cross domain ie: live firefox: live opera: live safari: live chrome: live postMessage
    drag and drop ie: live firefox: live opera: live safari: live chrome: live dnd
    drag anything ie: live firefox: live opera: live safari: live chrome: live dnd
    offline detection Works on Safari Mobile too ie: none firefox: live opera: live safari: live chrome: live offline events
    navigator.onLine tests Doesn't use events, only polls ie: live firefox: live opera: live safari: live chrome: live offline
    on/offline event tests ie: none firefox: live opera: live safari: live chrome: live offline events
    offline application using the manifest FF 3.6 is still buggy - doesn't request manifest after initial load ie: none firefox: live opera: live safari: live chrome: live offline manifest
    Storage ie: live firefox: live opera: live safari: live chrome: live storage
    Web SQL Database Storage ie: none firefox: none opera: live safari: live chrome: live sql-database
    Web SQL Database - rollback test ie: none firefox: none opera: live safari: live chrome: live sql-database
    Web Workers watch out - uses a lot of CPU! example without - will hang your browser ie: none firefox: live opera: live safari: live chrome: live workers
    SVG clock animation SVG inline clock with animation. ie: live firefox: live opera: live safari: live chrome: live svg
    + +

    All content, code, video and audio is Creative Commons Share Alike 2.0

    +
    + + HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
    +Fork me on GitHub + + + + diff --git a/www/js/gum.js b/www/js/gum.js new file mode 100644 index 0000000..eebe3a1 --- /dev/null +++ b/www/js/gum.js @@ -0,0 +1,27 @@ +var video = document.querySelector('video'); + +function gumSuccess(stream) { + // window.stream = stream; + if ('mozSrcObject' in video) { + video.mozSrcObject = stream; + } else if (window.webkitURL) { + video.src = window.webkitURL.createObjectURL(stream); + } else { + video.src = stream; + } + video.play(); +} + +function gumError(error) { + console.error('Error on getUserMedia', error); +} + +function gumInit() { + navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; + + if (navigator.getUserMedia) { + navigator.getUserMedia({video: true }, gumSuccess, gumError); + } +} + +gumInit(); \ No newline at end of file diff --git a/www/js/h5utils-offline.js b/www/js/h5utils-offline.js new file mode 100644 index 0000000..8c3eca2 --- /dev/null +++ b/www/js/h5utils-offline.js @@ -0,0 +1,27 @@ +// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/ +(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while (i--){document.createElement(e[i])}})(); + +var addEvent = (function () { + if (document.addEventListener) { + return function (el, type, fn) { + if (el.length) { + for (var i = 0; i < el.length; i++) { + addEvent(el[i], type, fn); + } + } else { + el.addEventListener(type, fn, false); + } + }; + } else { + return function (el, type, fn) { + if (el.length) { + for (var i = 0; i < el.length; i++) { + addEvent(el[i], type, fn); + } + } else { + el.attachEvent('on' + type, function () { return fn.call(el, window.event); }); + } + }; + } +})(); + diff --git a/www/js/h5utils.js b/www/js/h5utils.js new file mode 100644 index 0000000..8b853e9 --- /dev/null +++ b/www/js/h5utils.js @@ -0,0 +1,65 @@ +// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/ +/*@cc_on'abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video'.replace(/\w+/g,function(n){document.createElement(n)})@*/ + +var addEvent = (function () { + if (document.addEventListener) { + return function (el, type, fn) { + if (el && el.nodeName || el === window) { + el.addEventListener(type, fn, false); + } else if (el && el.length) { + for (var i = 0; i < el.length; i++) { + addEvent(el[i], type, fn); + } + } + }; + } else { + return function (el, type, fn) { + if (el && el.nodeName || el === window) { + el.attachEvent('on' + type, function () { return fn.call(el, window.event); }); + } else if (el && el.length) { + for (var i = 0; i < el.length; i++) { + addEvent(el[i], type, fn); + } + } + }; + } +})(); + +(function () { + +var pre = document.createElement('pre'); +pre.id = "view-source" + +// private scope to avoid conflicts with demos +addEvent(window, 'click', function (event) { + if (event.target.hash == '#view-source') { + // event.preventDefault(); + if (!document.getElementById('view-source')) { + // pre.innerHTML = ('\n\n' + document.documentElement.innerHTML + '\n').replace(/[<>]/g, function (m) { return {'<':'<','>':'>'}[m]}); + var xhr = new XMLHttpRequest(); + + // original source - rather than rendered source + xhr.onreadystatechange = function () { + if (this.readyState == 4 && this.status == 200) { + pre.innerHTML = this.responseText.replace(/[<>]/g, function (m) { return {'<':'<','>':'>'}[m]}); + prettyPrint(); + } + }; + + document.body.appendChild(pre); + // really need to be sync? - I like to think so + xhr.open("GET", location.origin + '/demos' + window.location.pathname.replace(/\/$/, '') + '.html', true); + xhr.send(); + } + document.body.className = 'view-source'; + + var sourceTimer = setInterval(function () { + if (window.location.hash != '#view-source') { + clearInterval(sourceTimer); + document.body.className = ''; + } + }, 200); + } +}); + +})(); diff --git a/www/js/modernizr.custom.js b/www/js/modernizr.custom.js new file mode 100644 index 0000000..a0032d8 --- /dev/null +++ b/www/js/modernizr.custom.js @@ -0,0 +1,2 @@ +/* Modernizr custom build of 1.7: applicationcache | canvas | canvastext | draganddrop | hashchange | history | audio | video | indexeddb | inputtypes | input | localstorage | postmessage | sessionstorage | webworkers | websockets | websqldatabase | geolocation */ +window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,e._enableHTML5=f,e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+" js "+u.join(" ");return e}(this,this.document) \ No newline at end of file diff --git a/www/js/prettify.packed.js b/www/js/prettify.packed.js new file mode 100644 index 0000000..7f478d6 --- /dev/null +++ b/www/js/prettify.packed.js @@ -0,0 +1,32 @@ +window.PR_SHOULD_USE_CONTINUATION=true;window.PR_TAB_WIDTH=8;window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void 0;window._pr_isIE6=function(){var y=navigator&&navigator.userAgent&&navigator.userAgent.match(/\bMSIE ([678])\./);y=y?+y[1]:false;window._pr_isIE6=function(){return y};return y}; +(function(){function y(b){return b.replace(L,"&").replace(M,"<").replace(N,">")}function H(b,f,i){switch(b.nodeType){case 1:var o=b.tagName.toLowerCase();f.push("<",o);var l=b.attributes,n=l.length;if(n){if(i){for(var r=[],j=n;--j>=0;)r[j]=l[j];r.sort(function(q,m){return q.name"); +for(l=b.firstChild;l;l=l.nextSibling)H(l,f,i);if(b.firstChild||!/^(?:br|link|img)$/.test(o))f.push("");break;case 3:case 4:f.push(y(b.nodeValue))}}function O(b){function f(c){if(c.charAt(0)!=="\\")return c.charCodeAt(0);switch(c.charAt(1)){case "b":return 8;case "t":return 9;case "n":return 10;case "v":return 11;case "f":return 12;case "r":return 13;case "u":case "x":return parseInt(c.substring(2),16)||c.charCodeAt(1);case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":return parseInt(c.substring(1), +8);default:return c.charCodeAt(1)}}function i(c){if(c<32)return(c<16?"\\x0":"\\x")+c.toString(16);c=String.fromCharCode(c);if(c==="\\"||c==="-"||c==="["||c==="]")c="\\"+c;return c}function o(c){var d=c.substring(1,c.length-1).match(RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));c=[];for(var a=[],k=d[0]==="^",e=k?1:0,h=d.length;e122)){s<65||g>90||a.push([Math.max(65,g)|32,Math.min(s,90)|32]);s<97||g>122||a.push([Math.max(97,g)&-33,Math.min(s,122)&-33])}}a.sort(function(v,w){return v[0]-w[0]||w[1]-v[1]});d=[];g=[NaN,NaN];for(e=0;eh[0]){h[1]+1>h[0]&&a.push("-"); +a.push(i(h[1]))}}a.push("]");return a.join("")}function l(c){for(var d=c.source.match(RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),a=d.length,k=[],e=0,h=0;e=2&&c==="[")d[e]=o(g);else if(c!=="\\")d[e]=g.replace(/[a-zA-Z]/g,function(s){s=s.charCodeAt(0);return"["+String.fromCharCode(s&-33,s|32)+"]"})}return d.join("")}for(var n=0,r=false,j=false,q=0,m=b.length;q=0;l-=16)o.push(" ".substring(0,l));l=n+1;break;case "\n":f=0;break;default:++f}if(!o)return i;o.push(i.substring(l));return o.join("")}}function I(b, +f,i,o){if(f){b={source:f,basePos:b};i(b);o.push.apply(o,b.decorations)}}function B(b,f){var i={},o;(function(){for(var r=b.concat(f),j=[],q={},m=0,t=r.length;m=0;)i[c.charAt(d)]=p;p=p[1];c=""+p;if(!q.hasOwnProperty(c)){j.push(p);q[c]=null}}j.push(/[\0-\uffff]/);o=O(j)})();var l=f.length,n=function(r){for(var j=r.basePos,q=[j,z],m=0,t=r.source.match(o)||[],p={},c=0,d=t.length;c=5&&"lang-"===k.substring(0,5))&&!(e&&typeof e[1]==="string")){h=false;k=P}h||(p[a]=k)}g=m;m+=a.length;if(h){h=e[1];var s=a.indexOf(h),v=s+h.length;if(e[2]){v=a.length-e[2].length;s=v-h.length}k=k.substring(5);I(j+g,a.substring(0,s),n,q);I(j+g+s,h,Q(k,h),q);I(j+g+v,a.substring(v),n,q)}else q.push(j+g,k)}r.decorations=q};return n}function x(b){var f=[],i=[]; +if(b.tripleQuotedStrings)f.push([A,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]);else b.multiLineStrings?f.push([A,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):f.push([A,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]);b.verbatimStrings&&i.push([A, +/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);if(b.hashComments)if(b.cStyleComments){f.push([C,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]);i.push([A,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else f.push([C,/^#[^\r\n]*/,null,"#"]);if(b.cStyleComments){i.push([C,/^\/\/[^\r\n]*/,null]);i.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}b.regexLiterals&&i.push(["lang-regex",RegExp("^"+Z+"(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)")]); +b=b.keywords.replace(/^\s+|\s+$/g,"");b.length&&i.push([R,RegExp("^(?:"+b.replace(/\s+/g,"|")+")\\b"),null]);f.push([z,/^\s+/,null," \r\n\t\u00a0"]);i.push([J,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],[z,/^[a-z_$][a-z_$@0-9]*/i,null],[J,/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],[E,/^.[^\s\w\.$@\'\"\`\/\#]*/,null]);return B(f,i)}function $(b){function f(D){if(D>r){if(j&&j!==q){n.push("");j=null}if(!j&&q){j=q; +n.push('')}var T=y(p(i.substring(r,D))).replace(e?d:c,"$1 ");e=k.test(T);n.push(T.replace(a,s));r=D}}var i=b.source,o=b.extractedTags,l=b.decorations,n=[],r=0,j=null,q=null,m=0,t=0,p=Y(window.PR_TAB_WIDTH),c=/([\r\n ]) /g,d=/(^| ) /gm,a=/\r\n?|\n/g,k=/[ \r\n]$/,e=true,h=window._pr_isIE6();h=h?b.sourceNode.tagName==="PRE"?h===6?" \r\n":h===7?" 
    \r":" \r":" 
    ":"
    ";var g=b.sourceNode.className.match(/\blinenums\b(?::(\d+))?/),s;if(g){for(var v= +[],w=0;w<10;++w)v[w]=h+'
  1. ';var F=g[1]&&g[1].length?g[1]-1:0;n.push('
    1. ");s=function(){var D=v[++F%10];return j?""+D+'':D}}else s=h;for(;;)if(m");j=null}n.push(o[m+1]);m+=2}else if(t");g&&n.push("
    ");b.prettyPrintedHtml= +n.join("")}function u(b,f){for(var i=f.length;--i>=0;){var o=f[i];if(G.hasOwnProperty(o))"console"in window&&console.warn("cannot override language handler %s",o);else G[o]=b}}function Q(b,f){b&&G.hasOwnProperty(b)||(b=/^\s*1&&m.charAt(0)==="<"){if(!ba.test(m))if(ca.test(m)){f.push(m.substring(9, +m.length-3));n+=m.length-12}else if(da.test(m)){f.push("\n");++n}else if(m.indexOf(V)>=0&&m.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,' $1="$2$3$4"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)){var t=m.match(W)[2],p=1,c;c=j+1;a:for(;c=0;){var e=p.indexOf(";",k);if(e>=0){var h=p.substring(k+3,e),g=10;if(h&&h.charAt(0)==="x"){h=h.substring(1);g=16}var s=parseInt(h,g);isNaN(s)||(p=p.substring(0,k)+String.fromCharCode(s)+p.substring(e+1))}}a=p.replace(ea,"<").replace(fa,">").replace(ga,"'").replace(ha,'"').replace(ia," ").replace(ja,"&")}f.push(a);n+=a.length}}o={source:f.join(""),tags:r};var v=o.source;b.source=v;b.basePos=0;b.extractedTags=o.tags;Q(i,v)(b);$(b)}catch(w){if("console"in window)console.log(w&&w.stack?w.stack:w)}} +var A="str",R="kwd",C="com",S="typ",J="lit",E="pun",z="pln",P="src",V="nocode",Z=function(){for(var b=["!","!=","!==","#","%","%=","&","&&","&&=","&=","(","*","*=","+=",",","-=","->","/","/=",":","::",";","<","<<","<<=","<=","=","==","===",">",">=",">>",">>=",">>>",">>>=","?","@","[","^","^=","^^","^^=","{","|","|=","||","||=","~","break","case","continue","delete","do","else","finally","instanceof","return","throw","try","typeof"],f="(?:^^|[+-]",i=0;i:&a-z])/g, +"\\$1");f+=")\\s*";return f}(),L=/&/g,M=//g,X=/\"/g,ea=/</g,fa=/>/g,ga=/'/g,ha=/"/g,ja=/&/g,ia=/ /g,ka=/[\r\n]/g,K=null,aa=RegExp("[^<]+| + + + + +

    + + 00:00 / loading... +

    +

    Video loaded: loading...

    +

    Note that (at time of writing) Webkit nightly supports full screen mode, which will add a button above.

    + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + + +Fork me on GitHub + + + + + diff --git a/www/web-socket/index.html b/www/web-socket/index.html new file mode 100644 index 0000000..c2fd85a --- /dev/null +++ b/www/web-socket/index.html @@ -0,0 +1,135 @@ + + + + + +HTML5 Demo: Web Socket + + + +
    + +
    +

    Web Socket

    +
    + + +
    +
    + +
    +

    Not connected

    +

    Users connected: 0

    +

    To test, open two windows with Web Socket support, type a message above and press return.

    +

    The server side code is available here: node-web-socket & server (note that it runs on nodejs)

    +
      +
      + + +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
      +Fork me on GitHub + + + + + diff --git a/www/worker/index.html b/www/worker/index.html new file mode 100644 index 0000000..3d4ace3 --- /dev/null +++ b/www/worker/index.html @@ -0,0 +1,70 @@ + + + + + +HTML5 Demo: Web Worker + + + +
      + +
      +

      Web Worker

      +
      + + +
      +

      This demo shows how main window animation isn't interrupted by Web Workers. Note that the animation does not work in Opera (due to lack of requestAnimationFrame support).

      +

      Use arrow keys to change the direction of the animated square. The square is animated with requestAnimationFrame.

      +
      +
      +
      +

      Click the button below to start or stop the worker.

      +
      +

      Messages from Worker:

      +
      + +
      +HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage + + +
      +Fork me on GitHub + + + + +