<?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>Aligned Left Blog &#187; Tech</title>
	<atom:link href="http://alignedleft.com/blog/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://alignedleft.com/blog</link>
	<description>Exploring digital culture and dynamic media</description>
	<lastBuildDate>Thu, 15 Jul 2010 23:22:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using CSS3 border-image Sprites for Flexible Button States</title>
		<link>http://alignedleft.com/blog/2010/07/using-css3-border-image-sprites-for-flexible-button-states/</link>
		<comments>http://alignedleft.com/blog/2010/07/using-css3-border-image-sprites-for-flexible-button-states/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 23:22:46 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://alignedleft.com/blog/?p=643</guid>
		<description><![CDATA[Much has been written about CSS sprites, but less so about CSS3’s border-image. I wanted to use the two together to produce beautiful, scalable buttons that use only one image for both normal and active (e.g. clicked) states.  I couldn’t find anyone else online using this approach yet, so I documented my experiments here.

First, [...]]]></description>
			<content:encoded><![CDATA[<p>Much has been written about <a href="http://www.alistapart.com/articles/sprites">CSS sprites</a>, but less so about CSS3’s <code>border-image</code>. I wanted to use the two together to produce beautiful, scalable buttons that use only one image for both normal and active (e.g. clicked) states.  I couldn’t find anyone else online using this approach yet, so I documented my experiments here.</p>

<p>First, here is the amazing button that we want to create:</p>

<p><img src="http://alignedleft.com/blog/wp-content/uploads/2010/07/Amazing-Button.png" alt="" title="Amazing-Button" width="200" height="50" class="alignnone size-full wp-image-644" /></p>

<p>Its active state will be triggered on either mouseDown or a touch event (for iOS and Android devices, say).  In that case, we want the colors to change as shown:</p>

<p><img src="http://alignedleft.com/blog/wp-content/uploads/2010/07/Amazing-Button-Active.png" alt="" title="Amazing-Button-Active" width="200" height="50" class="alignnone size-full wp-image-645" /></p>

<p>Of course, ideally we could create this button using pure CSS styles, like <code>border-radius</code> and <code>box-shadow</code>, or with SVG vector art.  But let’s say that for whatever reason, this button has visual elements that can’t be created with CSS alone, and we have to use a bitmap image.  (All images on this page are PNGs with alpha transparency.)</p>

<p>CSS3’s new <a href="http://www.css3.info/preview/border-image/">border-image</a> property lets us specify an image to stretch to fit our button, no matter how wide or tall it becomes.  Usually, <code>border-image</code> is used with an image like this:</p>

<p><img src="http://alignedleft.com/blog/wp-content/uploads/2010/07/Amazing-Button-Border.png" alt="" title="Amazing-Button-Border" width="40" height="50" class="alignnone size-full wp-image-646" /></p>

<p>This image is 40 pixels wide by 50 tall.  So we could use this CSS:</p>

<blockquote>
  <p><code>#buttonElement {</code></p>
  
  <p><code>border-image: url(../images/button.png) 0 18 0 18;</code></p>
  
  <p><code>-moz-border-image: url(../images/button.png) 0 18 0 18;</code></p>
  
  <p><code>-webkit-border-image: url(../images/button.png) 0 18 0 18;</code></p>
  
  <p><code>{</code></p>
</blockquote>

<p>This should grab 18 pixels from either side of the image and stretch it to fit.  Of course, we’d then have to overlay the button text on top of this background.  (I always specify both the “official” CSS3 property, plus the Mozilla and Webkit derivations. For clarity, I’ll omit the latter two below.)</p>

<p>The old-fashioned way to create the button’s active state is to generate a second PNG:</p>

<p><img src="http://alignedleft.com/blog/wp-content/uploads/2010/07/Amazing-Button-Active-Border.png" alt="" title="Amazing-Button-Active-Border" width="40" height="50" class="alignnone size-full wp-image-647" /></p>

<p>…and style it with more CSS.  Note that we’ve added the <code>.pressed</code> class, and we’re now referencing a different PNG:</p>

<blockquote>
  <p><code>#buttonElement.pressed {</code></p>
  
  <p><code>border-image: url(../images/button_active.png) 0 18 0 18;</code></p>
  
  <p><code>{</code></p>
</blockquote>

<p>You would then use JavaScript/jQuery/etc. to add the <code>.pressed</code> class to #buttonElement whenever it is clicked or tapped.</p>

<p>But by using the CSS sprites technique, we can include both button states in a single image.  (This one is 40 pixels by 100.)</p>

<p><img src="http://alignedleft.com/blog/wp-content/uploads/2010/07/Amazing-Button-Border-Sprite.png" alt="" title="Amazing-Button-Border-Sprite" width="40" height="100" class="alignnone size-full wp-image-648" /></p>

<p>Then, we modify the <code>border-image</code> parameters to reference different parts of our sprite image, depending on the button state: </p>

<blockquote>
  <p><code>#buttonElement {</code></p>
  
  <p><code>border-image: url(../images/button_sprite.png) 0 18 50 18;</code></p>
  
  <p><code>{</code></p>
  
  <p><code>#buttonElement.pressed {</code></p>
  
  <p><code>border-image: url(../images/button_sprite.png) 50 18 0 18;</code></p>
  
  <p><code>{</code></p>
</blockquote>

<p>See those “50” values?  They are the key to shifting the <code>border-image</code> reference up and down, as needed.</p>

<p>Now isn’t that better?  Just one image means fewer network requests, plus the button’s active state is already preloaded into memory — no need for extra weird JavaScript!</p>
]]></content:encoded>
			<wfw:commentRss>http://alignedleft.com/blog/2010/07/using-css3-border-image-sprites-for-flexible-button-states/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When Everyone is Free (to Meet)</title>
		<link>http://alignedleft.com/blog/2010/05/when-everyone-is-free-to-meet/</link>
		<comments>http://alignedleft.com/blog/2010/05/when-everyone-is-free-to-meet/#comments</comments>
		<pubDate>Fri, 28 May 2010 19:19:38 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Thesis]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://alignedleft.com/blog/?p=627</guid>
		<description><![CDATA[When is Good is one of my all-time favorite web tools, making it super easy to find a good time to schedule a group meeting. They published a fascinating paper last year, sharing the most interesting findings from the aggregate data of user’s schedules, including:


Event invitations are most likely to be accepted for a Tuesday [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://whenisgood.net/">When is Good</a> is one of my all-time favorite web tools, making it super easy to find a good time to schedule a group meeting. They published <a href="http://whenisgood.net/static/press/WhenIsGood-Whitepaper-Oct09.pdf">a fascinating paper</a> last year, sharing the most interesting findings from the aggregate data of user’s schedules, including:</p>

<ul>
<li>Event invitations are most likely to be accepted for a Tuesday at 3pm.</li>
<li>…on average only three or four people out of ten will be available at any given time.</li>
</ul>

<p>For more, <a href="http://whenisgood.net/static/press/WhenIsGood-Whitepaper-Oct09.pdf">download the full paper</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alignedleft.com/blog/2010/05/when-everyone-is-free-to-meet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone 3G: Unanswered Questions</title>
		<link>http://alignedleft.com/blog/2008/06/iphone-3g-unanswered-questions/</link>
		<comments>http://alignedleft.com/blog/2008/06/iphone-3g-unanswered-questions/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 04:55:13 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://alignedleft.com/blog/?p=213</guid>
		<description><![CDATA[I’m sure everyone and their mothers have already blogged this, but here are the lingering questions I have following today’s WWDC keynote:


A new remote “erase” feature was alluded to during the enterprise portion of the presentation.  How will this work, and who controls it?  If I’m late paying my AT&#38;T bill, try to [...]]]></description>
			<content:encoded><![CDATA[<p>I’m sure everyone and their mothers have already blogged this, but here are the lingering questions I have following today’s WWDC keynote:</p>

<ul>
<li><p>A new remote “erase” feature was alluded to during the enterprise portion of the presentation.  How will this work, and who controls it?  If I’m late paying my AT&amp;T bill, try to break my contract, or try to unlock the phone for use with another carrier, will the phone self-destruct?</p></li>
<li><p>Apple announced a new push notification service for developer use, but I’m guessing it ain’t free.  How much will it cost, and who can use it?  Will small, independent developers be priced out of the picture?  And is it part of the new Mobile Me service, or can it operate on its own, serving users who don’t have $99/year Mobile Me accounts?</p></li>
<li><p>How much will my monthly 3G phone bill cost?  (More, presumably.)</p></li>
<li><p>Is 3G service even <em>available</em> in my area?  How can I find out before purchasing a new phone?</p></li>
<li><p>Will Mobile Me’s push email service work only with me.com email accounts?  (I’m guessing yes, which means I wouldn’t be able to use it with alignedleft.com.)</p></li>
<li><p>How does the new Mail app’s UI for multiple-message delete/move work?  This is new functionality for iPhone, but it won’t be useful unless it’s also usable.</p></li>
<li><p>Same question for the multiple language support:  How does the UI work for switching languages/keyboards?  And can the handwriting recognition used for Chinese character input be expanded for use with other alphabets?</p></li>
</ul>

<p>Also, Jobs mentioned that the audio quality had been improved significantly.  It will be interesting to hear if that’s really the case.</p>

<p><strong>Update:</strong> I also want to add one observation that I haven’t seen made elsewhere yet:</p>

<ul>
<li>It looks like iPhone 2.0 supports multiple iCal calendars, which was not mentioned in the keynote (nor on Apple’s site).  This will be great, as it brings my iPhone calendar more in line, visually, with my desktop iCal calendar.  (I hope this also eliminates the bug/feature of having new events entered on the phone sync unpredictably into the last calendar in iCal’s list.)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alignedleft.com/blog/2008/06/iphone-3g-unanswered-questions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.266 seconds -->
