Advertisement
Guest User

overlay effect

a guest
Jun 28th, 2023
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <div id="intro-overlay">
  2. <div class="overlay-text">Text Here</div>
  3. </div>
  4.  
  5.  
  6. <style>
  7. #intro-overlay {
  8. position: fixed;
  9. display: block;
  10. width: 100%;
  11. height: 100%;
  12. top: 0;
  13. left: 0;
  14. background-color: black;
  15. z-index: 9999 !important;
  16. cursor: pointer;
  17. transition: top 2s ease-out 2.8s; /* Change top position with 2s ease-out after 2.8s */
  18. }
  19.  
  20. .overlay-text {
  21. position: absolute;
  22. top: 50%;
  23. left: 50%;
  24. transform: translate(-50%, -50%);
  25. color: white;
  26. font-size: 30px;
  27. text-align: center;
  28. }
  29. </style>
  30.  
  31. <script>
  32. window.onload = function() {
  33. setTimeout(function() {
  34. document.getElementById('intro-overlay').style.top = '-100%';
  35. }, 2800); // After 2.8 seconds
  36. }
  37. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement