<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codrops &#187; template</title>
	<atom:link href="http://tympanus.net/codrops/tag/template/feed/" rel="self" type="application/rss+xml" />
	<link>http://tympanus.net/codrops</link>
	<description>Useful resources and inspiration for creative minds</description>
	<lastBuildDate>Thu, 23 May 2013 13:36:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Collective #33</title>
		<link>http://tympanus.net/codrops/collective/collective-33/</link>
		<comments>http://tympanus.net/codrops/collective/collective-33/#comments</comments>
		<pubDate>Sun, 14 Oct 2012 18:41:36 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[inspiration]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[psd]]></category>
		<category><![CDATA[rwd]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?post_type=collective&#038;p=11392</guid>
		<description><![CDATA[Web Platform * Inspiration * Free PSDs * Learning * JavaScript Goodness * Modern Buttons * Templates * Free Fonts * jQuery UI Theme * RWD]]></description>
				<content:encoded><![CDATA[<div class="ct-coll-item">
<article>
<h2>Web Platform</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.webplatform.org/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_01.jpg" alt="Collective33_01" title="" width="246" height="195" class="alignnone size-full wp-image-11394" /></a></p>
<p>This platform will help us all to make a better web: Adobe, Apple, Facebook, Google, HP, Microsoft, Mozilla, Nokia, Opera and the W3C are the Web Platform Stewards that united for creating an open resource for the web.</p>
<p>	   <a class="ct-coll-link" href="http://www.webplatform.org/">Check it out</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Inspirational Website of the Week</h2>
<p>	   <a class="ct-coll-thumb" href="http://ideakites.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_23.jpg" alt="Collective33_23" title="" width="330" height="159" class="alignnone size-full wp-image-11416" /></a></p>
<p>This week&#8217;s pick is Ideakites for their interesting navigation concept and clean typography.</p>
<p>	   <a class="ct-coll-link" href="http://ideakites.com/">Get inspired</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>LearnStreet</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.learnstreet.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_02.jpg" alt="Collective33_02" title="" width="282" height="115" class="alignnone size-full wp-image-11395" /></a></p>
<p>LearnStreet is an early-stage startup focused on changing the way people of all backgrounds and skill levels learn how to code. </p>
<p>	   <a class="ct-coll-link" href="http://www.learnstreet.com/">Learn something</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
		<span class="ct-small-text">Advertisement</span></p>
<div id="bsap_1275127" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div>
</article>
</div>
<div class="ct-coll-item">
<article>
<h2>Designing Better JavaScript APIs</h2>
<p>	   <a class="ct-coll-thumb" href="http://coding.smashingmagazine.com/2012/10/09/designing-javascript-apis-usability/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_03.jpg" alt="Collective33_03" title="" width="200" height="137" class="alignnone size-full wp-image-11396" /></a></p>
<p>If you are developing your own utilities and libraries and plan to make them accessible to others, read this great Smashing Magazine article by Rodney Rehm.</p>
<p>	   <a class="ct-coll-link" href="http://coding.smashingmagazine.com/2012/10/09/designing-javascript-apis-usability/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Pikaday: JavaScript Datepicker</h2>
<p>	   <a class="ct-coll-thumb" href="http://dbushell.com/2012/10/09/pikaday-javascript-datepicker/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_04.jpg" alt="Collective33_04" title="" width="280" height="207" class="alignnone size-full wp-image-11397" /></a></p>
<p>Pikaday is a light JavaScript date picker by David Bushell. Modular CSS makes it easy to customize.</p>
<p>	   <a class="ct-coll-link" href="http://dbushell.com/2012/10/09/pikaday-javascript-datepicker/">Try it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>CSS3 Microsoft Modern Buttons</h2>
<p>	   <a class="ct-coll-thumb" href="http://ace-subido.github.com/css3-microsoft-metro-buttons/index.html"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_051.jpg" alt="Collective33_05" title="" width="200" height="157" class="alignnone size-full wp-image-11418" /></a></p>
<p>A light-weight and easy-to-use CSS/JS library that uses CSS3 styles for more than just rich button design. Made by Ace Subido.</p>
<p>	   <a class="ct-coll-link" href="http://ace-subido.github.com/css3-microsoft-metro-buttons/index.html">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Sellbox: Sell your Dropbox Files</h2>
<p>	   <a class="ct-coll-thumb" href="http://sellboxhq.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_06.jpg" alt="Collective33_06" title="" width="270" height="93" class="alignnone size-full wp-image-11399" /></a></p>
<p>Sellbox let&#8217;s you sell any file you host in your Dropbox account (5% fee) in just a few seconds.</p>
<p>	   <a class="ct-coll-link" href="http://sellboxhq.com/">Check it out</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Free Responsive Website Template</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.anarieldesign.com/?portfolio=proximet-free-responsive-site-template-business-card"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_07.jpg" alt="Collective33_07" title="" width="300" height="171" class="alignnone size-full wp-image-11400" /></a></p>
<p>Proximet is a free responsive website template by Anariel Design. It comes with a free business card design.</p>
<p>	   <a class="ct-coll-link" href="http://www.anarieldesign.com/?portfolio=proximet-free-responsive-site-template-business-card">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Dark Gold UI Kit</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.pixel-fabric.com/dark-gold-ui-kit-4"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_08.jpg" alt="Collective33_08" title="" width="280" height="146" class="alignnone size-full wp-image-11401" /></a></p>
<p>The Dark Gold UI Kit by Pixel Fabric contains common web UI elements like buttons, sliders, pagination and more. The well organized and fully layered PSD allows an easy usage.</p>
<p>	   <a class="ct-coll-link" href="http://www.pixel-fabric.com/dark-gold-ui-kit-4">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Advanced Search Form for WordPress</h2>
<p>	   <a class="ct-coll-thumb" href="http://fearlessflyer.com/2012/10/how-to-create-an-advanced-search-form-for-wordpress/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_09.jpg" alt="Collective33_09" title="" width="200" height="141" class="alignnone size-full wp-image-11402" /></a></p>
<p>Learn how to create an advanced search form in WordPress from this tutorial by Fearlessflyer.</p>
<p>	   <a class="ct-coll-link" href="http://fearlessflyer.com/2012/10/how-to-create-an-advanced-search-form-for-wordpress/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Responsive Web Design Makes It Hard To Be Fast</h2>
<p>An interesting article by Guy Podjarny on the complexity and difficulty that comes with responsive websites. Some insightful points follow in the comments.</p>
<p>	   <a class="ct-coll-link" href="http://www.guypo.com/technical/responsive-web-design-is-bad-for-performance-there-i-said-it/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Selfstarter: Build Your Own Crowdfunding Site</h2>
<p>	   <a class="ct-coll-thumb" href="http://selfstarter.us/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_10.jpg" alt="Collective33_10" title="" width="280" height="98" class="alignnone size-full wp-image-11403" /></a></p>
<p>Selfstarter is an open source starting point for building your own ad-hoc crowdfunding site made by Lockitron.</p>
<p>	   <a class="ct-coll-link" href="http://selfstarter.us/">Check it out</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Free Font: Sanchez Condensed (Regular &amp; Italic)</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.myfonts.com/fonts/latinotype/sanchez-condensed/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_11.jpg" alt="Collective33_11" title="" width="280" height="140" class="alignnone size-full wp-image-11404" /></a></p>
<p>Sánchez, designed by Daniel Hernández, is a serif typeface belonging to the classification slab serif. The regular and italic variants are for free.</p>
<p>	   <a class="ct-coll-link" href="http://www.myfonts.com/fonts/latinotype/sanchez-condensed/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>FontDropper 1000</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.webink.com/fontdropper"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_12.jpg" alt="Collective33_12" title="" width="270" height="152" class="alignnone size-full wp-image-11405" /></a></p>
<p>FontDropper 1000 is a bookmarklet that let&#8217;s you easily test or design with web fonts from WebINK.</p>
<p>	   <a class="ct-coll-link" href="http://www.webink.com/fontdropper">Check it out</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Toggle Switches (PSD)</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.graphicsfuel.com/2012/10/toggle-switches-ui-elements-psd/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_13.jpg" alt="Collective33_13" title="" width="290" height="182" class="alignnone size-full wp-image-11406" /></a></p>
<p>Some pixel-perfect and colorful toggle switches from GraphicsFuel for your next interface design.</p>
<p>	   <a class="ct-coll-link" href="http://www.graphicsfuel.com/2012/10/toggle-switches-ui-elements-psd/">Get them</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Web Developer Economics: Monthly Service Costs</h2>
<p>	   <a class="ct-coll-thumb" href="http://css-tricks.com/web-developer-economics-monthly-service-costs/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_14.jpg" alt="Collective33_14" title="" width="250" height="135" class="alignnone size-full wp-image-11407" /></a></p>
<p>Chris Coyer compiled a very insightful list of services for web developers and freelancers that he uses and their associated costs. As usual, with some great additional info in the comments.</p>
<p>	   <a class="ct-coll-link" href="http://css-tricks.com/web-developer-economics-monthly-service-costs/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Delta jQuery UI Theme</h2>
<p>	   <a class="ct-coll-thumb" href="http://blog.kiandra.com.au/2012/09/delta-a-free-jquery-ui-theme/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_151.jpg" alt="Collective33_15" title="" width="200" height="117" class="alignnone size-full wp-image-11417" /></a></p>
<p>Kiandra offers this nice jQuery UI theme (dark &amp; light) for free. If you have every tried to create a custom jQuery UI theme, you will appreciate this a lot!</p>
<p>	   <a class="ct-coll-link" href="http://blog.kiandra.com.au/2012/09/delta-a-free-jquery-ui-theme/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Manymo Android Emulators</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.manymo.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_16.jpg" alt="Collective33_16" title="" width="280" height="175" class="alignnone size-full wp-image-11409" /></a></p>
<p>If you are developing for Android, you&#8217;ll definitely want to give the emulators of Manymo a try.</p>
<p>	   <a class="ct-coll-link" href="http://www.manymo.com/">Try it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Free T-Shirt Mockup (PSD)</h2>
<p>	   <a class="ct-coll-thumb" href="http://wegraphics.net/downloads/free-t-shirt-mockup-psd-files/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_17.jpg" alt="Collective33_17" title="" width="250" height="209" class="alignnone size-full wp-image-11410" /></a></p>
<p>An easy-to-edit T-Shirt mockup PSD by WeGraphics.</p>
<p>	   <a class="ct-coll-link" href="http://wegraphics.net/downloads/free-t-shirt-mockup-psd-files/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Free Font: Slinkster</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.myfonts.com/fonts/will-ryan/slinkster/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_18.jpg" alt="Collective33_18" title="" width="230" height="115" class="alignnone size-full wp-image-11411" /></a></p>
<p>Need an impactful font for large display? Slinkster by Will Ryan is an intricately unique display fontface created by carefully overlapping equally-sized circles.</p>
<p>	   <a class="ct-coll-link" href="http://www.myfonts.com/fonts/will-ryan/slinkster/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Free iOS 6 Vector GUI (PSD)</h2>
<p>	   <a class="ct-coll-thumb" href="http://dribbble.com/shots/761351-IOS-6-GUI-Itunes-App-Store"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_19.jpg" alt="Collective33_19" title="" width="250" height="186" class="alignnone size-full wp-image-11412" /></a></p>
<p>A superb PSD resource by Christophe Béghin: a full vector GUI based on iOS 6, iTunes &amp; App Store. </p>
<p>	   <a class="ct-coll-link" href="http://dribbble.com/shots/761351-IOS-6-GUI-Itunes-App-Store">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>AppView: iPhone App UI Theme</h2>
<p>	   <a class="ct-coll-thumb" href="http://medialoot.com/item/free-iphone-app-template-appview/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_20.jpg" alt="Collective33_20" title="" width="260" height="145" class="alignnone size-full wp-image-11413" /></a></p>
<p>AppView is a beautiful iPhone app UI template as vector-based, layered and fully organised PSD file.</p>
<p>	   <a class="ct-coll-link" href="http://medialoot.com/item/free-iphone-app-template-appview/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Red Dwarf</h2>
<p>	   <a class="ct-coll-thumb" href="http://jrvis.com/red-dwarf/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_21.jpg" alt="Collective33_21" title="" width="220" height="98" class="alignnone size-full wp-image-11414" /></a></p>
<p>Red Dwarf, by Rick Viscomi, beautifully visualizes the global positions of any given GitHub repository&#8217;s stargazers (people who &#8220;star&#8221; the project). </p>
<p>	   <a class="ct-coll-link" href="http://jrvis.com/red-dwarf/">Check it out</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Cacoo: Create Diagrams and Collaborate</h2>
<p>	   <a class="ct-coll-thumb" href="https://cacoo.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/10/Collective33_22.jpg" alt="Collective33_22" title="" width="230" height="129" class="alignnone size-full wp-image-11415" /></a></p>
<p>Cacoo is a free online drawing tool that allows you to create a variety of diagrams such as site maps, wire frames, UML and network charts. </p>
<p>	   <a class="ct-coll-link" href="https://cacoo.com/">Check it out</a><br />
   </article>
</div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/collective/collective-33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D Restaurant Menu Concept</title>
		<link>http://tympanus.net/codrops/2012/09/25/3d-restaurant-menu-concept/</link>
		<comments>http://tympanus.net/codrops/2012/09/25/3d-restaurant-menu-concept/#comments</comments>
		<pubDate>Tue, 25 Sep 2012 14:22:59 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[restaurant]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=11029</guid>
		<description><![CDATA[A responsive 3D menu concept for a restaurant website. The idea is to show the menu as a folded flyer and unfold it in order to show the menu items. ]]></description>
				<content:encoded><![CDATA[<p><a href="http://tympanus.net/Tutorials/3DRestaurantMenu/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/09/3D-Restaurant-Menu-Concept.jpg" alt="3D Restaurant Menu Concept" title="3D Restaurant Menu Concept" width="580" height="315" class="alignnone size-full wp-image-11040" /></a></p>
<p><a class="demo" href="http://tympanus.net/Tutorials/3DRestaurantMenu/">View demo</a> <a class="download" href="http://tympanus.net/Tutorials/3DRestaurantMenu/3DRestaurantMenu.zip">Download source</a></p>
<p>Applying CSS 3D transforms to components can bring some more realism to normally flat web elements. We&#8217;ve experimented with some simple concepts for restaurant websites and came up with a 3D folded menu (a real menu, not a &#8220;web&#8221; menu). The result is a restaurant website template where the menu will open by unfolding. Clicking the linked items will reveal a modal overlay which contains some more info. </p>
<p>Since this &#8220;flyer&#8221; structure requires a decent amount of space, and, although we will make this responsive, we&#8217;ll add a media query for smaller screens where everything will fall back to a simplified stacked structure. The same will be applied for browsers that don&#8217;t support 3D transforms. </p>
<p>The thumbnails and delicious recipes are by Michael Natkin from <a href="http://herbivoracious.com/">herbivoracious.com</a> (all the ones that have a link). </p>
<div class="ct-special-box"><strong>Please note: this only works as intended in browsers that support the respective CSS properties.</strong></div>
<p><strong>Alright, so let&#8217;s get started! </strong></p>
<p><em>The CSS will not contain any vendor prefixes, but you will find them in the files.</em></p>
<h3>The Markup</h3>
<p>Our structure will consist of a main container with the class &#8220;rm-container&#8221; and we&#8217;ll have a wrapper inside. The wrapper will contain the three panels. Initially, we only want to see the cover of the folded menu; that is the division with the class &#8220;rm-cover&#8221;. The last panel is the one with the class &#8220;rm-right&#8221;. The middle panel is the one we see in the middle when we open the menu:</p>
<pre class="brush:html">
&lt;div id="rm-container" class="rm-container"&gt;

	&lt;div class="rm-wrapper"&gt;
		&lt;div class="rm-cover"&gt;&lt;/div&gt;
		&lt;div class="rm-middle"&gt;&lt;/div&gt;
		&lt;div class="rm-right"&gt;&lt;/div&gt;
	&lt;/div&gt;&lt;!-- /rm-wrapper --&gt;

&lt;/div&gt;&lt;!-- /rm-container --&gt;
</pre>
<p>Inside of the rm-cover and the rm-right division, we will have a front- and a backface:</p>
<pre class="brush:html">
&lt;div class="rm-front"&gt;

	&lt;div class="rm-content"&gt;
		&lt;!-- Some content --&gt;
	&lt;/div&gt;&lt;!-- /rm-content --&gt;
	
&lt;/div&gt;&lt;!-- /rm-front --&gt;

&lt;div class="rm-back"&gt;

	&lt;div class="rm-content"&gt;
		&lt;!-- Some content --&gt;
	&lt;/div&gt;&lt;!-- /rm-content --&gt;

	&lt;div class="rm-overlay"&gt;&lt;/div&gt;

&lt;/div&gt;&lt;!-- /rm-back --&gt;
</pre>
<p>We&#8217;ll also add an element for an overlay gradient that will give the menu parts a bit more realism. Note that the front will be empty in the last element.</p>
<p>The middle part of the menu will simply have another wrapper inside, no front or back part:</p>
<pre class="brush:html">
&lt;div class="rm-inner"&gt;

	&lt;div class="rm-content"&gt;
		&lt;!-- Some content --&gt;
	&lt;/div&gt;&lt;!-- /rm-content --&gt;

	&lt;div class="rm-overlay"&gt;&lt;/div&gt;

&lt;/div&gt;&lt;!-- /rm-inner --&gt;
</pre>
<p>We will never see the back part of this part of the menu, so we won&#8217;t need that structure.</p>
<p>The content will consist of some text elements, like definition lists for the dishes and headlines:</p>
<pre class="brush:html">
&lt;div class="rm-content"&gt;

	&lt;h4&gt;Appetizers&lt;/h4&gt;

	&lt;dl&gt;
		&lt;dt&gt;Bella's Artichokes&lt;/dt&gt;
		&lt;dd&gt;Roasted artichokes with chipotle aioli and cream cheese&lt;/dd&gt;

		&lt;dt&gt;&lt;a href="http://herbivoracious.com/2011/11/crostini-with-young-pecorino-grilled-figs-and-arugula-mint-pesto-recipe.html" class="rm-viewdetails" data-thumb="images/1.jpg"&gt;Green Love Crostini&lt;/a&gt;&lt;/dt&gt;
		&lt;dd&gt;Crostini with young pecorino, grilled figs and arugula &amp; mint pesto&lt;/dd&gt;
		
		&lt;dt&gt;Focaccia di Carciofi&lt;/dt&gt;
		&lt;dd&gt;Artichoke focaccia with fresh thyme&lt;/dd&gt;

		&lt;!-- ... --&gt;
	&lt;/dl&gt;

	&lt;h4&gt;Salads &amp; More&lt;/h4&gt;
	
	&lt;dl&gt;
		&lt;!-- ... --&gt;
	&lt;/dl&gt;

&lt;/div&gt;&lt;!-- /rm-content --&gt;
</pre>
<p>Notice the anchor with the class &#8220;rm-viewdetails&#8221; and the data attribute &#8220;data-thumb&#8221;. We will use this as the content for a modal overlay box that will appear when clicking on the link:</p>
<pre class="brush:html">
&lt;div class="rm-modal"&gt;
	&lt;div style="background-image: url(images/1.jpg)" class="rm-thumb"&gt;&lt;/div&gt;
	&lt;h5&gt;Green Love Crostini&lt;/h5&gt;
	&lt;p&gt;Crostini with young pecorino, grilled figs and arugula &amp; mint pesto&lt;/p&gt;
	&lt;a href="http://herbivoracious.com/2011/11/crostini-with-young-pecorino-grilled-figs-and-arugula-mint-pesto-recipe.html"&gt;See the recipe&lt;/a&gt;
	&lt;span class="rm-close-modal"&gt;x&lt;/span&gt;
&lt;/div&gt;
</pre>
<p>It will contain the same headline and description that we get from the followed dd element (definition description), the thumbnail that we get from the data-attribute and the link.</p>
<p>And that&#8217;s the HTML, now, let&#8217;s take a look at the style.</p>
<p><em>Note that we won&#8217;t go into the styling of the text elements or inner content parts. Instead we will focus on the 3D structure, transition classes and media queries.</em></p>
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div>
<h3>The CSS</h3>
<p>We want to make the whole thing fluid, so we will give the main container a percentage width, and, since we want some 3D awesomeness, some perspective:</p>
<pre class="brush:css">
.rm-container {
	width: 33%;
	height: 700px;
	max-width: 370px;
	margin: 0 auto 40px auto;
	position: relative;
	perspective: 1600px;
	color: #2a323f;
}
</pre>
<p>The wrapper and its children divisions (the cover, middle part and right part) will all have the full width and height and we&#8217;ll position them absolutely:</p>
<pre class="brush:css">
.rm-wrapper,
.rm-wrapper > div {
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	position: absolute;
	text-align: center;
	transform-style: preserve-3d;
}
</pre>
<p>Since we will be working in 3D perspective, we want the transform style of these elements to be &#8220;preserve-3d&#8221;.</p>
<p>The cover needs a higher z-index than all the other parts and we&#8217;ll set the transform origin to be on the left edge (left center). The transition delay is for when we <em>close</em> the menu. The transition to the open state will contain another value, but let&#8217;s look at that a bit later:</p>
<pre class="brush:css">
.rm-wrapper .rm-cover {
	z-index: 100;
	transform-origin: 0% 50%;
	transition-delay: 0.2s;
}
</pre>
<p>The middle part will have the lowest z-index of all three parts and we&#8217;ll add a subtle box shadow:</p>
<pre class="brush:css">
.rm-wrapper .rm-middle {
	z-index: 50;
	box-shadow: 0 4px 10px rgba(0,0,0,0.7);
}
</pre>
<p>The right most part will have a z-index that is higher than the middle part one but lower than the cover one. The transform origin will be on the right edge (right center) and there will be no transition delay when we <em>close</em> the menu:</p>
<pre class="brush:css">
.rm-wrapper .rm-right {
	z-index: 60;
	transform-origin: 100% 50%;
	transition-delay: 0s;
}
</pre>
<p>The inner divisions which are the ones with the classes &#8220;rm-front&#8221;, &#8220;rm-back&#8221; and &#8220;rm-inner&#8221; will have a paper texture as background and we&#8217;ll add a inset box shadow that will simulate a multi-line decorative border:</p>
<pre class="brush:css">
.rm-wrapper > div > div {
	background: #fff url(../images/white_paperboard.jpg);
	width: 100%;
	height: 100%;
	position: absolute;
	padding: 30px;
	box-shadow: 
		inset 0 0 0 16px #fff, 
		inset 0 0 0 17px #e6b741, 
		inset 0 0 0 18px #fff, 
		inset 0 0 0 19px #e6b741, 
		inset 0 0 0 20px #fff, 
		inset 0 0 0 21px #e6b741;
}
</pre>
<p>Now, let&#8217;s add the important 3D properties. The front and the back face need backface-visibility set to hidden:</p>
<pre class="brush:css">
.rm-container .rm-front,
.rm-container .rm-back {
	backface-visibility: hidden;
}
</pre>
<p>Let&#8217;s rotate the backfaces so that they are behind the front parts:</p>
<pre class="brush:css">
.rm-container .rm-back {
	transform: rotateY(-180deg);
}
</pre>
<p>The overlay will generally be an almost transparent gradient from light to a bit darker:</p>
<pre class="brush:css">
.rm-overlay {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	pointer-events: none;
	background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.05) 100%);
}
</pre>
<p>For the middle overlay we will turn the gradient to the other side:</p>
<pre class="brush:css">
.rm-middle .rm-overlay {
	background: linear-gradient(to right, rgba(0,0,0,0) 64%, rgba(0,0,0,0.05) 100%);
}
</pre>
<p>Let&#8217;s add some padding the the content divisions:</p>
<pre class="brush:css">
.rm-content {
	padding: 20px;
}
</pre>
<p>The modal layer will be invisible: we&#8217;ll set the opacity to 0, the pointer-event to none and we&#8217;ll translate it on the Z-axis:</p>
<pre class="brush:css">
.rm-modal {
	position: absolute;
	z-index: 10000;
	width: 120%;
	margin-left: -10%;
	top: 50%;
	padding: 40px;
	background: #fff url(../images/white_paperboard.jpg);
	box-shadow: 
		inset 0 0 0 16px #fff, 
		inset 0 0 0 17px #e6b741, 
		inset 0 0 0 18px #fff, 
		inset 0 0 0 19px #e6b741, 
		inset 0 0 0 20px #fff, 
		inset 0 0 0 21px #e6b741,
		0 4px 20px rgba(0,0,0,0.4);
	opacity: 0;
	pointer-events: none;
	transform: translateZ(1000px);
}
</pre>
<p>The idea is to reveal the modal when we click on one of the links on the menu. We&#8217;ll scale the menu down and make the modal appear from &#8220;above&#8221;. This concept is inspired by Hakim El Hattab&#8217;s modal concept <a href="http://lab.hakim.se/avgrund/">Avgrund</a>.</p>
<p>Let&#8217;s add some transitions and define some classes for opening the menu.</p>
<p>First, we&#8217;ll give a transition to the wrapper (for scaling it when opening the modal) and to the children of the wrapper, i.e. our three menu parts (for animating the &#8220;opening&#8221;/rotation):</p>
<prec class="brush:css">

.rm-wrapper,
.rm-wrapper > div {
	transition: all 0.6s ease-in-out;
}
</pre>
<p>The modal will also have a transition for the transformation (to scale down) and its opacity:</p>
<pre class="brush:css">
.rm-modal {
	transition: 
		transform 0.6s ease-in-out,
		opacity 0.6s ease-in-out;
}
</pre>
<p>The idea is to add a class called "rm-open" which will trigger the menu to unfold. This class will be added with JavaScript when we click on the "View the menu" link. </p>
<p>When adding the class, we will define what will happen to all the elements when we open the menu.</p>
<p>The children of the wrapper will all get a box shadow:</p>
<pre class="brush:css">
.rm-container.rm-open .rm-wrapper > div {
	box-shadow: 0 4px 5px -3px rgba(0,0,0,0.6);
}
</pre>
<p>The cover will rotate (without any delay) -180 degrees on the Y-axis. Since we defined the transform origin to be on the left center, it will open to the left:</p>
<pre class="brush:css">
.rm-container.rm-open .rm-cover {
	transform: rotateY(-180deg);
	transition-delay: 0s;
}
</pre>
<p>The right part will rotate 180 degrees, but here we will add a transition delay of 0.2s because we want the cover to open a bit first:</p>
<pre class="brush:css">
.rm-container.rm-open .rm-right {
	transform: rotateY(180deg);
	transition-delay: 0.2s;
}
</pre>
<p>When we click on one of the menu item that is an anchor, we will add another class called "rm-in" to the container and move the wrapper down on the Z-axis:</p>
<pre class="brush:css">

.rm-container.rm-in .rm-wrapper {
	transform: translateZ(-500px);
}
</pre>
<p>The cover and the right part will be rotated a bit more to the inside:</p>
<pre class="brush:css">
.rm-container.rm-in .rm-cover {
	transform: rotateY(-150deg);
}

.rm-container.rm-in .rm-right {
	transform: rotateY(150deg);
}
</pre>
<p>We need to set the transition delay to 0 seconds for this case:</p>
<pre class="brush:css">
.rm-container.rm-in .rm-cover, 
.rm-container.rm-in .rm-right,
.rm-container.rm-nodelay .rm-right {
	transition-delay: 0s;
}
</pre>
<p>The class "rm-nodelay" is an extra class that we'll need for the right menu part when we close the modal. Remember, it had a transition delay for when we open the menu.</p>
<p>The modal will appear by translating it to 0px on the Z-axis and increasing the opacity to 1:</p>
<pre class="brush:css">
.rm-container.rm-in .rm-modal {
	transform: translateZ(0px);
	opacity: 1;
	pointer-events: auto;
}
</pre>
<p>Let's define some media queries for smaller screens and devices. The first media query will simply resize the wrapper:</p>
<pre class="brush:css">
@media screen and (max-width: 1110px) {
	.rm-container {
		height: 800px;
	}
}
</pre>
<p>Since we made the wrapper fluid, it will need a larger height in order to contain the text.</p>
<p>From 960 pixels on, we no longer want to show the menu as a folded flyer but as normal, scrollable content.<br />
For that, we'll simply set the height of the wrapper to auto, give it 100% of width and define a maximum width:</p>
<pre class="brush:css">
@media screen and (max-width: 960px) {

	.rm-container {
		width: 100%;
		height: auto;
		max-width: 460px;
	}

</pre>
<p>All the inner divisions will no longer be absolute, but relative and we'll give them 100% of width and set the height to auto:</p>
<pre class="brush:css">

	.rm-wrapper, 
	.rm-wrapper > div,
	.rm-wrapper > div > div {
		position: relative;
		width: 100%;
		height: auto;
	}

</pre>
<p>The content divisions will need some margin:</p>
<pre class="brush:css">
	.rm-wrapper > div > div{
		margin-bottom: 10px;
		box-shadow: 
			inset 0 0 0 16px #fff, 
			inset 0 0 0 17px #e6b741, 
			inset 0 0 0 18px #fff, 
			inset 0 0 0 19px #e6b741, 
			inset 0 0 0 20px #fff, 
			inset 0 0 0 21px #e6b741,
			0 3px 5px rgba(0,0,0,0.2);
	}
</pre>
<p>Let's remove the rotations:</p>
<pre class="brush:css">
	.rm-container .rm-back,
	.rm-container.rm-open .rm-cover,
	.rm-container.rm-open .rm-right {
		transform: rotateY(0deg);
	}
</pre>
<p>We don't need the overlays any more:</p>
<pre class="brush:css">
	.rm-overlay, .rm-middle .rm-overlay {
		display: none;
	}
</pre>
<p>And we set the position of the modal to fixed, so that it sticks on top when we scroll:</p>
<pre class="brush:css">
	.rm-container .rm-modal {
		position: fixed;
		width: 80%;
		top: 100px;
		left: 50%;
		margin: 0 0 0 -40%;
		transform: translateZ(0px);
		transition: opacity 0.6s ease-in-out 0s;
	}
</pre>
<p>When we click on a menu item link and the modal appears we won't rotate anything any more:</p>
<pre class="brush:css">
	.rm-container.rm-in .rm-cover,
	.rm-container.rm-in .rm-right,
	.rm-container.rm-in .rm-wrapper {
		transform: rotateY(0deg);
		transition-delay: 0s;
	}
}
</pre>
<p>And that's all the important style. For browsers that don't support 3D transforms, we will use almost the same styling like we do for this last media query. Since we use <a href="http://modernizr.com/">Modernizr</a>, we'll just add those classes again, preceded by <strong>.no-csstransforms3d</strong> (which will be added to the body).</p>
<p>Now, let's add some lines of JavaScript.</p>
<h3>The JavaScript</h3>
<p>We will start by caching some elements:</p>
<pre class="brush:js">
	// main container
var $container = $( '#rm-container' ),						
	// the cover, middle and right panels
	$cover = $container.find( 'div.rm-cover' ),
	$middle = $container.find( 'div.rm-middle' ),
	$right = $container.find( 'div.rm-right' ),
	// open and close elements
	$open = $cover.find('a.rm-button-open'),
	$close = $right.find('span.rm-close'),
	// the links for each recipe (photo and details)
	$details = $container.find( 'a.rm-viewdetails' ),
</pre>
<p>The events for opening/closing the menu and also for showing each item's details (modal) are initialized:</p>
<pre class="brush:js">
init = function() {

		initEvents();

	},
initEvents = function() {

	$open.on( 'click', function( event ) {

		openMenu();
		return false;

	} );

	$close.on( 'click', function( event ) {

		closeMenu();
		return false;

	} );

	$details.on( 'click', function( event ) {

		$container.removeClass( 'rm-in' ).children( 'div.rm-modal' ).remove();
		viewDetails( $( this ) );
		return false;

	} );
	
},
</pre>
<p>To open/close the menu we will be adding/removing the class 'rm-open' from the $container. Remember, this is the class where the transitions are defined.</p>
<p>Note that on close, we are also removing the classes 'rm-nodelay' and 'rm-in'. These are classes that are added if we click to see the menu item's details.</p>
<pre class="brush:js">
openMenu = function() {

	$container.addClass( 'rm-open' );

},
closeMenu = function() {

	$container.removeClass( 'rm-open rm-nodelay rm-in' );

},
</pre>
<p>Finally, if we click to see an item's details, a modal box will be shown with the image and the text for that item. We translate the main container on the Z-axis (and adjust the top margin in order to center it), and slightly rotate the left and right panels:</p>
<pre class="brush:js">
viewDetails = function( recipe ) {

	var title = recipe.text(),
		img = recipe.data( 'thumb' ),
		description = recipe.parent().next().text(),
		url = recipe.attr( 'href' );

	var $modal = $( '<div class="rm-modal"><div class="rm-thumb" style="background-image: url(' + img + ')"></div><h5>' + title + '</h5><p>' + description + '</p><a href="' + url + '">See the recipe</a><span class="rm-close-modal">x</span></div>' );

	$modal.appendTo( $container );

	var h = $modal.outerHeight( true );
	$modal.css( 'margin-top', -h / 2 );

	setTimeout( function() {

		$container.addClass( 'rm-in rm-nodelay' );

		$modal.find( 'span.rm-close-modal' ).on( 'click', function() {

			$container.removeClass( 'rm-in' );

		} );
	
	}, 0 );

};
</pre>
<p>And that's it! I hope you enjoyed this tutorial and find it useful! </p>
<div class="ct-github-link">
<a href=" https://github.com/codrops/3DRestaurantMenu">Find this project on Github</a>
</div>
<p><a class="demo" href="http://tympanus.net/Tutorials/3DRestaurantMenu/">View demo</a> <a class="download" href="http://tympanus.net/Tutorials/3DRestaurantMenu/3DRestaurantMenu.zip">Download source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2012/09/25/3d-restaurant-menu-concept/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Collective #11</title>
		<link>http://tympanus.net/codrops/collective/collective-11/</link>
		<comments>http://tympanus.net/codrops/collective/collective-11/#comments</comments>
		<pubDate>Sun, 13 May 2012 15:43:26 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?post_type=collective&#038;p=9008</guid>
		<description><![CDATA[CSS Selectors demystified * Vendor Tokens? * Free Fonts * Social Media Icons * Flyer Template * jQuery Vector Maps]]></description>
				<content:encoded><![CDATA[<div class="ct-coll-item">
<article>
<h2>Interactive CSS Selectors</h2>
<p>	   <a class="ct-coll-thumb" href="http://twostepmedia.co.uk/cssselectors/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_14.jpg" alt="Collective11_14" title="" width="280" height="149" class="alignnone size-full wp-image-9022" /></a></p>
<p>Ben Howdle from Two Step Media will help you understand CSS Selectors in an interactive way. Choose a selector on the left and you&#8217;ll instantly see the affected elements on the right.</p>
<p>	   <a class="ct-coll-link" href="http://twostepmedia.co.uk/cssselectors/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>‘Vendor Tokens’ Offer Another Way Out of the CSS Prefix Mess</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.webmonkey.com/2012/05/vendor-tokens-offer-another-way-out-of-the-css-prefix-mess/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_06.jpg" alt="Collective11_06" title="" width="300" height="68" class="alignnone size-full wp-image-9014" /></a></p>
<p>There is a big discussion going on about whether vendor prefixes are harmful of helpful. Despire their original purpose they are being used all over and many issues are arising from that. Scott Gilbertson from Webmonkey explains Eric Meyer&#8217;s new proposal for ending the mess.</p>
<p>	   <a class="ct-coll-link" href="http://www.webmonkey.com/2012/05/vendor-tokens-offer-another-way-out-of-the-css-prefix-mess/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Inspirational Website of the Week</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.purepleasuredesign.com"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_12.jpg" alt="Collective11_12" title="" width="330" height="179" class="alignnone size-full wp-image-9020" /></a></p>
<p>Ines Maria Gamler&#8217;s website purepleasuredesign.com has a beautiful mixture of interesting typographic elements, shapes, color and textures.</p>
<p>	   <a class="ct-coll-link" href="http://www.purepleasuredesign.com">Check it out</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Znikomit Free Font</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.glukfonts.pl/font.php?font=Znikomit"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_18.jpg" alt="Collective11_18" title="" width="300" height="150" class="alignnone size-full wp-image-9026" /></a></p>
<p>A really beautiful and elegant free font with many Open­Type features by Grzegorz Luk.</p>
<p>	   <a class="ct-coll-link" href="http://www.glukfonts.pl/font.php?font=Znikomit">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>JQV Map: jQuery Vector Maps</h2>
<p>	   <a class="ct-coll-thumb" href="http://jqvmap.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_15.jpg" alt="Collective11_15" title="" width="300" height="199" class="alignnone size-full wp-image-9023" /></a></p>
<p>JQVMap is a really cool jQuery plugin that renders Vector Maps using Scalable Vector Graphics (SVG) for modern browsers. Via VML it provides legacy support for older browsers.</p>
<p>	   <a class="ct-coll-link" href="http://jqvmap.com/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
		<span class="ct-small-text">Advertisement</span></p>
<div id="bsap_1275127" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div>
</article>
</div>
<div class="ct-coll-item">
<article>
<h2>Fixed Table of Contents Drop-Down Menu </h2>
<p>	   <a class="ct-coll-thumb" href="http://www.impressivewebs.com/fixed-table-of-contents-drop-down-menu-jquery-plugin/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_09.jpg" alt="Collective11_09" title="" width="230" height="163" class="alignnone size-full wp-image-9017" /></a></p>
<p>Louis Lazaris from Impressive Webs is sharing this useful fixed drop-down menu with a table of contents. It is a jQuery plugin and it comes in really handy for making it easy to navigate a page that has a lot of content.</p>
<p>	   <a class="ct-coll-link" href="http://www.impressivewebs.com/fixed-table-of-contents-drop-down-menu-jquery-plugin/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Fixie.js</h2>
<p>	   <a class="ct-coll-thumb" href="http://fixiejs.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_10.jpg" alt="Collective11_10" title="" width="300" height="96" class="alignnone size-full wp-image-9018" /></a></p>
<p>If you design and develop websites, you know how laborsome it can be to add placeholder text. Fixie.js will help you. It is an open source tool that automatically adds filler content to HTML documents.</p>
<p>	   <a class="ct-coll-link" href="http://fixiejs.com/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>HTML5 Audio — The State of Play</h2>
<p>In this follow-up article about HTML5 audio, Mark Boas explains how the &lt;audio&gt; element and the associated API developed further and what can be done with it.</p>
<p>	   <a class="ct-coll-link" href="http://html5doctor.com/html5-audio-the-state-of-play/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Curtain.js</h2>
<p>	   <a class="ct-coll-thumb" href="http://curtain.victorcoulon.fr"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_03.jpg" alt="Collective11_03" title="" width="200" height="104" class="alignnone size-full wp-image-9011" /></a></p>
<p>This plugin allows you to create a web page with multiple fixed panels that unroll with an amusing effect. Exactly like a curtain rises. </p>
<p>	   <a class="ct-coll-link" href="http://curtain.victorcoulon.fr">Try it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Freebies Gallery</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.freebiesgallery.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_19.jpg" alt="Collective11_19" title="" width="260" height="221" class="alignnone size-full wp-image-9027" /></a></p>
<p>Freebies Gallery is a really useful site where you can download free design resources like PSDs, vector graphics, icons, templates and many more. </p>
<p>	   <a class="ct-coll-link" href="http://www.freebiesgallery.com/">Check it out</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Say No to Faux Bold</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.alistapart.com/articles/say-no-to-faux-bold/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_04.jpg" alt="Collective11_04" title="" width="200" height="48" class="alignnone size-full wp-image-9012" /></a></p>
<p>Alan Stearns explains in this &#8220;A List Apart&#8221; article what &#8220;fake&#8221; bold is and how to avoid using it in your website.</p>
<p>	   <a class="ct-coll-link" href="http://www.alistapart.com/articles/say-no-to-faux-bold/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Expert subsets for CSS in 123</h2>
<p>	   <a class="ct-coll-thumb" href="http://elliotjaystocks.com/blog/expert-subsets-for-css-in-123/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_05.jpg" alt="Collective11_05" title="" width="280" height="105" class="alignnone size-full wp-image-9013" /></a></p>
<p>The future of typography on the web is an exciting one and Elliot Jay Stocks will show you what beautiful things you can do. After his first article about <a href="http://elliotjaystocks.com/blog/the-fine-flourish-of-the-ligature/">ligatures</a> he digs deeper into the new  <em>font-variant</em> property.</p>
<p>	   <a class="ct-coll-link" href="http://elliotjaystocks.com/blog/expert-subsets-for-css-in-123/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Faye: Simple pub/sub messaging for the web</h2>
<p>	   <a class="ct-coll-thumb" href="http://faye.jcoglan.com/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_07.jpg" alt="Collective11_07" title="" width="260" height="108" class="alignnone size-full wp-image-9015" /></a></p>
<p>If you are searching for a publish-subscribe messaging system for Node.js or Ruby, this just might be a great solution for you.</p>
<p>	   <a class="ct-coll-link" href="http://faye.jcoglan.com/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>How To Build A Real-Time Commenting System</h2>
<p>	   <a class="ct-coll-thumb" href="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_08.jpg" alt="Collective11_08" title="" width="140" height="141" class="alignnone size-full wp-image-9016" /></a></p>
<p>Phil Leggetter will show you how to &#8220;convert a basic blog commenting system into a real-time engaging experience where you’ll see a comment made in one browser window &#8220;magically&#8221; appear in a second window&#8221;.</p>
<p>	   <a class="ct-coll-link" href="http://coding.smashingmagazine.com/2012/05/09/building-real-time-commenting-system/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Which responsive images solution should you use?</h2>
<p>	   <a class="ct-coll-thumb" href="http://css-tricks.com/which-responsive-images-solution-should-you-use/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_11.jpg" alt="Collective11_11" title="" width="140" height="45" class="alignnone size-full wp-image-9019" /></a></p>
<p>There are many techniques out there to help you with the &#8220;responsive image issue&#8221;. Chris Coyier put together this great guide that will help you choose the right technique for your needs.</p>
<p>	   <a class="ct-coll-link" href="http://css-tricks.com/which-responsive-images-solution-should-you-use/">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Statik: A Free Bold Style Font Kit</h2>
<p>	   <a class="ct-coll-thumb" href="http://wegraphics.net/downloads/statik-a-free-bold-style-font-kit/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_13.jpg" alt="Collective11_13" title="" width="300" height="173" class="alignnone size-full wp-image-9021" /></a></p>
<p>WeGraphics offers a great free font: Statik is a bold font face with a hint of static via radio transmission.</p>
<p>	   <a class="ct-coll-link" href="http://wegraphics.net/downloads/statik-a-free-bold-style-font-kit/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>JavaScript Canvas Image Conversion</h2>
<p>	   <a class="ct-coll-thumb" href="http://davidwalsh.name/convert-canvas-image"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_16.jpg" alt="Collective11_16" title="" width="170" height="170" class="alignnone size-full wp-image-9024" /></a></p>
<p>David Walsh explains how to convert an image to canvas and vice versa using a couple of lines of JavaScript. </p>
<p>	   <a class="ct-coll-link" href="http://davidwalsh.name/convert-canvas-image">Read it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Free Event Flyer Template (PSD)</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.behance.net/gallery/Free-Event-Flyer-Template-(PSD)/3809615"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_17.jpg" alt="Collective11_17" title="" width="290" height="161" class="alignnone size-full wp-image-9025" /></a></p>
<p>Sam Ridgway gives us a free event flyer template that is print ready, with bleeds and which comes with easy to edit layers.</p>
<p>	   <a class="ct-coll-link" href="http://www.behance.net/gallery/Free-Event-Flyer-Template-(PSD)/3809615">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>41 Social Media Icons (PNG)</h2>
<p>	   <a class="ct-coll-thumb" href="http://www.premiumpixels.com/freebies/41-social-media-icons-png/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_01.jpg" alt="Collective11_01" title="" width="300" height="135" class="alignnone size-full wp-image-9009" /></a></p>
<p>Premiumpixels offers us an amazing set of 41 social networking icons in both 16px and 32px by Prekesh Chavda.</p>
<p>	   <a class="ct-coll-link" href="http://www.premiumpixels.com/freebies/41-social-media-icons-png/">Get it</a><br />
   </article>
</div>
<div class="ct-coll-item">
<article>
<h2>Multilevel CSS3 Menu</h2>
<p>	   <a class="ct-coll-thumb" href="http://css.dzone.com/articles/ms-office-style-css3"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2012/05/Collective11_02.jpg" alt="Collective11_02" title="" width="180" height="87" class="alignnone size-full wp-image-9010" /></a></p>
<p>In this tutorial by Andrey Prikaznov you will learn how to code a MS Office-style CSS3 multilevel menu.</p>
<p>	   <a class="ct-coll-link" href="http://css.dzone.com/articles/ms-office-style-css3">Read it</a><br />
   </article>
</div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/collective/collective-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Draggable Image Boxes Grid</title>
		<link>http://tympanus.net/codrops/2011/10/07/draggable-image-boxes-grid/</link>
		<comments>http://tympanus.net/codrops/2011/10/07/draggable-image-boxes-grid/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 15:22:48 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[draggable]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=6002</guid>
		<description><![CDATA[Today we want to create a template with a fullscreen grid of images and content areas. The idea is to have a draggable grid that shows boxes of thumbnails and menu like items. Once clicked, the thumbnail will expand to the full size image and the menu item box will expand to a fullscreen content area. ]]></description>
				<content:encoded><![CDATA[<p><a href="http://tympanus.net/Tutorials/DraggableImageBoxesGrid/" target="_blank"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/10/DraggableImageBoxesGrid.jpg" alt="Draggable Image Boxes Grid" width="580" height="315" class="aligncenter size-full wp-image-6019" /></a><br />
<a class="demo" href="http://tympanus.net/Tutorials/DraggableImageBoxesGrid/" target="_blank">View demo</a> <a class="download" href="http://tympanus.net/Tutorials/DraggableImageBoxesGrid/DraggableImageBoxesGrid.zip">Download source</a></p>
<p>Today we want to create a template with a fullscreen grid of images and content areas. The idea is to have a draggable grid that shows boxes of thumbnails and menu like items. Once clicked, the thumbnail will expand to the full size image and the menu item box will expand to a fullscreen content area. </p>
<p>The main idea for this template and its effects comes from the beautiful Flash-based website of <a href="http://stephenhamilton.com" target="_blank">Stephen Hamilton</a>.</p>
<p>To make the grid draggable, we used <a href="http://the-taylors.org/jquery.kinetic/" target="_blank">jQuery.kinetic by Dave Taylor</a>. The jQuery plugin allows smooth drag scrolling and it&#8217;s just what we need in our grid.</p>
<p>The beautiful images in the demo are by Ibrahim Iujaz. Check out his <a href="http://www.flickr.com/photos/notsogoodphotography/" target="_blank">Flickr photostream</a>.</p>
<p>So, let&#8217;s begin!<br />
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div></p>
<h3>The Markup</h3>
<p>The main container will be a div with the class and ID <strong>ib-main-wrapper</strong>. We will add another div element inside since we will need this structure for applying the jQuery.kinetic plugin. Inside of that div which has the class <strong>ib-main</strong>, we will place two types of link elements: the thumbnail links and the content links. The content links are the menu like boxes that will expand to a fullscreen content area: </p>
<pre class="brush:xml">
&lt;div id="ib-main-wrapper" class="ib-main-wrapper"&gt;
	&lt;div class="ib-main"&gt;
		&lt;a href="#"&gt;
			&lt;img src="images/thumbs/1.jpg" data-largesrc="images/large/1.jpg" alt="image01"/&gt;
			&lt;span&gt;Crabbed Age and Youth&lt;/span&gt;
		&lt;/a&gt;
		&lt;a href="#"&gt;
			&lt;img src="images/thumbs/2.jpg" data-largesrc="images/large/2.jpg" alt="image02"/&gt;
			&lt;span&gt;Cannot live together&lt;/span&gt;
		&lt;/a&gt;
		&lt;a href="#" class="ib-content"&gt;
			&lt;div class="ib-teaser"&gt;
				&lt;h2&gt;Welcome &lt;span&gt;Howdy, Stranger&lt;/span&gt;&lt;/h2&gt;
			&lt;/div&gt;
			&lt;div class="ib-content-full"&gt;
				&lt;!-- Some content --&gt;
			&lt;/div&gt;
		&lt;/a&gt;
		...
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>The boxes for the content will have the class <strong>ib-content</strong>. The path to the large image for the thumbnails will be saved in the data attribute <strong>data-largesrc</strong>.</p>
<p>For the content and image preview we will use jQuery templates. The template for the large image preview is the following:</p>
<pre class="brush:xml">
&lt;div id="ib-img-preview" class="ib-preview"&gt;
	&lt;img src="${src}" alt="" class="ib-preview-img"/&gt;
	&lt;span class="ib-preview-descr" style="display:none;"&gt;${description}&lt;/span&gt;
	&lt;div class="ib-nav" style="display:none;"&gt;
		&lt;span class="ib-nav-prev"&gt;Previous&lt;/span&gt;
		&lt;span class="ib-nav-next"&gt;Next&lt;/span&gt;
	&lt;/div&gt;
	&lt;span class="ib-close" style="display:none;"&gt;Close Preview&lt;/span&gt;
	&lt;div class="ib-loading-large" style="display:none;"&gt;Loading...&lt;/div&gt;
&lt;/div&gt;	
</pre>
<p>We will have the large image, the navigation buttons, a closing cross and a loading element.</p>
<p>The template for the fullscreen content preview looks like this:</p>
<pre class="brush:xml">
&lt;div id="ib-content-preview" class="ib-content-preview"&gt;
	&lt;div class="ib-teaser" style="display:none;"&gt;{{html teaser}}&lt;/div&gt;
	&lt;div class="ib-content-full" style="display:none;"&gt;{{html content}}&lt;/div&gt;
	&lt;span class="ib-close" style="display:none;"&gt;Close Preview&lt;/span&gt;
&lt;/div&gt;
</pre>
<p>Now, let&#8217;s style the grid.</p>
<h3>The CSS</h3>
<p>First, we will style the wrapping container. It will occupy all the page&#8217;s width and we will set the height dynamically to fit the visible area:</p>
<pre class="brush:css">
.ib-main-wrapper{
    width: 100%;
    overflow: hidden;
    margin-top: 40px;
    outline: none;
    /*height dynamic*/
}
</pre>
<p>The main container will have a preset width. We chose this value because we want most visitors to be able to actually drag the grid. If you would set it to less and the user has a larger screen, then the container would be too small:</p>
<pre class="brush:css">
.ib-main{
    position: relative;
    width: 2546px;
}
</pre>
<p>Each box element will be floating and have a background image (for the thumbs) that we&#8217;ll stretch to be a bit larger than the box. We&#8217;ll add a nice transition which will make the background image contract on hover:</p>
<pre class="brush:css">
.ib-main a{
    float: left;
    width: 210px;
    height: 210px;
    position: relative;
    overflow: hidden;
    margin: 0px 0px 2px 2px;
    cursor: move;
    background: #fff url(../images/thumb_bg.jpg) no-repeat center center;
    background-size: 110% 110%;
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    -ms-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
}
.ib-main a:hover{
    background-size: 100% 100%;
}
</pre>
<p>The thumbnail will be slightly transparent so that we can see the background image (which is a thick border). We&#8217;ll also add some CSS3 transition here to animate the opacity on hover:</p>
<pre class="brush:css">
.ib-main a img{
    opacity: 0.95;
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    -ms-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
}
.ib-main a:hover img{
    opacity: 0.8;
}
</pre>
<p>The description will be positioned absolutely and we&#8217;ll place it out of the box. Then, on hover, we will make it slide in:</p>
<pre class="brush:css">
.ib-main > a > span{
    display: block;
    position: absolute;
    width: 100%;
    height: 20px;
    line-height: 22px;
    text-align: center;
    font-size: 11px;
    bottom: -20px;
    left: 0px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    -ms-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
}
.ib-main a:hover > span{
    bottom: 0px;
}
</pre>
<p>When we click on the thumbnail box, we&#8217;ll change the background image in order to show the loading image:</p>
<pre class="brush:css">
.ib-main a.ib-loading,
.ib-main a.ib-loading:hover{
    background: #fff url(../images/ajax-loader.gif) no-repeat center center;
    background-size: 31px 31px;
}
.ib-main a.ib-loading img,
.ib-main a.ib-loading:hover img{
    opacity: 0.5;
}
</pre>
<p>When the thumbnail is in the loading state, we don&#8217;t want to show the description:</p>
<pre class="brush:css">
.ib-main > a.ib-loading > span,
.ib-main a.ib-loading > span{
    display: none;
}
</pre>
<p>Now we&#8217;ll style the content boxes. The background is going to be dark:</p>
<pre class="brush:css">
.ib-content{
    background: #f9f9f9;
}
</pre>
<p>The teaser is the text we&#8217;ll be showing in each content box. On hover we want to animate the background color:</p>
<pre class="brush:css">
.ib-content .ib-teaser{
    text-align: center;
    background: #333;
    width: 100%;
    height: 100%;
    -webkit-transition: all 0.2s ease-in-out;
    -moz-transition: all 0.2s ease-in-out;
    -o-transition: all 0.2s ease-in-out;
    -ms-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
}
.ib-content .ib-teaser:hover{
    background: #000;
}
</pre>
<p>The headline and the subline will have the following style:</p>
<pre class="brush:css">
.ib-teaser h2{
    color: #fff;
    font-size: 26px;
    line-height: 26px;
    padding-top: 40%;
    text-shadow: 1px 0px 2px rgba(0,0,0,0.2);
}
.ib-teaser h2 span{
    text-transform: none;
    font-size: 16px;
    font-family: Georgia, serif;
    font-style: italic;
    display: block;
}
</pre>
<p>When the content area gets expanded, we will show the preview container and it will have an absolute position and a dynamic height:</p>
<pre class="brush:css">
.ib-content-preview{
    position: absolute;
    top: 44px;
    left: 0px;
    background: #000;
    width: 100%;
    /* height dynamic*/
    display: none;
}
</pre>
<p>The text elements will get some styling:</p>
<pre class="brush:css">
.ib-content-preview .ib-teaser h2{
    font-size: 50px;
    padding: 85px 40px 20px 40px;
}
.ib-content-preview .ib-teaser span{
    padding: 20px 0px 0px 5px;
    font-size: 22px;
}
.ib-content-full{
    font-family:'Oswald', serif;
    text-transform: none;
    line-height: 26px;
    margin: 0px 40px;
    border-top: 1px solid #333;
    padding: 20px 0px;
	font-size: 16px;
}
.ib-content-full p{
	padding: 5px 0px;
}
</pre>
<p>The large preview for the thumbnails will also be of absolute position </p>
<pre class="brush:css">
.ib-preview{
    overflow: hidden;
    position: absolute;
    top: 40px;
    display: none;
}
</pre>
<p>The description for the large image will be placed in the bottom left corner. We want big letters:</p>
<pre class="brush:css">
.ib-preview-descr{
    position: absolute;
    bottom: 30px;
    left: 10px;
    z-index: 999;
    font-size: 50px;
    text-shadow: 1px 0px 2px rgba(0,0,0,0.2);
}
</pre>
<p>The image itself will be absolute and the width and height will be set dynamically in the JavaScript:</p>
<pre class="brush:css">
.ib-preview img{
	position: absolute;
}
</pre>
<p>The navigation for the images will be placed on the left and the right side of the screen:</p>
<pre class="brush:css">
.ib-nav span{
	width: 53px;
	height: 87px;
	position: absolute;
	top: 50%;
	margin-top: -43px;
	cursor: pointer;
    text-indent: -9000px;
	opacity: 0.6;
	z-index: 999;
    background: transparent url(../images/nav.png) no-repeat top right;
	right: 10px;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-o-user-select: none;
	user-select: none;
}
.ib-nav span.ib-nav-prev{
	background-position: top left;
	left: 10px;
    right: auto;
}
</pre>
<p>The closing element will be at the top right corner:</p>
<pre class="brush:css">
.ib-close{
	top: 7px;
	right: 7px;
	background: transparent url(../images/close.png) no-repeat center center;
	position: absolute;
	width: 24px;
	height: 24px;
	cursor: pointer;
	opacity: 0.2;
	z-index: 999;
    text-indent: -9000px;
}
.ib-nav span:hover, .ib-close:hover{
	opacity: 1;
}
</pre>
<p>Last, but not least, we&#8217;ll style the loading element for the large image. We&#8217;ll place it in the center of the screen with our 50% and negative margin trick and give it some rounded borders:</p>
<pre class="brush:css">
.ib-loading-large{
    text-indent: -9000px;
    width: 60px;
    height: 60px;
    background: #fff url(../images/ajax-loader.gif) no-repeat center center;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -30px 0 0 -30px;
    z-index: 999;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px 10px 10px 10px;
    opacity: 0.9;
}
</pre>
<p>And that was all the style. Now, let&#8217;s take a look at the JavaScript.</p>
<h3>The JavaScript</h3>
<p>Let&#8217;s define our template function:</p>
<pre class="brush:js">
var $ibWrapper	= $('#ib-main-wrapper'),
 
	Template	= (function() {
		...
})();

Template.init();
</pre>
<p>First, we will set some variables and cache some elements:</p>
<pre class="brush:js">
var kinetic_moving				= false,
	// current index of the opened item
	current						= -1,
	// true if the item is being opened / closed
	isAnimating					= false,
	// items on the grid
	$ibItems					= $ibWrapper.find('div.ib-main &gt; a'),
	// image items on the grid
	$ibImgItems					= $ibItems.not('.ib-content'),
	// total image items on the grid
	imgItemsCount				= $ibImgItems.length,
</pre>
<p>The init function will add a class to all the image items and call the jQuery.kinetic plugin and initialize our main events:</p>
<pre class="brush:js">
init						= function() {
		
		// add a class ib-image to the image items
		$ibImgItems.addClass('ib-image');
		// apply the kinetic plugin to the wrapper
		loadKinetic();
		// load some events
		initEvents();

	},
</pre>
<p><strong>loadKinetic</strong> will set the size of the main wrapper and apply the jQuery.kinetic plugin:</p>
<pre class="brush:js">
loadKinetic					= function() {
	
	setWrapperSize();
	
	$ibWrapper.kinetic({
		moved	: function() {
			
			kinetic_moving = true;
			
		},
		stopped	: function() {
			
			kinetic_moving = false;
			
		}
	});
	
},
</pre>
<p><strong>setWrapperSize</strong> will set the height of the main wrapper by taking the window height and removing the top bar and the bottom bar (which is our demo header actually):</p>
<pre class="brush:js">
setWrapperSize				= function() {
	
	var containerMargins	= $('#ib-top').outerHeight(true) + $('#header').outerHeight(true) + parseFloat( $ibItems.css('margin-top') );
	$ibWrapper.css( 'height', $(window).height() - containerMargins )
	
},

</pre>
<p><strong>initEvents</strong> calls the openItem function when we click on a box (unless we are dragging) and takes care of the resizing when we change the window size:</p>
<pre class="brush:js">
initEvents					= function() {

	// open the item only if not dragging the container
	$ibItems.bind('click.ibTemplate', function( event ) {
		
		if( !kinetic_moving )
			openItem( $(this) );
	
		return false;	
	
	});
	
	// on window resize, set the wrapper and preview size accordingly
	$(window).bind('resize.ibTemplate', function( event ) {
		
		setWrapperSize();
		
		$('#ib-img-preview, #ib-content-preview').css({
			width	: $(window).width(),
			height	: $(window).height()
		})
		
	});

},

</pre>
<p>When we click on an item, depending on which item we clicked, we&#8217;ll load a full image or a content area:</p>
<pre class="brush:js">
openItem					= function( $item ) {
	
	if( isAnimating ) return false;
	
	// if content item
	if( $item.hasClass('ib-content') ) {
		
		isAnimating	= true;
		current	= $item.index('.ib-content');
		loadContentItem( $item, function() { isAnimating = false; } );
		
	}
	// if image item
	else {
	
		isAnimating	= true;
		current	= $item.index('.ib-image');
		loadImgPreview( $item, function() { isAnimating = false; } );
		
	}
	
},
</pre>
<p>If we click on a thumbnail, we&#8217;ll load and expand to the respective large image. We will use the jQuery template for the large image preview and set it to the same position like the currently clicked item. Initially having the same size, it will then expand first in width to fit the window and then in height:</p>
<pre class="brush:js">
loadImgPreview				= function( $item, callback ) {
	
	var largeSrc		= $item.children('img').data('largesrc'),
		description		= $item.children('span').text(),
		largeImageData	= {
			src			: largeSrc,
			description	: description
		};
	
	// preload large image
	$item.addClass('ib-loading');
	
	preloadImage( largeSrc, function() {
		
		$item.removeClass('ib-loading');
		
		var hasImgPreview	= ( $('#ib-img-preview').length &gt; 0 );
		
		if( !hasImgPreview )
			$('#previewTmpl').tmpl( largeImageData ).insertAfter( $ibWrapper );
		else
			$('#ib-img-preview').children('img.ib-preview-img').attr( 'src', largeSrc );
			
		//get dimentions for the image, based on the windows size
		var	dim	= getImageDim( largeSrc );
		
		$item.removeClass('ib-img-loading');
		
		//set the returned values and show/animate preview
		$('#ib-img-preview').css({
			width	: $item.width(),
			height	: $item.height(),
			left	: $item.offset().left,
			top		: $item.offset().top
		}).children('img.ib-preview-img').hide().css({
			width	: dim.width,
			height	: dim.height,
			left	: dim.left,
			top		: dim.top
		}).fadeIn( 400 ).end().show().animate({
			width	: $(window).width(),
			left	: 0
		}, 500, 'easeOutExpo', function() {
		
			$(this).animate({
				height	: $(window).height(),
				top		: 0
			}, 400, function() {
			
				var $this	= $(this);
				$this.find('span.ib-preview-descr, span.ib-close').show()
				if( imgItemsCount &gt; 1 )
					$this.find('div.ib-nav').show();
					
				if( callback ) callback.call();
			
			});
		
		});
		
		if( !hasImgPreview )
			initImgPreviewEvents();
		
	} );
	
},
</pre>
<p>With the same effect of expanding, we&#8217;ll open a content area, too. Here we have to take care of the text elements:</p>
<pre class="brush:js">
loadContentItem				= function( $item, callback ) {
	
	var hasContentPreview	= ( $('#ib-content-preview').length &gt; 0 ),
		teaser				= $item.children('div.ib-teaser').html(),
		content				= $item.children('div.ib-content-full').html(),
		contentData			= {
			teaser		: teaser,
			content		: content
		};
		
	if( !hasContentPreview )
		$('#contentTmpl').tmpl( contentData ).insertAfter( $ibWrapper );
		
	//set the returned values and show/animate preview
	$('#ib-content-preview').css({
		width	: $item.width(),
		height	: $item.height(),
		left	: $item.offset().left,
		top		: $item.offset().top
	}).show().animate({
		width	: $(window).width(),
		left	: 0
	}, 500, 'easeOutExpo', function() {
	
		$(this).animate({
			height	: $(window).height(),
			top		: 0
		}, 400, function() {
			
			var $this	= $(this),
				$teaser	= $this.find('div.ib-teaser'),
				$content= $this.find('div.ib-content-full'),
				$close	= $this.find('span.ib-close');
				
			if( hasContentPreview ) {
				$teaser.html( teaser )
				$content.html( content )
			}
		
			$teaser.show();
			$content.show();
			$close.show();
			
			if( callback ) callback.call();
		
		});
	
	});
	
	if( !hasContentPreview )
		initContentPreviewEvents();	
	
},

</pre>
<p>A little helper function for preloading images:</p>
<pre class="brush:js">
// preloads an image
preloadImage				= function( src, callback ) {

	$('&lt;img/&gt;').load(function(){
	
		if( callback ) callback.call();
	
	}).attr( 'src', src );

},

</pre>
<p>The next function takes care of loading the events for the large image preview : navigation, close button, and window resize:</p>
<pre class="brush:js">
initImgPreviewEvents		= function() {

	var $preview	= $('#ib-img-preview');
	
	$preview.find('span.ib-nav-prev').bind('click.ibTemplate', function( event ) {
		
		navigate( 'prev' );
		
	}).end().find('span.ib-nav-next').bind('click.ibTemplate', function( event ) {
		
		navigate( 'next' );
		
	}).end().find('span.ib-close').bind('click.ibTemplate', function( event ) {
		
		closeImgPreview();
		
	});
	
	//resizing the window resizes the preview image
	$(window).bind('resize.ibTemplate', function( event ) {
		
		var $largeImg	= $preview.children('img.ib-preview-img'),
			dim			= getImageDim( $largeImg.attr('src') );
		
		$largeImg.css({
			width	: dim.width,
			height	: dim.height,
			left	: dim.left,
			top		: dim.top
		})
		
	});
	
},
</pre>
<p>For the content preview we&#8217;ll also have to load the event for the closing functionality:</p>
<pre class="brush:js">
initContentPreviewEvents	= function() {

	$('#ib-content-preview').find('span.ib-close').bind('click.ibTemplate', function( event ) {
		
		closeContentPreview();
		
	});
	
},
</pre>
<p>Next, we&#8217;ll define the function that takes care of navigating through the large images in fullscreen:</p>
<pre class="brush:js">
// navigate the image items in fullscreen mode
navigate					= function( dir ) {
	
	if( isAnimating ) return false;
	
	isAnimating		= true;
	
	var $preview	= $('#ib-img-preview'),
		$loading	= $preview.find('div.ib-loading-large');
	
	$loading.show();
	
	if( dir === 'next' ) {
		
		( current === imgItemsCount - 1 ) ? current	= 0 : ++current;
		
	}
	else if( dir === 'prev' ) {
		
		( current === 0 ) ? current	= imgItemsCount - 1 : --current;
		
	}
	
	var $item		= $ibImgItems.eq( current ),
		largeSrc	= $item.children('img').data('largesrc'),
		description	= $item.children('span').text();
		
	preloadImage( largeSrc, function() {
		
		$loading.hide();
		
		//get dimentions for the image, based on the windows size
		var	dim	= getImageDim( largeSrc );
		
		$preview.children('img.ib-preview-img')
						.attr( 'src', largeSrc )
						.css({
			width	: dim.width,
			height	: dim.height,
			left	: dim.left,
			top		: dim.top
						})
						.end()
						.find('span.ib-preview-descr')
						.text( description );
		
		$ibWrapper.scrollTop( $item.offset().top )
				  .scrollLeft( $item.offset().left );
		
		isAnimating	= false;
		
	});
	
},
</pre>
<p>The following function is for closing the fullscreen image preview:</p>
<pre class="brush:js">

closeImgPreview				= function() {

	if( isAnimating ) return false;
	
	isAnimating	= true;
	
	var $item	= $ibImgItems.eq( current );
	
	$('#ib-img-preview').find('span.ib-preview-descr, div.ib-nav, span.ib-close')
					.hide()
					.end()
					.animate({
						height	: $item.height(),
						top		: $item.offset().top
						}, 500, 'easeOutExpo', function() {
						
						$(this).animate({
							width	: $item.width(),
							left	: $item.offset().left
							}, 400, function() {
							
								$(this).fadeOut(function() {isAnimating	= false;});
							
						} );
					
					});

},
</pre>
<p>For the content preview we will also need such a function:</p>
<pre class="brush:js">
// closes the fullscreen content item
closeContentPreview			= function() {
	
	if( isAnimating ) return false;
	
	isAnimating	= true;
	
	var $item	= $ibItems.not('.ib-image').eq( current );
	
	$('#ib-content-preview').find('div.ib-teaser, div.ib-content-full, span.ib-close')
							.hide()
							.end()
							.animate({
								height	: $item.height(),
								top		: $item.offset().top
							}, 500, 'easeOutExpo', function() {
								
								$(this).animate({
									width	: $item.width(),
									left	: $item.offset().left
								}, 400, function() {
									
									$(this).fadeOut(function() {isAnimating	= false;});
									
								} );
							
							});

},

</pre>
<p><strong>getImageDim</strong> will get the size of an image and make it centered in fullscreen:</p>
<pre class="brush:js">
getImageDim					= function( src ) {
	
	var img     	= new Image();
	img.src     	= src;
	
	var w_w	= $(window).width(),
		w_h	= $(window).height(),
		r_w	= w_h / w_w,
		i_w	= img.width,
		i_h	= img.height,
		r_i	= i_h / i_w,
		new_w, new_h,
		new_left, new_top;
	
	if( r_w &gt; r_i ) {
	
		new_h	= w_h;
		new_w	= w_h / r_i;
	
	}	
	else {
	
		new_h	= w_w * r_i;
		new_w	= w_w;
	
	}
	
	return {
		width	: new_w,
		height	: new_h,
		left	: (w_w - new_w) / 2,
		top		: (w_h - new_h) / 2
	};

};
</pre>
<p>And that&#8217;s it! I hope you enjoyed making this template with me and find it useful!</p>
<p><a class="demo" href="http://tympanus.net/Tutorials/DraggableImageBoxesGrid/" target="_blank">View demo</a> <a class="download" href="http://tympanus.net/Tutorials/DraggableImageBoxesGrid/DraggableImageBoxesGrid.zip">Download source</a></p>
<div class="googlead"><!-- wp_ad_camp_1 --></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2011/10/07/draggable-image-boxes-grid/feed/</wfw:commentRss>
		<slash:comments>90</slash:comments>
		</item>
		<item>
		<title>Expanding Fullscreen Grid Portfolio</title>
		<link>http://tympanus.net/codrops/2011/08/04/fullscreen-grid-portfolio/</link>
		<comments>http://tympanus.net/codrops/2011/08/04/fullscreen-grid-portfolio/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 11:54:00 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Playground]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[masonry]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=5443</guid>
		<description><![CDATA[Today we want to share a neat experimental portfolio template with you. The main idea is to have a grid layout that we create with jQuery Masonry. Clicking to view more, we expand the according item to fullscreen in order to show a longer description of the item and a representative fullscreen background image. 
]]></description>
				<content:encoded><![CDATA[<p><a target="_blank" href="http://tympanus.net/Development/FullscreenGridPortfolioTemplate/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/08/ExpandingFullscreenGridPortfolioTemplate.jpg" alt="" title="ExpandingFullscreenGridPortfolioTemplate" width="580" height="315" class="aligncenter size-full wp-image-5451" /></a><br />
<a class="demo" href="http://tympanus.net/Development/FullscreenGridPortfolioTemplate/" target="_blank">View demo</a> <a class="download" href="http://tympanus.net/Development/FullscreenGridPortfolioTemplate/FullscreenGridPortfolioTemplate.zip">Download source</a></p>
<p>Today we want to share a neat experimental portfolio template with you. The main idea is to have a grid layout that we create with jQuery Masonry. Clicking to view more, we expand the according item to fullscreen in order to show a longer description of the item and a representative fullscreen background image. </p>
<p>Each item has a little slideshow of thumbs which will be animated to the right position once the portfolio item gets &#8220;expanded&#8221;. If you know Flipboard for the iPad, then you might recognize this effect we got inspired with. </p>
<p>The beautiful images are by Kyle van Horn, check out <a href="http://www.flickr.com/photos/kvh/" target="_blank">his Flickr Photostream</a>.</p>
<p>jQuery Masonry is by David deSandro and you can find it <a href="http://masonry.desandro.com/" target="_blank">here</a>.</p>
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div>
<p>The HTML for an item in the portfolio is the following:</p>
<pre class="brush:xml">
&lt;div class="item block" data-bgimage="images/1.jpg"&gt;
	&lt;div class="thumbs-wrapper"&gt;
		&lt;div class="thumbs"&gt;
			&lt;img src="images/thumbs/1.jpg"/&gt;
			&lt;img src="images/thumbs/2.jpg"/&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;h2 class="title"&gt;Personal Works&lt;/h2&gt;
	&lt;p class="subline"&gt;Concept &lt;span class="fancy"&gt;&amp;&lt;/span&gt; Design&lt;/p&gt;
	&lt;div class="intro"&gt;
		&lt;p&gt;
			Some short introduction 
			&lt;a href="#" class="more_link"&gt;View project&lt;/a&gt;
		&lt;/p&gt;
	&lt;/div&gt;
	&lt;div class="project-descr"&gt;
		&lt;p&gt;A longer description...&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>We use a jQuery template for the fullscreen structure:</p>
<pre class="brush:xml">
&lt;!-- Fullscreen jQuery template --&gt;
&lt;script id="fullviewTmpl" type="text/x-jquery-tmpl"&gt; 
	{{html bgimage}}
	&lt;div class="full-view"&gt;
		&lt;span class="full-view-exit"&gt;Exit full screen view&lt;/span&gt;
		&lt;div class="header"&gt;
			&lt;h2 class="title"&gt;${title}&lt;/h2&gt;
			&lt;div class="full-nav"&gt;
				&lt;span class="full-nav-prev"&gt;Previous&lt;/span&gt;
				&lt;span class="full-nav-pages"&gt;
					&lt;span class="full-nav-current"&gt;${current}&lt;/span&gt;/
					&lt;span class="full-nav-total"&gt;${total}&lt;/span&gt;
				&lt;/span&gt;
				&lt;span class="full-nav-next"&gt;Next&lt;/span&gt;
			&lt;/div&gt;
			&lt;p class="subline"&gt;${subline}&lt;/p&gt;
			&lt;span class="loading-small"&gt;&lt;/span&gt;
		&lt;/div&gt;
		&lt;div class="project-descr-full"&gt;
			&lt;div class="thumbs-wrapper"&gt;
				&lt;div class="thumbs"&gt;{{html thumbs}}&lt;/div&gt;
			&lt;/div&gt;
			&lt;div class="project-descr-full-wrapper"&gt;
				&lt;div class="project-descr-full-content"&gt;
					{{html description}}
				&lt;/div&gt;&lt;!-- project-descr-full-content --&gt;
			&lt;/div&gt;
		&lt;/div&gt;&lt;!-- project-descr-full --&gt;
	&lt;/div&gt;&lt;!-- full-view --&gt;
&lt;/script&gt;
</pre>
<p>When loading the page, we have the initial grid view:</p>
<p><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/08/ExpandingFullscreenGridPortfolioTemplate1.jpg" alt="" title="ExpandingFullscreenGridPortfolioTemplate1" width="580" height="312" class="aligncenter size-full wp-image-5448" /></p>
<p>And when we click on &#8220;View Project&#8221;, the fullscreen mode will be loaded:<br />
<img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/08/ExpandingFullscreenGridPortfolioTemplate2.jpg" alt="" title="ExpandingFullscreenGridPortfolioTemplate2" width="580" height="310" class="aligncenter size-full wp-image-5449" /></p>
<p>We hope you like this little experiment and find it useful!</p>
<p><a class="demo" href="http://tympanus.net/Development/FullscreenGridPortfolioTemplate/" target="_blank">View demo</a> <a class="download" href="http://tympanus.net/Development/FullscreenGridPortfolioTemplate/FullscreenGridPortfolioTemplate.zip">Download source</a></p>
<div class="googlead"><!-- wp_ad_camp_1 --></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2011/08/04/fullscreen-grid-portfolio/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
		<item>
		<title>Restaurant Website and Gallery Template</title>
		<link>http://tympanus.net/codrops/2011/04/21/restaurant-template/</link>
		<comments>http://tympanus.net/codrops/2011/04/21/restaurant-template/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 09:26:42 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Playground]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[google map]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[restaurant]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=4670</guid>
		<description><![CDATA[View demoDownload source Today we want to share a little website experiment with you. The theme for today&#8217;s template is a restaurant website which will include an image gallery for the menu and an integrated Google map that shows the location. The great food photography is by avlxyz and you can find his Flickr photostream [...]]]></description>
				<content:encoded><![CDATA[<p><a target="_blank" href="http://tympanus.net/Development/RestaurantTemplate/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/RestaurantTemplate.jpg" alt="" title="RestaurantTemplate" width="580" height="315" class="aligncenter size-full wp-image-4682" /></a><br />
<a class="demo" href="http://tympanus.net/Development/RestaurantTemplate/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Development/RestaurantTemplate/RestaurantTemplate.zip">Download source</a></p>
<p>Today we want to share a little website experiment with you. The theme for today&#8217;s template is a restaurant website which will include an image gallery for the menu and an integrated Google map that shows the location.</p>
<p>The great food photography is by <a target="_blank" href="http://www.flickr.com/people/avlxyz/">avlxyz</a> and you can find his Flickr photostream <a target="_blank" href="http://www.flickr.com/photos/avlxyz/">here</a>.<br />
The license for these pictures is the <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/">Attribution-NonCommercial-ShareAlike 2.0 Generic</a> License.</p>
<p>The main homepage photo of Venice at night is by <a target="_blank" href="http://www.flickr.com/people/krossbow/">krossbow</a>, be sure to check out <a target="_blank" href="http://www.flickr.com/photos/krossbow/">his Flickr photostream</a>.</p>
<p>When coming to the homepage, the background image will fade in and we will see the first welcome content block:</p>
<p><a target="_blank" href="http://tympanus.net/Development/RestaurantTemplate/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/restaurantTemplate1.jpg" alt="" title="restaurantTemplate1" width="580" height="299" class="aligncenter size-full wp-image-4673" /></a></p>
<p>When the user clicks on &#8220;Our Menu&#8221;, a little thumbnails gallery will appear in the content area:</p>
<p><a target="_blank" href="http://tympanus.net/Development/RestaurantTemplate/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/restaurantTemplate2.jpg" alt="" title="restaurantTemplate2" width="580" height="300" class="aligncenter size-full wp-image-4674" /></a></p>
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div>
<p>Choosing a dish from the thumbnails gallery, will open the fullscreen gallery, that shows the dish image with a title and a description and the same image as background. <strong>Using the navigation arrows on screen, the left/right keyboard arrows, or the scrolling wheel of the mouse, the user can slide the images</strong>. The title and description will animate back behind the foreground image during the sliding.</p>
<p><a target="_blank" href="http://tympanus.net/Development/RestaurantTemplate/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/restaurantTemplate3.jpg" alt="" title="restaurantTemplate3" width="580" height="298" class="aligncenter size-full wp-image-4675" /></a></p>
<p>When clicking on the foreground image, it will disappear and the background will become more bright. Now, the user can view the fullscreen image and navigate through them the same way. Clicking on the background will bring us back the foreground gallery element.</p>
<p><a href="http://tympanus.net/Development/RestaurantTemplate/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/restaurantTemplate4.jpg" alt="" title="restaurantTemplate4" width="580" height="299" class="aligncenter size-full wp-image-4676" /></a></p>
<p>When we click on the cross on the top right corner, we will leave the image gallery.</p>
<p>The menu point &#8220;Visit us&#8221; will hide the content box and show a google map as the background of the whole page:<br />
<a target="_blank" href="http://tympanus.net/Development/RestaurantTemplate/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/restaurantTemplate5.jpg" alt="" title="restaurantTemplate5" width="580" height="299" class="aligncenter size-full wp-image-4677" /></a></p>
<p>And that&#8217;s it! We really hope you liked this template idea and find it useful! </p>
<p><a class="demo" href="http://tympanus.net/Development/RestaurantTemplate/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Development/RestaurantTemplate/RestaurantTemplate.zip">Download source</a></p>
<div class="googlead"><!-- wp_ad_camp_1 --></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2011/04/21/restaurant-template/feed/</wfw:commentRss>
		<slash:comments>170</slash:comments>
		</item>
		<item>
		<title>Circular Discography Template with jQuery</title>
		<link>http://tympanus.net/codrops/2011/04/11/circular-discography-template/</link>
		<comments>http://tympanus.net/codrops/2011/04/11/circular-discography-template/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 10:45:00 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Playground]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[circular]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[jplayer]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=4613</guid>
		<description><![CDATA[View demoDownload source Today we want to share a simple website template with you. The template will show some discography or music albums in a rounded fashion, rotating the albums when clicking on next or previous. When clicking on an album, we will open the album details view which contains a music player (jPlayer) and [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://tympanus.net/Development/CircularDiscographyTemplate/" target="_blank"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/circularDiscographyTemplate.jpg" alt="" title="circularDiscographyTemplate" width="580" height="315" class="aligncenter size-full wp-image-4622" /></a></p>
<p><a class="demo" href="http://tympanus.net/Development/CircularDiscographyTemplate/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Development/CircularDiscographyTemplate/CircularDiscographyTemplate.zip">Download source</a></p>
<p>Today we want to share a simple website template with you. The template will show some discography or music albums in a rounded fashion, rotating the albums when clicking on next or previous. When clicking on an album, we will open the album details view which contains a music player (jPlayer) and a playlist of some songs. There is also a description area that can be scrolled.</p>
<p>We will be using the following jQuery plugins and scripts that will help us with the effects and the functionality:</p>
<ul>
<li><a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">jQuery Easing Plugin</a></li>
<li><a href="http://jscrollpane.kelvinluck.com/" target="_blank">jScrollPane</a></li>
<li><a href="https://github.com/heygrady/transform/wiki/" target="_blank">jQuery 2D Transformation Plugin</a></li>
<li><a href="http://jplayer.org/" target="_blank">jPlayer</a></li>
</ul>
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div>
<p>We&#8217;ve added some nice music samples from the following artists:</p>
<p><strong>Audiotechnica &#8211; Testing</strong><br />
by <a href="http://ccmixter.org/people/audiotechnica" target="_blank">audiotechnica </a></p>
<p><strong>Coffeeeurope -Arena Blanca</strong><br />
by <a href="http://ccmixter.org/people/coffeeeurope" target="_blank">Hektor Thillet</a></p>
<p><strong>Ramblinglibrarian &#8211; Our Resolve </strong><br />
by <a href="http://ccmixter.org/people/ramblinglibrarian/profile" target="_blank">Ivan Chew</a></p>
<p><strong>Syenta &#8211; Emerging Cry </strong><br />
by <a href="http://ccmixter.org/people/Syenta" target="_blank">Syenta</a></p>
<p>Thanks to the artists for releasing their music under the Creative Commons Attribution Noncommercial (3.0) Licence!</p>
<p>The initial screen of the template will show some loading element, and we will preload all the images. It will show the album view with the navigation arrows lined up in a diagonal:<br />
<img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/circularDiscographyTemplate01.jpg" alt="" title="circularDiscographyTemplate01" width="580" height="283" class="aligncenter size-full wp-image-4617" /></p>
<p>When clicking on one of the navigations arrows, we will rotate the album and fade in the next/previous one:<br />
<img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/circularDiscographyTemplate02.jpg" alt="" title="circularDiscographyTemplate02" width="580" height="289" class="aligncenter size-full wp-image-4618" /></p>
<p>When clicking on one of the albums, we will open the album detail view with a music player, a playlist and some detailed info on the album. The background image will now change to the one we had in the circle of the album before. The music will start automatically with the first song and continue through the playlist:<br />
<img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/04/circularDiscographyTemplate03.jpg" alt="" title="circularDiscographyTemplate03" width="580" height="293" class="aligncenter size-full wp-image-4619" /></p>
<p>We hope you like this little template and find it useful!</p>
<p><a class="demo" href="http://tympanus.net/Development/CircularDiscographyTemplate/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Development/CircularDiscographyTemplate/CircularDiscographyTemplate.zip">Download source</a></p>
<div class="googlead"><!-- wp_ad_camp_1 --></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2011/04/11/circular-discography-template/feed/</wfw:commentRss>
		<slash:comments>67</slash:comments>
		</item>
		<item>
		<title>Moving Boxes Content with jQuery</title>
		<link>http://tympanus.net/codrops/2011/03/28/moving-boxes-content/</link>
		<comments>http://tympanus.net/codrops/2011/03/28/moving-boxes-content/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 12:34:00 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[boxes]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=4586</guid>
		<description><![CDATA[View demoDownload source Today we will create a website template with some really sweet animations using jQuery. The idea is to have little boxes scattered around at the top of the site and when a menu item is clicked, the boxes animate to form the main content area. We will use some different animation effects [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://tympanus.net/Tutorials/MovingBoxesContent/" target="blank"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/03/movingboxes.jpg" alt="" title="movingboxes" width="580" height="315" class="aligncenter size-full wp-image-4596" /></a><br />
<a class="demo" href="http://tympanus.net/Tutorials/MovingBoxesContent/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Tutorials/MovingBoxesContent/MovingBoxesContent.zip">Download source</a><br />
Today we will create a website template with some really sweet animations using jQuery. The idea is to have little boxes scattered around at the top of the site and when a menu item is clicked, the boxes animate to form the main content area. We will use some different animation effects that we will add as options to the menu item. </p>
<p>The content area will custom scroll for which we will be using the really awesome <a href="http://jscrollpane.kelvinluck.com/" target="_blank">jScrollPane Plugin by Kevin Luck</a>. We will also use the <a href="https://github.com/heygrady/transform" target="_blank">jQuery 2d transformation plugin by Grady</a> in order to rotate the little boxes while we animate them, and the the <a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">jQuery Easing Plugin</a> for some spice.</p>
<p>The beautiful photos are by Jin. Visit his Flickr photostream at <a href="http://www.flickr.com/photos/jinthai/" target="_blank">http://www.flickr.com/photos/jinthai/</a></p>
<p>So, let&#8217;s start!</p>
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div>
<h3>The Markup</h3>
<p>First, we want to place the background image with the grid overlay:</p>
<pre class="brush:xml">
&lt;div id="mb_background" class="mb_background"&gt;
	&lt;img class="mb_bgimage" src="images/default.jpg" alt="Background"/&gt;
	&lt;div class="mb_overlay"&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>The next div element will be used to add the little boxes with their random position and rotation degree</p>
<pre class="brush:xml">
&lt;div id="mb_pattern" class="mb_pattern"&gt;&lt;/div&gt;
</pre>
<p>We will place a total of 16 boxes (div elements) into this container.<br />
The menu and the heading will have the following HTML stucture:</p>
<pre class="brush:xml">
&lt;div class="mb_heading"&gt;
	&lt;h1&gt;Lack of Color&lt;/h1&gt;
&lt;/div&gt;

&lt;div id="mb_menu" class="mb_menu"&gt;
	&lt;a href="#" data-speed="600" data-easing="easeOutBack"&gt;About&lt;/a&gt;
	&lt;a href="#" data-speed="1000" data-easing="easeInExpo"&gt;Work&lt;/a&gt;
	&lt;a href="#" data-speed="600" data-easing="easeOutBack"&gt;Media&lt;/a&gt;
	&lt;a href="#" data-speed="1000" data-easing="easeInExpo"&gt;Contact&lt;/a&gt;
&lt;/div&gt;
</pre>
<p>As you can see, we will add two &#8220;data-&#8221; attributes that we&#8217;ll use to define the speed and the easing effect that will be associated to the animation of the boxes. Read more about these new custom data attributes of HTML5 on John Resig&#8217;s blog: <a href="http://ejohn.org/blog/html-5-data-attributes/" target="_blank">HTML 5 data- Attributes</a><br />
Next, we will define the structure for the content area. There will be a main wrapper with the class &#8220;mb_content_wrapper&#8221; which contains all the content containers that have the class &#8220;mb_content&#8221; and a span for the closing cross:</p>
<pre class="brush:xml">
&lt;div id="mb_content_wrapper" class="mb_content_wrapper"&gt;
	&lt;span class="mb_close"&gt;&lt;/span&gt;
	&lt;div class="mb_content"&gt;
		&lt;h2&gt;About&lt;/h2&gt;
		&lt;div class="mb_content_inner"&gt;
			&lt;p&gt;Some text...&lt;/p&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class="mb_content"&gt;
		...
	&lt;/div&gt;
	&lt;div class="mb_content"&gt;
		...
	&lt;/div&gt;
	&lt;div class="mb_content"&gt;
		...
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>One of the content elements is going to contain a list of images:</p>
<pre class="brush:xml">
&lt;div class="mb_content_inner"&gt;
	&lt;p&gt;...&lt;/p&gt;
	&lt;ul id="mb_imagelist" class="mb_imagelist"&gt;
		&lt;li&gt;&lt;img src="images/small/1.jpg" alt="image1" data-bgimg="images/image1.jpg"/&gt;&lt;/li&gt;
		&lt;li&gt;&lt;img src="images/small/2.jpg" alt="image2" data-bgimg="images/image2.jpg"/&gt;&lt;/li&gt;
		&lt;li&gt;...&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;...&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>And that&#8217;s all the HTML. Now, let&#8217;s make it pretty!</p>
<h3>The CSS</h3>
<p>First, we will embed our reset.css that will reset all the basic styles, and we&#8217;ll define some main properties:</p>
<pre class="brush:css">
@import url('reset.css');

body{
	background:#000;
	color:#fff;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
}
a{
	color:#fff;
	text-decoration:none;
}
</pre>
<p>Next, we will define the styles for the image that we will use as a background and the overlay pattern:</p>
<pre class="brush:css">
img.mb_bgimage{
	position:fixed;
	left:0px;
	top:0px;
	width:100%;
	opacity:0.8;
	z-index:1;
}
.mb_overlay{
	width:100%;
	height:100%;
	position:fixed;
	top:0px;
	left:0px;
	background:transparent url(../images/pattern.png) repeat top left;
	z-index:2;
}
</pre>
<p>They will both be of fixed positioning and we will give them a low z-index so that they really stay under everything else.</p>
<p>The little boxes will all have a height and width of 50 pixel and they will have absolute positioning:</p>
<pre class="brush:css">
.mb_pattern div{
	position:absolute;
	width:50px;
	height:50px;
	background:#000;
	z-index:10;
}
</pre>
<p>The main heading will also be positioned absolutely and we will use a font-face from the collection of Google Web Fonts:</p>
<pre class="brush:css">
.mb_heading h1{
	position:absolute;
	top:10px;
	left:10px;
	font-size:86px;
	color:#000;
	text-shadow:0px 0px 1px #fff;
	font-family:"Astloch", Arial, sans-serif;
	z-index:4;
}
</pre>
<p>The menu container will be placed absolutely to the left side of the screen:</p>
<pre class="brush:css">
.mb_menu{
	position:absolute;
	top:154px;
	left:0px;
	z-index:11;
}
</pre>
<p>The link elements inside of the menu container will be black boxes with a neat transition on hover:</p>
<pre class="brush:css">
.mb_menu a{
	background-color:#000;
	margin-bottom:2px;
	opacity:0.9;
	display:block;
	width:98px;
	height:98px;
	color:#fff;
	line-height:98px;
	text-align:center;
	text-transform:uppercase;
	outline:none;
	-webkit-transition: all 0.2s ease-in;
	-moz-transition:all 0.2s ease-in;
	-o-transition: all 0.2s ease-in;
	-transition: all 0.2s ease-in;
}
.mb_menu a:hover{
	color:#000;
	background-color:#fff;
}
</pre>
<p>Read more about transitions in the W3 working draft at <a href="http://www.w3.org/TR/css3-transitions/" target="_blank">http://www.w3.org/TR/css3-transitions/</a> or in this great article on A List Apart by Dan Cederholm: <a href="http://www.alistapart.com/articles/understanding-css3-transitions/">Understanding CSS3 Transitions</a>.</p>
<p>Next step is to style the content wrapper. We will give it a fixed width and height and a semi-transparent dark background. We&#8217;ll hide it initially:</p>
<pre class="brush:css">
.mb_content_wrapper{
	background:transparent url(../images/bg_menu.png) repeat top left;
	width:400px;
	height:400px;
	position:absolute;
	top:154px;
	left:200px;
	z-index:4;
	display:none;
}
</pre>
<p>Why don&#8217;t we just use opacity instead of a repeated background image? In some browsers all child elements will inherit that opacity level and we cannot set it higher for them. So, if we really want the inner elements to be completely opaque, it&#8217;s safer to use a background image for the surrounding container.</p>
<p>The little closing span will have the following style:</p>
<pre class="brush:css">
span.mb_close{
	position:absolute;
	top:10px;
	right:10px;
	width:11px;
	height:12px;
	cursor:pointer;
	background:transparent url(../images/close.png) no-repeat top left;
	opacity:0.8;
}
span.mb_close:hover{
	opacity:1.0;
}
</pre>
<p>The content area is going to have some padding and we&#8217;ll hide it:</p>
<pre class="brush:css">
.mb_content{
	padding:30px;
	display:none;
}
</pre>
<p>The heading will have some background image for the stripe underline:</p>
<pre class="brush:css">
.mb_content h2{
	font-family:"Astloch";
	text-shadow:0px 0px 1px #fff;
	font-size:42px;
	background:transparent url(../images/line.png) repeat-x bottom left;
	padding:0px 0px 5px 0px;
	margin-bottom:10px;
}
</pre>
<p>The following container is for the resting content and it will be this element that we will apply the custom scrollbar to: </p>
<pre class="brush:css">
.mb_content_inner{
	line-height:24px;
	height:268px;
	outline: none;
}
.mb_content_inner p{
	padding:5px 0px;
}
</pre>
<p>For the thumbnail list in the &#8220;Work&#8221; section, we will have the following style:</p>
<pre class="brush:css">
ul.mb_imagelist li{
	float:left;
	margin:2px;
	cursor:pointer;
}
ul.mb_imagelist li img{
	display:block;
	opacity:0.3;
	-webkit-transition: all 0.5s ease-in-out;
	-moz-transition: all 0.5s ease-in-out;
	-o-transition: all 0.5s ease-in-out;
	-transition: all 0.5s ease-in-out;
}
ul.mb_imagelist li img:hover{
	opacity:1.0;
}
</pre>
<p>As you can see, we will add some transition to it, making the thumbnail become opaque smoothly.</p>
<p>And that&#8217;s all the main style. (You can check out the styling for the form and the footer in the style.css file.)</p>
<p>Let&#8217;s add some brio to the whole thing!</p>
<h3>The JavaScript</h3>
<p>So the main idea is to create those little boxes and scatter them around a restricted area and rotate them. When we click on a menu item, we&#8217;ll make those boxes animate to a certain position and form the main content container. Then we&#8217;ll show the container and the respective content. When clicking on the closing span, we want to make the boxes disperse again.<br />
In the &#8220;Works&#8221; content, we will have some thumbnails that will show a background image when clicking on them. </p>
<p>So, let&#8217;s start by caching some elements:</p>
<pre class="brush:js">
var $menu				= $('#mb_menu'),
	$menuItems			= $menu.children('a'),
	$mbWrapper			= $('#mb_content_wrapper'),
	$mbClose			= $mbWrapper.children('.mb_close'),
	$mbContentItems		= $mbWrapper.children('.mb_content'),
	$mbContentInnerItems= $mbContentItems.children('.mb_content_inner');
	$mbPattern			= $('#mb_pattern'),
	$works				= $('#mb_imagelist > li'),
	$mb_bgimage			= $('#mb_background > img'),
</pre>
<p>Next, we will define the &#8220;Menu&#8221; function:</p>
<pre class="brush:js">
Menu		 		= (function(){
  ...
})();

/*
call the init method of Menu
 */
Menu.init();
</pre>
<p>So, inside of our &#8220;Menu&#8221; function, we&#8217;ll define our main functionality, starting with a method to initialize the whole thing:</p>
<pre class="brush:js">
var init			= function() {
	preloadImages();
	initPlugins();
	initPattern();
	initEventsHandler();
},
</pre>
<p>We want to preload the images that we have in the &#8220;Work&#8221; content. The data attribute in the thumbnails tells us, which images we need:</p>
<pre class="brush:js">
preloadImages		= function() {
	$works.each(function(i) {
		$('<img/>').attr('src' , $(this).children('img').data('bgimg'));
	});
},
</pre>
<p>The jScollPane plugin needs to be initialized, and we&#8217;ll apply the custom scroll to the inner content area of the content div when we call this:</p>
<pre class="brush:js">
initPlugins			= function() {
	$mbContentInnerItems.jScrollPane({
		verticalDragMinHeight: 40,
		verticalDragMaxHeight: 40
	});
},
</pre>
<p>&#8220;initPattern&#8221; will randomly place 16 boxes (div elements) into a restricted area. We restrict that area by restricting the top and left values to a certain range:</p>
<pre class="brush:js">
initPattern			= function() {
	for(var i = 0; i < 16 ; ++i) {
		//opacity, random top, left and angle
		var o		= 0.1,
		t		= Math.floor(Math.random()*196) + 5, // between 5 and 200
		l		= Math.floor(Math.random()*696) + 5, // between 5 and 700
		a		= Math.floor(Math.random()*101) - 50; // between -50 and 50
				
		$el		= $('<div>').css({
			opacity			: o,
			top				: t + 'px',
			left			: l + 'px'
		});
			
		if (!$.browser.msie)
			$el.transform({'rotate'	: a + 'deg'});
			
		$el.appendTo($mbPattern);
	}
	$mbPattern.children().draggable(); //just for fun
},
</pre>
<p>When we close the content area we want to move the little boxes back, scattered around randomly again:</p>
<pre class="brush:js">
disperse			= function() {
	$mbPattern.children().each(function(i) {
		var o			= 0.1,
		t			= Math.floor(Math.random()*196) + 5, 
		l			= Math.floor(Math.random()*696) + 5, 
		a			= Math.floor(Math.random()*101) - 50; 
		$el			= $(this),
		param		= {
			width	: '50px',
			height	: '50px',
			opacity	: o,
			top		: t + 'px',
			left	: l + 'px'
		};
				
		if (!$.browser.msie)
			param.rotate	= a + 'deg';
				
		$el.animate(param, 1000, 'easeOutExpo');
	});
},
</pre>
<p>Let&#8217;s handle the events:</p>
<pre class="brush:js">
initEventsHandler		= function() {
	/*
		click a link in the menu
	 */
	$menuItems.bind('click', function(e) {
		var $this	= $(this),
		pos		= $this.index(),
		speed	= $this.data('speed'),
		easing	= $this.data('easing');
		//if an item is not yet shown
		if(!$menu.data('open')){
			//if current animating return
			if($menu.data('moving')) return false;
			$menu.data('moving', true);
			$.when(openItem(pos, speed, easing)).done(function(){
				$menu.data({
					open	: true,
					moving	: false
				});
				showContentItem(pos);
				$mbPattern.children().fadeOut(500);
			});
		}
		else
			showContentItem(pos);
		return false;
	});
		
	/*
		click close makes the boxes animate to the top of the page
	 */
	$mbClose.bind('click', function(e) {
		$menu.data('open', false);
		/*
			if we would want to show the default image when we close:
			changeBGImage('images/default.jpg');
		 */
		$mbPattern.children().fadeIn(500, function() {
			$mbContentItems.hide();
			$mbWrapper.hide();
		});
			
		disperse();
		return false;
	});
		
	/*
		click an image from "Works" content item,
		displays the image on the background
	 */
	$works.bind('click', function(e) {
		var source	= $(this).children('img').data('bgimg');
		changeBGImage(source);
		return false;
	});
			
},
</pre>
<p>When we click on one of the thumbnails in the &#8220;Work&#8221; section, we want the background image to change. So we define:</p>
<pre class="brush:js">
changeBGImage			= function(img) {
	//if its the current one return
	if($mb_bgimage.attr('src') === img || $mb_bgimage.siblings('img').length > 0)
		return false;
				
	var $itemImage = $('&lt;img src="'+img+'" alt="Background" class="mb_bgimage" style="display:none;"/&gt;');
	$itemImage.insertBefore($mb_bgimage);
		
	$mb_bgimage.fadeOut(1000, function() {
		$(this).remove();
		$mb_bgimage = $itemImage;
	});
	$itemImage.fadeIn(1000);
},
</pre>
<p>This shows a content item when there is already one shown:</p>
<pre class="brush:js">
showContentItem			= function(pos) {
	$mbContentItems.hide();
	$mbWrapper.show();
	$mbContentItems.eq(pos).show().children('.mb_content_inner').jScrollPane();
},
</pre>
<p>&#8220;openItem&#8221; moves the boxes from the top to the center of the page, and shows the respective content item:</p>
<pre class="brush:js">
openItem				= function(pos, speed, easing) {
	return $.Deferred(
		function(dfd) {
			$mbPattern.children().each(function(i) {
				var $el			= $(this),
				param		= {
					width	: '100px',
					height	: '100px',
					top		: 154 + 100 * Math.floor(i/4),
					left	: 200 + 100 * (i%4),
					opacity	: 1
				};

				if (!$.browser.msie)
					param.rotate	= '0deg';

				$el.animate(param, speed, easing, dfd.resolve);
			});
		}
	).promise();
};
</pre>
<p>And that&#8217;s it! We really hope you enjoyed the tutorial and find it useful! </p>
<p><a class="demo" href="http://tympanus.net/Tutorials/MovingBoxesContent/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Tutorials/MovingBoxesContent/MovingBoxesContent.zip">Download source</a></p>
<div class="googlead"><!-- wp_ad_camp_1 --></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2011/03/28/moving-boxes-content/feed/</wfw:commentRss>
		<slash:comments>76</slash:comments>
		</item>
		<item>
		<title>Animated Content Menu with jQuery</title>
		<link>http://tympanus.net/codrops/2011/03/09/animated-content-menu/</link>
		<comments>http://tympanus.net/codrops/2011/03/09/animated-content-menu/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 12:06:21 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animated]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=4454</guid>
		<description><![CDATA[View demoDownload source Today we will create a slick animated content menu with jQuery for a restaurant theme. The menu items will be animated and when clicked, a content area with more information will appear. Also, he background image is going to change according to which menu item was clicked. The main idea is to [...]]]></description>
				<content:encoded><![CDATA[<p><a target="_blank" href="http://tympanus.net/Tutorials/AnimatedContentMenu/"><img src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2011/03/AnimatedContentMenu.jpg" alt="" title="AnimatedContentMenu" width="580" height="315" class="aligncenter size-full wp-image-4455" /></a></p>
<p><a class="demo" href="http://tympanus.net/Tutorials/AnimatedContentMenu/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Tutorials/AnimatedContentMenu/AnimatedContentMenu.zip">Download source</a></p>
<p>Today we will create a slick animated content menu with jQuery for a restaurant theme. The menu items will be animated and when clicked, a content area with more information will appear. Also, he background image is going to change according to which menu item was clicked.</p>
<p>The main idea is to have a restaurant menu with the different menu categories displayed. Each content are will have some foods/drinks listed. Once a content box is shown, the menu items are going to disappear. If we click on the close button to close the box, the menu items will be shown again.</p>
<p>So, let&#8217;s get started.</p>
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div>
<h3>The Markup</h3>
<p>The HTML structure is going to contain some elements for the background image, the grid overlay, the loading icon and the main menu. The Markup for the background is going to look like this:</p>
<pre class="brush:xml">
&lt;div id="ac_background" class="ac_background"&gt;
	&lt;img class="ac_bgimage" src="images/Default.jpg" alt="Background"/&gt;
	&lt;div class="ac_overlay"&gt;&lt;/div&gt;
	&lt;div class="ac_loading"&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>As a default background image when the page loads, we will have the image Default.jpg. Whenever we click on a menu item, we are going to change that image by adding another one and making the current one disappear. </p>
<p>The menu content will be wrapped by a div with the class &#8220;ac_content&#8221;. There will be a title and an unordered list for the items wrapped by a div with the class &#8220;ac_menu&#8221;:</p>
<pre class="brush:xml">
&lt;div id="ac_content" class="ac_content"&gt;
	&lt;h1&gt;&lt;span&gt;Cafe + Bar&lt;/span&gt;Dhalia&lt;/h1&gt;
	&lt;div class="ac_menu"&gt;
		&lt;ul&gt;
			&lt;li&gt;
				&lt;a href="images/Appetizers.jpg"&gt;Appetizers&lt;/a&gt;
				&lt;div class="ac_subitem"&gt;
					&lt;span class="ac_close"&gt;&lt;/span&gt;
					&lt;h2&gt;Appetizers&lt;/h2&gt;
					&lt;ul&gt;
						&lt;li&gt;
							A wonderful serenity has taken possession 
							of my entire soul, like these sweet mornings 
							of spring which I enjoy with my whole heart.
						&lt;/li&gt;
						&lt;li&gt;Lobster Bisque&lt;/li&gt;
						&lt;li&gt;Smoked Salmon Terrine&lt;/li&gt;
						&lt;li&gt;Tuna Ceviche&lt;/li&gt;
						&lt;li&gt;Wild Mushroom Flan&lt;/li&gt;
						&lt;li&gt;Almond Bruschetta&lt;/li&gt;
						&lt;li&gt;Green Chilli Canapee&lt;/li&gt;
						&lt;li&gt;Artichoke Rucula Salad&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/div&gt;&lt;!-- ac_subitem--&gt;
			&lt;/li&gt;
			...
		&lt;/ul&gt;
	&lt;/div&gt;&lt;!-- ac_menu --&gt;
&lt;/div&gt;&lt;!-- ac_content --&gt;
</pre>
<p>For each menu item, we will have a div &#8220;ac_subitem&#8221; which will contain the submenu content box. Inside of that box we will place another list (but it can be any other kind of content).</p>
<p>The link element in the main menu will have a href attribute pointing to the image that we will make appear in the background then.</p>
<p>Let&#8217;s take a look at the style.</p>
<h3>The CSS</h3>
<p>In the beginning of our CSS we will import a reset.css:</p>
<pre class="brush:css">
@import url('reset.css');
</pre>
<p>We will make the body black since we want to fade out the background images and make them appear darker while we do that:</p>
<pre class="brush:css">
body{
	background:#000;
	color:#fff;
	font-family: 'PT Sans Narrow', Arial, sans-serif;
	text-transform:uppercase;
}
</pre>
<p>The links are going to be white:</p>
<pre class="brush:css">
a{
	color:#fff;
	text-decoration:none;
}
</pre>
<p>The background image is going to be fixed and we don&#8217;t want to show it in the beginning &#8211; we want to take care of the appearance using JavaScript. The positioning and the size of the image is also going to be done dynamically, since we want to place it regarding to the size of the user&#8217;s window:</p>
<pre class="brush:css">
img.ac_bgimage{
	position:fixed;
	left:0px;
	top:0px;
	opacity:0.8;
	display:none;
}
</pre>
<p>The overlay is going to be placed on top of the image. It&#8217;s a repeated pattern that will give the image a neat look:</p>
<pre class="brush:css">
.ac_overlay{
	width:100%;
	height:100%;
	position:fixed;
	top:0px;
	left:0px;
	background:transparent url(../images/pattern.png) repeat top left;
}
</pre>
<p>We will place the loading icon in the top right corner of the page and it will appear in the beginning while we load the images:</p>
<pre class="brush:css">
.ac_loading{
	position:fixed;
	top:10px;
	right:10px;
	background:#000 url(../images/loader.gif) no-repeat center center;
	width:50px;
	height:50px;
	border-radius:10px 10px 10px 10px;
	z-index:999;
	opacity:0.7;
	display:none;
}
</pre>
<p>The main content div will also be fixed and placed in the middle of the screen. We set the top value to 50% and subtract half of its height from that position by setting the margin to -65 pixel. Like that we place it exactly in the middle of the webpage:</p>
<pre class="brush:css">
.ac_content{
	position:fixed;
	height:90px;
	width:100%;
	top:50%;
	left:0px;
	margin-top:-65px;
}
</pre>
<p>The heading to the left will have a black semi-transparent background and we will style the h1 and the span differently. We will also add a 1 pixel margin to the right in order to separate it a bit from the menu wrapper:</p>
<pre class="brush:css">
.ac_content h1{
	background:transparent url(../images/bg_menu.png) repeat top left;
	display:block;
	float:left;
	width:90px;
	height:50px;
	padding:20px;
	font-size:36px;
	font-weight:bold;
	line-height:20px;
	margin-right:1px;
}
.ac_content h1 span{
	display:block;
	font-weight:normal;
	font-size:14px;
}
</pre>
<p>The main menu wrapper will have the same background like the heading and we will give it an initial width of 0 pixel. In the JavaScript we will then animate the width when we load the page to fit the width of the window:</p>
<pre class="brush:css">
.ac_menu{
	background:transparent url(../images/bg_menu.png) repeat top left;
	float:left;
	position:relative;
	height:90px;
	width:0px; 
}
</pre>
<p>The unordered list which will contain the menu items will float right:</p>
<pre class="brush:css">
.ac_menu > ul{
	float:right;
}
</pre>
<p>The list items will have a specified height and the overflow will be set to hidden since we want to animate the link elements to appear from the bottom. If we wouldn&#8217;t set the overflow to hidden, we would be able to see the link elements under the menu. </p>
<pre class="brush:css">
.ac_menu > ul > li{
	float:left;
	position:relative;
	height:90px;
	overflow:hidden;
}
</pre>
<p>The link elements will initially be hidden by setting the margin top to 60 pixel and the opacity to 0. We will animate that margin to 0 pixel and make them opaque, in order for the items to appear, each one with a little delay, creating an interesting effect. </p>
<pre class="brush:css">
.ac_menu > ul > li a{
	margin-top:60px;
	opacity:0;
	display:block;
	height:90px;
	padding:0px 10px;
	text-align:center;
	line-height:90px;
	outline:none;
	font-size:18px;
	font-weight:bold;
	text-shadow:1px 1px 1px #000;
}
</pre>
<p>The subitem boxes will have a width of 400 pixel and an initial height of 0 pixel. We will animate that height and the top margin in order for each box to appear from the middle:</p>
<pre class="brush:css">
.ac_subitem{
	width:400px;
	height:0px; /* animate to 400px */
	top:50%;
	right:0px;
	margin-top:0px; /* animate to -200px */
	position:fixed;
	z-index:99;
	overflow:hidden;
	background:transparent url(../images/bg_menu.png) repeat top left;
}
</pre>
<p>Let&#8217;s give some styling to the content of the subitems:</p>
<pre class="brush:css">
.ac_subitem h2{
	font-size:22px;
	font-weight:bold;
	color:#fff;
	padding: 40px 0px 0px 40px;
	text-shadow:0px 0px 1px #000;
}
.ac_subitem ul{
	padding:0px 40px;
}
.ac_subitem ul li{
	margin:10px 0px;
}
.ac_subitem ul li:first-child{
	font-size:14px;
	text-transform:none;
	border-bottom:1px dotted #333;
	padding-bottom:15px;
	margin-bottom:15px;
}
</pre>
<p>And let&#8217;s place the little closing cross at the top right corner:</p>
<pre class="brush:css">
span.ac_close{
	float:right;
	margin:10px;
	width:11px;
	height:12px;
	cursor:pointer;
	background:transparent url(../images/close.png) no-repeat top left;
	opacity:0.4;
}
span.ac_close:hover{
	opacity:1.0;
}
</pre>
<p>And that&#8217;s all the style. Let&#8217;s add the magic!</p>
<h3>The JavaScript</h3>
<p>For the effects will will be using some easing, so we will need to include the <a href="http://gsgd.co.uk/sandbox/jquery/easing/" target="_blank">jQuery Easing Plugin</a> after including the jQuery script.</p>
<p>Let&#8217;s first cache some elements:</p>
<pre class="brush:js">
var $ac_background	= $('#ac_background'),
$ac_bgimage		= $ac_background.find('.ac_bgimage'),
$ac_loading		= $ac_background.find('.ac_loading'),

$ac_content		= $('#ac_content'),
$title			= $ac_content.find('h1'),
$menu			= $ac_content.find('.ac_menu'),
$mainNav		= $menu.find('ul:first'),
$menuItems		= $mainNav.children('li'),
totalItems		= $menuItems.length,
$ItemImages		= new Array();
</pre>
<p>We want to preload all the image, so let&#8217;s add all the image sources that we have in the href attributes of the link elements in the menu items, and also the one of the current image:</p>
<pre class="brush:js">
$menuItems.each(function(i) {
	$ItemImages.push($(this).children('a:first').attr('href'));
});
$ItemImages.push($ac_bgimage.attr('src'));
</pre>
<p>Then, let&#8217;s define our main function:</p>
<pre class="brush:js">
var Menu 			= (function(){
	var init				= function() {
		loadPage();
		initWindowEvent();
	},
	loadPage			= function() {
		/*
			1- loads the bg image and all the item images;
			2- shows the bg image;
			3- shows / slides out the menu;
			4- shows the menu items;
			5- initializes the menu items events
		 */
		$ac_loading.show(); //show loading status image
		$.when(loadImages()).done(function(){
			$.when(showBGImage()).done(function(){
				//hide the loading status image
				$ac_loading.hide();
				$.when(slideOutMenu()).done(function(){
						$.when(toggleMenuItems('up')).done(function(){
						initEventsSubMenu();
					});
				});
			});
		});
	},
	showBGImage			= function() {
		return $.Deferred(
		function(dfd) {
			//adjusts the dimensions of the image to fit the screen
			adjustImageSize($ac_bgimage);
			$ac_bgimage.fadeIn(1000, dfd.resolve);
		}
	).promise();
	},
	slideOutMenu		= function() {
		/* calculate new width for the menu */
		var new_w	= $(window).width() - $title.outerWidth(true);
		return $.Deferred(
		function(dfd) {
			//slides out the menu
			$menu.stop()
			.animate({
				width	: new_w + 'px'
			}, 700, dfd.resolve);
		}
	).promise();
	},
		/* shows / hides the menu items */
		toggleMenuItems		= function(dir) {
		return $.Deferred(
		function(dfd) {
			/*
			slides in / out the items. 
			different animation time for each one.
			*/
			$menuItems.each(function(i) {
						var $el_title	= $(this).children('a:first'),
							marginTop, opacity, easing;
						if(dir === 'up'){
							marginTop	= '0px';
							opacity		= 1;
							easing		= 'easeOutBack';
						}
						else if(dir === 'down'){
							marginTop	= '60px';
							opacity		= 0;
							easing		= 'easeInBack';
		}
				$el_title.stop()
				.animate({
									marginTop	: marginTop,
									opacity		: opacity
								 }, 200 + i * 200 , easing, function(){
					if(i === totalItems - 1)
						dfd.resolve();
				});
			});
		}
	).promise();
	},
	initEventsSubMenu	= function() {
		$menuItems.each(function(i) {
			var $item		= $(this), // the &lt;li&gt;
			$el_title	= $item.children('a:first'),
			el_image	= $el_title.attr('href'),
			$sub_menu	= $item.find('.ac_subitem'),
			$ac_close	= $sub_menu.find('.ac_close');
			
			/* user clicks on a menu item */
			$el_title.bind('click.Menu', function(e) {
					$.when(toggleMenuItems('down')).done(function(){
					openSubMenu($item, $sub_menu, el_image);
				});
				return false;
			});
			/* closes the submenu */
			$ac_close.bind('click.Menu', function(e) {
				closeSubMenu($sub_menu);
				return false;
			});
		});
	},
	openSubMenu			= function($item, $sub_menu, el_image) {
		$sub_menu.stop()
		.animate({
			height		: '400px',
			marginTop	: '-200px'
		}, 400, function() {
			//the bg image changes
			showItemImage(el_image);
		});
	},
	/* changes the background image */
	showItemImage		= function(source) {
		//if its the current one return
		if($ac_bgimage.attr('src') === source)
			return false;
				
		var $itemImage = $('&lt;img src="'+source+'" alt="Background" class="ac_bgimage"/&gt;');
		$itemImage.insertBefore($ac_bgimage);
		adjustImageSize($itemImage);
		$ac_bgimage.fadeOut(1500, function() {
			$(this).remove();
			$ac_bgimage = $itemImage;
		});
		$itemImage.fadeIn(1500);
	},
	closeSubMenu		= function($sub_menu) {
		$sub_menu.stop()
		.animate({
			height		: '0px',
			marginTop	: '0px'
		}, 400, function() {
			//show items
						toggleMenuItems('up');
		});
	},
	/*
	on window resize, ajust the bg image dimentions,
	and recalculate the menus width
	*/
	initWindowEvent		= function() {
		/* on window resize set the width for the menu */
		$(window).bind('resize.Menu' , function(e) {
			adjustImageSize($ac_bgimage);
			/* calculate new width for the menu */
			var new_w	= $(window).width() - $title.outerWidth(true);
			$menu.css('width', new_w + 'px');
		});
	},
	/* makes an image "fullscreen" and centered */
	adjustImageSize		= function($img) {
		var w_w	= $(window).width(),
		w_h	= $(window).height(),
		r_w	= w_h / w_w,
		i_w	= $img.width(),
		i_h	= $img.height(),
		r_i	= i_h / i_w,
		new_w,new_h,
		new_left,new_top;
			
		if(r_w &gt; r_i){
			new_h	= w_h;
			new_w	= w_h / r_i;
		}
		else{
			new_h	= w_w * r_i;
			new_w	= w_w;
		}
			
		$img.css({
			width	: new_w + 'px',
			height	: new_h + 'px',
			left	: (w_w - new_w) / 2 + 'px',
			top		: (w_h - new_h) / 2 + 'px'
		});
	},
	/* preloads a set of images */
	loadImages			= function() {
		return $.Deferred(
		function(dfd) {
			var total_images 	= $ItemImages.length,
			loaded			= 0;
			for(var i = 0; i &lt; total_images; ++i){
				$('&lt;img/&gt;').load(function() {
					++loaded;
					if(loaded === total_images)
						dfd.resolve();
				}).attr('src' , $ItemImages[i]);
			}
		}
	).promise();
	};
		
	return {
		init : init
	};
})();

/*
call the init method of Menu
 */
Menu.init();
</pre>
<p>And that&#8217;s all! I hope you enjoyed the tutorial and find it useful!</p>
<p><a class="demo" href="http://tympanus.net/Tutorials/AnimatedContentMenu/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Tutorials/AnimatedContentMenu/AnimatedContentMenu.zip">Download source</a></p>
<div class="googlead"><!-- wp_ad_camp_1 --></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2011/03/09/animated-content-menu/feed/</wfw:commentRss>
		<slash:comments>178</slash:comments>
		</item>
		<item>
		<title>Music Portfolio Template with HTML5 and jQuery</title>
		<link>http://tympanus.net/codrops/2010/07/26/music-portfolio-template/</link>
		<comments>http://tympanus.net/codrops/2010/07/26/music-portfolio-template/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:30:41 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Playground]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[carousel]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[draggable]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=2659</guid>
		<description><![CDATA[Today we want to share a music portfolio template with you. The idea is to create an artist portfolio with a discography line up and HTML5 audio player jPlayer. The artist albums are shown using the jCarousel plugin and the user can add song samples to the play list and reorder the songs by dragging [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://tympanus.net/Development/MusicPortfolioTemplate/" target="_blank"><img class="aligncenter size-full wp-image-2661" title="musicportfoliotemplate" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/uploads/2010/07/musicportfoliotemplate.jpg" alt="" width="580" height="315" /></a></p>
<p>Today we want to share a music portfolio template with you. The idea is to create an artist portfolio with a discography line up and HTML5 audio player <a href="http://www.happyworm.com/jquery/jplayer/">jPlayer</a>. The artist albums are shown using the <a href="http://sorgalla.com/jcarousel/">jCarousel plugin</a> and the user can add song samples to the play list and reorder the songs by dragging them.</p>
<p>The samples used are from the talented Ivan Chew at <a href="http://ccmixter.org/people/ramblinglibrarian/profile">ccmixter.org</a>. The original images come from <a href="http://www.flickr.com/photos/rickharris/">Rick Harris at Flickr</a>. All the albums are fictitious and are only shown for demonstration purposes. Any resemblance to existing bands or artists are unintended. </p>
<p>We hope you like this template and find it useful!</p>
<p><a class="demo" href="http://tympanus.net/Development/MusicPortfolioTemplate/" target="_blank">View demo</a><a class="download" href="http://tympanus.net/Development/MusicPortfolioTemplate/MusicPortfolioTemplate.zip">Download source</a></p>
<div class="ct-ad-article-wrapper ct-ad-article-wrapper-in"><div class="ct-ad-article"><img class="ct-ad-img" src="http://codropspz.tympanus.netdna-cdn.com/codrops/wp-content/themes/codropstheme02/images/advertisement.jpg" /><div id="bsap_1279993" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div></div></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2010/07/26/music-portfolio-template/feed/</wfw:commentRss>
		<slash:comments>83</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 10/19 queries in 0.010 seconds using disk: basic
Content Delivery Network via codropspz.tympanus.netdna-cdn.com

 Served from: tympanus.net @ 2013-05-25 18:50:47 by W3 Total Cache -->