Fast blur
Words sweep into focus and smear away using an animated horizontal Gaussian blur.
What you are seeing
White condensed text on black with a dim mirrored reflection beneath it. Each short phrase streaks in from a wide horizontal blur, sharpens, holds for about two seconds, then smears away as the next phrase arrives.
How it works
A single feGaussianBlur has separate X and Y deviations. SMIL animates X between 200 and 0.1 while Y stays tiny, so the text streaks sideways without going soft vertically.
When the blur-out animation begins, a small script swaps in the next word and restarts the blur-in animation.
The reflection is a flipped use of the same text element, so it blurs with it, and a gradient rectangle fades it out.
History
Published on October 4, 2009 as a study in smooth text transitions using filters and declarative animation.
Source
/filterEffects/blur.svg
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1000 250" onclick="run()">
<title>Fast blur</title>
<desc>White words on black with a mirrored reflection. Each word slides into focus from a wide horizontal blur, holds, then smears away as the next one arrives. Click, or press Enter or Space, to start.</desc>
<defs>
<desc>
/* ============================================================================
* Author: Erik Dahlström
* License terms: see svg-wow.org
* CC0 http://creativecommons.org/publicdomain/zero/1.0/
* Restoration: webfont replaced by a system stack, filter height given in
* user units, dead links removed, keyboard start added.
* =========================================================================== */
</desc>
<style>
#text { text-anchor: middle; font: 100px Impact, Haettenschweiler, "Arial Narrow Bold", "Liberation Sans Narrow", sans-serif; filter: url(#blurX) }
#unsupported { text-anchor: middle; font: 32px Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; }
:root { background: black; fill: white; cursor: pointer }
</style>
<filter id="blurX" x="0" y="0" width="100%" height="150" filterUnits="userSpaceOnUse">
<feGaussianBlur id="blur" stdDeviation="0.1 0.1">
<animate id="blurout" attributeName="stdDeviation" to="200 0.1" dur="1s" keySplines="0.25 0.1 0.25 1" begin="blurin.begin+2s" calcMode="spline" fill="freeze" onbegin="scheduleNext()"/>
<animate id="blurin" attributeName="stdDeviation" from="200 0.1" to="0.1 0.1" dur="1s" keySplines="0.25 0.1 0.25 1" begin="indefinite" calcMode="spline" fill="freeze"/>
</feGaussianBlur>
</filter>
<linearGradient id="fadegrad" x2="0" y2="1">
<stop stop-color="black" stop-opacity="0.6" offset="0"/>
<stop stop-color="black" stop-opacity="1" offset="1"/>
</linearGradient>
</defs>
<text id="text" x="50%" y="1em">Click here to start</text>
<use xlink:href="#text" transform="scale(1,-1) translate(0 -240)"/>
<rect fill="url(#fadegrad)" width="100%" height="100" y="120"/>
<rect fill="black" width="100%" height="60" y="219"/>
<animate id="fadeout" attributeName="fill-opacity" xlink:href="#text" to="0" dur="1s" begin="indefinite" fill="freeze"/>
<animate id="fadein" attributeName="fill-opacity" xlink:href="#text" to="1" dur="1s" begin="indefinite" fill="freeze"/>
<g id="unsupported" display="none">
<text x="50%" y="1em">
Your browser doesn't seem to support
</text>
<text x="50%" y="2.5em">
SMIL and SVG filters.
</text>
<text x="50%" y="130" font-size="12" onclick="overrideCapabilityCheck()">
Click this line to run the demo anyway.
</text>
</g>
<script><![CDATA[
var i = 0;
var str = "For the SVG Open;conference;this is;SVG Wow 2009;This demo uses;feGaussianBlur;SMIL;and javascript;Optimized;blur effects;made this;possible;Thanks to:;W3C;Core Team @opera;SVG Open organizers".split(";");
var master = document.getElementById("blurin");
var text = document.getElementById("text");
var fadeout = document.getElementById("fadeout");
var fadein = document.getElementById("fadein");
var runDemo = checkFilterAndSMILSupport();
var timerid = null;
var nextTimer = null;
var lastBegin = 0;
function overrideCapabilityCheck()
{
runDemo=true;
document.getElementById("unsupported").setAttribute("display", "none");
i = 0;
next();
}
function checkFilterAndSMILSupport()
{
function classOf(o) {
if (undefined === o)
return "Undefined";
if (null === o)
return "Null";
return {}.toString.call(o).slice(8, -1);
}
var f = document.getElementById("blurX");
var f2 = document.getElementById("blur")
return ( classOf(f) == "SVGFilterElement" && classOf(f2) == "SVGFEGaussianBlurElement" &&
master && master.beginElement );
}
// Restoration fix: a blur-out left over from the previous run must not skip a phrase.
function scheduleNext()
{
if(i >= str.length || performance.now() - lastBegin < 1500)
return;
clearTimeout(nextTimer);
nextTimer = setTimeout(next, 500);
}
function next()
{
if(runDemo)
{
try {
text.textContent = str[i];
if(str.length >= i)
{
lastBegin = performance.now();
master.beginElement();
i++;
}
if(str.length == i)
{
timerid = setTimeout(function() {fadeout.beginElement(); timerid=null;}, 1500);
}
}
catch(e)
{
// if master.beginElement failed for example...
}
}
else
{
text.textContent = "";
document.getElementById("unsupported").setAttribute("display", "inline");
}
}
function run()
{
if(runDemo && i >= str.length)
{
i = 0;
if(timerid)
clearTimeout(timerid);
clearTimeout(nextTimer);
fadeout.endElement();
fadein.beginElement();
}
if(i == 0)
next();
}
document.addEventListener("keydown", function(evt) {
if(evt.key === "Enter" || evt.key === " ")
{
evt.preventDefault();
run();
}
});
]]></script>
</svg>
/filterEffects/blur.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Fast blur | SVG Wow!</title>
<meta name="description" content="Words slide into focus using an animated feGaussianBlur with a horizontal standard deviation, driven by SMIL.">
<style>html,body{margin:0;height:100%;background:#111;color:#ddd;font:15px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif}body{display:flex;flex-direction:column;min-height:100%}header{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:baseline;padding:10px 16px}h1{font-size:18px;margin:0;color:#fff}p{margin:0;color:#aaa}a{color:#ffc14d}iframe{flex:1;width:100%;min-height:320px;border:0;background:#000;display:block}</style>
</head>
<body>
<header>
<h1>Fast blur</h1>
<p>Erik Dahlström, 2009. Click the demo, or press Enter, to start.</p>
<p><a href="/gallery/fast-blur/">Gallery page</a> · <a href="blur.svg">Open the SVG</a></p>
</header>
<iframe src="blur.svg" title="Fast blur demo"></iframe>
</body>
</html>