atlas/tools/unused/smallifier.html
Hans5958 07ffc41fa4 Shorten the license text
Nearly nobody bat an eye on this one (better check the LICENSE file on GitHub), also now make it so it doesn't get removed when minified
2023-03-26 15:16:05 +07:00

76 lines
1.3 KiB
HTML

<!--
The 2022 r/place Atlas
Copyright (c) 2017 Roland Rytz <roland@draemm.li>
Copyright (c) 2022 Place Atlas contributors
Licensed under AGPL-3.0 (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>