<?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>The Book and the Cover &#187; Uncategorized</title>
	<atom:link href="http://benjaminsterling.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://benjaminsterling.com</link>
	<description>Ok, you did not judge the book by it&#039;s cover, great.  Now, read the whole thing before passing judgment.</description>
	<lastBuildDate>Mon, 16 Jan 2012 21:58:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Turn that frown right side up</title>
		<link>http://benjaminsterling.com/turn-that-frown-right-side-up/</link>
		<comments>http://benjaminsterling.com/turn-that-frown-right-side-up/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 01:25:13 +0000</pubDate>
		<dc:creator>Benjamin Sterling</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://benjaminsterling.com/?p=102</guid>
		<description><![CDATA[Ok, this is going to be a real quick post, Toby Pitman did a guest post over at CSS-Tricks and it got me thinking what other simple things can be done with the css property "-webkit-transform."  The best I could come up with was to flip those emotional icons upright. Note: this will only work [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, this is going to be a real quick post, Toby Pitman did a guest post over at <a href="http://css-tricks.com/css3-clock/">CSS-Tricks</a> and it got me thinking what other simple things can be done with the css property "-webkit-transform."  The best I could come up with was to flip those emotional icons upright.</p>
<p><strong>Note:</strong> this will only work in WebKit browsers as of this writing so don't tell me it does not work in IE7 or below or in Firefox 3 or below, I know, it is meant to be a test for WebKit.</p>
<p>So, lets assume you have the following conversation:</p>
<blockquote><p>You are so cute :)</p>
<p>No, you are ;)</p>
<p>But I said it first &gt;:(</p>
<p>Why are you getting mad :O</p>
<p>I don't know :S</p>
<p>:/</p></blockquote>
<p>Great convo right? Not let's put some JavaScript into the mix here:</p>
<div class="igBar"><span id="ljavascript-3"><a href="#" onclick="javascript:showPlainTxt('javascript-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-3">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color: #66cc66;">&#40;</span>document<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #006600;">ready</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'p'</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> jqthis = $<span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> txt = jqthis.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066FF;">/\B<span style="color: #66cc66;">&#40;</span>:\<span style="color: #66cc66;">&#41;</span>|;\<span style="color: #66cc66;">&#41;</span>|&gt;:\<span style="color: #66cc66;">&#40;</span>|:O|:S|:\/<span style="color: #66cc66;">&#41;</span>/g</span>, <span style="color: #3366CC;">'&lt;span class=&quot;icon&quot;&gt;$1&lt;/span&gt;'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; jqthis.<span style="color: #006600;">html</span><span style="color: #66cc66;">&#40;</span> txt <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Basically what that is saying is grab all the paragraphs, grab the HTML out of them.  Use some RegEx to search through the characters to find the emotional icons, and then replace them with a SPAN and the characters that are being replaced (that would be the $1).</p>
<p>Now lets add some style to the mix:</p>
<div class="igBar"><span id="lcss-4"><a href="#" onclick="javascript:showPlainTxt('css-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-4">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;style&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #993333;">icon</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;-webkit-transform: rotate<span style="color: #66cc66;">&#40;</span>90deg<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">color</span>:#ff0000;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">display</span>:inline-<span style="color: #993333;">block</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;padding<span style="color: #3333ff;">:<span style="color: #cc66cc;color:#800000;">0</span> </span>2px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/style&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And this is what we get:</p>
<style>
.icon{
   -webkit-transform: rotate(90deg);
   color:#ff0000;
   display:inline-block;
   padding:0 2px;
}
</style>
<p><script type="text/javascript"><!--
$(document)
.ready(function(){
	$('.doIcon').each(function(){
		var jqthis = $(this);
		var txt = jqthis.html().replace(/\B(:\)|;\)|>:\(|:O|:S|:\/)/g, '<span class="icon">$1</span>');
		jqthis.html( txt );
	});
});
// --></script></p>
<blockquote>
<p class="doIcon">You are so cute :)</p>
<p class="doIcon">No, you are ;)</p>
<p class="doIcon">But I said it first &gt;:(</p>
<p class="doIcon">Why are you getting mad :O</p>
<p class="doIcon">I don't know :S</p>
<p class="doIcon">:/</p>
</blockquote>
<p>Neat trick, nothing real special, but the possibilities are really beginning to open up.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminsterling.com/turn-that-frown-right-side-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

