Skip to content

Instantly share code, notes, and snippets.

@Eaglefeather1
Created April 2, 2023 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Eaglefeather1/2452c56f096475cdd645a25d64f51d21 to your computer and use it in GitHub Desktop.
Save Eaglefeather1/2452c56f096475cdd645a25d64f51d21 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="myData"></div>
<script src="script.js"></script>
</body>
</html>
fetch('worldstuck.json')
.then(function(response) {
return response.json();
})
.then(function(data) {
var regions = Object.values(data);
for (var a = 0; a < regions.length; a++) {
regions[a].sort(function(a, b) {
return a.groupName.localeCompare(b.groupName);
});
appendData(data, a);
}
})
.catch(function(err) {
console.log('error: ' + err);
});
function appendData(data, a) {
//VARIABLES
var mainContainer = document.getElementById("myData");
var regionKeys = Object.keys(data)[a];
var regionValues = Object.values(data)[a];
//END VARIABLES
//FUNCTIONS
function appendDiv(classes, container, divId) {
let div = document.createElement("div");
div.setAttribute("class", classes);
if (divId != undefined) {
div.setAttribute("id", divId);
}
container.appendChild(div);
}
function appendImg(container) {
if (regionValues[i].img != undefined) {
let img = new Image();
img.src = `images/${regionValues[i].img}`;
container.appendChild(img);
}
}
function appendText(textVal, container, textTag, classes) {
let text = document.createElement(textTag);
if (classes != undefined) {
text.setAttribute("class", classes);
}
text.innerHTML = textVal;
container.appendChild(text);
}
//END FUNCTIONS
//THE GOOD SHIT
appendDiv("region", mainContainer, regionKeys);
appendDiv("headerDiv", mainContainer.lastChild);
appendText(Object.keys(data)[a], mainContainer.lastChild.lastChild, "h1", "header");
appendDiv("groupsDiv", mainContainer.lastChild);
for (var i = 0; i < regionValues.length; i++) {
appendDiv("group", mainContainer.lastChild.lastChild);
groupDiv = mainContainer.lastChild.lastChild.lastChild;
appendImg(groupDiv);
appendText(regionValues[i].groupName, groupDiv, "h2", "textCenter");
appendText(`<i>${regionValues[i].period}</i>`, groupDiv, "p", "textCenter lessHeight");
appendText(`${regionValues[i].location}<br><b>Member Count: </b>${regionValues[i].size}<br>${regionValues[i].desc}`, groupDiv, "p");
let linksLoc = regionValues[i].links;
appendDiv("links", groupDiv, "links");
for (var e = 0; e < linksLoc.length/2; e++) {
appendText(`<a href=${linksLoc[2*e+1]}>${linksLoc[e*2]}</a> `, groupDiv.lastChild, "span", linksLoc[e*2]);
}
appendDiv(`${regionValues[i].status} activityDiv`, groupDiv)
appendText(`<b>${regionValues[i].status.toUpperCase()}</b>`, groupDiv.lastChild, "p");
}
//END THE GOOD SHIT
}
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Zanabazar+Square&display=swap');
html {
height: 100%;
width: 100%;
}
body {
background-color: #404258;
color: white;
font-family: Open Sans, Helvetica, sans-serif;
}
h1 {
font-family: Noto Sans Zanabazar Square;
}
.textCenter {
text-align: center;
}
img {
width: 95%;
margin-top: 15px;
display: block;
margin-left: auto;
margin-right: auto;
}
span {
border: 2px solid white;
border-radius: 25px;
padding: 3px;
padding-left: 6px;
margin: 3px;
line-height: 35px;
}
a {
color: white;
}
a:link,visited,hover,active {
text-decoration: none;
}
.links {
margin-bottom: 10px;
}
.region {
border-radius: 10px;
margin: 5px;
padding-left: 15px;
padding-right: 15px;
background-color: #474E68;
}
.groupsDiv {
-webkit-column-width: 10em;
-webkit-column-gap: 1em;
-webkit-column-count: 5;
-moz-column-width: 20em;
-moz-column-gap: 2em;
-moz-column-count: 2;
-ms-column-width: 20em;
-ms-column-gap: 2em;
-ms-column-count: 5;
column-width: 20em;
column-gap: 2em;
column-count: 5;
padding-bottom: 15px;
}
.group {
border: 2px solid black;
border-radius: 25px;
padding: 10px;
background-color: #50577A;
/* COLUMNS */
break-inside: avoid-column;
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
width: 100%;
box-sizing:border-box;
}
.group:not(:first-of-type) {
margin: 20px 0;
}
/* ACTIVITY BANNER */
.activityDiv {
font-size: 30px;
padding: 10px 5px;
margin: 10px -10px -10px -10px;
border-radius: 0% 0% 23px 23px;
text-align: center;
}
.activityDiv * {
margin-top: auto;
margin-bottom: auto;
}
.Active {
background-color: #7cd992;
}
.Inactive {
background-color: #f7e463;
}
.Dead {
background-color: #eb6060;
}
.Unknown {
background-color: #a8a8a8;
}
/* END ACTIVITY BANNER */
/* LINK COLORS */
.Instagram {
background-image: linear-gradient(to bottom right, #d62976, #962fbf);
border-color: #000000;
}
.Discord {
background-color: #7289da;
border-color: #23272a;
}
.Tumblr {
background-color: #001935;
border-color: #00B8FF;
}
.TikTok {
background-image: linear-gradient(to bottom right, #00f2ea, #ff0050);
border-color: black;
}
.YouTube {
background-color: #FF0000;
border-color: #282828;
}
.Linktree {
background-color: #4d6d17;
border-color: black;
}
.Facebook {
background-color: #4292FF;
border-color: #18191A;
}
/* END LINK COLORS */
{
"Template": [
{
"img": "",
"groupName": "",
"location": "",
"size": "",
"desc": "",
"period": "",
"links": [],
"status": ""
}
],
"California": [
{
"img": "CaliborniaHomestucks.jpg",
"groupName": "Calibornia Homestucks",
"location": "California",
"size": "215",
"desc": "Calibornia Homestucks is a California-wide Homestuck group founded at FanimeCon 2022. They are very active in online spaces, particularly their Discord, and host gatherings and/or panels at most major California conventions. They have a 15+ age limit.",
"period": "2022-present",
"links": ["Discord", "https://discord.gg/calibornia", "Instagram", "https://instagram.com/caliborniahomestucks", "Tumblr", "https://tumblr.com/caliborniastuck", "TikTok", "https://tiktok.com/@calibornia.stuck", "YouTube", "https://youtube.com/channel/UC77y1UjGT_TKFNG6XkMAfcQ", "Linktree", "https://linktr.ee/calibornia"],
"status": "Active"
},
{
"groupName": "SoCal Homestuck 18 and Over Group",
"location": "Southern California",
"size": "32",
"desc": "A Facebook group for adult Homestuck cosplayers located in Southern California. Had a very short and inactive lifespan.",
"period": "2014-2017",
"links": ["Facebook", "https://www.facebook.com/groups/666498250112498/"],
"status": "Dead"
},
{
"img": "SoCalStuck.jpg",
"groupName": "SoCalStuck",
"location": "Southern California",
"size": "Unknown",
"desc": "A Tumblr page dedicated to tracking Homestuck meetups and groups in Southern California. While mostly dedicated to reporting on the activity of other, seperate SoCal groups, it did host multiple meetups of its own.",
"period": "2012-2013",
"links": ["Tumblr", "https://socalstuck.tumblr.com/"],
"status": "Dead"
},
{
"img": "SanDiegoStuck.jpg",
"groupName": "SanDiegoStuck",
"location": "San Diego",
"size": "81",
"desc": "A San Diego Homestuck group that at one point hosted bi-monthly meetups. The group seems to have amassed a pretty significant following at one point and had initially formed from a meetup at a local convention. It seems as though the group eventually morphed into a general San Diego cosplay group judging by the Facebook page.",
"period": "2012-2018",
"links": ["Tumblr", "https://sandiegostuck.tumblr.com/", "Facebook", "https://www.facebook.com/groups/282144831811932/"],
"status": "Dead"
},
{
"groupName": "Orange County Homestuck Team",
"location": "Orange County",
"size": "170",
"desc": "All information on the page is wiped with only the note \"This group is now inactive. Sorry about that!\". No more information can be found.",
"period": "2011-Unknown",
"links": ["Facebook", "https://www.facebook.com/groups/208196309218508/"],
"status": "Dead"
},
{
"groupName": "SoCal Homestuck Cosplay Group",
"location": "Southern California",
"size": "236",
"desc": "The Facebook page is locked to members only. Judging by the member count, they amassed a significant following in their peak. The group is most likely dead.",
"period": "2012-Unknown",
"links": ["Facebook", "https://www.facebook.com/groups/243886025731762/"],
"status": "Unknown"
},
{
"groupName": "Southern? California Homestuck Meetup",
"location": "California",
"size": "134",
"desc": "The Facebook page is locked to members only. It can be inferred from the title and member count that this was once a thriving Homestuck group spanning Southern California and at least part of Northern California. Latest activity is unknown, but can be safely assumed to be dead.",
"period": "2012-Unknown",
"links": ["Facebook", "https://www.facebook.com/groups/383399895048609/"],
"status": "Unknown"
},
{
"img": "SouthernCaliforniaHomestucks.jpg",
"groupName": "Southern California Homestucks",
"location": "Southern California",
"size": "165",
"desc": "A Homestuck group based in Southern California that seems to have been active for a longer period of time than most. Some members do appear to be active on Facebook still, although there hasn't been any significant activity in the group since 2018.",
"period": "2013-2018",
"links": ["Facebook", "https://www.facebook.com/groups/515355595200162/"],
"status": "Dead"
}
],
"Oregon": [
{
"img": "MSPA_Logo.gif",
"groupName": "Targetstuck",
"location": "San Jose",
"size": "100",
"desc": "Lots of cool cats and hip chicks",
"period": "2010-2011",
"links": ["Instagram", "https://instagram.com/battleblockb0ss", "Google", "https://google.com", "test", "test"],
"status": "Active"
},
{
"img": "Homestuck.jpg",
"groupName": "the Simpsons",
"location": "San Jose",
"size": "100",
"desc": "Lots of cool cats and hip chicks",
"period": "2010-2011",
"links": ["Instagram", "https://instagram.com/battleblockb0ss", "Google", "https://google.com", "test", "test"],
"status": "Active"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment