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.

            
              .center
  .case-front
    .handle
    each val, row in new Array(21)
      - let evenRow = row % 2 === 0
      .circle-row(class=(evenRow ? '' : 'shifted'))
        - let circleNumber = evenRow ? 8 : 7
        each val, column in new Array(circleNumber)
          .circle
            if (row !== 0)
              .top
            if (!evenRow || column !== 0)
              .left
            if (column !== 7)
              .right

    .foot.foot-left
    .foot.foot-right
    
  .case-side
    img.apple-logo(src="http://pngimg.com/uploads/apple_logo/apple_logo_PNG19670.png")
    .foot.foot-left
    .foot.foot-right
    

            
          
!
            
              *, *:before, *:after 
  box-sizing: border-box
  
body
  width: 100vw
  height: 100vh

.inspiration
  position: fixed
  bottom: 0
  right: 0
  padding: 10px
  text-align: center
  text-decoration: none
  font-family: 'Gill Sans', sans-serif
  font-size: 12px
  color: rgb(127, 127, 127)
  
.center
  position: absolute
  top: 50%
  left: 50%
  display: flex
  align-items: center
  transform: translate(-50%, -50%) scale(1.1)
  
  @media screen and (max-height: 500px)
    transition: transform 0.5s
    transform: translate(-50%, -50%) scale(0.8)

.case-front
  background-color: #e9eaec
  background: linear-gradient(to right, #b9babc, #e9eaec 5%, #e9eaec 95%, #b9babc 100%)
  padding: 10px 15px
  transform: scale(0.7)
  
.case-side
  display: flex
  justify-content: center
  align-items: center
  width: 500px
  height: 460px
  background: linear-gradient(to right, #b9babc, #e9eaec 5%, #e9eaec 95%, #b9babc 100%)
  transform: scale(0.7)
  margin-left: -60px
  
  .apple-logo
    width: 100px
    filter: brightness(30%)
  
.handle
  position: absolute
  top: -62px
  left: 50%
  width: 250px
  height: 110px
  border-radius: 30px 30px 0 0
  transform: translateX(-50%) scale(0.7)
  box-shadow: 
  0 0 0 5px #c4c4c4,
  0 0 0 9px #888787,
  0 0 0 13px #fff,
  0 0 0 16px #ddd,
  0 0 0 18px #aaa
  clip-path: inset(-20px -20px 45px -20px)
  
.circle-row
  display: grid
  grid-template-columns: repeat(8, 28px)
  grid-template-rows: repeat(1, 20px)
  height: 21px
  
  &.shifted
    transform: translateX(14px)
    
.circle
  place-self: center
  width: 100px
  height: 100px
  border-radius: 50%
  background: radial-gradient(circle at 30% 40%, #fff 10%, #888888 50%)
  box-shadow: inset 0px 0px 30px -2px #000
  transform: scale(0.22)

  .top
    position: absolute
    width: 50px
    height: 35px
    border-radius: 50%
    background-color: black
    transform: translateX(25px) translateY(1px)
  .left
    position: absolute
    width: 50px
    height: 35px
    border-radius: 50%
    background-color: black
    transform: translateX(-1px) translateY(50px) rotate(60deg)
  .right
    position: absolute
    width: 50px
    height: 35px
    border-radius: 50%
    background-color: black
    transform: translateX(51px) translateY(50px) rotate(-60deg)

.foot
  position: absolute
  bottom: -40px
  width: 25px
  height: 40px
  border-bottom: 2px solid #777
  background: linear-gradient(to right, #8a8a8a, #c4c4c4, #888787, #fff, #ddd, #828282)
  
  &:after
    content: ''
    width: 60px
    height: 5px
    position: absolute
    bottom: -6px
    left: -17px
    background: linear-gradient(to right, #8a8a8a, #c4c4c4, #888787, #fff, #ddd, #828282)
    border-bottom: 1px solid #777

  &.foot-left
    left: 25px
    transform: scale(-1, 1)
  &.foot-right
    right: 25px 

            
          
!
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