iconfont.js 9.83 KB
;(function(window) {

var svgSprite = '<svg>' +
  ''+
    '<symbol id="icon-playcopy" viewBox="0 0 1024 1024">'+
      ''+
      '<path d="M637.735892 125.360104A125.305131 125.305131 0 0 1 763.526075 0.001078 126.113551 126.113551 0 0 1 889.262364 125.360104V880.640151a125.305131 125.305131 0 0 1-125.736289 125.412921 126.113551 126.113551 0 0 1-125.790183-125.412921V125.360104zM134.736842 125.360104A125.305131 125.305131 0 0 1 260.473131 0.001078a126.113551 126.113551 0 0 1 125.790183 125.359026V880.640151a125.305131 125.305131 0 0 1-125.790183 125.412921A126.113551 126.113551 0 0 1 134.736842 880.640151V125.360104z" fill="#1FB6FF" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-play" viewBox="0 0 1024 1024">'+
      ''+
      '<path d="M823.099027 426.085225c40.277084 28.623061 40.277084 98.986054 0 127.46283L229.962889 973.141648c-26.233742 18.529409-59.245348-4.388544-59.245348-41.106031V47.695187C170.66878 10.928938 203.680385-11.989015 229.914127 6.589155L823.099027 426.085225z" fill="#FFFFFF" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-volume" viewBox="0 0 1194 1024">'+
      ''+
      '<path d="M556.937581 850.547223c-1.706652 52.451118-30.890409 82.033094-90.964575 39.025453a21759.249784 21759.249784 0 0 0-211.852457-149.502754c-32.767727-22.926031-64.852793-48.184487-138.864621-48.184488-73.954939 0-104.048911-43.007642-108.429318-82.374424A1371.010797 1371.010797 0 0 1 0 512.004267c0-7.509271 2.389313-58.196848 6.82661-97.506743 4.380408-39.366783 34.417491-82.317536 108.429318-82.317537s106.096894-25.315345 138.864621-48.241375c32.824615-22.98292 122.765199-85.673953 211.852457-149.502755 60.074166-43.007642 89.314811-13.425666 90.907687 39.025453C559.213118 243.263395 568.884148 388.954625 568.884148 512.004267c0 122.992753-9.727919 268.740872-11.946567 338.542956z m368.636928 157.694686a50.346247 50.346247 0 0 0 73.499832-0.398219C1119.848446 880.242976 1194.656711 705.3111 1194.656711 511.89049c0-193.249945-74.751377-368.068044-195.411705-495.725647a50.346247 50.346247 0 0 0-76.002922 2.389313c-18.204293 21.845151-15.701202 55.011097 3.697747 75.661592 101.033825 107.860434 163.383527 255.087652 163.383527 417.674742 0 163.952412-63.430583 312.260509-165.829729 420.348497-19.683392 20.707383-18.773177 55.409316 1.08088 76.002922z m-227.212329-170.153249a54.499101 54.499101 0 0 0 76.230476-0.682661A459.032619 459.032619 0 0 0 910.214637 511.89049a458.748177 458.748177 0 0 0-135.394427-325.231068 54.328436 54.328436 0 0 0-76.230476-0.739549 52.337342 52.337342 0 0 0-0.455107 74.353158 354.357936 354.357936 0 0 1 105.072902 251.617459 354.414824 354.414824 0 0 1-105.243568 251.845012 52.337342 52.337342 0 0 0 0.398219 74.353158z" fill="#FFFFFF" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-quanping" viewBox="0 0 1024 1024">'+
      ''+
      '<path d="M918.4 918.4c-9.6 9.6-19.2 16-32 16h-304c-12.8 0-22.4-3.2-32-12.8-9.6-9.6-12.8-19.2-12.8-32s3.2-25.6 12.8-32c9.6-9.6 19.2-12.8 32-12.8h192l-185.6-185.6c-9.6-9.6-12.8-19.2-12.8-32s3.2-22.4 12.8-32c9.6-9.6 19.2-12.8 32-12.8s22.4 3.2 32 12.8l185.6 185.6v-195.2c0-25.6 19.2-44.8 44.8-44.8 25.6 0 44.8 19.2 44.8 44.8v304c6.4 6.4 0 19.2-9.6 28.8M480 172.8c-9.6 9.6-19.2 12.8-32 12.8H256l185.6 185.6c19.2 19.2 19.2 48 0 64-9.6 9.6-19.2 12.8-32 12.8s-22.4-3.2-32-12.8L188.8 252.8V448c0 25.6-19.2 44.8-44.8 44.8-25.6 0-44.8-19.2-44.8-44.8V144c0-12.8 3.2-22.4 12.8-32 6.4-9.6 19.2-16 32-16H448c12.8 0 22.4 3.2 32 12.8 9.6 9.6 12.8 19.2 12.8 32s-3.2 25.6-12.8 32M947.2 0H76.8C35.2 0 0 35.2 0 76.8v867.2C0 988.8 35.2 1024 76.8 1024h867.2c41.6 0 76.8-35.2 76.8-76.8V76.8c3.2-41.6-32-76.8-73.6-76.8" fill="#FFFFFF" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-start" viewBox="0 0 1024 1024">'+
      ''+
      '<path d="M501.028571 53.028571c-243.2 0-438.857143 195.657143-438.857142 438.857143s195.657143 438.857143 438.857142 438.857143 438.857143-195.657143 438.857143-438.857143c0-241.371429-195.657143-438.857143-438.857143-438.857143z m0 804.571429c-201.142857 0-365.714286-164.571429-365.714285-365.714286s164.571429-365.714286 365.714285-365.714285 365.714286 164.571429 365.714286 365.714285c0 202.971429-162.742857 365.714286-365.714286 365.714286z" fill="#FFFFFF" ></path>'+
      ''+
      '<path d="M501.028571 491.885714m-292.571428 0a292.571429 292.571429 0 1 0 585.142857 0 292.571429 292.571429 0 1 0-585.142857 0Z" fill="#FF6668" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-suspend" viewBox="0 0 1024 1024">'+
      ''+
      '<path d="M512 54.857143C268.8 54.857143 73.142857 250.514286 73.142857 493.714286s195.657143 438.857143 438.857143 438.857143 438.857143-195.657143 438.857143-438.857143S755.2 54.857143 512 54.857143z m0 804.571428C310.857143 859.428571 146.285714 694.857143 146.285714 493.714286S310.857143 128 512 128s365.714286 164.571429 365.714286 365.714286-164.571429 365.714286-365.714286 365.714285z" fill="#FFFFFF" ></path>'+
      ''+
      '<path d="M621.714286 347.428571H402.285714c-20.114286 0-36.571429 16.457143-36.571428 36.571429v219.428571c0 20.114286 16.457143 36.571429 36.571428 36.571429h219.428572c20.114286 0 36.571429-16.457143 36.571428-36.571429V384c0-20.114286-16.457143-36.571429-36.571428-36.571429z" fill="#FF6668" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-luzhi" viewBox="0 0 1024 1024">'+
      ''+
      '<path d="M650.24 317.44H368.64c-25.6 0-51.2 20.48-51.2 51.2v281.6c0 25.6 20.48 51.2 51.2 51.2h281.6c25.6 0 51.2-20.48 51.2-51.2V368.64c0-25.6-20.48-51.2-51.2-51.2z" fill="#FFFFFF" ></path>'+
      ''+
      '<path d="M512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512S793.6 0 512 0z m0 926.72c-230.4 0-414.72-184.32-414.72-414.72S281.6 97.28 512 97.28s414.72 184.32 414.72 414.72-184.32 414.72-414.72 414.72z" fill="#FFFFFF" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-yulan" viewBox="0 0 1024 1024">'+
      ''+
      '<path d="M409.6 716.8l307.2-204.8-307.2-204.8z" fill="#FFFFFF" ></path>'+
      ''+
      '<path d="M512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512S793.6 0 512 0z m0 926.72c-230.4 0-414.72-184.32-414.72-414.72S281.6 97.28 512 97.28s414.72 184.32 414.72 414.72-184.32 414.72-414.72 414.72z" fill="#FFFFFF" ></path>'+
      ''+
    '</symbol>'+
  ''+
    '<symbol id="icon-fangda" viewBox="0 0 1331 1024">'+
      ''+
      '<path d="M102.400512 921.6h256.1536c27.8528 0 51.0464 22.9376 51.0464 51.2 0 28.4672-22.8352 51.2-51.0464 51.2H51.046912a50.8928 50.8928 0 0 1-35.9424-14.9504 50.2272 50.2272 0 0 1-15.104-36.096v-307.5072C0.000512 637.5936 22.938112 614.4 51.200512 614.4c28.4672 0 51.2 22.8352 51.2 51.0464V921.6zM15.002112 14.848C24.218112 5.632 37.018112 0 51.046912 0h307.5072C386.406912 0 409.600512 22.9376 409.600512 51.2c0 28.4672-22.8352 51.2-51.0464 51.2H102.400512v256.1536C102.400512 386.4064 79.462912 409.6 51.200512 409.6c-28.4672 0-51.2-22.8352-51.2-51.0464V51.0464C0.000512 37.1712 5.734912 24.4224 14.950912 15.104zM1228.800512 921.6h-256.1536c-27.8528 0-51.0464 22.9376-51.0464 51.2 0 28.4672 22.8352 51.2 51.0464 51.2h307.5072c13.8752 0 26.624-5.7344 35.9424-14.9504a50.2272 50.2272 0 0 0 15.104-36.096v-307.5072c0-27.8528-22.9376-51.0464-51.2-51.0464-28.4672 0-51.2 22.8352-51.2 51.0464V921.6zM1316.198912 14.848a50.8416 50.8416 0 0 0-36.0448-14.848h-307.5072C944.794112 0 921.600512 22.9376 921.600512 51.2c0 28.4672 22.8352 51.2 51.0464 51.2H1228.800512v256.1536c0 27.8528 22.9376 51.0464 51.2 51.0464 28.4672 0 51.2-22.8352 51.2-51.0464V51.0464a50.8928 50.8928 0 0 0-14.9504-35.9424z" fill="#FFFFFF" ></path>'+
      ''+
    '</symbol>'+
  ''+
'</svg>'
var script = function() {
    var scripts = document.getElementsByTagName('script')
    return scripts[scripts.length - 1]
  }()
var shouldInjectCss = script.getAttribute("data-injectcss")

/**
 * document ready
 */
var ready = function(fn){
  if(document.addEventListener){
      document.addEventListener("DOMContentLoaded",function(){
          document.removeEventListener("DOMContentLoaded",arguments.callee,false)
          fn()
      },false)
  }else if(document.attachEvent){
     IEContentLoaded (window, fn)
  }

  function IEContentLoaded (w, fn) {
      var d = w.document, done = false,
      // only fire once
      init = function () {
          if (!done) {
              done = true
              fn()
          }
      }
      // polling for no errors
      ;(function () {
          try {
              // throws errors until after ondocumentready
              d.documentElement.doScroll('left')
          } catch (e) {
              setTimeout(arguments.callee, 50)
              return
          }
          // no errors, fire

          init()
      })()
      // trying to always fire before onload
      d.onreadystatechange = function() {
          if (d.readyState == 'complete') {
              d.onreadystatechange = null
              init()
          }
      }
  }
}

/**
 * Insert el before target
 *
 * @param {Element} el
 * @param {Element} target
 */

var before = function (el, target) {
  target.parentNode.insertBefore(el, target)
}

/**
 * Prepend el to target
 *
 * @param {Element} el
 * @param {Element} target
 */

var prepend = function (el, target) {
  if (target.firstChild) {
    before(el, target.firstChild)
  } else {
    target.appendChild(el)
  }
}

function appendSvg(){
  var div,svg

  div = document.createElement('div')
  div.innerHTML = svgSprite
  svg = div.getElementsByTagName('svg')[0]
  if (svg) {
    svg.setAttribute('aria-hidden', 'true')
    svg.style.position = 'absolute'
    svg.style.width = 0
    svg.style.height = 0
    svg.style.overflow = 'hidden'
    prepend(svg,document.body)
  }
}

if(shouldInjectCss && !window.__iconfont__svg__cssinject__){
  window.__iconfont__svg__cssinject__ = true
  try{
    document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>");
  }catch(e){
    console && console.log(e)
  }
}

ready(appendSvg)


})(window)