{"id":176,"date":"2026-03-06T22:58:00","date_gmt":"2026-03-06T22:58:00","guid":{"rendered":"https:\/\/www.relayed.net\/?post_type=tools&#038;p=176"},"modified":"2026-03-06T22:58:00","modified_gmt":"2026-03-06T22:58:00","slug":"share-calculator","status":"publish","type":"tools","link":"https:\/\/www.relayed.net\/?tools=share-calculator","title":{"rendered":"Share Calculator"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\n<div class=\"sc-wrap\">\n\n<div class=\"sc-title\">Share Calculator<\/div>\n\n<div class=\"sc-actions\">\n<button class=\"sc-btn\" id=\"addWriter\">Add Writer<\/button>\n<\/div>\n\n<table class=\"sc-table\" id=\"shareCalc\">\n\n<thead>\n<tr>\n<th>Share<\/th>\n<th>Name<\/th>\n<th>PERF<\/th>\n<th>MECH<\/th>\n<th>SYNC<\/th>\n<\/tr>\n<\/thead>\n\n<tbody id=\"calcBody\">\n\n<tr>\n<td>Writer 1<\/td>\n<td><input type=\"text\"><\/td>\n<td><input type=\"number\" class=\"perf\"><\/td>\n<td><input type=\"number\" class=\"mech\"><\/td>\n<td><input type=\"number\" class=\"sync\"><\/td>\n<\/tr>\n\n<tr>\n<td>Publisher<\/td>\n<td><input type=\"text\"><\/td>\n<td><input type=\"number\" class=\"perf\"><\/td>\n<td><input type=\"number\" class=\"mech\"><\/td>\n<td><input type=\"number\" class=\"sync\"><\/td>\n<\/tr>\n\n<tr>\n<td>Sub Publisher<\/td>\n<td><input type=\"text\"><\/td>\n<td><input type=\"number\" class=\"perf\"><\/td>\n<td><input type=\"number\" class=\"mech\"><\/td>\n<td><input type=\"number\" class=\"sync\"><\/td>\n<\/tr>\n\n<tr>\n<td>Publisher 2<\/td>\n<td><input type=\"text\"><\/td>\n<td><input type=\"number\" class=\"perf\"><\/td>\n<td><input type=\"number\" class=\"mech\"><\/td>\n<td><input type=\"number\" class=\"sync\"><\/td>\n<\/tr>\n\n<tr>\n<td>Sub Publisher 2<\/td>\n<td><input type=\"text\"><\/td>\n<td><input type=\"number\" class=\"perf\"><\/td>\n<td><input type=\"number\" class=\"mech\"><\/td>\n<td><input type=\"number\" class=\"sync\"><\/td>\n<\/tr>\n\n<tr id=\"totalsRow\" class=\"sc-total\">\n<td>TOTALS<\/td>\n<td><\/td>\n<td id=\"perfTotal\">0<\/td>\n<td id=\"mechTotal\">0<\/td>\n<td id=\"syncTotal\">0<\/td>\n<\/tr>\n\n<\/tbody>\n<\/table>\n\n<\/div>\n\n<style>\n\n.sc-wrap{max-width:980px;border:1px solid #e3e5e8;border-radius:12px;padding:14px;margin:16px 0}\n\n.sc-title{font-size:14px;font-weight:700;margin-bottom:10px}\n\n.sc-table{width:100%;border-collapse:collapse}\n\n.sc-table th,.sc-table td{\npadding:6px;\nborder-bottom:1px solid #eef0f2;\nfont-size:13px\n}\n\n.sc-table th{\nfont-weight:700;\ntext-align:left\n}\n\n.sc-table input{\nwidth:100%;\npadding:5px;\nborder:1px solid #cfd4da;\nborder-radius:10px;\nbackground:#131313;\ncolor:#ffffff;\nbox-sizing:border-box\n}\n\n.sc-actions{\ndisplay:flex;\ngap:8px;\nflex-wrap:wrap;\nmargin-bottom:10px\n}\n\n.sc-btn{\nappearance:none;\nborder:1px solid #cfd4da;\nbackground:#111;\ncolor:#fff;\npadding:8px 12px;\nborder-radius:10px;\ncursor:pointer;\nfont-size:13px\n}\n\n.sc-btn2{\nbackground:#fff;\ncolor:#111\n}\n\n.sc-total{\nfont-weight:700\n}\n\n.sc-good{\nbackground:#183b20;\ncolor:#9ff5a9\n}\n\n.sc-bad{\nbackground:#3a1616;\ncolor:#ff9b9b\n}\n\n<\/style>\n\n<script>\n\nlet writerCount=1;\n\nfunction inputCell(cls){\nreturn '<input type=\"number\" class=\"'+cls+'\">';\n}\n\nfunction nameCell(){\nreturn '<input type=\"text\">';\n}\n\nfunction writerBlock(num){\n\nreturn `\n<tr>\n<td>Writer ${num}<\/td>\n<td>${nameCell()}<\/td>\n<td>${inputCell('perf')}<\/td>\n<td>${inputCell('mech')}<\/td>\n<td>${inputCell('sync')}<\/td>\n<\/tr>\n\n<tr>\n<td>Publisher<\/td>\n<td>${nameCell()}<\/td>\n<td>${inputCell('perf')}<\/td>\n<td>${inputCell('mech')}<\/td>\n<td>${inputCell('sync')}<\/td>\n<\/tr>\n\n<tr>\n<td>Sub Publisher<\/td>\n<td>${nameCell()}<\/td>\n<td>${inputCell('perf')}<\/td>\n<td>${inputCell('mech')}<\/td>\n<td>${inputCell('sync')}<\/td>\n<\/tr>\n\n<tr>\n<td>Publisher 2<\/td>\n<td>${nameCell()}<\/td>\n<td>${inputCell('perf')}<\/td>\n<td>${inputCell('mech')}<\/td>\n<td>${inputCell('sync')}<\/td>\n<\/tr>\n\n<tr>\n<td>Sub Publisher 2<\/td>\n<td>${nameCell()}<\/td>\n<td>${inputCell('perf')}<\/td>\n<td>${inputCell('mech')}<\/td>\n<td>${inputCell('sync')}<\/td>\n<\/tr>\n`;\n}\n\ndocument.getElementById('addWriter').addEventListener('click',function(){\n\nwriterCount++;\n\nlet totals=document.getElementById('totalsRow');\n\ntotals.insertAdjacentHTML('beforebegin',writerBlock(writerCount));\n\nattachEvents();\n\n});\n\nfunction scCalc(){\n\nlet perf=0,mech=0,sync=0;\n\ndocument.querySelectorAll('.perf').forEach(i=>perf+=Number(i.value)||0);\ndocument.querySelectorAll('.mech').forEach(i=>mech+=Number(i.value)||0);\ndocument.querySelectorAll('.sync').forEach(i=>sync+=Number(i.value)||0);\n\ndocument.getElementById('perfTotal').innerText=perf;\ndocument.getElementById('mechTotal').innerText=mech;\ndocument.getElementById('syncTotal').innerText=sync;\n\nvalidate(perf,'perfTotal');\nvalidate(mech,'mechTotal');\nvalidate(sync,'syncTotal');\n\n}\n\nfunction validate(total,id){\n\nlet el=document.getElementById(id);\n\nif(total==100){\nel.classList.remove('sc-bad');\nel.classList.add('sc-good');\n}\nelse{\nel.classList.remove('sc-good');\nel.classList.add('sc-bad');\n}\n\n}\n\nfunction attachEvents(){\n\ndocument.querySelectorAll('#shareCalc input').forEach(i=>{\ni.removeEventListener('input',scCalc);\ni.addEventListener('input',scCalc);\n});\n\n}\n\nattachEvents();\n\n<\/script>\n\n<\/p>\n","protected":false},"author":2,"featured_media":0,"template":"","meta":{"org":"","name":"","type":"","content":""},"class_list":["post-176","tools","type-tools","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.relayed.net\/index.php?rest_route=\/wp\/v2\/tools\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.relayed.net\/index.php?rest_route=\/wp\/v2\/tools"}],"about":[{"href":"https:\/\/www.relayed.net\/index.php?rest_route=\/wp\/v2\/types\/tools"}],"author":[{"embeddable":true,"href":"https:\/\/www.relayed.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"wp:attachment":[{"href":"https:\/\/www.relayed.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}