forked from klashdevelopment/Mika
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraft-item-searcher.html
1 lines (1 loc) · 1.37 KB
/
raft-item-searcher.html
1
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Item Search</title><style>body {font-family: Arial, sans-serif;margin: 20px;}textarea, input {width: 100%;font-size: 16px;margin-bottom: 10px;padding: 5px;}ul {list-style-type: none;padding: 0;}li {padding: 5px;border-bottom: 1px solid black;}li.hidden {display: none;}</style></head><body><h1>Item Search</h1><textarea id="itemInput" rows="4" placeholder="Paste your item list here..."></textarea><button onclick="loadItems()">Load Items</button><input type="text" id="searchBox" placeholder="Search items..." oninput="filterItems()" disabled><ul id="itemList"></ul><script>function loadItems() {const rawInput = document.getElementById('itemInput').value;const items = rawInput.split(',').map(item => item.trim());const itemList = document.getElementById('itemList');itemList.innerHTML = '';items.forEach(item => {const li = document.createElement('li');li.textContent = item;itemList.appendChild(li);});document.getElementById('searchBox').disabled = false;}function filterItems() {const query = document.getElementById('searchBox').value.toLowerCase();const listItems = document.getElementById('itemList').getElementsByTagName('li');for (let li of listItems) {li.classList.toggle('hidden', !li.textContent.toLowerCase().includes(query));}}</script></body></html>