mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-10-01 15:09:11 +02:00
Merge branch 'master' into feature/donations
This commit is contained in:
commit
1d26ddb9c7
7 changed files with 792 additions and 680 deletions
5
.github/FUNDING.yml
vendored
Normal file
5
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
patreon: placeAtlas
|
||||
ko_fi: placeatlas
|
||||
custom: ['https://paypal.me/Codixer']
|
|
@ -3,6 +3,7 @@
|
|||
import json
|
||||
import time
|
||||
import re
|
||||
import os
|
||||
|
||||
outfile = open('temp_atlas.json', 'w', encoding='utf-8')
|
||||
failfile = open('manual_atlas.json', 'w', encoding='utf-8')
|
||||
|
@ -25,7 +26,9 @@
|
|||
for item in existing:
|
||||
existing_ids.append(item['id'])
|
||||
|
||||
|
||||
total_all_flairs = 0
|
||||
duplicate_count = 0
|
||||
outfile.write("[\n")
|
||||
for submission in reddit.subreddit('placeAtlas2').new(limit=2000):
|
||||
"""
|
||||
Auth setup
|
||||
|
@ -47,10 +50,14 @@
|
|||
4. Pull Request
|
||||
|
||||
"""
|
||||
#print(dir(submission))
|
||||
total_all_flairs += 1
|
||||
if (submission.id in existing_ids):
|
||||
print("Found first duplicate!")
|
||||
break
|
||||
duplicate_count += 1
|
||||
if (duplicate_count > 10):
|
||||
break
|
||||
else:
|
||||
continue
|
||||
if(submission.link_flair_text == "New Entry"):
|
||||
text = submission.selftext
|
||||
#Old backslash filter:
|
||||
|
@ -73,7 +80,7 @@
|
|||
lines[i] = line.replace("\"id\": 0", "\"id\": "+"\""+str(submission.id)+"\"")
|
||||
text = "\n".join(lines)
|
||||
try:
|
||||
outfile.write(json.dumps(json.loads(text))+",\n")
|
||||
outfile.write(json.dumps(json.loads(text))+" ,\n")
|
||||
successcount += 1
|
||||
except json.JSONDecodeError:
|
||||
failfile.write(text+",\n")
|
||||
|
@ -81,4 +88,10 @@
|
|||
print("written "+submission.id+" submitted "+str(round(time.time()-submission.created_utc))+" seconds ago")
|
||||
totalcount += 1
|
||||
|
||||
print(f"\n\nSuccess: {successcount}/{totalcount}\nFail: {failcount}/{totalcount}\nPlease check manual_atlas.txt for failed entries to manually resolve.")
|
||||
# Remove ,\n
|
||||
outfile.seek(outfile.tell()-4, os.SEEK_SET)
|
||||
outfile.truncate()
|
||||
|
||||
outfile.write("\n]")
|
||||
|
||||
print(f"\n\nTotal all flairs:{total_all_flairs}\nSuccess: {successcount}/{totalcount}\nFail: {failcount}/{totalcount}\nPlease check manual_atlas.txt for failed entries to manually resolve.")
|
||||
|
|
BIN
web/_img/place-indexed-final-place.png
Normal file
BIN
web/_img/place-indexed-final-place.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 MiB |
Binary file not shown.
Before Width: | Height: | Size: 1 MiB After Width: | Height: | Size: 1 MiB |
|
@ -271,14 +271,23 @@ async function init(){
|
|||
initialPinchZoom = zoom;
|
||||
|
||||
lastPosition = [x, y];
|
||||
|
||||
if(e.deltaY > 0){
|
||||
|
||||
zoom = zoom / 2;
|
||||
|
||||
} else if(e.deltaY < 0){
|
||||
|
||||
zoom = zoom * 2;
|
||||
// Check if we are zooming by pixels
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaMode
|
||||
if (e.deltaMode === 0) {
|
||||
// Scale the pixel delta by the current zoom factor
|
||||
// We want to zoom faster when closer, and slower when further
|
||||
// This creates a smoother experience
|
||||
zoom -= e.deltaY * (0.001 * zoom);
|
||||
} else {
|
||||
if(e.deltaY > 0){
|
||||
|
||||
zoom = zoom / 2;
|
||||
|
||||
} else if(e.deltaY < 0){
|
||||
|
||||
zoom = zoom * 2;
|
||||
}
|
||||
}
|
||||
|
||||
zoom = Math.max(minZoom, Math.min(maxZoom, zoom));
|
||||
|
|
1419
web/atlas.json
1419
web/atlas.json
File diff suppressed because it is too large
Load diff
|
@ -99,7 +99,7 @@ <h1 id="title">The 2022 /r/place Atlas</h1>
|
|||
<canvas id="linesCanvas"></canvas>
|
||||
<div id="innerContainer">
|
||||
<canvas id="highlightCanvas" width="2000" height="2000"></canvas>
|
||||
<img id="image" src="./_img/place-indexed.png" width="2000" height="2000" alt="Canvas of /r/place in the state of when the experiment was concluded." />
|
||||
<img id="image" src="./_img/place-indexed-final-place.png" width="2000" height="2000" alt="Canvas of /r/place in the state of when the experiment was concluded." />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue