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.

            
              <h1>Infrared CSS Filters</h1>
<h2>Just a little experiment by <a href="http://una.im">@una</a></h2>

<div class="infra-1"></div>
<div class="infra-2"></div>
<div class="infra-3"></div>

<h2>(P.S. This might not work that well on your mobile device. Recommend Chrome 44+)</h2>
            
          
!
            
              h1, h2 {
  text-align: center;
  font-family: Open Sans, Helvetica, Arial, sans-serif;
  color: dimgrey;
  font-weight: 200;
}

h2 {
  font-size: 1em;
  line-height: 0;
  font-style: italic;
  margin-bottom: 2em;
}

div {
  margin: 2em auto;
  display: block;
  width: 80%;
  max-width: 600px;
  height: 400px;
  cursor: pointer;
  
  &:after {
    content: '';
    display: block;
    height: 400px;
  }
  
  &:hover {
    filter: none;
    
    &:after {
      background: none;
      filter: none;
    }
  }
}

@mixin infrared($img, $deg: -60) {
  position: relative;
  background: url('#{$img}');
  background-size: cover;

  &:after {
    background:  url('#{$img}');
    filter: invert(1) saturate(.75) hue-rotate(#{$deg}deg);
    mix-blend-mode: color;
    background-size: cover;
  }
}

.infra-1 {
  @include infrared('https://upload.wikimedia.org/wikipedia/commons/0/06/Cayoosh-creek.jpg');
}


.infra-2 {
  @include infrared('https://guidetoiceland.is/image/4830/x/0/mountains-in-iceland-2.jpg', 80);
}


.infra-3 {
  @include infrared('https://trafalgarblog.files.wordpress.com/2014/09/new-hampshire-lake.jpg', 40);
}
            
          
!
999px
Loading ..................

Console