cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="wrapper">
	<nav>
		<input type="checkbox" id="menu" />
		<label for="menu" class="menu">
			<span></span>
			<span></span>
			<span></span>
		</label>
		<label for="menu" class="menu-bg">
			<ul>
				<li><a href="#">
					<i class="fa fa-sun-o"></i>
					Your Daily Mix
				</a></li>
				<li><a href="#">
					<i class="fa fa-music"></i>
					Playlists
				</a></li>
				<li><a href="#">
					<i class="fa fa-feed"></i>
					Stations
				</a></li>
				<li><a href="#">
					<i class="fa fa-headphones"></i>
					Songs
				</a></li>
				<li><a href="#">
					<i class="fa fa-bullseye"></i>
					Albums
				</a></li>
				<li><a href="#">
					<i class="fa fa-group"></i>
					Artists
				</a></li>
				<li><a href="#">
					<i class="fa fa-bullhorn"></i>
					Podcasts
				</a></li>
				<li><a href="#">
					<i class="fa fa-video-camera"></i>
					Videos
				</a></li>
			</ul>
		</label>
		<label for="search" class="search">
			<i class="fa fa-search"></i>
		</label>
	</nav>
	<div class="now-playing">
		<div class="np">Now Playing</div>
		<div class="np-details">
			<div class="album-art"></div>
			<div class="album-info">
				<span>Forty Six & 2</span>
				<span>Tool &nbsp; | &nbsp; Ænima</span>
			</div>
			<div class="song-time">6:04</div>
		</div>
	</div>
	<ul class="track-listing">
		<div class="up-next">
			Up Next
		</div>
		<li data-time="5:11">
			<span><i class="fa fa-stop"></i></span>
			<div class="title">
				<div>Stinkfist</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="8:29">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Eulogy</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="6:07">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>H.</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="0:39">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Useful Idiot</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="6:04" class="playing">
			<span><i class="fa fa-pause"></i></span>
			<div class="title">
				<div>Forty Six & 2</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time playing"></li>
		<li data-time="1:53">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Message for Harry Manback</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="4:34">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Hooker With a Penis</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="0:56">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Intermission</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="5:24">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Jimmy</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="2:17">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Die Eier von Satan</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="9:56">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Pushit</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="1:26">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Cesaro Summability</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="6:40">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Ænima</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="4:00">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>(-) Ions</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
		<li data-time="13:47">
			<span><i class="fa fa-play"></i></span>
			<div class="title">
				<div>Third Eye</div>
				<div>Tool</div>
			</div>
		</li>
		<li class="time"></li>
	</ul>
	<div class="runtime">
		<div>
			<span id="totalHours"></span>:
			<span id="totalMinutes"></span>:
			<span id="totalSeconds"><span>
		</div>
	</div>		
	<div class="actions">
		<div class="favorite"><i class="fa fa-heart"></i></div>
		<div><i class="fa fa-random"></i></div>
		<div><i class="fa fa-repeat"></i></div>
		<div><i class="fa fa-ellipsis-h"></i></div>
	</div>	
</div>
            
          
!
            
              $base-duration: 500ms;

// Colors
$color-1: #19181D;
$color-2: #CDDC39;
$color-3: #3498db;
$white: #f5f5f5;
$text: #444;
$black: #000; 
$lightblack: #333;

// Breakpoints
$sm: new-breakpoint(min-width 320px);
$med: new-breakpoint(min-width 768px);
$lg: new-breakpoint(min-width 1024px);

*, *:before, *:after {
	box-sizing: border-box;
	outline: none;
}

label { cursor: pointer; }

html {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100vh;
	font-family: 'Source Sans Pro', sans-serif;
	font-size: 16px;
	font-smooth: auto;
	font-weight: 300;
	line-height: 1.5;
	color: $text;
	
	&:before, &:after {
		position: absolute;
		content: '';
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}
	
	&:before {
		background-color: rgba($color-1,0.96);
		z-index: 0;
	}
	
	&:after {
		background-image: url('https://static.pexels.com/photos/196652/pexels-photo-196652.jpeg');
		background-position: center;
		background-repeat: no-repeat;
		background-size: cover;
		filter: blur(5px);
		z-index: -1;
	}
}

body {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 375px;
	height: 667px;
	overflow: hidden;
}

.wrapper {
	position: relative;
	width: 375px;
	height: 667px;
	//background-color: rgba($color-1,0.96);
	border-radius: 5px;
	box-shadow: 0 0 40px rgba($black,0.4);
	overflow-x: hidden !important;
	overflow-y: scroll;
	
	nav {
		position: fixed;
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 375px;
		margin: 0;
		padding: 0 20px;
		border-radius: 5px 5px 0 0;
		z-index: 9999;
		
		.menu, .search {
			color: $white;
		}
		
		.menu {
			position: relative;
			display: block;
			// flex-direction: column;
			// align-items: center;
			// justify-content: center;
			width: 40px;
			height: 40px;
			z-index: 9999;
						
			span {
				position: absolute;
				top: 50%;
				left: 0;
				width: 20px;
				height: 2px;
				background-color: $white;
				transform-origin: center;
				transform: translate(-50,-50%);
				
				&:first-child {
					transform: translateY(-5px);
					animation: burger1 250ms linear;
				}
				
				&:last-child {
					transform: translateY(5px);
					animation: burger2 250ms linear;
				}
			}
		}
		
		.menu-bg {
			position: absolute;
			top: 0;
			left: 0;
			width: 375px;
			height: 0;
			background-color: rgba($black,0.9);
			transition: height 0.5s ease;
			overflow: hidden;
			z-index: 9990;
			
			> ul {
				position: relative;
				display: block;
				margin: 50px 0 0 0;
				padding: 0;
				list-style-type: none;
				
				li {
					position: relative;
					display: flex;
					align-items: center;
					justify-content: flex-start;
					margin: 0;
					padding: 10px 20px;
					
					a {
						color: $white;
						text-decoration: none;
						
						i {
							font-size: 12px;
							margin-right: 15px;
						}
					}
				}
			}
		}
		
		#menu {
			display: none;
			
			&:checked ~ .menu {
				
				span {
					
					&:first-child {
						transform: rotate(45deg);
						animation: burger3 250ms linear;
					}
					
					&:nth-of-type(2) {
						width: 0;
					}
					
					&:last-child {
						transform: rotate(-45deg);
						animation: burger4 250ms linear;
					}
				}
			}
			
			&:checked ~ .menu-bg {
				left: 0;
				height: 667px;
				transition: height 0.5s ease;
			}
		}
	}
	
	@keyframes burger1 {
		0%   { transform: translateY(0); }
		50%  { transform: translateY(0); }
		100% { transform: translateY(-5px) rotate(0deg); }
	}

	@keyframes burger2 {
		0%   { transform: translateY(0); }
		50%  { transform: translateY(0); }
		100% { transform: translateY(5px) rotate(0deg); }
	}

	@keyframes burger3 {
		0%   { transform: translateY(0); }
		50%  { transform: translateY(0); }
		100% { transform: translateY(0) rotate(45deg); }
	}

	@keyframes burger4 {
		0%   { transform: translateY(0); }
		50%  { transform: translateY(0); }
		100% { transform: translateY(0) rotate(-45deg); }
	}
	
	.now-playing {
		position: fixed;
		display: block;
		width: 375px;
		margin: 0;
		padding: 50px 20px 30px;
		background-color: rgba($color-1,0.99);
		border-radius: 5px 5px 0 0;
		z-index: 999;
		
		&:before, &:after {
			position: absolute;
			content: '';
			top: 100%;
			left: 0;
			height: 3px;
		}
		
		&:before {
			width: 69%;
			background-color: $color-2;
			z-index: 1;
		}
		
		&:after {
			width: 100%;
			background-color: $lightblack;
		}
		
		.np {
			margin-bottom: 5px;
			color: lighten($text,10%);
			font-size: 11px;
			font-weight: 600;
			text-transform: uppercase;
		}
		
		.np-details {
			position: relative;
			display: flex;
			flex-direction: row;
			align-items: flex-start;
			justify-content: flex-start;
			
			.album-art {
				position: relative;
				width: 50px;
				height: 50px;
				margin-right: 10px;
				background: #000;
				background-image: url('http://www.state38.co/Images/Aenima.jpg');
				background-position: center;
				background-repeat: no-repeat;
				background-size: cover;
				
				&:before {
					position: absolute;
					content: '\f04c';
					display: flex;
					align-items: center;
					justify-content: center;
					top: 0;
					left: 0;
					width: 100%;
					height: 100%;
					background-color: rgba($black,0.5);
					color: $white;
					font-family: 'FontAwesome';
					font-size: 14px;
				}
			}

			.album-info {
				width: 60%;
				padding: 5px 0;

				span {
					position: relative;
					display: block;
					
					&:first-child {
						font-size: 15px;
						letter-spacing: 1px;
						text-transform: uppercase;
						color: $white;
					}
					
					&:last-child {
						color: lighten($text,10%);
						font-size: 12px;
						font-weight: 600;
						text-transform: uppercase;
					}
				}
			}
		}
		
		.song-time {
			position: relative;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			width: calc(40% - 50px);
			padding: 7px 0;
			color: $white;
			font-size: 24px;
		}
	}
	
	.track-listing {
		position: relative;
		display: block;
		margin: 0;
		padding: 160px 0 10px;
		list-style-type: none;
		width: 100%;
		
		.up-next {
			margin: 0;
			padding: 0 20px;
			color: lighten($text,10%);
			font-size: 11px;
			font-weight: 600;
			text-transform: uppercase;
		}

		li {
			position: relative;
			display: flex;
			align-items: center;
			margin: 0;
			padding-top: 10px;
			padding-bottom: 10px;
			color: $white;
			float: left;

			&:nth-of-type(odd) {
				justify-content: flex-start;
				width: 75%;
				padding-left: 20px;
				
				span {
					position: relative;
					display: flex;
					align-items: center;
					justify-content: center;
					width: 20px;
					height: 20px;
					margin-right: 10px;
					border: 1px solid $white;
					border-radius: 50%;
					float: left;
					
					i {
						position: absolute;
						top: 50%;
						left: 53%;
						font-size: 8px;
						transform: translate(-50%,-50%);
					}
				}
			}

			&:nth-of-type(even) {
				justify-content: flex-end;
				width: 25%;
				padding-right: 20px;
				padding-top: 11px;
				padding-bottom: 12px;
				
				i {
					margin-left: 10px;
					color: lighten($text,10%);
					font-size: 12px;
				}
			}
			
			.title {
				font-size: 14px;
				line-height: 1.1;
				
				> div {
					
					&:last-child {
						color: lighten($text,10%);
						font-size: 11px;
						font-weight: 400;
						text-transform: uppercase;
					}
				}
			}
			
			&.playing {
				color: #CDDC39;
				font-weight: 400;
				background-color: rgba($white,0.05);
				
				span {
					border: 1px solid $color-2;
					border-radius: 50%;
					float: left;
					
					i {
						position: absolute;
						top: 50%;
						left: 52%;
						font-size: 8px;
						transform: translate(-50%,-50%);
					}
				}
			}
		}
	}
	
	.runtime {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		margin: 0 0 60px;
		padding: 15px 0 10px;
		border-top: 1px solid $text;
		color: $color-2;
		font-weight: 600;
	}
	
	.actions {
		position: sticky;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		bottom: 0;
		width: 375px;
		height: 55px;
		background-color: rgba($color-1,0.99);
		border-radius: 0 0 5px 5px;
		
		> div {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 25%;
			color: lighten($text,10%);
			
			&.favorite {
				color: $color-2;
			}
		}
	}
}


            
          
!
            
              const timeNodes= Array.from(document.querySelectorAll('[data-time]'));
const seconds = timeNodes
	.map(node => node.dataset.time)
	.map(timeCode => {
		const [mins, secs] = timeCode.split(':').map(parseFloat);
		return (mins * 60) + secs;
		console.log(mins, secs);
	})
	.reduce((total, videoSeconds) => total + videoSeconds);

let secondsLeft = seconds;
const hours = Math.floor(secondsLeft / 3600);
secondsLeft = secondsLeft % 3600;
const mins = Math.floor(secondsLeft / 60);
secondsLeft = secondsLeft % 60;

const totalHours = document.querySelector('#totalHours');
const totalMinutes = document.querySelector('#totalMinutes');

totalHours.innerHTML = hours;
totalMinutes.innerHTML = mins;
totalSeconds.innerHTML = secondsLeft;

if(secondsLeft < 10) {
	totalSeconds.innerHTML = '0' + secondsLeft;
}

if(mins < 10) {
	totalMinutes.innerHTML = '0' + mins;
}

const time = Array.from(document.querySelectorAll('.time'));
const timeValues = timeNodes.map(node => node.dataset.time);

for(i = 0; i < timeNodes.length; i++) {
	for(i = 0; i < timeNodes.length; i++) {
		time[i].innerHTML = timeValues[i] + '<i class="fa fa-bars"></i>';
	}
}
            
          
!
999px
Loading ..................

Console