Skip to content
Advertisements

CSS Solar System


HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
    <link rel="stylesheet" type="text/css" href="animation26.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>

  <div class="center">
    <div class="sun">
      <div class="earth">
        <div class="moon"></div>
      </div>
    </div>
  </div>

</body>
</html>

CSS CODE:

body{
    margin: 0;
    padding: 0;
    background:url(http://www.uzay.co/wp-content/uploads/2018/04/Yıldızlar-Neden-Göz-Kırpar-Gibi-Görünüyorlar-e1523793486957.jpg);
    background-size: cover;
}
.center{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: transparent;
}
.center .sun{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 15px rgba(0,155,255,0.5),
                0 0 30px rgba(0,155,255,0.5),
                0 0 45px rgba(0,155,255,0.5),
                0 0 60px rgba(0,155,255,0.5),
                0 0 10px rgba(0,155,255,0.5);
}
.center .sun .earth{
    position: absolute;
    top: calc(50% - 1px);
    left: 50%;
    width: 200px;
    height: 2px;
    transform-origin:left;
    animation: rotate 10s linear infinite;
}
.center .sun .earth:before{
    content: "";
    background:url(https://icon2.kisspng.com/20180210/dvw/kisspng-earth-satellite-download-blue-earth-australia-top-view-5a7f1f8a2a88f9.1200804815182805861742.jpg);
    background-size: 60px 60px;
    background-position: center;
    position: absolute;
    top: -25px;
    right: 0;
    width: 50px;height:50px;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0,155,255,0.5),
                0 0 30px rgba(0,155,255,0.5),
                0 0 45px rgba(0,155,255,0.5),
                0 0 60px rgba(0,155,255,0.5),
                0 0 10px rgba(0,155,255,0.5);
    animation: rotate 10s linear infinite;
}
.center .sun .earth .moon{
    position: absolute;
    right: 25px;    
    width: 60px;
    height: 1px;
    transform-origin: right;
    animation: rotate 1s linear infinite
}
.center .sun .earth .moon:before{
    content: "";
    background: url(http://pngimg.com/uploads/moon/moon_PNG20.png);
    background-size: 20px 20px;
    position: absolute;
    top: -10px;
    width: 20px;
    height: 20px;
    background-position: center;
    border-radius: 50%;
}
@keyframes rotate{
    0%{
        transform: rotate(0deg);
    }
    100%{
        transform: rotate(360deg);
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: