Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Future Friendly HTML5

Mike King
November 16, 2013

Future Friendly HTML5

The latest version of HTML brings incredible features to the browser, but like all things, with great power comes great responsibility. Learn how to harness the new capabilities in HTML5 & CSS3 responsibly by progressively enhancing your websites with new elements, multimedia, advanced graphics, and animations.

By the end of this course you will have a solid understanding of the new capabilities within HTML & CSS and know how to think and design in a `future-friendly` way.

Mike King

November 16, 2013
Tweet

Other Decks in Design

Transcript

  1. What we’ll be discussing The Web: Past, Present, & Future

    What is HTML5? Progressive Enhancement
  2. vs.

  3. *

  4. “How do you know whether an app is written in

    HTML5” “Open it in IE, if it doesn’t work, it’s HTML5”
  5. Over 2.4 billion people have access to the internet (⅓

    of world population) http://www.internetworldstats.com/stats.htm
  6. Over 1.2 billion people access the web from their mobile

    devices. (½ of all people with internet access) http://www.digitalbuzzblog.com/wp-content/uploads/2012/07/the-rise-of-mobile-infographic1.png
  7. Global mobile traffic now accounts for 17% of all Internet

    traffic. (28% in U.S.) http://www.slideshare.net/kleinerperkins/kpcb-internet-trends-2013
  8. Android reached one billion devices in July 2013. PC’s reached

    one billion in September 2009 http://www.asymco.com/2013/09/06/third-to-a-billion/
  9. Over the next decade, internet bandwidth will likely become 57

    times faster, while computers will become 100 times more powerful. http://www.nngroup.com/articles/mobile-sites-vs-apps-strategy-shift/
  10. Mobile industry will go from six billion connections today to

    more than 12 billion by 2020 http://allthingsd.com/20111010/mobile-devices-seen-doubling-by-2020-as-non-phones-dominate-wireless- airwaves/
  11. “[HTML5] is now basically being used to mean anything Web-standards

    related” – Ian Hickson http://blog.whatwg.org/html-is-the-new-html5
  12. <div class=”header”> <h1>My Fancy Website</h1> </div> <div class=”main”> <p>Yup, this

    is it!</p> </div> <div class=”sidebar”> <p>Some tangent...</p> </div> <div class=”footer”> <p>by Yours Truly</p> </div>
  13. <header> <h1>My Fancy Website</h1> </header> <section> <p>Yup, this is it!</p>

    </section> <aside> <p>Some tangent...</p> </aside> <footer> <p>by Yours Truly</p> </footer>
  14. <article> <header> <h2>Cheese sandwiches</h2> </header> <p>MY cat loves cheese sandwiches</p>

    <footer>Published on <time datetime=”2005-10-08T15:30” pubdate>3:30pm on October 8th, 2004</time> by Yours Truly</footer> </article>
  15. <input type=”text” value=”[email protected]”> <input type=”text” value=”http://dude.com”> <input type=”text” value=”11/16/2013”> <input

    type=”text” value=”12:00p”> <input type=”text” value=”Blue”> <input type=”text” value=”555-555-5555”>
  16. <input type=”email” value=”[email protected]”> <input type=”url” value=”http://dude.com”> <input type=”date” value=”11/16/2013”> <input

    type=”time” value=”12:00p”> <input type=”color” value=”Blue”> <input type=”tel” value=”555-555-5555”>
  17. Audio <audio controls autoplay loop muted preload=”auto”> <source src=”myaudio.ogg” type=”audio/ogg”>

    <source src=”myaudio.mp3” type=”audio/mp3”> <!-- Fallback content, such as flash o_O --> </audio>
  18. Video <video controls autoplay loop muted preload=”auto” poster=”myvideobackground.jpg” height=”250” width=”

    300”> <source src=”myvideo.webm” type=”video/webm”> <source src=”myvideo.mp4” type=”video/mp4”> <!-- Fallback content, such as flash o_O --> </video>
  19. Inline SVG <svg xmlns=”http://www.w3.org/2000/svg”> <circle id=”greencircle” cx=”50” cy=”50” r=”50” fill=”green”

    /> </svg> External SVG <img src=”green-circle.svg” height=”64” alt=”green circle”>
  20. Normal layout .container { display: block; height: 100px; } .left

    { background: green; width: 500px; } .right { background: blue; } .left .right
  21. Flexbox layout .container { display: box; height: 100px; } .left

    { background: green; width: 500px; } .right { background: blue; flex: 1; } .left .right
  22. Media Queries /* Small Screens */ @media all (max-width: 480px){

    /* Mobile device with max width of 480px */ } /* Medium screens */ @media all (max-width: 768px){ /* Mobile device with max width of 768px */ }
  23. Animations @keyframes spin{ 0% { transform: rotate(0deg); } 100% {

    transform: rotate(360deg); } } animation: spin 5s ease infinite;
  24. History API link.addEventListener(‘click’, function(event){ event.preventDefault(); history.pushState({url: this.href}, null, this. href);

    gotToPage(this.href); }); window.addEventListener(‘popstate’, function(event){ goToPage(event.state.url); });
  25. WebSocket var socket = new WebSocket(‘ws://html5rocks. websocket.org/echo’); socket.onopen = function(event)

    { socket.send(‘Hello, WebSocket’); }; socket.onmessage = function(event){ alert(event.data); } socket.onclose = function(event){ alert(‘closed’); }
  26. Drag and Drop function allowDrop(ev){ ev.preventDefault(); } function drag(ev){ ev.dataTransfer.setData("Text",ev.target.id);

    } function drop(ev){ ev.preventDefault(); var data = ev.dataTransfer.getData("Text"); ev.target.appendChild(document.getElementById (data)); }
  27. Geolocation if (navigator.geolocation){ navigator.geolocation.getCurrentPosition(function (position){ var latlang = new google.maps.LatLng(position.

    coords.latitude, position.coords.longitude); var marker = new google.maps.Marker({position: latlng, map: map}); map.setCenter(latlng); }, errorHandler); }
  28. Selectors API var wally = document.getElementsById(‘wally’); var friends = document.getElementsByClassName

    (‘friend’); var wallyDivs = document.getElementsByTagName(‘div’); var friendsInFooter = document.querySelectorAll (‘footer .friend’);
  29. Audio / Video <!-- HTML --> <audio id=”audio” src=”sound.mp3” controls></audio>

    <video id=”video” src=”movie.mp4” controls></video> // JavaScript document.getElementById(‘audio’).muted = false; document.getElementById(‘video’).play();
  30. By anticipating what’s next, we can react to today’s concerns

    but also build long-term value for people and businesses.
  31. Designing for mobile first not only prepares you for the

    explosive growth and opportunities in this space, it forces you to focus and enables you to innovate.
  32. Make sure that your web pages and apps are available

    to everyone, including people with disabilities.
  33. HTML5 Boilerplate - http://html5boilerplate.com/ HTML5 Rocks - http://www.html5rocks.com/en/ A Book

    Apart - http://www.abookapart.com/ Dive into HTML5 - http://diveintohtml5.info/ Future Friendly - http://futurefriend.ly/ Media Queries - http://mediaqueri.es/ CSS3Please - http://css3please.com/ Modernizr - http://modernizr.com/ Can I Use - http://caniuse.com/ Codepen - http://codepen.io/ Dochub - http://dochub.io/