Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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>QND PoC: Wheel of Fortune</h1>
  <li>Start- and stop with some momentum</li>
  <li>Spin wheel until requested to stop</li>
  <li>Stop at specific angle</li>
  <li>Spin a minimum amount of turns before stopping</li>
<div class="spinner"></div>
<button id="play">Play</button>
<button id="stop">Stop at 254°</button>


                .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70vmin;
  height: 70vmin;
  margin: -35vmin 0 0 -35vmin;
  border-radius: 50%;
  background: green;
.spinner::after {
  content: ">";
  position: absolute;
  left: 100%;
  top: 50%;
  margin-top: -10px;
  font-weight: bold;
  font-size: 3em;



                let requestStop = false;
const fullSpins = 5;
const stopAt = 254;
const stopRotation = 360 + stopAt;

const startAnim =".spinner", {
  rotation: "+=360",
  ease: "",
  duration: 1,
  onComplete: () =>,
  paused: true

let loopIteration = 0;

const loopAnim =".spinner", {
  rotation: "+=360",
  ease: "none",
  duration: 0.5,
  onComplete: () => {
    if (loopIteration >= fullSpins && requestStop) {;
    } else {
  paused: true

const stopAnim =".spinner", {
  rotation: `+=${stopRotation}`,
  // Calculate the new duration ...
  // ... to make the transition between spinning and ...
  // ... stopping as smooth as possible.
  duration: stopRotation / 360,
  paused: true

document.querySelector("#play").addEventListener("click", () => {;
  .addEventListener("click", () => (requestStop = true));