Seleccionar página

Here we have a series of preload animations of different types, varied and very cool.

1.- Cloud:

cloud

HTML
.wrapper
– (1..62).each do
%i

%a{:href => “#black”, :id => “black”}

CSS

$particles: 62; // has to match nodes in dom
$particleSize: 8px;
$radius: 80;
$lapDuration: 3s;

html, body {
overflow: hidden;
background: #3e6fa3;
}

.wrapper {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;

@include perspective(500px);
}

i {
display: block;
position: absolute;
width: $particleSize;
height: $particleSize;
border-radius: $particleSize;
opacity: 0;
background: rgba(255,255,255,0.5);
box-shadow: 0px 0px 10px rgba(255,255,255,1);

animation-name: spin;
animation-duration: $lapDuration;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
}

@for $i from 1 through $particles {
i:nth-child(#{$i}) {
$angle: ( $i / $particles ) * 720;

@include transform(
rotate( #{$angle}deg )
translate3d( #{$radius}px, 0, 0 )
);

animation-delay: $i * ($lapDuration / $particles);
}
}

@keyframes spin {
from {
opacity: 0.0;
}
to {
opacity: 0.6;
transform: translate3d(-$particleSize/2, -$particleSize/2, 570px);
}
}

 // background color controls

#black {
position: absolute;
left: 10px;
bottom: 10px;
color: rgba(255,255,255,0.6);
text-decoration: none;

&:after { content: ‘Black & white’; }
}

#black:target {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
background: #111;
cursor: default;

&:after { content: ”; }
}

botondemopeq botoneditpeq

 

2.- Spinner

spinner

HTML

.spinner
– (1..100).each do

%i
%b

CSS

$particles: 100; // has to match nodes in dom
$particleSize: 6px;
$radius: 100;
$lapDuration: 3s;

html, body {
overflow: hidden;
background: #111;
}

.spinner {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;

perspective: 200px;
}

i {
display: block;
position: absolute;
opacity: 1;

b {
display: block;
width: $particleSize;
height: $particleSize;
border-radius: $particleSize;
background: rgba(255,255,255,1);
box-shadow: 0px 0px 14px rgba(255,255,255,1);

animation-name: spin;
animation-duration: $lapDuration;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
}
}

@for $i from 1 through $particles {
i:nth-child(#{$i}) {
$angle: ( $i / $particles ) * 360;

transform:
rotate( #{$angle}deg )
translate3d( #{$radius}px, 0, 0 );

b {
animation-delay: $i * ($lapDuration / ( $particles – 2 ));
}
}
}

@keyframes spin {
0% {
transform: scale(1);
}
15% {
transform: translate(-$particleSize/2, -$particleSize/2) scale(3);
}
50% {
transform: scale(1);
}
}

botondemopeq botoneditpeq

 

3.- Hole

hole

 

HTML:

.hole
– (1..10).each do
%i

CSS:

$particles: 10; // has to match nodes in dom
$particleSize: 140px;
$lapDuration: 3s;
$shadowColor: #ffffff;

html, body {
overflow: hidden;
background: #111;
}

.hole {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;
}

i {
display: block;
position: absolute;
width: $particleSize;
height: $particleSize;
left: -$particleSize/2;
top: -$particleSize/2;
border-radius: $particleSize;
opacity: 0;

animation-name: scale;
animation-duration: $lapDuration;
animation-iteration-count: infinite;
animation-timing-function: linear;
//animation-direction: alternate;
}

@for $i from 1 through $particles {
i:nth-child(#{$i}) {
animation-delay: $i * ($lapDuration / $particles);
}
}

@keyframes scale {
0% {
transform: scale(2);
opacity: 0;
box-shadow: 0px 0px 50px rgba($shadowColor, 0.5);
}
50% {
transform: scale(1) translate(0px, -5px);
opacity: 1;
box-shadow: 0px 8px 20px rgba($shadowColor, 0.5);
}
100% {
transform: scale(0.1) translate(0px, 5px);
opacity: 0;
box-shadow: 0px 10px 20px rgba($shadowColor, 0);
}
}

botondemopeq botoneditpeq

 

Posted by HAKIM EL HATTAB on codepen.io

 


Powered with Custom Code Adder