atlas/web/_js/minified.js

1 line
22 KiB
JavaScript
Raw Normal View History

function pointIsInPolygon(e,t){for(var n=e[0],o=e[1],i=!1,a=0,r=t.length-1;a<t.length;r=a++){var l=t[a][0],c=t[a][1],s=t[r][0],d=t[r][1];c>o!=d>o&&n<(s-l)*(o-c)/(d-c)+l&&(i=!i)}return i}window.addEventListener("error",function(e){console.log(e);var t='<p class="error">An error has occurred:</p>';t+='<p class="errorBody">'+e.message+"</p>",t+='<p class="errorBody">on line '+e.lineno+"</p>",t+='<p class="error">If this keeps happening, feel free to send me a <a href="mailto:roland.rytz@gmail.com">mail</a>.</p>',document.getElementById("loadingContent").innerHTML=t});var atlas=[{id:0,name:"Pinewood Logo/Rubix cube (Destroyed)",description:"Originally the logo for the Roblox group Pinewood Builders, the logo transformed into a game of tic tac toe, and then a Rubix cube. It was destroyed after being invaded by Iran",website:"https://pinewoodbuilders.reddit.com/",subreddit:"r/PinewoodBuilders",center:[39.5,279.5],path:[[22.5,295.5],[23.5,274.5],[35.5,262.5],[55.5,262.5],[55.5,283.5],[43.5,295.5]]},{id:1,name:"CCKUFI Robin",description:"The icon of CcKuFi, the subreddit of users who made it to the highest tier in Reddit's 2016 April Fools Event, Robin.",subreddit:"ccKufiPrFaShleWoli0",center:[783.5,669.5],path:[[771.5,661.5],[771.5,680.5],[789.5,680.5],[789.5,664.5],[806.5,664.5],[806.5,660.5],[771.5,660.5]]}];atlas.sort(function(e,t){return e.center[1]<t.center[1]?-1:e.center[1]>t.center[1]?1:0});var linesCanvas=document.getElementById("linesCanvas"),linesContext=linesCanvas.getContext("2d"),hovered=[],previousZoomOrigin=[0,0],previousScaleZoomOrigin=[0,0],backgroundCanvas=document.createElement("canvas");backgroundCanvas.width=2e3,backgroundCanvas.height=1e3;var backgroundContext=backgroundCanvas.getContext("2d");function updateLines(){linesCanvas.width=linesCanvas.clientWidth,linesCanvas.height=linesCanvas.clientHeight,linesContext.lineCap="round",linesContext.lineWidth=Math.max(Math.min(1.5*zoom,24),6),linesContext.strokeStyle="#000000";for(var e=0;e<hovered.length;e++){0!=(t=hovered[e].element).getBoundingClientRect().left&&(linesContext.beginPath(),linesContext.moveTo(t.getBoundingClientRect().left+document.documentElement.scrollLeft+t.clientWidth/2,t.getBoundingClientRect().top+document.documentElement.scrollTop+20),linesContext.lineTo(~~(hovered[e].center[0]*zoom)+innerContainer.offsetLeft,~~(hovered[e].center[1]*zoom)+innerContainer.offsetTop),linesContext.stroke())}linesContext.lineWidth=Math.max(Math.min(zoom,16),4),linesContext.strokeStyle="#FFFFFF";for(e=0;e<hovered.length;e++){var t;0!=(t=hovered[e].element).getBoundingClientRect().left&&(linesContext.beginPath(),linesContext.moveTo(t.getBoundingClientRect().left+document.documentElement.scrollLeft+t.clientWidth/2,t.getBoundingClientRect().top+document.documentElement.scrollTop+20),linesContext.lineTo(~~(hovered[e].center[0]*zoom)+innerContainer.offsetLeft,~~(hovered[e].center[1]*zoom)+innerContainer.offsetTop),linesContext.stroke())}}function renderBackground(e){backgroundContext.clearRect(0,0,canvas.width,canvas.height),backgroundContext.fillStyle="rgba(0, 0, 0, 0.6)",backgroundContext.fillRect(0,0,backgroundCanvas.width,backgroundCanvas.height);for(var t=0;t<e.length;t++){var n=e[t].path;backgroundContext.beginPath(),n[0]&&backgroundContext.moveTo(n[0][0],n[0][1]);for(var o=1;o<n.length;o++)backgroundContext.lineTo(n[o][0],n[o][1]);backgroundContext.closePath(),backgroundContext.strokeStyle="rgba(255, 255, 255, 0.8)",backgroundContext.stroke()}}function initView(){var e,t=document.getElementById("wrapper"),n=document.getElementById("objectsList"),o=document.getElementById("closeObjectsListButton"),i=document.getElementById("searchList"),a=document.getElementById("entriesList"),r=document.getElementById("hideListButton"),l=!0,c=50,s=0,d=document.createElement("button");d.innerHTML="Show "+c+" more",d.id="moreEntriesButton",d.onclick=function(){f(null,null)};var m="shuffle";document.getElementById("sort").value=m;var u=[0,0],g=!1;renderBackground(atlas),y(),f(null,null),document.documentElement.clientWidth>1e3&&(l=!0,t.className=t.className.replace(/ listHidden/