⭐ If you would like to buy me a coffee, well thank you very much that is mega kind! : https://www.buymeacoffee.com/honeyvig
Hire a web Developer and Designer to upgrade and boost your online presence with cutting edge Technologies
Showing posts with label HTML 5. Show all posts
Showing posts with label HTML 5. Show all posts

Sunday, November 30, 2014

Page loading effect using jQuery and CSS3

In this tutorial we will learn how to load your contents in your website with some user experience to make it feel lively. In this we will load the contents as they scroll down. The contents will come out with a fadeIn effect and then it will move up slightly.

Step 1 : Include the Js files
You need to include the latest Jquery Library file.Here I used is
Then you need to include the wayfinder.js file to calculate the scroll amount.
<script src="js/wayfinder.js" ></script>
Step 2: Add the following CSS
.load-animate {opacity: 0;}
 
.fadeInUp {-webkit-animation-name: fadeInUp;-moz-animation-name: fadeInUp;-o-animation-name: fadeInUp;animation-name: fadeInUp;}
 
.animated {-webkit-animation-duration: 1s;-moz-animation-duration: 1s;-o-animation-duration: 1s;animation-duration: 1s;
 
-webkit-animation-fill-mode: both;-moz-animation-fill-mode: both;-o-animation-fill-mode: both;animation-fill-mode: both;
 
}
 
@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}
Step 3 : Add class load-animate
Now you need to add a class name load-animate where you want the animation to happen.
Example Html :
<div class="load-animate" id="inner1">
 
</div>
Step 4: Initialize the script
$(document).ready(function() {
 
&nbsp;
 
&nbsp;
 
jQuery('.load-animate').waypoint({
 
triggerOnce: true,
 
offset: '70%',
 
handler: function() {
 
jQuery(this).addClass('animated fadeInUp');
 
}
 
});
 
&nbsp;
 
});
 
JS
 
--------wayfinder.js----

// Generated by CoffeeScript 1.4.0

/*

jQuery Waypoints - v2.0.2

Copyright (c) 2011-2013 Caleb Troughton

Dual licensed under the MIT license and GPL license.

https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt

*/

(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(this,function(n,r){var i,o,l,s,f,u,a,c,h,d,p,y,v,w,g,m;i=n(r);c=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t,e){t.each(function(){var t;t=l.getWaypointsByElement(this);return n.each(t,function(t,n){n[e]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(a,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=a[n(t).data(u)])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
-----

Thursday, November 14, 2013

Laying The Groundwork For Extensibility

The Web has succeeded at interoperability and scale in a way that no other technology has before or since. Still, the Web remains far from “state of the art”, and it is being increasingly threatened by walled gardens. The Web platform often lags competitors in delivering new system and device capabilities to developers. Worse, it often hobbles new capabilities behind either high- or low-level APIs, forcing painful choices (and workarounds) on developers.
Despite browser versions being released much faster, new capabilities still take a long time to materialize, and often do so in forms that are at best frustrating and at worst nearly useless to large swathes of the developer community for solving real-world needs.
The best recent improvements to the platform have been the result of collaborative discussions between developers and browser vendors. Sometimes these lead to big new features. More often than not, they lead to small changes that make existing systems suitable for a wider range of uses. In the absence of an intellectual framework for making these changes, we get a hodgepodge approach to design, where good ideas are not carried through and discredited patterns live on far longer than they should.
Building on the successes of tight collaboration between Web developers and browser-makers, folks who have iterated on proposals and straddled both sides of the line have taken a longer look at what gives Web features longevity and utility.
image-4
The result of collaborative discussions between developers and browser vendors lead to small changes that make existing systems suitable for a wider range of uses. (Image source)
Over a decade of JavaScript library work, the progressive-enhancement revolution, the advent of polyfills, and the effort to birth the “Web Components” and “Shadow DOM” specifications have taught us surprising lessons: In every period, being able to use features in both high- and low-level forms has always been desirable.
HTML is great, until it isn’t. And JavaScript-only has predictable (and thankfully, now acknowledged) drawbacks.
Thinking that there is a “right way” to build new Web features is seductive. Just define The Way To Do It™ and make all standard-bearers comply, right? Turns out, it’s not that simple. New proposals are organic and stem from needs, not from pure speculation. Low-level needs demand low-level solutions. HTML elements and CSS rules aren’t natural fits for all work. And the existence of JavaScript creates a need for new APIs near the language level.
The process of introducing new features is usually an either-or proposition (i.e. either declarative features or low-level APIs) in the short run. But in the long run, nearly all features need expression in both domains. Moreover, we have to realize that proposals for new standards are hard work. The people doing that hard work are generally trying to do the right thing and can’t wait forever to ship features. A pragmatic, realistic approach to increasing the power and quality of Web APIs is needed, one that doesn’t presuppose infinite time, effort or understanding on the part of participants — just goodwill and a willingness to build bridges.
To support this goal, the standards process needs an intervention.
The Extensible Web Manifesto is a document that we have drafted to build consensus among standards participants around a few core ideas:
  • High-level APIs and markup should provide direct extension points via JavaScript.
  • Where the platform already provides high-level systems, related low-level additions should be used to explain how the high-level bits would have been written in terms of these new lower-level APIs.
  • When adding new raw power to the platform, prefer lower-level to higher-level APIs because they enable experimentation and iteration ahead of broad adoption.
The core insight is that the Web has come this far on the back of largely declarative, largely high-level features: HTML elements for forms, CSS for layout and styling, and <a> for defining relationships between documents. While each of these adds APIs, little effort has been made so far to explain how they do their work and how they relate to each other.
While you can almost sense the many strata of APIs below Web features, they go unnamed, unexplained, unconnected and unavailable to you when the system doesn’t do exactly what you need.
image-2
It’s vital to know how APIs work and how they’re connected to each other. (Image source)
For example:
  • The HTML5 canvas element defines a programmatic 2-D bitmap API, while the long-standing img element is, not coincidentally, a way of rendering 2-D bitmap content. It’s easy to imagine that we could explain how JavaScript loads, unpacks and finally renders image content using the canvas API. Very strange that they’re separate elements and that the img element doesn’t have the canvas API, no?
  • Asking for camera access with <input type="file" accept="image/*;capture=camera"> as well as with getUserMedia() is possible, but the form element version isn’t explained in the HTML specification in terms of getUserMedia() (which, admittedly, was added later — but no one has bothered to connect them yet).
  • That’s better than the Geolocation API. There’s currently no way to do that with an input element. It’s a valuable feature entirely disconnected from markup.
  • Neither HTML nor the Web Audio API explains how the audio tag works, despite the Web Audio API clearly being capable of providing the audio element’s implementation.
This isn’t to pick on or single out any of the hard-working developers and authors who have poured their lives into building consensus and software to introduce these capabilities. Indeed, we are grateful for their accomplishments.
The high-order bit is that the job isn’t done when both declarative and script-driven versions of a feature appear. Building a platform that’s resilient and adaptive for the long haul hinges on giving developers the confidence to take what they learn about one area and apply it evenly across the system. And that means explaining how the system works and drawing connections between the pieces.
In the case of many low-level APIs without high-level equivalents (such as Geolocation), their duty to “explain themselves” ends at the point where they have exposed a good API to JavaScript. “Good” here could mean being idiomatic and not introducing more platform magic than necessary. But when there are also declarative versions, or when only high-level versions exist, then the question looms large: How does that thing work? What are the layers below it? What APIs are required to make it go? How would you explain that API in mostly-JavaScript terms, appealing as little as possible to magical new platform APIs?
In an earlier time, attempting such a sweeping cultural change might have been foolish. Starting at a declarative level was undoubtedly a good idea. However, explaining even a bit of the underlying magic goes a long way: Exposing a DOM tree JavaScript opened new worlds to developers and bolstered the competitiveness of the platform. It also enabled the community to adapt through experimentation and enabled libraries to compete. This allows valuable, popular API ideas to potentially be standardized. The community can do it faster and with less risk than browser vendors and standards organizations can.
The answers aren’t always obvious, but the process of asking “How does that work?” is often more fruitful than it first appears. Details come into focus and missing explanations are uncovered, layer by layer. At each layer, it’s tempting to throw up our collective hands and say “It’s too hard” to explain all the stuff down there. Throw it all out. Start over. At least we won’t make the same mistakes, right?
Perhaps. But we’d also be starting from zero. Zero users, zero developers and zero useful content. The Web is the open, extensible, multi-vendor, universal platform of our lifetime. Small, meaningful changes to the Web can have an outsized impact relative to the effort involved. It’s a straightforward way to do a great deal of good. Encouraging layering, bit by bit, doesn’t mean giving up or “slowing down.” Just the opposite: It’s our only credible hope of making a Web that’s worthy to succeed the Web we have today.
image-1
Always keep in mind to “make things better” as much as you can. (Image source)
(al, ea, il)

Wednesday, January 18, 2012

Quickly build a prototype to test on any device

Quickly build a prototype to test on any device

This article shows you how to use Foundation, a new, responsive open source framework, to quickly build a prototype you can test and build onto for any device

Hopefully you have ever Let’s sum up where we are in a few simple truths:
  • The number and type of devices people can use to get online is increasing every day
  • Building a different interface for every device is impossible
  • Not considering devices when you build is a death sentence for your site or app
Cheery, right? Don’t worry, we’ll get through this together. The reason we say this is ‘a poorly-realised present’ is that different devices and screens has always been a problem, we’ve just ignored it for years and kept building 960 grid system sites.
What we need now is a way to quickly build out prototypes that work on all devices, not just laptops and desktops. That’s why we developed Foundation, an open source front-end framework to help you rapidly prototype for any kind of device, and then take that prototype and extend it into a production-ready site. If you’re curious, you can check out foundation.zurb.com and see what the framework is all about. If you’re a total boss, though, follow along while we build a quick prototype that we can test out on whatever device we have at hand.
Off we go!

Getting started

To begin, download the code pack from foundation.zurb.com - it’s the big blue button right there on the homepage. That’ll give us a simple directory with a few pieces in it:
  • index.html - We’ll be building our first page right here.
  • javascripts/ and stylesheets/ - These are the main files for Foundation to work, including jQuery and a swath of handy global styles.
  • humans.txt and robots.txt - Nice boilerplate elements you can use and peruse at your leisure.
For our purposes today don’t worry about the JavaScript. However, inside the stylesheets folder are some files we’re interested in:
  • global.css - This is the meat of Foundation. It includes the styles for the grid, a 12-column, arbitrary width, nestable tool for quickly building complex layouts. It also includes typography, some layout tools, and various common elements.
  • ui.css - We’ll be using this as well, as it includes a number of other elements useful for quickly putting together a prototype.
  • mobile.css - Finally, this guy helps the prototype we build on our desktop adjust itself to mobile devices.
Load up the directory for the downloaded Foundation files in your editor of choice (we like Coda or Textmate, but your call) and go ahead and open up index.html, both there and in your browser. You’ll notice in your browser that the index file starts with a few elements already in place to get your feet wet: we’ll start by looking at the grid.

The grid

We mentioned the grid when we talked about global.css: let’s look at how it works. If you’re familiar with a 960 grid system such as 960.gs or Blueprint, the Foundation grid syntax should feel pretty standard. Here’s an example:
  1. <div class="container">
  2.         <div class="row">
  3.                 <div class="eight columns"> ... </div>
  4.                 <div class="four columns"> ... </div>
  5.         </div>
  6. </div>
The grid comprises three elements: containers, rows, and columns. The container element does nothing more than add left and right padding to the page, so as a window scales down your content doesn’t run into the edge.
Rows are made to contain columns, and they have an arbitrary max-width that prevents your layout from stretching all the way out on very large displays (you can, however, remove that constraint for a truly fluid layout).
Finally, columns hold your content, and there can be up to 12 of them in total in a row. In the example above we’ve created a simple thirds layout, two-thirds and then one-third content sections. We could reasonably title our sections above like so:
  1. <div class="container">
  2.         <div class="row">
  3.                 <div class="eight columns" id="mainContent"> ... </div>
  4.                 <div class="four columns" id="sidebarContent"> ... </div>
  5.         </div>
  6. </div>
The grid can also be nested, which looks like this:
  1. <div class="container">
  2.         <div class="row">
  3.                 <div class="eight columns">
  4.         <div class="row">
  5.                 <div class="four columns"> ... </div>
  6.                 <div class="four columns"> ... </div>
  7.                 <div class="four columns"> ... </div>
  8.         </div>
  9. </div>
  10.                 <div class="four columns"> ... </div>
  11.         </div>
  12. </div>
You can see some more examples of the grid on the Foundation site, including this one: http://foundation.zurb.com/grid-example2.php. All set? Good; let’s spend the rest of our time together actually building something!

We do mean ‘rapid’ prototyping

For this example we’re going to put together two pages of a simple content site, a very basic news site. We’ll do the homepage and an article page so we can see not only how to use Foundation to do this crazy-fast, but also how to modify it for different devices.
We’ll base the homepage on this sketch we did for the desktop view of the site:
You can see we have a header area, a main article, several secondary articles, and then a row of featured content. For this page we’ll use several Foundation constructs and one nifty outside service:
  • The layout will be created using the grid that we’ve already talked about
  • The main nav will be created using Foundation’s built-in tabs
  • The image placeholders we’ll fill in using placehold.it, a totally sweet service that returns filler blocks based on any dimensions. For our purposes the dimensions almost don’t matter, and we’ll talk about why.
Let’s do it! We’ll start with the header, and we’ll use the HTML5 header element (which Foundation manages for older browsers). We’ll give the header a class of ‘row’ so it can stand in for our row object, and inside that we’ll place a few columns.
  1. <div class="container">
  2.         <header class="row">   
  3.                 <div class="two columns">
  4.                         <img src="http://placehold.it/200x120" />
  5.                 </div>
  6.                 <div class="eight columns">
  7.                         <h1 class="centered">The Foundation Times</h1>
  8.                         <h5 class="centered">December 1, 2011</h5>
  9.                 </div>
  10.                 <div class="two columns">
  11.                         <img src="http://placehold.it/200x120" />
  12.                 </div>
  13.         </header>
You can see that we open the container, then place a row, and inside the row we place our columns. The columns can be any combination that doesn’t exceed 12. Inside our columns we’ll drop placeholders, and in the middle we’ll drop in an H1 element with a subtitle below it. We’re not going to style any of this now; we just want to see how it comes together.
After the header we want some nav for our desktop users, so they can find the sections we’ve devoted to various kinds of dromedary. Why llamas and such? Why not! For the nav we’ll use tabs, a construct built into Foundation. The nav will look like this:
  1. <div class="row">
  2. <div class="twelve columns">
  3.                 <dl class="tabs">
  4.                         <dd><a href="#" class="active">All News</a></dd>
  5.                         <dd><a href="#">Llamas</a></dd>
  6.                         <dd><a href="#">Alpacas</a></dd>
  7.                         <dd><a href="#">Vicunas</a></dd>
  8.                         <dd><a href="#">Other Dromedaries</a></dd>
  9.                 </dl>
  10.         </div>
  11. </div>
You’ll notice the nav goes in a row and column as well. This is necessary for the grid to maintain the layout correctly, and for this to work on mobile devices (as we’ll see later). With our simple nav in place it’s just a matter of blocking in the rest of our content. We’ll use the grid, basic elements, and a single other Foundation elements to build the remainder of the page.
  1. <div class="row">
  2.         <div class="eight columns">
  3.                 <img src="http://placehold.it/800x340" />
  4.                 <h3><a href="#">Llamas: Great Pets or the Best Pets?</a></h3>
  5.                 <p>Intrepid reporter Jordan Humphreys went to Happy Time Llama Farm to investigate: are llamas merely great pets, or he best pets? Read the full article to find out!</p> <a href="#" class="small radius nice blue button">Read More &rarr;</a>
  6.         </div>
  7.         <div class="four columns">
  8.                 <div class="row">
  9.                         <div class="five columns">
  10.                                 <img src="http://placehold.it/120x100" />
  11.                         </div>
  12.                         <div class="seven columns">
  13.                                 <h5><a href="">Alpaca Farm Closed</a></h5>
  14.                                 <p>Anthony Tadina reports on this tragic closing.<br /><a href="#">Read More &rarr;</a></p>
  15.                         </div>
  16.                 </div>
  17.                 ... [repeat this row twice more]
  18.         </div>
  19. </div>
  20.                
  21. <div class="row">
  22.         <div class="twelve columns">
  23.                 <hr />
  24.         </div>
  25. </div>
  26.                
  27. <div class="row">
  28.         <div class="three columns">
  29.                 <img src="http://placehold.it/260x190" />
  30.                 <h5><a href="#">Feature 1</a></h5>
  31.                 <p>Description<br /><a href="#">Read More &rarr;</a></p>
  32.         </div>
  33.         ... [repeat this column 3 more times]
  34. </div>
  35.                
  36. <footer class="row">
  37.         <div class="seven columns">
  38.                 <p><strong>The Foundation Times</strong><br />&copy; 2025 no rights reserved.</p>
  39.         </div>
  40.         <div class="five columns">
  41.                 <p><a href="#">All News</a> | <a href="#">Llamas</a> | <a href="#">Alpacas</a> | <a href="#">Vicunas</a> | <a href="#">Other Dromedaries</a></p>
  42.         </div>
  43. </footer>
As you can see, the markup is very simple. We have one new construct in here for buttons, which Foundation includes various versions of. Here you can see we’ve taken an anchor (could also be a button or input[type=”button”]) and added classes of small, radius, nice, blue and button to it. It breaks down like this:
  • small - Could also be large, and if it’s not declared the button is a medium size.
  • radius - This means apply a slight border radius to soften the button. Could also be ‘round’ or undeclared for square.
  • nice - This adds a slight shine to the button and some other subtle visual affordances.
  • blue - Could also be red, black, or grey (or whatever you create).
  • button - This actually creates the structure and size, and is the only required class.
What we’ve achieved here very quickly is a page that’s almost ready for actual prototyping, but there are some considerations we need to make for other devices than the desktop.

Think mobile

Users on mobile devices have different expectations when they come to a content site (or an app). In our case, we want users on a mobile device to immediately see our content so they can read it, then decide if they want to go somewhere else. Mobile users are more tolerant of scrolling below the fold, but less tolerant of having to endure a long load of titles and nav before they can read anything. Here’s what our site looks like on a small device right now:
Not ideal, right? What Foundation is doing is making each of our columns 100% width, basically linearising the content. A lot of the time this will work great on mobile and we won’t need to do anything else, but in this case we want to make some changes. We’ll use Foundation’s mobile visibility classes to selectively show different content on a phone. Where before we had this as the header:
  1. <header class="row">  
  2.     <div class="two columns">
  3.         <img src="http://placehold.it/200x120" />
  4.     </div>
  5.     <div class="eight columns">
  6.         <h1 class="centered">The Foundation Times</h1>
  7.         <h5 class="centered">December 1, 2011</h5>
  8.     </div>
  9.     <div class="two columns">
  10.         <img src="http://placehold.it/200x120" />
  11.     </div>
  12. </header>
Now, we’ll have this:
  1. <header class="row hide-on-phones">  
  2.     <div class="two columns">
  3.         <img src="http://placehold.it/200x120" />
  4.     </div>
  5.     <div class="eight columns">
  6.         <h1 class="centered">The Foundation Times</h1>
  7.         <h5 class="centered">December 1, 2011</h5>
  8.     </div>
  9.     <div class="two columns">
  10.         <img src="http://placehold.it/200x120" />
  11.     </div>
  12. </header>
  13.  
  14. <header class="row show-on-phones">
  15.     <div class="twelve columns">
  16.         <img src="http://placehold.it/480x100" />
  17.        
  18.         <h1 class="centered">The Foundation Times</h1>
  19.         <h5 class="centered">December 1, 2011</h5>
  20.     </div>
  21. </header>
You’ll notice two classes in there: one called hide-on-phones, the other called show-on-phones. Foundation has several of these mobile visibility classes so you can rapidly prototype different layouts and interactions for different classes of device (you can also hide/show on desktops and tablets).
The syntax implies only, as in only show on phones, so the second header is what we’ll see on a phone. What we’ve done is create a different header for small devices that maintains one image above the title (for an ad, or similar) and simplifies our layout so we can get to content faster. With a little CSS...
  1. h1.centered { text-align: center; margin-bottom: 0; }
  2. h5.centered { text-align: center; }
  3.  
  4. .show-on-phones h1.centered { font-size: 24px; font-size: 2.4rem; }
  5. .show-on-phones h5.centered { font-size: 12px; font-size: 1.2rem; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #ddd; }
...we can clean up the title on both large and small devices. Now what we see is this:
Much closer! Now our problem is that nav: too many tabs, and in the wrong place. For a device like this we’ll want the nav down on the bottom, so what we’ll do is hide the main nav on desktops, like this:
  1. <div class="row hide-on-phones">
  2.     <div class="twelve columns">
  3.         <dl class="tabs">
  4.             <dd><a href="#" class="active">All News</a></dd>
  5.             <dd><a href="#">Llamas</a></dd>
  6.             <dd><a href="#">Alpacas</a></dd>
  7.             <dd><a href="#">Vicunas</a></dd>
  8.             <dd><a href="#">Other Dromedaries</a></dd>
  9.         </dl>
  10.     </div>
  11. </div>
Now at the bottom of the page, above the footer, we’ll drop that same block back in place, with two changes:
  1. <div class="row show-on-phones">
  2.     <div class="twelve columns">
  3.         <dl class="tabs mobile">
  4.             <dd><a href="#" class="active">All News</a></dd>
  5.             <dd><a href="#">Llamas</a></dd>
  6.             <dd><a href="#">Alpacas</a></dd>
  7.             <dd><a href="#">Vicunas</a></dd>
  8.             <dd><a href="#">Other Dromedaries</a></dd>
  9.         </dl>
  10.     </div>
  11. </div>
We added a show-on-phones class to the nav above the footer, and a class of ‘mobile’ to the tabs, so they look like this:
Now we’re really cooking. We’ve got a lot of code samples in here but remember: we’re mostly copying and pasting, and modifying some simple class names and structural elements. Since the hit on load for text like this is pretty low we could feasibly even move this into production, or we can do some server-side detection later to render only what we need. Our goal is to prototype our site quickly without getting hung up on tools, and that’s what Foundation is for.

Your turn!

Try to create our second article page, seen in this sketch, from scratch. We’ve added a couple of notes so you can see where you might want to use certain elements, and you can view the code for a completed article prototype page here:

Does this actually work?

Well, yes. Building for multiple devices is a necessity now, and the best way to build a better product for different screens is to see how your design actually works on those devices. Iteration can’t happen any more just in Photoshop, at least not without doing a whole lot of different comps.

We used this approach recently for a 24-hour design marathon we did at ZURB for a local non-profit called Rebekah Children’s Services. After sketching out their new site we built the entire prototype (just like we did up above) in about two hours, and that was invaluable. We could not only see how it would work responsively, we were able to get engineering started on the back end and content teams starts on the copy while we kept working on the visual design and final implementation. You can check out the whole process here: www.zurb.net/zurbwired2011 or check out the prototype we built here: www.zurb.net/zurbwired2011/projects/zurbwired2011/frame/prototype.php. Again, the prototype was rough, but very useful.

We’ve also used Foundation to prototype and then build various client sites as well as most of our newer apps like axeapp.com, spurapp.com, and reelapp.com.

Get building!

Foundation is open source and completely free, so you can grab the entire site or just the starting framework and do whatever you’d like with it. We’ve found it very helpful for building sites in a future-friendly way, and hopefully you do too. If you have questions, find bugs, or just want to give feedback we’d love to hear from you at foundation@zurb.com or on the issues board on Github.

a glimpse into the future of web design.

Friday, November 4, 2011

Best Free and Premium HTML5 WordPress Themes

Best Free and Premium HTML5 WordPress Themes 
Best Free and Premium HTML5 WordPress Themes
Best Free and Premium HTML5 WordPress Themes. WordPress is one of the famous blogging platform. It have a lot of benefit, like SEO friendly, we can using Plugins to customize our blogs, A lot of free WordPress themes for download with nice design, and a lot of another benefits.

Yes, WordPress have tons of WP themes, and one of them is using HTML5. It is the latest revision of the HTML standard. Currently now there are a lot of web designers who use HTML5, because all browsers have HTML5 supports. HTML5 has many new features, especially in the layout (framework, canvas, etc). For that reason, i want to share about nice HTML5 WordPress themes with nice and elegant design that can make your sites or blogs more nice and interactive.

Best Free and Premium HTML5 WordPress Themes

Free HTML5 WordPress Themes

  1. California
    This simple one column WordPress theme is based on the idea of micro blogging and would be best suited to a video or photo blog. The theme is built on HTML5 and CSS3. California have clean design with jQuery page scroll plugin. California HTML5 WordPress Themes
    Live Demo | Download
  2. TemplateGate
    The design of Temple Gate is inspired by the spirituality and simplicity of Japanese Temple Gate. TemplateGate was bulit in WordPress 3.0+ ready with multilingual translation. It’s also have Theme Options (for logo, Feed icons, Twitter, Facebook profile and google analytics code from admin) for easy customization. TemplateGate HTML5 WordPress Themes
    Live Demo | Download
  3. HTML5Press
    HTML5Press is a bright, colorful blogging-oriented theme, but it would also make a decent base for your own HTML5 + CSS3 theme creation. It’s have a lot of features, like featured post images, WordPress menu support, WordPress widget support, threaded comments, and “Back To Top” Button.  HTML5Press WordPress Themes
    Live Demo | Download
  4. Grey
    Grey theme was built to have an elegant, out of the box, design with a strong core layout structure.  Grey is generic enough to be used for almost any kind of blog. Whether you’re looking to setup your own design blog, a blog about photography, fashion or whatever your passion, the Grey theme should suit your needs. It is built on a simple layout, but with lots of little touches of subtle detail and texture.
    Grey HTML5 WordPress Themes
    Download
  5. Twilight
    A clean and professional looking WordPress theme with built in Jquery image slider. This theme is coded in HTLM5 and CSS3. The theme is free to download.  Twilight HTML5 WordPress Themes
    Live Demo | Download
  6. Travel
    TheTravelTheme is a free theme for WordPress designed to offer travel bloggers enhanced functionality for showcasing their blog posts, images and videos. If you are a non-travel blogger, that’s OK! You are welcome to use The Travel Theme too.  The Travel HTML5 WordPress Themes
    Live Demo | Download
  7. Spectacular
    It’s free WordPress theme that aims to provide a warm and pleasurable atmosphere for personal musings and ramblings. The theme comes in two flavors: HTML 4.01 and HTML5. Also, both German and English versions of the theme are included in the download package. The theme is cross-browser compatible and supports Opera, Safari, Chrome, IE7+, and FF.  Spectacular HTML5 WordPress Themes
    Live Demo | Download

Premium HTML5 WordPress Themes

  1. Nitro
    Nitro is a Modular HTML5 Theme for WordPress. It’s built on a solid Grid System Framework, the modular design gives you a full control on the theme layout. Homepage, Columns, Sidebars and Widget areas are designed to make this product really flexible and easy to use. Nitro has a modular structure, which means you can customize the whole theme as you wish.  Nitro HTML5 WordPress Themes
    Download
  2. Mingle
    Mingle has been designed as an adaptable and highly intuitive WordPress theme. It includes administration features allowing you to fully control the layout and design of your website. The unique and easy to manage design ensures your site will stand out and be remembered.  The theme uses HTML5 and CSS3 to create advanced styles using the latest technologies. Proper heading tags and coding standards are used to ensure search engine optimization.
    Mingle HTML5 WordPress Themes
    Live Demo | Download
  3. SuperMassive
    SuperMassive is a powerful professional WordPress theme. The aim from the beginning was to create a great looking theme that would allow you to make your own unique and abstract layouts in minutes.  SuperMassive HTML5 WordPress Themes
    Live Demo | Download
  4. Sideways
    Sideways is a portfolio theme that offers both horizontal and grid layouts. It incorporates eye catching full screen background images that scale to fit all resolutions and window sizes as well as strong and elegant typography and design. This theme requires PHP5.  Sideways HTML5 WordPress Themes
  5. Shuffle
    Shuffle is a powerfull business/corporate & portfolio premium WordPress theme jam-packed with features. Shuffle comes with 5 custom widgets, 5 color styles, sortable portfolio and featured slider custom post types, custom contact form, sitemap template, and much more.  Shuffle HTML5 WordPress Themes
    Live Demo | Download
  6. Slide
    Slide is designed for people who want a wide WordPress template that can showcase their images and videos in an Accordion and/or Fade Slider. It comes with over 40 shortcodes that allow you to customise each page as you want in order to create a unique site to suit your needs. It also supports YouTube, Vimeo, Flash (FLV, MP4 ), MP3 and HTML5 video files in the sliders, shortcodes and lightbox.  Slide HTML5 WordPress Themes
  7. Visual
    Visual is designed for people who love a clean design and functionality. It’s built on a solid modular framework and it comes with a custom set of Widgets which allow you to build your own layout.  Visual comes with a modular structure, which means you can customize the whole theme as you wish. The homepage is really flexible, you may choose to use or remove the homepage slider, the message board, center and footer areas etc..
    Visual HTML5 WordPress Themes
    Live Demo | Download

Do you have another free and premium HTML5 WordPress themes?

if you’ve another one, please add it to the comments below. please share it with us in the comments, we’d love to hear your thoughts!