
Cicada (link coming shortly) is our first site of 2010, commissioned by a friend of mine for his new business. The brief was to provide a simple and clean website in order to allow prospective clients to contact him and to conform to all current European standards for businesses. It should also be compliant with IE6+, Firefox, Chrome, and Opera.
The website truly does seem simple at first look, but there’s a lot going on behind the scenes in terms of JavaScript and design choices. The big one being cufon, used to serve Helvetica Neue — in Light and Ultra Light variants — to the viewers. Using cufon is as easy as uploading the typefaces to their provided generator (make sure that the licensing allows for them to be embedded, you should also lock the file to your domain) and then linking the generated JavaScript file in the head of your HTML:
<script type="text/javascript" src="../js/cufon-yui.js"></script>
<script type="text/javascript" src="../js/HelveticaNeue_300-HelveticaNeue_400.font.js"></script>
<script type="text/javascript">
Cufon.replace('h1, h2, h3, p');
</script>
Here I’ve chosen to have cufon replace all h1, h2, h3, and p elements. It’s not recommended to use cufon to replace body text like I’ve done here unless it’s less than 1,000 characters.
Next up is a little bit of jQuery to switch states between the main page and the contact page (seen below) — when the viewer clicks on the “get in touch” link — by hiding and unhiding two <div>‘s.
$(function(){
$('#email_us').click(function(){
$('#about').toggle();
$('#contact').toggle();
});
});

Note that this all degrades neatly if the viewer doesn’t have JavaScript enabled. First by simply choosing Helvetica or Arial from the viewers machine if it can’t serve them the cufon version of Helvetica Neue, and secondly by showing them an email address they can use instead of the contact form with <noscript><a href="mailto:us@cicada.eu">us@cicada.eu</a></noscript>.
Also to note is that all text and images are solid white (#FFF) with varying degrees of opacity to give them some transparency over the blue gradient background. To get this working in all browsers (and their ancestors) required quite a few lines of CSS (the order is very important):
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; filter:alpha(opacity=80); -khtml-opacity:.80; -moz-opacity:.80; opacity:.80;
Another thing to note with the transparency is that Internet Explorer (versions 6 and 7) handle transparent PNG’s terribly. So I’ve had to use a Microsoft designed catch-all to serve IE a non-transparent PNG instead:
<!--[if !IE]><!--> <img src="../images/white_logo.png" /> <!--<![endif]--> <!--[if IE]> <img src="../images/logo_ie.png" /> <![endif]-->
This covers the majority of the little pieces of code I’ve used in developing this website. I’ll update this post with a link to the site when it goes live later this month.