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.

            
              <div class="box">
  <h2>iOS 7</h2>
  <p>When you bring up the control center in iOS 7, the background is shown with a translucant effect.</p>
  <img src="https://s.cdpn.io/79/ios7.controlcenter.jpg">
</div>
  
<div class="box">
  <h2>Web?</h2>
  <p>Is there a way to do it on the web?</p>
  <div class="iphone">
    <div id="homescreen" class="homescreen">
      <div class="animation"></div>
    </div>
    <div class="control-center">
      <div class="control-center-background"></div>
      <div class="control-center-content">
        <h3>Control Center</h3>
      </div>
    </div>
  </div>
  
  <p>It kinda works if the layer underneath would be just a known static background (like in the example above). You could doublicate it and just add a CSS filter. But since it could be anything, you kinda have to take "screenshots" of it. And if there is also animation underneath (like with the Gyro and in the above example the red ball), even more tricky. In Firefox there is the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/element">element property</a> that could work. But that's still experimental.</p>
  
  <p>Any other way to "screen record" other HTML elements and use it as a background?</p>
  
  <p><strong>Update I: </strong><a href="https://twitter.com/SaraSoueidan/status/350479973288648705">Some</a> <a href="https://twitter.com/cgiffard/status/350480271872770048">suggested</a> using CSS shaders.</p>
  
  <p><strong>Update II: </strong>Here a <a href="http://iamvdo.me/conf/2012/kiwiparty/#/33">demo</a> that uses -moz-element to "screen record" the background (Test with Firefox, click anywhere to bring up the popup). It's getting close. It just needs better browser adoption and better performance.. kinda lags behind when dragging around.</p>
    
</div>
            
          
!
            
              
.iphone {
  position: relative;
  width: 244px;
  height: 433px;
  overflow: hidden;
}

.homescreen {
  width: inherit;
  height: inherit;
  background: url(https://s.cdpn.io/79/ios7-homescreen.jpg);
  background-size: 100%;
}

.animation {
  margin: 0 auto;
  width: 50px;
  height: 50px;
  background: red;
  border-radius: 25px;
  animation: animate 1s alternate infinite;
}

@keyframes animate {
  100% { transform: translateY(200px); }
}

.control-center {
  position: absolute;
  background: hsla(0,0%,100%,.8);
  top: 112px;
  left: 0;
  right: 0;
  bottom: 0;
}

.control-center:hover .control-center-background {
  background: transparent;
}

.control-center-background {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url(https://s.cdpn.io/79/ios7-homescreen.jpg);
  background-size: 100%;
  background-position: center bottom;
  -webkit-filter: contrast(30%) brightness(160%) blur(12px);
}

.control-center-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  text-align: center;
}

h3 {
  line-height: 3em;
  font-weight: normal;
  border-bottom: 1px solid black;
}



.box {
  display: inline-block;
  padding: 30px;
  width: 45%;
  min-width: 244px;
  vertical-align: top;
}

* {
  box-sizing: border-box;
}
            
          
!
999px
Loading ..................

Console