Advertisement
nicuf

loading html cass loader

Nov 30th, 2023
703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.15 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Page Loader with Counters</title>
  6.     <style type="text/css">
  7.         /* Stilurile pentru loader */
  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 #3498db;
  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.         /* Stilurile pentru counter-uri */
  40.         /* ... stilurile dvs. pentru .counter, .counter:before, etc ... */
  41.     </style>
  42. </head>
  43. <body>
  44.     <!-- Loader -->
  45.     <div class="loader">
  46.         <div class="loader-inner"></div>
  47.     </div>
  48.  
  49.     <!-- Conținutul paginii, inclusiv counter-urile -->
  50.     <div class="container" style="display:none;" id="page-content">
  51.         <!-- Elementele dvs. counter aici -->
  52.     </div>
  53.  
  54.     <script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
  55.     <script>
  56.         window.addEventListener('load', function() {
  57.             document.querySelector('.loader').classList.add('hidden');
  58.             document.getElementById('page-content').style.display = 'block';
  59.  
  60.             // Initializarea și animația counter-urilor
  61.             $('.counter-value').each(function(){
  62.                 $(this).prop('Counter',0).animate({
  63.                     Counter: $(this).text()
  64.                 },{
  65.                     duration: 3500,
  66.                     easing: 'swing',
  67.                     step: function (now){
  68.                         $(this).text(Math.ceil(now));
  69.                     }
  70.                 });
  71.             });
  72.         });
  73.     </script>
  74. </body>
  75. </html>
  76.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement