Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

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.

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

              
                - $cubes_array = [3, 4, 5, 4, 3]
- $cubes_total = $cubes_array.sum - 1
- $cube_position = 0
.context(style='--cubes-total: #{$cubes_total}')
  - $cubes_array.each_with_index do |cubes, index|
    .row(style='--row: #{index}' data-cubes='#{cubes}')
      - (1..cubes).each do |cube|
        .cube(style="--cube: #{cube}; --cube-position: #{$cube_position}")
          .face.face--right
          .face.face--left
        - $cube_position += 1
 




%footer
  %p 
    %a(href='https://codepen.io/ruidovisual/')
      Watch More 
  %p 
    Have a project? 
    %a(href='https://mazing.studio' target='_blank')
      Contact my studio : ) 
              
            
!

CSS

              
                $pink: #ee2b3d
$wine: #8e264c
$purple-muted: #4f3a61
$peach: #FFA57E

$cube_unit: 6vw


//ANIMATION 
.cube 
  $delay_amount: 1s
  $delay: calc(var(--cube-position) * #{$delay_amount/4})
  $duration: calc(var(--cubes-total) * #{$delay_amount})
  @include animator(cube, (duration: $duration, iteration-count: infinite, delay: $delay))
    1%, 25%
      transform: rotateDeg(55, 0, 45)
    26%, 50%
      transform: rotateDeg(55, 0, 135)
    51%, 75%
      transform: rotateDeg(55, 0, 225)
    76%, 100%
      transform: rotateDeg(55, 0, 315)


.cube
  font-size: 1rem
  position: relative
  display: inline-block
  transition: all .3s
  transform: rotateX(55deg) rotateY(0) rotateZ(-45deg)
  z-index: 3
  background-color: $peach
  margin: 0 3vw 1.8vw 0
  @include size($cube_unit)
    
.cube,
.face
  transform-style: preserve-3d
  &::after
    content: ''
    position: absolute
    display: block
    background-color: inherit
    transform-origin: 100% 100%
    transform: translateZ(-$cube_unit)
    @include size(100%)
    
.face 
  position: absolute
  @include size(100%)
  &::after
    transform: translateZ($cube_unit)

.face--right 
  background-color: $wine
  transform-origin: 100% 100% 0
  transform: rotateX(90deg)
  &::after
    background-color: #f95202
.face--left 
  background-color: $pink
  transform-origin: 0 100% 0
  transform: rotateY(90deg)
  &::after
    background-color: #f08500
  
.row 
  text-align: left
  
.row:nth-child(even)
  margin-left: 4.5vw
.row[data-cubes='3']
  margin-left: 9vw 

  
body 
  margin: 0
  padding: 0
  background-color: #3930bb
  text-align: center
  display: flex
  justify-content: center 
  align-items: center
  height: 100%
  width: 100%
  position: absolute
  color: #fff
  font-family: 'Avenir', 'Helvetica', sans-serif
  
.context
  position: relative
  font-size: 0
  display: inline-block
  margin-top: -3rem
  &::first-line
    text-indent: 2rem
  
// Brand placement
a 
  color: inherit
  // text-decoration: none
  &:hover 
    text-decoration: underline
footer 
  font-size: 12px
  text-align: right
  position: fixed
  bottom: 10px
  right: 20px
              
            
!

JS

              
                
              
            
!
999px

Console