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.

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

              
                .screen
	.counter 00:00
	a.btn-start(href="#") start
	.shape
a.go-to-dribbble(href="https://dribbble.com/shots/2909633--014-Daily-UI-Challenge-Countdown-Timer" target="_blank") View the original on Dribbble
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Roboto')

$pink: rgb(223, 84, 137)
$gray: rgb(53, 56, 69)

body
	overflow: hidden
	width: 100vw
	height: 100vh
	background: $gray
	box-sizing: border-box
	text-align: center
	user-select: none
	-moz-user-select: none
	-webkit-user-select: none

.screen
	width: 290px
	height: 480px
	background: $gray
	position: relative
	top: 45%
	left: 50%
	transform: translate(-50%, -50%)
	border-radius: 5px
	box-shadow: 0 10px 50px rgba(0,0,0,.3)
	overflow: hidden
	text-align: center		
	
.counter
	color: #fff
	font-weight: 500
	font-size: 5rem
	z-index: 6
	margin-top: 150px
	position: relative

.btn-start
	position: absolute
	bottom: 30px
	left: 50%
	transform: translateX(-50%)
	text-decoration: none
	text-transform: uppercase
	color: $pink
	cursor: pointer
	font-weight: bold
	letter-spacing: 0.05rem
	font-family: Roboto, sans-serif
	z-index: 3

.shape
	width: 20px
	height: 20px
	border-radius: 50%
	background: $pink
	position: absolute
	bottom: 30px
	left: 50%
	transform: translateX(-50%) scale(0)
	transform-origin: center center
	z-index: 2
	
	&.anim
		animation: shapeAnimation 4s forwards 1 ease-out
	
.go-to-dribbble
	position: fixed
	bottom: 30px
	left: 50%
	transform: translateX(-50%)
	color: $pink
	text-decoration: none
	transition: all .2s ease

	&:hover
		color: darken($pink, 20%)
	
@keyframes shapeAnimation
	10%
		transform: translateX(-50%) scale(50)
	15%
		border-radius: 50%
	30%
		border-radius: 0
	100%
		border-radius: 0
		bottom: -1px
		transform: translateX(-50%) scale(50,0)
		transform-origin: bottom center
	
              
            
!

JS

              
                // original on Dribbble: https://dribbble.com/shots/2909633--014-Daily-UI-Challenge-Countdown-Timer

const $btnStart = document.querySelector('.btn-start');
const $shape = document.querySelector('.shape');
const $counter = document.querySelector('.counter');

$btnStart.addEventListener('click', function(e) {
	e.preventDefault();
	
	if ($counter.textContent === '00:00') {
		$counter.textContent = '00:03';
	
		let i = 2;

		setTimeout(function() {
			setInterval(function() {
				if (i >= 0) {
					i = '0' + i;
					i = i.toString();
					$counter.textContent = '00:' + i;
					i--;
				}
				if (i < 0) {
					clearInterval(this);
				}
			}, 1000);
		}, 800);

		setTimeout(function() {
			$btnStart.textContent = 'WAIT';
			$btnStart.style.color = '#fff';
			$shape.classList.add('anim');
			$shape.addEventListener('animationend', function() {
				$shape.classList.remove('anim');
				$btnStart.style.color = 'rgb(223, 84, 137)';
				$btnStart.textContent = 'START';
			});
		}, 200);
	}
});
              
            
!
999px

Console