Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                - let t = 12;
.nucl(style=`--t:${t}`)
  .cont
    -for(let i=1; i<=t;i++)
      .ele(style=`--r:${i};`)
        .dot 
          .fill
//expansion of
//https://codepen.io/ghaste/pen/MWxMgWK
              
            
!

CSS

              
                @mixin sizingEle {
    width: 50vmin;
    height: 50vmin;
    top: 0;
    left: 0;
    border-radius: 100%;
    border: 1px dashed color-mix(in lab, var(--clr), #0003 30%);
    position: absolute;
    //translate: -20vmin -20vmin;
    z-index: 1;
}
@mixin sizing {
  position: absolute;
    width: 3vmin;
    height: 3vmin;
    top: 0;
    left: 0;
    background-color: var(--clr);
    border-radius: 100%;
}
@mixin pseudo-fill() {
  &::before,
  &::after {
    content: "";
    @include sizing;
    transform: rotatex(90deg);
  }
  &::after {
    transform: rotatey(90deg);
  }
}
:root {
  --bg: #fbf7f4;
  --clr: #aee1cd;
}
div {
  box-sizing: border-box;
  transform-style: preserve-3d;
}
body {
  display: grid;
  place-content: center;
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  perspective: 50vmin;
}

.nucl {
  position: relative;
  width: 10vmin;
  height: 10vmin;
  //border: 1px solid;
  background: radial-gradient(circle, #3cf 50%, #0000 0) 50% 50% / 60% 60% space,
    radial-gradient(circle, #3fc 50%, #0000 0) 50% 15% / 60% 40% space,
    radial-gradient(circle, #f9c 50%, #0000 0) 50% 50% / 50% 90% space,
    radial-gradient(circle, #3cf 50%, #0000 0) 0 0 / 45% 45% space;
  .cont {
    position: relative;
    width: 50vmin;
    height: 50vmin;
    translate: -20vmin -20vmin;
    animation: turn 60s linear infinite forwards;
    //border: 1px solid;
  }

  .ele {
    @include sizingEle;
    
    transform: rotatez(calc(var(--r) * 180deg / var(--t)))
      rotatex(calc(var(--r) * 180deg / var(--t)))
      rotatey(calc(var(--r) * 180deg / var(--t)));
    .dot {
      //border: 1vmin solid var(--bg);
      @include sizing;
      offset-path: border-box;
      offset-distance: 0%;
      offset-rotate: 90deg;
      animation: rot linear 4s infinite forwards calc(var(--r) * -1s);
      z-index: 5;
      @include pseudo-fill;
      .fill {
        @include sizing;
        background-color: var(--clr);
        border-radius: 100%;
        transform: rotatex(45deg) rotatey(45deg);

        @include pseudo-fill;
      }
    }
  }
}
.nucl:hover .ele {
  border-color: color-mix(in lab, var(--clr), #000 50%);
}
@keyframes turn {
  to {
    transform: rotatex(360deg) rotatey(360deg) rotatez(360deg);
  }
}
@keyframes rot {
  to {
    offset-distance: 100%;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console