cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <figure class="system">
    <span class="planet"></span>
    <span class="moon"></span>
    
    <span class="star star--blue star--1"></span>
    <span class="star star--2"></span>
    <span class="star star--red star--3"></span>
    <span class="star star--round star--4"></span>
    
    <span class="star star--red star--5"></span>
    <span class="star star--round star--6"></span>
    <span class="star star--blue star--7"></span>
	
	<figcaption class="cap">
		by
		<a href="https://dribbble.com/shots/2570798-Earth" target="_blank" rel="noopener noreferrer" class="cap__link">ibe vanmeenen</a> 
		
		&mdash; 
		
		<a href="https://dribbble.com/shots/2570798-Earth" target="_blank" rel="noopener noreferrer" class="cap__link">style inspiration</a>
	</figcaption>
</figure>
            
          
!
            
              .system {
    position: relative;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    width: 100vw;
    height: 100vh;
    margin: 0;
    
    background: rgb(22, 23, 67);
}

.planet {
    z-index: 10;
    position: relative;
    
    display: block;
    width: 20vw;
    height: 20vw;
    
    background: #48BDFF;
    border-radius: 100%;
    
    box-shadow: inset -3vw -1.5vw 0 rgba(22, 23, 67, .05);
    
    overflow: hidden;
    
    &::before {
        content: "";
        
        position: absolute;
        top: -15vw;
        left: -5vw;
        
        display: block;
        width: 20vw;
        height: 20vw;
        
        background: #48E5DC;
        border-radius: 100%;
        border: .4vw solid rgb(22, 23, 67);
        
        box-shadow: 0 0 2vw rgba(0, 0, 0, .05);
    }
}

.moon {
    z-index: 11;
    position: absolute;
    top: calc(50% - 2.5vw);
    left: calc(50% - 2.5vw);
    
    display: block;
    width: 5vw;
    height: 5vw;
    
    background: rgb(234, 242, 253);
    border-radius: 100%;
    border: .2vw solid rgb(22, 23, 67);
    box-shadow: inset -1.5vw -1vw 0 rgba(72, 189, 255, .05), 0 0 2vw rgba(22, 23, 67, .5);
    
    will-change: transform;
    animation: 6s linear orbit infinite;
    transform: translate3d(0, 0, 0);
}


@keyframes orbit {
    0% {
        z-index: 10;
        
        transform: translate3d(0, 0, 0) scale(1.3);
        background: rgb(234, 242, 253);
    }
    15% {
        z-index: 10;
        
        transform: translate3d(8vw, 8vw, 0) scale(1);
        background: rgb(234, 242, 253);
    }
    20% {
        z-index: 9;
        
        transform: translate3d(9vw, 9vw, 0) scale(.9);
        background: rgb(234, 242, 253);
    }
    25% {
        z-index: 9;
        
        transform: translate3d(8.5vw, 8.5vw, 0) scale(.85);
        background: darken(rgb(234, 242, 253), 5%);
    }
    30% {
        z-index: 9;
        
        transform: translate3d(7.5vw, 7.5vw, 0) scale(.8);
        background: darken(rgb(234, 242, 253), 5%);
    }
    
    
    65% {
        z-index: 9;
        
        transform: translate3d(-8.5vw, -8.5vw, 0) scale(.8);
        background: darken(rgb(234, 242, 253), 5%);
    }
    70% {
        z-index: 9;
        
        transform: translate3d(-9.5vw, -9.5vw, 0) scale(.85);
        background: darken(rgb(234, 242, 253), 5%);
    }
    75% {
        z-index: 9;
        
        transform: translate3d(-10vw, -10vw, 0) scale(.9);
        background: darken(rgb(234, 242, 253), 5%);
    }
    80% {
        z-index: 10;
        
        transform: translate3d(-9vw, -9vw, 0) scale(1);
        background: rgb(234, 242, 253);
    }
    100% {
        z-index: 10;
        
        transform: translate3d(0, 0, 0) scale(1.3);
        background: rgb(234, 242, 253);
    }
}


.star {
    z-index: 2;
    position: absolute;
    top: 30%;
    left: 30%;
    
    display: block;
    width: .5vw;
    height: 1.1vw;
    
    background: #fff;
    border-radius: 100%;
    
    animation: 4s linear star infinite;
    
    &::after {
        content: "";
     
        position: absolute;
        top: 50%;
        left: 50%;

        display: block;
        width: 100%;
        height: 100%;

        background: inherit;
        border-radius: 100%;
        
        transform: translate3d(-50%, -50%, 0) rotate(90deg);
    }
}

.star--round {
    width: .5vw;
    height: .5vw;
    
    &::after {
        display: none;
    }
}

.star--blue {
    background-color: rgb(72, 189, 255);
    transform: scale(1.6);
}


.star--red {
    background-color: rgb(232, 61, 59);
    transform: scale(1.2);
}


.star--1 {
    top: 20%;
    left: 35%;
    
    animation-delay: 0;
}

.star--2 {
    top: 40%;
    left: 30%;
    
    animation-delay: .5s;
}

.star--3 {
    top: 70%;
    left: 35%;
    
    animation-delay: .25s;
}

.star--4 {
    top: 55%;
    left: 37%;
    
    animation-delay: .15s;
}

.star--5 {
    top: 25%;
    left: 60%;
    
    animation-delay: .5s;
}

.star--6 {
    top: 35%;
    left: 65%;
    
    animation-delay: 0;
}

.star--7 {
    top: 75%;
    left: 60%;
    
    animation-delay: .25s;
}


@keyframes star {
    0% {
        opacity: 1; 
    }
    50% {
        opacity: .7;
    }
    100% {
        opacity: 1; 
    }
}



.cap {
	position: absolute;
	bottom: 0;
	right: 0;
	
	padding: .5vw;
	
	font-size: .5vw;
	letter-spacing: .1em;
	color: #fff;
}

.cap__link {
	color: rgb(72, 189, 255);
}
            
          
!
999px
Loading ..................

Console