You've already forked BitBox-Web
mirror of
https://github.com/MrLyallCSIT/BitBox-Web.git
synced 2026-01-18 07:09:38 +00:00
217 lines
16 KiB
HTML
217 lines
16 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"><title>Binary Box Simulator</title><link rel="icon" type="image/png" sizes="1080x1080" href="/assets/img/Bit%20Box%20Logo.png?h=a50b3ddb5614299b0c00dd4f01bc402e"><link rel="icon" type="image/png" sizes="1080x1080" href="/assets/img/Bit%20Box%20Logo.png?h=a50b3ddb5614299b0c00dd4f01bc402e"><link rel="icon" type="image/png" sizes="1080x1080" href="/assets/img/Bit%20Box%20Logo.png?h=a50b3ddb5614299b0c00dd4f01bc402e"><link rel="icon" type="image/png" sizes="1080x1080" href="/assets/img/Bit%20Box%20Logo.png?h=a50b3ddb5614299b0c00dd4f01bc402e"><link rel="icon" type="image/png" sizes="1080x1080" href="/assets/img/Bit%20Box%20Logo.png?h=a50b3ddb5614299b0c00dd4f01bc402e"><link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css?h=f1a8fe9e98944b9d682ec5c3efac8f17"><link rel="stylesheet" href="/assets/css/styles.min.css?h=75b676c4d50a5c5715c5470a85fad960"></head><body style="background: rgb(0,0,0);color: rgb(255,255,255);--bs-body-color: #FFFFFF;--bs-body-bg: #000000;--bs-primary: #dc3545;--bs-primary-rgb: 220,53,69;--bs-secondary: #198754;--bs-secondary-rgb: 25,135,84;--bs-dark: #000000;--bs-dark-rgb: 0,0,0;border-style: none;"><script>
|
|
denary = 0
|
|
binary = ""
|
|
bit1 = false
|
|
bit2 = false
|
|
bit4 = false
|
|
bit8 = false
|
|
bit16 = false
|
|
bit32 = false
|
|
bit64 = false
|
|
bit128 = false
|
|
bit256 = false
|
|
function changeClass256(){
|
|
if (bit256){
|
|
document.getElementById("blb256").classList.add('poweredOff');
|
|
document.getElementById("blb256").classList.remove('poweredOn');
|
|
document.getElementById("swt256").classList.remove('btnActive');
|
|
bit256 = false;
|
|
denary = denary - 256;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb256").classList.add('poweredOn');
|
|
document.getElementById("blb256").classList.remove('poweredOff');
|
|
document.getElementById("swt256").classList.add('btnActive');
|
|
bit256 = true;
|
|
denary = denary + 256;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass128(){
|
|
if (bit128){
|
|
document.getElementById("blb128").classList.add('poweredOff');
|
|
document.getElementById("blb128").classList.remove('poweredOn');
|
|
document.getElementById("swt128").classList.remove('btnActive');
|
|
bit128 = false;
|
|
denary = denary - 128;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb128").classList.add('poweredOn');
|
|
document.getElementById("blb128").classList.remove('poweredOff');
|
|
document.getElementById("swt128").classList.add('btnActive');
|
|
bit128 = true;
|
|
denary = denary + 128;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass64(){
|
|
if (bit64){
|
|
document.getElementById("blb64").classList.add('poweredOff');
|
|
document.getElementById("blb64").classList.remove('poweredOn');
|
|
document.getElementById("swt64").classList.remove('btnActive');
|
|
bit64 = false;
|
|
denary = denary - 64;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb64").classList.add('poweredOn');
|
|
document.getElementById("blb64").classList.remove('poweredOff');
|
|
document.getElementById("swt64").classList.add('btnActive');
|
|
bit64 = true;
|
|
denary = denary + 64;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass32(){
|
|
if (bit32){
|
|
document.getElementById("blb32").classList.add('poweredOff');
|
|
document.getElementById("blb32").classList.remove('poweredOn');
|
|
document.getElementById("swt32").classList.remove('btnActive');
|
|
bit32 = false;
|
|
denary = denary - 32;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb32").classList.add('poweredOn');
|
|
document.getElementById("blb32").classList.remove('poweredOff');
|
|
document.getElementById("swt32").classList.add('btnActive');
|
|
bit32 = true;
|
|
denary = denary + 32;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass16(){
|
|
if (bit16){
|
|
document.getElementById("blb16").classList.add('poweredOff');
|
|
document.getElementById("blb16").classList.remove('poweredOn');
|
|
document.getElementById("swt16").classList.remove('btnActive');
|
|
bit16 = false;
|
|
denary = denary - 16;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb16").classList.add('poweredOn');
|
|
document.getElementById("blb16").classList.remove('poweredOff');
|
|
document.getElementById("swt16").classList.add('btnActive');
|
|
bit16 = true;
|
|
denary = denary + 16;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass8(){
|
|
if (bit8){
|
|
document.getElementById("blb8").classList.add('poweredOff');
|
|
document.getElementById("blb8").classList.remove('poweredOn');
|
|
document.getElementById("swt8").classList.remove('btnActive');
|
|
bit8 = false;
|
|
denary = denary - 8;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb8").classList.add('poweredOn');
|
|
document.getElementById("blb8").classList.remove('poweredOff');
|
|
document.getElementById("swt8").classList.add('btnActive');
|
|
bit8 = true;
|
|
denary = denary + 8;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass4(){
|
|
if (bit4){
|
|
document.getElementById("blb4").classList.add('poweredOff');
|
|
document.getElementById("blb4").classList.remove('poweredOn');
|
|
document.getElementById("swt4").classList.remove('btnActive');
|
|
bit4 = false;
|
|
denary = denary - 4;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb4").classList.add('poweredOn');
|
|
document.getElementById("blb4").classList.remove('poweredOff');
|
|
document.getElementById("swt4").classList.add('btnActive');
|
|
bit4 = true;
|
|
denary = denary + 4;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass2(){
|
|
if (bit2){
|
|
document.getElementById("blb2").classList.add('poweredOff');
|
|
document.getElementById("blb2").classList.remove('poweredOn');
|
|
document.getElementById("swt2").classList.remove('btnActive');
|
|
bit2 = false;
|
|
denary = denary - 2;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb2").classList.add('poweredOn');
|
|
document.getElementById("blb2").classList.remove('poweredOff');
|
|
document.getElementById("swt2").classList.add('btnActive');
|
|
bit2 = true;
|
|
denary = denary + 2;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
function changeClass1(){
|
|
if (bit1){
|
|
document.getElementById("blb1").classList.add('poweredOff');
|
|
document.getElementById("blb1").classList.remove('poweredOn');
|
|
document.getElementById("swt1").classList.remove('btnActive');
|
|
bit1 = false;
|
|
denary = denary - 1;
|
|
updateNumbers();
|
|
}else{
|
|
document.getElementById("blb1").classList.add('poweredOn');
|
|
document.getElementById("blb1").classList.remove('poweredOff');
|
|
document.getElementById("swt1").classList.add('btnActive');
|
|
bit1 = true;
|
|
denary = denary + 1;
|
|
updateNumbers();
|
|
}
|
|
}
|
|
|
|
function updateNumbers(){
|
|
binary = ""
|
|
if(bit256){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit128){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit64){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit32){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit16){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit8){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit4){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit2){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
if(bit1){
|
|
binary = binary + "1"
|
|
}else{
|
|
binary = binary + "0"
|
|
}
|
|
document.getElementById("denaryNumber").innerHTML = denary;
|
|
document.getElementById("binaryNumber").innerHTML = binary;
|
|
}
|
|
</script><!-- Start: 1 Row 2 Columns --><div class="container" style="width: 100%;margin-top: 15px;"><div class="row"><div class="col-md-6" style="width: 25%;margin: 0;margin-top: 0;"><a href="https://bitbox.mrdaviscsit.uk/"><img style="margin-top: 10px;margin-left: 10px;width: 100px;margin-bottom: 10px;" src="/assets/img/Bit%20Box%20Logo.png?h=a50b3ddb5614299b0c00dd4f01bc402e" href=""https://bitbox.mrdaviscsit.uk/""></a></div><div class="col" style="width: 45%;"></div><div class="col-md-6" style="width: 30%;"><div class="row"><div class="col"><h1 style="text-align: center;font-family: 'Seven Segment Regular';">Denary</h1></div></div><div class="row"><div class="col"><h1 id="denaryNumber" style="text-align: center;color: #10ff00;font-family: 'DSEG7 Classic Regular';">0</h1></div></div><div class="row"><div class="col"><h1 style="text-align: center;font-family: 'Seven Segment Regular';">Binary</h1></div></div><div class="row"><div class="col"><h1 id="binaryNumber" style="text-align: center;color: #10ff00;font-family: 'DSEG7 Classic Regular';">000000000</h1></div></div></div></div></div><!-- End: 1 Row 2 Columns --><!-- Start: Box Sim --><div class="container" style="width: 100%;"><div class="row"><div class="col-md-12" style="width: 11.11%;"><h1 id="blb256" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb128" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb64" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb32" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb16" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb8" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb4" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb2" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div><div class="col-md-12" style="width: 11.11%;"><h1 id="blb1" class="poweredOff" style="text-align: center;font-size: 48px;">💡<br></h1></div></div><div class="row"><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">256</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">128</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">64</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">32</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">16</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">8</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">4</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">2</h1></div><div class="col-md-12" style="width: 11.11%;"><h1 style="text-align: center;font-family: 'DSEG7 Classic Regular';">1</h1></div></div><div class="row"><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt256" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass256()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt128" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass128()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;" onclick="onclick"><button class="btn btn-primary" id="swt64" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass64()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt32" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass32()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt16" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass16()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt8" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass8()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt4" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass4()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt2" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass2()">⏼<br></button></div><div class="col-md-12" style="width: 11.11%;margin-top: 10px;text-align: center;margin-bottom: 10px;"><button class="btn btn-primary" id="swt1" type="button" style="margin-top: 10px;text-align: center;margin-bottom: 10px;font-family: 'Unicode IEC Symbols';" onclick="changeClass1()">⏼<br></button></div></div></div><!-- End: Box Sim --><footer><!-- Start: 1 Row 2 Columns --><div class="container"><div class="row" style="height: 200px;"><div class="col" style="vertical-align: bottom;position: relative;"><p style="bottom: 10px;font-family: 'Open Sans', sans-serif;margin-bottom: 0px;text-align: left;vertical-align: bottom;position: absolute;bottom: 0;left: 0;">©2022 ADCM Networks<br></p></div><div class="col" style="text-align: right;position: relative;"><a href="https://github.com/AlexanderEDavis/BitBox-Web"><img style="margin-top: 10px;margin-left: auto;width: 100px;margin-bottom: 10px;margin-right: 10px;position: absolute;bottom: 0;right: 0;" src="/assets/img/GitHub.png?h=31597ab28e4a3ee98b489abd72269457" href=""https://bitbox.mrdaviscsit.uk/""></a></div></div></div><!-- End: 1 Row 2 Columns --></footer><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"></script></body></html> |