2016-04-28 13 views
0

私は言葉が「太字」フォントで表示されたテキストパスを持っているGoogle検索ボックスSVGテキストアニメーションのフォントスタイル

のように見えるアニメーションを作りたいです。

私は、最初の文字は「通常の」表示され、その後、第一および第二など、その後、第一、第二および第三

は、SVGアニメーションを行うことが可能であるように、このアニメーション化する単語をご希望ですか?

<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="path1"> 
    <animate attributeName="d" from="m100,50 h0" to="m100,50 h1100" dur="5s" begin="0s" repeatCount="indefinite" /> 
    </path> 

// this text "types" 

    <text font-size="90" font-family="Montserrat" fill='black'> 
    <textPath xlink:href="#path1">Google is</textPath> 
    </text> 

// I want this text to animate the "font-style" 

    <text font-size="90" font-family="Montserrat" fill='black' x="100" y="200"> 
    Google is gold 
    <animate attributeType="CSS" .... /> 
    </text> 

+0

感謝。これを行うにはそれぞれにIDを与える必要がありますか?また、animateタグ内にfont-style = 'regular'を書いて、それぞれに異なるbegin = "?s"を与えることでこれをアニメーション化しますか? – user3821345

+0

連鎖したい場合は、前の –

答えて

1

あなたがアニメーションで個別にそれらを標的にすることができるようtextPath内の別々のタグに文字を配置する必要があると思います。

私はちょうど最初の手紙を済ませましたが、望むならこれをすべての手紙に広げることができます。

<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="path1"> 
 
    <animate attributeName="d" from="m100,50 h0" to="m100,50 h1100" dur="5s" begin="0s" repeatCount="indefinite" /> 
 
    </path> 
 

 
// this text "types" 
 

 
    <text font-size="90" font-family="Montserrat" fill='black'> 
 
    <textPath xlink:href="#path1">Google is</textPath> 
 
    </text> 
 

 
// I want this text to animate the "font-style" 
 

 
    <text font-size="90" font-family="Montserrat" fill='black' x="100" y="200"> 
 
    <tspan>G<animate attributeType="CSS" attributeName="font-weight" from="700" to="100" dur="1s" begin="0s" repeatCount="indefinite"/></tspan>oogle is gold 
 
    
 
    </text>

+0

の '' .endイベントでそれぞれをアニメーション化することが非常に役に立ちました。私はアニメーションを連鎖させている。これは私の最高の試みです、あなたは見てみることができますか? https://plnkr.co/edit/Yg3F37QtUUcdkoHlOIeN?p=infoこれは次のように動作するはずです。上の行 - 0から各文字が順番に表示されます(表示が隠されて表示され、次に保持されます)。下の行 - 0の全文太字で表示され、各文字が変更されます(font-weight:700から100まで順に1つずつ保持してください)。次に、シーケンス全体をもう一度開始します。 – user3821345

+0

別の質問をしてその中にあなたのコードを入れることができますか? –

+0

ありがとう! http://stackoverflow.com/questions/36933509/svg-animating-visibility-and-chaining – user3821345

関連する問題