index.html.erb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <!-- svgstore fallback -->
  2. <%= javascript_tag nonce: true do -%>
  3. /*
  4. detect if browser is
  5. - Chrome 14-20
  6. - Android Browser 4.1+
  7. - iOS 6-7
  8. - Safari 6
  9. - Edge 12
  10. - IE 9-11
  11. */
  12. window.svgPolyfill = /\bEdge\/12\b|\bTrident\/[567]\b|\bVersion\/7.0 Safari\b/.test(navigator.userAgent) || (navigator.userAgent.match(/AppleWebKit\/(\d+)/) || [])[1] < 537;
  13. (function (doc) {
  14. if(!svgPolyfill)
  15. return
  16. var scripts = doc.getElementsByTagName('script')
  17. var script = scripts[scripts.length - 1]
  18. var xhr = new XMLHttpRequest()
  19. xhr.onload = function () {
  20. var div = doc.createElement('div')
  21. div.innerHTML = this.responseText
  22. div.style.cssText = 'position: absolute; clip: rect(0, 0, 0, 0); z-index: -1;'
  23. script.parentNode.insertBefore(div, script)
  24. }
  25. xhr.open('get', 'assets/images/icons.svg', true)
  26. xhr.send()
  27. })(document)
  28. <% end -%>
  29. <div id="app"></div>
  30. <div class="splash">
  31. <svg class="icon icon-logo"><use xlink:href="assets/images/icons.svg#icon-logo" /></svg>
  32. <div class="splash-title">Loading…</div>
  33. </div>