Advertisement
nicuf

load page 1

Nov 30th, 2023
996
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.97 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Page Loader with Counter</title>
  6.     <style type="text/css">
  7.         /* Stilurile pentru loader și counter */
  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.         .counter {
  22.             font-family: 'Open Sans', sans-serif;
  23.             text-align: center;
  24.             width: 190px;
  25.             padding: 25px 30px 10px;
  26.             margin: 10px;
  27.             border-radius: 30px 0;
  28.             box-shadow: 10px 10px 0 rgba(0,0,0,0.05);
  29.             position: relative;
  30.             z-index: 1;
  31.         }
  32.  
  33.         .counter:before {
  34.             content: "";
  35.             background: #51d658; /* Culoarea verde */
  36.             border-radius: 15px 0 30px 0;
  37.             box-shadow: inset 0 4px 8px rgba(0,0,0,0.15);
  38.             position: absolute;
  39.             top: 12px;
  40.             left: 12px;
  41.             right: 12px;
  42.             bottom: 27px;
  43.             z-index: -1;
  44.         }
  45.  
  46.         .counter h3 {
  47.             font-size: 17px;
  48.             font-weight: 500;
  49.             text-transform: uppercase;
  50.             letter-spacing: 1px;
  51.             margin: 0 0 20px;
  52.             color: #666;
  53.         }
  54.  
  55.         .counter-value {
  56.             font-size: 33px;
  57.             font-weight: 600;
  58.             line-height: 60px;
  59.             color: #666;
  60.         }
  61.  
  62.         /* ... alte stiluri ... */
  63.     </style>
  64. </head>
  65. <body>
  66.     <!-- Loader cu un singur counter -->
  67.     <div class="loader">
  68.         <div class="counter">
  69.             <h3>Încărcare...</h3>
  70.             <span class="counter-value" data-target="100">0</span>
  71.         </div>
  72.     </div>
  73.  
  74.     <!-- Conținutul paginii (ascuns inițial) -->
  75.     <div class="container" style="display:none;">
  76.         <h1>Welcome!</h1>
  77.         <p>This is the content of the page.</p>
  78.     </div>
  79.  
  80.     <script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
  81.     <script>
  82.         $(document).ready(function() {
  83.             var $counter = $('.counter-value'),
  84.                 countTo = $counter.attr('data-target');
  85.  
  86.             $({ countNum: $counter.text() }).animate({
  87.                 countNum: countTo
  88.             },
  89.             {
  90.                 duration: 5000,
  91.                 easing: 'linear',
  92.                 step: function() {
  93.                     $counter.text(Math.floor(this.countNum));
  94.                 },
  95.                 complete: function() {
  96.                     $counter.text(this.countNum);
  97.                 }
  98.             });
  99.         });
  100.  
  101.         window.addEventListener('load', function() {
  102.             $('.loader').fadeOut('slow', function() {
  103.                 $('.container').fadeIn();
  104.             });
  105.         });
  106.     </script>
  107. </body>
  108. </html>
  109.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement