<?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>Papermashup.com</title>
	<atom:link href="http://papermashup.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://papermashup.com</link>
	<description>Tutorials :: jQuery :: PHP :: CSS :: HTML5 :: Papermashup.com</description>
	<lastBuildDate>Fri, 08 Mar 2013 10:48:38 +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>Gauge Bootstrap Theme</title>
		<link>http://papermashup.com/gauge-bootstrap-theme/</link>
		<comments>http://papermashup.com/gauge-bootstrap-theme/#comments</comments>
		<pubDate>Sun, 03 Mar 2013 16:38:30 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Bootstrap Themes]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=3099</guid>
		<description><![CDATA[I&#8217;ve been super busy over the last few weeks, and one of the things i&#8217;ve been working on is a theme for Twitter bootstrap. It includes the following features and is available for just $15! If you&#8217;ve not used Bootstrap &#8230; <br/> <a href="http://papermashup.com/gauge-bootstrap-theme/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been super busy over the last few weeks, and one of the things i&#8217;ve been working on is a theme for <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter bootstrap</a>. It includes the following features and is available for just $15! If you&#8217;ve not used Bootstrap you&#8217;re missing out, it takes all the heavy lifting out of frontend development.</p>
<p><img src="http://papermashup.com/wp-content/uploads/gauge-theme.png" alt="gauge-theme" width="640" height="696" class="alignnone size-full wp-image-3124" /></p>
<p><a href="http://papermashup.com/bootstrap-themes/demos/gauge/" target="_blank">
<div style="width:583px; margin:0 auto; padding:20px;"></a></p>
<p><a href="http://papermashup.com/bootstrap-themes/demos/gauge/" target="_blank"><img src="http://papermashup.com/wp-content/uploads/live-preview.png" style="padding:0; float:left; margin-top:10px; height:75px; margin-right:15px; border:0;" alt="live-preview" width="284" height="75"></a></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="padding:0; margin:0; float:left;border:0; width:284px!important; height:75px;"><input type="image" src="http://papermashup.com/wp-content/uploads/15-buy.png" border="0" name="submit" alt="PayPal — The safer, easier way to pay online."><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="V2TFH9JVWD7FC"><img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"></form>
<div class="clear"></div>
</div>
<h3>Features</h3>
<p> &#8211; Flot Charts<br />
 &#8211; Dynamic jQuery Gauges using Easy Pie Charts<br />
 &#8211; Responsive One Page Theme<br />
 &#8211; Mini Bar, Line and Pie Charts<br />
 &#8211; Signup Modal Support<br />
 &#8211; Font Awesome 3.0.1<br />
 &#8211; <a href="https://wrapbootstrap.com/?ref=papermashup">More Features</a></p>
<p><strong>Gauge Admin One Page Responsive Theme</strong> comes complete with awesome charts gauges and micro bar charts. Gauge is a super clean elegant theme suitable for displaying your dashboard, app, business, portfolio or service. Created using  the latest HTML5 and CSS3 features. With full responsive design which works great on any device.</p>
<h3>Sign in dropdown</h3>
<p><img src="http://papermashup.com/wp-content/uploads/nav.png" alt="nav" width="640" height="478" class="alignnone size-full wp-image-3114" /></p>
<h3>Sign up Modal</h3>
<p><img src="http://papermashup.com/wp-content/uploads/signup.png" alt="signup" width="640" height="520" class="alignnone size-full wp-image-3115" /></p>
<h3>Complete pricing table</h3>
<p><img src="http://papermashup.com/wp-content/uploads/pricing.png" alt="pricing" width="640" height="514" class="alignnone size-full wp-image-3117" /></p>
<div style="width:583px; margin:0 auto; padding:20px;">
<p><a href="http://papermashup.com/bootstrap-themes/demos/gauge/" target="_blank"><img src="http://papermashup.com/wp-content/uploads/live-preview.png" style="padding:0; float:left; margin-top:10px; height:75px; margin-right:15px; border:0;" alt="live-preview" width="284" height="75"></a></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="padding:0; margin:0; float:left;border:0; width:284px!important; height:75px;"><input type="image" src="http://papermashup.com/wp-content/uploads/15-buy.png" border="0" name="submit" alt="PayPal — The safer, easier way to pay online."><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="V2TFH9JVWD7FC"><img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"></form>
<div class="clear"></div>
</div>
<p style="font-size:12px; text-align:center; margin-top:15px; color:#999;">Once your order has been sent you will receive an email with the theme files attached within 8 hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/gauge-bootstrap-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create an Animated Timeline with jQuery</title>
		<link>http://papermashup.com/create-an-animated-timeline-with-jquery/</link>
		<comments>http://papermashup.com/create-an-animated-timeline-with-jquery/#comments</comments>
		<pubDate>Wed, 30 Jan 2013 08:30:35 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Free]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Learn]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=3055</guid>
		<description><![CDATA[I&#8217;ve been meaning to write about this plugin for some time but never got around to it until now! This great plugin written by csslab.cl helps you beautifully present timelines and has support for both horizontal and vertical layouts. jQuery &#8230; <br/> <a href="http://papermashup.com/create-an-animated-timeline-with-jquery/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been meaning to write about this plugin for some time but never got around to it until now! This great plugin written by csslab.cl helps you beautifully present timelines and has support for both horizontal and vertical layouts.</p>
<h3>jQuery Timelinr</h3>
<p>After including the timelinr.js plugin file, to get it working all you need to do is call the basic method below and include the setup HTML at the bottom of the page. Checkout the <a href="http://papermashup.com/demos/jquery-timeline/">horizontal and vertical demos</a></p>
<p><img alt="chrome-book" src="http://papermashup.com/wp-content/uploads/chrome-book.png" width="640" height="300" /></p>
<pre class="brush: jscript; title: ;">

$(function(){
   $().timelinr();
});

</pre>
<pre class="brush: jscript; title: ;">

$(function(){
   $().timelinr({
      orientation: 'horizontal',
      // value: horizontal | vertical, default to horizontal
      containerDiv: '#timeline',
      // value: any HTML tag or #id, default to #timeline
      datesDiv: '#dates',
      // value: any HTML tag or #id, default to #dates
      datesSelectedClass: 'selected',
      // value: any class, default to selected
      datesSpeed: 'normal',
      // value: integer between 100 and 1000 (recommended) or 'slow', 'normal' or 'fast'; default to normal
      issuesDiv : '#issues',
      // value: any HTML tag or #id, default to #issues
      issuesSelectedClass: 'selected',
      // value: any class, default to selected
      issuesSpeed: 'fast',
      // value: integer between 100 and 1000 (recommended) or 'slow', 'normal' or 'fast'; default to fast
      issuesTransparency: 0.2,
      // value: integer between 0 and 1 (recommended), default to 0.2
      issuesTransparencySpeed: 500,
      // value: integer between 100 and 1000 (recommended), default to 500 (normal)
      prevButton: '#prev',
      // value: any HTML tag or #id, default to #prev
      nextButton: '#next',
      // value: any HTML tag or #id, default to #next
      arrowKeys: 'false',
      // value: true/false, default to false
      startAt: 1,
      // value: integer, default to 1 (first)
      autoPlay: 'false',
      // value: true | false, default to false
      autoPlayDirection: 'forward',
      // value: forward | backward, default to forward
      autoPlayPause: 2000
      // value: integer (1000 = 1 seg), default to 2000 (2segs)&lt; });
   });

</pre>
<h3>The HTML</h3>
<pre class="brush: xml; title: ;">

&lt;div id=&quot;timeline&quot;&gt;
   &lt;ul id=&quot;dates&quot;&gt;
      &lt;li&gt;&lt;a href=&quot;#2013&quot;&gt;2013&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2014&quot;&gt;2014&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;
   &lt;ul id=&quot;issues&quot;&gt;
      &lt;li id=&quot;2013&quot;&gt;
&lt;h1&gt;Title&lt;/h1&gt;
         &lt;p&gt;Lorem ipsum.&lt;/p&gt;
      &lt;/li&gt;
      &lt;li id=&quot;2014&quot;&gt;
         &lt;p&gt;Lorem ipsum.&lt;/p&gt;
      &lt;/li&gt;
   &lt;/ul&gt;
   &lt;!-- optional buttons --&gt;
   &lt;a href=&quot;#&quot; id=&quot;next&quot;&gt;Next&lt;/a&gt;
   &lt;a href=&quot;#&quot; id=&quot;prev&quot;&gt;Previous&lt;/a&gt;
&lt;/div&gt;

</pre>
<p><a href="http://papermashup.com/demos/jquery-timeline/"><img class="alignnone size-full wp-image-23" title="demo" alt="Demo" src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" /></a> <a href="http://papermashup.com/demos/jquery-timeline/jquery-timeline.zip"><img class="alignnone size-full wp-image-24" title="download" alt="Download" src="http://papermashup.com/wp-content/uploads/2009/01/download.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/create-an-animated-timeline-with-jquery/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Getting started with Responsive and Adaptive layouts</title>
		<link>http://papermashup.com/getting-started-with-responsive-and-adaptive-layouts/</link>
		<comments>http://papermashup.com/getting-started-with-responsive-and-adaptive-layouts/#comments</comments>
		<pubDate>Mon, 28 Jan 2013 08:30:36 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Learn]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Tools]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=3024</guid>
		<description><![CDATA[There is no one-size-fits-all approach. Each project has its own focus, requirements and audience. This article will hopefully help you make the best decision for your project by outlining the advantages and disadvantages of each solution. Jeffrey Veen said: &#8220;Day &#8230; <br/> <a href="http://papermashup.com/getting-started-with-responsive-and-adaptive-layouts/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>There is no one-size-fits-all approach. Each project has its own focus, requirements and audience. This article will hopefully help you make the best decision for your project by outlining the advantages and disadvantages of each solution. Jeffrey Veen said: <em>&#8220;Day by day, the number of devices, platforms, and browsers that need to work with your site grows. Responsive web design represents a fundamental shift in how we’ll build websites for the decade to come.&#8221;</em></p>
<h3>What is Responsive web design?</h3>
<p>Responsive design is all about building a project that will respond and adapt to any number of user devices. since the early days of CSS style sheets have enjoyed to some extent device awareness through media types. If you&#8217;ve ever coded a print style sheet, chances are you&#8217;re already familiar with the concept:</p>
<pre class="brush: css; title: ;">

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; media=&quot;screen&quot; /&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;print.css&quot; media=&quot;print&quot; /&gt;

</pre>
<p><img class="alignnone size-large wp-image-3026" alt="The Next Web" src="http://papermashup.com/wp-content/uploads/Screen-Shot-2013-01-20-at-15.06.05-1024x320.png" width="640" height="200" /> <a href="http://mediaqueri.es/">View more examples at http://mediaqueri.es</a></p>
<h3>Top 4 Frameworks for building a responsive site.</h3>
<p>1. <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> &#8211; Simple, fluid HTML/CSS/JS framework from Twitter.<br />
2. <a href="http://goldilocksapproach.com/">Goldilocks</a> &#8211; Fixed width for medium &amp; large screens, fluid single column for small devices.<br />
3. <a href="http://foundation.zurb.com/">Foundation</a> &#8211; Flexible 6 and 12-grid framework from Zurb.<br />
4. <a href="http://www.getskeleton.com/">Skeleton</a> &#8211; Minimal responsive framework. Includes WordPress theme.</p>
<h3>Adaptive vs Responsive</h3>
<p>The adaptive layout is based on a simple idea. instead of using percentages we give our layout fixed sizes but adapt these sizes depending on the width of the browser/viewport, this then creates a layout with different &#8220;break points&#8221;. The responsive layout is a mix between a fluid and adaptive layout. It uses the relative units of the fluid layout and the break points of the adaptive.</p>
<p><img class="alignnone size-full wp-image-3042" alt="Zurb Foundation Layouts" src="http://papermashup.com/wp-content/uploads/Screen-Shot-2013-01-20-at-17.12.41.png" width="640" height="auto" /></p>
<h3>Getting Started</h3>
<p>Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.</p>
<pre class="brush: css; title: ;">

/* Large desktop */
@media (min-width: 1200px) { ... }

/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }

/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }

/* Landscape phones and down */
@media (max-width: 480px) { ... }

</pre>
<h3>Flexible Images</h3>
<p>There are a number of techniques to resize images proportionately, the most popular option, noted in Ethan Marcotte’s article on fluid images but first experimented with by Richard Rutter, is to use CSS&#8217;s max-width for an easy fix as shown below.</p>
<pre class="brush: css; title: ;">

img { max-width: 100% }

</pre>
<p>We now have web browsers on Playstation&#8217;s and Xbox&#8217;s, and even some television are able to connect to internet. Maybe tomorrow you we&#8217;ll have a web browser in our coffee machine, who knows! If we use responsive layouts to optimise for smaller screens, we can also use them to optimise for bigger ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/getting-started-with-responsive-and-adaptive-layouts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Particle Animation with Javascript and Canvas</title>
		<link>http://papermashup.com/particle-animation-with-javascript-and-canvas/</link>
		<comments>http://papermashup.com/particle-animation-with-javascript-and-canvas/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 08:30:57 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Free]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=3014</guid>
		<description><![CDATA[Here&#8217;s a great example of particle animation using the HTML5 canvas. It&#8217;s important to note this uses the 2D canvas instead of using the cool but not widely supported WebGL 3D context. checkout the demo. In the demo you&#8217;ll notice &#8230; <br/> <a href="http://papermashup.com/particle-animation-with-javascript-and-canvas/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a great example of particle animation using the HTML5 canvas. It&#8217;s important to note this uses the 2D canvas instead of using the cool but not widely supported WebGL 3D context. checkout the <a href="http://papermashup.com/demos/html5-particle-animation/">demo</a>.</p>
<p>In the demo you&#8217;ll notice the whole space containing the particles rotates slowly around a vertical axis giving the animation a 3d feel. by tinkering with the code below you should be able to come up with some interesting experiments. The origina code is based on an example by Rectangle World</p>
<pre class="brush: jscript; title: ;">

(function() {

window.addEventListener(&quot;load&quot;, windowLoadHandler, false);
var sphereRad = 280;
//for debug messages
var Debugger = function() { };
Debugger.log = function(message) {
	try {
		console.log(message);
	}
	catch (exception) {
		return;
	}
}

function windowLoadHandler() {
	canvasApp();
}

function canvasSupport() {
	return Modernizr.canvas;
}

function canvasApp() {
	if (!canvasSupport()) {
		return;
	}

	var theCanvas = document.getElementById(&quot;particles&quot;);
	var context = theCanvas.getContext(&quot;2d&quot;);

	var displayWidth;
	var displayHeight;
	var timer;
	var wait;
	var count;
	var numToAddEachFrame;
	var particleList;
	var recycleBin;
	var particleAlpha;
	var r,g,b;
	var fLen;
	var m;
	var projCenterX;
	var projCenterY;
	var zMax;
	var turnAngle;
	var turnSpeed;
	var sphereCenterX, sphereCenterY, sphereCenterZ;
	var particleRad;
	var zeroAlphaDepth;
	var randAccelX, randAccelY, randAccelZ;
	var gravity;
	var rgbString;
	//we are defining a lot of variables used in the screen update functions globally so that they don't have to be redefined every frame.
	var p;
	var outsideTest;
	var nextParticle;
	var sinAngle;
	var cosAngle;
	var rotX, rotZ;
	var depthAlphaFactor;
	var i;
	var theta, phi;
	var x0, y0, z0;

	init();

	function init() {
		wait = 1;
		count = wait - 1;
		numToAddEachFrame = 5;

		//particle color
		r = 150;
		g = 3;
		b = 177;

		rgbString = &quot;rgba(&quot;+r+&quot;,&quot;+g+&quot;,&quot;+b+&quot;,&quot;; //partial string for color which will be completed by appending alpha value.
		particleAlpha = 0.9; //maximum alpha

		displayWidth = theCanvas.width;
		displayHeight = theCanvas.height;

		fLen = 100; //represents the distance from the viewer to z=0 depth.

		//projection center coordinates sets location of origin
		projCenterX = displayWidth/2;
		projCenterY = displayHeight/2;

		//we will not draw coordinates if they have too large of a z-coordinate (which means they are very close to the observer).
		zMax = fLen-2;

		particleList = {};
		recycleBin = {};

		//random acceleration factors - causes some random motion
		randAccelX = 0.1;
		randAccelY = 0.1;
		randAccelZ = 0.1;

		gravity = -0; //try changing to a positive number (not too large, for example 0.3), or negative for floating upwards.

		particleRad = 5;

		sphereCenterX = 0;
		sphereCenterY = 0;
		sphereCenterZ = -3 - sphereRad;

		//alpha values will lessen as particles move further back, causing depth-based darkening:
		zeroAlphaDepth = -750;

		turnSpeed = 2*Math.PI/2000; //the sphere will rotate at this speed (one complete rotation every 1600 frames).
		turnAngle = 0; //initial angle

		timer = setInterval(onTimer, 10/24);
	}

	function onTimer() {
		//if enough time has elapsed, we will add new particles.
		count++;
			if (count &gt;= wait) {

			count = 0;
			for (i = 0; i &lt; numToAddEachFrame; i++) {
				theta = Math.random()*2*Math.PI;
				phi = Math.acos(Math.random()*2-1);
				x0 = sphereRad*Math.sin(phi)*Math.cos(theta);
				y0 = sphereRad*Math.sin(phi)*Math.sin(theta);
				z0 = sphereRad*Math.cos(phi);

				//We use the addParticle function to add a new particle. The parameters set the position and velocity components.
				//Note that the velocity parameters will cause the particle to initially fly outwards away from the sphere center (after
				//it becomes unstuck).
				var p = addParticle(x0, sphereCenterY + y0, sphereCenterZ + z0, 0.005*x0, 0.002*y0, 0.002*z0);

				//we set some &quot;envelope&quot; parameters which will control the evolving alpha of the particles.
				p.attack = 120;
				p.hold = 120;
				p.decay = 460;
				p.initValue = 0;
				p.holdValue = particleAlpha;
				p.lastValue = 0;

				//the particle will be stuck in one place until this time has elapsed:
				p.stuckTime = 120 + Math.random()*20;

				p.accelX = 0;
				p.accelY = gravity;
				p.accelZ = 0;
			}
		}

		//update viewing angle
		turnAngle = (turnAngle + turnSpeed) % (2*Math.PI);
		sinAngle = Math.sin(turnAngle);
		cosAngle = Math.cos(turnAngle);

		//background fill
		context.fillStyle = &quot;#000000&quot;;
		context.fillRect(0,0,displayWidth,displayHeight);

		//update and draw particles
		p = particleList.first;
		while (p != null) {
			//before list is altered record next particle
			nextParticle = p.next;

			//update age
			p.age++;

			//if the particle is past its &quot;stuck&quot; time, it will begin to move.
			if (p.age &gt; p.stuckTime) {
				p.velX += p.accelX + randAccelX*(Math.random()*2 - 1);
				p.velY += p.accelY + randAccelY*(Math.random()*2 - 1);
				p.velZ += p.accelZ + randAccelZ*(Math.random()*2 - 1);

				p.x += p.velX;
				p.y += p.velY;
				p.z += p.velZ;
			}

			/*
			We are doing two things here to calculate display coordinates.
			The whole display is being rotated around a vertical axis, so we first calculate rotated coordinates for
			x and z (but the y coordinate will not change).
			Then, we take the new coordinates (rotX, y, rotZ), and project these onto the 2D view plane.
			*/
			rotX = cosAngle*p.x + sinAngle*(p.z - sphereCenterZ);
			rotZ = -sinAngle*p.x + cosAngle*(p.z - sphereCenterZ) + sphereCenterZ;
			m = fLen/(fLen - rotZ);
			p.projX = rotX*m + projCenterX;
			p.projY = p.y*m + projCenterY;

			//update alpha according to envelope parameters.
			if (p.age &lt; p.attack+p.hold+p.decay) {
				if (p.age &lt; p.attack) {
					p.alpha = (p.holdValue - p.initValue)/p.attack*p.age + p.initValue;
				}
				else if (p.age &lt; p.attack+p.hold) {
					p.alpha = p.holdValue;
				}
				else if (p.age &lt; p.attack+p.hold+p.decay) {
					p.alpha = (p.lastValue - p.holdValue)/p.decay*(p.age-p.attack-p.hold) + p.holdValue;
				}
			}
			else {
				p.dead = true;
			}

			//see if the particle is still within the viewable range.
			if ((p.projX &gt; displayWidth)||(p.projX&lt;0)||(p.projY&lt;0)||(p.projY&gt;displayHeight)||(rotZ&gt;zMax)) {
				outsideTest = true;
			}
			else {
				outsideTest = false;
			}

			if (outsideTest||p.dead) {
				recycle(p);
			}

			else {
				//depth-dependent darkening
				depthAlphaFactor = (1-rotZ/zeroAlphaDepth);
				depthAlphaFactor = (depthAlphaFactor &gt; 1) ? 1 : ((depthAlphaFactor&lt;0) ? 0 : depthAlphaFactor);
				context.fillStyle = rgbString + depthAlphaFactor*p.alpha + &quot;)&quot;;

				//draw
				context.beginPath();
				context.arc(p.projX, p.projY, m*particleRad, 0, 2*Math.PI, false);
				context.closePath();
				context.fill();
			}

			p = nextParticle;
		}
	}

	function addParticle(x0,y0,z0,vx0,vy0,vz0) {
		var newParticle;
		var color;

		//check recycle bin for available drop:
		if (recycleBin.first != null) {
			newParticle = recycleBin.first;
			//remove from bin
			if (newParticle.next != null) {
				recycleBin.first = newParticle.next;
				newParticle.next.prev = null;
			}
			else {
				recycleBin.first = null;
			}
		}
		//if the recycle bin is empty, create a new particle (a new ampty object):
		else {
			newParticle = {};
		}

		//add to beginning of particle list
		if (particleList.first == null) {
			particleList.first = newParticle;
			newParticle.prev = null;
			newParticle.next = null;
		}
		else {
			newParticle.next = particleList.first;
			particleList.first.prev = newParticle;
			particleList.first = newParticle;
			newParticle.prev = null;
		}

		//initialize
		newParticle.x = x0;
		newParticle.y = y0;
		newParticle.z = z0;
		newParticle.velX = vx0;
		newParticle.velY = vy0;
		newParticle.velZ = vz0;
		newParticle.age = 0;
		newParticle.dead = false;
		if (Math.random() &lt; 0.5) {
			newParticle.right = true;
		}
		else {
			newParticle.right = false;
		}
		return newParticle;
	}

	function recycle(p) {
		//remove from particleList
		if (particleList.first == p) {
			if (p.next != null) {
				p.next.prev = null;
				particleList.first = p.next;
			}
			else {
				particleList.first = null;
			}
		}
		else {
			if (p.next == null) {
				p.prev.next = null;
			}
			else {
				p.prev.next = p.next;
				p.next.prev = p.prev;
			}
		}
		//add to recycle bin
		if (recycleBin.first == null) {
			recycleBin.first = p;
			p.prev = null;
			p.next = null;
		}
		else {
			p.next = recycleBin.first;
			recycleBin.first.prev = p;
			recycleBin.first = p;
			p.prev = null;
		}
	}
}
var asd = 12;

})();

</pre>
<p><a href="http://papermashup.com/demos/html5-particle-animation/"><img alt="demo" src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" /></a> <a href="http://papermashup.com/demos/html5-particle-animation/html5-particle-animation.zip"><img alt="download" src="http://papermashup.com/wp-content/uploads/2009/01/download.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/particle-animation-with-javascript-and-canvas/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Prototype iPhone apps with Javascript and HTML</title>
		<link>http://papermashup.com/prototype-iphone-apps-with-javascript-and-html/</link>
		<comments>http://papermashup.com/prototype-iphone-apps-with-javascript-and-html/#comments</comments>
		<pubDate>Wed, 23 Jan 2013 08:30:13 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2985</guid>
		<description><![CDATA[Ratchet is a great way of prototyping iPhone apps and has a whole host of functionality. It also takes advantage of Push.js which when connecting your pages allows you to create a prototype that feels like a real app when &#8230; <br/> <a href="http://papermashup.com/prototype-iphone-apps-with-javascript-and-html/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>Ratchet is a great way of prototyping iPhone apps and has a whole host of functionality. It also takes advantage of Push.js which when connecting your pages allows you to create a prototype that feels like a real app when you save it to your phone. Push.js basically loads in the pages and animates between them much like the animation effects on native IOS apps. You&#8217;ll need to deploy the code on a server to get push working. You can download and <a href="http://maker.github.com/ratchet/">check out Ratchet here.</a></p>
<h3>Getting Started</h3>
<p>Ratchet is not a complicated framework only for advanced developers. You can get up and running with it in minutes. It requires zero knowledge of any iOS programming and really only the tiniest bit of JavaScript.</p>
<p>1. All fixed bars (.bar-title, .bar-tab, .bar-header-secondary, .bar-footer) should always be the first thing in the of the page. This is really important!</p>
<p>2. Anything that&#8217;s not a .bar- should be put in a div with the class &#8220;content&#8221;. Put this div after the bars in the tag. The .content div is what actually scrolls in a Ratchet prototype.</p>
<p>3. They&#8217;re included in the template.html page included in the download, but make sure they stay in the page. They are important to Ratchet working just right.</p>
<h3>The Title Bar</h3>
<p>The header is the container element for the title.</p>
<pre class="brush: xml; title: ;">

&lt;header class=&quot;bar-title&quot;&gt;
  &lt;h1 class=&quot;title&quot;&gt;Papermashup&lt;/h1&gt;
&lt;/header&gt;

</pre>
<div align="center"><img alt="" src="http://papermashup.com/wp-content/uploads/Screen-Shot-2013-01-19-at-21.56.47.png" /></div>
<h3>Adding A Popover</h3>
<p>Popovers are designed to only fire from the title bar. Set the value of the title href to the id of a popover as shown below:</p>
<pre class="brush: xml; title: ;">

&lt;!-- The Header Title Bar --&gt;

&lt;header class=&quot;bar-title&quot;&gt;
  &lt;a href=&quot;#myPopover&quot;&gt;
    &lt;h1 class=&quot;title&quot;&gt;Title&lt;/h1&gt;
  &lt;/a&gt;
&lt;/header&gt;

&lt;!-- The Popover --&gt;

&lt;div id=&quot;myPopover&quot; class=&quot;popover&quot;&gt;
  &lt;header class=&quot;popover-header&quot;&gt;
    &lt;a class=&quot;button&quot; href=&quot;#&quot;&gt;
      Left
    &lt;/a&gt;
    &lt;h3 class=&quot;title&quot;&gt;Popover title&lt;/h3&gt;
    &lt;a class=&quot;button&quot; href=&quot;#&quot;&gt;
      Right
    &lt;/a&gt;
  &lt;/header&gt;
  &lt;ul class=&quot;list&quot;&gt;
    &lt;li&gt;Item1&lt;/li&gt;
    &lt;li&gt;Item2&lt;/li&gt;
    &lt;li&gt;Item3&lt;/li&gt;
    &lt;li&gt;Item4&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

</pre>
<div align="center"><img alt="" src="http://papermashup.com/wp-content/uploads/Screen-Shot-2013-01-19-at-21.38.11.png" /></div>
<h3>Slider</h3>
<p>The slider can be used for any type of content but it works great with images.</p>
<pre class="brush: xml; title: ;">

&lt;div class=&quot;slider&quot;&gt;
  &lt;ul&gt;
    &lt;li&gt;
      &lt;img src=&quot;img/slide1.jpg&quot;&gt;
      &lt;span class=&quot;slide-text&quot;&gt;← Slide me&lt;/span&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;img src=&quot;img/slide2.jpg&quot;&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;img src=&quot;img/slide3.jpg&quot;&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

</pre>
<div align="center"><img alt="" src="http://papermashup.com/wp-content/uploads/Screen-Shot-2013-01-19-at-21.40.57.png" /></div>
<h3>Linking Pages with Push.js</h3>
<p>No working iPhone app prototype would be any good without the standard iPhone page transition. Fortunately the Push.js file takes care of this for you when you link pages together. You can even set up different transitions: without writing any JavaScript for example:</p>
<pre class="brush: xml; title: ;">

&lt;a href=&quot;page-one.html&quot; data-transition=&quot;fade&quot;&gt;One&lt;/a&gt;
&lt;a href=&quot;page-two.html&quot; data-transition=&quot;slide-in&quot;&gt;Two&lt;/a&gt;

</pre>
<h3>The Conclusion</h3>
<p>Ratchet is an amazing tool to put together prototypes. It&#8217;s effortless to get started with and i&#8217;d recommend it to anyone wanting to build an iPhone app demo. We&#8217;ve just touched the surface of what Ratchet can bo but it&#8217;s truly awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/prototype-iphone-apps-with-javascript-and-html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Awesome Dashboard Gauges with Javascript</title>
		<link>http://papermashup.com/awesome-dashboard-gauges-with-javascript/</link>
		<comments>http://papermashup.com/awesome-dashboard-gauges-with-javascript/#comments</comments>
		<pubDate>Mon, 21 Jan 2013 08:30:54 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Analytics]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2971</guid>
		<description><![CDATA[Data visualisation techniques are ever evolving, and I&#8217;d like to share a cool plugin I&#8217;ve been using for a while now, It&#8217;s based on the Raphaël library for vector drawing so it&#8217;s completely scalable and self-adjusting. You can track it &#8230; <br/> <a href="http://papermashup.com/awesome-dashboard-gauges-with-javascript/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>Data visualisation techniques are ever evolving, and I&#8217;d like to share a cool plugin I&#8217;ve been using for a while now, It&#8217;s based on the Raphaël library for vector drawing so it&#8217;s completely scalable and self-adjusting. You can track it on <a href="https://github.com/toorshia/justgage" target="_blank">Git Hub here</a> it&#8217;s called <a href="http://justgage.com/" target="_blank">JustGage</a> and allows you to add these awesome gauges to your site in minutes.</p>
<h3>The Code</h3>
<p>So once you&#8217;ve included the javascript plugin files, all you need to do is call the plugin as shown below. You&#8217;ll see that in the demo below we&#8217;re refreshing the data every 1.5 seconds and generating a random number but this could easily be fed with live data from say a database or ajax feed.</p>
<pre class="brush: jscript; title: ;">

      var g1, g2, g3;

      window.onload = function(){
        var g1 = new JustGage({
          id: &quot;g1&quot;,
          value: getRandomInt(0, 32),
          min: 0,
          max: 100,
          title: &quot;CPU&quot;,
          label: &quot;load&quot;,
          levelColorsGradient: false
        });

        var g2 = new JustGage({
          id: &quot;g2&quot;,
          value: getRandomInt(34, 65),
          min: 0,
          max: 100,
          title: &quot;RAM&quot;,
          label: &quot;load&quot;,
          levelColorsGradient: false
        });

        var g3 = new JustGage({
          id: &quot;g3&quot;,
          value: getRandomInt(66, 100),
          min: 0,
          max: 100,
          title: &quot;Network&quot;,
          label: &quot;connections&quot;,
          levelColorsGradient: false
        });

        setInterval(function() {
          g1.refresh(getRandomInt(0, 42));
          g2.refresh(getRandomInt(34, 65));
          g3.refresh(getRandomInt(66, 100));
        }, 1500);
      };

</pre>
<h3>The HTML</h3>
<p>Simply define the div elements where you want the gauges to be injected into and that&#8217;s it. This is just a quick introduction into how the gauges work, and there&#8217;s far more customisation that can be done.</p>
<pre class="brush: xml; title: ;">

    &lt;div id=&quot;g1&quot;&gt;&lt;/div&gt;
    &lt;div id=&quot;g2&quot;&gt;&lt;/div&gt;
    &lt;div id=&quot;g3&quot;&gt;&lt;/div&gt;

</pre>
<p><img alt="" src="http://papermashup.com/wp-content/uploads/Screen-Shot-2013-01-19-at-20.51.53.png" width="90%" /></p>
<p><a href="http://papermashup.com/demos/javascript-gauge/"><img class="alignnone size-full wp-image-23" title="demo" alt="Demo" src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" /></a> <a href="https://github.com/toorshia/justgage/archive/master.zip"><img class="alignnone size-full wp-image-24" title="download" alt="Download" src="http://papermashup.com/wp-content/uploads/2009/01/download.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/awesome-dashboard-gauges-with-javascript/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP GD generate an image with text and font embedding</title>
		<link>http://papermashup.com/php-gd-generate-an-image-with-text-and-font-embedding/</link>
		<comments>http://papermashup.com/php-gd-generate-an-image-with-text-and-font-embedding/#comments</comments>
		<pubDate>Fri, 18 Jan 2013 22:17:40 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2946</guid>
		<description><![CDATA[PHP isn&#8217;t limited to just generating HTML. It can also be used to create and manipulate image files in a variety of formats. I recently worked on a project where we had to generate an image for the user and &#8230; <br/> <a href="http://papermashup.com/php-gd-generate-an-image-with-text-and-font-embedding/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>PHP isn&#8217;t limited to just generating HTML. It can also be used to create and manipulate image files in a variety of formats. I recently worked on a project where we had to generate an image for the user and include their name flattened into it. It&#8217;s extremely easy to do with PHP. Admittedly the demo I&#8217;ve put together for this tutorial is rather extravagant! but it serves the purpose to explain how to use the PHP GD image library.</p>
<h3>The Code</h3>
<pre class="brush: php; title: ;">

// link to the font file no the server
$fontname = 'font/Capriola-Regular.ttf';
// controls the spacing between text
$i=30;
//JPG image quality 0-100
$quality = 85;

function create_image($user){

		global $fontname;	
		global $quality;
		$file = &quot;covers/&quot;.md5($user[0]['name'].$user[1]['name'].$user[2]['name']).&quot;.jpg&quot;;	
	
	// if the file already exists dont create it again just serve up the original	
	if (!file_exists($file)) {	
			
			// define the base image that we lay our text on
			$im = imagecreatefromjpeg(&quot;pass.jpg&quot;);
			
			// setup the text colours
			$color['grey'] = imagecolorallocate($im, 54, 56, 60);
			$color['green'] = imagecolorallocate($im, 55, 189, 102);
			
			// this defines the starting height for the text block
			$y = imagesy($im) - $height - 365;
			 
		// loop through the array and write the text	
		foreach ($user as $value){
			// center the text in our image - returns the x value
			$x = center_text($value['name'], $value['font-size']);	
			imagettftext($im, $value['font-size'], 0, $x, $y+$i, $color[$value['color']], $fontname,$value['name']);
			// add 32px to the line height for the next text block
			$i = $i+32;	
			
		}
			// create the image
			imagejpeg($im, $file, $quality);
			
	}
						
		return $file;	
}

function center_text($string, $font_size){

			global $fontname;

			$image_width = 800;
			$dimensions = imagettfbbox($font_size, 0, $fontname, $string);
			
			return ceil(($image_width - $dimensions[4]) / 2);				
}

	$user = array(
	
		array(
			'name'=&gt; 'Ashley Ford', 
			'font-size'=&gt;'27',
			'color'=&gt;'grey'),
			
		array(
			'name'=&gt; 'Technical Director',
			'font-size'=&gt;'16',
			'color'=&gt;'grey'),
			
		array(
			'name'=&gt; 'ashley[at]papermashup.com',
			'font-size'=&gt;'13',
			'color'=&gt;'green'
			)			
	);

// run the script to create the image
$filename = create_image($user);

</pre>
<h3>Running the code</h3>
<p>I&#8217;ve created two functions to make it as simple as possible. to run the code simply pass the $user array data to the function and it&#8217;ll save the new image in the folder &#8216;covers&#8217; on your server. The function returns the file url so you just need to echo it into an image tag as shown below. <a href="http://papermashup.com/demos/php-gd-image-and-text/">Check out the demo where you can create your own.</a></p>
<pre class="brush: php; title: ;">

$filename = create_image($user);

&lt;img src=&quot;&lt;?=$filename;?&gt;&quot; width=&quot;800&quot; height=&quot;600&quot;/&gt;

</pre>
<p><img src="http://papermashup.com/demos/php-gd-image-and-text/covers/5876ac3b8c9cc1848c6d8aa65ac17260.jpg" width="90%" height="auto"/></p>
<h3>GD vs ImageMagick</h2>
<p>On a performance level there&#8217;s not much between the two libraries ImageMagick has more options for example text rotation. you can find out more about ImageMagick <a href="http://www.imagemagick.org/" target="_blank">here</a> and <a href="http://php.net/manual/en/book.image.php" target="_blank">GD</a> here.</p>
<p><a href="http://papermashup.com/demos/php-gd-image-and-text/"><img src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="Demo" title="demo" class="alignnone size-full wp-image-23" /></a> <a href="http://papermashup.com/demos/php-gd-image-and-text/php-gd-image-and-text.zip"><img src="http://papermashup.com/wp-content/uploads/2009/01/download.png" alt="Download" title="download" class="alignnone size-full wp-image-24" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/php-gd-generate-an-image-with-text-and-font-embedding/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP Clever Caching</title>
		<link>http://papermashup.com/php-clever-caching/</link>
		<comments>http://papermashup.com/php-clever-caching/#comments</comments>
		<pubDate>Tue, 23 Oct 2012 20:45:32 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[caching]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2694</guid>
		<description><![CDATA[This clever bit of code checks if a page has been modified since it was last displayed and if it hasn&#8217;t, it sends a &#8220;304 not modified&#8221; header and exits, otherwise the content is loads as normal. Add the code &#8230; <br/> <a href="http://papermashup.com/php-clever-caching/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>This clever bit of code checks if a page has been modified since it was last displayed and if it hasn&#8217;t, it sends a &#8220;304 not modified&#8221; header and exits, otherwise the content is loads as normal. Add the code below to the top of each PHP page you want to apply it to. It&#8217;s especially useful if you serve static content via php and want it to be cached like ordinary HTML or CSS.</p>
<pre class="brush: php; title: ;">

//get the last-modified-date of this very file
$lastModified=filemtime(__FILE__);
//get a hash of this file
$etagFile = md5_file(__FILE__);
//get the HTTP_IF_MODIFIED_SINCE header if set
$ifModifiedSince=(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false);
//get the HTTP_IF_NONE_MATCH header if set
$etagHeader=(isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH']) : false);

//set last-modified header
header(&quot;Last-Modified: &quot;.gmdate(&quot;D, d M Y H:i:s&quot;, $lastModified).&quot; GMT&quot;);
//set etag-header
header(&quot;ETag: \&quot;$etagFile\&quot;&quot;);
//make sure caching is turned on
header('Cache-Control: public');

//check if page has changed If not send 304 header and exit
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])==$lastModified || $etagHeader == $etagFile)
{
       header(&quot;HTTP/1.1 304 Not Modified&quot;);
       exit;
}

echo &quot;Page last modified: &quot;.date(&quot;d.m.Y H:i:s&quot;,time());

</pre>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/php-clever-caching/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fade between a background image with CSS3</title>
		<link>http://papermashup.com/fade-between-a-background-image-with-css3/</link>
		<comments>http://papermashup.com/fade-between-a-background-image-with-css3/#comments</comments>
		<pubDate>Sun, 12 Aug 2012 16:34:07 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Free]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2675</guid>
		<description><![CDATA[Creating an image rollover is pretty easy with CSS. Give the element a background-image, Then absolute position a span element within the div. Then you just need to set the opacity of the span element to 0, and animate the &#8230; <br/> <a href="http://papermashup.com/fade-between-a-background-image-with-css3/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>Creating an image rollover is pretty easy with CSS. Give the element a <code>background-image</code>, Then absolute position a <code>span</code> element within the div. Then you just need to set the opacity of the span element to 0, and animate the opacity on <code>span:hover</code>. </p>
<p>This method uses a CSS sprite image, you could easily use two images but it&#8217;s best to save them in one file so we only make one HTTP request to the server.</p>
<h3>The Code</h3>
<pre class="brush: css; title: ;">
.button{
	height:47px;
	width:156px;
	background:url(images/hover_sprite.png) top center;
	position: relative;
	cursor:pointer;
}

.button span{
	position: absolute;
	top:0;
	left:0;
	height:47px;
	width:156px;
	background:url(images/hover_sprite.png) bottom center;
	opacity: 0;
	-webkit-transition: opacity 0.5s;
	-moz-transition:    opacity 0.5s;
	-o-transition:      opacity 0.5s;
}

.button span:hover{
	opacity: 1;
}
</pre>
<p><a href="http://papermashup.com/demos/css-sprite/"><img src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="" title="demo" class="alignnone size-full wp-image-23" /></a> <a href="http://papermashup.com/demos/css-sprite/css-sprite.zip"><img src="http://papermashup.com/wp-content/uploads/2009/01/download.png" alt="download" title="download" class="alignnone size-full wp-image-24" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/fade-between-a-background-image-with-css3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Show Google Plus&#8217;s &#8211; PHP function</title>
		<link>http://papermashup.com/google-plus-php-function/</link>
		<comments>http://papermashup.com/google-plus-php-function/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 07:22:23 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[Learn]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[popular]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Trends]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2658</guid>
		<description><![CDATA[Following on from yesterdays function to get likes and share data for a URL here&#8217;s a function to get Google Plus&#8217;s for any URL. The Code It&#8217;s worth pointing out you must have CURL enabled on your web server, I &#8230; <br/> <a href="http://papermashup.com/google-plus-php-function/">Continue reading</a>]]></description>
				<content:encoded><![CDATA[<p>Following on from yesterdays function to get likes and share data for a URL here&#8217;s a function to get Google Plus&#8217;s for any URL.</p>
<h3>The Code</h3>
<p>It&#8217;s worth pointing out you must have CURL enabled on your web server, I believe it&#8217;s enabled by default on PHP5 setups. Also the Key below <strong>Isn&#8217;t</strong> a unique API key you must leave the key as is to ensure the code works properly.</p>
<pre class="brush: php; title: ;">

function gplus_shares($url){

	// G+ DATA
	$ch = curl_init();  
	curl_setopt($ch, CURLOPT_URL, &quot;https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ&quot;);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_POSTFIELDS, '[{&quot;method&quot;:&quot;pos.plusones.get&quot;,&quot;id&quot;:&quot;p&quot;,
&quot;params&quot;:{&quot;nolog&quot;:true,&quot;id&quot;:&quot;' . $url . '&quot;,&quot;source&quot;:&quot;widget&quot;,&quot;userId&quot;:&quot;@viewer&quot;,&quot;groupId&quot;:&quot;@self&quot;},
&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;key&quot;:&quot;p&quot;,&quot;apiVersion&quot;:&quot;v1&quot;}]');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
	  
	$result = curl_exec ($ch);
	curl_close ($ch);
	return json_decode($result, true);
	
}


</pre>
<h3>Example Usage</h3>
<pre class="brush: php; title: ;">

$gplus = gplus_shares('https://facebook.com');

echo $gplus[0]['result']['metadata']['globalCounts']['count'];

</pre>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/google-plus-php-function/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Database Caching 15/24 queries in 0.047 seconds using disk: basic

 Served from: papermashup.com @ 2013-05-23 17:53:29 by W3 Total Cache -->