Technological Bench: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 26: | Line 26: | ||
border-radius: 6px; | border-radius: 6px; | ||
cursor: pointer; | cursor: pointer; | ||
} | } | ||
| Line 36: | Line 31: | ||
background: linear-gradient(180deg, #1ec8ff, #0ea5e9); | background: linear-gradient(180deg, #1ec8ff, #0ea5e9); | ||
color: #001018; | 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 { | ||
background: # | margin-top: 10px; | ||
background: #0d1319; | |||
border: 1px solid #1f2a35; | border: 1px solid #1f2a35; | ||
border-radius: 10px; | border-radius: 10px; | ||
padding: 12px; | |||
} | } | ||
. | .output-title { | ||
font-weight: 700; | font-weight: 700; | ||
margin-bottom: 8px; | |||
color: #e6edf3; | 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> | ||
| Line 110: | Line 95: | ||
<div id="slot1" class="mw-tab-content active"> | <div id="slot1" class="mw-tab-content active"> | ||
<div class="dropdown"> | |||
<div class=" | <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> | |||
< | </select> | ||
</div> | </div> | ||
<div id="survivalOutput" class="output" style="display:none;"></div> | |||
<div | |||
</div> | |||
</div> | </div> | ||
| Line 158: | Line 115: | ||
<!-- ================= BUILD ================= --> | <!-- ================= BUILD ================= --> | ||
<div id="slot4" class="mw-tab-content"> | <div id="slot4" class="mw-tab-content"></div> | ||
</div> | |||
</div> | </div> | ||
| Line 167: | Line 122: | ||
/* TAB SYSTEM */ | /* TAB SYSTEM */ | ||
document.querySelectorAll('.mw-tab-btn').forEach(btn => { | document.querySelectorAll('.mw-tab-btn').forEach(btn => { | ||
btn. | btn.onclick = () => { | ||
document.querySelectorAll('.mw-tab-btn').forEach(b => b.classList.remove('active')); | document.querySelectorAll('.mw-tab-btn').forEach(b => b.classList.remove('active')); | ||
document.querySelectorAll('.mw-tab-content').forEach(c => c.classList.remove('active')); | document.querySelectorAll('.mw-tab-content').forEach(c => c.classList.remove('active')); | ||
| Line 173: | Line 128: | ||
btn.classList.add('active'); | btn.classList.add('active'); | ||
document.getElementById(btn.dataset.tab).classList.add('active'); | document.getElementById(btn.dataset.tab).classList.add('active'); | ||
} | }; | ||
}); | }); | ||
/* | /* DATA */ | ||
const survivalData = { | |||
stove: { | |||
title: "Primary Stove", | |||
lines: [ | |||
"Tech Level 1: 29 Copper Ore + 17 Gravel + 25 Wood", | |||
"Tech Level 8: 29 Copper Ore + 17 Gravel + 25 Wood", | |||
"Tech Level 12: 30 Copper Ore + 25 Gravel + 17 Wood" | |||
] | |||
}, | |||
meat: { | |||
title: "Meat Drier", | |||
lines: [ | |||
"Tech Level 1: 9 Iron Ingot + 13 Metal Scraps + 17 Wood", | |||
"Tech Level 8: 6 Iron Ingot + 8 Metal Scraps + 17 Wood", | |||
"Tech Level 12: 9 Iron Ingot + 8 Metal Scraps + 17 Wood" | |||
] | |||
}, | |||
treatment: { | |||
title: "Treatment", | |||
lines: [ | |||
"Tech Level 1: 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", | |||
"Tech Level 12: 1 Detoxident + 1 Glass + 5 Rubber + 1 Acid + 1 Boiled Water" | |||
] | |||
} | |||
}; | |||
/* DROPDOWN LOGIC */ | |||
document.getElementById("survivalSelect").onchange = function () { | |||
const val = this.value; | |||
const output = document.getElementById("survivalOutput"); | |||
if (!val) { | |||
output.style.display = "none"; | |||
} | return; | ||
}); | } | ||
} | |||
const item = survivalData[val]; | |||
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> | </html> | ||