S
S
Sergey Goryachev2015-10-20 20:57:31
css
Sergey Goryachev, 2015-10-20 20:57:31

How to make a site preloader from a logo?

Hi all!
How to implement a site preloader from a logo? Are there any examples?
Initially, the logo will be white, and will be filled with color.
Naturally, the color should be filled based on the site load.
73fff39ee5964cc891c6c1624f296e93.gif

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Den Totsky, 2015-10-20
@xDen

as an option, overlapping one logo with another
https://jsfiddle.net/c5o5qm7o/

V
Vlad, 2015-10-20
@p1rat495

.logo{
    width: 100px;
    height: 20px;
    position: relative;
    background-size: cover;
    background-image: url(logo.png);
}
.logo__loaded{
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 0%;
    background-size: cover;
    background-image: url(logo2.png);
}

<div class="logo">
  <div class="logo__loaded" style="70%"></div>
</div

T
Think With Your Head, 2015-10-20
@Vyad

I recently solved exactly the same problem.
Made the logo loading depending on the weight of the page files, i.e. until all the pictures are loaded - the logo is filled with color. The emphasis was on the pictures, because. text files don't affect the download much.
The bottom line is that you need to use svg (for masks) and, as mentioned above, a javascript code to determine if the pictures have loaded or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question