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.

            
              <body>

	<!-- #HEADER -->
	<header class="contain-to-grid">

		<!-- #NAVIGATION -->
		<nav class="top-bar" data-topbar data-options="" role="navigation">

			<!-- Top Bar Name -->
			<ul class="title-area">
			
				<li class="name"><h1><a href="#">Fixed Media Player</a></h1></li>
			
			</ul>

		</nav>

	</header> 


	<!-- #ABOUT -->

	<div class="row">

		<!-- About Summary -->
		<section class="medium-7 columns end">

			<div class="about__summary">

				<p>My goal was to build a media player that is fixed to the bottom of the viewport. It should exactly match the resizing that happens with the 'medium-10 medium-centered large-uncentered large-7 columns' setup I have in this section.</p>
        <p>The key to the solution was to mimic the column structure of the footer with the 7-column left div (containing the .media-player__device) and 5-column right div (empty). That is, I contained the row & column in a div called .media-player, which I set as position: fixed, bottom: 0, and width: 100%.</p>
			</div>

		</section>

	</div>





	<!-- #FOOTER -->
	<section class="footer">

		<div class="row">

			<!-- #footer__right -->
			<div class="medium-10 medium-centered large-uncentered large-5 large-push-7 columns">

				<!-- Copyright -->
				<div class="copyright">&copy; 2014 This Website</div>

			</div>


			<!-- #footer__left -->
			<div class="medium-10 medium-centered large-uncentered large-7 large-pull-5 columns">

				<div class="footer__dock"></div>

			</div>

		</div>

	</section>





	<!-- #MEDIA-PLAYER -->
	<section class="media-player">

		<div class="row">

			<!-- #media-player__left -->
			<div class="medium-10 medium-centered large-uncentered large-7 columns">

				<div class="media-player__device">
					Media Player
				</div>

			</div>

			<!-- #media-player__right (invisible placeholder) -->
			<div class="large-5 columns show-for-large-only"></div>

		</div>

	</section>





<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/foundation/js/foundation.min.js"></script>
<script src="js/app.js"></script>





</body>

            
          
!
            
              @import "bourbon";

//------------------------------------------------------------
//
// #BODY
//
//------------------------------------------------------------


body {
  background: #ccc;
}


.about__summary {
  background: #c1c1c1;
  color: #333;
  padding: rem-calc(15);
  margin-top: rem-calc(50);
  margin-bottom: rem-calc(400);
}





//------------------------------------------------------------
//
// #FOOTER
//
//------------------------------------------------------------


.footer {
  background: #333;

  &__dock {
    background: #ccc;
    font-size: rem-calc(12);
    height: 60px;
  }

}

.copyright {
  color: #777;
  font-size: rem-calc(12);
  margin-bottom: rem-calc(20);
  text-align: center;
  
  // How is it best to vertically align this in the center?
  margin-top: 20px;

  @media #{$large-up} {
    margin-bottom: 0;
  }

}





//------------------------------------------------------------
//
// #MEDIA-PLAYER
//
//------------------------------------------------------------


.media-player {

  // Here is where the magic happens
  position: fixed;
  bottom: 0;
  width: 100%;
	
	&__device {
    background: rgba(0, 0, 0, .8);
    color: #ccc;
    font-size: rem-calc(12);
    height: 60px;
    padding: rem-calc(15);
	}

}
            
          
!
            
              $(document).foundation({
	orbit: {
		animation: 'slide',
		circular: true,
		navigation_arrows: false,
		slide_number: false,
		swipe: true,
		timer: 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