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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
                <section id="app" class="bg-blue-darkest h-screen py-32">
    <div class="clock rounded-full p-8 relative mx-auto border-8 border-blue">
      <div class="clock-face relative w-full h-full">
        <div class="hand hour-hand z-10 bg-blue-lightest absolute h-4 rounded-full" :style="{transform:'rotate('+hoursDegrees+'deg)'}"></div>
        <div class="hand min-hand z-20 bg-blue-lighter absolute h-4 rounded-full" :style="{transform:'rotate('+minutesDegrees+'deg)'}"></div>
        <div class="hand second-hand z-30 bg-blue-light absolute h-4 rounded-full" :style="{transform:'rotate('+secondsDegrees+'deg)'}"></div>
        <div class="center w-8 h-8 p-1 bg-blue absolute rounded-full z-40">&nbsp;</div>
      </div>
    </div>
  </section>
            
          
!

CSS

            
                section {
     .clock {
       width:32rem;
       height:32rem;
      box-shadow:
        0 0 60px 2px #fff,  /* inner white */
        0 0 75px 4px #f0f, /* middle magenta */
        0 0 140px 9px #0ff; /* outer cyan */

      .clock-face {
        transform: translateY(-3px);

        .hand {
          top: 50%;
          transform-origin: 100%;
          transform: rotate(90deg);
          transition: all 0.05s;
          transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1);

          &.second-hand {
            width: 50%;
          }

          &.min-hand {
            width: 45%;
            left: 5%;
          }

          &.hour-hand {
            width: 40%;
            left: 10%;
          }
        }

        .center {
          top: 48%;
          left: 46.5%;
        }
      }
    }
  }
            
          
!

JS

            
              new Vue ({
  el: '#app',
  data: {
    date: moment(),
  },
  methods: {
    updateTime() {
      this.date = moment();
    },
  },
  computed: {
    seconds() {
      return this.date.format('ss');
    },
    minutes() {
      return this.date.format('mm');
    },
    hours() {
      return this.date.format('HH');
    },
    secondsDegrees() {
      return ((this.seconds / 60) * 360) + 90;
    },
    minutesDegrees() {
      return ((this.minutes / 60) * 360) + ((this.seconds / 60) * 6) + 90;
    },
    hoursDegrees() {
      return ((this.hours / 12) * 360) + ((this.minutes / 60) * 30) + 90;
    },
  },

  mounted() {
    this.updateTime();

    setInterval(this.updateTime, 1000);
  },
});
            
          
!
999px

Console