Advertisement
nicuf

load page 2

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