cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.

 -(1..300).each do |i|
 -(1..72).each do |i|
  %div{:class => "ring#{i}"}
 -(1..36).each do |i|
  %div{:class => "moon#{i}"} 
              $sphere-size: 20em;
$ring1-size: $sphere-size * 1.3;
$ring2-size: $sphere-size * 1.5;
$ring1-offset: -($ring1-size - $sphere-size)/2;
$ring2-offset: -($ring2-size - $sphere-size)/2;

* { box-sizing: border-box; }

html, body {
  height: 100%;

body {
  background: black;

#stars {
  overflow: hidden;
  top:0; left:0; right:0;  bottom:0;
  li {
    display: block;
    border-radius: 50%;
    background-color: white;
  @for $i from 1 through 300 {
    $star-size: random(3) + px;
      transform: translate3D(random(100)*1vw, random(100)*1vh, 0);
      width: $star-size;
      height: $star-size;
      opacity: .1 + random(10)*.1;

.sphere {
 /* z-index: 10;*/
  width: $sphere-size;
  height: $sphere-size;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -$sphere-size / 2;
  animation: spinSphere 10s infinite linear;
  transform-style: preserve-3d;

[class^="ring"] {
  position: absolute;
  width: $sphere-size;
  height: $sphere-size;
  border-radius: 50%;

[class^="moon"] {
  position: absolute;
  top: -50px;
  left: -50px;
  width: $sphere-size/5;
  height: $sphere-size/5;
  border: 1px solid rgba(white, 0.2)!important; //yeah, I used important. I hang my head in shame...
  border-radius: 50%;

@for $i from 1 through 35 {
  [class$="#{$i}"] {
    transform: rotateY($i*5deg);
    border: 1px double hsla(30, 100%, 50%, 1);

@for $i from 36 through 72 {
  [class$="#{$i}"] {
    transform: rotateX($i*5deg);
    border: 1px solid rgba(white, 0.2);
    box-shadow: 5px 0 3px 0 rgba(white, 0.1);

[class="ring18"], [class="ring19"]{
    position: absolute;
    content: "";
    width: $ring1-size;
    height: $ring1-size;
    left: $ring1-offset;
    bottom: $ring1-offset;
    top: $ring1-offset;
    right: $ring1-offset;
    border: 10px dotted rgba(orange, 0.4);
    border-radius: 50%;
    position: absolute;
    content: "";
    width: $ring2-size;
    height: $ring2-size;
    left: $ring2-offset;
    bottom: $ring2-offset;
    top: $ring2-offset;
    right: $ring2-offset;
    border: 20px dotted rgba(red, 0.4);
    border-radius: 50%;

@keyframes spinSphere {
  from {
    transform: rotateZ(60deg) rotateX(0);
  to {
    transform: rotateZ(60deg) rotateX(360deg);

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................