Fonts import test

In this example below you will see how to do a Fonts import test with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by davidmason, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright davidmason ©
  • HTML
  • CSS
  • JavaScript
    <div class="button">
  Hello there <span class="arrow">⟶ &#10230;</span>
</div>

<div class="button">
  Fixed? <span class="arrow-svg"><svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   id="svg8"
   version="1.1"
   viewBox="0 0 3.8503553 1.4385663"
   height="1.4385663mm"
   width="3.8503554mm">
  <defs
     id="defs2" />
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     transform="translate(0.02536844,0.03098437)"
     id="layer1">
    <path
       id="path3712"
       d="M 3.0521378,1.3178772 3.4636933,0.80339513 H -0.02536844 V 0.56782418 H 3.4636933 L 3.0521378,0.04992918 3.1447517,-0.03098437 3.824987,0.63206829 V 0.74335688 L 3.1381122,1.4075819 3.0521378,1.3178771 Z"
       style="fill:#000000;fill-opacity:1;stroke-width:0.01814811" />
  </g>
</svg>
</span>
</div>

/*Downloaded from https://www.codeseek.co/davidmason/fonts-import-test-RLzqgw */
    .button {
  background: #F7D33A;
  padding: 0.5em 1em;
  padding-bottom: 0.4em;
  display: inline-block;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease; }
  .button .arrow {
    transition: transform 0.3s ease;
    transform: translateX(0);
    display: inline-block; }
  .button .arrow-svg > svg {
/*     width: 16px;
    height: 10px; */
  }
  .button:hover {
    background: #0B2C3E;
    color: #FFFFFF; }
    .button:hover .arrow {
      transform: translateX(0.5em); }


/*Downloaded from https://www.codeseek.co/davidmason/fonts-import-test-RLzqgw */
    console.log('⟶'.charCodeAt(0))
console.log()

Comments