Download script.js from Spyderi/minecraft-picky-picker-pro: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/spaces/Spyderi/minecraft-picky-picker-pro/resolve/main/script.js
- Command line
-
hf download hf://spaces/Spyderi/minecraft-picky-picker-pro/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Spyderi/minecraft-picky-picker-pro/resolve/main/script.js
1.35 kB
| 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 |