Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Agregar estilos
- function add_ov_preloader_styles() {
- if (isset($_GET['et_fb'])) {
- return;
- }
- ?>
- <style>
- .ov-preloader-background {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: #ffffff; /* color fondo preloader */
- z-index: 999998;
- opacity: 1;
- transition: opacity 1s ease;
- }
- .ov-preloader-background.fade-out {
- opacity: 0;
- }
- .ov-preloader {
- position: fixed;
- width: 100%;
- height: 100vh;
- display: flex;
- z-index: 999999;
- }
- .ov-preloader-section {
- position: relative;
- width: 20%;
- height: 100%;
- background: #000000; /* color fondo transición preloader */
- transform: translateY(0);
- transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
- }
- .ov-preloader.ov-loaded .ov-preloader-section:nth-child(1) { transform: translateY(-100%); transition-delay: 0s; }
- .ov-preloader.ov-loaded .ov-preloader-section:nth-child(2) { transform: translateY(-100%); transition-delay: 0.2s; }
- .ov-preloader.ov-loaded .ov-preloader-section:nth-child(3) { transform: translateY(-100%); transition-delay: 0.4s; }
- .ov-preloader.ov-loaded .ov-preloader-section:nth-child(4) { transform: translateY(-100%); transition-delay: 0.6s; }
- .ov-preloader.ov-loaded .ov-preloader-section:nth-child(5) { transform: translateY(-100%); transition-delay: 0.8s; }
- .ov-loading-container {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- z-index: 10000;
- color: white;
- text-align: center;
- }
- .ov-loading-progress {
- font-size: 3rem;
- font-weight: 300;
- color: #ffffff; /* color contador */
- letter-spacing: 2px;
- opacity: 1;
- transition: opacity 0.5s ease;
- }
- .ov-preloader.ov-loaded .ov-loading-container {
- opacity: 0;
- }
- </style>
- <?php
- }
- add_action('wp_head', 'add_ov_preloader_styles');
- // Agregar HTML del preloader
- function add_ov_preloader_html() {
- if (isset($_GET['et_fb'])) {
- return;
- }
- ?>
- <!-- Preloader -->
- <div class="ov-preloader-background"></div>
- <div class="ov-preloader">
- <div class="ov-preloader-section"></div>
- <div class="ov-preloader-section"></div>
- <div class="ov-preloader-section"></div>
- <div class="ov-preloader-section"></div>
- <div class="ov-preloader-section"></div>
- <div class="ov-loading-container">
- <div class="ov-loading-progress">0%</div>
- </div>
- </div>
- <?php
- }
- add_action('wp_body_open', 'add_ov_preloader_html');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement