Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Page Loader with Counters</title>
- <style type="text/css">
- /* Stilurile pentru loader */
- .loader {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 100;
- }
- .loader-inner {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- border: 10px solid #f3f3f3;
- border-top: 10px solid #3498db;
- animation: spin 1s linear infinite;
- }
- @keyframes spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
- }
- .hidden {
- display: none;
- }
- /* Stilurile pentru counter-uri */
- /* ... stilurile dvs. pentru .counter, .counter:before, etc ... */
- </style>
- </head>
- <body>
- <!-- Loader -->
- <div class="loader">
- <div class="loader-inner"></div>
- </div>
- <!-- Conținutul paginii, inclusiv counter-urile -->
- <div class="container" style="display:none;" id="page-content">
- <!-- Elementele dvs. counter aici -->
- </div>
- <script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
- <script>
- window.addEventListener('load', function() {
- document.querySelector('.loader').classList.add('hidden');
- document.getElementById('page-content').style.display = 'block';
- // Initializarea și animația counter-urilor
- $('.counter-value').each(function(){
- $(this).prop('Counter',0).animate({
- Counter: $(this).text()
- },{
- duration: 3500,
- easing: 'swing',
- step: function (now){
- $(this).text(Math.ceil(now));
- }
- });
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement