Warioworld.com

September 19, 2014 at 1:53 pm

This arti­cle popped up in my RSS feed yes­ter­day and it was too much. Something welled up inside me to fight the evil design in the world in what lit­tle way that I could. I gave myself 24 hours to code a new land­ing page from scratch. (I had to give myself a good buffer because I knew noth­ing was get­ting done last night while I watched the foot­ball game. War Damn Eagle!) Along the way, I cleaned up the infor­ma­tion archi­tec­ture and rewrote some copy.

There’s way more that could be done, but I want­ed to give myself a hard dead­line. By putting myself on the clock, I did­n’t futz around. Nor am I hold­ing on to it because it’s not per­fect. It’s just an unso­licit­ed redesign of a land­ing page — noth­ing more, noth­ing less.

The cur­rent site lives at warioworld.com while you can see my redesign live on my new play­ground space.

Firefox Screenshot of Warioworld.com as it Currently Exists, 1996 web design, my eyes hurt

Warioworld.com Current Screenshot

Firefox Screenshot of Warioworld.com Redesigned Landing Page, unsolicited, responsive, web design

Warioworld.com Landing Page Redesign

The Redesign: Part Three

August 22, 2014 at 12:00 pm

The third and final post in the series about my recent redesign of Spare­Type is the fun one chock full of bits of code. With visu­als and process out of the way, it’s time to dig into the pieces that actu­al­ly make the site run. This isn’t going to be a com­pre­hen­sive break­down of every line of code but a look at my favorite pieces that do the most heavy lifting.

Typography

Font sizes and line-height are the per­fect can­di­dates for vari­ables in a CSS pre­proces­sor. I’m run­ning Sass because that’s the one I heard of first and it was easy enough to pick up the basics of imports and variables.

// =Variables for typography expressed in pixels
$title-text: 58;
$headline-text: 36;
$subhead-text: 28;
$primary-text: 22;
$secondary-text: 17;
$title-leading: 60;
$headline-leading: 44;
$primary-leading: 36;
$secondary-leading: 27;

So where did these num­bers come from? The Golden Ratio Typography Calculator, of course. This pro­vides a reli­able scale and hier­ar­chy while also address­ing read­abil­i­ty with an appro­pri­ate char­ac­ter per line count (CPL). While being respon­sive will cause that num­ber to fluc­tu­ate, I’ve designed for 65 CPL on desk­top sized screens which make up the bulk of my traf­fic. So what do we do with these num­bers? Say hello to the only mixin in my Sass so far.

// =Font size and line height mixin for pixels and rems
@mixin font-size($fontsize: $primary-text, $lineheight: $primary-leading) {
font-size: $fontsize + px;
font-size: ($fontsize / 16) + rem;
line-height: $lineheight + px ;
line-height: ($lineheight /16) + rem ;
}

This beau­ty allows you to pass it one of the vari­ables above then spit it out in pix­els for older browsers and rem units for newer browsers. The ‘16’ comes from the default type size in pix­els. This piece is awe­some because it does all the math in con­vert­ing pix­els to rem units. Hooray, for com­put­ers doing math. Now, the mixin in action.

body {
    @include font-size($primary-text,$primary-leading);
    color: $brand-color1;
    font-family: 'Source Sans Pro', sans-serif;
}
h1 {
    @include font-size($title-text,$title-leading);
}
h2 {
    @include font-size($headline-text,$headline-leading);
}

@include calls the mixin named font-size. The vari­ables for text size and line-height are includ­ed for that par­tic­u­lar ele­ment. Then we have some other CSS rules to start the over­all styling of the text with color and font-family. The color prop­er­ty also shows off anoth­er per­fect use of vari­ables for defin­ing color palettes to be reused through­out the code. Once com­piled from Sass to nor­mal CSS it looks like the following.

body {
font-size:22px;
font-size:1.375rem;
line-height:36px;
line-height:2.25rem;
color:#3c4d56;
font-family:'Source Sans Pro', sans-serif
}
h1 {
font-size:58px;
font-size:3.625rem;
line-height:60px;
line-height:3.75rem;
}
h2 {
font-size:36px;
font-size:2.25rem;
line-height:44px;
line-height:2.75rem;
}

Layout

My favorite piece of struc­ture for the site is the blog page with its tiles for each blog post. Amazingly, it’s a CSS only solu­tion. The secret is inline-block and column-count, which has plen­ty of brows­er sup­port when pre­fixed. Set the column-count and column-gap on a div that wraps the arti­cles. Then set the arti­cles to inline-block and 100% width.

.loop-content {
    margin: 184px 72px 18px;
    -moz-column-count: 1;
    -moz-column-gap: 72px;
    -webkit-column-count: 1;
    -webkit-column-gap: 72px;
    column-count: 1;
    column-gap: 72px;
}

.loop-content article {
    display: inline-block;
    margin-bottom: 72px;
    width: 100%;
    background-color: $brand-color4;
    border: 2px solid $brand-color1;
}

@media screen and (min-width: 850px) {
    .loop-content {
        -moz-column-count: 2;
        -webkit-column-count: 2;
        column-count: 2;
        max-width:800px;
    }
}

This tech­nique works great in a respon­sive design because you can update the column-count on wider dis­plays to spread out infor­ma­tion. You can adjust the width of the wrap­ping div and the col­umn widths inside will adjust accord­ing­ly. Again, hooray for leav­ing the math to the com­put­er and let­ting the brows­er cal­cu­late widths. I’ve also used this tech­nique in the foot­er for lay­ing out wid­gets there.

Multiple Thumbnails

The last piece of code I’d like to high­light is WordPress spe­cif­ic and actu­al­ly involves installing a plu­g­in. The Multiple Post Thumbnails plu­g­in allows you to reg­is­ter extra fea­tured images for your posts. It does take some cod­ing to get work­ing, but that flex­i­bil­i­ty allows for lots of tweak­ing to fit your design goals. All the code and instruc­tions for imple­ment­ing the plu­g­in can be found on this Github page. It dove­tails per­fect­ly into WordPress’s built-in media man­ag­er and cus­tom image sizes reg­is­tered through functions.php. Plus, there is no limit to how many fea­tured images you can add.

SpareType Multiple Thumbnails (Featured Images) for WordPress, plugin, screenshot

Those three pieces of code real­ly do 80% of the work around the site. They are pow­er­ful, under­stand­able, and adjustable which makes them amaz­ing tools for work­ing with the site’s design. As I makes tweaks and intro­duce new code, I’ll be high­light­ing the stand out pieces here on the blog so keep an eye out for those.

For now, that wraps up the redesign series about the site. If you real­ly want to fol­low along, I am doing all of this out in the open on Github. Plus, there’s always the RSS feed so you can catch all of my blog posts. Now, go code something.

The Redesign: Part Two

August 18, 2014 at 2:30 pm

Welcome to the sec­ond post about my recent redesign of SpareType. Part one cov­ered the visu­als, while this post will dive into how I changed my think­ing and process. I’ll share a few key code snip­pets pow­er­ing the new design in part three com­ing soon. For now, let’s talk about process.

Holy shit. I’ve been doing this all wrong.

Have you ever had that thought? It’s a tough real­iza­tion. I had that moment a few months ago. I was feel­ing like an old dog in my web design game. I knew of these things called Github, Grunt, and Sass but wasn’t tak­ing advan­tage of them. I hadn’t updat­ed my skills or my process. My mind­set also need­ed a reboot.

My first break­through moment was for­get­ting about a fin­ished prod­uct. Coming from the print side of graph­ic design, I was still hold­ing on to that idea of get­ting every­thing right before hit­ting the print but­ton. I kept par­a­lyz­ing myself with the list of things to do before I could release the redesign. But that’s not true for a web­site. If I don’t like the way com­ments show up today, I can update a file and they can look bet­ter tomor­row. A web­site can — and should be — in a con­stant state of improvement.

Make it more better.

The idea of con­stant improve­ment notched per­fect­ly with the idea of ver­sion con­trol. If I want to always be try­ing new things, I need a safe­ty net to CMD‑Z the things that don’t work out. I threw all my cod­ing pride out the win­dow and start­ed with the Git basics. “I’m smart enough to fig­ure it out,” had to take a seat while I dust­ed off the instruc­tion man­u­al and read the baby steps. I’m still not com­plete­ly using Git cor­rect­ly for branch­ing and merg­ing, but I have the con­fi­dence to break things in my code and undo them.

Github Screenshot of SpareType 2014 Project, version control, redesign

At the same time I was start­ing to crawl with Git, I was lucky to stum­ble across Codio. Before, I bounced around edit­ing code in Dreamweaver or the built-in theme edi­tor in Word­Press. Some­times I just used the file brows­er pro­vided by what­ever host­ing com­pany the project was on. I did­n’t have an inte­grat­ed devel­op­ment envi­ron­ment (IDE) and set­tling on one place to code and work has been a huge orga­niz­ing force in my process.

Codio is web based and fully inte­grat­ed with Git and Github. It’s lib­er­at­ing to no longer be shack­led to a local pro­gram or files. I’m just mov­ing stuff from one spot on the Internet to anoth­er. This also has the ben­e­fit of forc­ing me to learn the dark arts of com­mit, push, pull, and branch. Codio’s other inte­gra­tions with the soft­ware I was inter­est­ed in learn­ing — Sass and Grunt — made it eas­i­er to start learn­ing about them. Of course I screwed up at first — four­teen com­mits before Grunt was pro­duc­ing the right out­put. And it could still get better.

Codio Screenshot - Homepage, World's Most Powerful IDE, integrated development environment

The Biggest Game Changer

As cliché as it sounds, if you feel like you need to do some­thing, just do it. If you need to use [insert tool, pro­gram­ming lan­guage, new-fangled boon­dog­gle here], start using it. Screw it up, read more doc­u­men­ta­tion, copy some code, screw up again, get one tiny thing to work, screw up again, rinse, repeat. Along the way those tiny things that work start to stick and that’s called learning.

I’ve learned a lot the last few months both tech­ni­cal­ly in my code and in my approach to think­ing about what I do. It’s also made me appre­ci­ate oth­ers shar­ing their learn­ing on the Internet. Hopefully, I can con­tribute a small piece and inspire oth­ers to make things more bet­ter. I leave you with a few of the key arti­cles that helped teach me the last few months and bring about my process changes.

Site Performance Starting Point

August 15, 2014 at 11:00 am

With the redesign this week, I’m shift­ing to a more con­tin­u­ous devel­op­ment process. Tweak, break, fix, rinse, repeat. Before things set­tled too much I want­ed to get a per­for­mance base­line of the new theme in action. You have to have a start­ing point in order to judge improve­ment — so here are the numbers.

Size
in KB
Requests Empty cache
in seconds
Primed cache
in seconds
Cached Size
in KB
Home Page 30.1 10 2.95 2.82 24.6
Blog 210.1 12 4.16 2.69 202.6
Post 1 286.1 23 5.12 3.59 280.4
Post 2 220.9 16 2.79 2.99 220.9

 

Methodology

All num­bers come from Firebug 2.0.3 run­ning on Firefox 31. Times above are the aver­age of three tests for each scenario.

Takeaways

Already on the to-do list is to imple­ment a build process with Grunt. That will take care of low­er­ing the request num­bers once the mul­ti­ple JS and CSS files are com­bined. It should also trim a few kilo­bytes once it ugli­fies everything.

Second, and more impor­tant, is upgrad­ing host­ing. The shared host­ing on Bluehost is great. I’ve never had any prob­lems, tons of fea­tures, and things work won­der­ful for the price. Now that I’m get­ting seri­ous and look­ing at the num­bers, per­for­mance is where you take the hit. Waiting for a response from the serv­er var­ied wild­ly with the quick­est response tak­ing 837 mil­lisec­onds and aver­ag­ing 2.69 seconds.

Not a bad start­ing point but it will def­i­nite­ly get better.