Skip to content

Instantly share code, notes, and snippets.

@codingdudecom
Created May 10, 2020 17:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingdudecom/28f0578e82b0bb679cf2a614695c62d8 to your computer and use it in GitHub Desktop.
Save codingdudecom/28f0578e82b0bb679cf2a614695c62d8 to your computer and use it in GitHub Desktop.
Anaglyph 3D CSS Effect
<center>
<h2>Anaglyph 3D CSS Effect</h2>
<p>Try the <a href="https://www.mockofun.com/tutorials/anaglyph-3d/">Anaglyph 3D</a> online photo filter in <a href="https://www.mockofun.com/">MockoFun</a></p>
</center>
<img src="https://cdn.pixabay.com/photo/2014/08/01/15/51/manhattan-407703_1280.jpg" class="image anaglyph3d">
<svg>
<defs>
<filter id="anaglyph3d">
<feOffset in="SourceGraphic" dx="-4" dy="0" result="left"/>
<feOffset in="SourceGraphic" dx="4" dy="0" result="right"/>
<feComponentTransfer in="left" result="leftRed">
<feFuncR type="identity"></feFuncR>
<feFuncG type="discrete" tableValues="0"></feFuncG>
<feFuncB type="discrete" tableValues="0"></feFuncB>
</feComponentTransfer>
<feComponentTransfer in="right" result="rightCyan">
<feFuncR type="discrete" tableValues="0"></feFuncR>
<feFuncG type="identity"></feFuncG>
<feFuncB type="identity"></feFuncB>
</feComponentTransfer>
<feBlend in="leftRed" in2="rightCyan" mode="screen"/>
</filter>
</defs>
</svg>
.image{
max-height:100vh;
margin:0 auto;
display:block;
}
.anaglyph3d{
filter:saturate(50%) url(#anaglyph3d);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment