MCPcopy Create free account
hub / github.com/JKPotato-Computer/SignMaker / redraw

Function redraw

js/main.js:1247–2251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1245 */
1246
1247 const redraw = function() {
1248 const postContainerElmt = document.getElementById("postContainer");
1249
1250 postContainerElmt.className = `polePosition${post.polePosition}`;
1251
1252 // post
1253
1254 if (post.showPost == true) {
1255 var item = document.getElementsByClassName("post");
1256 for (let i = 0; i < item.length; i++) {
1257 item[i].style.visibility = "hidden";
1258 }
1259
1260 const panelContainer = document.getElementById("panelContainer");
1261
1262 panelContainer.style.background = "none";
1263
1264
1265 } else {
1266 var item = document.getElementsByClassName("post");
1267 for (let i = 0; i < item.length; i++) {
1268
1269 if (post.polePosition.toLowerCase() != "overhead") {
1270 if (post.polePosition.toLowerCase() == "left") {
1271 item[0].style.visibility = "visible";
1272 item[1].style.visibility = "hidden";
1273 } else if (post.polePosition.toLowerCase() == "right") {
1274 item[0].style.visibility = "hidden";
1275 item[1].style.visibility = "visible";
1276 } else if (post.polePosition.toLowerCase() == "center" || post.polePosition.toLowerCase() == "rural") {
1277 //hide both
1278 item[0].style.visibility = "hidden";
1279 item[1].style.visibility = "hidden";
1280 }
1281
1282 } else {
1283 item[i].style.visibility = "visible";
1284 }
1285 }
1286
1287 const panelContainer = document.getElementById("panelContainer");
1288
1289 if (post.polePosition.toLowerCase() == "center") {
1290 panelContainer.style.background = "linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 45%,rgba(191,191,191,1) 45%,rgba(240,240,240,1) 49%,rgba(128,128,128,1) 55%,rgba(255,255,255,0) 55%)";
1291 } else if (post.polePosition.toLowerCase() == "rural") {
1292 panelContainer.style.background = "linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 20%,rgba(191,191,191,1) 20%,rgba(240,240,240,1) 22%,rgba(128,128,128,1) 25%,rgba(255,255,255,0) 25%,rgba(255,255,255,0) 75%,rgba(191,191,191,1) 75%,rgba(240,240,240,1) 77%,rgba(128,128,128,1) 80%,rgba(255,255,255,0) 80%)"
1293 } else {
1294 panelContainer.style.background = "linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 47%, rgba(191,191,191,1) 47%, rgba(240,240,240,1) 49%, rgba(128,128,128,1) 52%, rgba(255,255,255,0) 52%, rgba(255,255,255,0) 64%, rgba(191,191,191,1) 64%, rgba(240,240,240,1) 66%, rgba(128,128,128,1) 69%, rgba(255,255,255,0) 69%";
1295 }
1296 }
1297
1298 const panelContainerElmt = document.getElementById("panelContainer");
1299 lib.clearChildren(panelContainerElmt);
1300
1301 var index = -1;
1302 var firstExitTab = null;
1303
1304 for (const panel of post.panels) {

Callers 15

newPanelFunction · 0.70
duplicatePanelFunction · 0.70
deletePanelFunction · 0.70
shiftLeftFunction · 0.70
shiftRightFunction · 0.70
addSubPanelFunction · 0.70
removeSubPanelFunction · 0.70
duplicateSubPanelFunction · 0.70
newExitTabFunction · 0.70
newNestExitTabFunction · 0.70
duplicateExitTabFunction · 0.70
removeExitTabFunction · 0.70

Calls 4

createShieldFunction · 0.85
monitorControlTextFunction · 0.85
monitorActionMessageFunction · 0.85
createArrowElmtFunction · 0.85

Tested by

no test coverage detected