Advertisement
retnet

css overlay

Feb 21st, 2024
802
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.77 KB | None | 0 0
  1. .modal-overlay {
  2.   position: fixed;
  3.   height: 100vh;
  4.   width: 100%;
  5.   left: 0;
  6.   top: 0;
  7.   background: rgba(0, 0, 0, 0.4);
  8.   pointer-events: none;
  9.  
  10.   opacity: 0;
  11.   transition: all 400ms ease;
  12. }
  13.  
  14. .modal-overlay.active {
  15.   opacity: 1;
  16. }
  17.  
  18. .modal {
  19.   position: fixed;
  20.   top: 50%;
  21.   left: 50%;
  22.   transform: translate(-50%, calc(-50% - 10px));
  23.   z-index: 300;
  24.   background: #fff;
  25.   min-width: 550px;
  26.   font-family: "Roboto", sans-serif;
  27.   box-shadow: 0 5px 26px -8px rgba(0, 0, 0, 0.3);
  28.   border-radius: 20px;
  29.   display: flex;
  30.  
  31.   opacity: 0;
  32.   pointer-events: none;
  33.   transition: all 400ms ease;
  34. }
  35.  
  36. .modal.active {
  37.   opacity: 1;
  38.   pointer-events: auto;
  39.   transform: translate(-50%, -50%);
  40. }
  41.  
  42. .modal .close-btn {
  43.   position: absolute;
  44.   right: 20px;
  45.   top: 20px;
  46.   font-size: 20px;
  47.   cursor: pointer;
  48.   padding: 4px;
  49. }
  50.  
  51. .modal .left {
  52.   background: #242424;
  53.   color: #fff;
  54.   border-radius: 20px;
  55.   box-shadow: 17px 0 17px -8px rgba(0, 0, 0, 0.3);
  56.   padding: 24px 16px;
  57.   text-align: center;
  58. }
  59.  
  60. .modal .left h3 {
  61.   font-size: 22px;
  62.   text-transform: uppercase;
  63.   margin: 0;
  64. }
  65.  
  66. .modal .left h3.sale-text {
  67.   font-size: 36px;
  68. }
  69.  
  70. .modal .left .discount p {
  71.   font-size: 13px;
  72.   text-transform: uppercase;
  73.   letter-spacing: 3px;
  74.   color: #ebff00;
  75.   margin: 0;
  76.   margin-top: 32px;
  77. }
  78.  
  79. .modal .left .discount .discount-percent {
  80.   font-size: 60px;
  81.   font-weight: 300;
  82. }
  83.  
  84. .modal .right {
  85.   padding: 32px;
  86.   display: flex;
  87.   flex-direction: column;
  88.   justify-content: center;
  89. }
  90.  
  91. .modal .right h2 {
  92.   margin: 0;
  93.   text-transform: uppercase;
  94.   font-size: 24px;
  95. }
  96.  
  97. .modal .right p {
  98.   color: #222;
  99. }
  100.  
  101. .modal .right .discount-btn {
  102.   text-decoration: none;
  103.   background: #ff5555;
  104.   align-self: flex-start;
  105.   padding: 8px 32px;
  106.   color: #fff;
  107.   text-transform: uppercase;
  108.   font-weight: bold;
  109.   border-radius: 20px;
  110. }
  111.  
  112. .modal .bg-shape {
  113.   position: absolute;
  114.   height: 12px;
  115.   width: 40%;
  116.   background: linear-gradient(180deg, #04b6c1 0%, #0e8a91 100%);
  117.   border-radius: 20px 20px 0 0;
  118.   top: -12px;
  119.   left: 40%;
  120. }
  121.  
  122. @media (max-width: 600px) {
  123.   .modal {
  124.     flex-direction: column;
  125.     min-width: 300px;
  126.   }
  127.  
  128.   .modal .bg-shape {
  129.     display: none;
  130.   }
  131.  
  132.   .modal .close-btn {
  133.     color: #eee;
  134.     right: 8px;
  135.     top: 8px;
  136.   }
  137.  
  138.   .modal .left .discount-text {
  139.     display: flex;
  140.     gap: 8px;
  141.     justify-content: center;
  142.   }
  143.  
  144.   .modal .left h3,
  145.   .modal .left h3.sale-text {
  146.     font-size: 24px;
  147.   }
  148.  
  149.   .modal .left .discount p {
  150.     margin-top: 20px;
  151.   }
  152.  
  153.   .modal .right {
  154.     padding: 24px;
  155.     text-align: center;
  156.   }
  157.  
  158.   .modal .right h2 {
  159.     text-transform: none;
  160.   }
  161.  
  162.   .modal .right h2 br {
  163.     display: none;
  164.   }
  165.  
  166.   .modal .right .discount-btn {
  167.     align-self: auto;
  168.   }
  169. }
  170.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement