Fantastic portraits can be made with almost everything, because anything we’ve seen in daily life would become part of art when they come to the artists. And right here we’d like to introduce you several 3D portraits created by Andrew Myers with nails. To complete every portrait, the designer needs to drive in 8000 to 10000 nails simply with his hands and his imagination, but relies on no hi- tech equipments such as computers. Well, his hard work makes these portraits extraordinarily amazing!
For the first time, Industrial Light & Magic did the visual effects on a fully animated feature. CNET takes a look at the process of making that film look like a live-action movie.
Ever since I saw Tyler Finck’s Sursly.com, I’ve been looking everywhere for an excuse to try out a smooth-scrolling horizontal layout like his. It’s by no means a new trend, but it’s one that few of us have had the opportunity to use, and it’s still unusual enough that you really do notice when you see it.
A sideways style lends itself well to designs with a bit of an “arty” feel: brochure-style sites, galleries, portfolios, and perhaps even sites that make use of interesting info-graphics or charts. Successful horizontal layouts often use animation and graphics to highlight their sideways movement — a large number of these sites use colorful images and nice, big backgrounds that really show this off. Unusual also means unfamiliar, so a well-designed horizontal layout will also make good use of navigation elements such as menus, arrows, and buttons to overcome any usability hitches.
As far as what goes into one of these sites — well, it turns out that it’s actually pretty easy. Let’s take a look at how to build our own groovy, scrolly, sideways website using just a bit of simple CSS and jQuery.
Planning it out
First of all, we’ll need to figure out what’s happening in this site. Imagine that we’re building a simple brochureware site for a fictional brick-and-mortar store selling fashionable shoes. There’s very little information to convey here:
a small piece of introductory text
a newsletter signup
directions and contact info
a contact form
Fashion is a pretty groovy sort of business, so the unusual horizontal layout is a good fit for this sort of site. If you can imagine each of the four items as being a panel, then you might arrange each of them in a row. Only one panel would be visible at one time, just as if they were separate pages, meaning that our layout’s overall width needs to be a good deal wider than the browser window — our viewport. In the diagram below, our viewport is represented by a red square surrounding the first panel, and the overall width of our body element is represented by a blue one:
This should be easy enough to code!
Adding markup and styles
To mark this up, we can use four little div elements inside a body. The markup for this might look something like the following example:
To achieve the effect of each panel being a standalone “page”, and also to give us some space to play with for our animation, we’ll need each of the panels to occupy at a lot more space than our viewport — let’s allow 960 pixels for the actual content, and an additional 1040 pixels for extra space, making each panel occupy a total of 2000 pixels in width. Here’s a little CSS to make this work for us:
You can see how this looks so far in demo 1, which also includes some content and shading. Unless you have a gratuitously wide monitor, you should only see one page at a time whilst you scroll from side to side. Groovy!
Adding navigation
This is all very well so far, but what about an easier way to move around the page? Let’s build a menu of four links:
Of course, the links’ targets match the divs’ IDs, so we know that clicking on each would let us leap straight to the relevant anchor on the page. However, as soon as we click one, our menu disappears — it’s back at the top left of the body element, where we can no longer see it. If we use a fixed position to attach the menu to the top of the page, we can even make sure it sticks around while we go zooming around. An item with fixed positioning is removed from the overall flow of the layout — we’ll need to add some more space at the top of those panels to leave room. While we’re at it, let’s make that menu look a little more like a menu:
We’ve made space for the menu by setting a line-height of 45 pixels, and a matching top margin on the panels to make sure they stay well clear. You can see the result in demo 2, where you can click all four links and bounce between panels.
Smooth scrolling
Now that you have your content and menu in place, you can use a little bit of jQuery to smoothly animate around your nice long canvas. We’ll listen out for clicks on our menu links, and then replace the default behaviour with our own: instead of just jumping right to that part of the page, we’ll smoothly scroll over to the right element using jQuery’s animation methods. Here’s what that looks like:
Here’s how that breaks down: first, we prevent the default behaviour from occurring. Next, we set up a variable to hold the href value of our link. Thirdly, we perform a few actions with both the html and body elements:
stop makes sure that any currently playing animations stop right away — if someone’s clicking on several menu links, we won’t have to wait for all the scrolling actions to complete.
Next, to animate our scroll behaviour — we work out where we need to scroll by calculating how far away our target is, relative to the left and top of the document, and use scrollLeft and scrollTop to do so.
We set a duration of 1200 milliseconds (1.2 seconds) for the effect, which should leave plenty of time for admiring the scenery as it whizzes by.
That’s all you need! Demo 3 shows you how it all comes together.
But what about the pretty stuff?
Now that you have the bones in place, you can start adding some colour and liveliness to your sidescrolling design. I’m certainly no Tyler Finck, but even I can improve on the grey, boxy demos we’ve seen before. In demo 4, you’ll see that I’ve added a big background image that changes the feel of the site from panel to panel. I’ve also added some opacity to the background colour on the menu, and rearranged the markup somewhat to allow for a title in the menu there. Finally, I’ve rearranged this somewhat so that when JavaScript is off, the layout reverts to a regular vertical-scrolling one.
Use previous and next buttons on each panel, guiding your readers along a path
Add some more adventurous background images in those big, wide gaps between content areas
Why be restricted to horizontal scrolling? Use this technique to zoom all over a big, square canvas!
Use JavaScript to add more or less space between panels, based on the current viewport size
Roll this into a set of media queries — little screens can certainly skip the show
However you choose to use it, one thing’s for sure — while this has been a bit of a trend in web design for awhile, it’s still unusual enough that your site’s sure to stand out. I know I’ll be considering it for my next mini site!
D3 is a small, free JavaScript library for manipulating HTML documents based on data. D3 can help you quickly visualize your data as HTML or SVG, handle interactivity, and incorporate smooth transitions and staged animations into your pages.
D3 is not a traditional visualization framework. Rather than provide a monolithic system with all the features anyone may ever need, D3 solves only the crux of the problem: efficient manipulation of documents based on data. This gives D3 extraordinary flexibility, exposing the full capabilities of underlying technologies such as CSS3, HTML5 and SVG. It avoids learning a new intermediate proprietary representation.