Guest User

Untitled

a guest
May 31st, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. .container {
  6. display: flex;
  7. justify-content: center;
  8. align-items: center;
  9. height: 100vh;
  10. background-color: #757575;
  11. }
  12.  
  13. .window {
  14. width: 50%;
  15. height: 100vh;
  16. background-color: #000000;
  17. overflow: hidden;
  18. position: absolute;
  19. transition: all 1s ease;
  20. }
  21.  
  22. .window.left {
  23. left: 0;
  24. }
  25.  
  26. .window.right {
  27. right: 0;
  28. }
  29.  
  30. .line {
  31. position: absolute;
  32. bottom: 40%;
  33. left: 50%;
  34. transform: translateX(-50%);
  35. width: 0;
  36. height: 2px;
  37. background-color: #ffffff;
  38. transition: width 0.5s ease;
  39. }
  40.  
  41. .logo {
  42. position: absolute;
  43. top: 30%;
  44. left: 50%;
  45. transform: translate(-50%, -50%);
  46. transition: all 0.5s ease;
  47. opacity: 0;
  48. }
  49.  
  50. /* Add a fade-out class */
  51. .fade-out {
  52. animation-name: fadeOut;
  53. animation-duration: 1s;
  54. animation-fill-mode: forwards;
  55. }
  56.  
  57. @keyframes fadeOut {
  58. from { opacity: 1; }
  59. to { opacity: 0; }
  60. }
  61. </style>
  62. </head>
  63. <body>
  64. <div class="container">
  65. <div class="window left"></div>
  66. <div class="window right"></div>
  67. <div class="line"></div>
  68. <img class="logo" src="dot.png" alt="Logo">
  69. </div>
  70.  
  71. <script>
  72. const leftWindowElem = document.querySelector('.window.left');
  73. const rightWindowElem = document.querySelector('.window.right');
  74. const lineElem = document.querySelector('.line');
  75. const logoElem = document.querySelector('.logo');
  76.  
  77. setTimeout(() => {
  78. // Curtain-like effect - windows split open
  79. leftWindowElem.style.transform = 'translateX(-100%)';
  80. rightWindowElem.style.transform = 'translateX(100%)';
  81. setTimeout(() => {
  82. // Line opening effect
  83. lineElem.style.width = '0%';
  84. setTimeout(() => {
  85. lineElem.style.width = '70%';
  86. setTimeout(() => {
  87. // Logo dropping onto the line
  88. logoElem.style.opacity = '1';
  89. logoElem.style.top = '50%';
  90. setTimeout(() => {
  91. // Line closing effect
  92. lineElem.style.width = '0%';
  93. setTimeout(() => {
  94. // Reset positions and opacity
  95. leftWindowElem.style.transform = 'translateX(0)';
  96. rightWindowElem.style.transform = 'translateX(0)';
  97. logoElem.style.top = '50%';
  98. logoElem.style.opacity = '0';
  99. }, 500); // Delay for 0.5 seconds (500 milliseconds)
  100. }, 500); // Delay for 0.5 seconds (500 milliseconds)
  101. }, 1000); // Delay for 1 second (1000 milliseconds)
  102. }, 1000); // Delay for 1 second (1000 milliseconds)
  103. }, 1000); // Delay for 1 second (1000 milliseconds)
  104. }, 0); // Delay for 0 milliseconds (start immediately)
  105.  
  106. // Redirect to the three js scene after a specified amount of time
  107. setTimeout(() => {
  108. // Add the fade-out class to the body element
  109. document.body.classList.add('fade-out');
  110.  
  111. // Redirect to the second page after the fade-out animation has finished
  112. setTimeout(() => {
  113. window.location.href = "threejsscene.html";
  114. }, 1000); // Delay for 1 second (1000 milliseconds)
  115. }, 6000); // Delay for 6 seconds (6000 milliseconds)
  116. </script>
  117. </body>
  118. </html>
Advertisement
Add Comment
Please, Sign In to add comment