<?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>squaredesign</title>
	<atom:link href="http://squaredesign.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://squaredesign.com</link>
	<description>we turn great ideas into excellent websites</description>
	<lastBuildDate>Sun, 07 Aug 2011 12:32:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Build Guild turns 3!</title>
		<link>http://squaredesign.com/news/build-guild-turns-3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=build-guild-turns-3</link>
		<comments>http://squaredesign.com/news/build-guild-turns-3/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 12:53:35 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[News and Events]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=928</guid>
		<description><![CDATA[we're proud to be sponsoring the Build Guild for its 3rd anniversary!]]></description>
			<content:encoded><![CDATA[<p>A web meetup in Salem, MA called the <a href="http://salem.buildguild.org/">Build Guild</a> is turning three years old tomorrow, and squaredesign is glad to be sponsoring it.</p>
<p>What started out as a single meetup of a dozen (or two?) web builders, has turned into a network of events in sixteen different cities, uniting hundreds of web people for beverages and high-fives.</p>
<p>We personally owe an enormous debt of gratitude to this meetup; the relationships we&#8217;ve developer here over the years have led to both work and fun.</p>
<p>one super SquareFive<sup style="font-size:10px;vertical-align:top">TM</sup> to <a href="http://buildguild.org/">Build Guild</a> on turning 3, and many many more!</p>
<p>(also, we&#8217;re donating a raffle prize that should be well received)</p>
<p><img class="alignnone size-full wp-image-932" title="teaser" src="http://squaredesign.com/wp-content/blogs.dir/1/files/teaser.jpg" alt="" width="123" height="92" /></p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/news/build-guild-turns-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No Email</title>
		<link>http://squaredesign.com/crit/no-email/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=no-email</link>
		<comments>http://squaredesign.com/crit/no-email/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 12:18:51 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Design Critiques]]></category>
		<category><![CDATA[minus]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=755</guid>
		<description><![CDATA[icons rely on familiarity to convey a message beyond their miniscule dimensions.

a nitpick, but one of many aggregated flaws that tarnish Apple's Mail application.]]></description>
			<content:encoded><![CDATA[<div id="attachment_797" class="wp-caption alignleft" style="width: 250px"><a href="http://www.flickr.com/photos/markmorgantrinidad/5154357836/"><img class="size-medium wp-image-797 photo" title="5154357836_82c4b2d9aa" src="http://squaredesign.com/wp-content/blogs.dir/1/files/2011/04/5154357836_82c4b2d9aa-240x238.jpg" alt="" width="240" height="238" /></a><p class="wp-caption-text">&quot;No parking&quot; by Flickr user Mark Morgan (used with permission)</p></div>
<p>Apple is usually touted for their User Interface design, and rightfully so. Their focus on simplicity and empowering user intuition is unparalleled in their industry and beyond.</p>
<p>This is also why, when they make a gaffe, it gets a lot of attention. One thing that I think has slipped beneath the radar for too long is their Mail application.</p>
<p>Again, these flaws wouldn&#8217;t seem so egregious if they didn&#8217;t originate in Cupertino &#8211; one has to wonder if the internal decision makers (or Steve Jobs himself) even use Mail on the desktop anymore (or do they only see filtered messages gated by secretaries delivered via their iOS device?)</p>
<p><br class="clear" /></p>
<p><img class="alignright size-medium wp-image-774" title="MailScreenSnapz001" src="http://squaredesign.com/wp-content/blogs.dir/1/files/2011/04/MailScreenSnapz001-300x150.png" alt="" width="300" height="150" /></p>
<h3>Don&#8217;t Trash your Mail</h3>
<p>This stares me in the face every day. What does a circle with a slash mean?</p>
<p>In Europe, this means No Parking. In general, a Circle &amp; Slash means something is prohibited – a behavior, an item, a pet, etc. But in Mail, this represents &#8216;Delete.&#8217;</p>
<p>Why not a Trashcan? presumably, to prevent confusion with the Trashcan icon that appears to represent the Trash in the mailboxes list. Apple&#8217;s <a href="http://en.wikipedia.org/wiki/Apple_Computer,_Inc._v._Microsoft_Corporation">Patent dispute over the GUI</a> even upheld that the Trashcan icon was a uniquely created element and prohibited other Operating Systems from having &#8220;Trash.&#8221;</p>
<p>I&#8217;m not certain what the best representation of this would be; but I would hope that Apple would know.</p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/crit/no-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chuck and Friends</title>
		<link>http://squaredesign.com/crit/chuck-and-friends/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=chuck-and-friends</link>
		<comments>http://squaredesign.com/crit/chuck-and-friends/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 10:15:43 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Design Critiques]]></category>
		<category><![CDATA[plus]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=746</guid>
		<description><![CDATA[some thoughts on the industrial design of these Tonka toys.

don't let my son know that i play with his cars and trucks after he goes to bed.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-751 photo" title="handy" src="http://squaredesign.com/wp-content/blogs.dir/1/files/2011/04/handy-240x240.jpg" alt="" width="240" height="240" /></p>
<p>being a parent, we get to have lots of brightly colored plastic items strewn about the house. we carefully inspect them for sharp corners, loose pieces, and any other hazards for the kids.</p>
<p>but we also get to examine the quality of design and construction. these toys, in particular, exemplify a lot of thought and caring for the user experience.</p>
<p>we received as a gift, this <a href="http://www.amazon.com/gp/product/B0039GKU4I/ref=as_li_ss_tl?ie=UTF8&amp;tag=sqdes-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399349&amp;creativeASIN=B0039GKU4I">Tonka Chuck and Friends Mini 3-pack Truck</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=&amp;l=as2&amp;o=1&amp;a=B0039GKU4I&amp;camp=217145&amp;creative=399349" border="0" alt="" width="1" height="1" />. anthropomorphic faces aside (i&#8217;m learning this is a reality in almost all kids toys) i&#8217;m quite impressed by the design and material selection.</p>
<ul class="clear">
<li><strong>body plastics</strong> &#8211; a slightly soft compound, with some give but not enough to crack the paint (although that&#8217;s taking quite a beating while the toddler &#8230; gives the toy a beating).</li>
<li><strong>wheel pastics</strong> &#8211; a harder compound, makes a a pleasant sound when rolling. this was completely unexpected.</li>
<li><strong>weight</strong> &#8211; while small, the toy has some heft. it appears to have an embedded weight on the bottom to help keep it upright.</li>
</ul>
<p>while some of the toys we see seem to have had no consideration for what would happen to them once they leave the shelf, these have been carefully designed to be pleasing to play with.</p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/crit/chuck-and-friends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WX Weather 0.6 released</title>
		<link>http://squaredesign.com/news/wx-weather-0-6-released/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wx-weather-0-6-released</link>
		<comments>http://squaredesign.com/news/wx-weather-0-6-released/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 17:16:22 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[News and Events]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=630</guid>
		<description><![CDATA[an update to our WX Weather Widget for WordPress was released]]></description>
			<content:encoded><![CDATA[<p>today sees version 0.6 of our <a href="http://squaredesign.com/products/wx-weather/">WX Weather Widget</a> for WordPress being released. new in this version:</p>
<ul>
<li>added the ability to choose Metric or English unit preference</li>
<li>fixed the display of rainfall data (if it&#8217;s raining)</li>
<li>updated readme and plugin info page to reflect PHP5 requirement</li>
</ul>
<p>see the <a href="http://squaredesign.com/wx-weather/">Widget Page</a> or get it from the <a href="http://wordpress.org/extend/plugins/wx-weather-widget/">WordPress Plugin Directory</a>. if you have any questions or concerns, <a href="http://squaredesign.com/contact/">drop me a line</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/news/wx-weather-0-6-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BarCamp Rochester</title>
		<link>http://squaredesign.com/news/barcamp-rochester/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=barcamp-rochester</link>
		<comments>http://squaredesign.com/news/barcamp-rochester/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 19:18:08 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[News and Events]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=594</guid>
		<description><![CDATA[we'll be heading to Rochester, NY this weekend to participate in a few tech events happening there.]]></description>
			<content:encoded><![CDATA[<p>i&#8217;ll be heading out to Rochester, NY this weekend to attend <a href="http://barcamprochester.org/">BarCamp Rochester</a> being held at <a href="http://www.rit.edu/">RIT</a>. i&#8217;m working on a presentation about WordPress that will hopefully appeal to the BarCamp crowd.</p>
<p>also taking place the night previous is <a href="http://refreshrochester.org/">Refresh Rochester</a>, at the excellent <a href="http://www.artisanworks.net/">ARTISANworks</a> facility.</p>
<p>it will be a great weekend for people who work with web technologies in the greater Rochester area. if you&#8217;re nearby and would like to join us, please <a href="http://www.facebook.com/event.php?eid=357629800422">RSVP for Refresh</a> and <a href="http://barcamprochester.org/login">Register for BarCamp</a> so they can keep track of attendance.</p>
<p>see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/news/barcamp-rochester/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>See you at WordCamp Boston</title>
		<link>http://squaredesign.com/news/see-you-at-wordcamp-boston/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=see-you-at-wordcamp-boston</link>
		<comments>http://squaredesign.com/news/see-you-at-wordcamp-boston/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 07:22:32 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[News and Events]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=564</guid>
		<description><![CDATA[we'll be presenting an Ignite talk at WordCamp Boston, as well as volunteering at the Genius Bar. we hope to see you there!]]></description>
			<content:encoded><![CDATA[<p>i proposed an Ignite talk for <a href="http://wordcampboston.com/">WordCamp Boston</a> on the subject of <a href="http://codex.wordpress.org/Shortcode_API">WordPress Short Code API</a>. this, certainly sounds riveting! well, the attendees voted and my proposal was one of seven <a href="http://wordcampboston.com/2010/01/13/the-inaugural-ignite-wordcamp-lineup/">talks chosen</a>. i&#8217;m looking forward to teaching the community how they can use Short Codes to break through the barrier of the Post Content area, and empower our users to be able to do clever things with their content.</p>
<p>in addition to the talk, i&#8217;ve signed up to volunteer at the Genius Bar &#8211; a special table set up where volunteers with advanced WordPress experience can answer questions from attendees and help them solve problems/achieve goals with their use of WordPress.</p>
<p>if you&#8217;re attending WordCamp Boston, stop by and say hello. i&#8217;ll be posting my presentation, and links to great Short Code resources here after the event.</p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/news/see-you-at-wordcamp-boston/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress widget: WX Weather</title>
		<link>http://squaredesign.com/news/new-wordpress-widget-wx-weather/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-wordpress-widget-wx-weather</link>
		<comments>http://squaredesign.com/news/new-wordpress-widget-wx-weather/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 11:31:58 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[News and Events]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=369</guid>
		<description><![CDATA[our first publicly released WordPress Widget is a tool for Weather Station owners to display their station data in a blog sidebar.]]></description>
			<content:encoded><![CDATA[<p>recently i&#8217;ve completed work on my first (public) WordPress Widget &#8211; <a href="http://squaredesign.com/products/wx-weather/">WX Weather</a>.</p>
<p><img class="alignnone size-full wp-image-921" title="screenshot-3" src="http://squaredesign.com/wp-content/blogs.dir/1/files/2009/04/screenshot-3.gif" alt="" width="400" height="300" /></p>
<p>it was a bit of a passion project &#8211; something that fascinates me (besides web design and development) is weather. i&#8217;ve been a weather geek and a member of the <a href="http://www.wunderground.com">Weather Underground</a> website for quite some time.</p>
<p>Weather Underground combines conditions and forecasts from the National Weather Service, with data being collected by enthusiasts using Personal Weather Stations.</p>
<p>that includes data from my own <abbr title="Personal Weather Station">PWS</abbr> &#8211; you can see that here at my <a href="http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KNHRINDG5" target="_blank">weather station conditions page</a>.</p>
<p>while there are already lots of <a href="http://wordpress.org/extend/plugins/tags/weather" target="_blank">weather plugins</a> for WordPress, gathering data from the NWS, Weather.com, Accuweather.com, etc. i wanted to design one that was specifically for PWS owners to display their own data.</p>
<p>read more about installing and configuring it on the <a href="http://squaredesign.com/wx-weather/">plugin page</a>, or see it in action at my personal blog, <a href="http://mikeyboy.com">mikeyboy.com</a>.</p>
<p class="center"><a title="a photo of my anemometer during the 2008 ice storm" href="http://www.flickr.com/photos/mikeyboydotcom/3112138790/"><img src="http://farm4.static.flickr.com/3259/3112138790_0e3e59ed42_m.jpg" alt="Ice Storm 2008 - anemometer" width="240" height="180" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/news/new-wordpress-widget-wx-weather/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>javascript, math, and color</title>
		<link>http://squaredesign.com/garage/javascript-math-and-color/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javascript-math-and-color</link>
		<comments>http://squaredesign.com/garage/javascript-math-and-color/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 13:07:36 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Garage]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=852</guid>
		<description><![CDATA[an article about using javascript to do math, and math to make colors.]]></description>
			<content:encoded><![CDATA[<p>in my previous article about the <a href="http://squaredesign.com/garage/crazy-squares">crazy squares</a> i showed you how i do the mousemove() triggered, random square manipulation using JQuery and a bit of raw javascript.</p>
<p>in this entry, i&#8217;ll talk about how we can manipulate colors as numbers.</p>
<p><span id="more-852"></span></p>
<h2>step 1: draw the squares</h2>
<p>i&#8217;ve stolen my square-filled &lt;div&gt; from the <a href="http://squaredesign.com/lab/crazy-squares">previous demo</a>, but this time the squares start out black.</p>
<pre class="css">.demo-square {
   float:left;
   width:28px;
   height:28px;
   background:#000;
   margin:1px;
}
</pre>
<p>the javascript that creates them:</p>
<pre class="javascript">var cols = 10;
var rows = 6;
for(x=0; x&lt;(cols * rows); x++) {
  $("&lt;div&gt;")
  .clone(false)
  .appendTo("#demo")
  .addClass("demo-square")
}
</pre>
<pre class="html">&lt;div id="demo"&gt;&lt;/div&gt;</pre>
<div id="demo1" class="demo-squares-container"></div>
<p>pretty boring.</p>
<h2>step 2: alter the colors</h2>
<p>notice we make a loop to create the squares. loops are great for incrementally doing math ($something++).</p>
<p>also, colors can be expressed not only in the hexadecimal #AABBCC, but also numerically from 0-225, e.g. rgb(000,120,255)</p>
<p>so if we wanted the squares to fade slowly from black to white, we need to take the number of squares, divide 255 by that number, and add that amount to each of the r,g,b values on every loop. (here i&#8217;m manipulating all r,g,b values equally &#8211; if you want to play with color, you can change them separately)</p>
<p>that loop looks like this:</p>
<pre class="javascript">var increment = 255 / ((cols * rows)-2);
var current = 0;
for(x=0; x&lt;(cols * rows); x++) {
   rounded = Math.round(current);
   $("&lt;div&gt;")
   .clone(false)
   .appendTo("#demo")
   .addClass("demo-square")
   .css("background","rgb("+rounded+","+rounded+","+rounded+")");
   current += increment;
}
</pre>
<div id="demo2" class="demo-squares-container"></div>
<p>notes:</p>
<ul>
<li>rounding &#8211; CSS doesn&#8217;t like decimals in rgb() values)</li>
<li>for the increment value, i subtract two from cols * rows, because we want the first one fully black, and the last one fully white.</li>
</ul>
<h2>step 3: random, and other uses</h2>
<p>i know, i don&#8217;t have a big sweeping gradient in the back. i have random shades. the theory is the same, to loop through every square and alter it&#8217;s rgb() value, but instead of incrementing it, we pick a (rounded) random value every time.</p>
<pre class="javascript">var rand = 0;
for(x=0; x&lt;(cols * rows); x++) {
  rand = Math.round(Math.random()*255);
  $("&lt;div&gt;")
  .clone(false)
  .appendTo("#demo")
  .addClass("demo-square")
  .css("background","rgb("+rand+","+rand+","+rand+")");
}
</pre>
<div id="demo3" class="demo-squares-container"></div>
<p>my <a href="http://squaredesign.com/lab/crazy-squares/">last demo</a> showed how random things could happen with mousemove(). do you want the squares to react to user input as they mouse over them individually? we&#8217;ll tie the change to the hover() event on each square.</p>
<pre class="javascript">for(x=0; x&lt;(cols * rows); x++) {
   $("&lt;div&gt;")
   .clone(false)
   .appendTo("#demo")
   .addClass("demo-square")
   .css("background","#000000")
   .hover(function() {
      rand = Math.round(Math.random()*255);
   $(this).css("background","rgb("+rand+","+rand+","+rand+")")
  })
}
</pre>
<p>(mouse over the div below to see it in action)</p>
<div id="demo4" class="demo-squares-container"></div>
<p>you could do something interesting with opacity and images (for browsers that support it):</p>
<p>add an image to the background of the container with CSS:</p>
<pre class="css">#demo {
  background:url('/images/demo.jpg') top left no-repeat;
}
</pre>
<p>and adjust the opacity of each square to a random value (divided by two here to make it reveal more of the image)</p>
<pre class="javascript">for(x=0; x&lt;(cols * rows); x++) {
  $("&lt;div&gt;")
  .clone(false)
  .appendTo("#demo")
  .addClass("demo-square")
  .css("background","#000000")
  .css("opacity",Math.random()/2)
}
</pre>
<div id="demo5" class="demo-squares-container"></div>
<p>is there any practical usage for this? i think so. creating an appealing or joyful experience is practical because it makes the user happy. a happy user will read/learn/buy/share.</p>
<p>i hope you&#8217;ll consider using clever technology to make fun and functional designs for your users. if you do, please <a href="http://squaredesign.com/note/">contact me</a> and let me know how this inspired your own creations!</p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/garage/javascript-math-and-color/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Squares</title>
		<link>http://squaredesign.com/garage/the-squares/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-squares</link>
		<comments>http://squaredesign.com/garage/the-squares/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 12:59:03 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Garage]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=847</guid>
		<description><![CDATA[here's an article explaining how i do the animation in the background of this site. it's all done with HTML, CSS, and JQuery/javascript (no images or Flash)]]></description>
			<content:encoded><![CDATA[<p>visitors to my site have asked me how i was able to make it load quickly with a big image/animation in the background (in the previous design)</p>
<p>the answer: it&#8217;s not a graphic. it&#8217;s all HTML, CSS, and Javascript.</p>
<p><span id="more-847"></span></p>
<p>as a designer / developer, i try to find ways of using the capabilities of the browser to provide advanced design and functionality, instead of pushing a large payload like a Flash movie down to the browser for every effect i want to create.</p>
<p>my inspiration came from John Resig&#8217;s port of the Processing library to <a href="http://ejohn.org/blog/processingjs/">processing.js</a>. there are some really beautiful visuals in those examples, all of which are generated in the browser.  while i didn&#8217;t use processing.js to create my design, i did leverage the <a href="http://jquery.com">JQuery</a> library to do a lot of the heavy lifting for me.</p>
<p>for this demonstration, i won&#8217;t get into the math involved to do the random colors &#8211; that would probably fill another article by itself. instead, let&#8217;s focus on the rendering and animation.</p>
<h2>step 1: pick a container</h2>
<p>for this example, let&#8217;s take this &lt;div&gt; element:</p>
<pre>&lt;div id="demo"&gt;&lt;/div&gt;</pre>
<div id="demo" class="demo-squares-container"></div>
<p>pretty boring.</p>
<h2>step 2: fill it up</h2>
<p>now let&#8217;s fill the &lt;div&gt; with smaller &lt;div&gt;s &#8211; a grid of them 10&#215;6</p>
<p>this CSS will style the small squares that we will create:</p>
<pre class="css">.demo-square {
	float:left;
	width:28px;
	height:28px;
	background:#dfd;
	margin:1px;
}</pre>
<p>here&#8217;s the javascript that creates them:</p>
<pre class="javascript">var cols = 10;
var rows = 6;
for(x=0; x&lt;(cols * rows); x++) {
	$("&lt;div&gt;")
	.clone(false)
	.appendTo("#demo")
	.addClass("demo-square")
}</pre>
<p>that gives us this:</p>
<div id="demo2" class="demo-squares-container"></div>
<p>(i styled them with a bit of margin between so you could see the separate squares)</p>
<h2>step 3: make it go</h2>
<p>while there are other ways to animate the squares, most of them use a lot of CPU time, and would run even when the user wasn&#8217;t watching. i got the idea to tie the animation to the mousemove() event that JQuery provides. this would insure that it wouldn&#8217;t be eating CPU cycles while the user had another tab or window focused. also, i hope it adds a bit of fun!</p>
<p>the CSS for the alternate square style:</p>
<pre class="css">.demo-square-dark {
	background:#6a6;
}</pre>
<p>the javascript that toggles the alternate class on a random square as the mouse moves:</p>
<pre class="javascript">var demosquares = $('#demo .demo-square');
$("#demo").mousemove(function(e) {
  pick = Math.round(demosquares.length * Math.random());
  $(demosquares[pick]).toggleClass("demo-square-dark");
});</pre>
<p>mouse over this div to see how the mousemove() event triggers that toggle</p>
<div id="demo3" class="demo-squares-container"></div>
<p>and that&#8217;s basically how the animated background of my site works. in another post, i&#8217;ll get into the details of the math that makes the different shades. until then &#8211; check out a <a href="http://squaredesign.com/squares.html">toy i made with the background squares</a> &#8211; you can even select the two colors that it differences between!</p>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/garage/the-squares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>toggling CSS rules</title>
		<link>http://squaredesign.com/garage/toggling-css-rules/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=toggling-css-rules</link>
		<comments>http://squaredesign.com/garage/toggling-css-rules/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 12:57:33 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Garage]]></category>

		<guid isPermaLink="false">http://squaredesign.com/?p=845</guid>
		<description><![CDATA[a brief post demonstrating a technique to quickly enable and disable CSS selectors. i use it toggle debug rules on and off - how will you apply it?]]></description>
			<content:encoded><![CDATA[<p>somewhere in my development career, i observed a quick way of enabling and disabling blocks of code using comments. i use this now in all my stylesheets, to be able to quickly toggle a CSS selector on and off.</p>
<p>if you look at a block comment:</p>
<pre class="css">/* */</pre>
<p>you realize you can stack two of these up on each other:</p>
<pre class="css">/* */ i'm not commented!  /* */</pre>
<p>and by quickly inserting a space in the closing side of the first comment, you can make the comment tag expand to encompass the whole line or block.</p>
<pre class="css">/* * / &lt;-- that space makes me commented now!  /* */</pre>
<p>the finished example:</p>
<pre class="css">/* no space */ #example{} /* enabled */
/* with space * / #example{} /* disabled */</pre>
<p>you can use this to toggle a debug class, e.g.</p>
<pre class="css">/*  */  .todo { font-weight:bold; color:red; } /* */</pre>
]]></content:encoded>
			<wfw:commentRss>http://squaredesign.com/garage/toggling-css-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

