cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <body onload="startTime()">
  <div class="iphone">
    <div class="band"></div>
    <div class="bezel"></div>
    <div class="screen">
      <div class="content">
        <div style="margin-top:10px;margin-left:15px;background:#ccc;">
          <div id="time">&nbsp;</div>
          <div class="wifiBattery">
            <i class="fa fa-wifi" aria-hidden="true"></i>&nbsp;<i class="fa fa-battery-full" aria-hidden="true"></i> &nbsp;&nbsp;&nbsp;
          </div>&nbsp;
        </div>
        <iframe src="http://codepen.io"></iframe>
      </div>
    </div>
    <div class="speaker"></div>
    <div class="camera"></div>
    <div class="button toggle"></div>
    <div class="button vol up"></div>
    <div class="button vol down"></div>
    <div class="button power"></div>
    <div class="band"></div>
  </div>
</body>
            
          
!
            
              .iphone {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  height: 724px;
  width: 357px;
  background-image: linear-gradient(
    top,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 1%,
    rgba(0, 0, 0, 1) 2%,
    rgba(255, 255, 255, 1) 5%,
    rgba(255, 255, 255, 1) 95%,
    rgba(0, 0, 0, 1) 98%,
    rgba(255, 255, 255, 1) 99%,
    rgba(255, 255, 255, 1) 100%
  );
  margin: 30px auto;
  border-radius: 55px;
  box-sizing: border-box;
  border: 2px solid black;
  box-shadow: inset 0px 0px 7px 0px rgba(0, 0, 0, 0.75);
  position: relative;
  // transform: rotate(-90deg);
}

.band {
  background: #aaaaaa;
  height: 5px;
  width: 100%;
  position: absolute;
  &:first-of-type {
    top: 9%;
  }
  &:last-of-type {
    bottom: 9%;
  }
}

.bezel {
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  background: #565656;
  background-image: linear-gradient(
    top,
    rgba(106, 106, 106, 1) 0%,
    rgba(0, 0, 0, 1) 1%,
    rgba(86, 86, 86, 1) 4%,
    rgba(86, 86, 86, 1) 96%,
    rgba(0, 0, 0, 1) 99%,
    rgba(106, 106, 106, 1) 100%
  );
  position: relative;
  left: 5px;
  top: 5px;
  border-radius: 48px;
  border-left: 3px solid black;
  border-right: 3px solid black;
  border-top: 3px solid #484848;
  border-bottom: 3px solid #0d0d0d;
  box-sizing: border-box;
  box-shadow: inset 0px 0px 7px 0px rgba(190, 190, 190, 0.8);
  z-index: 2;

  &::after {
    content: "";
    width: calc(100% - 14px);
    height: calc(100% - 14px);
    background: #000;
    position: absolute;
    top: 7px;
    left: 7px;
    border-radius: 40px;
  }
}

.screen {
  z-index: 3;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/1543663/cp-iphonex-1125x2436.png");
  background-size: cover;
  position: absolute;
  top: 20px;
  left: 20px;
  border-radius: 35px;
  overflow: hidden;

  &::after {
    content: "";
    width: 56%;
    height: 4%;
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    border-radius: 0 0 20px 20px;
    -webkit-transition: height ease-in 0.3s, width 0.3s, left ease 0.3s,
      border-radius ease 1s;
    transition: height ease-in 0.3s, width 0.3s, left ease 0.3s,
      border-radius ease 1s;
  }
}

#time {
  width: 50%;
  margin-top: -5px;
  float: left;
  font-size: 12px;
  font-weight: 700;
}

@keyframes move {
  25% {
    opacity: 1;
  }
  33% {
    opacity: 1;
    transform: translateY(30px);
  }
  67% {
    opacity: 1;
    transform: translateY(40px);
  }
  100% {
    opacity: 0;
    transform: translateY(55px) scale3d(0.5, 0.5, 0.5);
  }
}
.wifiBattery {
  width: 50%;
  float: right;
  text-align: right;
  margin-top: -5px;
}
iframe {
  background: black;
  width: 100%;
  height: 535px;
  margin-top: 40px;
  border: none;
}
.speaker {
  width: 48px;
  height: 5px;
  position: absolute;
  background: #1c1c1c;
  top: 3.75%;
  z-index: 4;
  left: 0;
  right: 0;
  margin: 0 auto;
  border-radius: 3px;
}

.camera {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  // background: #1b1c20;
  position: absolute;
  z-index: 4;
  top: 3.5%;
  right: 38%;
  background-image: radial-gradient(
    center,
    rgba(2, 26, 60, 1) 0%,
    rgba(49, 62, 79, 1) 8%,
    rgba(31, 62, 108, 1) 21%,
    rgba(2, 26, 60, 1) 56%,
    rgba(2, 26, 60, 1) 100%
  );
}

.button {
  width: 4px;
  position: absolute;
  z-index: 5;
  background-image: linear-gradient(
    top,
    rgba(0, 0, 0, 1) 0%,
    rgba(244, 244, 244, 1) 15%,
    rgba(244, 244, 244, 1) 85%,
    rgba(0, 0, 0, 1) 100%
  );
  box-sizing: border-box;
  border-left: 1px solid #cdcdcd;
  border-right: 1px solid #303030;
}

.button.toggle {
  height: 28px;
  top: 13%;
  left: -4px;
}

.button.vol.up,
.button.vol.down {
  height: 53px;
  left: -4px;
}

.button.vol.up {
  top: 21%;
}

.button.vol.down {
  top: 30%;
}

.button.power {
  right: -4px;
  height: 84px;
  top: 23.5%;
  border-right: 1px solid #cdcdcd;
  border-left: 1px solid #303030;
}

            
          
!
            
              function startTime() {
  var d = new Date();
  var n = d.toLocaleString([], { hour: "2-digit", minute: "2-digit" });
  document.getElementById("time").innerHTML = n;
}

            
          
!
999px
Loading ..................

Console