Sunset Upholstery Website

After more than 25 years of doing everything from antique furniture restoration to custom aircraft and motorcycle seating, Sunset Upholstery is beginning to use the web to reach a larger audience.

For their first web site, the goal was to create a simple design that would showcase the wide variety of services offered by Sunset, as well as feature testimonials from previous customers.

In addition, a form allows customers to receive an estimate by uploading photos of the items they wish to have upholstered.

“I’m honored to recommend you. I’m getting calls as a result of the web site you built for us.”
— Dennis Polzin, owner

The site was built using WordPress to allow the client to easily manage his own content.

Posted in Projects | Tagged , , | Leave a comment

I guess some guys really do just read it for the articles

My wife said this is the only time she’s coming home with a Playboy for me.

Playboy in braille

Check out Miss October 1989. Hot stuff!

Miss October in braille

Posted in Uncategorized | Tagged | 2 Comments

Placehold.it: a Placeholder Image Web Service

File this under: Things I never knew I needed.

Placehold.it is probably the most useful tool to come along in quite a while. Anyone who does website layouts knows that eventually you’re going to need placeholder images for something, even if it’s just to show where ads will go in a sidebar.

The best part is you don’t even need to visit the website to use the service, just memorize how the url structure works. It even works for background images in CSS.

This is going to save me so much time when I’m doing mock-ups. Thanks to Madelin for the tip.

Posted in Elsewhere | Tagged , , | Leave a comment

Left Bank Cafe Menu

closeup of menu

Every once in a while, when the right project comes along, it’s nice to do a print piece or two to keep those skills sharp. When my friend asked if I’d be interested in designing the menu for his family’s French café, it sounded too delicious to say no.

front and back of menuThe client wanted a simple two-sided menu that could be printed on card stock. Printing on legal size stock allowed for plenty of elegant white space, while not making the menu too large or unwieldy.

Since the menu wouldn’t feature pictures of food, the typography and layout had to communicate its quality. The common but versatile Adobe Garamond Pro was chosen for its superior readability at small sizes, its historical connections to French typography, and for details like the old style figures and gorgeous italic ampersand.

Posted in Projects | Tagged , , , | 1 Comment

Highlight Today’s Business Hours with PHP

If you have business hours listed on your website, highlighting the hours for the current day is a nice finishing touch that makes it just a little easier for your visitors to find the information they’re looking for. To set that up, all we need is some beginner-level PHP and a little CSS for styling.

The Goal

screen shot of final version

We’re going to end up with something like this, although I’m sure you can make it look much better than my demo.

Getting Started

We’ll start by creating a list with the hours for our business. We’ll also add a class to each list item with a three letter abbreviation for that day.

<ul>
    <li class="mon">Monday: 8am - 5pm</li>
    <li class="tue">Tuesday: 10am - 5pm</li>
    <li class="wed">Wednesday: 8am - 5pm</li>
    <li class="thu">Thursday: 11am - 6pm</li>
    <li class="fri">Friday: 1pm - 4pm</li>
    <li class="sat">Saturday: 2pm - 5pm</li>
    <li class="sun">Sunday: closed</li>
</ul>

The date() Function

The real magic is done by PHP’s date() function. It holds all kinds of information about the current time and can display it in many different formats. Here’s an example:

<?php echo "Today is " . date('l, F jS, Y') . "."; ?>

Would output: Today is Friday, July 30th, 2010 (or whatever date you happen to run the code). You can read about all the possible parameters for date() in the PHP manual.

The parameter we’re interested in is D, which returns the current day of the week expressed as a three letter abbreviation.

We’re going to use this to write a class name for the ul element that corresponds to the current day:

<ul class="today-is-<?php echo date('D'); ?>">
    <li class="mon">Monday: 8am - 5pm</li>
    <li class="tue">Tuesday: 10am - 5pm</li>
    <li class="wed">Wednesday: 8am - 5pm</li>
    <li class="thu">Thursday: 11am - 6pm</li>
    <li class="fri">Friday: 1pm - 4pm</li>
    <li class="sat">Saturday: 2pm - 5pm</li>
    <li class="sun">Sunday: closed</li>
</ul>

So on a Friday, our class name will be today-is-Fri, but on a Saturday, it will be today-is-Sat.

Highlighting the Current Day

Now that we have PHP filling in an appropriate class name for our ul, it’s up to CSS to do the rest. We’ll combine each of the possible outputs of date() with the corresponding classes on our list items for each day.

.today-is-Mon .mon,
.today-is-Tue .tue,
.today-is-Wed .wed,
.today-is-Thu .thu,
.today-is-Fri .fri,
.today-is-Sat .sat,
.today-is-Sun .sun {
	background-color: #ee7e1a;
	color: #fff4ea;
	text-shadow: 1px 1px 2px rgba(0,0,0,0.25);
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
}

By using descendant selectors in CSS we guarantee that only the current day will match our CSS rules.

Tidying Up

If we want adhere to best practices (and we do!), we should prefer to use an all lower case value for our ul class name. Unfortunately, the date function doesn’t have a parameter for a three letter lower case version of the day. However, we can easily make one ourselves by using the strtolower() function, which converts an input string to all lower case. To use it, all we have to do is wrap it around our date() function when we echo it.

<?php echo strtolower( date('D') ); ?>

Now instead of being mixed case, as in today-is-Fri, it will read today-is-fri, which looks much neater and was hardly any trouble to do. Remember to edit the CSS to reflect the new lower case selectors as well.

The Result

View live demo

Now our hours for the current day are a little easier to find. And best of all, it changes automatically every day.

Takeaways

  • PHP’s date() function is a quick and easy way to get all sorts of information about the current date and time.
  • Using PHP to write class names dynamically is a powerful technique for styling your pages.
  • Using strtolower() to filter the output of other PHP functions can help keep our markup consistent and readable.

One Last Thing

No discussion of business hours would be complete without this video (slightly NSFW-ish):

Posted in Tutorials | Tagged , | 1 Comment

Good Enough

Quick question: Think about your favorite blogs. Can you remember the very first post on any of them? I can’t seem to think of any myself. Since I’m just now starting this blog in earnest, I’m hoping that my experience is a universal one and that this post will be forgotten or undiscovered as I go on to write about topics of greater importance.

screen shot of old design

The Hayloft, circa 2008... eww

Why start this way? Because, quite simply, I have to start somewhere. After nearly two years of this website existing in various unfinished states, I decided it’s time I get on with some of those pesky goals I had in the first place.

The basic idea is to have a place to share the work I’ve done as a web designer and developer (and hopefully find some new work while I’m at it). I suspect I’ll also try writing opinions, advice, tips, and other content relating to design and the web.

But Matt, you’re a web designer. Shouldn’t it be easy for you to make your own website?

I’ve always said designers are their own worst clients. No one can nitpick my work the way I can. No one holds me to a higher standard than I do. No one is more aware that I could do better or try harder than I am. Also, I don’t have to pay myself or meet deadlines when i’m working on my own stuff, so there’s less motivation for me to say “That’s good enough”.

One of the great things about the web is that nothing is set in stone. Unlike a printed piece, a website can evolve over time. This makes it somewhat less important to have everything just so before you put it out into the world. I don’t know exactly what I want to do with this site yet, but I’ll never know unless I actually start working on it. Perfection be damned!

Posted in Uncategorized | Tagged | Leave a comment