Jump to content

Hover element stroke on gallery picture + padding/color correction on description text under

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Hi,

I've made a "Latest work" gallery (grid:simple) block on my home page.
I'd like each image link to have a "hover" property like on my portfolio pages.


Current layout: hover does nothing different and text description padding is too low on image.
image.thumb.png.74ccd45efd0491326c03848d9c3b4a9e.png

After changes:
1. padding on description text is closer up on image
2. Description text is this color #656565
3. Hover over stroke color #42c6ff + 5px stroke + image 20% bigger like in portfolio pages (motion/design/illustration)

Desired look:

after-look.thumb.jpg.635e5fc09796ecf789456f1c2ad65cc9.jpg

Web:
https://ellipse-teal-dl5w.squarespace.com/

Pass: 3

Cheers,

Mac

Posted

https://ellipse-teal-dl5w.squarespace.com/illustration

Sure here's the link thanks.

Here's the css code I applied to the portfolio pages also to get stroke border:
 

/*PORTFOLIO HOVER_________________*/

/* Show stroke border overlay on hover */
.grid-image {
    opacity: 1 !important;
    position: relative;
}

.grid-image:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 5px solid rgba(66,198,255,0.8); /* change border color here */
    transition: all 0.3s;
    opacity: 0;
    box-sizing: border-box;
}

.grid-item:hover .grid-image:after {
    opacity: 1;
    transition: all 0.3s;
}

/*PORTFOLIO HOVER END______________*/
//-----------------------------------



 

  • Solution
Posted

Use this code for Gallery

/* Replicate hover effect on Gallery */
.gallery-grid-image-link {
    opacity: 1 !important;
    overflow: hidden;
}

.gallery-grid-image-link:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 5px solid rgba(66,198,255,0.8); /* change border color here */
    transition: all 0.3s;
    opacity: 0;
    box-sizing: border-box;
}

figure.gallery-grid-item:hover .gallery-grid-image-link:after {
    opacity: 1;
    transition: all 0.3s;
}
figure.gallery-grid-item:hover img {
    transform: scale(1.1);
    transition: all 0.3s;
}
figure.gallery-grid-item img {
    transition: all 0.3s;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.