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.

            
              %h1  CSS3 SINE WAVES    
%h2 [linear && alternate movement]
%section.curve.linear
  - (1..10).each do
    .increase
    .peak
    .decrease
    .valley
%h2 [wave perspective]
%section.curve.perspective
  - (1..15).each do
    .increase
    .peak
    .decrease
    .valley
%h2 [showing the wave]
%section.curve
  .showing
  - (1..10).each do
    .increase
    .peak
    .decrease
    .valley
%h2 [static]
%section.curve
  - (1..6).each do
    .increase
    .peak
    .decrease
    .valley
            
          
!
            
              // visual variables
$bodybg: #1E1717
$wavecolor: darken($bodybg, 7%)
$showingtime: 4s // 2s is fun, try :D
$titlecolor: #753222
  
// relevant variables
$angle: 38.43
$increasemargin: -89.75px
$thick: 5.7px
  
// relevant
div
  display: inline-block
 
.curve
  margin-bottom: 110px
 
.linear
  animation: linearmov 8s linear infinite alternate 
.perspective 
  transform: perspective(600px) rotateY(26deg)
.showing
  
.increase, .decrease
  height: $thick - 0.3px
  background: $wavecolor
  width: #{3.9*$angle}px
  margin-left: $increasemargin
  position: relative
  z-index: 1
.increase
  transform: rotate(-#{$angle}deg)
.decrease
  transform: rotate(#{$angle}deg)
  margin-left: $increasemargin + 1.5
  
.peak, .valley
  border: $thick solid $bodybg
  border-top: $thick solid $wavecolor
  border-radius: 50%
  width: 140px
  height: 105px
.peak 
  transform: translate(-44px, 47.65px)
.valley
  transform: rotate(180deg) translate(45px, -62px)

// page + movements + extra transforms
body
  background: $bodybg
  white-space: nowrap
  overflow-x: hidden
  font-family: 'Allerta'
  text-align: center
h1, h2
  color: $titlecolor
  margin-bottom: 0
h2
  font-weight: normal
  margin: 0
  
.showing
  float: right
  background: $bodybg
  width: 100%
  height: 200px
  animation: showing $showingtime linear infinite alternate
  position: relative
  z-index: 2
    
@keyframes linearmov
  from
    transform: translateX(0)
    perspective: 300px
  to
    transform: translateX(-1030px)

@keyframes showing
  from
    transform: translateX(0%)
  to
    transform: translateX(105%)
            
          
!
            
              //  will be improved/organized soon.
// by diessica.com || github.com/diessicode
            
          
!
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