Jump to content

Adding Overlay Captions to Packed Gallery

Recommended Posts

Add to Design > Custom CSS

/* Images overlay */
div#page-section-628fca388c857c062397772f figure a:after {
    content: "";
    background-color: rgba(0,0,0,0.5);
    position: absolute;
    z-index: 900;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

 

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

Link to comment
On 5/27/2022 at 8:57 PM, TheBrattleboro said:

Thanks @tuanphan

I think I may have asked in a confusing way. Can I try again?


Is there a way to get these captions to hover OVER the photo while controlling the font styles? It would be even better if they appear on hover. Thank you again!

Screen Shot 2022-05-27 at 9.56.34 AM.png

You mean

Initial: show image, no text

Hover: show image, show overlay, show text over overlay

Is this right?

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

Link to comment
9 hours ago, TheBrattleboro said:

That is correct! Image with dark overlay and text overlay.

Try adding to Design > Custom CSS

/* Masonry hover */
[data-section-id="627ecc448851d864ffb7543e"] {
figure.gallery-masonry-item {
    position: relative;
}
.gallery-caption {
    position: static;
}
/* title */
.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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
}
/* overlay */
.gallery-masonry-item-wrapper a:after {
    background: rgba(0,0,0,0.5); /* overlay color */
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity ease 200ms !important;
}
.gallery-masonry-item:hover .gallery-masonry-item-wrapper a:after {
    opacity: 0.75;
}
/* remove gap */
figcaption {
    padding: 0 !important;
}}

 

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

Link to comment
7 hours ago, tuanphan said:

Try adding to Design > Custom CSS

/* Masonry hover */
[data-section-id="627ecc448851d864ffb7543e"] {
figure.gallery-masonry-item {
    position: relative;
}
.gallery-caption {
    position: static;
}
/* title */
.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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
}
/* overlay */
.gallery-masonry-item-wrapper a:after {
    background: rgba(0,0,0,0.5); /* overlay color */
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity ease 200ms !important;
}
.gallery-masonry-item:hover .gallery-masonry-item-wrapper a:after {
    opacity: 0.75;
}
/* remove gap */
figcaption {
    padding: 0 !important;
}}

 

Thank you! It's working well, but I wanted to change the font so I injected the following bolded part. Now when I hover, I see the large caption, but as I pull my mouse away, I still see the small caption in the back. How can I adjust this?

 

/* Masonry hover buttons */
[data-section-id="627ecc448851d864ffb7543e"] {
figure.gallery-masonry-item {
    position: relative;
}
.gallery-caption {
    position: static;
  
}
/* title */
.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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
      font-family: orpheus-pro;
      font-size: 3em;
      color: #F9F8ED;

}
/* overlay */
.gallery-masonry-item-wrapper a:after {
    background: rgba(0,0,0,0.5); /* overlay color */
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity ease 200ms !important;
}
.gallery-masonry-item:hover .gallery-masonry-item-wrapper a:after {
    opacity: 0.75;

}
/* remove gap */
figcaption {
    padding: 0 !important;
  
}}

Link to comment
15 hours ago, TheBrattleboro said:

Thank you! It's working well, but I wanted to change the font so I injected the following bolded part. Now when I hover, I see the large caption, but as I pull my mouse away, I still see the small caption in the back. How can I adjust this?

 

/* Masonry hover buttons */
[data-section-id="627ecc448851d864ffb7543e"] {
figure.gallery-masonry-item {
    position: relative;
}
.gallery-caption {
    position: static;
  
}
/* title */
.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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
      font-family: orpheus-pro;
      font-size: 3em;
      color: #F9F8ED;

}
/* overlay */
.gallery-masonry-item-wrapper a:after {
    background: rgba(0,0,0,0.5); /* overlay color */
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity ease 200ms !important;
}
.gallery-masonry-item:hover .gallery-masonry-item-wrapper a:after {
    opacity: 0.75;

}
/* remove gap */
figcaption {
    padding: 0 !important;
  
}}

edit this

/* title */
.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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
      font-family: orpheus-pro;
      font-size: 3em;
      color: #F9F8ED;
}

to this

/* title */
.gallery-caption-content {
      font-family: orpheus-pro;
      font-size: 3em;
      color: #F9F8ED;
    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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
}

 

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

Link to comment
8 hours ago, tuanphan said:

edit this

/* title */
.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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
      font-family: orpheus-pro;
      font-size: 3em;
      color: #F9F8ED;
}

to this

/* title */
.gallery-caption-content {
      font-family: orpheus-pro;
      font-size: 3em;
      color: #F9F8ED;
    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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
}

 

I injected the following code, but the font / type is not changing.

https://www.thebrattleboro.com/home-1

 

/* Images overlay */
div#page-section-628fca388c857c062397772f figure a:after {
    content: "";
    background-color: rgba(0,0,0,0.5);
    position: absolute;
    z-index: 900;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

//* Masonry hover */
[data-section-id="627ecc448851d864ffb7543e"] {
figure.gallery-masonry-item {
    position: relative;
}
.gallery-caption {
    position: static;
}
/* title */
.gallery-caption-content {
      font-family: orpheus-pro;
    font-size: 3em;
    color: #F9F8ED;
    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;
}
.gallery-masonry-item:hover .gallery-caption-content {
    opacity: 1 !important;
}
/* overlay */
.gallery-masonry-item-wrapper a:after {
    background: rgba(0,0,0,0.5); /* overlay color */
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity ease 200ms !important;
}
.gallery-masonry-item:hover .gallery-masonry-item-wrapper a:after {
    opacity: 0.75;
}
/* remove gap */
figcaption {
    padding: 0 !important;
}}

Link to comment

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.