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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


<h1>actualRotation / normalizedRotation / index</h1>
<h1 id="message">0 0 fred</h1>

<div class="container">
	<div id="wheel"></div>
  	<div id="content">
		<h1 id="person">Light Blue</h1>
		<p>This is some content about the chosen segment</p>
		<a href="#">View Light Blue</a>



                .container {
	display: grid;
	grid-template-columns: 2fr 1fr;
  align-items: center;
  justify-items: center;
  height: 100vh;

#wheel {
  background: url('') no-repeat center;
  width: 500px;
  height: 500px;
  background-size: cover;

h1 {
	color: #6ad2e7;



                var people = ["fred", "bill", "jim", "pam", "sue", "simon"]

var rotationSnap = 60;
Draggable.create("#wheel", {
    type:"rotation", //instead of "x,y" or "top,left", we can simply do "rotation" to make the object spinnable! 
    throwProps:true, //enables kinetic-based flicking (continuation of movement, decelerating after releasing the mouse/finger)
    snap:function(endValue) { 
        //this function gets called when the mouse/finger is released and it plots where rotation should normally end and we can alter that value and return a new one instead. This gives us an easy way to apply custom snapping behavior with any logic we want. In this case, just make sure the end value snaps to 90-degree increments but only when the "snap" checkbox is selected.
        return Math.round(endValue / rotationSnap) * rotationSnap;
		var actualRotation = this.rotation;
		var normalizedRotation = actualRotation % 360;
		var index = normalizedRotation / 60;
		if (index < 0) {
			//negative index needs to wrap around
			index = (people.length) + index;
		$("#message").text(actualRotation + " " + normalizedRotation + " " + index);