123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              - $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 : ) 
            
          
!
            
              $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
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console