Skip to content

Instantly share code, notes, and snippets.

@bsakhanov
Created January 24, 2019 10:28
Show Gist options
  • Save bsakhanov/2eb9ffa62b0f5283f9ba45b145d708a6 to your computer and use it in GitHub Desktop.
Save bsakhanov/2eb9ffa62b0f5283f9ba45b145d708a6 to your computer and use it in GitHub Desktop.
Cloudy SVG-filter
<svg>
<filter id="filter">
<feTurbulence id="feTurbulence"
type="turbulence"
baseFrequency="0.005"
numOctaves="2"
result="turbulence"/>
<feFlood
flood-color="white"
result="flood"
/>
<feComposite
in="flood"
in2="turbulence"
operator="in"
result="composite2"/>
<feComposite
in="composite2"
in2="SourceAlpha"
operator="in"
result="composite3"/>
</filter>
</svg>
<div class="text" contenteditable>Cloud</div>
HTML, BODY {
height: 100%;
}
BODY {
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
background: steelblue linear-gradient(
to right bottom,
skyblue, steelblue,
teal, lightseagreen);
font: 20vw/1 Arial Black, sans-serif;
text-align: center;
}
.text {
white-space: nowrap;
filter: url(#filter);
outline: none;
&::selection {
background: rgba(0,0,0,.15);
}
}
svg {
position: absolute;
width: 0;
height: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment