<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>daniel t ott</title>
    <link>http://www.dtott.com/</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:rights>Copyright 2010</dc:rights>
    <dc:date>2010-02-26T16:09:46+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>CSS/Javascript Word Clock</title>
      <link>http://dtott.com/thoughts/2010/02/26/css-javascript-word-clock</link>
      <guid>http://dtott.com/thoughts/2010/02/26/css-javascript-word-clock#When:16:09:46Z</guid>
      <description><![CDATA[<p><img src="/images/uploads/clock2.png" class="insetLeft"  alt="CSS Clock" style="float:right;width:30%;margin: 0 0 1% 1%;" />
</p><p>A little experiment I built: <a href="http://x.dtott.com/clock/">a word clock</a> using CSS3 transforms and a little Javascript to run the actual clock. Useful? Maybe not. Fun? Definitely.</p>
<p>The code behind it is fairly straight-forward. Let&#8217;s take a peak:</p>
<h2>CSS</h2>
<p>The first thing we need to do is set a base set of styles for each arm of the clock.</p>
<pre><code>
li{ 
    position: absolute;  width: 150px;
    text-transform: lowercase; 
    -webkit-transform-origin: 0 center;
    -moz-transform-origin: 0 center;
    color: rgba(255,255,255,.1);
    position: absolute; left: 0; top: 0;
}
</code></pre>
<p>This is basically saying for each arm, position it at the top of the clock body, and then rotate around left side, so that we have uniform rotations.</p>
<p>Then, for each arm, we set the actual rotation. Here is the HTML for the &#8220;hour&#8221; arms:</p>
<pre><code>
&lt;ol id="hours"&gt;
        &lt;li&gt;&lt;span&gt;One&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Two&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Three&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Four&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Five&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Six&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Seven&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Eight&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Nine&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Ten&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Eleven&lt;/span&gt;&lt;/li&gt;
        &lt;li&gt;&lt;span&gt;Twelve&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
</code></pre>
<p>And, the corresponding CSS:</p>
<pre><code>
#hours > li{ padding: 0 0 0 80px; }
#hours > li:nth-child(1){ -webkit-transform: rotate(-60deg); -moz-transform: rotate(-60deg); }
#hours > li:nth-child(2){ -webkit-transform: rotate(-30deg); -moz-transform: rotate(-30deg); }
#hours > li:nth-child(3){ -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); }
#hours > li:nth-child(4){ -webkit-transform: rotate(30deg); -moz-transform: rotate(30deg); }
#hours > li:nth-child(5){ -webkit-transform: rotate(60deg); -moz-transform: rotate(60deg); }
#hours > li:nth-child(6){ -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); }
#hours > li:nth-child(7){ -webkit-transform: rotate(120deg); -moz-transform: rotate(120deg); }
#hours > li:nth-child(8){ -webkit-transform: rotate(150deg); -moz-transform: rotate(150deg); }
#hours > li:nth-child(9){ -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); }
#hours > li:nth-child(10){ -webkit-transform: rotate(210deg); -moz-transform: rotate(210deg); }
#hours > li:nth-child(11){ -webkit-transform: rotate(240deg); -moz-transform: rotate(240deg); }
#hours > li:nth-child(12){ -webkit-transform: rotate(270deg); -moz-transform: rotate(270deg); }
</code></pre>
<p>The first line sets the padding, so that each hour arm begins 80px from the center. The rest set up the individual rotations for each arm, at 30 degrees each. The minute and second hands have more padding, and rotate 6 degrees for each arm. The rest of the CSS in the file is used to style the clock, and to show/hide the extra text.</p>

<h2>Javascript</h2>
<p>All we need to do for the javascript is create a function that sets class=&#8220;active&#8221; on each arm of the current time. So, at 12:45 and 20 seconds, the 12 hour arm, the 45 minute arm, and the 20 second arm have class=&#8220;active&#8221;, and the rest are normal. Then we simply set an interval to run every second.</p>

<pre><code>
$(function(){
        var hours = $("#hours"), minutes = $("#minutes"), seconds = $("#seconds");
        
        //these are default grabs so that the first time it runs, it doesn't throw an error
        //after that, we use them to cache the current active arm for each group, so that we
        //don't have to waste time searching
        var cHour = $("html"), cMinute = $("html"), cSecond = $("html");
        
        var setCurrentTime = function(){
            //establish what the time is
            var currentTime = new Date();
            var hour = currentTime.getHours() - 1;
            if(hour == -1){ hour = 11; }
            var minute = currentTime.getMinutes() - 1;
            if(minute == -1){ minute = 59; }
            var second = currentTime.getSeconds() - 1;
            if(second == -1){ second = 59; }
            var ampm = "am";
            if(hour > 11){
                ampm = "pm";
                hour = hour-12;
            }
            if(hour == 11){
                ampm = "pm";
            }
            
            //remove the active class, and add it to the new time
            cHour.removeClass("active");
            cHour = hours.children(":eq(" + hour + ")").addClass("active");
            
            cMinute.removeClass("active");
            cMinute = minutes.children(":eq(" + minute + ")").addClass("active");
            
            cSecond.removeClass("active");
            cSecond = seconds.children(":eq(" + second + ")").addClass("active");
            
            $("body").removeClass("am").removeClass("pm").addClass(ampm);
        
        };
        //set the interval to run each second
        setInterval(setCurrentTime,1000);
    
    });

</code></pre>

<p>It&#8217;s a fun little experiment that doesn&#8217;t have any real value on it&#8217;s own, but it&#8217;s a good exercise and as good of an excuse as any to play around with CSS transforms.</p>

<p>The full CSS file can be found <a href="http://x.dtott.com/clock/clock.css">here</a>, and the javascript can be found <a href="http://x.dtott.com/clock/clock.js">here</a></p>]]></description>
      <dc:subject>css, html, javascript</dc:subject>
      <dc:date>2010-02-26T16:09:46+00:00</dc:date>
    </item>

    <item>
      <title>A New Start</title>
      <link>http://dtott.com/thoughts/2010/02/04/a-new-start</link>
      <guid>http://dtott.com/thoughts/2010/02/04/a-new-start#When:15:30:46Z</guid>
      <description><![CDATA[<p>It&#8217;s been quiet around here for a few months. Part of that, of course, is the holidays and all the craziness that comes with them. But the main reason is that I&#8217;ve spent most of my free computer time on this: my new site.</p>

<p>It&#8217;s built on the mostly awesome but sometimes infuriating <a href="http://ExpressionEngine.com">ExpressionEngine</a>, and features some stuff that I&#8217;m fairly proud of: </p>
<ul>
<li>Brand new design, by yours truly</li>
<li>Javascript/CSS - based fluid layout (check out the <a href="http://dtott.com">home page</a> for the best example).</li>
<li>The <a href="http://dtott.com/work">portfolio section</a> features some custom javascript if you&#8217;re in a decent browser. Safari, especially, will give you a treat.</li>
<li>Some cool stuff like <a href="http://typekit.com">Typekit</a> and <a href="http://Modernizr.com">Modernizr</a> (and of course <a href="http://jquery.com">jQuery</a> and <a href="http://jqueryui.com">jQuery UI</a>)</li>
<li>Some fun HTML5 and CSS3 stuff throughout</li>
</ul>

<p>I&#8217;d like to thank <a href="http://minchdesign.com">Craig Minch</a> for periodically guiding me in the right direction, and my wife Emily for being so awesome and being my Official Design Consultant on this project.</p>

<p>I&#8217;ll most likely be posting about different aspects of the site; but please feel free to drop a comment if you&#8217;d like to know more about anything in particular.</p>

<p>Take a look around, and enjoy(:</p>]]></description>
      <dc:subject>Blogging, General</dc:subject>
      <dc:date>2010-02-04T15:30:46+00:00</dc:date>
    </item>

    <item>
      <title>IE6 Cheatsheet</title>
      <link>http://dtott.com/thoughts/2009/09/24/ie6-cheatsheet</link>
      <guid>http://dtott.com/thoughts/2009/09/24/ie6-cheatsheet#When:14:09:05Z</guid>
      <description><![CDATA[<p>There's <a href="http://www.virtuosimedia.com/tutorials/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs#javascript-detection">a great collection of IE6 fixes</a> up on <a href="http://www.virtuosimedia.com/">Virtuosi Media</a> that is worth a bookmark. If you've ever stepped into IE6 (and, chances are, you have) you know that it can be a mess. This cheatsheet is a very nice roundup of IE6 bugs in HTML/CSS/Javascript, plus a few more goodies.</p>
<p>None of this information is new at all, but it's very nice having it all in one place, and you can just have one bookmark for IE6 fixes instead of an entire folder full of them(:</p>
<p>(via <a href="http://www.wait-till-i.com/2009/09/24/ttmmhtm-chrome-for-ie-3d-for-safari-and-firefox-nes-for-js-and-accessibility-and-an-open-internet-for-all/">Chris Heilmann</a>)</p>]]></description>
      <dc:subject>Front End, ie6, linked</dc:subject>
      <dc:date>2009-09-24T14:09:05+00:00</dc:date>
    </item>

    <item>
      <title>VanadiumJS &#45; Client&#45;side validation made easy (and pretty cool)</title>
      <link>http://dtott.com/thoughts/2009/09/18/vanadiumjs-client-side-validation-made-easy-and-pretty-cool</link>
      <guid>http://dtott.com/thoughts/2009/09/18/vanadiumjs-client-side-validation-made-easy-and-pretty-cool#When:14:52:05Z</guid>
      <description><![CDATA[<p>Client-side validation (checking for things like required fields, valid email address, etc) is always one of those sort of pain in the butt, last minute, only because i have to sort of things. It's not usually fun or flashy, it's just one of those things you have to do. Enter <a href="http://vanadiumjs.com/">VanadiumJS</a>, a new library just released by <a href="http://lambder.com/">Daniel Kwiecinski</a>. </p>
<p>Aside from having a cool-looking website, Vanadium looks like it will ease <em>all </em> of your validation woes, and make it easy and fun (you know, if you're in to that sort of thing) again. Worth checking out / bookmarking / using.</p>]]></description>
      <dc:subject>javascript, linked</dc:subject>
      <dc:date>2009-09-18T14:52:05+00:00</dc:date>
    </item>

    <item>
      <title>More Drawing in Canvas</title>
      <link>http://dtott.com/thoughts/2009/09/10/more-drawing-in-canvas2</link>
      <guid>http://dtott.com/thoughts/2009/09/10/more-drawing-in-canvas2#When:17:00:28Z</guid>
      <description><![CDATA[<p>Speaking of HTML5 and <code>canvas</code>, <a href="http://carsonified.com/blog/dev/html-5-dev/how-to-draw-with-html-5-canvas/">Carsonified has a nice little tutorial</a> to get started with <code>canvas</code>.  This article includes a good overview of where you can use <code>canvas</code> (anywhere), which browsers support it (most of them, at least with a little help (even IE6!)), and how to get going with some easy stuff. </p>]]></description>
      <dc:subject>javascript, linked</dc:subject>
      <dc:date>2009-09-10T17:00:28+00:00</dc:date>
    </item>

    <item>
      <title>Dive into HTML5</title>
      <link>http://dtott.com/thoughts/2009/09/09/dive-into-html52</link>
      <guid>http://dtott.com/thoughts/2009/09/09/dive-into-html52#When:18:50:17Z</guid>
      <description><![CDATA[<p><a href="http://diveintohtml5.org/">Dive Into HTML5</a> is a thoroughly beautiful site by <a href="http://diveintomark.org/">Mark Pilgrim</a> that houses text from his upcoming book of the same name. </p><br/><p>Aside from containing great information, it really is a pleasure to look at (check out those font stacks!). Two chapters are available right now: <a href="http://diveintohtml5.org/detect.html">Detecting HTML5 Features</a>, which is really an in-depth explanation of how <a href="http://www.modernizr.com/">Modernizr</a> works, and <a href="http://diveintohtml5.org/canvas.html">Let’s Call It A Draw(ing Surface)</a>, which contains some good stuff on the <code>canvas</code> element.</p>
<p>This is the sort of thing that makes me want to work on my redesign(:</p>]]></description>
      <dc:subject>Front End, html, linked</dc:subject>
      <dc:date>2009-09-09T18:50:17+00:00</dc:date>
    </item>

    <item>
      <title>Firefox 3.5 &#45; CSS3 Boogaloo</title>
      <link>http://dtott.com/thoughts/2009/07/01/firefox-3.5-css3-boogaloo</link>
      <guid>http://dtott.com/thoughts/2009/07/01/firefox-3.5-css3-boogaloo#When:19:24:52Z</guid>
      <description><![CDATA[<p>As I'm sure you're aware, Firefox 3.5 was released recently. If you haven't already, I would suggest updating(:</p><br/><br/><p>A large bonus is their support for a whole slew of CSS 3 features. Their <a href="https://developer.mozilla.org/En/Firefox_3.5_for_developers">developers page for 3.5</a> serves as a great resource for checking the <code>-moz</code> specific CSS features, as well as a nice refresher on some of the more complicated CSS 3 features in general. This plus Safari 4's ongoing CSS 3 awesomeness opens plenty of doors for doing some cool stuff. With the two main (good) browsers supporting so many CSS 3 features, plus Firefox's astronomical update rate, the time to start using this stuff is now.</p>]]></description>
      <dc:subject>linked</dc:subject>
      <dc:date>2009-07-01T19:24:52+00:00</dc:date>
    </item>

    <item>
      <title>HTML5 Doctor</title>
      <link>http://dtott.com/thoughts/2009/07/01/html5-doctor2</link>
      <guid>http://dtott.com/thoughts/2009/07/01/html5-doctor2#When:19:06:47Z</guid>
      <description><![CDATA[<p>A new site, <a href="http://html5doctor.com">HTML5 Doctor</a> was recently released, and it promises to be a good resource for learning HTML5.</p>
<blockquote><p>We will publish articles relating to <abbr title="hypertext markup language">HTML</abbr>5 and it’s semantics and how to use them, here and now. We will also be inviting questions, in the form of <a href="http://html5doctor.com/ask-the-doctor">‘Ask the doctor’</a> to help answer people’s queries and questions. Answers will be posted in the form of articles for all to learn from.</p></blockquote>
<p>There are plenty of posts around describing all of the new elements, or discussing semantics of the new elements, but this site is nice in that it actually gives use-cases for each of them, so that you can learn the best way to use them on your next site.</p>
<p>Bookmark this site, add it to your feed reader, and start HTML5-ing.</p>]]></description>
      <dc:subject>linked</dc:subject>
      <dc:date>2009-07-01T19:06:47+00:00</dc:date>
    </item>

    <item>
      <title>It&#8217;s Naked Time Again</title>
      <link>http://dtott.com/thoughts/2009/04/08/its-naked-time-again</link>
      <guid>http://dtott.com/thoughts/2009/04/08/its-naked-time-again#When:16:11:26Z</guid>
      <description><![CDATA[<p>Yes, it's back. The annual <a href="http://naked.dustindiaz.com/">CSS Naked Day</a>.</p>
<blockquote><p>The idea behind this event is to promote Web Standards. Plain and simple. This includes proper use of (x)html, semantic markup, a good hierarchy structure, and of course, a good 'ol play on words. It's time to show off your <body>.</p></blockquote>
<p>It's good fun, and a good exercise. Enjoy naked time while it lasts!</p>]]></description>
      <dc:subject>css, linked</dc:subject>
      <dc:date>2009-04-08T16:11:26+00:00</dc:date>
    </item>

    <item>
      <title>New site launch: 10 Best Things</title>
      <link>http://dtott.com/thoughts/2009/03/12/new-site-launch-10-best-things</link>
      <guid>http://dtott.com/thoughts/2009/03/12/new-site-launch-10-best-things#When:03:01:24Z</guid>
      <description><![CDATA[<p><a href="http://10bestthings.com">10bestthings.com</a> just went live a few minutes ago. It's basically a site where you can make top 10 (or any number, really) lists and then share them around. It's actually a lot of fun to play with. Here's a list I made a while ago that I'm fairly proud of: <a href="http://www.10bestthings.com/list/52">My favorite Christmas movies</a>.</p>
<p>This was a <a href="http://sprokets.net">Sprokets</a> project, meaning that I was responsible for the HTML/CSS/Javascript, and was blessed to work with the extremely talented likes of <a href="http://frantzid.com">Vince Frantz</a>, <a href="http://schemestudio.com">John-Paul Walton</a>, <a href="http://colbowdesign.com">Brad Colbow</a>, <a href="http://www.nontoxicgroup.com/">Mike Barone</a>, and <a href="http://www.mattgrosse.com">Matt Grosse</a>. It was a pleasure, as always.</p>
<p>Congrats to the Sprokets crew, and good job everyone.</p><br/><p>So what are you waiting for? Go <a href="http://10bestthings.com">make a list</a>!</p>]]></description>
      <dc:subject>Work, Front End</dc:subject>
      <dc:date>2009-03-13T03:01:24+00:00</dc:date>
    </item>

    
    </channel>
</rss>