Advertisement
ikai2

image with hover text

Sep 12th, 2022 (edited)
1,147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.88 KB | None | 0 0
  1. /* add a block/column and give it this class: stacked */
  2.  
  3. .stacked {
  4.     display: grid;
  5.     place-items: end center;
  6.     isolation: isolate;
  7.     --animation: all 350ms ease-in-out;
  8. }
  9. .stacked > * {
  10.     grid-column: 1 / -1;
  11.     grid-row: 1 / -1;
  12. }
  13. .stacked::before {
  14.     content: "";
  15.     position: absolute;
  16.     inset: 0;
  17.     backdrop-filter: blur(5px);
  18.     -webkit-backdrop-filter: blur(5px);
  19.     opacity: 0;
  20.     transition: var(--animation);
  21. }
  22. .stacked:hover::before {
  23.     opacity: 1;
  24. }
  25. .stacked > [data-pf-type="Image"], .stacked > [data-pf-type="ProductMedia"] {
  26.     z-index: -1;
  27. }
  28. .stacked > [data-pf-type="Heading"], .stacked > [data-pf-type="Paragraph"] {
  29.     transform: translateY(100%);
  30.     opacity: 0;
  31.     transition: var(--animation);
  32.     visibility: hidden;
  33. }
  34. .stacked:hover > [data-pf-type="Heading"], .stacked:hover > [data-pf-type="Paragraph"] {
  35.     transform: translateY(0%);
  36.     opacity: 1;
  37.     visibility: visible;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement