Код HTML приводить не будем там SVG и он очень большой приведем CSS и js.
Пишем стиль:
Пишем js:
Получаем следующий результат:
Пишем стиль:
CSS:
body
{
}
/*********snow *****/
.snowflake {
color: #fff;
font-size: 1em;
font-family: Arial, sans-serif;
}
@-webkit-keyframes snowflakes-fall {
0% {
top: -10%;
}
100% {
top: 100%;
}
}
@keyframes snowflakes-fall {
0% {
top: -10%;
}
100% {
top: 100%;
}
}
@-webkit-keyframes snowflakes-shake {
0%, 100% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
50% {
-webkit-transform: translateX(80px);
transform: translateX(80px);
}
}
@keyframes snowflakes-shake {
0%, 100% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
50% {
-webkit-transform: translateX(80px);
transform: translateX(80px);
}
}
.snowflake {
position: absolute;
top: -10%;
z-index: 1;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: default;
-webkit-animation-name: snowflakes-fall, snowflakes-shake;
animation-name: snowflakes-fall, snowflakes-shake;
-webkit-animation-duration: 10s, 3s;
animation-duration: 10s, 3s;
-webkit-animation-timing-function: linear, ease-in-out;
animation-timing-function: linear, ease-in-out;
-webkit-animation-iteration-count: infinite, infinite;
animation-iteration-count: infinite, infinite;
-webkit-animation-play-state: running, running;
animation-play-state: running, running;
}
.snowflake:nth-of-type(0) {
left: 1%;
-webkit-animation-delay: 0s, 0s;
animation-delay: 0s, 0s;
}
.snowflake:nth-of-type(1) {
left: 10%;
-webkit-animation-delay: 1s, 1s;
animation-delay: 1s, 1s;
}
.snowflake:nth-of-type(2) {
left: 20%;
-webkit-animation-delay: 6s, .5s;
animation-delay: 6s, .5s;
}
.snowflake:nth-of-type(3) {
left: 30%;
-webkit-animation-delay: 4s, 2s;
animation-delay: 4s, 2s;
}
.snowflake:nth-of-type(4) {
left: 40%;
-webkit-animation-delay: 2s, 2s;
animation-delay: 2s, 2s;
}
.snowflake:nth-of-type(5) {
left: 50%;
-webkit-animation-delay: 8s, 3s;
animation-delay: 8s, 3s;
}
.snowflake:nth-of-type(6) {
left: 60%;
-webkit-animation-delay: 6s, 2s;
animation-delay: 6s, 2s;
}
.snowflake:nth-of-type(7) {
left: 70%;
-webkit-animation-delay: 2.5s, 1s;
animation-delay: 2.5s, 1s;
}
.snowflake:nth-of-type(8) {
left: 80%;
-webkit-animation-delay: 1s, 0s;
animation-delay: 1s, 0s;
}
.snowflake:nth-of-type(9) {
left: 90%;
-webkit-animation-delay: 3s, 1.5s;
animation-delay: 3s, 1.5s;
}
.snowflake:nth-of-type(10) {
left: 25%;
-webkit-animation-delay: 2s, 0s;
animation-delay: 2s, 0s;
}
.snowflake:nth-of-type(11) {
left: 65%;
-webkit-animation-delay: 4s, 2.5s;
animation-delay: 4s, 2.5s;
}
/**********snkow End*/
.bg-fo
{
height:300px;
background: linear-gradient(
180deg
,#526ade .02%,#69d3c2 52.36%,#fef5bc 93.75%,#68d3c1);
}
.bg-water
{
position:relative;
z-index:2;
}
.bg-stone
{
position: absolute;
z-index: 0;
}
#wing
{
transform-box: fill-box;
transform-origin: center;
}
#baloon
{
transform-box: fill-box;
transform-origin: center;
}
#fan1
{
transform-box: fill-box;
transform-origin: 58% 60%;
}
#fan2
{
transform-box: fill-box;
transform-origin: 36% 49%;
}
#fan3
{
transform-box: fill-box;
transform-origin: 57% 58%;
}
#Group_42
{
transform-box: fill-box;
transform-origin: 58% 60%;
}
JavaScript:
anime({
targets: 'svg #ship',
translateX: [-200, 350], // from 100 to 250
direction: 'alternate',
loop: true,
easing: 'easeInOutSine',
duration: 8000
});
anime({
targets: 'svg #baloon',
translateX: [-200, 350], // from 100 to 250
direction: 'alternate',
keyframes: [
{translateY: -50},
{translateX: 800},
{translateY: 10},
{translateX: 10},
{translateY: 100}
],
loop: true,
easing: 'easeInOutSine',
duration: 15000
});
var design = anime({
targets: 'svg #wing',
skew: 10,
easing: 'linear',
loop: true,
direction: 'alternate',
});
anime({
targets: 'svg #fan1',
rotate: ([360]),
loop: true,
easing: 'linear',
duration: 5000,
});
anime({
targets: 'svg #fan2',
rotate: ([360]),
loop: true,
easing: 'linear',
duration: 5000,
});
anime({
targets: 'svg #fan3',
rotate: ([360]),
loop: true,
easing: 'linear',
duration: 5000,
});
anime({
targets: '#Group_42 path',
translateX: [20, -50], // from 100 to 250
direction: 'alternate',
loop: true,
easing: 'easeInOutSine',
delay: function(el, i, l) {
return i * 400;
},
endDelay: function(el, i, l) {
return (l - i) * 50;
}
});