Denary
-
0
+
0
Binary
-
00000000
+
00000000
@@ -27,25 +25,23 @@ import BaseLayout from "../layouts/BaseLayout.astro";
-
-
+
-
+
-
diff --git a/src/styles/binary.css b/src/styles/binary.css
index 6a03738..9d68932 100644
--- a/src/styles/binary.css
+++ b/src/styles/binary.css
@@ -1,68 +1,274 @@
-.binary-container {
- max-width: 1100px;
- margin: auto;
- padding: 2rem;
- color: #e0e0e0;
+:root{
+ --bg:#1f2027;
+ --panel2: rgba(255,255,255,.04);
+ --text:#e8e8ee;
+ --muted:#a9acb8;
+ --accent:#33ff7a;
+ --accent-dim: rgba(51,255,122,.15);
+ --line: rgba(255,255,255,.12);
}
-.display {
- text-align: center;
+@font-face{
+ font-family:"DSEG7ClassicRegular";
+ src:
+ url("/fonts/DSEG7Classic-Regular.woff") format("woff"),
+ url("/fonts/DSEG7Classic-Regular.ttf") format("truetype");
+ font-weight:400;
+ font-style:normal;
+ font-display:swap;
}
-.label {
- font-size: 1.2rem;
- opacity: 0.7;
+.wrap{
+ max-width:1200px;
+ margin:0 auto;
+ padding:32px 20px 60px;
}
-.number {
- font-size: 3rem;
- margin-bottom: 1rem;
- color: #00ff66;
+.topGrid{
+ display:grid;
+ grid-template-columns: 1fr 340px;
+ gap:28px;
+ align-items:start;
}
-.controls {
- margin-top: 1rem;
+.readout{
+ text-align:center;
+ padding:10px 10px 0;
}
-.controls button {
- margin: 0.25rem;
- padding: 0.6rem 1rem;
- font-size: 1rem;
+.label{
+ letter-spacing:.18em;
+ font-weight:800;
+ color:var(--muted);
+ text-transform:uppercase;
+ font-size:14px;
+ margin-top:10px;
}
-.bits {
- display: grid;
- grid-template-columns: repeat(8, 1fr);
- gap: 1rem;
- margin-top: 3rem;
+.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);
}
-.bit {
- width: 40px;
- height: 80px;
- background: #333;
- border-radius: 20px;
- position: relative;
- cursor: pointer;
+#denaryNumber{
+ font-size:84px;
+ line-height:1.0;
+ margin:6px 0 16px;
}
-.bit::after {
- content: "";
- width: 32px;
- height: 32px;
- background: #555;
- border-radius: 50%;
- position: absolute;
- bottom: 6px;
- left: 4px;
- transition: all 0.2s ease;
+#binaryNumber{
+ font-size:62px;
+ letter-spacing:.12em;
+ line-height:1.0;
+ margin:6px 0 18px;
+ word-break:break-word;
}
-.bit.on {
- background: #00c853;
+.controls{
+ margin-top:10px;
+ display:flex;
+ gap:12px;
+ justify-content:center;
+ flex-wrap:wrap;
}
-.bit.on::after {
- bottom: 42px;
- background: #eaffea;
+.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); }
+
+.divider{
+ margin-top:26px;
+ border-top:1px solid var(--line);
+}
+
+/* Right panels */
+.panelCol{ display:flex; flex-direction:column; gap:14px; }
+.card{
+ background:var(--panel2);
+ border:1px solid rgba(255,255,255,.10);
+ 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;
+}
+
+/* Toggle switch (used for Mode AND each bit) */
+.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;
+ position:absolute;
+}
+.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);
+}
+
+/* Bit width control */
+.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 grid — force rows of 8, NO horizontal scrollbar */
+.bits{
+ margin-top:26px;
+ padding-top:22px;
+ display:grid;
+ grid-template-columns: repeat(8, minmax(90px, 1fr));
+ gap:18px;
+ align-items:end;
+ text-align:center;
+}
+
+/* Each bit */
+.bit{
+ display:flex;
+ flex-direction:column;
+ align-items:center;
+ gap:10px;
+ padding:8px 4px;
+}
+
+/* 💡 bulb */
+.bulb{
+ font-size:22px;
+ line-height:1;
+ opacity:.18;
+ filter: grayscale(100%);
+ transform: translateY(2px);
+ user-select:none;
+}
+.bulb.on{
+ opacity:1;
+ filter: none;
+ text-shadow: 0 0 14px rgba(255,216,107,.55);
+}
+
+.bitVal{
+ font-family:"DSEG7ClassicRegular", ui-monospace, monospace;
+ font-size:30px;
+ color:var(--text);
+ opacity:.95;
+ line-height:1;
+ min-height:34px;
+}
+
+@media (max-width: 980px){
+ .topGrid{ grid-template-columns: 1fr; }
+ #denaryNumber{ font-size:72px; }
+ #binaryNumber{ font-size:52px; }
+ .bits{ grid-template-columns: repeat(4, minmax(90px, 1fr)); } /* still neat on phones */
+}
+
+@media (max-width: 520px){
+ #denaryNumber{ font-size:62px; }
+ #binaryNumber{ font-size:44px; }
+ .btn{ min-width:140px; }
}