Adds helpful features to Infinite Craft.
当前为
// ==UserScript==
// @name Infinite Craft Helper - Made by ChatGPT
// @namespace https://chat.openai.com/
// @version 1.0
// @description Adds helpful features to Infinite Craft.
// @author ChatGPT
// @match https://neal.fun/infinite-craft/
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
// Add "Made by ChatGPT" attribution to the page
const chatGPTAttribution = document.createElement('div');
chatGPTAttribution.innerText = "Made by ChatGPT";
chatGPTAttribution.style.position = 'fixed';
chatGPTAttribution.style.bottom = '10px';
chatGPTAttribution.style.right = '10px';
chatGPTAttribution.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
chatGPTAttribution.style.color = 'white';
chatGPTAttribution.style.padding = '5px 10px';
chatGPTAttribution.style.borderRadius = '5px';
chatGPTAttribution.style.fontFamily = 'Arial, sans-serif';
chatGPTAttribution.style.fontSize = '12px';
chatGPTAttribution.style.zIndex = '1000';
document.body.appendChild(chatGPTAttribution);
// Example feature: Quick access to random element
const randomButton = document.createElement('button');
randomButton.innerText = 'Random Element';
randomButton.style.position = 'fixed';
randomButton.style.bottom = '50px';
randomButton.style.right = '10px';
randomButton.style.backgroundColor = '#007BFF';
randomButton.style.color = 'white';
randomButton.style.border = 'none';
randomButton.style.padding = '10px';
randomButton.style.borderRadius = '5px';
randomButton.style.cursor = 'pointer';
randomButton.style.fontFamily = 'Arial, sans-serif';
randomButton.style.fontSize = '14px';
randomButton.style.zIndex = '1000';
randomButton.addEventListener('click', () => {
alert('Random element feature coming soon!');
});
document.body.appendChild(randomButton);
// Example feature: Toggle dark mode
const toggleDarkModeButton = document.createElement('button');
toggleDarkModeButton.innerText = 'Toggle Dark Mode';
toggleDarkModeButton.style.position = 'fixed';
toggleDarkModeButton.style.bottom = '90px';
toggleDarkModeButton.style.right = '10px';
toggleDarkModeButton.style.backgroundColor = '#28A745';
toggleDarkModeButton.style.color = 'white';
toggleDarkModeButton.style.border = 'none';
toggleDarkModeButton.style.padding = '10px';
toggleDarkModeButton.style.borderRadius = '5px';
toggleDarkModeButton.style.cursor = 'pointer';
toggleDarkModeButton.style.fontFamily = 'Arial, sans-serif';
toggleDarkModeButton.style.fontSize = '14px';
toggleDarkModeButton.style.zIndex = '1000';
toggleDarkModeButton.addEventListener('click', () => {
document.body.classList.toggle('dark-mode');
});
document.body.appendChild(toggleDarkModeButton);
// Apply dark mode styles if toggled
const darkModeStyles = document.createElement('style');
darkModeStyles.innerText = `
body.dark-mode {
background-color: #121212;
color: #FFFFFF;
}
`;
document.head.appendChild(darkModeStyles);
})();