/ Published in: HTML
Expand |
Embed | Plain Text
<!DOCTYPE html> <html lang="en-CA" xml:lang="en-CA"> <head> <meta charset="UTF-8" /> <meta name="description" content="HTML5 Skeleton" /> <meta name="keywords" content="HTML5,HTML,CSS3,CSS,XML,JavaScript" /> <meta name="author" content="Bryan Copeland" /> <!-- BEHAVIOR (JavaScript): include any cross-browser JS libraries such as jQuery --> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- PRESENTATION (CSS3): include as many device-specific renderings as desired --> <link type="text/css" rel="stylesheet" href="css/desktop.css" media="screen" /> <link type="text/css" rel="stylesheet" href="css/tv.css" media="tv" /> <link type="text/css" rel="stylesheet" href="css/mobile.css" media="handheld" /> <!--[if !IE]> <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="css/tablet.css" media="only screen and (min-width: 321px) and (max-width: 768px)" > <link type="text/css" rel="stylesheet" href="css/projector.css" media="projection" /> <link type="text/css" rel="stylesheet" href="css/printer.css" media="print" /> <!-- CSS3 @font-face for stylized Typography --> <link type="text/css" rel="stylesheet" href="css/font.css" /><!-- All screen sizes/types see Typography --> <style type="text/css"> header, section, footer, aside, nav, article, figure, audio, video, canvas { display:block; } a { text-decoration:none; color:#363636; font-weight:bold; } img { border:0; } ul { margin:0; padding:0; } #container { text-align:center; } #name { float:left; text-align:center; padding:0px 5px 0px 5px; font-family:'Irish Growler',Arial,serif; overflow:hidden; } #name:hover { color:#0f0; text-shadow:2px 2px 2px #000; } ul#links li { list-style:none; float:left; text-align:center; height:39px; background:-webkit-gradient(radial, 50% 100%, 10, 50% 50%, 90, from(rgba(31,169,244,1)), to(rgba(0,28,78, 1)) ); background:-moz-radial-gradient(center 40px 45deg, circle cover, rgba(31,169,244,1) 0%, rgba(0,28,78, 1) 100%); } ul#links li a { display:block; font-family:'Arial Narrow',serif; background:#606060; line-height:39px; padding:0 20px; border-left:1px solid rgba(255,255,255,0.1); border-right: 1px solid rgba(0,0,0,0.1); text-align:center; background:-webkit-gradient(linear, left top, left bottom, from(rgb(168,168,168)), to(rgb(69,69,69))); background:-moz-linear-gradient(top, rgb(168,168,168), rgb(69,69,69)); -webkit-transition-property:background; -webkit-transition-duration: 700ms; -moz-transition-property:background; -moz-transition-duration:700ms; } ul#links li a:hover { background:transparent none; text-shadow:2px 2px 2px #000; } ul#link li.active a { background:-webkit-gradient(radial, 50% 100%, 10, 50% 50%, 90, from(rgba(31,169,244,1)), to(rgba(0,28,78, 1)) ); background:-moz-radial-gradient(center 40px 45deg, circle cover, rgba(31,169,244,1) 0%, rgba(0,28,78, 1) 100%); } #content { margin-left:auto; margin-right:auto; text-align:center; display:table; margin-top:-10px; } #main { display:table-cell; padding:0px 10px 0px 10px; background-color:limegreen; border:1px solid gold; -webkit-border-radius:50px; -moz-border-radius:50px; -webkit-box-shadow: 5px 5px 8px #818181; -moz-box-shadow: 5px 5px 8px #818181; } #sidebar { padding-left:20px; display:table-cell; width:40px; } #storage { float:left; padding-left:15px; font-size:80%; } #storage span { display:block; } #contact { font-size:75%; text-align:center; } .hidden { display:none; } .clear { clear:both; } .icon { vertical-align:middle; } </style> </head> <body> <div id="container"> <header id="name"> </header> <nav id="semantics" title="SEMANTICS"> <ul id="links"> </ul> </nav> <div id="content"> <div id="main"> <section id="info"> <article title="CANVAS"> <canvas id="drawingboard" width="105" height="105"> <img src="smiley.png" alt="Smiley" /> </canvas> </article> <article title="AUDIO"> <audio id="audioclip" controls="controls" preload="auto"> <source src="audio.mp3" type="audio/mpeg" /> <source src="audio.ogg" type="audio/ogg" /> <source src="audio.wav" type="audio/x-wav" /> </audio> </article> <article title="VIDEO"> <video id="videoclip" width="320" height="240" controls="controls" poster="clouds.jpg"> <source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /> <source src="video.webm" type='video/webm; codecs="vp8, vorbis"' /> <source src="video.ogv" type='video/ogg; codecs="theora, vorbis"' /> </video> </article> <article title="CROSS-DOMAIN MESSAGING"> <form> <input type="submit" id="send" value="Send" /> </form> </article> <article title="OFFLINE DATA STORAGE"> <input type="button" id="clear" value="Clear Storage" /> </article> <article id="geolocation" title="GEOLOCATION"> You are at: <span id="latitude" class="lat"></span>; <span id="longitude" class="lon"></span> <a id="geomap" href="http://maps.google.com?q=" onclick="window.open('http://maps.google.com?q='+$('#latitude').html()+','+$('#longitude').html(), 'googlemaps','toolbar=no,width=600,height=400,resizable=0'); return false;">Map</a> </article> <article title="DEVICE"> </article> </section> </div> <aside id="sidebar"> <a href="http://validator.w3.org/check?uri=referer"> <img src="http://www.w3.org/html/logo/badge/html5-badge-v-connectivity-css3-device-graphics-multimedia-performance-semantics-storage.png" width="38" height="330" alt="HTML5 Powered with Connectivity / Realtime, CSS3 / Styling, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage" title="HTML5 Powered with Connectivity / Realtime, CSS3 / Styling, Device Access, Graphics, 3D & Effects, Multimedia, Performance & Integration, Semantics, and Offline & Storage"> </a> </aside> </div> <footer id="contact" title="MICRODATA"> <div id="me" itemscope itemtype="http://microformats.org/profile/hcard"> <img class="icon" itemprop="photo" alt="Me" title="Bryan Copeland @ Urasa Conference 2007 (Niigata, Japan)" src="http://bryancopeland.com/images/me.jpg" width="30" height="25" /> <span itemprop="org" itemscope> </span> <span itemprop="adr" itemscope> </span> <span itemprop="tel" itemscope> </span> <ins datetime="2011-03-01T17:30:00+01:00"> <span itemprop="rev" itemscope> <meta itemprop="type" content="date-time" /> <meta itemprop="value" content="2011-03-01T17:30:00+01:00" /> </span> Last Updated: 2011-03-01 </ins> </div> </footer> </div> <!-- additional scripts particularly those triggered after DOM (onload, onready) --> <script type="text/javascript"> ///////////////////////////////////////////////////////// //Device API (FF, Safari and Chrome only... for now) ///////////////////////////////////////////////////////// /* MozOrientation is used in FireFox on desktops with an accelerometer and Mobile devices with Fennick installed */ window.addEventListener("MozOrientation", function(e) { /* 3 values: e.x, e.y, e.z */ if(e.x!=0 || e.y !=0) { $("#device").html("Hey, put me down!"); } }, true); /* deviceorientation is used for Chrome and Android */ window.addEventListener('deviceorientation', function(event) { var a = event.alpha; var b = event.beta; var g = event.gamma; if (a>=40||b>=40) { $("#device").html("Woah, not so fast!"); } }, false); /* iOS 4.2+ (official iPhone Device API) */ window.ondevicemotion = function(event) { ax = event.accelerationIncludingGravity.x; ay = event.accelerationIncludingGravity.y; if (ax>=40||ay>=40) { $("#device").html("Woah, not so fast!"); } } //iOS 3.x (not supported) window.orientation returns a value that indicates whether iPhone is in portrait mode (0), landscape mode with the screen turned to the left (90), or landscape mode with the screen turned to the right (-90). */ window.onorientationchange = function() { switch(window.orientation) { case 0: //in portrait mode $("#device").html("Now in portrait orientation"); break; case 90: //in landscape mode (screen turned to the left) $("#device").html("Now in landscape orientation (left)"); break; case -90: //in landscape mode (screen turned to the right) $("#device").html("Now in landscape orientation (right)"); break; } } ///////////////////////////////////////////////////////// //Offline DataStorage ///////////////////////////////////////////////////////// //DataStorage helper (non-jQuery) function getStorage(type) { var storage = window[type + 'Storage'], delta = 0, localOffline = document.createElement('span'); if (!window[type + 'Storage']) { return; } if (storage.getItem('value')) { delta = ((new Date()).getTime() - (new Date()).setTime(storage.getItem('timestamp'))) / 1000; localOffline.innerHTML = type + ': ' + storage.getItem('value') + ' (last updated: ' + delta + 's ago)'; } else { localOffline.innerHTML = type + ': empty'; } localOffline.id = type+'Storage'; document.querySelector('#storage').appendChild(localOffline); } //Geo-Location helper function geoLocate(position) { $('#latitude').html(position.coords.latitude); $('#longitude').html(position.coords.longitude); $('#geomap').attr('href').append(position.coords.latitude+','+position.coords.longitude); } $(document).ready(function() { ///////////////////////////////////////////////////////// //DataStorage (pre-load fields) getStorage('session'); getStorage('local'); addEvent(document.querySelector('#session'), 'keyup', function () { sessionStorage.setItem('value', this.value); sessionStorage.setItem('timestamp', (new Date()).getTime()); document.getElementById('sessionStorage').innerHTML = 'session: ' + this.value; }); addEvent(document.querySelector('#local'), 'keyup', function () { localStorage.setItem('value', this.value); localStorage.setItem('timestamp', (new Date()).getTime()); document.getElementById('localStorage').innerHTML = 'local: ' + this.value; }); addEvent(document.querySelector('#clear'), 'click', function () { sessionStorage.clear(); localStorage.clear(); document.querySelector('#storage').innerHTML = ''; getStorage('local'); getStorage('session'); }); $('#session').val(sessionStorage.getItem('value')); $('#local').val(localStorage.getItem('value')); ///////////////////////////////////////////////////////// //Geo-Location ///////////////////////////////////////////////////////// if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(geoLocate, function() { $("#geolocation").html("Geo-Location not allowed"); } ); } else { $("#geolocation").html("No Geo-Location support"); } ///////////////////////////////////////////////////////// //Canvas drawing ///////////////////////////////////////////////////////// var canvas = document.getElementById('drawingboard'); // Make sure we don't execute when canvas isn't supported if (canvas.getContext) { // use getContext to use the canvas for drawing var ctx = canvas.getContext('2d'); ctx.beginPath(); // Draw shapes ctx.arc(75,75,30,0,Math.PI*2,true); // Outer circle ctx.moveTo(98,75); ctx.arc(75,75,22,0,Math.PI,false); // Mouth ctx.moveTo(65,65); ctx.arc(60,65,5,0,Math.PI*2,true); // Left eye ctx.moveTo(95,65); ctx.arc(90,65,5,0,Math.PI*2,true); // Right eye ctx.stroke(); } else { $('#drawingboard').html('You need Safari or Firefox 1.5+ to see the canvas demo.'); } ///////////////////////////////////////////////////////// //Web Messaging (cross-domain) ///////////////////////////////////////////////////////// var win = document.getElementById("iframe").contentWindow; addEvent(document.querySelector('form'), 'submit', function (e) { win.postMessage( document.getElementById("message").value, "http://www.bryancopeland.com"); if (e.preventDefault) { e.preventDefault(); } // otherwise set the returnValue property of the original event to false (IE) e.returnValue = false; }); }); </script> </body> </html>
You need to login to post a comment.
