Pen Settings

HTML

CSS

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

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

Auto Save

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

              
                <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Transform Origin Demonstration</title>
    <style>
      body {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        height: 100vh;
        margin: 0;
        background-color: #f0f0f0;
        gap: 20px;
        font-family: Arial, sans-serif;
      }

      .wrapper {
        display: flex;
        width: 50vw;
        flex-wrap: wrap;
        justify-content: center;
        gap: 60px;
      }
      .container {
        text-align: center;
      }
      .edge {
        width: 100px;
        height: 100px;
        background-color: #0ebac5;
        margin: 10px auto;
        position: relative;
        transition: transform 1s ease-in-out;
        animation: trans-rotate 4s infinite linear;
      }
      .dot {
        position: absolute;
        width: 10px;
        height: 10px;
        background-color: #000;
        border-radius: 50%;
        transform: translate(-50%, -50%);
      }
      /* Positioning dots for each transform-origin */
      .top-left .dot {
        top: 0%;
        left: 0;
      }
      .top-right .dot {
        top: 0;
        left: 100%;
      }
      .bottom-left .dot {
        top: 100%;
        left: 0;
      }
      .bottom-right .dot {
        top: 100%;
        left: 100%;
      }
      .top-edge .dot {
        top: 0;
        left: 50%;
      }
      .bottom-edge .dot {
        top: 100%;
        left: 50%;
      }
      .left-edge .dot {
        top: 50%;
        left: 0;
      }
      .right-edge .dot {
        top: 50%;
        left: 100%;
      }

      /* transform origin for each edge */
      .top-left {
        transform-origin: top left;
      }
      .top-right {
        transform-origin: top right;
      }
      .bottom-left {
        transform-origin: bottom left;
      }
      .bottom-right {
        transform-origin: bottom right;
      }

      .top-edge {
        transform-origin: top;
      }
      .bottom-edge {
        transform-origin: 50% 100%;
      }
      .left-edge {
        transform-origin: 0 50%;
      }
      .right-edge {
        transform-origin: 100% 50%;
      }

      @keyframes trans-rotate {
        from {
          transform: rotate(0deg);
        }
        to {
          transform: rotate(360deg);
        }
      }
    </style>
  </head>
  <body>
    <h2>Transform Origin Example</h2>
    <div class="wrapper">
      <div class="container">
        <div class="edge top-left"><div class="dot"></div></div>
        <span>Top Left</span>
      </div>
      <div class="container">
        <div class="edge top-right"><div class="dot"></div></div>
        <span>Top Right</span>
      </div>
      <div class="container">
        <div class="edge bottom-left"><div class="dot"></div></div>
        <span>Bottom Left</span>
      </div>
      <div class="container">
        <div class="edge bottom-right"><div class="dot"></div></div>
        <span>Bottom Right</span>
      </div>
      <div class="container">
        <div class="edge top-edge"><div class="dot"></div></div>
        <span>Top Edge</span>
      </div>
      <div class="container">
        <div class="edge bottom-edge"><div class="dot"></div></div>
        <span>Bottom Edge</span>
      </div>
      <div class="container">
        <div class="edge left-edge"><div class="dot"></div></div>
        <span>Left Edge</span>
      </div>
      <div class="container">
        <div class="edge right-edge"><div class="dot"></div></div>
        <span>Right Edge</span>
      </div>
    </div>
  </body>
</html>

              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console