123

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

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.

            
              <div class="demo-view">
		<div id="first-view" class="first-view">
			<header role="banner" class="main-header">
				<div class="top-bar">
					<button class="back-button" type="button">
						<img src="https://dev.crofte.fr/demos/performance-ressentie/back.png" with="32" height="32" alt="Back to previous view">
					</button>
					<h1>Streaming</h1>
				</div>
			</header>
			<main class="main-content">
				<ul class="video-list">
					<li>
						<a href="#video-1">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 1</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-2">
							<figure>
								<img class="icon" src="https://dev.crofte.fr/demos/performance-ressentie/streaming-icon.png" width="32" height="32" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 2</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-3">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 3</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-4">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 4</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-5">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 5</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-4">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 6</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-5">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 7</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-4">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 8</p>
								</figcaption>
							</figure>
						</a>
					</li>
					<li>
						<a href="#video-5">
							<figure>
								<img src="https://dev.crofte.fr/demos/performance-ressentie/cam-mini.jpg" width="60" height="45" alt="">
								<figcaption>
									<p class="video-title">Caméra extérieure 9</p>
								</figcaption>
							</figure>
						</a>
					</li>
				</ul>
			</main>
		</div><!-- .first-view -->

		<!-- panel-view -->
		<div id="panel" class="panel">
			<header role="banner" class="main-header">
				<div class="top-bar">
					<button class="back-button" type="button">
						<img src="https://dev.crofte.fr/demos/performance-ressentie/back.png" with="32" height="32" alt="Back to previous view">
					</button>
					<p class="view-title">Caméra extérieure <span>- 12:30</span></p>
				</div>
			</header>

			<div class="player">
				<div class="player-video-area">
					<div aria-hidden="true" id="loader">
						<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve"><path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946 s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634 c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"/><path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0 C22.32,8.481,24.301,9.057,26.013,10.047z"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" dur="0.5s" repeatCount="indefinite"/></path></svg>
						<p>Votre streaming est<br>en cours de chargement.</p>
					</div>
					<img id="video" src="https://dev.crofte.fr/demos/performance-ressentie/fake-video.jpg" width="330" height="248" alt="">
				</div>
				<div class="player-controls">
					<div class="pc-play">
						<span class="icon-play"></span>
					</div>
					<div class="pc-start">
						0:00
					</div>
					<div class="pc-timeline">
						<span class="pct-total"></span>
					</div>
					<div class="pc-end">
						15:03
					</div>
				</div>
			</div>
		</div>
	</div>
            
          
!
            
              body {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	line-height: 1.7;
	font-family: Helvetica, Arial, sans-serif;
	background: #151921;
	color: #F2F2F2;
}
body, figure, ul, li {
	margin: 0;
	padding: 0;
}
ul {
	list-style: none;
}
.demo-view {
	position: relative;
	width: 375px;
	height: 667px;
	background: #F2F2F2;
	box-shadow: 0 0 15px rgba(0,0,0,.4);
	overflow: hidden;
}
.main-header {
	padding: 0;
	color: #FFF;
	background: rgb(26, 126, 149);
	text-align: left;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.top-bar {
	display: flex;
	align-items: center;
	padding: 2px 0;
}
.main-header h1,
.main-header .view-title {
	flex-basis: 100%;
	margin: 0;
	font-size: 1.2em;
	letter-spacing: 0.05em;
	word-spacing: 0.05em;
}
.main-header .view-title span {
	color: rbga(255, 255, 255, 0.6);
	font-size: 0.875em;
}

.back-button {
	padding: 8px;
	border: 0;
	background: transparent;
	cursor: pointer;
}
.back-button:focus {
	outline: 0; /* demo only */
}

.main-content {
	color: #2E303D;
}
.video-list li + li {
	margin-top: 2px;
}
.video-list a {
	display: block;
	background: #FFF;
	text-decoration: none;
	color: inherit;
}
.video-list figure {
	display: flex;
	align-items: center;
	padding: 10px;
}
.video-list img {
	width: 60px;
	height: auto;
	min-height: auto;
}
.video-list .icon {
	width: 32px;
	height: 32px;
	margin: 5px 14px;
}
.video-list figcaption {
	padding: 0 10px;
}
.video-title {
	font-size: 1em;
	margin: 0;
}
.video-title + p {
	font-size: 0.75em;
	margin: 0;
}

/* Transition between panel view */
.first-view {
	transition: transform 0.475s;
	will-change: transform;
}
.panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgb(26, 26, 26);
	color: #F2F2F2;
	transform: translateX(100%);
	transition: transform 0.475s;
	will-change: transform;
}
.first-view.slide {
	transform: translateX(-100%);
}
.first-view.slide + .panel {
	transform: translateX(0);
}
.player-video-area {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 310px;
	justify-content: center;
	align-items: center;
	transition: opacity .75s;
	opacity: 0;
	will-change: opacity;
}
.panel.gogogo .player-video-area {
	opacity: 1;
}
.player-controls {
	display: flex;
	padding: 0 5px;
	align-items: center;
}
.player-controls > * {
	padding: 10px;
}
.icon-play {
	display: block;
	border-left: 10px solid currentColor;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
}
.pc-timeline {
	position: relative;
	flex-basis: 100%;
}
.pct-total {
	position: absolute;
	top: 5px;
	left: 5px;
	right: 5px;
	height: 6px;
	background: rgba(255,255,255, .3);
	border-radius: 6px;
}

/* transitions */
.icon-play,
.pc-start,
.pct-total,
.pc-end {
	opacity: 0;
	transform: translateY(20px);
	transition: transform .375s, opacity .375s;
	will-change: transform, opacity;
}
.gogogo .icon-play,
.gogogo .pc-start,
.gogogo .pct-total,
.gogogo .pc-end {
	transform: translateY(0);
	opacity: 1;
}
/* transitions timeline (by delay) */
.player-video-area {
	transition-delay: 1.33s;
}
.icon-play {
	transition-delay: .33s;
}
.pc-start {
	transition-delay: .66s;
}
.pct-total {
	transition-delay: 1s;
}
.pc-end {
	transition-delay: 1.33s;
}

/* Loader */
[id="loader"] {
	text-align: center;
	color: rgb(66, 166, 189);;
	opacity: 0;
	transition: opacity .675s;
	will-change: opacity;
}
[id="loader"] svg {
	transition: transform .675s;
	will-change: transform;	
}
[id="loader"] path,
[id="loader"] rect{
  fill: rgb(66, 166, 189);
}
[id="loader"].visible {
	opacity: 1;
}
[id="loader"].visible svg {
	transform: scale(1.7);
}

/* Video */
[id="video"] {
	position: absolute;
	top: 50px;
	left: 50%;
	margin-left: -165px;
	max-width: 100%;
	width: 330px;
	height: auto;
	opacity: 0;
	transition: opacity .475s;
	will-change: opacity;
}
[id="video"].visible {
	opacity: 1;
}
            
          
!
            
              var videos  = document.querySelectorAll( '[href^="#video-"]' ),
	panel   = document.getElementById( 'panel' ),
	firtsv  = document.getElementById( 'first-view' ),
	loader  = document.getElementById( 'loader' ),
	video   = document.getElementById( 'video' ),
	too, too2;

videos.forEach( function( element ) {
	element.addEventListener( 'click', function(e) {
		e.preventDefault();
		firtsv.classList.add( 'slide' );
		return false;
	}, false );
});

panel.addEventListener( 'click', function() {
	firtsv.classList.remove( 'slide' );
	panel.classList.remove( 'gogogo' );
	loader.setAttribute( 'aria-hidden', 'true' );
	loader.classList.remove( 'visible' );
	clearTimeout( too );
	clearTimeout( too2 );

	setTimeout(function(){
		panel.addEventListener( 'transitionend', timeline, false );
	}, 1250);
}, false );

var timeline = function(e) {
	panel.removeEventListener( 'transitionend', timeline, false );

	panel.classList.add( 'gogogo' );

	too = setTimeout( function() {
		loader.setAttribute( 'aria-hidden', 'false' );
		loader.classList.add( 'visible' );
		clearTimeout(too);
	}, 1666);

	too2 = setTimeout( function() {
		loader.setAttribute( 'aria-hidden', 'true' );
		loader.classList.remove( 'visible' );
		video.classList.add( 'visible' );
		clearTimeout(too2);
	}, 4000);
};

panel.addEventListener( 'transitionend', timeline, false );
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console