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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div class="container">
  <div class="svg-container h">
    <canvas id="alphabet-h"></canvas>
  </div>  
</div>

<script type="text/paperscript" canvas="alphabet-h">
var outerClip = new Path.Circle({
    center: [150, 150],
    radius: 103,
    fillColor: 'white'
});

var inner = new Path.Circle({
    center: [150, 150],
    radius: 103,
    fillColor: 'white'
});

// The amount of segment points we want to create:
var amount = 4;

// The maximum height of the wave:
var height = 30;

// Create a new path and style it:
var path = new Path({
	// 80% black:
	strokeColor: '#FF00FF',
	strokeWidth: 200,
	strokeCap: 'square'
});

var path2 = new Path({
	// 80% black:
	strokeColor: '#FBB03B',
	strokeWidth: 200,
	strokeCap: 'square'
});

// Add 5 segment points to the path spread out
// over the width of the view:
for (var i = 0; i <= amount; i++) {
    path.add(new Point(i / amount, 2) * 300);
    path2.add(new Point(i / amount, 2) * view.size);
}

// Select the path, so we can see how it is constructed:
// path.selected = true;
// path2.selected = true;

function onFrame(event) {
	// Loop through the segments of the path:
	for (var i = 0; i <= amount; i++) {
		var segment = path.segments[i];
		var segment2 = path2.segments[i];

		// A cylic value between -1 and 1
		var sinus = Math.sin(event.time * 2 + i);
		var cosus = Math.cos(event.time * 2 + i);
		
		// Change the y position of the segment point:
		segment.point.y = sinus * height + 250;
		segment2.point.y = cosus * height + 250;
	}
	// Uncomment the following line and run the script again
	// to smooth the path:
	path.smooth();
	path2.smooth();
}

path.blendMode = 'multiply'
path2.blendMode = 'multiply'

var group = new Group(outerClip, path2, path);
group.clipped = true;


var outer = new Path.Circle({
    center: [150, 150],
    radius: 45,	
    // parent: originals,
    fillColor: '#FFCDD1'
});
</script>
              
            
!

CSS

              
                html, body {
  background-color: #292929;
  height: 100%;
  margin: 0;
}

canvas {
    border-radius: 8px;
    background-color: #FFCDD1;
}

.container {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.svg-container {
  padding: 0;
  height: 300px;
  border-radius: 8px;
}

.svg-frame {
  border-radius: 8px;
}

#alphabet-h {
    display: inline-block;
    height: 300px;
    width: 300px;
  
}


              
            
!

JS

              
                
              
            
!
999px

Console