| The Useful, the Usable and the Unbelieveable in Design for the Web | |||
In This Issue...
Host Unlimited Domains For $9.95 Per Month At HostGator! Tired of downtime
and bad support? Time to move to HostGator and find what you have been missing!
24/7 support, rock solid servers, and attention to the details. Use the
coupon code "sitepoint" for a free month on any of our web hosting
plans.
Introduction
I got a lot of positive feedback on the last issue from Fireworks users keen for more quick tutorials. I get the impression that a lot of developers who purchased 'Macromedia Studio 8' to get Flash and Dreamweaver are starting to look seriously into Fireworks. I've certainly been a fan for a long time now. I'll explain a few tricks in this issue of the Design View. Secondly, we'll look at some of the interesting visual effects you can get by sprinkling a little DOM scripting onto your images. Also, if you haven't checked out Corrie Haffly's latest feature article, give it a look-in. It's a comprehensive Photoshop and CSS tour de force!
Alex Walker
Using Filters in FireworksI think it was the 'Page Curl Filter' that did the damage. All through the late 90s, Kai Krause (KPT) was a guru and this 'plug-in' was a legitimate and valuable tool. But somewhere amidst a forest of page curl, fire and ice effects sprouting up on every Geocities site, the whole idea of plug-in graphics filters seemed to fall badly out of fashion. Now that there's some water under the bridge, maybe it's time for another look at this school of effects. One of the issues I have with Fireworks is that it can look quite sterile. The bevels, glows and shadows that it generates can look as though they were created in a deep-space vacuum. While this can be useful, to my mind it often brands a lot of artwork immediately as a 'Fireworks design'. Although you can access Photoshop's native filters in Fireworks (provided you have them), I've enjoyed very limited success using these filters in Fireworks. However, third party filters are, fortunately, another matter, and some of them allow you to generate some nice organic touches in your Fireworks artwork. 1). The Plugin: Cybia offer a range of really handy, quality freeware filters that work perfectly in Fireworks (and Photoshop and PSP, for that matter). Download Mezzy, pop it into your plugins folder, make sure your preferences point to the plugins folder, and restart Fireworks. You should see 'Cybia' in the filter menu.
It's nice, but a little too clean for my liking.
I've applied the Cybia Mezzy filter using the stock-standard 'Whiten' setting.
You'll notice that applying any of these filters converts the object to a bitmap, so make sure you scale your work BEFORE applying the filter.
Think of the 'Multiply' channel as analogous to overlaying two copies of the same slide on a light table -- the highlights say relatively similar, but the darker areas really fill in. As you can see, the final effect gives the graphic a rough, richer, almost pencil-rendered effect, and certainly takes its 'vectorishness' away. I've used it in an illustration here, but it could be equally effective in a logo, header or even icons. I hope this gives you some ideas. Layering simple filters like these can certainly give you some really original effects. But perhaps you'll still want to steer clear of that page curl effect, though...
Simple, fast and affordable Email and Postcard Marketing Easily create and send HTML Emails and customized,
full-color direct mail Postcard campaigns in minutes, right from your
browser. No technical expertise needed!
Styling Images with the DOMThe DOM is your friend. It can correct browser bugs, add site functionality and help you achieve presentation effects that simply are not possible with pure CSS. If you're a long-time DV reader, you might remember us fixing the HR tag (here's an example), and only this week I was admiring some of Chris Campbell's DOM-powered handiwork in the design blog. Let's stick with that theme.
In the past, there wasn't much choice. You made a nice framing template in Photoshop or Fireworks, dropped your picture behind it and exported your new image. The problem with this is that, although the image itself is considered 'content', the rounded corners are a 'design whim' that's only relevant to the current look and feel. If the client decided that the next redesign should be a little more slick and hard-edged, we would need to either re-author every image, or just accept it -- not good choices. So, what can we do? Not even CSS3 or Mozilla specific styles can offer us any help. This sounds like a job for... DOM-Man! First we need to look at how we might accomplish the effect, forgetting (for now) about good markup.
As you can see in the above diagram, the wrapping DIV is called '.wrapper' and needs to positioned relatively, and floated either left or right, to force it to tightly wrap the image. div.wrapper {
Our four inner DIVs are set to 'position:absolute', which automatically brings them to the front of our image regardless of where they appear in the code. Each will have the same width and height (7x7px in this case), but different positions and background graphics, something like this: div.wrapper div{
div.wrapper div.tl{
div.wrapper div.tr{
You can work out what DIV.BL and DIV.BR would be. Stitch it all together, and it works nicely. Now, that's all very nice but obviously we can't go around delicately wrapping each new image by hand, like little 'virtual sushi rolls'. No, we can delegate this menial task to the browser. If the browser can't handle it, it has failed and its owner is condemned to seeing square images! Ha HA! Like our HR function, our script is a 'son' of Simon Willison's earlier Rounded Corners with DOM article. I'm going to run through it quickly here, but the source in the example is amply commented. I've decided in this case to target only the images within a specified DIV -- 'DIV#content' -- but it wouldn't be hard to alter the script to target all images, or only those images with a certain class. To start, we'll declare a new function (roundedImages), grab all the elements inside #content, then filter out everything but the images. They're waiting for us to use in an array call 'imgs[]'. function roundedImages() {
Next, we start a loop to process our list of images. We create a brand new DIV, attach the 'wrapper' class to it, select the first image, and replace it (for now) with our new DIV. for (var i = 0; i < imgs.length; i++) {
Now we'll need to fabricate our four corner DIVs and attach the appropriate classes to each. The code is fairly clean. var tl = document.createElement('div');
Ok, we have our corner DIVs but they aren't actually in the document. We can use 'appendChild' to glue them into our wrapper DIV. To complete the loop, we glue our original image back into the wrapper; then we're ready to grab the next image. wrapper.appendChild(tl); Lastly, we simply have to run the function as the page loads. window.onload = roundedImages; And that's it. Pop it into your <head> with your CSS, and you're rounding with the best of 'em! This is a first generation experiment and has some limitations. DIV.wrapper needs to be floated, so your images will appear to be floated too. There also seems to be a bug in IE6 (No! Never!) that causes a 1px mis-alignment on the right and bottom sides of images with odd widths and heights. Totally bizarre. It appears to be a rounding error (no pun intended) and, at the moment, the best solution I have is to use even-numbered image dimensions. If you have better IE voodoo, I'd certainly love to hear it. Otherwise, it seems to be quite solid. Certainly it's fast, degrades elegantly and there are endless potential variations on this simplest of themes. Hope you have fun playing around with it. Read the blog entry:
That's all for this issue -- thanks for reading! I'll see you in a few weeks.
Alex Walker
Help Your Friends OutPeople you care about can benefit from the wealth of information on new and maturing technologies available on the Internet. Help them learn how to do it by forwarding them this issue of the SitePoint Design View! |
Download free chapters from every SitePoint Book!
DHTML Utopia: Modern Web Design
Using JavaScript & DOM
Get Cooking with Photoshop and CSS - 3 Low-fat Recipes
Variety is the spice of life! With Photoshop, CSS, and a little creativity, you can enjoy a feast of design options. Corrie shows how easy it is to tweak the graphic ingredients of your designs to produce completely different results. She cooks up three tasty design styles in Photoshop, then shows, step-by-step, how to reproduce them using CSS. Don’t worry, folks: all recipes are provided in full!
Seven Screen Reader Usability Tips
Who says making a site usable to screen reader users is a pain? Trenton provides 7 quick, easy fixes that boost your site's usability for all visitors, including those who use screen reader technology.
You Don't Know Jack About Firefox!
Think you know it all? Think again! Chu Yeow explains some of Firefox's lesser-known features - such as about:config, the JavaScript Console and the DOM Inspector - in this sample of Firefox Secrets, SitePoint's new release.
Design Blog:
DHTML & CSS
Blog:
|
||
|
Manage Your Subscription Here.
SitePoint Pty. Ltd. Thanks for reading! |
|||
|
© SitePoint 1998-2005. All Rights Reserved.
|
|||
Design, coding, community or marketing? Select the right newsletters right for your needs...