Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <div class="container">
  <div class="ipod small">
    <div class="screen">
			<div class="title-bar">
				<div class="play-icon"></div>
				<div class="title">iPod</div>
				<div class="battery small"></div>	
			</div>
      <div class="menu-options">
				<div class="option">Playlists</div>
				<div class="option">Artists</div>
				<div class="option selected">Songs</div>
				<div class="option">Settings</div>
				<div class="option">About</div>
				<div class="option">Now Playing</div>
			</div>
		</div>	
    <div class="outer-ring">
      <svg viewBox="-150 5 350 350">
				<path id="curve" d="m0,30 c16,-4 32,-4 48,0" />
				<text>
					<textPath xlink:href="#curve">menu</textPath>
				</text>
			</svg>
      <div class="skip forward"></div>
			<div class="skip back"></div>
      <div class="play-pause"></div>
			<div class="touch-wheel">
				<div class="center-button"></div>
			</div>				
		</div>
  </div>
</div>
              
            
!

CSS

              
                @font-face {
	font-family: 'ChicagoFont';
	src: url('https://dangasson.github.io/Resources/Fonts/ChicagoFLF.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
}

@light-background: #FFFFFF;
@dark-background: #E3E4E5;
@light-screen-background: #D6D5D0;
@dark-screen-background: #A5A59B;
@screen-light: #C1C1BA;
@screen-dark: #484647;
@icon-light-grey: #BABDC1;
@light-grey: #F2F2F2;
@mid-grey: #999999;
@dark-grey: #595959;
@very-dark-grey: #4D4D4D;

.centered {
  top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.container {
  position: absolute;
  .centered;
}

.ipod {
	width: 415px;
	height: 692px;
	border: 1px solid transparent;
	border-radius: 38px;
	background: linear-gradient(45deg, @dark-background, @light-background);
	box-shadow: inset 5px -5px 15px 0px grey;
}
.ipod.small {
	transform: scale(0.67, 0.67);
}

.screen {
	position: relative;
	margin: 30px auto 0px auto;
	width: 284px;
	height: 230px;
	background: linear-gradient(135deg, @dark-screen-background, @light-screen-background);
	border-radius: 10px;
	box-shadow: inset 0px 0px 10px 2px @very-dark-grey;
	font-family: "ChicagoFont", "Arial";
	font-size: 130%;
	color: @screen-dark;
}

.title {
	position: absolute;
  .centered;
}

.title-bar {
	position: absolute;
	left: 5px;
	right: 5px;
	height: 16%;
	border-bottom: 2px solid @screen-dark;
	text-align: center;
}

.play-icon {
	position: absolute;
	display: inline-block;
	top: 50%;
	left: 10px;
	transform: translate(0, -50%);
	border-left: 18px solid @screen-dark;
	border-top: 9px solid transparent;
	border-bottom: 9px solid transparent;
	height: 0;
	width: 0;
}

.battery {
  position: absolute;
  right: 5px;
  height: 50px;
  width: 100px;
  background-color: @screen-light;
  border: 5px solid @screen-dark;
  &:before {
    content: '';
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translate(0, -50%);
    height: 33%;
    width: 7px;
    background-color: @screen-light;
    border-right: 5px solid @screen-dark;
    border-top: 5px solid @screen-dark;
    border-bottom: 5px solid @screen-dark;
  }
  &:after {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: 70px;
    background: repeating-linear-gradient(to right,
      @screen-dark, @screen-dark 20px,
      @screen-light 20px, @screen-light 25px,
      @screen-dark 25px, @screen-dark 45px,
      @screen-light 45px, @screen-light 50px,
      @screen-dark 50px, @screen-dark 70px);
  }
}
.battery.small {
  transform: scale(0.3, 0.3);
  transform-origin: 100% 25%;
}

.menu-options {
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	position: relative;
	top: 17%;
	height: 81%;
}
.option {
	padding-left: 12px;
  &:after {
    content: '';
	  position: absolute;
	  right: 18px;
	  border-bottom: 3px solid @screen-dark;
  	border-right: 3px solid @screen-dark;
  	width: 8px;
	  height: 8px;
	  transform: rotate(-45deg) skew(7deg, 7deg);
	  transform-origin: 180%;
  }
}
.option.selected {
	background-color: @screen-dark;
  border-bottom: 2px solid @screen-dark;
	color: @screen-light;
  &:after {
    border-bottom: 3px solid @screen-light;
    border-right: 3px solid @screen-light;
  }
}

.outer-ring {
	position: relative;
	margin: 0 auto;
	top: 30px;
	height: 350px;
	width: 350px;
	border-radius: 50%;
	background-color: @light-background;
	box-shadow: inset 5px -5px 30px -7px @dark-grey;
  &:before, &:after {
    content: '';
    position: absolute;
    width: 0;
    height: 99%;
    border: 1px solid @very-dark-grey;
  }
  &:before {
    left: 50%;
    transform: rotate(45deg);
  }
  &:after {
    top: 0;
    left: 50%;
    transform: rotate(135deg);
  }
}

.touch-wheel {
	position: absolute;
  .centered;
	height: 276px;
	width: 276px;
	border: 2px solid @very-dark-grey;
	border-radius: 50%;
	background: radial-gradient(farthest-side at 90% -70%, @mid-grey, @light-grey);	
	box-shadow: 5px -5px 30px -7px @dark-grey;
	z-index: 1;
}

.center-button {
	position: absolute;
  .centered;
	height: 100px;
	width: 100px;
	border: 2px solid @icon-light-grey;
	border-radius: 50%;
	background-color: #CBCCCE;
	background: radial-gradient(farthest-side at -90% 80%, @mid-grey, @light-grey);
}

text {
	font-family: "Arial";
	font-size: 110%;
	font-weight: bold;
	fill: @icon-light-grey;
}
path {
  fill: transparent;
}

.skip {
	position: absolute;
	top: 50%;
	transform: translate(0, -50%);
	background-color: @icon-light-grey;
	height: 12px;
	width: 4px;
  &:before, &:after {
    content: '';
    position: absolute;
    border-left: 9px solid @icon-light-grey;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
  }
  &:before {
    left: -9px;
  }
  &:after {
    left: -18px;
  }
}
.skip.forward {
	right: 7px;
}
.skip.back {
	left: 7px;
	transform: rotate(180deg) translate(0, 50%);
}

.play-pause {
	position: absolute;
	bottom: 12px;
	left: 50%;
	height: 0;
	width: 0;
	transform: translate(-13px, 0);
	border-left: 12px solid @icon-light-grey;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
  &:before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 4px;
    height: 12px;
    width: 10px;
    background: repeating-linear-gradient(to right,
      @icon-light-grey, @icon-light-grey 4px,
      transparent 4px, transparent 6px,
      @icon-light-grey 6px, @icon-light-grey 10px);
  }
}

// hacks to get box shadows looking similar in Edge
_:-ms-lang(x), .ipod { 
  box-shadow: inset 5px -5px 25px 3px #999999;
}
_:-ms-lang(x), .screen { 
  box-shadow: inset 0px 0px 20px 1px @dark-grey;
}
_:-ms-lang(x), .outer-ring { 
  box-shadow: inset 5px -5px 50px -7px @mid-grey;
}
_:-ms-lang(x), .touch-wheel { 
 box-shadow: 5px -5px 50px -7px @mid-grey;
}
// end Edge hacks
              
            
!

JS

              
                
              
            
!
999px

Console