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. 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


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


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.


    .date-day 10
    .date-month MAY
    .date-year 2014
    .time-hand.time-hours 3
    .time-hand.time-minutes 33
    .time-hand.time-hours 5
    .time-hand.time-minutes 45
    .time-hand.time-hours 5
    .time-hand.time-minutes 12



                $clockColor: #5f1bfc;
$bgColor: #e2fc1b;

html, body {
  position: relative;
  height: 100%;
body {
  background-color: $bgColor;

.flex-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  height: 100%;

.date {
  display: inline-block;
  padding: 3px 6px;
  margin-bottom: 12px;
  border: 3px solid $clockColor;
  text-align: center;
  color: $clockColor;
  font: bold 12px/1em "Helvetica Neue", Helvetica, "sans-serif";

.date-day {
  font-size: 26px;
  line-height: 1em;

.time {
  position: relative;
  // display: inline-block;
  width: 25px;
  height: 25px;
  margin: 7px;
  border: 3px solid $clockColor;
  border-radius: 50%;
.time-hand {
  position: absolute;
  top: 2px;
  left: 11px;
  width: 3px;
  height: 11px;
  background-color: $clockColor;
  border-radius: 3px;
  transition: transform 2s ease-out;
  transform-origin: 50% 10px;
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
.time-minutes {
  // display: none;
.time-hours {
  top: 5px;
  height: 8px;
  transform-origin: 50% 7px;

// It's late...
.time.night {
  background-color: $clockColor;
  .time-hand {
    background-color: $bgColor;


                function setTime(clock) {
  var hourHand = clock.find('.time-hours'),
      minuteHand = clock.find('.time-minutes'),
      hours = hourHand.text(),
      minutes = minuteHand.text(),
      hourAngle = 360 / (12 / hours),
      minuteAngle = 360 / (12 / (minutes / 5));
  if( clock.hasClass('pm') && (hours > 7) ) {
  } else if( clock.hasClass('am') && (hours < 7)) {
  //  .html( hourAngle );
  //  .html( minuteAngle );
    .css('-webkit-transform', 'rotate(' + hourAngle + 'deg)')
    .css('-ms-transform', 'rotate(' + hourAngle + 'deg)')
    .css('transform', 'rotate(' + hourAngle + 'deg)');
     .css('-webkit-transform', 'rotate(' + minuteAngle + 'deg)')
     .css('-ms-transform', 'rotate(' + minuteAngle + 'deg)')
     .css('transform', 'rotate(' + minuteAngle + 'deg)');

setTimeout(function() {
    .each(function() {
      setTime( $(this) );    
}, 1000);