Advertisement
nicuf

loader page html loading code

Nov 30th, 2023
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.01 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.  
  5.   <meta charset="UTF-8">
  6.   <title>Page Loader</title>
  7.  <style type="text/css">
  8.   .loader {
  9.   position: fixed;
  10.   top: 0;
  11.   left: 0;
  12.   width: 100%;
  13.   height: 100%;
  14.   background-color: #fff;
  15.   display: flex;
  16.   align-items: center;
  17.   justify-content: center;
  18.   z-index: 100;
  19. }
  20.  
  21. .loader-inner {
  22.   width: 50px;
  23.   height: 50px;
  24.   border-radius: 50%;
  25.   border: 10px solid #f3f3f3;
  26.   border-top: 10px solid #FF1493;
  27.   animation: spin 1s linear infinite;
  28. }
  29.  
  30. @keyframes spin {
  31.   0% { transform: rotate(0deg); }
  32.   100% { transform: rotate(360deg); }
  33. }
  34.  
  35. .hidden {
  36.   display: none;
  37. }
  38.  
  39. </style>
  40. </head>
  41. <body>
  42.   <div class="loader">
  43.     <div class="loader-inner"></div>
  44.   </div>
  45.  
  46.  
  47.   <div class="container">
  48.     <h1>Welcome!</h1>
  49.     <p>This is the content of the page.</p>
  50.   </div>
  51.  
  52.   <script>
  53.     window.addEventListener('load', function() {
  54.       document.querySelector('.loader').classList.add('hidden');
  55.     });
  56.   </script>
  57. </body>
  58. </html>
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement