mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-10-20 00:10:56 +02:00
Solved cleanup conflicts
This commit is contained in:
commit
a005161c4c
14 changed files with 460 additions and 1605 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,4 +12,4 @@ allCharacters.txt
|
||||||
combined.js
|
combined.js
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
.vscode/
|
.vscode/
|
||||||
_img/place/
|
web/atlas-before-ids-migration.json
|
||||||
|
|
|
@ -69,7 +69,7 @@ #wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #FFAA00;
|
color: #ffcf6f;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,6 +491,16 @@ .object p {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.edit {
|
||||||
|
color: #FFFF00;
|
||||||
|
}
|
||||||
|
p.add {
|
||||||
|
color: #00FF00;
|
||||||
|
}
|
||||||
|
p.delete {
|
||||||
|
color: #FF0000;
|
||||||
|
}
|
||||||
|
|
||||||
#drawControlsContainer {
|
#drawControlsContainer {
|
||||||
background-color: #444;
|
background-color: #444;
|
||||||
border-right: 1px #000 solid;
|
border-right: 1px #000 solid;
|
||||||
|
@ -648,6 +658,43 @@ #exportOverlay {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#coordsWrapper {
|
||||||
|
min-width: 100px;
|
||||||
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
.collapsed {
|
||||||
|
top: 49px;
|
||||||
|
left: 149px;
|
||||||
|
}
|
||||||
|
.uncollapsed {
|
||||||
|
top: 49px;
|
||||||
|
left: 380px;
|
||||||
|
}
|
||||||
|
@media (max-width: 750px) {
|
||||||
|
#coordsWrapper {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#coords {
|
||||||
|
background-color: #555;
|
||||||
|
border: 1px #000 solid;
|
||||||
|
padding: 3px;
|
||||||
|
font-size: 18px;
|
||||||
|
z-index: 1100;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#coords p {
|
||||||
|
margin: 0;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
#bottomBar {
|
#bottomBar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
|
|
BIN
web/_img/pwa/icon-192x192.png
Normal file
BIN
web/_img/pwa/icon-192x192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
BIN
web/_img/pwa/icon-256x256.png
Normal file
BIN
web/_img/pwa/icon-256x256.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
web/_img/pwa/icon-384x384.png
Normal file
BIN
web/_img/pwa/icon-384x384.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6 KiB |
BIN
web/_img/pwa/icon-512x512.png
Normal file
BIN
web/_img/pwa/icon-512x512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
|
@ -22,6 +22,12 @@ function createInfoBlock(entry) {
|
||||||
|
|
||||||
element.appendChild(headerElement);
|
element.appendChild(headerElement);
|
||||||
|
|
||||||
|
if (entry.diff) {
|
||||||
|
let diffElement = createInfoParagraph("Diff: ", entry.diff);
|
||||||
|
diffElement.className = entry.diff;
|
||||||
|
element.appendChild(diffElement);
|
||||||
|
}
|
||||||
|
|
||||||
if (entry.description) {
|
if (entry.description) {
|
||||||
let descElement = document.createElement("p");
|
let descElement = document.createElement("p");
|
||||||
descElement.innerText = entry.description;
|
descElement.innerText = entry.description;
|
||||||
|
|
|
@ -146,11 +146,7 @@ async function init(){
|
||||||
a[c.id] = c;
|
a[c.id] = c;
|
||||||
return a;
|
return a;
|
||||||
},{});
|
},{});
|
||||||
if(mode.endsWith("only")){
|
// Mark added/edited entries
|
||||||
atlas = atlas.filter(function(entry) {
|
|
||||||
return JSON.stringify(entry) !== JSON.stringify(liveAtlasReduced[entry.id]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
atlas = atlas.map(function(entry) {
|
atlas = atlas.map(function(entry) {
|
||||||
if(liveAtlasReduced[entry.id] === undefined){
|
if(liveAtlasReduced[entry.id] === undefined){
|
||||||
entry.diff = "add";
|
entry.diff = "add";
|
||||||
|
@ -159,14 +155,38 @@ async function init(){
|
||||||
}
|
}
|
||||||
return entry;
|
return entry;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Mark removed entries
|
||||||
|
let atlasReduced = atlas.reduce(function(a, c) {
|
||||||
|
a[c.id] = c;
|
||||||
|
return a;
|
||||||
|
},{});
|
||||||
|
let removedEntries = liveJson.map(function(entry) {
|
||||||
|
if(atlasReduced[entry.id] === undefined){
|
||||||
|
entry.diff = "delete";
|
||||||
|
}
|
||||||
|
return entry;
|
||||||
|
});
|
||||||
|
atlas.push(...removedEntries)
|
||||||
|
|
||||||
|
if(mode.includes("only")){
|
||||||
|
atlas = atlas.filter(function(entry) {
|
||||||
|
return typeof entry.diff == "string"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//TEMP FOR TIME TRAVEL
|
//TEMP FOR TIME TRAVEL
|
||||||
atlasBackup = atlas;
|
atlasBackup = atlas;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Diff mode failed to load, reverting to normal view - " + error);
|
console.log("Diff mode failed to load, reverting to normal view - " + error);
|
||||||
} finally {
|
} finally {
|
||||||
|
if(initOverlap && mode.includes("overlap")){
|
||||||
|
initOverlap();
|
||||||
|
} else {
|
||||||
initView();
|
initView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function changeOverlapMode(){
|
function changeOverlapMode(){
|
||||||
console.log(mode)
|
console.log(mode)
|
||||||
|
@ -325,7 +345,7 @@ async function init(){
|
||||||
applyZoom(x, y, zoom);
|
applyZoom(x, y, zoom);
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
}, {passive: true});
|
||||||
|
|
||||||
/*function setDesiredZoom(x, y, target){
|
/*function setDesiredZoom(x, y, target){
|
||||||
zoom = (zoom*2 + target)/3;
|
zoom = (zoom*2 + target)/3;
|
||||||
|
@ -354,7 +374,7 @@ async function init(){
|
||||||
|
|
||||||
touchstart(e);
|
touchstart(e);
|
||||||
|
|
||||||
});
|
}, {passive: true});
|
||||||
|
|
||||||
function mousedown(x, y){
|
function mousedown(x, y){
|
||||||
lastPosition = [x, y];
|
lastPosition = [x, y];
|
||||||
|
|
|
@ -124,6 +124,10 @@ function renderBackground(atlas){
|
||||||
bgStrokeStyle = "rgba(255, 255, 0, 1)";
|
bgStrokeStyle = "rgba(255, 255, 0, 1)";
|
||||||
backgroundContext.lineWidth = 2;
|
backgroundContext.lineWidth = 2;
|
||||||
break;
|
break;
|
||||||
|
case "delete":
|
||||||
|
bgStrokeStyle = "rgba(255, 0, 0, 1)";
|
||||||
|
backgroundContext.lineWidth = 2;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
bgStrokeStyle = "rgba(255, 255, 255, 0.8)";
|
bgStrokeStyle = "rgba(255, 255, 255, 0.8)";
|
||||||
break;
|
break;
|
||||||
|
@ -252,6 +256,7 @@ function initView(){
|
||||||
} else {
|
} else {
|
||||||
wrapper.className += " listHidden";
|
wrapper.className += " listHidden";
|
||||||
}
|
}
|
||||||
|
updateHovering();
|
||||||
applyView();
|
applyView();
|
||||||
render();
|
render();
|
||||||
updateLines();
|
updateLines();
|
||||||
|
@ -336,12 +341,20 @@ function initView(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateHovering(e, tapped){
|
function updateHovering(e, tapped){
|
||||||
|
var coordsWrapper = document.getElementById("coordsWrapper");
|
||||||
|
if (entriesListShown) {
|
||||||
|
coordsWrapper.className = "uncollapsed"
|
||||||
|
} else {
|
||||||
|
coordsWrapper.className = "collapsed"
|
||||||
|
}
|
||||||
|
|
||||||
if(!dragging && (!fixed || tapped)){
|
if(!dragging && (!fixed || tapped)){
|
||||||
var pos = [
|
var pos = [
|
||||||
(e.clientX - (container.clientWidth/2 - innerContainer.clientWidth/2 + zoomOrigin[0] + container.offsetLeft))/zoom
|
(e.clientX - (container.clientWidth/2 - innerContainer.clientWidth/2 + zoomOrigin[0] + container.offsetLeft))/zoom
|
||||||
,(e.clientY - (container.clientHeight/2 - innerContainer.clientHeight/2 + zoomOrigin[1] + container.offsetTop))/zoom
|
,(e.clientY - (container.clientHeight/2 - innerContainer.clientHeight/2 + zoomOrigin[1] + container.offsetTop))/zoom
|
||||||
];
|
];
|
||||||
|
var coords_p = document.getElementById("coords_p");
|
||||||
|
coords_p.innerText = Math.ceil(pos[0]) + ", " + Math.ceil(pos[1]);
|
||||||
|
|
||||||
if(pos[0] <= 2200 && pos[0] >= -100 && pos[0] <= 2200 && pos[0] >= -100){
|
if(pos[0] <= 2200 && pos[0] >= -100 && pos[0] <= 2200 && pos[0] >= -100){
|
||||||
var newHovered = [];
|
var newHovered = [];
|
||||||
|
@ -568,6 +581,7 @@ function initView(){
|
||||||
zoom = 4;
|
zoom = 4;
|
||||||
renderBackground(atlas);
|
renderBackground(atlas);
|
||||||
applyView();
|
applyView();
|
||||||
|
updateHovering();
|
||||||
|
|
||||||
zoomOrigin = [
|
zoomOrigin = [
|
||||||
innerContainer.clientWidth/2 - this.entry.center[0]* zoom// + container.offsetLeft
|
innerContainer.clientWidth/2 - this.entry.center[0]* zoom// + container.offsetLeft
|
||||||
|
@ -756,7 +770,7 @@ function initView(){
|
||||||
,e.touches[0].clientY
|
,e.touches[0].clientY
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
});
|
},{passive: true} );
|
||||||
|
|
||||||
container.addEventListener("mouseup", function(e){
|
container.addEventListener("mouseup", function(e){
|
||||||
if(Math.abs(lastPos[0] - e.clientX) + Math.abs(lastPos[1] - e.clientY) <= 4){
|
if(Math.abs(lastPos[0] - e.clientX) + Math.abs(lastPos[1] - e.clientY) <= 4){
|
||||||
|
@ -803,6 +817,7 @@ function initView(){
|
||||||
entriesListShown = false;
|
entriesListShown = false;
|
||||||
wrapper.className += " listHidden";
|
wrapper.className += " listHidden";
|
||||||
}
|
}
|
||||||
|
updateHovering();
|
||||||
|
|
||||||
viewportWidth = document.documentElement.clientWidth;
|
viewportWidth = document.documentElement.clientWidth;
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
646
web/atlas.json
646
web/atlas.json
File diff suppressed because it is too large
Load diff
1
web/built_atlas_DO_NOT_MODIFY.json
Normal file
1
web/built_atlas_DO_NOT_MODIFY.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -21,7 +21,7 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>The 2022 /r/place Atlas</title>
|
<title>The 2022 /r/place Atlas</title>
|
||||||
|
@ -33,10 +33,11 @@
|
||||||
|
|
||||||
<!-- <meta name="google-site-verification" content="gZGHpBSMzffAbIn0qB8b00We6EwSGkDTfDoQVv-NWss"/> -->
|
<!-- <meta name="google-site-verification" content="gZGHpBSMzffAbIn0qB8b00We6EwSGkDTfDoQVv-NWss"/> -->
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, shrink-to-fit=no"> <!-- user-scalable=no -->
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
|
||||||
<link href="./_css/style.css?version=1.0.33" rel="stylesheet" type="text/css" media="all">
|
<link href="./_css/style.css?version=1.0.33" rel="stylesheet" type="text/css" media="all">
|
||||||
|
<link rel="manifest" href="./manifest.webmanifest">
|
||||||
|
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{
|
{
|
||||||
|
@ -137,7 +138,14 @@ <h1 id="title">The 2022 /r/place Atlas</h1>
|
||||||
</div>
|
</div>
|
||||||
<div id="entriesListBackground"></div>
|
<div id="entriesListBackground"></div>
|
||||||
|
|
||||||
<button id="hideListButton"></button>
|
<button id="hideListButton" aria-label:="Show List Button"></button>
|
||||||
|
|
||||||
|
<div id="coordsWrapper" class="collapsed">
|
||||||
|
|
||||||
|
<div id="coords">
|
||||||
|
<p id="coords_p">0, 0</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="bottomBar">
|
<div id="bottomBar">
|
||||||
<div id="zoomControls">
|
<div id="zoomControls">
|
||||||
|
@ -148,8 +156,8 @@ <h1 id="title">The 2022 /r/place Atlas</h1>
|
||||||
<div id="timeControls">
|
<div id="timeControls">
|
||||||
<input type="range" min="1" max="1" value="1" class="slider" id="timeControlsSlider">
|
<input type="range" min="1" max="1" value="1" class="slider" id="timeControlsSlider">
|
||||||
</div>
|
</div>
|
||||||
<div id="author">
|
|
||||||
<p>Code by <a href="https://draemm.li/various/place-atlas/" target="_blank" rel="author">Roland Rytz</a>. Source on <a target="_blank" href="https://github.com/placeAtlas/atlas">GitHub</a>. This site is powered by <a href="https://www.netlify.com">Netlify</a>. Images provided by <a target="_blank" href="https://place.thatguyalex.com/">Alex Tsernoh</a>.</p>
|
<p><div id="author">Code owned by <a href="https://github.com/placeAtlas/atlas" target="_blank" rel="author">Place Atlas</a>.. Source on <a target="_blank" href="https://github.com/placeAtlas/atlas">GitHub</a>. This site is powered by <a href="https://www.netlify.com">Netlify</a>. Images provided by <a target="_blank" href="https://place.thatguyalex.com/">Alex Tsernoh</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -199,12 +207,7 @@ <h1 id="title">The 2022 /r/place Atlas</h1>
|
||||||
|
|
||||||
<div id="exportOverlay" class="overlay">
|
<div id="exportOverlay" class="overlay">
|
||||||
<div id="exportWindow">
|
<div id="exportWindow">
|
||||||
|
<p><b>Recommended:</b> Post directly after clicking this button. Don't forget to flair it with the "New Entry" tag. </p>
|
||||||
<p>Please copy the text below and submit it as a<br>
|
|
||||||
new text post to <a target="_blank" href="https://www.reddit.com/r/placeAtlas2/">/r/placeAtlas2</a> on Reddit.</p>
|
|
||||||
<p>I will then check it and add it to the atlas.</p>
|
|
||||||
<textarea cols="50" rows="5" id="exportString"></textarea>
|
|
||||||
|
|
||||||
<div style="display:flex; flex-direction:column;align-items:center">
|
<div style="display:flex; flex-direction:column;align-items:center">
|
||||||
<a href="_blank" id="exportDirectPost">Post Direct to Reddit</a>
|
<a href="_blank" id="exportDirectPost">Post Direct to Reddit</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
32
web/manifest.webmanifest
Normal file
32
web/manifest.webmanifest
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"theme_color": "#f69435",
|
||||||
|
"background_color": "#f69435",
|
||||||
|
"display": "minimal-ui",
|
||||||
|
"scope": "/",
|
||||||
|
"start_url": "/",
|
||||||
|
"name": "r/place atlas",
|
||||||
|
"short_name": "r/placeAtlas2",
|
||||||
|
"description": "The atlas for the r/place event from 2022",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "_img/pwa/icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "_img/pwa/icon-256x256.png",
|
||||||
|
"sizes": "256x256",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "_img/pwa/icon-384x384.png",
|
||||||
|
"sizes": "384x384",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "_img/pwa/icon-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue