Jump to content

Help with hovering Captions & effects for images on a Masonry Grid

Go to solution Solved by Web_Solutions,

Recommended Posts

Posted

Hi,

I am trying to create a text on hover after darkening (or if possible and preferred -- blurring) the image underneath using a Masonry grid gallery. How do I do that with code? Additional question is would I have the ability to change fonts? Do I keep the Lightbox feature on?

For example like how did sample Squarespace site did it (but I would love if my captions showed up quicker): https://www.claireandayesh.com/auto-photography

This is a link to the page on my site here: https://www.aminakahmad.com/photography

Thank you so very much ahead of time. I am so confused right now hahaha.

Appreciate ALL the help.

Best,

Amina

Screen Shot 2024-01-15 at 4.51.37 PM.png

  • Replies 9
  • Views 2.5k
  • Created
  • Last Reply

Top Posters In This Topic

Posted
5 hours ago, aminakahmad said:

 

Hi,

I am trying to create a text on hover after darkening (or if possible and preferred -- blurring) the image underneath using a Masonry grid gallery. How do I do that with code? Additional question is would I have the ability to change fonts? Do I keep the Lightbox feature on?

For example like how did sample Squarespace site did it (but I would love if my captions showed up quicker): https://www.claireandayesh.com/auto-photography

This is a link to the page on my site here: https://www.aminakahmad.com/photography

Thank you so very much ahead of time. I am so confused right now hahaha.

Appreciate ALL the help.

Best,

Amina

Screen Shot 2024-01-15 at 4.51.37 PM.png

Add caption on each image and enable the caption. Then I can provide you code for the hovering effect 

Screenshot_36.png

Screenshot_35.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Posted
13 hours ago, Web_Solutions said:

Add caption on each image and enable the caption. Then I can provide you code for the hovering effect 

Screenshot_36.png

Screenshot_35.png

@Web_Solutions - Thank you so much! I added captions to the site and enabled captions to show. Thank you so much for your helping with this. Two things -- 1) Would love if the part of my caption that is in the brackets show up on the second line of the hovered caption. 2) Also, is there a way to only enable the hover caption feature for masonry grid galleries for only this specific webpage? I wouldn't want it messing with the other masonry grid galleries on the other webpages! Thank you in advance.

  • Solution
Posted
5 hours ago, aminakahmad said:

@Web_Solutions I was playing around and was able to get it in somewhat of a decent place (YAY!!!) but two questions still:

1 -- Can I have the hovering captions only show up on that particular page (https://www.aminakahmad.com/photography). I don't want it messing with any gallery grids on the other pages.

2 -- Can I adjust the font size and font type for the hovering captions?

Thank you so much!!!

 

Replace your code with the the code below. And you can change the font size 20px to as you want.

[data-section-id="65119e1c70d8ea7c423d0729"] figure.gallery-masonry-item {
    position: relative
}

[data-section-id="65119e1c70d8ea7c423d0729"] .gallery-caption {
    position: static
}

[data-section-id="65119e1c70d8ea7c423d0729"] .gallery-caption-content {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 7%;
    transition: opacity ease 200ms !important;
    opacity: 0 !important;
    pointer-events: none
}

[data-section-id="65119e1c70d8ea7c423d0729"] .gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important
}

[data-section-id="65119e1c70d8ea7c423d0729"] .gallery-masonry-item-wrapper a:after {
    background: rgba(0,0,0,.5);
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity ease 200ms !important
}

[data-section-id="65119e1c70d8ea7c423d0729"] .gallery-masonry-item:hover .gallery-masonry-item-wrapper a:after {
    opacity: .75
}

[data-section-id="65119e1c70d8ea7c423d0729"] .gallery-masonry-item * {
    color: #fff
}

[data-section-id="65119e1c70d8ea7c423d0729"] figcaption {
    padding: 0 !important
}

[data-section-id="65119e1c70d8ea7c423d0729"] p.gallery-caption-content {
    text-align: center
}

[data-section-id="65119e1c70d8ea7c423d0729"] .gallery-caption-content {
    font-size: 20px !important
}

 

Screenshot_41.png

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

  • 2 months later...
Posted

Hello @Web_Solutions but exactly where do I paste this code to specifically relate to my masonry grid? I'm having trouble figuring out where to put the code. When I add a block and add "code" and use the pencil to edit and paste your code, it just shows up as plain text. 

Posted
On 3/21/2024 at 5:59 AM, ArcherDougherty said:

Hello but exactly where do I paste this code to specifically relate to my masonry grid? I'm having trouble figuring out where to put the code. When I add a block and add "code" and use the pencil to edit and paste your code, it just shows up as plain text. 

You need to add it to Website > Website Tools > Custom CSS

Custom Css Menu Min

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!)

Posted (edited)

Thank you! How do I apply this hovering effect only to image galleries that are also clickthrough links? I don't want it to affect all the galleries, as I'm an artist and that's a lot of images lol. I've been through so many forum threads and can't find a simple solution and none of the code is working anymore, as all I've found is a few years old at this point. My website is https://cobalt-mustard-hn3a.squarespace.com/ and is still in trial

 

Edited by ArcherDougherty
poor wording
Posted
On 3/27/2024 at 9:39 PM, ArcherDougherty said:

Thank you! How do I apply this hovering effect only to image galleries that are also clickthrough links? I don't want it to affect all the galleries, as I'm an artist and that's a lot of images lol. I've been through so many forum threads and can't find a simple solution and none of the code is working anymore, as all I've found is a few years old at this point. My website is https://cobalt-mustard-hn3a.squarespace.com/ and is still in trial

 

You can follow this to share url.

And which page you want to apply effect? or apply for all pages, but for Linked Image only?

 

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.