Files
computing-box/src/styles/binary.css
Alexander Lyall ac585701a3 Fix broken code
Signed-off-by: Alexander Lyall <alex@adcm.uk>
2025-12-16 11:30:59 +00:00

298 lines
5.0 KiB
CSS

/* DSEG7ClassicRegular font */
@font-face{
font-family: "DSEG7ClassicRegular";
src:
url("/fonts/DSEG7Classic-Regular.ttf") format("truetype"),
url("/fonts/DSEG7Classic-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
}
.binary-wrap{
padding-top: 6px;
}
.topGrid{
display:grid;
grid-template-columns: 1fr 340px;
gap: 28px;
align-items:start;
}
.readout{
background: transparent;
text-align:center;
padding: 10px 10px 0;
}
.label{
letter-spacing: .18em;
font-weight: 800;
color: var(--muted);
text-transform: uppercase;
font-size: 13px;
margin-top: 10px;
}
.num{
font-family: "DSEG7ClassicRegular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-weight: 400;
color: var(--accent);
text-shadow: 0 0 18px var(--accent-dim);
}
.denary{
font-size: 72px; /* smaller */
line-height: 1.0;
margin: 6px 0 10px;
}
.binary{
font-size: 46px; /* smaller */
letter-spacing: .12em;
line-height: 1.15;
margin: 6px 0 14px;
white-space: pre-wrap;
word-break: break-word;
display:inline-block;
text-align:center;
}
.controls{
margin-top: 8px;
display:flex;
justify-content:center;
gap: 12px;
flex-wrap: wrap;
}
.controls--twoRows{
flex-direction: column;
gap: 10px;
}
.controlsRow{
display:flex;
gap: 12px;
justify-content:center;
flex-wrap: wrap;
}
.btn{
background: rgba(255,255,255,.06);
border: 1px solid rgba(255,255,255,.14);
color: #fff;
padding: 12px 14px;
border-radius: 12px;
font-weight: 800;
cursor: pointer;
min-width: 160px;
}
.btn:active{ transform: translateY(1px); }
.btn--green{
background: rgba(51,255,122,.16);
border-color: rgba(51,255,122,.45);
}
.btn--green:hover{
background: rgba(51,255,122,.22);
}
.btn--spin{
min-width: 120px;
font-size: 18px; /* bigger */
}
.divider{
margin-top: 22px;
border-top: 1px solid var(--line);
}
.panelCol{
display:flex;
flex-direction:column;
gap: 14px;
}
.card{
background: var(--panel);
border: 1px solid var(--panel-border);
border-radius: 14px;
padding: 14px;
}
.cardTitle{
letter-spacing: .18em;
font-weight: 900;
color: var(--muted);
text-transform: uppercase;
font-size: 12px;
margin: 0 0 10px;
}
.hint{
color: var(--muted);
font-size: 12px;
margin-top: 8px;
line-height: 1.35;
}
.toggleRow{
display:flex;
align-items:center;
justify-content:space-between;
gap: 10px;
}
.toggleLabel{
color: var(--text);
font-weight: 800;
font-size: 14px;
}
.switch{
position:relative;
width:56px;
height:34px;
display:inline-block;
flex:0 0 auto;
}
.switch input{
opacity:0;
width:0;
height:0;
}
.slider{
position:absolute;
inset:0;
background: rgba(255,255,255,.10);
border: 1px solid rgba(255,255,255,.14);
border-radius:999px;
transition:.18s ease;
}
.slider::before{
content:"";
position:absolute;
height:28px;
width:28px;
left:3px;
top:2px;
background: rgba(255,255,255,.92);
border-radius:50%;
transition:.18s ease;
}
.switch input:checked + .slider{
background: rgba(51,255,122,.20);
border-color: rgba(51,255,122,.55);
}
.switch input:checked + .slider::before{
transform: translateX(22px);
background: var(--accent);
}
.bitWidthRow{
display:grid;
grid-template-columns:44px 1fr 44px;
gap:10px;
align-items:center;
}
.miniBtn{
height:44px;
width:44px;
border-radius:12px;
background: rgba(255,255,255,.06);
border: 1px solid rgba(255,255,255,.14);
color:#fff;
cursor:pointer;
font-weight:900;
font-size:18px;
}
.bitInputWrap{
background: rgba(255,255,255,.06);
border: 1px solid rgba(255,255,255,.14);
border-radius:12px;
padding:10px 12px;
display:flex;
align-items:center;
justify-content:space-between;
gap:12px;
}
.bitInputLabel{
color: var(--muted);
font-size:12px;
font-weight:900;
letter-spacing:.18em;
text-transform:uppercase;
}
.bitInput{
width:86px;
text-align:right;
background: transparent;
border: none;
outline: none;
color: var(--accent);
font-family:"DSEG7ClassicRegular", ui-monospace, monospace;
font-size:28px;
}
.bitInput::-webkit-outer-spin-button,
.bitInput::-webkit-inner-spin-button{
-webkit-appearance:none;
margin:0;
}
/* Bits: wrap every 8 */
.bits{
--cols: 8;
margin-top: 26px;
padding-top: 18px;
display:grid;
grid-template-columns: repeat(var(--cols), 90px);
justify-content: center; /* centres when < 8 too */
gap: 18px;
align-items:end;
text-align:center;
}
.bit{
display:flex;
flex-direction:column;
align-items:center;
gap: 10px;
padding: 8px 4px;
}
/* Bulb emoji bigger */
.bulb{
font-size: 26px; /* bigger */
line-height: 1;
filter: grayscale(1);
opacity: .35;
transform: translateY(2px);
}
.bulb.on{
filter: grayscale(0);
opacity: 1;
text-shadow: 0 0 16px rgba(255,216,107,.55);
}
.bitVal{
font-size: 28px;
color: var(--text);
opacity: .95;
line-height: 1;
min-height: 34px;
}
@media (max-width: 980px){
.topGrid{ grid-template-columns: 1fr; }
.denary{ font-size: 62px; }
.binary{ font-size: 40px; }
}