Skip to content

Instantly share code, notes, and snippets.

@DrOctogon
Created December 13, 2019 06:48
Show Gist options
  • Save DrOctogon/29aa0674a96108f1e9b6cfc8f60ba484 to your computer and use it in GitHub Desktop.
Save DrOctogon/29aa0674a96108f1e9b6cfc8f60ba484 to your computer and use it in GitHub Desktop.

Revisions

  1. DrOctogon created this gist Dec 13, 2019.
    13 changes: 13 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    <svg viewBox="0 0 960 300">
    <symbol id="s-text">
    <text text-anchor="middle" x="50%" y="80%">Montserrat</text>
    </symbol>

    <g class = "g-ants">
    <use xlink:href="#s-text" class="text-copy"></use>
    <use xlink:href="#s-text" class="text-copy"></use>
    <use xlink:href="#s-text" class="text-copy"></use>
    <use xlink:href="#s-text" class="text-copy"></use>
    <use xlink:href="#s-text" class="text-copy"></use>
    </g>
    </svg>
    2 changes: 2 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    /* This Pen is best viewable in Google Chrome.
    */
    57 changes: 57 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    @import url(https://fonts.googleapis.com/css?family=Montserrat);

    html, body{
    height: 100%;
    font-weight: 800;
    }

    body{
    background: #030321;
    font-family: Arial;
    }

    svg {
    display: block;
    font: 10.5em 'Montserrat';
    width: 960px;
    height: 300px;
    margin: 0 auto;
    }

    .text-copy {
    fill: none;
    stroke: white;
    stroke-dasharray: 6% 29%;
    stroke-width: 5px;
    stroke-dashoffset: 0%;
    animation: stroke-offset 5.5s infinite linear;
    }

    .text-copy:nth-child(1){
    stroke: #4D163D;
    animation-delay: -1;
    }

    .text-copy:nth-child(2){
    stroke: #840037;
    animation-delay: -2s;
    }

    .text-copy:nth-child(3){
    stroke: #BD0034;
    animation-delay: -3s;
    }

    .text-copy:nth-child(4){
    stroke: #BD0034;
    animation-delay: -4s;
    }

    .text-copy:nth-child(5){
    stroke: #FDB731;
    animation-delay: -5s;
    }

    @keyframes stroke-offset{
    100% {stroke-dashoffset: -35%;}
    }
    7 changes: 7 additions & 0 deletions text-animation-montserrat.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Text Animation: Montserrat
    --------------------------
    Text animation inspired by Web Designer issue 241

    A [Pen](https://codepen.io/ClaireLarsen/pen/XmVyVX) by [Claire Larsen](https://codepen.io/ClaireLarsen) on [CodePen](https://codepen.io).

    [License](https://codepen.io/ClaireLarsen/pen/XmVyVX/license).