Scattered Polaroids Gallery

A flat-style Polaroid gallery where the items are scattered randomly in a container. When a specific item is selected, it will move to the middle while the other Polaroids will make space for it by moving to the sides. Optionally, an item can have a backface which will be shown by flipping the Polaroid when clicking on the current navigation dot again.
ScatteredPolaroidGallery

From our monthly sponsor: Automate manual QA and catch visual bugs with Percyโ€™s all-in-one visual testing and review platform.

Today we’d like to share a little gallery experiment with you. We wanted to revisit the classic look of scattered Polaroids and bring it to a next, flat level with some nice effects. The resulting gallery shows some Polaroid images with a title, randomly rotated and spread in a container. When navigating the images, the current one will be moved to the center and the resting Polaroids will move to the sides. Optionally, we’ll have a backside for each Polaroid which can be viewed by clicking the current dot of the navigation again. The indication for an existing backside will be a rotated arrow on the dot. Once the dot is clicked again, the dot itself will flip and so will the Polaroid, revealing the description on the back.

We use the following structure for the gallery:

<section id="photostack-1" class="photostack photostack-start">
	<div>

		<!-- default Polaroid without backside -->
		<figure>
			<a href="http://goo.gl/Qw3ND4" class="photostack-img">
				<img src="img/1.jpg" alt="img01"/>
			</a>
			<figcaption>
				<h2 class="photostack-title">Serenity Beach</h2>
			</figcaption>
		</figure>

		<!-- Polaroid with backside -->
		<figure>
			<a href="http://goo.gl/fhwlSP" class="photostack-img">
				<img src="img/2.jpg" alt="img02"/>
			</a>
			<figcaption>
				<h2 class="photostack-title">Happy Days</h2>
				<!-- optional backside -->
				<div class="photostack-back">
					<p>Fish don't fry in the kitchen and beans don't burn on the grill. Took a whole lotta tryin' just to get up that hill. Baby if you've ever wondered - wondered whatever became of me. </p>
				</div>
			</figcaption>
		</figure>

		<!-- Example for different shuffle iteration count -->
		<figure data-shuffle-iteration="3">
			<!-- ... -->
		</figure>

		<!-- Example for a "dummy" Polaroid -->
		<figure data-dummy>
			<a href="#" class="photostack-img"><img src="img/7.jpg" alt="img07"/></a>
			<figcaption>
				<h2 class="photostack-title">Lovely Green</h2>
			</figcaption>
		</figure>
		
		<!-- ... -->
	</div>
</section>

The “photostack-start” class can be used to show an initial overlay on the gallery container. Once the gallery is clicked, the items will make their first move and the first item will be shown in the middle.

The div with the class “photostack-back” can be used to insert some more info for the backside of the Polaroid.

The shuffle iteration count (the amount of times we want all Polaroids to move around before the next item becomes current) can be controlled with the data-attribute data-shuffle-iteration.

The can also contain “dummy” items which will be shown in the container but which will not be part of the viewable gallery. This can be useful in cases where only a subset of a certain image collection should be shown. Imagine an article about your travels where in each section you describe a specific location. You’d set the irrelevant items as dummies and only the Polaroids that are specific to that location would be viewable in detail. In the next section you’d set the others to dummies.

Note that the main wrapping div (immediate child of the section) is set to a width and height of 100%, which means that the items will be scattered across the whole container. If we would like to compact the space of spreading, we could also set the dimension of that div to a smaller one.

Take a look at some screenshots of the gallery:

Optionally, the initial state of the gallery can have an overlay
Optionally, the initial state of the gallery can have an overlay

The current image moves to the middle and the resting items will make way and move to the sides
The current image moves to the middle and the resting items will make way and move to the sides
If there is a backside, we can flip the Polaroid by clicking on the navigation dot for a second time
If there is a backside, we can flip the Polaroid by clicking on the navigation dot for a second time

I hope you like this gallery idea and find it inspirational ๐Ÿ™‚

Tagged with:

Mary Lou

ML is a freelance web designer and developer with a passion for interaction design. She studied Cognitive Science and Computational Logic and has a weakness for the smell of freshly ground peppercorns.

http://www.codrops.com

Receive our bi-weekly Collective or official newsletter right in your inbox.

CSS Reference

Learn about all important CSS properties from the basics with our extensive and easy-to-read CSS Reference.

It doesn't matter if you are a beginner or intermediate, start learning CSS now.

Feedback 90

Comments are closed.
  1. Hey the Github link is not working ๐Ÿ™

    This is really cool btw, keep up the good work.

  2. Hello there, loved your gallery, I’m trying to do something similar but with song and auto slide..
    I know how to put my audio file, but for the auto-slide.. is there a simple way for photostack to set an interval and do ‘next’?
    Thank you !!

  3. I tried it on my Galaxy Trend and it’s really sweet. I didn’t see the entire gallery but it was still working and was useable.

  4. This is nice…good work! But would be great if you can click on any picture and then effects to the middle ๐Ÿ™‚

  5. Nice gallery.
    Could it be possible to expand it with autorotation of the images with stopping on hover. It would be a nice feature that could be used many places. Maybe an idea for your next project? ๐Ÿ™‚

  6. Awesome work..
    Can you please tell me the fonts used in back of image I really liked it and want to use it on my site
    *I am a newbie and don’t know how to find it of my own

  7. Hi

    Really like the effect. What I would like to do is properly shuffle the cards every time what would be easiest way to do this?

  8. I love the attention to detail in order for it to stay consistent with ‘flat’ design. Nice job.

  9. Hola chicos, me encanta su blog, uso mucho de su material para paginas de mis clientes, me parece muy bueno todo lo que hacen y se que en algun momento estare en su altura.

    Thank you!
    From Argentina!