<?xml version='1.0' encoding='utf-8' ?>
<feed xmlns='http://www.w3.org/2005/Atom'>
  <title type='text'>Camenisch Creative</title>
  <generator uri='http://effectif.com/nesta'>Nesta</generator>
  <id>tag:camenischcreative.com,2009:/</id>
  <link href='http://camenischcreative.com/articles.xml' rel='self' />
  <link href='http://camenischcreative.com' rel='alternate' />
  <subtitle type='text'>tagline</subtitle>
  <updated>2011-04-26T00:00:00+00:00</updated>
  <entry>
    <title>Sunburst with CSS3 Gradients</title>
    <link href='http://camenischcreative.com/blog/2011-04-26' rel='alternate' type='text/html' />
    <id>tag:camenischcreative.com,2011-04-26:/blog/2011-04-26</id>
    <content type='html'>
            &lt;p&gt;This post was inspired by Lea Verou&amp;#8217;s delighfully creative &lt;a href='http://leaverou.me/css3patterns/'&gt;CSS3 pattern gallery&lt;/a&gt;. I was so impressed with the creative calculating that went into some of the examples that I thought I&amp;#8217;d like to try my own hand at CSS3 gradient-wrangling.&lt;/p&gt;
            
            &lt;p&gt;The background of this page is my first attempt to contribute something a bit different. Technically, it&amp;#8217;s not even a &amp;#8220;pattern,&amp;#8221; though it&amp;#8217;s certainly a background, so it could be of use for similar reasons. I&amp;#8217;ve also found that you can use the same technique to make &lt;a href='http://camenischcreative.com/blog/2011-04-26.1/'&gt;a rather ugly pattern&lt;/a&gt;.&lt;/p&gt;
            
            &lt;p&gt;It weighs in rather heavy—almost 1KB for just one of the prefixes. Perhaps a better guru could accomplish the same thing at a lighter weight. One could also simply use fewer rays, but I&amp;#8217;m not sure that would make for a very nice look.&lt;/p&gt;
            
            &lt;p&gt;Below is the basic sunburst CSS. &lt;a href='http://camenischcreative.com/stylesheets/sunburst.css'&gt;View the actual file&lt;/a&gt; to see all the prefixes.&lt;/p&gt;
            &lt;script src='https://gist.github.com/943169.js'&gt; &lt;/script&gt;
            &lt;p&gt;If this is of any use to you, feel free to copy it or adapt it however you&amp;#8217;d like.&lt;/p&gt;
            
            &lt;p&gt;Thanks to &lt;a href='http://leaverou.me/'&gt;Lea Verou&lt;/a&gt; for the inspiration, and for helping me trim down the syntax.&lt;/p&gt;
          </content>
    <published>2011-04-26T00:00:00+00:00</published>
    <updated>2011-04-26T00:00:00+00:00</updated>
  </entry>
  <entry>
    <title>Sunburst Pattern with CSS3 Gradients</title>
    <link href='http://camenischcreative.com/blog/2011-04-26.1' rel='alternate' type='text/html' />
    <id>tag:camenischcreative.com,2011-04-26:/blog/2011-04-26.1</id>
    <content type='html'>
              &lt;p&gt;Here&amp;#8217;s a variation on the sunburst CSS background, reworked into a pattern.&lt;/p&gt;
              
              &lt;p&gt;The code, sans prefixes:&lt;/p&gt;
              &lt;script src='https://gist.github.com/943639.js'&gt; &lt;/script&gt;
            </content>
    <published>2011-04-26T00:00:00+00:00</published>
    <updated>2011-04-26T00:00:00+00:00</updated>
  </entry>
  <entry>
    <title>Email address obfuscation as view helper</title>
    <link href='http://camenischcreative.com/blog/2011-04-20' rel='alternate' type='text/html' />
    <id>tag:camenischcreative.com,2011-04-20:/blog/2011-04-20</id>
    <content type='html'>
                &lt;h2 id='the_goal'&gt;The Goal&lt;/h2&gt;
                
                &lt;p&gt;I recently published my email address on my simple new website. Instead of the common approach of providing a web form, I decided to go quick and dirty this time and just provide a mailto: link.&lt;/p&gt;
                
                &lt;p&gt;I&amp;#8217;ve seen several approaches to obfuscating email addresses on the web to protect them from pesky bots, and I&amp;#8217;ve used one or two myself. This time, I wanted to meet these requirements:&lt;/p&gt;
                
                &lt;ul&gt;
                &lt;li&gt;
                &lt;p&gt;Keep the view itself clean—encapsulate all obfuscation in an easy-to-call helper.&lt;/p&gt;
                &lt;/li&gt;
                
                &lt;li&gt;
                &lt;p&gt;Make the link completely user-friendly—readable and clickable&lt;/p&gt;
                &lt;/li&gt;
                
                &lt;li&gt;
                &lt;p&gt;Require javascript execution to render the link&lt;/p&gt;
                &lt;/li&gt;
                
                &lt;li&gt;
                &lt;p&gt;And just in case bots can run Javascript now:&lt;/p&gt;
                
                &lt;ul&gt;
                &lt;li&gt;Require loading of an external js file to get the address.&lt;/li&gt;
                
                &lt;li&gt;Provide no hint in the html source that the external file does contain an email address.&lt;/li&gt;
                &lt;/ul&gt;
                &lt;/li&gt;
                &lt;/ul&gt;
                
                &lt;p&gt;In other words, I&amp;#8217;d like a fully functional email address link, but demand as much from bots as I can. And the highest bar I can think to set for bots is that they must not only execute Javascript, but also download every script file on every page they spider. This seems to me like unlikely functionality not only today, but in the near future as well.&lt;/p&gt;
                
                &lt;h2 id='the_implementation'&gt;The Implementation&lt;/h2&gt;
                
                &lt;p&gt;My implementation is in Ruby, using the lovely &lt;a href='https://github.com/jlong/serve'&gt;Serve&lt;/a&gt; prototyping framework. However, You can easily adapt the code for a Rails application, or the algorithm into PHP or any other language.&lt;/p&gt;
                
                &lt;h3 id='the_view'&gt;The View&lt;/h3&gt;
                
                &lt;p&gt;Here&amp;#8217;s the Ruby snippet I want to end up with in my actual template:&lt;/p&gt;
                
                &lt;pre&gt;&lt;code&gt;email_link(&amp;#39;me@mydomain.com&amp;#39;)&lt;/code&gt;&lt;/pre&gt;
                
                &lt;p&gt;I might want to pass at least one other parameter, like the text to go into the link. I&amp;#8217;ll leave that out for now though. The point is, again, to have a perfectly clean api for the view, and encapsulate the logic somewhere else.&lt;/p&gt;
                
                &lt;h3 id='the_view_helper'&gt;The View Helper&lt;/h3&gt;
                
                &lt;p&gt;In Serve, the place to encapsulate this sort of thing is in a helper. So I crack open my /views/view_helpers file, and write the method called above. Let&amp;#8217;s start with a working method, and get to the obfuscation later.&lt;/p&gt;
                
                &lt;pre&gt;&lt;code&gt;module ViewHelpers&amp;#x000A;  def email_link(address)&amp;#x000A;    &amp;quot;&amp;lt;a href=&amp;#39;mailto:\#{address}&amp;#39;&amp;gt;\#{address}&amp;lt;/a&amp;gt;&amp;quot;&amp;#x000A;  end&amp;#x000A;end&lt;/code&gt;&lt;/pre&gt;
                
                &lt;p&gt;With all this code in place, we should have a working page. We&amp;#8217;ve met our first two requirements: the view is clean, and the email link is readable and clickable.&lt;/p&gt;
              </content>
    <published>2011-04-20T00:00:00+00:00</published>
    <updated>2011-04-20T00:00:00+00:00</updated>
  </entry>
</feed>

