Jump to content

Technological Bench: Difference between revisions

From Once Human Guide
No edit summary
No edit summary
Tag: Reverted
Line 1: Line 1:
<html>
<a href="https://ohwikiguide.com">Return to Front Page</a>
<br><br>
<div style="max-width:420px; margin:0 auto;">
<style>
<style>
/* ===== TABS ===== */
.tb-tabs { display:flex; gap:6px; margin-bottom:12px; }
.mw-tab-buttons {
.tb-tab { flex:1; padding:8px 0; font-size:13px; font-weight:500; text-align:center; border-radius:var(--border-radius-md); border:0.5px solid var(--color-border-secondary); color:var(--color-text-secondary); cursor:pointer; background:var(--color-background-secondary); }
  display: flex;
.tb-tab.active { background:var(--color-background-primary); color:var(--color-text-primary); border-color:var(--color-border-primary); }
  width: 100%;
.tb-tab:hover:not(.active) { background:var(--color-background-primary); color:var(--color-text-primary); }
  background: #0b0f14;
.tb-panel { display:none; }
  border-radius: 10px;
.tb-panel.active { display:block; }
  padding: 4px;
.tb-select { width:100%; padding:9px 10px; font-size:13px; border-radius:var(--border-radius-md); border:0.5px solid var(--color-border-secondary); background:var(--color-background-secondary); color:var(--color-text-primary); margin-bottom:10px; }
  gap: 4px;
.tb-output { background:var(--color-background-secondary); border:0.5px solid var(--color-border-tertiary); border-radius:var(--border-radius-lg); padding:12px 14px; display:none; }
}
.tb-out-title { font-size:13px; font-weight:500; color:var(--color-text-primary); margin-bottom:8px; }
 
.tb-line { font-size:12px; color:var(--color-text-secondary); padding:5px 0; border-top:0.5px solid var(--color-border-tertiary); }
.mw-tab-btn {
.tb-line:first-of-type { border-top:none; }
  flex: 1;
.tb-tier { font-size:10px; font-weight:500; color:var(--color-text-tertiary); text-transform:uppercase; letter-spacing:.04em; display:block; margin-bottom:1px; }
  text-align: center;
  padding: 10px 0;
  font-weight: 600;
  color: #cfd6df;
  background: #11161c;
  border-radius: 6px;
  cursor: pointer;
}
 
.mw-tab-btn.active {
  background: linear-gradient(180deg, #1ec8ff, #0ea5e9);
  color: #001018;
}
 
/* ===== DROPDOWN UI ===== */
.dropdown {
  width: 100%;
  margin-top: 10px;
}
 
.dropdown select {
  width: 100%;
  padding: 10px;
  background: #11161c;
  color: #e6edf3;
  border: 1px solid #1f2a35;
  border-radius: 8px;
  font-size: 14px;
}
 
/* ===== OUTPUT PANEL ===== */
.output {
  margin-top: 10px;
  background: #0d1319;
  border: 1px solid #1f2a35;
  border-radius: 10px;
  padding: 12px;
}
 
.output-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #e6edf3;
}
 
.output-line {
  font-size: 13px;
  color: #9fb0c3;
  padding: 4px 0;
  border-top: 1px solid #1a222b;
}
 
.output-line:first-of-type {
  border-top: none;
}
 
.mw-tab-content {
  display: none;
}
 
.mw-tab-content.active {
  display: block;
}
</style>
</style>


<!-- TABS -->
<h2 class="sr-only">Technological Bench — crafting recipe lookup by category and item</h2>
<div class="mw-tab-buttons">
  <div class="mw-tab-btn active" data-tab="slot1">Survival</div>
  <div class="mw-tab-btn" data-tab="slot2">Production</div>
  <div class="mw-tab-btn" data-tab="slot3">Combat</div>
  <div class="mw-tab-btn" data-tab="slot4">Build</div>
</div>
 
<!-- ================= SURVIVAL ================= -->
<div id="slot1" class="mw-tab-content active">


<div class="dropdown">
<div style="max-width:420px; padding:1rem 0;">
<select id="survivalSelect">
  <div class="tb-tabs">
  <option value="">Select Item</option>
    <div class="tb-tab active" data-tab="survival">Survival</div>
  <option value="stove">Primary Stove</option>
    <div class="tb-tab" data-tab="production">Production</div>
  <option value="meat">Meat Drier</option>
    <div class="tb-tab" data-tab="combat">Combat</div>
  <option value="treatment">Treatment</option>
    <div class="tb-tab" data-tab="build">Build</div>
</select>
  </div>
</div>


<div id="survivalOutput" class="output" style="display:none;"></div>
  <div id="survival" class="tb-panel active">
 
    <select class="tb-select" id="survivalSelect">
</div>
      <option value="">Select item</option>
 
      <option value="stove">Primary stove</option>
<!-- ================= PRODUCTION ================= -->
      <option value="meat">Meat drier</option>
<div id="slot2" class="mw-tab-content"></div>
      <option value="treatment">Treatment</option>
 
      <option value="adrenaline">Adrenaline shots</option>
<!-- ================= COMBAT ================= -->
      <option value="waterfilter">Compact water filter</option>
<div id="slot3" class="mw-tab-content"></div>
      <option value="rainwater">Rainwater collection system</option>
 
    </select>
<!-- ================= BUILD ================= -->
    <div class="tb-output" id="survivalOutput"></div>
<div id="slot4" class="mw-tab-content"></div>
  </div>


  <div id="production" class="tb-panel">
    <select class="tb-select"><option value="">Select item</option></select>
  </div>
  <div id="combat" class="tb-panel">
    <select class="tb-select"><option value="">Select item</option></select>
  </div>
  <div id="build" class="tb-panel">
    <select class="tb-select"><option value="">Select item</option></select>
  </div>
</div>
</div>


<script>
<script>
/* TAB SYSTEM */
const data = {
document.querySelectorAll('.mw-tab-btn').forEach(btn => {
  btn.onclick = () => {
    document.querySelectorAll('.mw-tab-btn').forEach(b => b.classList.remove('active'));
    document.querySelectorAll('.mw-tab-content').forEach(c => c.classList.remove('active'));
 
    btn.classList.add('active');
    document.getElementById(btn.dataset.tab).classList.add('active');
  };
});
 
/* DATA */
const survivalData = {
   stove: {
   stove: {
     title: "Primary Stove",
     title: "Primary stove",
     lines: [
     tiers: [
       "Tech Level 1: 29 Copper Ore + 17 Gravel + 25 Wood",
       { label:"Tech level 1", recipe:"29 Copper Ore · 17 Gravel · 25 Wood" },
       "Tech Level 8: 29 Copper Ore + 17 Gravel + 25 Wood",
       { label:"Tech level 8", recipe:"29 Copper Ore · 17 Gravel · 25 Wood" },
       "Tech Level 12: 30 Copper Ore + 25 Gravel + 17 Wood"
       { label:"Tech level 12", recipe:"30 Copper Ore · 25 Gravel · 17 Wood" }
     ]
     ]
   },
   },
   meat: {
   meat: {
     title: "Meat Drier",
     title: "Meat drier",
     lines: [
     tiers: [
       "Tech Level 1: 9 Iron Ingot + 13 Metal Scraps + 17 Wood",
       { label:"Tech level 1", recipe:"9 Iron Ingot · 13 Metal Scraps · 17 Wood" },
       "Tech Level 8: 6 Iron Ingot + 8 Metal Scraps + 17 Wood",
       { label:"Tech level 8", recipe:"6 Iron Ingot · 8 Metal Scraps · 17 Wood" },
       "Tech Level 12: 9 Iron Ingot + 8 Metal Scraps + 17 Wood"
       { label:"Tech level 12", recipe:"9 Iron Ingot · 8 Metal Scraps · 17 Wood" }
     ]
     ]
   },
   },
   treatment: {
   treatment: {
     title: "Treatment",
     title: "Treatment",
     lines: [
     tiers: [
       "Tech Level 1: 1 Detoxident + 1 Glass + 5 Rubber + 1 Acid + 1 Boiled Water",
       { label:"Tech level 1", recipe:"1 Detoxident · 1 Glass · 5 Rubber · 1 Acid · 1 Boiled Water" },
       "Tech Level 8: 1 Detoxident + 1 Glass + 3 Rubber + 1 Acid + 1 Boiled Water",
       { label:"Tech level 8", recipe:"1 Detoxident · 1 Glass · 3 Rubber · 1 Acid · 1 Boiled Water" },
       "Tech Level 12: 1 Detoxident + 1 Glass + 5 Rubber + 1 Acid + 1 Boiled Water"
       { label:"Tech level 12", recipe:"1 Detoxident · 1 Glass · 5 Rubber · 1 Acid · 1 Boiled Water" }
    ]
  },
  adrenaline: {
    title: "Adrenaline shots",
    tiers: [
      { label:"Tech level 1", recipe:"7 Acid · 1 Glass · 2 Rubber · 17 Stardust Source" },
      { label:"Tech level 8", recipe:"3 Acid · 1 Glass · 2 Rubber · 17 Stardust Source" },
      { label:"Tech level 12", recipe:"5 Acid · 1 Glass · 2 Rubber · 17 Stardust Source" }
    ]
  },
  waterfilter: {
    title: "Compact water filter",
    tiers: [
      { label:"Tech level 1", recipe:"41 Wood · 13 Adhesive · 17 Charcoal · 21 Iron Ingot · 1 Power Cable" },
      { label:"Tech level 8", recipe:"41 Wood · 13 Adhesive · 17 Charcoal · 21 Iron Ingot · 1 Power Cable" },
      { label:"Tech level 12", recipe:"41 Wood · 13 Adhesive · 17 Charcoal · 21 Iron Ingot · 1 Power Cable" }
    ]
  },
  rainwater: {
    title: "Rainwater collection system",
    tiers: [
      { label:"Tech level 1", recipe:"25 Wood · 13 Fiber · 5 Rubber" },
      { label:"Tech level 8", recipe:"25 Wood · 13 Fiber · 2 Rubber" },
      { label:"Tech level 12", recipe:"26 Wood · 13 Fiber · 3 Rubber" }
     ]
     ]
   }
   }
};
};


/* DROPDOWN LOGIC */
document.querySelectorAll('.tb-tab').forEach(btn => {
document.getElementById("survivalSelect").onchange = function () {
  btn.onclick = () => {
  const val = this.value;
    document.querySelectorAll('.tb-tab').forEach(b => b.classList.remove('active'));
  const output = document.getElementById("survivalOutput");
    document.querySelectorAll('.tb-panel').forEach(p => p.classList.remove('active'));
    btn.classList.add('active');
    document.getElementById(btn.dataset.tab).classList.add('active');
  };
});


   if (!val) {
document.getElementById('survivalSelect').onchange = function() {
    output.style.display = "none";
  const out = document.getElementById('survivalOutput');
    return;
  const item = data[this.value];
  }
   if (!item) { out.style.display = 'none'; return; }
 
   out.innerHTML = `<div class="tb-out-title">${item.title}</div>` +
  const item = survivalData[val];
     item.tiers.map(t => `<div class="tb-line"><span class="tb-tier">${t.label}</span>${t.recipe}</div>`).join('');
 
   out.style.display = 'block';
   output.innerHTML =
    `<div class="output-title">${item.title}</div>` +
     item.lines.map(line => `<div class="output-line">${line}</div>`).join("");
 
   output.style.display = "block";
};
};
</script>
</script>
</html>

Revision as of 16:25, 24 April 2026

<style> .tb-tabs { display:flex; gap:6px; margin-bottom:12px; } .tb-tab { flex:1; padding:8px 0; font-size:13px; font-weight:500; text-align:center; border-radius:var(--border-radius-md); border:0.5px solid var(--color-border-secondary); color:var(--color-text-secondary); cursor:pointer; background:var(--color-background-secondary); } .tb-tab.active { background:var(--color-background-primary); color:var(--color-text-primary); border-color:var(--color-border-primary); } .tb-tab:hover:not(.active) { background:var(--color-background-primary); color:var(--color-text-primary); } .tb-panel { display:none; } .tb-panel.active { display:block; } .tb-select { width:100%; padding:9px 10px; font-size:13px; border-radius:var(--border-radius-md); border:0.5px solid var(--color-border-secondary); background:var(--color-background-secondary); color:var(--color-text-primary); margin-bottom:10px; } .tb-output { background:var(--color-background-secondary); border:0.5px solid var(--color-border-tertiary); border-radius:var(--border-radius-lg); padding:12px 14px; display:none; } .tb-out-title { font-size:13px; font-weight:500; color:var(--color-text-primary); margin-bottom:8px; } .tb-line { font-size:12px; color:var(--color-text-secondary); padding:5px 0; border-top:0.5px solid var(--color-border-tertiary); } .tb-line:first-of-type { border-top:none; } .tb-tier { font-size:10px; font-weight:500; color:var(--color-text-tertiary); text-transform:uppercase; letter-spacing:.04em; display:block; margin-bottom:1px; } </style>

Technological Bench — crafting recipe lookup by category and item

Survival
Production
Combat
Build
   <select class="tb-select" id="survivalSelect">
     <option value="">Select item</option>
     <option value="stove">Primary stove</option>
     <option value="meat">Meat drier</option>
     <option value="treatment">Treatment</option>
     <option value="adrenaline">Adrenaline shots</option>
     <option value="waterfilter">Compact water filter</option>
     <option value="rainwater">Rainwater collection system</option>
   </select>
   <select class="tb-select"><option value="">Select item</option></select>
   <select class="tb-select"><option value="">Select item</option></select>
   <select class="tb-select"><option value="">Select item</option></select>

<script> const data = {

 stove: {
   title: "Primary stove",
   tiers: [
     { label:"Tech level 1", recipe:"29 Copper Ore · 17 Gravel · 25 Wood" },
     { label:"Tech level 8", recipe:"29 Copper Ore · 17 Gravel · 25 Wood" },
     { label:"Tech level 12", recipe:"30 Copper Ore · 25 Gravel · 17 Wood" }
   ]
 },
 meat: {
   title: "Meat drier",
   tiers: [
     { label:"Tech level 1", recipe:"9 Iron Ingot · 13 Metal Scraps · 17 Wood" },
     { label:"Tech level 8", recipe:"6 Iron Ingot · 8 Metal Scraps · 17 Wood" },
     { label:"Tech level 12", recipe:"9 Iron Ingot · 8 Metal Scraps · 17 Wood" }
   ]
 },
 treatment: {
   title: "Treatment",
   tiers: [
     { label:"Tech level 1", recipe:"1 Detoxident · 1 Glass · 5 Rubber · 1 Acid · 1 Boiled Water" },
     { label:"Tech level 8", recipe:"1 Detoxident · 1 Glass · 3 Rubber · 1 Acid · 1 Boiled Water" },
     { label:"Tech level 12", recipe:"1 Detoxident · 1 Glass · 5 Rubber · 1 Acid · 1 Boiled Water" }
   ]
 },
 adrenaline: {
   title: "Adrenaline shots",
   tiers: [
     { label:"Tech level 1", recipe:"7 Acid · 1 Glass · 2 Rubber · 17 Stardust Source" },
     { label:"Tech level 8", recipe:"3 Acid · 1 Glass · 2 Rubber · 17 Stardust Source" },
     { label:"Tech level 12", recipe:"5 Acid · 1 Glass · 2 Rubber · 17 Stardust Source" }
   ]
 },
 waterfilter: {
   title: "Compact water filter",
   tiers: [
     { label:"Tech level 1", recipe:"41 Wood · 13 Adhesive · 17 Charcoal · 21 Iron Ingot · 1 Power Cable" },
     { label:"Tech level 8", recipe:"41 Wood · 13 Adhesive · 17 Charcoal · 21 Iron Ingot · 1 Power Cable" },
     { label:"Tech level 12", recipe:"41 Wood · 13 Adhesive · 17 Charcoal · 21 Iron Ingot · 1 Power Cable" }
   ]
 },
 rainwater: {
   title: "Rainwater collection system",
   tiers: [
     { label:"Tech level 1", recipe:"25 Wood · 13 Fiber · 5 Rubber" },
     { label:"Tech level 8", recipe:"25 Wood · 13 Fiber · 2 Rubber" },
     { label:"Tech level 12", recipe:"26 Wood · 13 Fiber · 3 Rubber" }
   ]
 }

};

document.querySelectorAll('.tb-tab').forEach(btn => {

 btn.onclick = () => {
   document.querySelectorAll('.tb-tab').forEach(b => b.classList.remove('active'));
   document.querySelectorAll('.tb-panel').forEach(p => p.classList.remove('active'));
   btn.classList.add('active');
   document.getElementById(btn.dataset.tab).classList.add('active');
 };

});

document.getElementById('survivalSelect').onchange = function() {

 const out = document.getElementById('survivalOutput');
 const item = data[this.value];
 if (!item) { out.style.display = 'none'; return; }

out.innerHTML = `

${item.title}

` + item.tiers.map(t => `

${t.label}${t.recipe}

`).join();

 out.style.display = 'block';

}; </script>