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

            
              	<div class="header">
		Pure CSS Watch
	</div>

	<div class="watch-container">
		<div class="watch-strap-top"></div>

		<div class="watch">
			<div class="watch-face">
				<div class="watch-face-outline">
					<div class="watch-face-outline-point point-12"></div>
					<div class="watch-face-outline-point point-1"></div>
					<div class="watch-face-outline-point point-2"></div>
					<div class="watch-face-outline-point point-3"></div>
					<div class="watch-face-outline-point point-4"></div>
					<div class="watch-face-outline-point point-5"></div>
					<div class="watch-face-outline-point point-6"></div>
					<div class="watch-face-outline-point point-7"></div>
					<div class="watch-face-outline-point point-8"></div>
					<div class="watch-face-outline-point point-9"></div>
					<div class="watch-face-outline-point point-10"></div>
					<div class="watch-face-outline-point point-11"></div>
				</div>

				<div class="watch-face-date date"></div>

				<div class="watch-face-centre">
					<div class="watch-face-centre-inner"></div>
				</div>

				<div class="watch-face-hands">
					<div class="watch-face-hand hour"></div>
					<div class="watch-face-hand minute"></div>
					<div class="watch-face-hand second"></div>
				</div>
			</div>

			<div class="watch-crown"></div>
		</div>

		<div class="watch-strap-bottom">James</div>
	</div>

	<div class="footer">
		&copy; 2018 <a href="http://jgrimshaw.com">James Grimshaw</a>
	</div>
            
          
!

CSS

            
              * {
	margin: 0;
	padding: 0;
	list-style-type: none;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

body {
	background: #eee;
	font-family: "Helvetica Neue", sans-serif;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Website Header */
.header {
	text-align: center;
	font-weight: 300;
	font-size: 30px;
	color: #999;
	margin: 50px;
}

/* Watch Container */
.watch-container {
	width: 300px;
	margin: 50px auto;
}

/* Watch */
.watch {
	position: relative;
	width: 300px;
	height: 300px;
}

/* Watch Face */
.watch-face {
	width: 300px;
	height: 300px;
	border-radius: 100%;
	background: #3F484A; /* Dial colour */
	border: 10px solid silver; /* Face border */
	box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5), 1px 1px 2px rgba(0, 0, 0, 0.3);
}
	
	/* Watch Face Outline */
	.watch-face-outline {}

	.watch-face-outline-point {
		position: absolute;
		width: 10px;
		height: 10px;
		background: #777;
		left: 145px;
		top: 24px;
		border-radius: 100%;
		-webkit-transform-origin: 50% 126px;
		transform-origin: 50% 126px;
	}

	.point-12 { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
	.point-1 { -webkit-transform: rotate(30deg); transform: rotate(30deg); }
	.point-2 { -webkit-transform: rotate(60deg); transform: rotate(60deg); }
	.point-3 { -webkit-transform: rotate(90deg); transform: rotate(90deg); }
	.point-4 { -webkit-transform: rotate(120deg); transform: rotate(120deg); }
	.point-5 { -webkit-transform: rotate(150deg); transform: rotate(150deg); }
	.point-6 { -webkit-transform: rotate(180deg); transform: rotate(180deg); }
	.point-7 { -webkit-transform: rotate(210deg); transform: rotate(210deg); }
	.point-8 { -webkit-transform: rotate(240deg); transform: rotate(240deg); }
	.point-9 { -webkit-transform: rotate(270deg); transform: rotate(270deg); }
	.point-10 { -webkit-transform: rotate(300deg); transform: rotate(300deg); }
	.point-11 { -webkit-transform: rotate(330deg); transform: rotate(330deg); }

	/* Watch Face Date */
	.watch-face-date {
    position: absolute;
		background-color: rgba(0,0,0,0.1);
    width: 27px;
    height: 27px;
    border-radius: 100%;
    text-align: center;
		top: 138px;
		right: 50px;
		font-size: 15px;
    line-height: 27px;
		color: #aaa;
		font-weight: 300;
	}

	/* Watch Face Center */
	.watch-face-centre {
		position: absolute;
		width: 12px;
		height: 12px;
		top: 144px;
		left: 144px;
		border-radius: 100%;
		background: #fff;
	}

	.watch-face-centre-inner {
		position: absolute;
		z-index: 1;
		width: 8px;
		height: 8px;
		top: 2px;
		left: 2px;
		border-radius: 100%;
		background: #333;
		border: 2px solid #fa9f22;
	}

	/* Watch Face Hands */
	.watch-face-hands {}

	.watch-face-hand {
		position: absolute;
	}

	.watch-face-hand.hour {
		width: 4px;
		height: 60px;
		top: 90px;
		left: 148px;
		border-radius: 10px;
		background: #fff;
		-webkit-transform-origin: 50% 100%;
		transform-origin: 50% 100%;
		-webkit-transform: rotate(306deg);
		transform: rotate(306deg);
	}

	.watch-face-hand.minute {
		width: 4px;
		height: 120px;
		top: 30px;
		left: 148px;
		border-radius: 10px;
		background: #fff;
		-webkit-transform-origin: 50% 100%;
		transform-origin: 50% 100%;
		-webkit-transform: rotate(50deg);
		transform: rotate(50deg);
	}
	
	.watch-face-hand.second {
		width: 2px;
		height: 145px;
		top: 20px;
		left: 149px;
		border-radius: 10px;
		background: #fa9f22;
		-webkit-transform-origin: 50% 130px;
		transform-origin: 50% 130px;
		-webkit-transform: rotate(180deg);
		transform: rotate(180deg);
	}

/* Watch Crown */
.watch-crown {
	position: relative;
	z-index: -1;
	width: 15px;
	height: 26px;
	top: -163px;
	left: 295px;
	border-radius: 5px;
	background: #999;
	border-right: 2px solid rgba(0, 0, 0, 0.05);
	box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Watch Straps */
.watch-strap-top {
	position: relative;
	z-index: -1;
	width: 120px;
	height: 150px;
	left: 90px;
	bottom: -20px;
	background: #785734;
	border-radius: 10px 10px 0 0;
}

.watch-strap-bottom {
	position: relative;
	z-index: -1;
	width: 120px;
	height: 150px;
	left: 90px;
	bottom: 20px;
	background: #785734;
	border-radius: 0 0 10px 10px;
	color: rgba(0, 0, 0, 0.2);
	font-weight: bold;
	text-align: center;
	padding-top: 120px;
	text-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* Website Footer */
.footer {
	text-align: center;
	font-weight: 400;
	font-size: 14px;
	color: #999;
	margin: 50px;
}

.footer a {
	color: #999;
	font-weight: 500;
	text-decoration: none;
}

.footer a:hover {
	text-decoration: underline;
}
            
          
!

JS

            
              $(document).ready(function() {
	function watch() {
		// Get the time
		var now = new Date();
		var time = now.getHours() * 3600 +
					    now.getMinutes() * 60 +
					    now.getSeconds() * 1 +
					    now.getMilliseconds() / 1000;

		// Change the time into degrees
		var hours = time / 60 / 12 * 6;
		var minutes = time / 60 * 6;
		var seconds = time * 6;
		var date = now.getDate();

		// Modify classes
		$('.hour').css('transform', 'rotate(' + hours + 'deg)');
		$('.minute').css('transform', 'rotate(' + minutes + 'deg)');
		$('.second').css('transform', 'rotate(' + seconds + 'deg)');
		$('.date').html(date);
	}

	// Get new time every 50ms
	setInterval(watch, 50);
});
            
          
!
999px

Console