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

              
                .template
  .phone
    .speaker
    .flashlight
    .screen
      #app(v-on:click="openApp", :class="{on: isActive}")
        //- create your app here
        h1 {{title}}
        a(:href="url" target="_blank", :class="{on: isActive}") {{description}}
    button.home(onclick="closeApp()")

  .controls
    .title iPhone 8 Plus
    .author made by <a href="https://www.instagram.com/nicky3878/" target="_blank">Rainforest</a>
              
            
!

CSS

              
                $colorWhite: #e4e4e4
$colorBlack: #444444
$colorApple: #F1CEB9

@mixin size($w, $h: $w)
  width: $w
  height: $h
@mixin bxshadow($h, $v, $hb, $vb, $a)
  box-shadow: $h $v $hb $vb rgba(black, $a)
*
  // border: 1px solid black
  font-family: "San Francisco Display Semibold", serif
body, html
  +size(100%)
  margin: 0
  display: flex
  align-items: center
  justify-content: center
  background-color: $colorBlack
.template
  .phone
    +size(375px, 792px)
    border-radius: 50px
    display: flex
    align-items: center
    justify-content: center
    position: relative
    background-color: $colorWhite
    border: 5px solid $colorApple
    +bxshadow(0px, 5px, 25px, 5px, 0.4)
    transition: 0.5s
    &:hover
      transform: translate(0px, -5px)
      +bxshadow(0px, 5px, 50px, 10px, 0.4)
    .speaker
      +size(75px, 4px)
      border-radius: 4px
      background-color: #000
      position: absolute
      top: 45px
    .flashlight
      +size(8px, 8px)
      border-radius: 50%
      background-color: #000
      position: absolute
      top: 43px
      transform: translateX(-50px)
    .screen
      +size(335px, 610px)
      border-radius: 5px
      overflow: hidden
      background-image: url(https://applealmond.com/wp-content/uploads/2018/09/1537027385-8f977adb51eadb4b26b47e013ce5a18d.jpg)
      background-size: cover
      background-position: center
      #app
        +size(75px)
        border-radius: 15px
        margin: 25px
        background-color: $colorApple
        transition: 0.4s
        display: flex
        align-items: center
        justify-content: center
        flex-direction: column
        &.on
          margin: 0
          +size(100%)
          border-radius: 0
          background-color: $colorBlack
        h1
          color: $colorApple
          font-size: 60px
          margin: 10px
        a.on
          color: $colorWhite
          font-size: 16px
          border: 2px solid $colorWhite
          border-radius: 10px
          padding: 10px
          margin: 0
          text-decoration: none
          &:hover
            color: $colorApple
            border: 2px solid $colorApple
            background-color: rgba($colorApple, 0.3)
          
          
    .home
      +size(50px)
      border-radius: 50%
      position: absolute
      left: calc(50% - 25px)
      bottom: 15px
      background-color: transparent
      border: 3px solid $colorApple
      

  .controls
    margin-top: 50px
    .title
      font-size: 60px
      text-align: center
      color: $colorApple
    .author
      font-size: 20px
      color: $colorWhite
      text-align: center
      margin-top: 10px
      a
        font-size: 20px
        color: $colorWhite
        text-align: center
      
    

    
@font-face
  font-family: "San Francisco Display Ultralight"
  font-style: normal
  font-weight: 400
  src: url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.eot?#iefix) format("embedded-opentype"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff2) format("woff2"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff) format("woff"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.ttf) format("truetype"), url("fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.svg#San Francisco Display Ultralight") format("svg")


@font-face
  font-family: "San Francisco Display Thin"
  font-style: normal
  font-weight: 400
  src: url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-thin-webfont.eot?#iefix) format("embedded-opentype"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-thin-webfont.woff2) format("woff2"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-thin-webfont.woff) format("woff"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-thin-webfont.ttf) format("truetype"), url("fonts/sanfrancisco/sanfranciscodisplay-thin-webfont.svg#San Francisco Display Thin") format("svg")


@font-face
  font-family: "San Francisco Display Medium"
  font-style: normal
  font-weight: 400
  src: url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.eot?#iefix) format("embedded-opentype"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff2) format("woff2"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.woff) format("woff"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.ttf) format("truetype"), url("fonts/sanfrancisco/sanfranciscodisplay-medium-webfont.svg#San Francisco Display Medium") format("svg")


@font-face
  font-family: "San Francisco Display Semibold"
  font-style: normal
  font-weight: 400
  src: url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.eot?#iefix) format("embedded-opentype"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff2) format("woff2"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff) format("woff"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.ttf) format("truetype"), url("fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.svg#San Francisco Display Semibold") format("svg")


@font-face
  font-family: "San Francisco Display Bold"
  font-style: normal
  font-weight: 400
  src: url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.eot?#iefix) format("embedded-opentype"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff2) format("woff2"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff) format("woff"), url(https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.ttf) format("truetype"), url("fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.svg#San Francisco Display Bold") format("svg")
              
            
!

JS

              
                var vm = new Vue({
  el: "#app",
  data: {
    isActive: false,
    title: "",
    description: "",
    url: ""
  },
  methods: {
    openApp: function() {
      this.isActive = true
      this.title = "iOS 12"
      this.description = "Available 2018.9.17"
      this.url = "https://www.apple.com/ios/ios-12/"
    },
  }
  
})

function closeApp() {
  vm.isActive = false
  vm.title=""
  vm.description = ""
  vm.url = ""
}
              
            
!
999px

Console