← Back to blogYouTube Video

Published April 11, 2025

Landing Page Design Tutorial - NextJS & Tailwind (Travel Agency) - Part 8

Part 8 of 13 in Landing Page Design with Next.js & Tailwind

Can't play the video or having issues? Here's the direct link.

Summary

I build the social photo grid for the travel agency landing page in Next.js and Tailwind, using a hover overlay to reveal an Explore More button. I create a posts array with image and location fields, render it in a flex row with gap, and wrap each image in a relative, overflow-hidden container. On hover, a white overlay fades to 80% opacity over 300ms and the image scales, with an Instagram icon and external Explore More button inside. That completes this section of the landing page.

Key takeaways

  • Store social gallery items in a posts array with image and location fields so the markup stays clean and easy to extend.
  • Use a relative, overflow-hidden wrapper around each image so the hover overlay and image scale stay clipped to the rounded card.
  • Drive the hover effect with Tailwind’s group and group-hover classes: fade the overlay to 80% opacity over 300ms and scale the image.
  • Make gallery images full height with object-cover and object-center so every card fills its column consistently.
  • Put the Instagram icon and Explore More button inside the overlay, not on the base image, so the hover state reveals the action cleanly.

Description

Source code: https://github.com/hassanaziz0012/travel-buddy

Transcript

Auto-generated transcript
all right continuing where we left off this is the entire landing page that we've built so far we've come really far along with this and for this one we're going to build this social section where we basically have a bunch of travel pictures and if you hover over them you get this cool little effect where you can add some more content. I just you can add whatever you want. This is what we're going to build. So let's go back to our Explorer here and create a social component. I'll change this to a section and I'll give it some padding and also an orange 50 color for the background. Now let's add a container and inside that container let's add the heading label. We'll call it social and right below that let's add the section heading. and I'll wrap this text in our brand color. Now with that done let's see what this looks like and to do that let's first render this on our page right here. There we go and this is what we have so far. Now we need to add a bunch of stock photos here and I just going to speed that up as always And now I'm just going to add a destinations variable over here and I'll put everything inside that or actually I'll call it posts and I'll put everything inside it. We'll add the image, the location, and the... yeah that's about it. And I'll copy this four times. Make sure you use the correct path for each image. and now let's add the location names as well of course all of these are just examples none of these are real okay with that done let's actually render all of these so just below the section headings let's create another div and render our posts inside it We'll add the key here and up here we'll also give it some flexbox and gap and also margin top. Now for this one let give it basis zero and grow and inside let render the image and right below that i'll add an h3 with these classes which will show the location now for the image let's add a bunch more classes let's give it full height and make it object cover and object center and we have this and now we have this now let's also make it rounded let's make it a bit more rounded Now for the location, let's add some other stuff here. Let's move this all into a span. And before that, let's add an icon, which is our social Instagram icon. And let's make this a flexbox to align the icon properly. And there we go. Now let's move the image into a div and give that div the class of relative and also overflow hidden. And we make it rounded same as the image let add the overlay over this so we can show our button as well let's give it full height to fix that issue and now we don't need to make the image grounded anymore Okay, so let's give this a background of white with... Yeah, just white. Okay, and also make this a flexbox. And inside let's add the white external button component that we made. And we'll call it ExploreMore. I'll also make it border just so it's easier to see. And there we go. Now let's add the group class up here. And let's say on, we want to have zero opacity, but on group hover, let's give it 80% opacity. Let's also give it a duration of 300 milliseconds. So it looks more smooth and let's also give it some Z index of 10 Now same thing for the image, but on group power. We'll just scale it by And there we go And yeah with that we are done with this section this was a lot shorter than the usual one was yeah, we're done with this

Share this article

Hassan Aziz pointing up

Dude, you’re at the bottom of my landing page.

Just book a call already if you’re that interested.

You scrolled all the way here.