Skip to content

Instantly share code, notes, and snippets.

@opqdonut
Last active September 12, 2024 12:07
Show Gist options
  • Save opqdonut/4a00295c927fa677b1398b2390e84224 to your computer and use it in GitHub Desktop.
Save opqdonut/4a00295c927fa677b1398b2390e84224 to your computer and use it in GitHub Desktop.
Pineapple mirage svg animation
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<filter id="h" x="-100%" y="-100%" width="300%" height="1000%" filterUnits="objectBoundingBox">
<feTurbulence
type="turbulence"
baseFrequency="0.00 0.04"
height="80%"
numOctaves="1"
stichTiles="stitch"
result="turbulence" />
<feComponentTransfer
in="turbulence"
result="rturbulence">
<feFuncR type="linear" slope="0.5" intercept="0.5">
<animate attributeName="slope" values="0;0.5;0" dur="10s" repeatCount="indefinite" />
</feFuncR>
<feFuncG type="linear" slope="0" intercept="0" />
<feFuncB type="linear" slope="0" intercept="0" />
<feFuncA type="linear" slope="0" intercept="0.5" />
</feComponentTransfer>
<feOffset
in="rturbulence"
result="shifted"
dy="200%">
<animate attributeName="dy" values="0;-400" dur="10s" repeatCount="indefinite" />
</feOffset>
<feDisplacementMap
in2="shifted"
in="SourceGraphic"
scale="30"
xChannelSelector="R"
yChannelSelector="G" />
</filter>
<text x="160" y="160" style="font-size: 80px" filter="url(#h)">🍍</text>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment