java.js
// Updates the statistics page and then opens it
Updates the statistics page and then opens it
Updates the statistics page and then opens it
function openStatsPage() {
	roundTimeDisplay(playedseconds);
	document.getElementById("timeplayedcounter").innerHTML = `Time played: ${hoursplayed} hours ${minutesplayed} minutes and ${minutesplayedremainder} seconds`;
	document.getElementById("clickcountstat").innerHTML = `Total clicks: ${clickcount}`;
	const newsizeperclick1 = sps * clicksbonus;
	const truesizeperclick = spc + newsizeperclick1;
	addCommasToNumber(truesizeperclick);
	if (spc === 1) {document.getElementById("sizeperclickstat").innerHTML = `Size per click: ${spc} byte`;}
	else {document.getElementById("sizeperclickstat").innerHTML = `Size per click: ${newdisp}`;}
	roundSizeDisp(sizefromclicking, 'n', 1);
	const newsizefromclicks = addCommasToNumber(sizefromclicking);
	document.getElementById("sizefromclicking").innerHTML = `Size from clicking: ${newdisp}`;
	document.getElementById("sizefromclicking").title = newsizefromclicks;
	document.getElementById("upgradesboughtcount").innerHTML = `Upgrades bought: ${upgradesbought}`;
	document.getElementById("autoupgradesboughtcount").innerHTML = `Automatic upgrades bought: ${autoupgradesbought}`;
	document.getElementById("clickingupgradesboughtcount").innerHTML = `Clicking upgrades bought: ${clickupgradesbought}`;
	roundSizeDisp(spentonupgrades, 'n', 1);
	const newspentonups = addCommasToNumber(spentonupgrades);
	document.getElementById("spentonupscount").innerHTML = `Spent on upgrades: ${newdisp}`;
	document.getElementById("spentonupscount").title = newspentonups;
	roundSizeDisp(spentonautoupgrades, 'n', 1);
	const newspentonautoups = addCommasToNumber(spentonautoupgrades);
	document.getElementById("spentonautoupscount").innerHTML = `Spent on automatic upgrades: ${newdisp}`;
	document.getElementById("spentonautoupscount").title = newspentonautoups;
	roundSizeDisp(spentonclickupgrades, 'n', 1);
	const newspentonclickups = addCommasToNumber(spentonclickupgrades);
	document.getElementById("spentonclickupscount").innerHTML = `Spent on click upgrades: ${newdisp}`;
	document.getElementById("spentonclickupscount").title = newspentonclickups;
	progressBar("clickrewardbar", clickcount, clicklevelreq);
	progressBar("factoryawardbar", sps, buildawardlevelreq);
	openPage("statistics");
}
function openStatsPage ( ) { roundTimeDisplay ( playedseconds ) ; document . getElementById ( "timeplayedcounter" ) . innerHTML = ` ${ hoursplayed } ${ minutesplayed } ${ minutesplayedremainder } ` ; document . getElementById ( "clickcountstat" ) . innerHTML = ` ${ clickcount } ` ; const newsizeperclick1 = sps * clicksbonus ; const truesizeperclick = spc + newsizeperclick1 ; addCommasToNumber ( truesizeperclick ) ; if ( spc === 1 ) { document . getElementById ( "sizeperclickstat" ) . innerHTML = ` ${ spc } ` ; } else { document . getElementById ( "sizeperclickstat" ) . innerHTML = ` ${ newdisp } ` ; } roundSizeDisp ( sizefromclicking , 'n' , 1 ) ; const newsizefromclicks = addCommasToNumber ( sizefromclicking ) ; document . getElementById ( "sizefromclicking" ) . innerHTML = ` ${ newdisp } ` ; document . getElementById ( "sizefromclicking" ) . title = newsizefromclicks ; document . getElementById ( "upgradesboughtcount" ) . innerHTML = ` ${ upgradesbought } ` ; document . getElementById ( "autoupgradesboughtcount" ) . innerHTML = ` ${ autoupgradesbought } ` ; document . getElementById ( "clickingupgradesboughtcount" ) . innerHTML = ` ${ clickupgradesbought } ` ; roundSizeDisp ( spentonupgrades , 'n' , 1 ) ; const newspentonups = addCommasToNumber ( spentonupgrades ) ; document . getElementById ( "spentonupscount" ) . innerHTML = ` ${ newdisp } ` ; document . getElementById ( "spentonupscount" ) . title = newspentonups ; roundSizeDisp ( spentonautoupgrades , 'n' , 1 ) ; const newspentonautoups = addCommasToNumber ( spentonautoupgrades ) ; document . getElementById ( "spentonautoupscount" ) . innerHTML = ` ${ newdisp } ` ; document . getElementById ( "spentonautoupscount" ) . title = newspentonautoups ; roundSizeDisp ( spentonclickupgrades , 'n' , 1 ) ; const newspentonclickups = addCommasToNumber ( spentonclickupgrades ) ; document . getElementById ( "spentonclickupscount" ) . innerHTML = ` ${ newdisp } ` ; document . getElementById ( "spentonclickupscount" ) . title = newspentonclickups ; progressBar ( "clickrewardbar" , clickcount , clicklevelreq ) ; progressBar ( "factoryawardbar" , sps , buildawardlevelreq ) ; openPage ( "statistics" ) ; }
Updates the statistics page and then opens it
Updates the statistics page and then opens it
// If the size per click is 1, don't add an s to the end of the stat // update the displays // Used for creating the progress bars that are seen on the awards page