0

The below code display animated text in most browsers, except IE where It runs but you don't see it. Could I have some guidance on how to solve this?

Please refer to this link to see the example > http://jsfiddle.net/pherrera/posvken7/

and here is the code:

<div class="container">
    <div id="background" class="card">
        <div class="sp-container">
            <div class="sp-content">
                <div class="sp-globe"></div>
                <h3 class="frame-1">message 1</h3>
                <h3 class="frame-2">message 2</h3>
                <h3 class="frame-3">message 3</h3>
                <h3 class="frame-4">Now!</h2>
                <h3 class="frame-5">
                    <span>this</span> <span>is</span> <span>a message</span>
                </h3>
                <a class="sp-circle-link" href="#">again!</a>
            </div>
        </div>
    </div>
</div>
body, html {
    background-color: #282828;
    display: table;
    height: 100%;
    width: 100%;
}

.container {
    display: table-cell;
    vertical-align: middle;
}

.card {
    border-radius: 2px 2px 2px 2px;
    -moz-border-radius: 2px 2px 2px 2px;
    -webkit-border-radius: 2px 2px 2px 2px;
    border: 0px none;
    -webkit-box-shadow: 0px 0px 75px 0px rgba(255, 255, 255, 0.1);
    -moz-box-shadow: 0px 0px 75px 0px rgba(255, 255, 255, 0.1);
    box-shadow: 0px 0px 75px 0px rgba(255, 255, 255, 0.1);
}

#background {
    width: 600px;
    height: 500px;
    margin: 0 auto;
    background: rgba(92, 92, 92, 1);
    background: -moz-radial-gradient(center, ellipse cover, rgba(92, 92, 92, 1) 0%, rgba(59, 59, 59, 1) 100%);
    background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(92, 92, 92, 1)), color-stop(100%, rgba(59, 59, 59, 1)));
    background: -webkit-radial-gradient(center, ellipse cover, rgba(92, 92, 92, 1) 0%, rgba(59, 59, 59, 1) 100%);
    background: -o-radial-gradient(center, ellipse cover, rgba(92, 92, 92, 1) 0%, rgba(59, 59, 59, 1) 100%);
    background: -ms-radial-gradient(center, ellipse cover, rgba(92, 92, 92, 1) 0%, rgba(59, 59, 59, 1) 100%);
    background: radial-gradient(ellipse at center, rgba(92, 92, 92, 1) 0%, rgba(59, 59, 59, 1) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5c5c5c', endColorstr='#3b3b3b', GradientType=1);
}

a {
    text-decoration: none;
}

h1.main, p.demos {
    -webkit-animation-delay: 18s;
    -moz-animation-delay: 18s;
    -ms-animation-delay: 18s;
    animation-delay: 18s;
}

.sp-container {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: -webkit-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
    background: -moz-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
    background: -ms-radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
    background: radial-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3) 35%, rgba(0, 0, 0, 0.7));
}

.sp-content {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0px;
    top: 0px;
    z-index: 1000;
}

.sp-container h3 {
    position: absolute;
    top: 50%;
    line-height: 100px;
    height: 90px;
    margin-top: -50px;
    font-size: 60px;
    width: 100%;
    text-align: center;
    color: transparent;
    -webkit-animation: blurFadeInOut 3s ease-in backwards;
    -moz-animation: blurFadeInOut 3s ease-in backwards;
    -ms-animation: blurFadeInOut 3s ease-in backwards;
    animation: blurFadeInOut 3s ease-in backwards;
}

.sp-container h3.frame-1 {
    -webkit-animation-delay: 0s;
    -moz-animation-delay: 0s;
    -ms-animation-delay: 0s;
    animation-delay: 0s;
}

.sp-container h3.frame-2 {
    -webkit-animation-delay: 3s;
    -moz-animation-delay: 3s;
    -ms-animation-delay: 3s;
    animation-delay: 3s;
}

.sp-container h3.frame-3 {
    -webkit-animation-delay: 6s;
    -moz-animation-delay: 6s;
    -ms-animation-delay: 6s;
    animation-delay: 6s;
}

.sp-container h3.frame-4 {
    font-size: 200px;
    -webkit-animation-delay: 9s;
    -moz-animation-delay: 9s;
    -ms-animation-delay: 9s;
    animation-delay: 9s;
}

.sp-container h3.frame-5 {
    -webkit-animation: none;
    -moz-animation: none;
    -ms-animation: none;
    animation: none;
    color: transparent;
    text-shadow: 0px 0px 1px #fff;
}

.sp-container h3.frame-5 span {
    -webkit-animation: blurFadeIn 3s ease-in 12s backwards;
    -moz-animation: blurFadeIn 1s ease-in 12s backwards;
    -ms-animation: blurFadeIn 3s ease-in 12s backwards;
    animation: blurFadeIn 3s ease-in 12s backwards;
    color: transparent;
    text-shadow: 0px 0px 1px #fff;
}

.sp-container h3.frame-5 span:nth-child(2) {
    -webkit-animation-delay: 13s;
    -moz-animation-delay: 13s;
    -ms-animation-delay: 13s;
    animation-delay: 13s;
}

.sp-container h3.frame-5 span:nth-child(3) {
    -webkit-animation-delay: 14s;
    -moz-animation-delay: 14s;
    -ms-animation-delay: 14s;
    animation-delay: 14s;
}

.sp-globe {
    position: absolute;
    width: 282px;
    height: 273px;
    left: 50%;
    top: 50%;
    margin: -137px 0 0 -141px;
    -webkit-animation: fadeInBack 3.6s linear 14s backwards;
    -moz-animation: fadeInBack 3.6s linear 14s backwards;
    -ms-animation: fadeInBack 3.6s linear 14s backwards;
    animation: fadeInBack 3.6s linear 14s backwards;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
    filter: alpha(opacity=30);
    opacity: 0.3;
    -webkit-transform: scale(5);
    -moz-transform: scale(5);
    -o-transform: scale(5);
    -ms-transform: scale(5);
    transform: scale(5);
}

.sp-circle-link {
    position: absolute;
    left: 50%;
    bottom: 100px;
    margin-left: -50px;
    text-align: center;
    line-height: 100px;
    width: 100px;
    height: 100px;
    background: #fff;
    color: #3f1616;
    font-size: 25px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    -webkit-animation: fadeInRotate 1s linear 16s backwards;
    -moz-animation: fadeInRotate 1s linear 16s backwards;
    -ms-animation: fadeInRotate 1s linear 16s backwards;
    animation: fadeInRotate 1s linear 16s backwards;
    -webkit-transform: scale(1) rotate(0deg);
    -moz-transform: scale(1) rotate(0deg);
    -o-transform: scale(1) rotate(0deg);
    -ms-transform: scale(1) rotate(0deg);
    transform: scale(1) rotate(0deg);
}

.sp-circle-link:hover {
    background: #85373b;
    color: #fff;
}
/**/
@-webkit-keyframes blurFadeInOut {
    0% {
        opacity: 0;
        text-shadow: 0px 0px 40px #fff;
        -webkit-transform: scale(1.3);
    }

    20%, 75% {
        opacity: 1;
        text-shadow: 0px 0px 1px #fff;
        -webkit-transform: scale(1);
    }

    100% {
        opacity: 0;
        text-shadow: 0px 0px 50px #fff;
        -webkit-transform: scale(0);
    }
}

@-webkit-keyframes blurFadeIn {
    0% {
        opacity: 0;
        text-shadow: 0px 0px 40px #fff;
        -webkit-transform: scale(1.3);
    }

    50% {
        opacity: 0.5;
        text-shadow: 0px 0px 10px #fff;
        -webkit-transform: scale(1.1);
    }

    100% {
        opacity: 1;
        text-shadow: 0px 0px 1px #fff;
        -webkit-transform: scale(1);
    }
}

@-webkit-keyframes fadeInBack {
    0% {
        opacity: 0;
        -webkit-transform: scale(0);
    }

    50% {
        opacity: 0.4;
        -webkit-transform: scale(2);
    }

    100% {
        opacity: 0.2;
        -webkit-transform: scale(5);
    }
}

@-webkit-keyframes fadeInRotate {
    0% {
        opacity: 0;
        -webkit-transform: scale(0) rotate(360deg);
    }

    100% {
        opacity: 1;
        -webkit-transform: scale(1) rotate(0deg);
    }
}
/**/
@-moz-keyframes blurFadeInOut {
    0% {
        opacity: 0;
        text-shadow: 0px 0px 40px #fff;
        -moz-transform: scale(1.3);
    }

    20%, 75% {
        opacity: 1;
        text-shadow: 0px 0px 1px #fff;
        -moz-transform: scale(1);
    }

    100% {
        opacity: 0;
        text-shadow: 0px 0px 50px #fff;
        -moz-transform: scale(0);
    }
}

@-moz-keyframes blurFadeIn {
    0% {
        opacity: 0;
        text-shadow: 0px 0px 40px #fff;
        -moz-transform: scale(1.3);
    }

    100% {
        opacity: 1;
        text-shadow: 0px 0px 1px #fff;
        -moz-transform: scale(1);
    }
}

@-moz-keyframes fadeInBack {
    0% {
        opacity: 0;
        -moz-transform: scale(0);
    }

    50% {
        opacity: 0.4;
        -moz-transform: scale(2);
    }

    100% {
        opacity: 0.2;
        -moz-transform: scale(5);
    }
}

@-moz-keyframes fadeInRotate {
    0% {
        opacity: 0;
        -moz-transform: scale(0) rotate(360deg);
    }

    100% {
        opacity: 1;
        -moz-transform: scale(1) rotate(0deg);
    }
}
/**/
@keyframes blurFadeInOut {
    0% {
        opacity: 0;
        text-shadow: 0px 0px 40px #fff;
        transform: scale(1.3);
    }

    20%, 75% {
        opacity: 1;
        text-shadow: 0px 0px 1px #fff;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        text-shadow: 0px 0px 50px #fff;
        transform: scale(0);
    }
}

@keyframes blurFadeIn {
    0% {
        opacity: 0;
        text-shadow: 0px 0px 40px #fff;
        transform: scale(1.3);
    }

    50% {
        opacity: 0.5;
        text-shadow: 0px 0px 10px #fff;
        transform: scale(1.1);
    }

    100% {
        opacity: 1;
        text-shadow: 0px 0px 1px #fff;
        transform: scale(1);
    }
}

@keyframes fadeInBack {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    50% {
        opacity: 0.4;
        transform: scale(2);
    }

    100% {
        opacity: 0.2;
        transform: scale(5);
    }
}

@keyframes fadeInRotate {
    0% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}
Sampson
  • 265,109
  • 74
  • 539
  • 565
phg
  • 15
  • 2
  • Seems to be a duplicate of this answer: http://stackoverflow.com/questions/25850100/css-blur-in-ie-11 – Giacomo Paita Dec 08 '14 at 17:29
  • Well IE 8/9 doesn't support keyframes so you can forget them! IE 8 doesn't support transform but IE 9+ does. IE 8/9 do not support text-shadows either. Sad times for IE (like there has ever been a happy one...) – Joe Corby Dec 08 '14 at 17:30
  • Definitely not a duplicate of that question, because this is not using a blur filter. – Josiah Keller Dec 08 '14 at 18:00
  • I'm testing in IE-11. I would like to know if there is a work around to show something on IE. Even if there is no animation, I'd like to show something on IE. Many Thanks – phg Dec 08 '14 at 18:45

3 Answers3

2

Basically the only issue here that modern versions of IE will have a problem with is rendering a shadow on an transparent element. This is a known limitation with a couple of quirks; if the blur radius is 0 then text will be visible. Otherwise, for a shadow to be cast, the color of the text needs to be somewhat opaque.

After playing with this for a brief time I came up with a potential work-around that should suffice in your demo. Since text-shadows already work, and are able to be positioned from an offset, you can position the element itself in the opposite direction:

.blur {
    top: -100vh;
    position: relative;
    text-shadow: 0 100vh 1em #000;
}

In order to show only a blurred text, we push the shadow down 100vh. This will set it off-screen, so we also push the element casting the shadow up 100vh, which restores the blurred text to the original position of its host element.

In this case I'm usin ga veritcal offset, but you may find that this is not ideal for some scenarios. For instance, your document is taller, and your blurred regions are further down, you may find that a lateral offset is better. In that case, you can avoid unnecessary scrollbars by hiding lateral overflow:

body {
    overflow-x: hidden;
}

I've composed a demo fiddle that shows the results online here. Upon constructing this, I did notice that Chrome presently has a layout issue which is evident during resizing — it appears the vm (and presumably vh) are not kept in sync with the current viewport dimensions. You may need to use another unit if this presents an issue with your project.

Applying this effect to works that appear with a delay is also possible. I've taken the liberty to create a second fiddle that demonstrates this effect. The markup for which is very straight-forward, resembling what you already have:

<h1>
    <span>Hello</span> 
    <span>World</span>
</h1>
<h2>
    <span>Additional</span>
    <span>Information</span>
    <span>Provided</span>
    <span>Eventually</span>
</h2>

The CSS accomplishes a few things:

  1. Center the text in the <body> (could be limited to the headers)
  2. Position elements off-screen, and text-shadows on-screen
  3. Animate text-shadow property at various delays to reveal nested <span> elements
body {
    text-align: center;
    font-family: "Segoe UI";
}

span {
    opacity: 0;
    vertical-align: middle;
    text-shadow: 100vw 0 3em #000;
    position: relative; left: -100vw;
    animation: fadein 2s ease-in-out forwards;
}

/* Controls 'Hello' and 'World' */
h1 span:nth-child(1) { animation-delay: 1s; }
h1 span:nth-child(2) { animation-delay: 2s; }

/* Controls 'Stack Overflow is Awesome */
h2 span { animation-delay: 3s; }

@keyframes fadein {
    to { 
        opacity: 1;
        text-shadow: 100vw 0 0 #000;
    }
}

The end-result is a smooth, cross-browser, blurring effect:

enter image description here

Sampson
  • 265,109
  • 74
  • 539
  • 565
  • Thank for this, seems to be a good approach. However, I don't know what to do with it or where to put it, this is due to my lack of CSS knowledge. What I'm trying to achieve is the following in all browsers: Some text A here --> Transition(if possible) --> Some text B here (replacing text A) --> Stop. – phg Dec 08 '14 at 23:00
  • @phg You could use your `animation-delay` approach in your original answer. Did the write the original CSS? – Sampson Dec 09 '14 at 00:08
  • Many thanks for your input Jonathan, very much appreciated. Unfortunately I have no idea how to integrate this in to what I already have. I don't seem to find anywhere what I need, I believe that this is relatively easy for someone that knows CSS or even JS. **I want to show some text for a few seconds, then fade it out or any other effect if any, then show another text replacing previous text and stop it there.** Is this that hard to achieve for all browsers? – phg Dec 10 '14 at 18:40
0

DONE:

After some digging around the net, I managed to add some bits of code that made it work on IE (IE 11 at least).

I pretty much had to add and fiddle with these lines:

-ms-filter:”progid:DXImageTransform.Microsoft.Alpha(Opacity=0)”;
filter: alpha(opacity=0);
zoom: 1; filter: alpha(opacity=0);

See here: http://jsfiddle.net/posvken7/8/

phg
  • 15
  • 2
-1

Css animations, child selectors, and gradients are supported in IE7, check out caniuse.com to see what css is supported in each browser/version.

Also, filter and animation are not supported in IE at all.

Oh, and it breaks in IE 9, it that helps anyone.

Justin Breiland
  • 450
  • 2
  • 5
  • 1
    Internet Explorer has supported animations for years. In fact, it supported them unprefixed, and for pseudo-elements long before Chrome. You might be confusing modern versions of IE with old versions of IE ;) – Sampson Dec 08 '14 at 20:31