title: Injecting a CSS/HTML loader into multiple parts of my site (html, js, vuejs)
body: <p>I have an animated loader made up of some html:</p>
  
  <pre><code>&lt;!-- full page loading screen --&gt;
  &lt;div id="fs-spinner-wrapper"&gt;
      &lt;div class="spinner fs-spinner"&gt;
          &lt;div class="rect1"&gt;&lt;/div&gt;
          &lt;div class="rect2"&gt;&lt;/div&gt;
          &lt;div class="rect3"&gt;&lt;/div&gt;
          &lt;div class="rect4"&gt;&lt;/div&gt;
          &lt;div class="rect5"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Which has associated CSS to get it animated. Currently I am including this HTML code at every point where I need the loader to appear... which is quite messy, especially when using it within vueJS components and other javascript functions.</p>
  
  <p>Can anyone suggest the best way to be able to inject this HTML into each part of my site that needs it. In an ideal world I would love to use a standard icon approach, but am not sure if this is possible?</p>
  
  <pre><code>&lt;i class="myicon"&gt;&lt;/i&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>/* loading animation */
  .spinner {
      /*width: 50px;*/
      height: 40px;
      text-align: center;
      font-size: 10px;
  }
  
  .spinner &gt; div {
      background-color: #ececec;
      height: 100%;
      width: 6px;
      display: inline-block;
  
      -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
      animation: sk-stretchdelay 1.2s infinite ease-in-out;
  }
  
  .spinner .rect2 {
      -webkit-animation-delay: -1.1s;
      animation-delay: -1.1s;
  }
  
  .spinner .rect3 {
      -webkit-animation-delay: -1.0s;
      animation-delay: -1.0s;
  }
  
  .spinner .rect4 {
      -webkit-animation-delay: -0.9s;
      animation-delay: -0.9s;
  }
  
  .spinner .rect5 {
      -webkit-animation-delay: -0.8s;
      animation-delay: -0.8s;
  }
  
  @-webkit-keyframes sk-stretchdelay {
      0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
      20% { -webkit-transform: scaleY(1.0) }
  }
  
  @keyframes sk-stretchdelay {
      0%, 40%, 100% {
          transform: scaleY(0.4);
          -webkit-transform: scaleY(0.4);
      }  20% {
             transform: scaleY(1.0);
             -webkit-transform: scaleY(1.0);
         }
  }
  </code></pre>