atlas/web/_js/minified.js

1 line
23 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]]},{id:2,name:"Narrator Nexus",description:"The icon of Narrator Nexus, the group of users who coordinated the storyline in Reddit's 2019 April Fools Event, Sequence.",website:"",subreddit:"/r/NarraNexus/",center:[763.5,673.5],path:[[755.5,667.5],[755.5,680.5],[771.5,680.5],[771.5,674.5],[772.5,673.5],[772.5,670.5],[767.5,664.5],[762.5,664.5],[759.5,669.5],[755.5,667.5]]},{id:3,name:"April Knights",description:"The Logo of the April Knights, a subreddit formed for Reddit's 2015 April Fools event 'The Button'.",website:"",subreddit:"/r/AprilKnights/",center:[788.5,677.5],path:[[789.5,664.5],[789.5,679.5],[789.5,680.5],[755.5,680.5],[755.5,684.5],[803.5,684.5],[801.5,679.5],[803.5,676.5],[803.5,664.5],[789.5,664.5]]},{id:4,name:"Triforce",description:"The iconic symbol of the Legend of Zelda franchise.",website:"",subreddit:"/r/Zelda",center:[788.5,640.5],path:[[788.5,598.5],[756.5,661.5],[819.5,661.5],[819.5,660.5],[788.5,598.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.