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

              
                p.step1
  | Step 1
p.step2
  | Step 2
p.step3
  | Step 3
p.step4
  | Step 4
p.step5
  | Step 5
p.step6
  | Step 6
              
            
!

CSS

              
                // Read the full story on dev.to
// https://dev.to/rossangus/simple-wave-pattern-with-css-gradients-29g4

// The width of the tile which repeats
$wave-width:  200px;
// The height of the tile or the vertical space between peaks
$wave-height: 100px;
// Colour of the lighter blue wiggly lines
$line-color: blue;
// Colour of the background
$wave-background: navy;
// Thickness of the wiggly line
$line-thickness: 10px;
// This is just used for the demo
$para-count: 6;
// This is the radius of the circle found outside the light blue line
$radius: ($wave-width + $line-thickness + $line-thickness) / 4;

// Simple repeating radial gradient from red to blue,
// locked to the middle of the bottom
.step1 {
	background-image: radial-gradient(
    circle at top center,
    red,
    green
  ); 
	background-size: $wave-width $wave-height;
}

// Adding in some stops, to make a hard change of colour
// This creates a half-circle of 100px diameter.
// Note that pixels give a more predictable size of each curve.
// Percentages seem to be tied to the aspect ratio of the
// background-size in a way I don't fully understand.
.step2 {
	background-image: radial-gradient(
    circle at top center,
    red,
    red $radius,
    green $radius,
    green
  ); 
	background-size: $wave-width $wave-height;
}

// Adding in a new colour, to form a curve
// The width of the $line-color half-circle is 100px;
.step3 {
	background-image: radial-gradient(
    circle at top center,
    red,
    red $radius - $line-thickness,
    $line-color $radius - $line-thickness,
    $line-color $radius,
    green $radius,
    green
  ); 
	background-size: $wave-width $wave-height;
}

// Making the other colours transparent
.step4 {
	background-image: radial-gradient(
    circle at top center,
    transparent,
    transparent $radius - $line-thickness,
    $line-color $radius - $line-thickness,
    $line-color $radius,
    transparent $radius,
    transparent
  ); 
	background-size: $wave-width $wave-height;
}

// Adding a second gradient which is exactly the same,
// but locked to the bottom right, rather than the top
.step5 {
	background-image:
    radial-gradient(
      circle at center top,
      transparent,
      transparent $radius - $line-thickness,
      $line-color $radius - $line-thickness,
      $line-color $radius,
      transparent $radius,
      transparent
    ),
    radial-gradient(
      circle at right bottom,
      transparent,
      transparent $radius - $line-thickness,
      $line-color $radius - $line-thickness,
      $line-color $radius,
      transparent $radius,
      transparent
    );
  background-size: $wave-width $wave-height;
}

// Adding a third gradient locked to the bottom left
.step6 {
	background-image:
    radial-gradient(
      circle at center top,
      transparent,
      transparent $radius - $line-thickness,
      $line-color $radius - $line-thickness,
      $line-color $radius,
      transparent $radius,
      transparent
    ),
    radial-gradient(
      circle at right bottom,
      transparent,
      transparent $radius - $line-thickness,
      $line-color $radius - $line-thickness,
      $line-color $radius,
      transparent $radius,
      transparent
    ),
    radial-gradient(
      circle at left bottom,
      transparent,
      transparent $radius - $line-thickness,
      $line-color $radius - $line-thickness,
      $line-color $radius,
      transparent $radius,
      transparent
    );
  background-size: $wave-width $wave-height;
}

body {
  background: $wave-background;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  margin: 0;
  text-align: center;
}

p {
  border: solid 2px white;
  font-size: 10vw;
  height: 100vh / $para-count;
  line-height: 100vh / $para-count;
  margin: 0;
  text-shadow: .5vw .5vw 2vw #000;
}

body, p {
  box-sizing: border-box;
}

              
            
!

JS

              
                
              
            
!
999px

Console