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

              
                <center>

<div class="device device-iphone">
  <!-- Your Mockup Here! -->
  <img src="https://picsum.photos/375/812">
</div>

</center>
              
            
!

CSS

              
                // By: J.T. Brown
// Frontend Developer and UX/UI Designer
// EpogeeDesign.com
// Twitter: twitter.com/epogeedesign
:root {
  --color-light: 255,255,255;
  --color-dark: 0,0,0;
}

html {
  @media (max-width:580px) {
    font-size:calc((16 / 580) * 100vw);
  }
}

*,*:before,*:after { box-sizing:border-box; }

.device-iphone {
  //Phone Size:
  font-size:100%;
  @media (max-height:950px) { font-size:90%; }
  @media (max-height:850px) { font-size:80%; }
  @media (max-height:750px) { font-size:70%; }
  @media (max-height:650px) { font-size:60%; }
  @media (max-height:550px) { font-size:50%; }
  @media (max-height:350px) { font-size:40%; }
  
  position:relative;
  
  width:375 / 16em;
  height:812 / 16em;
  //PHONE BODY
  border-radius:60 / 16em;
  padding:15 / 16em;
  box-sizing:content-box;
  background:rgba(var(--color-dark),1);
  box-shadow:
    0 2 / 16em 2 / 16em 3 / 16em rgba(var(--color-dark),1), 
    0 -1 / 16em 4 / 16em 3 / 16em rgba(var(--color-light),.55), 
    0 -1 / 16em 4 / 16em 3 / 16em rgba(var(--color-dark),1), 
    0 0 0 8 / 16em rgba(var(--color-light),.11),
    0 0 0 8 / 16em rgba(var(--color-dark),1),
    inset 0 -3 / 16em 5 / 16em 0 rgba(var(--color-light),.1), 
    inset 0 -3 / 16em 5 / 16em 0 rgba(var(--color-dark),1), 
    inset 0 -5 / 16em 2 / 16em 4 / 16em rgba(var(--color-dark),.77), 
    inset 0 -5 / 16em 1 / 16em 0 rgba(var(--color-light),.18), 
    inset 0 0 / 16em 10 / 16em 3 / 16em rgba(var(--color-dark),.87), 
    inset 0 5 / 16em 1 / 16em 0 rgba(var(--color-light),.18), 
    inset 0 -1 / 16em 5 / 16em 5 / 16em rgba(var(--color-light),.5),
    0 0 20 / 16em 10 / 16em fade(black,30), //Iphone Drop Shadow
  ;

  //BUTTONS
  &:after {
    content:'';
    position:absolute;
    width:calc(100% + .625em + .625em + .625em);
    height:calc(100% + .625em + .625em + .625em);
    left:-12 / 16em;
    top:-12 / 16em;
    filter: drop-shadow(-1px 0px 1px rgba(0,0,0,.3));
    background-repeat:no-repeat;
    background-image:
      linear-gradient(to right, #454545, #979797, #555555 80%, #484848), // Btn- Body
      radial-gradient(circle at top right, #3c3c3c 10%, #808080, #6d6d6d 54%, transparent 70%, transparent 100%), //Btn - Bottom curve
      radial-gradient(circle at bottom right, #3c3c3c 10%, #808080, #6d6d6d 54%, transparent 70%, transparent 100%), // Btn - Top curve
      
      linear-gradient(to right, #454545, #979797, #555555 80%, #484848), // Btn- Body
      radial-gradient(circle at top right, #3c3c3c 10%, #808080, #6d6d6d 54%, transparent 70%, transparent 100%), //Btn - Bottom curve
      radial-gradient(circle at bottom right, #3c3c3c 10%, #808080, #6d6d6d 54%, transparent 70%, transparent 100%), // Btn - Top curve
      
      linear-gradient(to right, #454545, #979797, #555555 80%, #484848), // Btn- Body
      radial-gradient(circle at top right, #3c3c3c 10%, #808080, #6d6d6d 54%, transparent 70%, transparent 100%), //Btn - Bottom curve
      radial-gradient(circle at bottom right, #3c3c3c 10%, #808080, #6d6d6d 54%, transparent 70%, transparent 100%) // Btn - Top curve
    ;
    
    --btn-offset:0;
    --btn-width: 5px;
    z-index:-1;
    
    background-size:
      var(--btn-width) 25 / 16em,
      var(--btn-width) 5 / 16em,
      var(--btn-width) 5 / 16em,
      
      var(--btn-width) 60 / 16em,
      var(--btn-width) 5 / 16em,
      var(--btn-width) 5 / 16em,
      
      var(--btn-width) 60 / 16em,
      var(--btn-width) 5 / 16em,
      var(--btn-width) 5 / 16em
    ;
    background-position:
      var(--btn-offset) 13%,
      var(--btn-offset) calc(13% + 1.375em),
      var(--btn-offset) calc(13% - .5em),
      
      var(--btn-offset) 21%,
      var(--btn-offset) calc(21% + 3.0625em),
      var(--btn-offset) calc(21% - 1em),
      
      var(--btn-offset) 32%,
      var(--btn-offset) calc(32% + 2.5625em),
      var(--btn-offset) calc(32% - 1.375em)
    ;
  }
  
  //BEZEL
  &:before {
    --sml-curve: .5em;
    --big-curve: 1.375em;
    --tot-height: calc(var(--sml-curve) + var(--big-curve));
    --spkr-height: .375em;
    --cam-height:1em;
    content:'';
    position:absolute;
    z-index:1;
    width:230 / 16em;
    height:var(--tot-height);
    left:50%;
    transform:translateX(-50%);
    filter: drop-shadow(0px .0625em .0625em fade(white,10));
    background-repeat:no-repeat;
    background-image:
      linear-gradient(to right,#161616,#161616), // Speaker
      linear-gradient(to right,#282828,#282828), // Speaker
      radial-gradient(circle, fade(white,5) 40%, transparent 80%), // Camera - Glare (White)
      radial-gradient(circle, #192940 40%, transparent 60%), // Camera - Glare (Blue)
      radial-gradient(circle, #161616 50%, transparent 50%), // Camera - Shape
      linear-gradient(to right,black,black), // Top black rectangle
      radial-gradient(circle at bottom right, transparent 0, transparent 70%, black 70%, black 100%), //Right curve
      radial-gradient(circle at bottom left, transparent 0, transparent 70%, black 70%, black 100%), //Left Curve
      radial-gradient(circle at top right, black 0, black 70%, transparent 70%, transparent 100%), //left Curve
      radial-gradient(circle at top left, black 0, black 70%, transparent 70%, transparent 100%), //Right Curve
      linear-gradient(to right,black,black) // Bottom black rectangle
    ;
 
    background-size: 
      3.75em var(--spkr-height),
      3.75em var(--spkr-height),
      calc(var(--cam-height) * .3) calc(var(--cam-height) * .3),
      calc(var(--cam-height) * .66) calc(var(--cam-height) * .66),
      var(--cam-height) var(--cam-height),
      calc(100% - (var(--sml-curve) + var(--sml-curve))) calc(100% - var(--big-curve)), // Top black rectangle
      var(--sml-curve) var(--sml-curve), //Right curve
      var(--sml-curve) var(--sml-curve), //Left Curve
      var(--big-curve) var(--big-curve), //Left Curve
      var(--big-curve) var(--big-curve), //Right Curve
      calc(102% - (var(--sml-curve) + var(--sml-curve) + var(--big-curve) + var(--big-curve))) 100% // Bottom black rectangle
      
    ;
    background-position:
      50% calc(50% - (var(--spkr-height) * .5)),
      50% calc(50% - (-1px + (var(--spkr-height) * .5))),
      calc(70% - .1875em) calc(25% + .0625em),
      calc(70% - .125em) calc(25% + .0625em),
      70% 25%,
      var(--sml-curve) 0, // Top black rectangle
      100% 0, //Right curve
      0% 0, //Left Curve
      var(--sml-curve) calc((var(--sml-curve) )), //Left Curve
      calc(100% - var(--sml-curve)) calc((var(--sml-curve) )), //Right Curve
      calc(var(--sml-curve) + var(--big-curve) - 1px) 0, // Bottom black rectangle
      
    ;
  }
  
  img {
    width:100%;
    height:auto;
    display:block;
    max-width:375px;
    height:auto;
    border-radius:45 / 16em;
  }
}


//FOR USE IN CODEPEN ONLY, Not needed for project.
  //Animated BG Credit: https://codepen.io/P1N2O/pen/pyBNzX
body, html { height:100%;overflow:hidden; }

body {
	background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
	background-size: 400% 400%;
	animation: gradient 15s ease infinite;
}

@keyframes gradient {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

center {
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  width:100%;
  text-align:left;
  margin:0 auto;
  box-sizing:border-box;
}
              
            
!

JS

              
                

              
            
!
999px

Console