SVG Typing Animation Effect with the tspan tag











up vote
0
down vote

favorite












I've an svg on which I want to perform an animated typing effect, exactly like this codepen example.
Here is the original code of that codepen:



<svg width="100%" height="100%" viewBox="30 -50 600 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<path id="path" d="m 0 110 h 342.868">
<animate attributeName="d" from="m0,110 h0" to="m0,110 h1100" dur="6.8s" begin="0s" repeatCount="indefinite"></animate>
</path>
<text font-size="26" font-family="Montserrat" fill="hsla(36, 95%, 85%, 1)">
<textPath xlink:href="#path">I'm An Animated Typing Example &amp;&amp; I'm All SVG.
</textPath>
</text>
</svg>


As you can see, that codepen uses path to animate a text through the textpath tag.



But I've an svg where the text isn't contained in a textpath but in a tspan instead, on which I want to accomplish the same effect.



Here is my SVG code:



   <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="303.29140625" height="139.28875199999993" viewBox="0 0 303.29 139.29" xml:space="preserve">
<desc>Created with Fabric.js 2.4.3</desc>

<defs></defs>
<g transform="matrix(1.55 0 0 1.53 151.65 69.64)" style="" >

<text xml:space="preserve" font-family="Times" font-size="24" font-style="normal" font-weight="bold" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; white-space: pre;" >
<tspan xlink:href="#path" x="-97.34" y="-23.92" style="fill: rgb(25,115,217); white-space: pre; ">I am an Animated</tspan>
<tspan x="-97.34" y="7.54" style="fill: rgb(25,115,217); white-space: pre; ">And I'm all SVG</tspan>
</text>
</g>
</svg>


Please how can I perform such typing animation effect using tspan with pure svg tools ?










share|improve this question






















  • svg-wow.org/text-effects/text-effects.xhtml
    – Robert Longson
    Nov 17 at 11:43










  • The codepen solution is wonderful. What prevents you to edit your code and add the textPath?
    – enxaneta
    Nov 17 at 12:57










  • I can't, the svg is actually used in a big program where tspan are link to many other things
    – kabrice
    Nov 17 at 13:01















up vote
0
down vote

favorite












I've an svg on which I want to perform an animated typing effect, exactly like this codepen example.
Here is the original code of that codepen:



<svg width="100%" height="100%" viewBox="30 -50 600 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<path id="path" d="m 0 110 h 342.868">
<animate attributeName="d" from="m0,110 h0" to="m0,110 h1100" dur="6.8s" begin="0s" repeatCount="indefinite"></animate>
</path>
<text font-size="26" font-family="Montserrat" fill="hsla(36, 95%, 85%, 1)">
<textPath xlink:href="#path">I'm An Animated Typing Example &amp;&amp; I'm All SVG.
</textPath>
</text>
</svg>


As you can see, that codepen uses path to animate a text through the textpath tag.



But I've an svg where the text isn't contained in a textpath but in a tspan instead, on which I want to accomplish the same effect.



Here is my SVG code:



   <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="303.29140625" height="139.28875199999993" viewBox="0 0 303.29 139.29" xml:space="preserve">
<desc>Created with Fabric.js 2.4.3</desc>

<defs></defs>
<g transform="matrix(1.55 0 0 1.53 151.65 69.64)" style="" >

<text xml:space="preserve" font-family="Times" font-size="24" font-style="normal" font-weight="bold" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; white-space: pre;" >
<tspan xlink:href="#path" x="-97.34" y="-23.92" style="fill: rgb(25,115,217); white-space: pre; ">I am an Animated</tspan>
<tspan x="-97.34" y="7.54" style="fill: rgb(25,115,217); white-space: pre; ">And I'm all SVG</tspan>
</text>
</g>
</svg>


Please how can I perform such typing animation effect using tspan with pure svg tools ?










share|improve this question






















  • svg-wow.org/text-effects/text-effects.xhtml
    – Robert Longson
    Nov 17 at 11:43










  • The codepen solution is wonderful. What prevents you to edit your code and add the textPath?
    – enxaneta
    Nov 17 at 12:57










  • I can't, the svg is actually used in a big program where tspan are link to many other things
    – kabrice
    Nov 17 at 13:01













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I've an svg on which I want to perform an animated typing effect, exactly like this codepen example.
Here is the original code of that codepen:



<svg width="100%" height="100%" viewBox="30 -50 600 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<path id="path" d="m 0 110 h 342.868">
<animate attributeName="d" from="m0,110 h0" to="m0,110 h1100" dur="6.8s" begin="0s" repeatCount="indefinite"></animate>
</path>
<text font-size="26" font-family="Montserrat" fill="hsla(36, 95%, 85%, 1)">
<textPath xlink:href="#path">I'm An Animated Typing Example &amp;&amp; I'm All SVG.
</textPath>
</text>
</svg>


As you can see, that codepen uses path to animate a text through the textpath tag.



But I've an svg where the text isn't contained in a textpath but in a tspan instead, on which I want to accomplish the same effect.



Here is my SVG code:



   <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="303.29140625" height="139.28875199999993" viewBox="0 0 303.29 139.29" xml:space="preserve">
<desc>Created with Fabric.js 2.4.3</desc>

<defs></defs>
<g transform="matrix(1.55 0 0 1.53 151.65 69.64)" style="" >

<text xml:space="preserve" font-family="Times" font-size="24" font-style="normal" font-weight="bold" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; white-space: pre;" >
<tspan xlink:href="#path" x="-97.34" y="-23.92" style="fill: rgb(25,115,217); white-space: pre; ">I am an Animated</tspan>
<tspan x="-97.34" y="7.54" style="fill: rgb(25,115,217); white-space: pre; ">And I'm all SVG</tspan>
</text>
</g>
</svg>


Please how can I perform such typing animation effect using tspan with pure svg tools ?










share|improve this question













I've an svg on which I want to perform an animated typing effect, exactly like this codepen example.
Here is the original code of that codepen:



<svg width="100%" height="100%" viewBox="30 -50 600 500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<path id="path" d="m 0 110 h 342.868">
<animate attributeName="d" from="m0,110 h0" to="m0,110 h1100" dur="6.8s" begin="0s" repeatCount="indefinite"></animate>
</path>
<text font-size="26" font-family="Montserrat" fill="hsla(36, 95%, 85%, 1)">
<textPath xlink:href="#path">I'm An Animated Typing Example &amp;&amp; I'm All SVG.
</textPath>
</text>
</svg>


As you can see, that codepen uses path to animate a text through the textpath tag.



But I've an svg where the text isn't contained in a textpath but in a tspan instead, on which I want to accomplish the same effect.



Here is my SVG code:



   <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="303.29140625" height="139.28875199999993" viewBox="0 0 303.29 139.29" xml:space="preserve">
<desc>Created with Fabric.js 2.4.3</desc>

<defs></defs>
<g transform="matrix(1.55 0 0 1.53 151.65 69.64)" style="" >

<text xml:space="preserve" font-family="Times" font-size="24" font-style="normal" font-weight="bold" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; white-space: pre;" >
<tspan xlink:href="#path" x="-97.34" y="-23.92" style="fill: rgb(25,115,217); white-space: pre; ">I am an Animated</tspan>
<tspan x="-97.34" y="7.54" style="fill: rgb(25,115,217); white-space: pre; ">And I'm all SVG</tspan>
</text>
</g>
</svg>


Please how can I perform such typing animation effect using tspan with pure svg tools ?







svg






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 17 at 10:28









kabrice

3621822




3621822












  • svg-wow.org/text-effects/text-effects.xhtml
    – Robert Longson
    Nov 17 at 11:43










  • The codepen solution is wonderful. What prevents you to edit your code and add the textPath?
    – enxaneta
    Nov 17 at 12:57










  • I can't, the svg is actually used in a big program where tspan are link to many other things
    – kabrice
    Nov 17 at 13:01


















  • svg-wow.org/text-effects/text-effects.xhtml
    – Robert Longson
    Nov 17 at 11:43










  • The codepen solution is wonderful. What prevents you to edit your code and add the textPath?
    – enxaneta
    Nov 17 at 12:57










  • I can't, the svg is actually used in a big program where tspan are link to many other things
    – kabrice
    Nov 17 at 13:01
















svg-wow.org/text-effects/text-effects.xhtml
– Robert Longson
Nov 17 at 11:43




svg-wow.org/text-effects/text-effects.xhtml
– Robert Longson
Nov 17 at 11:43












The codepen solution is wonderful. What prevents you to edit your code and add the textPath?
– enxaneta
Nov 17 at 12:57




The codepen solution is wonderful. What prevents you to edit your code and add the textPath?
– enxaneta
Nov 17 at 12:57












I can't, the svg is actually used in a big program where tspan are link to many other things
– kabrice
Nov 17 at 13:01




I can't, the svg is actually used in a big program where tspan are link to many other things
– kabrice
Nov 17 at 13:01

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53350330%2fsvg-typing-animation-effect-with-the-tspan-tag%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53350330%2fsvg-typing-animation-effect-with-the-tspan-tag%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?