File size: 1,345 Bytes
2b3f8a2
517b743
2b3f8a2
 
 
 
 
517b743
2b3f8a2
517b743
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

document.addEventListener('DOMContentLoaded', () => {
    // Initialize feather icons
    if (feather) {
        feather.replace();
    }

    // Toggle functionality for the main switch
const toggleSwitch = document.querySelector('input[type="checkbox"]');
    if (toggleSwitch) {
        toggleSwitch.addEventListener('change', function() {
            const status = this.checked ? 'enabled' : 'disabled';
            console.log(`Item pickup ${status}`);
            // Here you would typically send this to your mod's backend
        });
    }

    // Add item buttons functionality
    const addItemButtons = document.querySelectorAll('button:has(i[data-feather="plus"])');
    addItemButtons.forEach(button => {
        button.addEventListener('click', function() {
            const listType = this.closest('div').querySelector('h3').textContent.trim();
            console.log(`Add item to ${listType}`);
            // Implement your add item logic here
        });
    });

    // Delete item buttons functionality
    const deleteButtons = document.querySelectorAll('button:has(i[data-feather="trash-2"])');
    deleteButtons.forEach(button => {
        button.addEventListener('click', function() {
            const itemName = this.closest('div').querySelector('span').textContent;
            console.log(`Remove ${itemName} from