@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 804 B
JavaScript
export function remsToPixels(e){return e*parseFloat(getComputedStyle(document.documentElement).fontSize)}export function chunkArray(e,t){const o=[];for(let n=0;n<e.length;n+=t)o.push(e.slice(n,n+t));return o}export function sortByName(e){e.sort(function(t,o){var n=t.name.toLowerCase(),r=o.name.toLowerCase();return n<r?-1:n>r?1:0})}const u=document.createElement("canvas"),c=u.getContext("webgl")||u.getContext("experimental-webgl");export const isWebGlSupported=!!c;if(!isWebGlSupported){const e=document.createElement("div");e.innerHTML="<!--no webgl-->",document.body.appendChild(e)}export function shuffle(e){for(var t=e.length,o,n;t!==0;)n=Math.floor(Math.random()*t),t-=1,o=e[t],e[t]=e[n],e[n]=o;return e}export function sleep(e){return new Promise(t=>setTimeout(t,e))}export*from"./urlEncoding";