atlas/tools/unused/smallifier.html
2022-04-28 17:43:03 +07:00

85 lines
1.6 KiB
HTML

<!--
========================================================================
The 2022 r/place Atlas
An Atlas of Reddit's 2022 r/place, with information to each
artwork of the canvas provided by the community.
Copyright (c) 2017 Roland Rytz <roland@draemm.li>
Copyright (c) 2022 Place Atlas contributors
Licensed under the GNU Affero General Public License Version 3
https://place-atlas.stefanocoding.me/license.txt
========================================================================
-->
<!--
This shrinks the atlas by making it arrays instead of objects, but
the difference in size is only about 100k, so it's probably not
worth the effort
-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>
Smallifier
</title>
<style>
html, body{
height: 100%;
width: 100%;
}
#output{
height: 90%;
width: 90%;
display: block;
}
</style>
</head>
<body>
<textarea id="output"></textarea>
<script type="text/javascript" src="../web/_js/atlas.js"></script>
<script type="text/javascript">
var smallifiedAtlas = [];
for(var i = 0; i < atlas.length; i++){
smallifiedAtlas.push([
atlas[i].id
,atlas[i].name
,atlas[i].description
,atlas[i].website
,atlas[i].subreddit
,atlas[i].center
,atlas[i].path
]);
}
console.log(atlas.length, smallifiedAtlas.length);
var jsonString = JSON.stringify(smallifiedAtlas, null, 0);
var textarea = document.getElementById("output");
textarea.innerHTML = "var atlas = "+jsonString+";";
</script>
</body>
</html>