diff --git a/css/app.css b/css/app.css index b3e28b6..bab5d09 100644 --- a/css/app.css +++ b/css/app.css @@ -104,7 +104,11 @@ pre { width: 240px; } -.contributors { +.eras, .contributors { overflow: scroll; height: 180px; -} \ No newline at end of file +} + +.eras a { + margin-right: 10px; +} diff --git a/index.html b/index.html index 7e9bc9f..c30cc40 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - + @@ -23,6 +23,8 @@ of remixers.

For reference, there is source code and a wiki.

+

Eras

+

Made by...

The percentages represent an activity score based on amount and age of remixes.

@@ -30,5 +32,6 @@
+ - \ No newline at end of file + diff --git a/js/app.js b/js/app.js index 258329d..cd23bcb 100644 --- a/js/app.js +++ b/js/app.js @@ -1,39 +1,36 @@ let area = document.querySelector('#area-main'); let entries = []; let users = {}; - let fetchData; - let sum = 0; +let doThings = false; +let i = 0; async function genTree(treeId) { let entry = treeId; while (true) { let entryDat = fetchData[entry]; - if (!entryDat) break; - + entries.push(entry); - let us = users[entryDat.username]; + if (!entryDat) break; - console.log(entryDat); + let us = users[entryDat.username]; let s = 1 / ((new Date() - new Date(entryDat.datetime_created.$date)) + 1000*60*60); sum += s; users[entryDat.username] = (us ? us : 0) + s; entry = entryDat.parent_id; } - + return entry; } -let doThings = false; - async function main() { - fetchData = await fetch(`https://scratch.mit.edu/projects/1052168454/remixtree/bare/`).then(x => x.json()); + fetchData = await fetch(`https://scratch.mit.edu/projects/${treeID}/remixtree/bare/`).then(x => x.json()); - let latestData = await fetch("https://corsproxy.io/?https://api.scratch.mit.edu/studios/34493018/projects").then(x => x.json()); + let latestData = await fetch(`https://corsproxy.io/?https://api.scratch.mit.edu/studios/${studioID}/projects`).then(x => x.json()); let lid = latestData[0].id; while (fetchData[lid].children.length > 0) { @@ -42,33 +39,55 @@ async function main() { lid = ch2[0] || ch[0]; } await genTree(lid); // latest project - await genTree("654605857"); // tree bug here, unavoidable without jank + for (let gap of treeGaps) { + await genTree(gap); // tree bug here, unavoidable without jank + } + + let params = new URL(window.location).searchParams; + + entries.forEach((x,i) => x && fetchData[x] ? (fetchData[x].id = entries.length - i - 2) : null); + + let start = params.get('start') * 1; + let end = params.get('end') * 1; + + if (start && end) { + entries = entries.splice(entries.length - end - 2,end - start + 1); + } + doThings = true; document.querySelector('.contributors').innerHTML = Object.keys(users) .sort((x, y) => users[y] - users[x]) .map(x => `${x} ${Math.trunc(users[x] / sum * 100000) / 1000}%`) .join(', '); // Doesn't need to be sanitized (hopefully) + + let newEras = importedEras.split('\n').map(x => x.split('-')).map(x => ({start: x[0] * 1, end: x[1] * 1, name: x[2].slice(1)})); + + eras = [...eras, ...newEras]; + + document.querySelector('.eras').innerHTML = eras.map(x => `${x.name}`).join(', '); + setInterval(function () { + if (doThings && (window.innerHeight + window.scrollY) >= document.body.scrollHeight - 25) + scroller(); + }, 500) + } -main(); - -let i = 0; - function sanitize(content) { const decoder = document.createElement('div'); decoder.textContent = content; return decoder.innerHTML; } -setInterval(function () { - if (doThings && (window.innerHeight + window.scrollY) >= document.body.scrollHeight - 25) { - let h = ''; - for (let j = 0; j < 35; j++) { - let entry = entries[i]; - if (!entry || !(entry in fetchData)) break; - h += `
${sanitize(fetchData[entry].title)} #${entries.length - i} by ${fetchData[entry].username}
`; - i++; - } - area.innerHTML += h; +function scroller() { + let h = ''; + for (let j = 0; j < 35; j++) { + let entry = entries[i]; + if (!entry || !(entry in fetchData)) break; + h += `
${sanitize(fetchData[entry].title)} #${fetchData[entry].id} by ${fetchData[entry].username}
`; + i++; } -}, 500); + area.innerHTML += h; +} + +main(); + diff --git a/js/data.js b/js/data.js new file mode 100644 index 0000000..b7d3fed --- /dev/null +++ b/js/data.js @@ -0,0 +1,441 @@ +const treeID = "1052168454"; +const treeGaps = [ + "654605857" +]; + +const studioID = "34493018"; + +const importedEras = `1-6 - Increasing Friction Era +7-10 - Negative Friction Era +11-15 - Nothing Era +16-18 - End & Restart Era +18-24 - H Era +25-28 - Destruction Era +29-48 - Whale Era +49-53 - Platformer Era +54-60 - I don't know Era +61-67 - Story Era +68-94 - Map Collab Era +95-101 - HTTP Status Code Era +102-104 - Ending Era +105-108 - Returning Era +109-118 - Less & Platformer Era +119-125 - Lag Era +126-128 - Zalerfo Era +129-168 - Cement Era +169-174 - Cow Era +175-180 - Cloning Era +181-216 - TTS Era +217-220 - Variable Era +221-229 - I don't know Era 2 +230-234 - Egg Era +235-251 - Neck Era +252-276 - Eeg Era +277-288 - 2nd New World Era +289-339 - I don't know Era 3 +340-364 - Whale Era 2 +365-367 - Ramen Era +368-375 - Roadclose Era +376-390 - storyfrictions Era +391-404 - Chaos Era +405-429 - Chaotic Chaos Era +430-447 - Revival Era +448-464 - Britain Era +465-475 - Whale Era 3 +476-492 - Chaptered Stories Era +493-499 - No More Chapters Era +500-537 - Obama Era +538-540 - Nobama Era +541-560 - Obama Era 2 +561-672 - Remix Cannon +672-684 - Obama Era 3 +685-821 - Remix Cannon V2 +822-850 - Bananium Era +851-885 - Remix Bomb +886-888 - le potassium Era +889-953 - Self Remix Spam +954-976 - Anti-Takeover Era +977-1013 - I don't know Era 4 +1014-1024 - Bad Things Era +1025-1054 - Cyrillic B Era +1055-1076 - Cement Era 2 +1077-1089 - Stole an Gobo Era +1090-1110 - Whale Era 4 +1111-1124 - Dodecahedron Era +1125-1128 - True Negative Era +1129-1137 - I don't know Era 5 +1138-1140 - Map Whales Era +1141-1218 - everiithinq Era +1219-1242 - Icons Era +1243-1283 - Trollface Era +1283-1312 - Time Era +1313-1331 - Gek Era +1332-1355 - PIG Era +1356-1384 - Save H-Frictions Era +1385-1428 - RCv4 Era +1429-1446 - World War Era +1447-1456 - Trash Era +1457-1478 - Adding Era +1479-1498 - I don't know Era 6 +1499-1514 - Sand Era +1515-1525 - Banned Era +1526-1550 - Based Era +1551-1559 - Story Returns Era +1560-1571 - Picture Era +1572-1581 - True Story Era +1582-1592 - bpo Era +1593-1617 - gek Era +1618-1626 - Never Era +1627-1643 - Dead Era +1644-1654 - 1 RobotDance Era +1655-1663 - 47 Car Tires Era +1664-1685 - no Era +1686-1719 - Beat OoVBRC Era +1720-1732 - 2022 Era +1733-1739 - Project 1 Era +1740-1751 - Poop Whale Era +1752-1771 - No Land Era +1772-1784 - Land Bear Era +1785-1803 - Octowhale Era +1804-1811 - I don't know Era 7 +1812-1826 - Yes Era +1827-1852 - Letters Era +1853-1881 - I don't know Era 8 +1882-1898 - HTTP Code Era 2 +1899-1904 - Low Effort Era +1905-1912 - Revolution Era +1913-1936 - Poop Era +1937-1952 - Crashed Era +1953-1968 - Tamagotchi Figures Era +1969-1985 - Neo Story Era +1986-2016 - dabbers-dabbing Era +2017-2030 - History Alerts Era +2031-2082 - Republics Era +2083-2105 - Wanda Era +2106-2127 - 2106 Remixes Era +2128-2167 - Cat Era +2168-2190 - Fork Era +2191-2240 - I don't know Era 9 +2241-2251 - The Box Era +2252-2274 - Real War Era +2275-2292 - Layered Alerts Era +2293-2385 - I don't know Era 10 +2386-2404 - Land of Æ Era +2405-2412 - Fighting Era +2413-2452 - Airport Era +2453-2477 - BSOD Era +2478-2502 - Ukraine Era +2503-2517 - THE DEATH PLANT Era +2518-2566 - nevber Era +2567-2592 - H-Frictions is ruined Era +2593-2606 - Chicken Nuggets Era +2607-2690 - Random Whale Era +2691-2741 - ቃ Era +2742-2764 - Symboliawaila Era +2765-2789 - Ponhces Era +2790-2838 - Mega Whale Ultra Obama Era +2839-2844 - EEG Roll Era +2845-2894 - Failed Stories Era +2895-2903 - Not Funny Era +2904-2923 - Ban Hammer Era +2924-2938 - Ratio Era +2939-2947 - Entry of the Gladiators Era +2948-2964 - Protegent Era +2965-2981 - Top Era +2982-3004 - 3000 Era +3005-3015 - Top Lore Era +3016-3032 - Defeat Top Era +3033-3040 - Ukraine or Not Era +3041-3088 - Dry Concrete Era +3089-3107 - Red Emptiness Era +3108-3144 - Fration Era +3145-3161 - Post-Fration Era +3162-3178 - Competitive Egg Game Era +3179-3184 - Check Your Mailbox Era +3185-3199 - Minerals Era +3200-3204 - EDIT THE PIG Era +3205-3218 - Multiversal Era +3219-3232 - AI Generated Era +3233-3270 - I am a black hole Era +3271-3290 - The Box Era 2 +3291-3327 - White Void Era +3328-3329 - H-frictions the story Era +3330-3357 - H- josh clicker Erafrictions +3358-3365 - the button Era +3366-3401 - Bread ending Era +3402-3435 - Republic of H Era +3436-3467 - stop spam Era +3468-3485 - Anti catatatatat Era +3486-3512 - ? Bug Era +3513-3537 - Irrationless Era +3538-3579 - Anti-catatatatat Era 2 +3580-3600 - Platforming Era +3601-3637 - Becoming Era +3638-3664 - Death Plant Era +3665-3694 - Ending Era Again +3695-3725 - Yummy Era +3726-3772 - Infinity h Era +3773-3804 - Beat RAITNEF Era +3805-3817 - I don't know Era 11 +3818-3825 - Counts Era +3826-3847 - dumbcars2 Era +3848-3865 - H-Frictions when it is Era +3866-3913 - Too Long Era +3914-3937 - Leavels Era +3938-3950 - things-Frictions Era +3951-3999 - ☭☭☭☭ Era +4000-4007 - 4000 Era +4008-4025 - R Era +4026-4050 - Freefall Era +4051-4061 - Trollsome Bot Era +4062-4077 - Times Remixes Era +4078-4095 - Trampoline Era +4095-4105 - Eiffel Era +4106-4135 - Moderator Fail Era +4136-4176 - Britain Era 2 +4177-4208 - I don't know Era 12 +4209-4220 - Grow Undinging Era +4221-4248 - Stay Above untitled Era +4249-4267 - things grow Era +4267-4280 - Lazy Era +4281-4288 - Cool New Story Era +4289-4313 - I don't know Era 13 +4314-4348 - gas™ Era +4349-4355 - d - Platformer Era +4356-4381 - Branching Era +4382-4393 - Rain Era +4394-4446 - 200th Era +4447-4462 - Tau Era +4463-4499 - Branching Era 2 +4500-4549 - Restart Era +4550-4580 - 4550 Era +4580-4604 - gek Era 2 +4605-4641 - I don't know Era 14 +4642-4675 - Space wales Era +4676-4715 - hjyfgjiutyity Cement Era +4716-4730 - e. remix Era +4731-4776 - (no era) +4777-4816 - Dubstepv1new Story Era +4817-4849 - Not a remix cannon +4850-4861 - Bear Era +4862-4895 - Distortion Era +4896-4908 - Cannon Era +4909-4933 - 4 Years Era +4934-4945 - Low Quality Era +4946-4956 - Explode Story Era +4957-4973 - Remix Count Era +4974-4984 - We Had To Go Era +4985-5000 - werty Era +5001-5026 - 5000 Era +5027-5051 - Derailed Era +5052-5099 - PON spam +5100-5146 - Silas Era +5147-5176 - Ban Hammer Era +5177-5189 - Screamer Era +5190-5207 - Circles Era +5208-5223 - potato Era +5224-5239 - Giraffe Era +5240-5266 - eye frictions Era +5267-5285 - Interrupt Chain Era +5286-5313 - YOU ARE NOT A WELL Era +5314-5332 - letter sim Era +5333-5369 - Giraffe Story Era +5370-5397 - frictionverse Era +5398-5405 - GAD Era +5406-5418 - FBAAGRC Era +5418-5450 - Tapes FBAAGRC Era +5451-5517 - ifriction FBAAGRC Era +5518-5545 - Troll Era +5546-5561 - ZOG Era +5562-5575 - no E Frictions era +5576-5599 - Troll Chungus Era +5600-5618 - Well Party Era +5619-5626 - Watermelon Clicker 3 Era +5627-5699 - I don't know Era 15 +5700-5724 - Remix is a Era +5725-5767 - Troll Cow Era +5768-5780 - Not just the cow Era +5781-5814 - Cardiff era +5815-5861 - cardiff story era +5862-5917 - Low effort story era +5918-5959 - keg Era +5960-5978 - well resistance Era +5979-6005 - 6000 Era +6006-6016 - The War Era +6017-6033 - Unremixed Story Era +6034-6053 - RCUTB Chaos Era +6054-6068 - Fan Era +6069-6091 - now here is Era +6092-6110 - I don't know Era 16 +6111-6141 - Britain Era 3 +6142-6151 - Orange Square Era +6152-6161 - Untitled-400 Era +6162-6167 - by n story Era +6168-6180 - Dice Era +6181-6205 - One Of The Letterclone Era +6206-6218 - Remix bomb Era +6219-6226 - Unremixable Era +6227-6235 - Selfremixable Era +6236-6247 - Platformer Controls Era +6248-6263 - Steel Era +6264-6281 - I don't know Era 17 +6282-6319 - Archiredture Era +6319-6337 - Cardiff Era 2 +6338-6358 - Collapse Era +6359-6377 - Void Era +6378-6399 - Collapse Era 2 +6400-6408 - 6400 Era +6409-6421 - Troll Selfremix Era +6422-6427 - The Box Era 3 +6428-6441 - Palyers Era +6442-6459 - Ant Era +6460-6474 - Mario Game Era +6475-6487 - the the movie Era +6488-6506 - Horse Era +6507-6518 - because Era +6519-6538 - Ponhces Era 2 +6539-6575 - Ozone Era +6576-6587 - PALEOMap Era +6588-6599 - I don't know Era 18 +6600-6613 - 6600 Era +6614-6631 - thirtypastsixteen Era +6632-6665 - Fast Remix Claims Era +6666-6673 - 6666 Era +6674-6718 - I don't know Era 19 +6719-6742 - Global Era +6743-6759 - Creatures Era +6760-6780 - Cat Era 2 +6781-6804 - Eradication Era +6805-6841 - Fell off Era +6842-6885 - Eradication Era 2 +6886-6904 - Skateboard Owlless Era +6905-6934 - Variable Era 2 +6935-6981 - Powers Era +6981-6999 - I've Changed It Era +7000-7079 - 7000 Era +7080-7089 - Zalerfo Era +7090-7120 - 7100 Era +7121-7154 - I don't know Era 20 +7155-7170 - Effort Stages Era +7171-7226 - It will put a story Era +7227-7294 - No more story Era +7295-7315 - My PFP Era +7316-7330 - real Era +7331-7357 - Not Generic Chain Era +7358-7369 - re Era +7370-7399 - Put Effort Era +7400-7425 - 7400 Era +7426-7437 - Well Sides Era +7438-7460 - Another story Era +7461-7472 - China Era +7473-7484 - a new Era +7485-7501 - yt bitrate cars Era +7502-7519 - Plent Era +7520-7532 - Whale Clicker Era +7533-7557 - 08draven back Era +7558-7591 - Tau Era 2 +7592-7646 - Telephone Era +7647-7699 - I don't know Era 21 +7700-7705 - 7700 Era +7706-7742 - New Platformer Era +7743-7752 - frictionless but Era +7753-7764 - Collapsed Era +7765-7776 - Found Gek Era +7777-7792 - 26 billion Era +7793-7823 - h-frictions activity Era +7824-7844 - Spam Pig Credits Era +7845-7870 - I don't know Era 22 +7871-7888 - WHY THE whale Era +7889-7939 - Tunnelcard Era +7940-7949 - Weird TTS Era +7950-7973 - Troll China Era +7974-7999 - Story frictions The story Era +8000-8011 - 8000 Era +8012-8034 - H-Frictions but Era +8035-8051 - We had to go back Era +8052-8137 - I don't know Era 23 +8136-8167 - TSTHATHGGE Era +8168-8192 - PostTSTHATHGGE Era +8193-8218 - Classic Era`; + +let eras = [ + { + 'name': 'Everything' + }, + { + 'name': 'Classic Eon', + 'start': 1, + 'end': 288 + }, + { + 'name': 'Dead Eon', + 'start': 289, + 'end': 429, + }, + { + 'name': 'Revival Eon', + 'start': 430, + 'end': 1140 + }, + { + 'name': 'Doggolandian Eon', + 'start': 1141, + 'end': 1739 + }, + { + 'name': 'Loggerminian Eon', + 'start': 1740, + 'end': 2789 + }, + { + 'name': 'Decay Eon', + 'start': 2790, + 'end': 3040 + }, + { + 'name': 'Story Eon', + 'start': 3041, + 'end': 3232 + }, + { + 'name': 'Lolcannian Eon', + 'start': 3233, + 'end': 4248 + }, + { + 'name': 'Treenuked Eon', + 'start': 3805, + 'end': 4105 + }, + { + 'name': 'Future Eon', + 'start': 4249, + 'end': 5223 + }, + { + 'name': 'I Friction Eon', + 'start': 5224, + 'end': 6033 + }, + { + 'name': 'Unnamed Eon', + 'start': 6053, + 'end': 6235 + }, + { + 'name': 'Neoclassic Eon', + 'start': 6236, + 'end': 7089 + }, + { + 'name': 'Generic Eon', + 'start': 7090, + 'end': 7646 + }, + { + 'name': 'Welded Eon', + 'start': 7647, + 'end': 8218 + }, + +];