Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1850124
Page Preloader
Closed

Comments

  • ottimoto started the conversation

    Hi guys,

    After good success with The Gem theme on a few websites I bought now Scalia for another new site. 

    The first question is in regards to a page preloader. When I simply choose a style of the existing 3 preloaders styles, no preloader is shown on the page. It seems the preloaders here are juts for galleries etc, but I require the preloader to work for the whole page. Can you please provide the css/js code?


    Many thanks
    otti

  • [deleted] replied

    Hi,

    Scalia theme doesn't contain page preloader.

  • ottimoto replied

    That is a shame. Is there a js script I can inset into advanced code?

  • [deleted] replied

    Hi,

    Please provide the wp-admin and ftp access. We will install  child theme and try to make same page preloader.

    Do you need it on all pages?

  •   ottimoto replied privately
  • [deleted] replied

    FTP access please.

  •   ottimoto replied privately
  • [deleted] replied

    Can't connect to ftp with this data. Access denided.

  •   ottimoto replied privately
  • [deleted] replied

    Added code to child theme

    in file header.php:

    <?php /* Page preloader interface*/ ?>
    <?php if ( in_array(get_the_ID(), array(22) ) ) : ?>
        <div id="page-preloader"><div class="page-preloader-spin"></div></div>
        <?php do_action('scalia_after_page_preloader'); ?>
    <?php endif; ?>
    22 is page id. you can add necessary ids to array.

    in style.css:

    /* Page Preloader */
    #page-preloader {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 999999;
        opacity: 0.98;
        background: #2c2e3d;
    }
    #page-preloader.preloader-loaded .page-preloader-spin {
        opacity: 0;
        -webkit-transition: all 0.3s ease-out;
        transition: all 0.3s ease-out;
    }
    #page-preloader.preloader-loaded {
        visibility: hidden;
        opacity: 0;
        -webkit-transition: all 0.3s ease-out;
        transition: all 0.3s ease-out;
    }
    .no-js #page-preloader {
        display: none;
    }
    #page-preloader .page-preloader-spin {
        position: absolute;
        left: 50%;
        top: 50%;
        z-index: 1001;
        width: 80px;
        height: 80px;
        margin: -40px 0 0 -40px;
        border-radius: 50%;
        -moz-border-radius: 50%;
        -webkit-border-radius: 50%;
        border: 2px solid transparent;
        border-top-color: #b9b7ff;
        -webkit-animation: PreloaderSpin 2s linear infinite;
        animation: PreloaderSpin 2s linear infinite;
    }
    #page-preloader .page-preloader-spin:before {
        content: "";
        position: absolute;
        top: 4px;
        left: 4px;
        right: 4px;
        bottom: 4px;
        border-radius: 50%;
        -moz-border-radius: 50%;
        -webkit-border-radius: 50%;
        border: 2px solid transparent;
        border-top-color: #00bcd4;
        -webkit-animation: PreloaderSpin 3s linear infinite;
        animation: PreloaderSpin 3s linear infinite;
    }
    #page-preloader .page-preloader-spin:after {
        content: "";
        position: absolute;
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        border-radius: 50%;
        -moz-border-radius: 50%;
        -webkit-border-radius: 50%;
        border: 2px solid transparent;
        border-top-color: #a3e7f0;
        -webkit-animation: PreloaderSpin 1.5s linear infinite;
        animation: PreloaderSpin 1.5s linear infinite;
    }
    @-webkit-keyframes PreloaderSpin {
        0%   {
            -webkit-transform: rotate(0deg);
            -ms-transform: rotate(0deg);
            transform: rotate(0deg);
        }
        100% {
            -webkit-transform: rotate(360deg);
            -ms-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }
    @keyframes PreloaderSpin {
        0% {
            -webkit-transform: rotate(0deg);
            -ms-transform: rotate(0deg);
            transform: rotate(0deg);
        }
        100% {
            -webkit-transform: rotate(360deg);
            -ms-transform: rotate(360deg);
            transform: rotate(360deg);
        }
    }
    in footer.php:

        <script type="text/javascript">
            (function($) {
                $(window).load(function() {
                    var $preloader = $('#page-preloader');
                    if ($preloader.length && !$preloader.hasClass('preloader-loaded')) {
                        $preloader.addClass('preloader-loaded');
                    }
                });
            })(jQuery);
        </script>

  • ottimoto replied

    Hi Max,

    Many thanks for that. I can go ahead and style it now accordingly.

    Best regards

    otti