From 5f78e58e45241c40db9fcf87942fe4efe37a26ce Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Sun, 24 Aug 2025 22:36:30 +0200 Subject: [PATCH 01/36] test decoupled css --- Auto-Image.js | 1149 +++++++---------------------------------- auto-image-styles.css | 749 +++++++++++++++++++++++++++ 2 files changed, 941 insertions(+), 957 deletions(-) create mode 100644 auto-image-styles.css diff --git a/Auto-Image.js b/Auto-Image.js index b4ea565..696198b 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -3292,406 +3292,222 @@ document.head.appendChild(googleFonts) } + // Link external CSS file + const cssLink = document.createElement('link'); + cssLink.rel = 'stylesheet'; + cssLink.href = 'https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css'; + cssLink.setAttribute('data-wplace-theme', 'true'); + document.head.appendChild(cssLink); + + // Apply theme-specific dynamic styles const style = document.createElement("style") - style.setAttribute("data-wplace-theme", "true") + style.setAttribute("data-wplace-theme-dynamic", "true") style.textContent = ` - ${theme.animations.glow - ? ` - @keyframes neonGlow { - 0%, 100% { - text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor; + /* Dynamic theme-specific styles */ + ${theme.animations.glow ? ` + .wplace-header { animation: neonGlow 2s ease-in-out infinite alternate; } + .fas, .fa { filter: drop-shadow(0 0 3px currentColor); } + ` : ""} + + ${theme.animations.pixelBlink ? ` + .wplace-btn:hover:not(:disabled) { animation: pixelBlink 0.5s infinite; } + .status-error { animation: pixelBlink 0.5s infinite; } + .wplace-progress-bar::after { animation: pixelBlink 1s infinite; } + ` : ""} + + ${theme.animations.scanline ? ` + #wplace-image-bot-container::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 2px; + background: linear-gradient(90deg, transparent, ${theme.neon}, transparent); + animation: scanline 3s linear infinite; + z-index: 1; + pointer-events: none; } - 50% { - text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor; - } - }` - : "" - } - - ${theme.animations.pixelBlink - ? ` - @keyframes pixelBlink { - 0%, 50% { opacity: 1; } - 51%, 100% { opacity: 0.7; } - }` - : "" - } - - ${theme.animations.scanline - ? ` - @keyframes scanline { - 0% { transform: translateY(-100%); } - 100% { transform: translateY(400px); } - }` - : "" - } - - @keyframes pulse { - 0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); } - 70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); } - 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); } - } - @keyframes slideIn { - from { transform: translateY(-10px); opacity: 0; } - to { transform: translateY(0); opacity: 1; } - } - @keyframes shimmer { - 0% { transform: translateX(-100%); } - 100% { transform: translateX(100%); } - } + ` : ""} + /* Theme-specific container styles */ #wplace-image-bot-container { - position: fixed; - top: 20px; - left: 20px; - width: ${CONFIG.currentTheme === "Neon Retro" ? "280px" : "280px"}; - max-height: calc(100vh - 40px); background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.primary} 0%, #1a1a1a 100%)` - : theme.primary - }; + ? `linear-gradient(135deg, ${theme.primary} 0%, #1a1a1a 100%)` + : theme.primary + }; border: ${theme.borderWidth} ${theme.borderStyle} ${CONFIG.currentTheme === "Classic Autobot" ? theme.accent : theme.text}; border-radius: ${theme.borderRadius}; - padding: 0; box-shadow: ${theme.boxShadow}; - z-index: 9998; font-family: ${theme.fontFamily}; color: ${theme.text}; - animation: slideIn 0.4s ease-out; - overflow-y: auto; /* Allow scrolling for main panel */ - overflow-x: hidden; ${theme.backdropFilter ? `backdrop-filter: ${theme.backdropFilter};` : ""} - transition: all 0.3s ease; - user-select: none; ${CONFIG.currentTheme === "Neon Retro" ? "image-rendering: pixelated;" : ""} } - ${theme.animations.scanline - ? ` - #wplace-image-bot-container::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 2px; - background: linear-gradient(90deg, transparent, ${theme.neon}, transparent); - animation: scanline 3s linear infinite; - z-index: 1; - pointer-events: none; - }` - : "" - } + ${CONFIG.currentTheme === "Neon Retro" ? ` + #wplace-image-bot-container::after { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: + repeating-linear-gradient( + 0deg, + transparent, + transparent 2px, + rgba(0, 255, 65, 0.03) 2px, + rgba(0, 255, 65, 0.03) 4px + ); + pointer-events: none; + z-index: 1; + } + ` : ""} - ${CONFIG.currentTheme === "Neon Retro" - ? ` - #wplace-image-bot-container::after { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: - repeating-linear-gradient( - 0deg, - transparent, - transparent 2px, - rgba(0, 255, 65, 0.03) 2px, - rgba(0, 255, 65, 0.03) 4px - ); - pointer-events: none; - z-index: 1; - }` - : "" - } - - #wplace-image-bot-container.wplace-dragging { - transition: none; - box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 0 2px rgba(255,255,255,0.2); - transform: scale(1.02); - z-index: 9999; - } - #wplace-image-bot-container.wplace-minimized { - width: 200px; - height: auto; - overflow: hidden; - } - #wplace-image-bot-container.wplace-compact { - width: 240px; - } - - /* Stats Container */ #wplace-stats-container { - position: fixed; - top: 20px; - left: 330px; - width: ${CONFIG.currentTheme === "Neon Retro" ? "280px" : "280px"}; - max-height: calc(100vh - 40px); background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.primary} 0%, #1a1a1a 100%)` - : theme.primary - }; + ? `linear-gradient(135deg, ${theme.primary} 0%, #1a1a1a 100%)` + : theme.primary + }; border: ${theme.borderWidth} ${theme.borderStyle} ${CONFIG.currentTheme === "Classic Autobot" ? theme.accent : theme.text}; border-radius: ${theme.borderRadius}; - padding: 0; box-shadow: ${theme.boxShadow}; - z-index: 9997; font-family: ${theme.fontFamily}; color: ${theme.text}; - animation: slideIn 0.4s ease-out; - overflow-y: auto; /* Make stats panel scrollable */ ${theme.backdropFilter ? `backdrop-filter: ${theme.backdropFilter};` : ""} - transition: all 0.3s ease; - user-select: none; ${CONFIG.currentTheme === "Neon Retro" ? "image-rendering: pixelated;" : ""} } - /* FIX: Disable transition during drag to prevent lag */ - #wplace-stats-container.wplace-dragging { - transition: none; - } - .wplace-header { padding: ${CONFIG.currentTheme === "Neon Retro" ? "8px 12px" : "8px 12px"}; background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.secondary} 0%, #2a2a2a 100%)` - : theme.secondary - }; + ? `linear-gradient(135deg, ${theme.secondary} 0%, #2a2a2a 100%)` + : theme.secondary + }; color: ${theme.highlight}; font-size: ${CONFIG.currentTheme === "Neon Retro" ? "11px" : "13px"}; font-weight: ${CONFIG.currentTheme === "Neon Retro" ? "normal" : "700"}; - display: flex; - justify-content: space-between; - align-items: center; - cursor: move; - user-select: none; border-bottom: ${CONFIG.currentTheme === "Neon Retro" ? "2px" : "1px"} solid ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255,255,255,0.1)" : theme.text}; ${CONFIG.currentTheme === "Classic Autobot" ? "text-shadow: 0 1px 2px rgba(0,0,0,0.5);" : "text-transform: uppercase; letter-spacing: 1px;"} - transition: background 0.2s ease; - position: relative; - z-index: 2; - ${theme.animations.glow ? "animation: neonGlow 2s ease-in-out infinite alternate;" : ""} + font-family: ${theme.fontFamily}; } - .wplace-header-title { - display: flex; - align-items: center; - gap: ${CONFIG.currentTheme === "Neon Retro" ? "6px" : "6px"}; - } - - .wplace-header-controls { - display: flex; - gap: ${CONFIG.currentTheme === "Neon Retro" ? "6px" : "6px"}; - } + .wplace-header-title { gap: ${CONFIG.currentTheme === "Neon Retro" ? "6px" : "6px"}; } + .wplace-header-controls { gap: ${CONFIG.currentTheme === "Neon Retro" ? "6px" : "6px"}; } .wplace-header-btn { background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255,255,255,0.1)" : theme.accent}; border: ${CONFIG.currentTheme === "Neon Retro" ? `2px solid ${theme.text}` : "none"}; color: ${theme.text}; - cursor: pointer; border-radius: ${CONFIG.currentTheme === "Classic Autobot" ? "4px" : "0"}; width: ${CONFIG.currentTheme === "Classic Autobot" ? "18px" : "auto"}; height: ${CONFIG.currentTheme === "Classic Autobot" ? "18px" : "auto"}; padding: ${CONFIG.currentTheme === "Neon Retro" ? "4px 6px" : "0"}; font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "10px"}; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.2s; font-family: ${theme.fontFamily}; ${CONFIG.currentTheme === "Neon Retro" ? "image-rendering: pixelated;" : ""} } .wplace-header-btn:hover { background: ${CONFIG.currentTheme === "Classic Autobot" ? theme.accent : theme.text}; color: ${CONFIG.currentTheme === "Classic Autobot" ? theme.text : theme.primary}; - transform: ${CONFIG.currentTheme === "Classic Autobot" ? "scale(1.1)" : "none"}; ${CONFIG.currentTheme === "Neon Retro" ? `box-shadow: 0 0 10px ${theme.text};` : ""} } - .wplace-content { - padding: ${CONFIG.currentTheme === "Neon Retro" ? "12px" : "12px"}; - display: block; - position: relative; - z-index: 2; - } - .wplace-content.wplace-hidden { - display: none; - } - - .wplace-status-section { - margin-bottom: 12px; - padding: 8px; - background: rgba(255,255,255,0.03); - border-radius: ${theme.borderRadius}; - border: 1px solid rgba(255,255,255,0.1); - } - - .wplace-section { - margin-bottom: ${CONFIG.currentTheme === "Neon Retro" ? "12px" : "12px"}; - padding: 12px; - background: rgba(255,255,255,0.03); - border-radius: ${theme.borderRadius}; - border: 1px solid rgba(255,255,255,0.1); - } - - .wplace-section-title { - font-size: 11px; - font-weight: 600; - margin-bottom: 8px; - color: ${theme.highlight}; - display: flex; - align-items: center; - gap: 6px; - text-transform: uppercase; - letter-spacing: 0.5px; - } - - .wplace-controls { - display: flex; - flex-direction: column; - gap: 8px; - } - .wplace-row { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 8px; - } - .wplace-row.single { - grid-template-columns: 1fr; - } + .wplace-content { padding: ${CONFIG.currentTheme === "Neon Retro" ? "12px" : "12px"}; } + .wplace-section { border-radius: ${theme.borderRadius}; } + .wplace-section-title { color: ${theme.highlight}; } .wplace-btn { padding: ${CONFIG.currentTheme === "Neon Retro" ? "12px 8px" : "8px 12px"}; border: ${CONFIG.currentTheme === "Neon Retro" ? "2px solid" : "none"}; border-radius: ${theme.borderRadius}; font-weight: ${CONFIG.currentTheme === "Neon Retro" ? "normal" : "500"}; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; gap: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "6px"}; font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "11px"}; - transition: all 0.3s ease; - position: relative; - overflow: hidden; font-family: ${theme.fontFamily}; ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px; image-rendering: pixelated;" : ""} background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.accent} 0%, #4a4a4a 100%)` - : theme.accent - }; + ? `linear-gradient(135deg, ${theme.accent} 0%, #4a4a4a 100%)` + : theme.accent + }; ${CONFIG.currentTheme === "Classic Autobot" ? "border: 1px solid rgba(255,255,255,0.1);" : ""} } - ${CONFIG.currentTheme === "Classic Autobot" - ? ` - .wplace-btn::before { - content: ''; - position: absolute; - top: 0; - left: -100%; - width: 100%; - height: 100%; - background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); - transition: left 0.5s ease; - } - .wplace-btn:hover:not(:disabled)::before { - left: 100%; - }` - : ` - .wplace-btn::before { - content: ''; - position: absolute; - top: 0; - left: -100%; - width: 100%; - height: 100%; - background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); - transition: left 0.5s; - } - .wplace-btn:hover::before { - left: 100%; - }` - } - - .wplace-btn:hover:not(:disabled) { - transform: ${CONFIG.currentTheme === "Classic Autobot" ? "translateY(-1px)" : "none"}; - box-shadow: ${CONFIG.currentTheme === "Classic Autobot" ? "0 4px 12px rgba(0,0,0,0.4)" : "0 0 15px currentColor" - }; - ${theme.animations.pixelBlink ? "animation: pixelBlink 0.5s infinite;" : ""} - } - .wplace-btn:active:not(:disabled) { - transform: translateY(0); - } + ${CONFIG.currentTheme === "Classic Autobot" ? ` + .wplace-btn::before { + background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); + transition: left 0.5s ease; + } + .wplace-btn:hover:not(:disabled)::before { left: 100%; } + .wplace-btn:hover:not(:disabled) { + transform: translateY(-1px); + box-shadow: 0 4px 12px rgba(0,0,0,0.4); + } + ` : ` + .wplace-btn:hover:not(:disabled) { box-shadow: 0 0 15px currentColor; } + `} .wplace-btn-primary { background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.accent} 0%, #6a5acd 100%)` - : theme.accent - }; + ? `linear-gradient(135deg, ${theme.accent} 0%, #6a5acd 100%)` + : theme.accent + }; color: ${theme.text}; ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.text};` : ""} } + .wplace-btn-upload { background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.secondary} 0%, #4a4a4a 100%)` - : theme.purple - }; + ? `linear-gradient(135deg, ${theme.secondary} 0%, #4a4a4a 100%)` + : theme.purple + }; color: ${theme.text}; ${CONFIG.currentTheme === "Classic Autobot" - ? `border: 1px dashed ${theme.highlight};` - : `border-color: ${theme.text}; border-style: dashed;` - } + ? `border: 1px dashed ${theme.highlight};` + : `border-color: ${theme.text}; border-style: dashed;` + } } + .wplace-btn-start { background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.success} 0%, #228b22 100%)` - : theme.success - }; + ? `linear-gradient(135deg, ${theme.success} 0%, #228b22 100%)` + : theme.success + }; color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.primary}; ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.success};` : ""} } + .wplace-btn-stop { background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.error} 0%, #dc143c 100%)` - : theme.error - }; + ? `linear-gradient(135deg, ${theme.error} 0%, #dc143c 100%)` + : theme.error + }; color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.text}; ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.error};` : ""} } + .wplace-btn-select { background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.highlight} 0%, #9370db 100%)` - : theme.highlight - }; + ? `linear-gradient(135deg, ${theme.highlight} 0%, #9370db 100%)` + : theme.highlight + }; color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.primary}; ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.highlight};` : ""} } + .wplace-btn-file { background: ${CONFIG.currentTheme === "Classic Autobot" - ? "linear-gradient(135deg, #ff8c00 0%, #ff7f50 100%)" - : theme.warning - }; + ? "linear-gradient(135deg, #ff8c00 0%, #ff7f50 100%)" + : theme.warning + }; color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.primary}; ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.warning};` : ""} } - .wplace-btn:disabled { - opacity: ${CONFIG.currentTheme === "Classic Autobot" ? "0.5" : "0.3"}; - cursor: not-allowed; - transform: none !important; - ${theme.animations.pixelBlink ? "animation: none !important;" : ""} - box-shadow: none !important; - } - .wplace-btn:disabled::before { - display: none; - } - - .wplace-btn-overlay.active { - background: linear-gradient(135deg, #29b6f6 0%, #8e2de2 100%); - box-shadow: 0 0 15px #8e2de2; - } + + .wplace-btn:disabled { opacity: ${CONFIG.currentTheme === "Classic Autobot" ? "0.5" : "0.3"}; } .wplace-stats { background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255,255,255,0.03)" : theme.secondary}; @@ -3703,132 +3519,68 @@ } .wplace-stat-item { - display: flex; - justify-content: space-between; padding: ${CONFIG.currentTheme === "Neon Retro" ? "6px 0" : "4px 0"}; font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "11px"}; - border-bottom: 1px solid rgba(255,255,255,0.05); ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px;" : ""} } - .wplace-stat-item:last-child { - border-bottom: none; - } - .wplace-stat-label { - display: flex; - align-items: center; - gap: 6px; - opacity: 0.9; - font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "10px"}; - } - .wplace-stat-value { - font-weight: 600; - color: ${theme.highlight}; - } - - .wplace-colors-section { - margin-top: 10px; - padding-top: 8px; - border-top: 1px solid rgba(255,255,255,0.05); - } - - .wplace-stat-colors-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); - gap: 4px; - margin-top: 8px; - padding: 4px; - background: rgba(0,0,0,0.2); - border-radius: 4px; - max-height: 80px; /* Limit height and allow scrolling */ - overflow-y: auto; - } - - .wplace-stat-color-swatch { - width: 16px; - height: 16px; - border-radius: 3px; - border: 1px solid rgba(255,255,255,0.1); - box-shadow: inset 0 0 2px rgba(0,0,0,0.5); - } + .wplace-stat-label { font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "10px"}; } + .wplace-stat-value { color: ${theme.highlight}; } .wplace-progress { - width: 100%; background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(0,0,0,0.3)" : theme.secondary}; border: ${CONFIG.currentTheme === "Neon Retro" ? `2px solid ${theme.text}` : "1px solid rgba(255,255,255,0.1)"}; border-radius: ${theme.borderRadius}; margin: ${CONFIG.currentTheme === "Neon Retro" ? "10px 0" : "8px 0"}; - overflow: hidden; height: ${CONFIG.currentTheme === "Neon Retro" ? "16px" : "6px"}; - position: relative; } - ${CONFIG.currentTheme === "Neon Retro" - ? ` - .wplace-progress::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: - repeating-linear-gradient( - 45deg, - transparent, - transparent 2px, - rgba(0, 255, 65, 0.1) 2px, - rgba(0, 255, 65, 0.1) 4px - ); - pointer-events: none; - }` - : "" - } + ${CONFIG.currentTheme === "Neon Retro" ? ` + .wplace-progress::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: + repeating-linear-gradient( + 45deg, + transparent, + transparent 2px, + rgba(0, 255, 65, 0.1) 2px, + rgba(0, 255, 65, 0.1) 4px + ); + pointer-events: none; + } + ` : ""} .wplace-progress-bar { height: ${CONFIG.currentTheme === "Neon Retro" ? "100%" : "6px"}; background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.highlight} 0%, #9370db 100%)` - : `linear-gradient(90deg, ${theme.success}, ${theme.neon})` - }; + ? `linear-gradient(135deg, ${theme.highlight} 0%, #9370db 100%)` + : `linear-gradient(90deg, ${theme.success}, ${theme.neon})` + }; transition: width ${CONFIG.currentTheme === "Neon Retro" ? "0.3s" : "0.5s"} ease; - position: relative; ${CONFIG.currentTheme === "Neon Retro" ? `box-shadow: 0 0 10px ${theme.success};` : ""} } - ${CONFIG.currentTheme === "Classic Autobot" - ? ` - .wplace-progress-bar::after { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); - animation: shimmer 2s infinite; - }` - : ` - .wplace-progress-bar::after { - content: ''; - position: absolute; - top: 0; - right: 0; - width: 4px; - height: 100%; - background: ${theme.text}; - animation: pixelBlink 1s infinite; - }` - } + ${CONFIG.currentTheme === "Classic Autobot" ? ` + .wplace-progress-bar::after { + background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); + animation: shimmer 2s infinite; + } + ` : ` + .wplace-progress-bar::after { + background: ${theme.text}; + } + `} .wplace-status { padding: ${CONFIG.currentTheme === "Neon Retro" ? "10px" : "6px"}; border: ${CONFIG.currentTheme === "Neon Retro" ? "2px solid" : "1px solid"}; border-radius: ${theme.borderRadius}; - text-align: center; font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "11px"}; ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px;" : ""} - position: relative; - overflow: hidden; } .status-default { @@ -3847,7 +3599,6 @@ border-color: ${theme.error}; color: ${CONFIG.currentTheme === "Classic Autobot" ? theme.error : theme.text}; box-shadow: 0 0 15px ${theme.error}; - ${theme.animations.pixelBlink ? "animation: pixelBlink 0.5s infinite;" : ""} } .status-warning { background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255, 165, 0, 0.1)" : theme.warning}; @@ -3856,71 +3607,17 @@ box-shadow: 0 0 15px ${theme.warning}; } + /* Settings and other dynamic elements */ .resize-container { - display: none; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); background: ${theme.primary}; - padding: 20px; border: ${theme.borderWidth} ${theme.borderStyle} ${theme.text}; border-radius: ${theme.borderRadius}; - z-index: 10000; - box-shadow: ${CONFIG.currentTheme === "Classic Autobot" ? "0 0 20px rgba(0,0,0,0.5)" : "0 0 30px rgba(0, 255, 65, 0.5)" - }; - width: 90%; - max-width: 700px; - max-height: 90%; - overflow: auto; + box-shadow: ${CONFIG.currentTheme === "Classic Autobot" ? "0 0 20px rgba(0,0,0,0.5)" : "0 0 30px rgba(0, 255, 65, 0.5)"}; font-family: ${theme.fontFamily}; } - .resize-preview-wrapper { - display: flex; - justify-content: center; - align-items: center; - border: 1px solid ${theme.accent}; - background: rgba(0,0,0,0.2); - margin: 15px 0; - height: 300px; - overflow: hidden; - } - - .resize-canvas-stack { position: relative; transform-origin: center center; display: inline-block; } - .resize-base-canvas, .resize-mask-canvas { - position: absolute; left: 0; top: 0; - image-rendering: pixelated; - image-rendering: -moz-crisp-edges; - image-rendering: crisp-edges; - } - .resize-mask-canvas { pointer-events: auto; } - .resize-tools { display:flex; gap:8px; align-items:center; margin-top:8px; font-size:12px; } - .resize-tools button { padding:6px 10px; border-radius:6px; border:1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); color:#fff; cursor:pointer; } - .wplace-btn.active, - .wplace-btn[aria-pressed="true"] { - background: ${theme.highlight} !important; - color: ${theme.primary} !important; - border-color: ${theme.text} !important; - box-shadow: 0 0 8px rgba(0,0,0,0.25) inset, 0 0 6px rgba(0,0,0,0.2) !important; - } - .wplace-btn.active i, - .wplace-btn[aria-pressed="true"] i { filter: drop-shadow(0 0 3px ${theme.primary}); } - .mask-mode-group .wplace-btn.active, - .mask-mode-group .wplace-btn[aria-pressed="true"] { - background: ${theme.highlight}; - color: ${theme.primary}; - border-color: ${theme.text}; - box-shadow: 0 0 8px rgba(0,0,0,0.25) inset, 0 0 6px rgba(0,0,0,0.2); - } - - .resize-controls { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 15px; - align-items: center; - } - + .resize-preview-wrapper { border: 1px solid ${theme.accent}; } + .resize-controls label { font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "12px"}; ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px;" : ""} @@ -3928,517 +3625,55 @@ } .resize-slider { - width: 100%; height: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "4px"}; background: ${CONFIG.currentTheme === "Classic Autobot" ? "#ccc" : theme.secondary}; border: ${CONFIG.currentTheme === "Neon Retro" ? `2px solid ${theme.text}` : "none"}; border-radius: ${theme.borderRadius}; - outline: none; - -webkit-appearance: none; } - ${CONFIG.currentTheme === "Neon Retro" - ? ` - .resize-slider::-webkit-slider-thumb { - -webkit-appearance: none; - width: 16px; - height: 16px; - background: ${theme.highlight}; - border: 2px solid ${theme.text}; - border-radius: 0; - cursor: pointer; - box-shadow: 0 0 5px ${theme.highlight}; - } + ${CONFIG.currentTheme === "Neon Retro" ? ` + .resize-slider::-webkit-slider-thumb { + width: 16px; + height: 16px; + background: ${theme.highlight}; + border: 2px solid ${theme.text}; + border-radius: 0; + box-shadow: 0 0 5px ${theme.highlight}; + } - .resize-slider::-moz-range-thumb { - width: 16px; - height: 16px; - background: ${theme.highlight}; - border: 2px solid ${theme.text}; - border-radius: 0; - cursor: pointer; - box-shadow: 0 0 5px ${theme.highlight}; - }` - : "" + .resize-slider::-moz-range-thumb { + width: 16px; + height: 16px; + background: ${theme.highlight}; + border: 2px solid ${theme.text}; + border-radius: 0; + box-shadow: 0 0 5px ${theme.highlight}; + } + ` : ""} + + .wplace-slider::-webkit-slider-thumb { background: ${theme.highlight}; } + + ${CONFIG.currentTheme === "Neon Retro" ? ` + input[type="checkbox"] { + width: 16px; + height: 16px; + border: 2px solid ${theme.text}; + background: ${theme.secondary}; + } + input[type="checkbox"]:checked { background: ${theme.success}; } + input[type="checkbox"]:checked::after { color: ${theme.primary}; } + ` : ""} + + /* Additional theme-specific styles */ + .wplace-btn.active, + .wplace-btn[aria-pressed="true"] { + background: ${theme.highlight} !important; + color: ${theme.primary} !important; + border-color: ${theme.text} !important; } - .resize-zoom-controls { - grid-column: 1 / -1; - display: flex; - align-items: center; - gap: 10px; - margin-top: 15px; - } - - .resize-buttons { - display: flex; - gap: 10px; - justify-content: center; - margin-top: 20px; - } - - .resize-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.8); - z-index: 9999; - display: none; - } - .wplace-color-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); - gap: 10px; - padding-top: 8px; - max-height: 300px; - overflow-y: auto; - } - .wplace-color-item { - display: flex; - flex-direction: column; - align-items: center; - gap: 4px; - } - .wplace-color-item-name { - font-size: 9px; - color: #ccc; - text-align: center; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - width: 100%; - } - .wplace-color-swatch { - width: 22px; - height: 22px; - border: 1px solid rgba(255,255,255,0.2); - border-radius: 4px; - cursor: pointer; - transition: transform 0.1s ease, box-shadow 0.2s ease; - position: relative; - margin: 0 auto; - } - .wplace-color-swatch.unavailable { - border-color: #666; - border-style: dashed; - cursor: not-allowed; - } - .wplace-color-swatch:hover { - transform: scale(1.1); - z-index: 1; - } - .wplace-color-swatch:not(.active) { - opacity: 0.3; - filter: grayscale(80%); - } - .wplace-color-swatch.unavailable:not(.active) { - opacity: 0.2; - filter: grayscale(90%); - } - .wplace-color-swatch.active::after { - content: '✔'; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - color: white; - font-size: 12px; - font-weight: bold; - text-shadow: 0 0 3px black; - } - .wplace-color-divider { - border: none; - height: 1px; - background: rgba(255,255,255,0.1); - margin: 8px 0; - } - - .wplace-cooldown-control { - margin-top: 8px; - } - .wplace-cooldown-control label { - font-size: 11px; - margin-bottom: 4px; - display: block; - } - .wplace-slider-container { - display: flex; - align-items: center; - gap: 8px; - } - .wplace-slider { - flex: 1; - -webkit-appearance: none; - appearance: none; - height: 4px; - background: #444; - border-radius: 2px; - outline: none; - } - .wplace-slider::-webkit-slider-thumb { - -webkit-appearance: none; - width: 14px; - height: 14px; - background: ${theme.highlight}; - border-radius: 50%; - cursor: pointer; - } - - - ${CONFIG.currentTheme === "Neon Retro" - ? ` - input[type="checkbox"] { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - width: 16px; - height: 16px; - border: 2px solid ${theme.text}; - background: ${theme.secondary}; - margin-right: 8px; - position: relative; - cursor: pointer; - } - - input[type="checkbox"]:checked { - background: ${theme.success}; - } - - input[type="checkbox"]:checked::after { - content: '✓'; - position: absolute; - top: -2px; - left: 1px; - color: ${theme.primary}; - font-size: 12px; - font-weight: bold; - } - - .fas, .fa { - filter: drop-shadow(0 0 3px currentColor); - } - - .wplace-speed-control { - margin-top: 12px; - padding: 12px; - background: ${theme.secondary}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.accent}; - border-radius: ${theme.borderRadius}; - backdrop-filter: ${theme.backdropFilter}; - } - - .wplace-speed-label { - display: flex; - align-items: center; - margin-bottom: 8px; - color: ${theme.text}; - font-size: 13px; - font-weight: 600; - } - - .wplace-speed-label i { - margin-right: 6px; - color: ${theme.highlight}; - } - - .wplace-speed-slider-container { - display: flex; - align-items: center; - gap: 12px; - } - - .wplace-speed-slider { - flex: 1; - height: 6px; - border-radius: 3px; - background: ${theme.primary}; - outline: none; - cursor: pointer; - -webkit-appearance: none; - appearance: none; - } - - .wplace-speed-slider::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - width: 18px; - height: 18px; - border-radius: 50%; - background: ${theme.highlight}; - cursor: pointer; - border: 2px solid ${theme.text}; - box-shadow: ${theme.boxShadow}; - } - - .wplace-speed-slider::-moz-range-thumb { - width: 18px; - height: 18px; - border-radius: 50%; - background: ${theme.highlight}; - cursor: pointer; - border: 2px solid ${theme.text}; - box-shadow: ${theme.boxShadow}; - } - - .wplace-speed-display { - display: flex; - align-items: center; - gap: 4px; - min-width: 90px; - justify-content: flex-end; - } - - #speedValue { - color: ${theme.highlight}; - font-weight: 600; - font-size: 14px; - } - - .wplace-speed-unit { - color: ${theme.text}; - font-size: 11px; - opacity: 0.8; - } - - #wplace-settings-container { - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 10001; - min-width: 400px; - max-width: 500px; - background: ${theme.primary}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.accent}; - border-radius: ${theme.borderRadius}; - box-shadow: ${theme.boxShadow}; - backdrop-filter: ${theme.backdropFilter}; - } - - .wplace-settings { - padding: 16px; - max-height: 400px; - overflow-y: auto; - } - - .wplace-setting-section { - margin-bottom: 20px; - padding: 12px; - background: ${theme.secondary}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.accent}; - border-radius: ${theme.borderRadius}; - } - - .wplace-setting-title { - display: flex; - align-items: center; - margin-bottom: 12px; - color: ${theme.text}; - font-size: 14px; - font-weight: 600; - } - - .wplace-setting-title i { - margin-right: 8px; - color: ${theme.highlight}; - } - - .wplace-setting-content { - color: ${theme.text}; - } - - .wplace-section { - margin-bottom: 20px; - padding: 15px; - background: ${theme.secondary}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.accent}; - border-radius: ${theme.borderRadius}; - } - - .wplace-section-title { - display: flex; - align-items: center; - margin-bottom: 15px; - color: ${theme.text}; - font-size: 14px; - font-weight: 600; - } - - .wplace-section-title i { - margin-right: 8px; - color: ${theme.highlight}; - } - - .wplace-speed-container { - display: flex; - align-items: center; - gap: 15px; - margin-bottom: 10px; - } - - .wplace-slider { - flex: 1; - height: 6px; - background: ${theme.accent}; - border-radius: 3px; - outline: none; - -webkit-appearance: none; - } - - .wplace-slider::-webkit-slider-thumb { - -webkit-appearance: none; - width: 18px; - height: 18px; - background: ${theme.highlight}; - border-radius: 50%; - cursor: pointer; - border: 2px solid ${theme.primary}; - } - - .wplace-speed-display { - background: ${theme.accent}; - padding: 5px 10px; - border-radius: 4px; - color: ${theme.text}; - font-weight: 600; - min-width: 80px; - text-align: center; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.highlight}; - } - - .wplace-select { - width: 100%; - padding: 8px 12px; - background: ${theme.secondary}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.accent}; - border-radius: ${theme.borderRadius}; - color: ${theme.text}; - font-size: 14px; - margin-bottom: 10px; - } - - .wplace-select:focus { - outline: none; - border-color: ${theme.highlight}; - } - - .wplace-description { - color: ${theme.text}; - font-size: 12px; - opacity: 0.8; - line-height: 1.4; - } - - .wplace-theme-custom { - margin-top: 15px; - padding: 15px; - background: ${theme.accent}; - border-radius: ${theme.borderRadius}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.highlight}; - } - - .wplace-custom-group { - margin-bottom: 15px; - } - - .wplace-custom-label { - display: flex; - align-items: center; - margin-bottom: 8px; - color: ${theme.text}; - font-size: 13px; - font-weight: 600; - } - - .wplace-custom-label i { - margin-right: 8px; - color: ${theme.highlight}; - width: 16px; - } - - .wplace-color-input-group { - display: flex; - gap: 8px; - align-items: center; - } - - .wplace-color-input { - width: 50px; - height: 30px; - border: none; - border-radius: 4px; - cursor: pointer; - background: transparent; - } - - .wplace-color-text { - flex: 1; - padding: 6px 10px; - background: ${theme.secondary}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.accent}; - border-radius: 4px; - color: ${theme.text}; - font-size: 12px; - font-family: monospace; - } - - .wplace-animation-controls { - display: flex; - flex-direction: column; - gap: 8px; - } - - .wplace-checkbox-label { - display: flex; - align-items: center; - gap: 8px; - color: ${theme.text}; - font-size: 12px; - cursor: pointer; - } - - .wplace-checkbox-label input[type="checkbox"] { - accent-color: ${theme.highlight}; - } - - .wplace-slider-container { - display: flex; - align-items: center; - gap: 10px; - } - - .wplace-slider-container .wplace-slider { - flex: 1; - } - - .wplace-slider-container span { - color: ${theme.text}; - font-size: 12px; - font-weight: 600; - min-width: 40px; - } - - .wplace-custom-actions { - display: flex; - gap: 10px; - margin-top: 20px; - border-top: 1px solid ${theme.accent}; - padding-top: 15px; - } - - .wplace-btn-secondary { - background: ${theme.accent}; - color: ${theme.text}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.highlight}; - } - - .wplace-btn-secondary:hover { - background: ${theme.secondary}; - }` - : "" - } + .wplace-btn.active i, + .wplace-btn[aria-pressed="true"] i { filter: drop-shadow(0 0 3px ${theme.primary}); } ` document.head.appendChild(style) diff --git a/auto-image-styles.css b/auto-image-styles.css new file mode 100644 index 0000000..5ac4a82 --- /dev/null +++ b/auto-image-styles.css @@ -0,0 +1,749 @@ +/* WPlace Auto-Image Bot Styles */ + +/* Animations */ +@keyframes neonGlow { + 0%, 100% { + text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor; + } + 50% { + text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor; + } +} + +@keyframes pixelBlink { + 0%, 50% { opacity: 1; } + 51%, 100% { opacity: 0.7; } +} + +@keyframes scanline { + 0% { transform: translateY(-100%); } + 100% { transform: translateY(400px); } +} + +@keyframes pulse { + 0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); } + 70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); } + 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); } +} + +@keyframes slideIn { + from { transform: translateY(-10px); opacity: 0; } + to { transform: translateY(0); opacity: 1; } +} + +@keyframes shimmer { + 0% { transform: translateX(-100%); } + 100% { transform: translateX(100%); } +} + +@keyframes slideDown { + from { transform: translateX(-50%) translateY(-20px); opacity: 0; } + to { transform: translateX(-50%) translateY(0); opacity: 1; } +} + +/* Main containers - will be dynamically styled based on theme */ +#wplace-image-bot-container { + position: fixed; + top: 20px; + left: 20px; + width: 280px; + max-height: calc(100vh - 40px); + padding: 0; + z-index: 9998; + animation: slideIn 0.4s ease-out; + overflow-y: auto; + overflow-x: hidden; + transition: all 0.3s ease; + user-select: none; +} + +#wplace-image-bot-container.wplace-dragging { + transition: none; + box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 0 2px rgba(255,255,255,0.2); + transform: scale(1.02); + z-index: 9999; +} + +#wplace-image-bot-container.wplace-minimized { + width: 200px; + height: auto; + overflow: hidden; +} + +#wplace-image-bot-container.wplace-compact { + width: 240px; +} + +/* Stats Container */ +#wplace-stats-container { + position: fixed; + top: 20px; + left: 330px; + width: 280px; + max-height: calc(100vh - 40px); + padding: 0; + z-index: 9997; + animation: slideIn 0.4s ease-out; + overflow-y: auto; + transition: all 0.3s ease; + user-select: none; +} + +#wplace-stats-container.wplace-dragging { + transition: none; +} + +/* Header styles */ +.wplace-header { + display: flex; + justify-content: space-between; + align-items: center; + cursor: move; + user-select: none; + transition: background 0.2s ease; + position: relative; + z-index: 2; +} + +.wplace-header-title { + display: flex; + align-items: center; +} + +.wplace-header-controls { + display: flex; +} + +.wplace-header-btn { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.2s; +} + +.wplace-header-btn:hover { + transform: scale(1.1); +} + +/* Content areas */ +.wplace-content { + display: block; + position: relative; + z-index: 2; +} + +.wplace-content.wplace-hidden { + display: none; +} + +.wplace-status-section { + margin-bottom: 12px; + padding: 8px; + background: rgba(255,255,255,0.03); + border: 1px solid rgba(255,255,255,0.1); +} + +.wplace-section { + margin-bottom: 12px; + padding: 12px; + background: rgba(255,255,255,0.03); + border: 1px solid rgba(255,255,255,0.1); +} + +.wplace-section-title { + font-size: 11px; + font-weight: 600; + margin-bottom: 8px; + display: flex; + align-items: center; + gap: 6px; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +/* Controls and buttons */ +.wplace-controls { + display: flex; + flex-direction: column; + gap: 8px; +} + +.wplace-row { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 8px; +} + +.wplace-row.single { + grid-template-columns: 1fr; +} + +.wplace-btn { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.3s ease; + position: relative; + overflow: hidden; +} + +.wplace-btn::before { + content: ''; + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); + transition: left 0.5s; +} + +.wplace-btn:hover::before { + left: 100%; +} + +.wplace-btn:hover:not(:disabled) { + box-shadow: 0 0 15px currentColor; +} + +.wplace-btn:active:not(:disabled) { + transform: translateY(0); +} + +.wplace-btn:disabled { + opacity: 0.3; + cursor: not-allowed; + transform: none !important; + box-shadow: none !important; +} + +.wplace-btn:disabled::before { + display: none; +} + +.wplace-btn-overlay.active { + background: linear-gradient(135deg, #29b6f6 0%, #8e2de2 100%); + box-shadow: 0 0 15px #8e2de2; +} + +/* Stats display */ +.wplace-stats { + margin-bottom: 8px; +} + +.wplace-stat-item { + display: flex; + justify-content: space-between; + border-bottom: 1px solid rgba(255,255,255,0.05); +} + +.wplace-stat-item:last-child { + border-bottom: none; +} + +.wplace-stat-label { + display: flex; + align-items: center; + gap: 6px; + opacity: 0.9; +} + +.wplace-stat-value { + font-weight: 600; +} + +.wplace-colors-section { + margin-top: 10px; + padding-top: 8px; + border-top: 1px solid rgba(255,255,255,0.05); +} + +.wplace-stat-colors-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); + gap: 4px; + margin-top: 8px; + padding: 4px; + background: rgba(0,0,0,0.2); + border-radius: 4px; + max-height: 80px; + overflow-y: auto; +} + +.wplace-stat-color-swatch { + width: 16px; + height: 16px; + border-radius: 3px; + border: 1px solid rgba(255,255,255,0.1); + box-shadow: inset 0 0 2px rgba(0,0,0,0.5); +} + +/* Progress bars */ +.wplace-progress { + width: 100%; + overflow: hidden; + position: relative; +} + +.wplace-progress-bar { + position: relative; + transition: width 0.5s ease; +} + +/* Status indicators */ +.wplace-status { + text-align: center; + position: relative; + overflow: hidden; +} + +.status-default { + background: rgba(255,255,255,0.1); +} + +.status-success { + background: rgba(0, 255, 0, 0.1); + box-shadow: 0 0 15px currentColor; +} + +.status-error { + background: rgba(255, 0, 0, 0.1); + box-shadow: 0 0 15px currentColor; +} + +.status-warning { + background: rgba(255, 165, 0, 0.1); + box-shadow: 0 0 15px currentColor; +} + +/* Resize container */ +.resize-container { + display: none; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10000; + width: 90%; + max-width: 700px; + max-height: 90%; + overflow: auto; +} + +.resize-preview-wrapper { + display: flex; + justify-content: center; + align-items: center; + background: rgba(0,0,0,0.2); + margin: 15px 0; + height: 300px; + overflow: hidden; +} + +.resize-canvas-stack { + position: relative; + transform-origin: center center; + display: inline-block; +} + +.resize-base-canvas, .resize-mask-canvas { + position: absolute; + left: 0; + top: 0; + image-rendering: pixelated; + image-rendering: -moz-crisp-edges; + image-rendering: crisp-edges; +} + +.resize-mask-canvas { + pointer-events: auto; +} + +.resize-tools { + display: flex; + gap: 8px; + align-items: center; + margin-top: 8px; + font-size: 12px; +} + +.resize-tools button { + padding: 6px 10px; + border-radius: 6px; + border: 1px solid rgba(255,255,255,0.2); + background: rgba(255,255,255,0.06); + color: #fff; + cursor: pointer; +} + +.wplace-btn.active, +.wplace-btn[aria-pressed="true"] { + box-shadow: 0 0 8px rgba(0,0,0,0.25) inset, 0 0 6px rgba(0,0,0,0.2) !important; +} + +.mask-mode-group .wplace-btn.active, +.mask-mode-group .wplace-btn[aria-pressed="true"] { + box-shadow: 0 0 8px rgba(0,0,0,0.25) inset, 0 0 6px rgba(0,0,0,0.2); +} + +.resize-controls { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 15px; + align-items: center; +} + +.resize-slider { + width: 100%; + outline: none; + -webkit-appearance: none; +} + +.resize-zoom-controls { + grid-column: 1 / -1; + display: flex; + align-items: center; + gap: 10px; + margin-top: 15px; +} + +.resize-buttons { + display: flex; + gap: 10px; + justify-content: center; + margin-top: 20px; +} + +.resize-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.8); + z-index: 9999; + display: none; +} + +/* Color grid */ +.wplace-color-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); + gap: 10px; + padding-top: 8px; + max-height: 300px; + overflow-y: auto; +} + +.wplace-color-item { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; +} + +.wplace-color-item-name { + font-size: 9px; + color: #ccc; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 100%; +} + +.wplace-color-swatch { + width: 22px; + height: 22px; + border: 1px solid rgba(255,255,255,0.2); + border-radius: 4px; + cursor: pointer; + transition: transform 0.1s ease, box-shadow 0.2s ease; + position: relative; + margin: 0 auto; +} + +.wplace-color-swatch.unavailable { + border-color: #666; + border-style: dashed; + cursor: not-allowed; +} + +.wplace-color-swatch:hover { + transform: scale(1.1); + z-index: 1; +} + +.wplace-color-swatch:not(.active) { + opacity: 0.3; + filter: grayscale(80%); +} + +.wplace-color-swatch.unavailable:not(.active) { + opacity: 0.2; + filter: grayscale(90%); +} + +.wplace-color-swatch.active::after { + content: '✔'; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: white; + font-size: 12px; + font-weight: bold; + text-shadow: 0 0 3px black; +} + +.wplace-color-divider { + border: none; + height: 1px; + background: rgba(255,255,255,0.1); + margin: 8px 0; +} + +/* Cooldown controls */ +.wplace-cooldown-control { + margin-top: 8px; +} + +.wplace-cooldown-control label { + font-size: 11px; + margin-bottom: 4px; + display: block; +} + +.wplace-slider-container { + display: flex; + align-items: center; + gap: 8px; +} + +.wplace-slider { + flex: 1; + -webkit-appearance: none; + appearance: none; + height: 4px; + background: #444; + border-radius: 2px; + outline: none; +} + +.wplace-slider::-webkit-slider-thumb { + -webkit-appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + cursor: pointer; +} + +/* Settings container */ +#wplace-settings-container { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10001; + min-width: 400px; + max-width: 500px; +} + +.wplace-settings { + padding: 16px; + max-height: 400px; + overflow-y: auto; +} + +.wplace-setting-section { + margin-bottom: 20px; + padding: 12px; +} + +.wplace-setting-title { + display: flex; + align-items: center; + margin-bottom: 12px; + font-size: 14px; + font-weight: 600; +} + +.wplace-setting-title i { + margin-right: 8px; +} + +.wplace-setting-content { + /* Content styling will be theme-dependent */ +} + +.wplace-speed-control { + margin-top: 12px; + padding: 12px; +} + +.wplace-speed-label { + display: flex; + align-items: center; + margin-bottom: 8px; + font-size: 13px; + font-weight: 600; +} + +.wplace-speed-label i { + margin-right: 6px; +} + +.wplace-speed-slider-container { + display: flex; + align-items: center; + gap: 12px; +} + +.wplace-speed-slider { + flex: 1; + height: 6px; + border-radius: 3px; + outline: none; + cursor: pointer; + -webkit-appearance: none; + appearance: none; +} + +.wplace-speed-slider::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 18px; + height: 18px; + border-radius: 50%; + cursor: pointer; + border: 2px solid; +} + +.wplace-speed-slider::-moz-range-thumb { + width: 18px; + height: 18px; + border-radius: 50%; + cursor: pointer; + border: 2px solid; +} + +.wplace-speed-display { + display: flex; + align-items: center; + gap: 4px; + min-width: 90px; + justify-content: flex-end; +} + +#speedValue { + font-weight: 600; + font-size: 14px; +} + +.wplace-speed-unit { + font-size: 11px; + opacity: 0.8; +} + +.wplace-speed-container { + display: flex; + align-items: center; + gap: 15px; + margin-bottom: 10px; +} + +.wplace-speed-display { + padding: 5px 10px; + border-radius: 4px; + font-weight: 600; + min-width: 80px; + text-align: center; +} + +.wplace-select { + width: 100%; + padding: 8px 12px; + font-size: 14px; + margin-bottom: 10px; +} + +.wplace-select:focus { + outline: none; +} + +.wplace-description { + font-size: 12px; + opacity: 0.8; + line-height: 1.4; +} + +.wplace-theme-custom { + margin-top: 15px; + padding: 15px; +} + +.wplace-custom-group { + margin-bottom: 15px; +} + +.wplace-custom-label { + display: flex; + align-items: center; + margin-bottom: 8px; + font-size: 13px; + font-weight: 600; +} + +.wplace-custom-label i { + margin-right: 8px; + width: 16px; +} + +.wplace-color-input-group { + display: flex; + gap: 8px; + align-items: center; +} + +.wplace-color-input { + width: 50px; + height: 30px; + border: none; + border-radius: 4px; + cursor: pointer; + background: transparent; +} + +.wplace-color-text { + flex: 1; + padding: 6px 10px; + border-radius: 4px; + font-size: 12px; + font-family: monospace; +} + +.wplace-animation-controls { + display: flex; + flex-direction: column; + gap: 8px; +} + +.wplace-checkbox-label { + display: flex; + align-items: center; + gap: 8px; + font-size: 12px; + cursor: pointer; +} + +.wplace-custom-actions { + display: flex; + gap: 10px; + margin-top: 20px; + border-top: 1px solid; + padding-top: 15px; +} + +/* Theme-specific overrides will be applied dynamically via JavaScript */ \ No newline at end of file From 43c86972efb3980b9cb4f483b6135624a28e1a46 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Sun, 24 Aug 2025 22:39:28 +0200 Subject: [PATCH 02/36] my branch --- Auto-Image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auto-Image.js b/Auto-Image.js index 696198b..596bf34 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -3295,7 +3295,7 @@ // Link external CSS file const cssLink = document.createElement('link'); cssLink.rel = 'stylesheet'; - cssLink.href = 'https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css'; + cssLink.href = 'https://raw.githubusercontent.com/Staninna/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css'; cssLink.setAttribute('data-wplace-theme', 'true'); document.head.appendChild(cssLink); From 158159019b4a24a23c0ec9059759254f288a91a5 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Sun, 24 Aug 2025 22:45:18 +0200 Subject: [PATCH 03/36] updated url --- Auto-Image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auto-Image.js b/Auto-Image.js index 596bf34..49a8b95 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -3295,7 +3295,7 @@ // Link external CSS file const cssLink = document.createElement('link'); cssLink.rel = 'stylesheet'; - cssLink.href = 'https://raw.githubusercontent.com/Staninna/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css'; + cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/auto-image-styles.css'; cssLink.setAttribute('data-wplace-theme', 'true'); document.head.appendChild(cssLink); From 8d5bd64988cfee4966e0eb9f3b6508d28f0c9c93 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Sun, 24 Aug 2025 23:04:47 +0200 Subject: [PATCH 04/36] added todo for merge --- Auto-Image.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Auto-Image.js b/Auto-Image.js index 49a8b95..2ce2c02 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -3295,7 +3295,7 @@ // Link external CSS file const cssLink = document.createElement('link'); cssLink.rel = 'stylesheet'; - cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/auto-image-styles.css'; + cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/auto-image-styles.css'; // TODO: Before merge change to https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css cssLink.setAttribute('data-wplace-theme', 'true'); document.head.appendChild(cssLink); From 4667c5b736539fff660dd1b37e4166ebb3dc7861 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 01:23:43 +0200 Subject: [PATCH 05/36] Refactor CSS integration by decoupling styles from JavaScript and adding complete CSS file --- Auto-Image.js | 98 +---- auto-image-complete-styles.css | 753 +++++++++++++++++++++++++++++++++ 2 files changed, 771 insertions(+), 80 deletions(-) create mode 100644 auto-image-complete-styles.css diff --git a/Auto-Image.js b/Auto-Image.js index 2ce2c02..217aa26 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -1700,18 +1700,7 @@ } this._turnstileContainer = document.createElement('div'); - this._turnstileContainer.style.cssText = ` - position: fixed !important; - left: -99999px !important; - top: -99999px !important; - width: 1px !important; - height: 1px !important; - pointer-events: none !important; - opacity: 0 !important; - visibility: hidden !important; - z-index: -99999 !important; - overflow: hidden !important; - `; + this._turnstileContainer.className = 'wplace-turnstile-hidden'; this._turnstileContainer.setAttribute('aria-hidden', 'true'); this._turnstileContainer.id = 'turnstile-widget-container'; document.body.appendChild(this._turnstileContainer); @@ -1727,35 +1716,19 @@ const overlay = document.createElement('div'); overlay.id = 'turnstile-overlay-container'; - overlay.style.cssText = ` - position: fixed !important; - bottom: 20px !important; - right: 20px !important; - z-index: 99999 !important; - background: rgba(0,0,0,0.9) !important; - border-radius: 12px !important; - padding: 20px !important; - box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important; - backdrop-filter: blur(10px) !important; - border: 1px solid rgba(255,255,255,0.2) !important; - color: white !important; - font-family: 'Segoe UI', sans-serif !important; - display: none !important; - max-width: 350px !important; - min-width: 300px !important; - `; + overlay.className = 'wplace-turnstile-overlay wplace-overlay-hidden'; const title = document.createElement('div'); title.textContent = 'Cloudflare Turnstile — please complete the check if shown'; - title.style.cssText = 'font: 600 12px/1.3 "Segoe UI",sans-serif; margin-bottom: 8px; opacity: 0.9;'; + title.className = 'wplace-turnstile-title'; const host = document.createElement('div'); host.id = 'turnstile-overlay-host'; - host.style.cssText = 'width: 100%; min-height: 70px;'; + host.className = 'wplace-turnstile-host'; const hideBtn = document.createElement('button'); hideBtn.textContent = 'Hide'; - hideBtn.style.cssText = 'position:absolute; top:6px; right:6px; font-size:11px; background:transparent; color:#fff; border:1px solid rgba(255,255,255,0.2); border-radius:6px; padding:2px 6px; cursor:pointer;'; + hideBtn.className = 'wplace-turnstile-hide-btn'; hideBtn.addEventListener('click', () => overlay.remove()); overlay.appendChild(title); @@ -2084,40 +2057,7 @@ showAlert: (message, type = "info") => { const alertDiv = document.createElement("div") - alertDiv.style.cssText = ` - position: fixed; - top: 20px; - left: 50%; - transform: translateX(-50%); - padding: 12px 20px; - border-radius: 8px; - color: white; - font-weight: 600; - z-index: 10001; - max-width: 400px; - text-align: center; - box-shadow: 0 4px 12px rgba(0,0,0,0.3); - animation: slideDown 0.3s ease-out; - font-family: 'Segoe UI', sans-serif; - ` - - const colors = { - info: "background: linear-gradient(135deg, #3498db, #2980b9);", - success: "background: linear-gradient(135deg, #27ae60, #229954);", - warning: "background: linear-gradient(135deg, #f39c12, #e67e22);", - error: "background: linear-gradient(135deg, #e74c3c, #c0392b);", - } - - alertDiv.style.cssText += colors[type] || colors.info - - const style = document.createElement("style") - style.textContent = ` - @keyframes slideDown { - from { transform: translateX(-50%) translateY(-20px); opacity: 0; } - to { transform: translateX(-50%) translateY(0); opacity: 1; } - } - ` - document.head.appendChild(style) + alertDiv.className = `wplace-alert-base wplace-alert-${type}` alertDiv.textContent = message document.body.appendChild(alertDiv) @@ -2126,7 +2066,6 @@ alertDiv.style.animation = "slideDown 0.3s ease-out reverse" setTimeout(() => { document.body.removeChild(alertDiv) - document.head.removeChild(style) }, 300) }, 4000) }, @@ -3292,13 +3231,20 @@ document.head.appendChild(googleFonts) } - // Link external CSS file + // Link external CSS files const cssLink = document.createElement('link'); cssLink.rel = 'stylesheet'; - cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/auto-image-styles.css'; // TODO: Before merge change to https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css + cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/auto-image-complete-styles.css'; // TODO: Before merge change to https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css cssLink.setAttribute('data-wplace-theme', 'true'); document.head.appendChild(cssLink); + // Link complete styles CSS file (includes extracted inline styles) + const completeCssLink = document.createElement('link'); + completeCssLink.rel = 'stylesheet'; + completeCssLink.href = './auto-image-complete-styles.css'; + completeCssLink.setAttribute('data-wplace-complete', 'true'); + document.head.appendChild(completeCssLink); + // Apply theme-specific dynamic styles const style = document.createElement("style") style.setAttribute("data-wplace-theme-dynamic", "true") @@ -3838,17 +3784,9 @@ `linear-gradient(135deg, ${theme.primary} 0%, ${theme.secondary || theme.primary} 100%)` : `linear-gradient(135deg, #667eea 0%, #764ba2 100%)` - settingsContainer.style.cssText = ` - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background: ${themeBackground}; - border: ${theme.borderWidth || '1px'} ${theme.borderStyle || 'solid'} ${theme.accent || 'rgba(255,255,255,0.1)'}; - border-radius: ${theme.borderRadius || '16px'}; - padding: 0; - z-index: 10002; - display: none; + settingsContainer.className = 'wplace-settings-container-base'; + // Apply theme-specific background + settingsContainer.style.background = themeBackground; min-width: 420px; max-width: 480px; color: ${theme.text || 'white'}; diff --git a/auto-image-complete-styles.css b/auto-image-complete-styles.css new file mode 100644 index 0000000..d33e415 --- /dev/null +++ b/auto-image-complete-styles.css @@ -0,0 +1,753 @@ +/* WPlace Auto-Image Bot - Complete CSS Styles */ +/* All styling separated from JavaScript */ + +/* CSS Custom Properties for Dynamic Values */ +:root { + /* Default Theme Colors */ + --wplace-primary: #000000; + --wplace-secondary: #111111; + --wplace-accent: #775ce3; + --wplace-text: #ffffff; + --wplace-success: #00ff00; + --wplace-error: #ff0000; + --wplace-warning: #ffa500; + + /* Layout Properties */ + --wplace-border-width: 1px; + --wplace-border-style: solid; + --wplace-border-radius: 16px; + --wplace-padding: 16px; + + /* Animation Properties */ + --wplace-glow-enabled: 0; + --wplace-pixel-blink-enabled: 0; + --wplace-scanline-enabled: 0; + + /* Overlay Properties */ + --wplace-overlay-opacity: 0.6; +} + +/* Theme Variants */ +.theme-cyberpunk { + --wplace-primary: #0a0a0a; + --wplace-secondary: #1a1a2e; + --wplace-accent: #00ffff; + --wplace-text: #00ff00; + --wplace-glow-enabled: 1; + --wplace-pixel-blink-enabled: 1; +} + +.theme-neon { + --wplace-primary: #0f0f23; + --wplace-secondary: #16213e; + --wplace-accent: #ff006e; + --wplace-text: #ffffff; + --wplace-glow-enabled: 1; +} + +.theme-matrix { + --wplace-primary: #000000; + --wplace-secondary: #001100; + --wplace-accent: #00ff00; + --wplace-text: #00ff00; + --wplace-scanline-enabled: 1; +} + +.theme-minimal { + --wplace-primary: #ffffff; + --wplace-secondary: #f5f5f5; + --wplace-accent: #007acc; + --wplace-text: #333333; +} + +/* Base Animations */ +@keyframes neonGlow { + 0%, 100% { + text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor; + } + 50% { + text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor; + } +} + +@keyframes pixelBlink { + 0%, 50% { opacity: 1; } + 51%, 100% { opacity: 0.7; } +} + +@keyframes scanline { + 0% { transform: translateY(-100%); } + 100% { transform: translateY(400px); } +} + +@keyframes pulse { + 0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); } + 70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); } + 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); } +} + +@keyframes slideIn { + from { transform: translateY(-10px); opacity: 0; } + to { transform: translateY(0); opacity: 1; } +} + +@keyframes slideDown { + from { transform: translateX(-50%) translateY(-20px); opacity: 0; } + to { transform: translateX(-50%) translateY(0); opacity: 1; } +} + +@keyframes shimmer { + 0% { transform: translateX(-100%); } + 100% { transform: translateX(100%); } +} + +/* Conditional Animations Based on Theme */ +.theme-cyberpunk .wplace-header, +.theme-neon .wplace-header { + animation: neonGlow 2s ease-in-out infinite alternate; +} + +.theme-cyberpunk .fas, +.theme-cyberpunk .fa, +.theme-neon .fas, +.theme-neon .fa { + filter: drop-shadow(0 0 3px currentColor); +} + +.theme-cyberpunk .wplace-btn:hover:not(:disabled), +.theme-cyberpunk .status-error, +.theme-cyberpunk .wplace-progress-bar::after { + animation: pixelBlink 0.5s infinite; +} + +.theme-matrix::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 2px; + background: linear-gradient(90deg, transparent, var(--wplace-accent), transparent); + animation: scanline 3s linear infinite; + pointer-events: none; +} + +/* Turnstile Container Styles */ +.wplace-turnstile-hidden { + position: fixed !important; + left: -99999px !important; + top: -99999px !important; + width: 1px !important; + height: 1px !important; + pointer-events: none !important; + opacity: 0 !important; + visibility: hidden !important; + z-index: -99999 !important; + overflow: hidden !important; +} + +.wplace-turnstile-overlay { + position: fixed !important; + bottom: 20px !important; + right: 20px !important; + z-index: 99999 !important; + background: rgba(0,0,0,0.9) !important; + border-radius: 12px !important; + padding: 20px !important; + box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important; + backdrop-filter: blur(10px) !important; + border: 1px solid rgba(255,255,255,0.2) !important; + color: var(--wplace-text) !important; + font-family: "Segoe UI", sans-serif !important; + min-width: 300px !important; + max-width: 400px !important; +} + +.wplace-turnstile-title { + font: 600 12px/1.3 "Segoe UI", sans-serif !important; + margin-bottom: 8px !important; + opacity: 0.9 !important; + color: var(--wplace-text) !important; +} + +.wplace-turnstile-host { + width: 100% !important; + min-height: 70px !important; +} + +.wplace-turnstile-hide-btn { + position: absolute !important; + top: 6px !important; + right: 6px !important; + font-size: 11px !important; + background: transparent !important; + color: var(--wplace-text) !important; + border: 1px solid rgba(255,255,255,0.2) !important; + border-radius: 6px !important; + padding: 2px 6px !important; + cursor: pointer !important; +} + +.wplace-turnstile-hide-btn:hover { + background: rgba(255,255,255,0.1) !important; +} + +/* Alert System */ +.wplace-alert { + position: fixed; + top: 20px; + left: 50%; + transform: translateX(-50%); + padding: 12px 20px; + border-radius: 8px; + color: white; + font-weight: 600; + z-index: 10001; + max-width: 400px; + text-align: center; + animation: slideDown 0.3s ease-out; +} + +.wplace-alert-success { + background: linear-gradient(135deg, #4caf50, #66bb6a); + box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); +} + +.wplace-alert-error { + background: linear-gradient(135deg, #f44336, #ef5350); + box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3); +} + +.wplace-alert-warning { + background: linear-gradient(135deg, #ff9800, #ffb74d); + box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3); +} + +.wplace-alert-info { + background: linear-gradient(135deg, #2196f3, #42a5f5); + box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3); +} + +/* Settings Container */ +.wplace-settings-container { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background: var(--wplace-primary); + border: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-accent); + border-radius: var(--wplace-border-radius); + padding: 0; + z-index: 10002; + display: none; + color: var(--wplace-text); + font-family: "Segoe UI", Roboto, sans-serif; + min-width: 400px; + max-width: 500px; + max-height: 80vh; + overflow-y: auto; + box-shadow: 0 20px 60px rgba(0,0,0,0.5); +} + +.wplace-settings-container.show { + display: block; + animation: slideIn 0.3s ease-out; +} + +/* Settings Header */ +.wplace-settings-header { + background: var(--wplace-secondary); + padding: var(--wplace-padding); + border-bottom: 1px solid var(--wplace-accent); + display: flex; + justify-content: space-between; + align-items: center; +} + +.wplace-settings-title { + color: var(--wplace-accent); + font-size: 18px; + font-weight: 600; + display: flex; + align-items: center; + gap: 10px; +} + +.wplace-settings-close { + background: none; + border: none; + color: var(--wplace-text); + font-size: 18px; + cursor: pointer; + opacity: 0.7; + transition: opacity 0.2s; +} + +.wplace-settings-close:hover { + opacity: 1; +} + +/* Settings Content */ +.wplace-settings { + padding: var(--wplace-padding); + max-height: 400px; + overflow-y: auto; +} + +.wplace-setting-section { + margin-bottom: 20px; + padding: 12px; + background: rgba(255,255,255,0.03); + border: 1px solid rgba(255,255,255,0.1); + border-radius: 8px; +} + +.wplace-setting-title { + display: flex; + align-items: center; + margin-bottom: 12px; + font-size: 14px; + font-weight: 600; + color: var(--wplace-accent); +} + +.wplace-setting-title i { + margin-right: 8px; +} + +/* Form Controls */ +.wplace-select { + width: 100%; + padding: 8px 12px; + font-size: 14px; + margin-bottom: 10px; + background: var(--wplace-secondary); + border: 1px solid var(--wplace-accent); + border-radius: 6px; + color: var(--wplace-text); +} + +.wplace-select:focus { + outline: none; + box-shadow: 0 0 0 2px rgba(119, 92, 227, 0.3); +} + +.wplace-description { + font-size: 12px; + opacity: 0.8; + line-height: 1.4; + color: var(--wplace-text); +} + +/* Speed Controls */ +.wplace-speed-control { + margin-top: 12px; + padding: 12px; + background: rgba(255,255,255,0.03); + border-radius: 8px; +} + +.wplace-speed-label { + display: flex; + align-items: center; + margin-bottom: 8px; + font-size: 13px; + font-weight: 600; + color: var(--wplace-text); +} + +.wplace-speed-label i { + margin-right: 6px; +} + +.wplace-speed-slider-container { + display: flex; + align-items: center; + gap: 12px; +} + +.wplace-speed-slider { + flex: 1; + height: 6px; + border-radius: 3px; + outline: none; + cursor: pointer; + -webkit-appearance: none; + appearance: none; + background: #444; +} + +.wplace-speed-slider::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + width: 18px; + height: 18px; + border-radius: 50%; + cursor: pointer; + border: 2px solid var(--wplace-accent); + background: var(--wplace-accent); +} + +.wplace-speed-slider::-moz-range-thumb { + width: 18px; + height: 18px; + border-radius: 50%; + cursor: pointer; + border: 2px solid var(--wplace-accent); + background: var(--wplace-accent); +} + +.wplace-speed-display { + display: flex; + align-items: center; + gap: 4px; + min-width: 90px; + justify-content: flex-end; + padding: 5px 10px; + border-radius: 4px; + font-weight: 600; + background: var(--wplace-secondary); + color: var(--wplace-text); +} + +.wplace-speed-unit { + font-size: 11px; + opacity: 0.8; +} + +/* Theme Customization */ +.wplace-theme-custom { + margin-top: 15px; + padding: 15px; + background: rgba(255,255,255,0.03); + border-radius: 8px; +} + +.wplace-custom-group { + margin-bottom: 15px; +} + +.wplace-custom-label { + display: flex; + align-items: center; + margin-bottom: 8px; + font-size: 13px; + font-weight: 600; + color: var(--wplace-text); +} + +.wplace-custom-label i { + margin-right: 8px; + width: 16px; +} + +.wplace-color-input-group { + display: flex; + gap: 8px; + align-items: center; +} + +.wplace-color-input { + width: 50px; + height: 30px; + border: none; + border-radius: 4px; + cursor: pointer; + background: transparent; +} + +.wplace-color-text { + flex: 1; + padding: 6px 10px; + border-radius: 4px; + font-size: 12px; + font-family: monospace; + background: var(--wplace-secondary); + border: 1px solid var(--wplace-accent); + color: var(--wplace-text); +} + +.wplace-animation-controls { + display: flex; + flex-direction: column; + gap: 8px; +} + +.wplace-checkbox-label { + display: flex; + align-items: center; + gap: 8px; + font-size: 12px; + cursor: pointer; + color: var(--wplace-text); +} + +.wplace-custom-actions { + display: flex; + gap: 10px; + margin-top: 20px; + border-top: 1px solid rgba(255,255,255,0.1); + padding-top: 15px; +} + +/* Overlay Styles */ +.wplace-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.8); + z-index: 9999; + display: none; +} + +.wplace-overlay.show { + display: block; +} + +/* Overlay visibility classes */ +.wplace-overlay-hidden { + display: none !important; +} + +.wplace-overlay-visible { + display: block !important; +} + +/* Responsive Design */ +@media (max-width: 768px) { + .wplace-settings-container { + min-width: 90vw; + max-width: 90vw; + margin: 20px; + } + + .wplace-turnstile-overlay { + bottom: 10px !important; + right: 10px !important; + left: 10px !important; + min-width: auto !important; + } + + .wplace-alert { + max-width: 90vw; + margin: 0 5vw; + } +} + +/* Dark/Light mode support */ +@media (prefers-color-scheme: light) { + .theme-auto { + --wplace-primary: #ffffff; + --wplace-secondary: #f5f5f5; + --wplace-accent: #007acc; + --wplace-text: #333333; + } +} + +@media (prefers-color-scheme: dark) { + .theme-auto { + --wplace-primary: #1e1e1e; + --wplace-secondary: #2d2d30; + --wplace-accent: #775ce3; + --wplace-text: #ffffff; + } +} + +/* =============================================== */ +/* EXTRACTED INLINE STYLES - PREVIOUSLY IN JS */ +/* =============================================== */ + +/* Turnstile Overlay Styles - extracted from createTurnstileOverlay */ +.wplace-turnstile-title { + font: 600 12px/1.3 "Segoe UI", sans-serif; + margin-bottom: 8px; + opacity: 0.9; + color: var(--wplace-text, #ffffff); +} + +.wplace-turnstile-host { + width: 100%; + min-height: 70px; +} + +.wplace-turnstile-hide-btn { + position: absolute; + top: 6px; + right: 6px; + font-size: 11px; + background: transparent; + color: var(--wplace-text, #ffffff); + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 6px; + padding: 2px 6px; + cursor: pointer; + transition: background 0.2s ease; +} + +.wplace-turnstile-hide-btn:hover { + background: rgba(255, 255, 255, 0.1); +} + +/* Alert System Styles - extracted from showAlert */ +.wplace-alert-base { + position: fixed; + top: 20px; + left: 50%; + transform: translateX(-50%); + padding: 12px 20px; + border-radius: 8px; + color: white; + font-weight: 600; + z-index: 10001; + max-width: 400px; + text-align: center; + animation: slideDown 0.3s ease-out; + box-shadow: 0 4px 12px rgba(0,0,0,0.3); + font-family: 'Segoe UI', sans-serif; +} + +/* Alert type variants - extracted from showAlert colors object */ +.wplace-alert-info { + background: linear-gradient(135deg, #3498db, #2980b9); + box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); +} + +.wplace-alert-success { + background: linear-gradient(135deg, #27ae60, #229954); + box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3); +} + +.wplace-alert-warning { + background: linear-gradient(135deg, #f39c12, #e67e22); + box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3); +} + +.wplace-alert-error { + background: linear-gradient(135deg, #e74c3c, #c0392b); + box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3); +} + +/* Settings Container Base Styles - extracted from showSettings */ +.wplace-settings-container-base { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10002; + display: none; + font-family: "Segoe UI", Roboto, sans-serif; + min-width: 400px; + max-width: 500px; + max-height: 80vh; + overflow-y: auto; + animation: slideIn 0.3s ease-out; + border: 1px solid var(--wplace-accent, rgba(255,255,255,0.1)); + border-radius: 16px; + padding: 0; +} + +.wplace-settings-container-base.show { + display: block; +} + +/* Dynamic Theme Background Classes */ +.wplace-theme-classic { + background: linear-gradient(135deg, var(--wplace-primary, #000000) 0%, #1a1a1a 100%); +} + +.wplace-theme-standard { + background: var(--wplace-primary, #000000); +} + +/* Settings Container Theme Variations */ +.wplace-settings-cyberpunk { + background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%); +} + +.wplace-settings-neon { + background: linear-gradient(135deg, #0f0f23 0%, #16213e 50%, #240046 100%); +} + +.wplace-settings-matrix { + background: linear-gradient(135deg, #000000 0%, #001100 50%, #002200 100%); +} + +.wplace-settings-retro { + background: linear-gradient(135deg, #2c3e50 0%, #3498db 50%, #9b59b6 100%); +} + +.wplace-settings-minimal { + background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%); +} + +.wplace-settings-synthwave { + background: linear-gradient(135deg, #1a0033 0%, #2d1b69 50%, #11998e 100%); +} + +.wplace-settings-vapor { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); +} + +/* Color swatch states - extracted from updateColorGrid */ +.wplace-color-swatch.unavailable { + opacity: 0.4; + filter: grayscale(50%); +} + +/* Stats container visibility - extracted from toggleStats */ +.wplace-stats-container.hidden { + display: none; +} + +/* Additional utility classes for dynamic behavior */ +.wplace-drag-active { + transition: none !important; + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.2) !important; + transform: scale(1.02) !important; + z-index: 9999 !important; +} + +.wplace-paint-effect { + animation: pulse 0.5s ease-out; +} + +.wplace-settings-error { + background: rgba(255, 0, 0, 0.4) !important; +} + +/* Animation modifier classes for conditional application */ +.wplace-glow-animation .wplace-header { + animation: neonGlow 2s ease-in-out infinite alternate; +} + +.wplace-glow-animation .fas, +.wplace-glow-animation .fa { + filter: drop-shadow(0 0 3px currentColor); +} + +.wplace-blink-animation .wplace-btn:hover:not(:disabled) { + animation: pixelBlink 0.5s infinite; +} + +.wplace-blink-animation .status-error { + animation: pixelBlink 0.5s infinite; +} + +.wplace-blink-animation .wplace-progress-bar::after { + animation: pixelBlink 1s infinite; +} + +.wplace-scanline-animation::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 2px; + background: linear-gradient(90deg, transparent, var(--wplace-neon, #00ffff), transparent); + animation: scanline 3s linear infinite; + z-index: 1; + pointer-events: none; +} \ No newline at end of file From f4863f9018e18639a9d740a66cb699a51ef0b3e9 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 12:46:24 +0200 Subject: [PATCH 06/36] Fix JavaScript syntax error in settings container CSS assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Auto-Image.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Auto-Image.js b/Auto-Image.js index 217aa26..dc1e605 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -3787,6 +3787,7 @@ settingsContainer.className = 'wplace-settings-container-base'; // Apply theme-specific background settingsContainer.style.background = themeBackground; + settingsContainer.style.cssText += ` min-width: 420px; max-width: 480px; color: ${theme.text || 'white'}; @@ -3799,7 +3800,7 @@ box-shadow: ${theme.boxShadow || '0 20px 40px rgba(0,0,0,0.3)'}, 0 0 30px ${theme.highlight || theme.neon || '#00ffff'}; ` : ''} - ` + `; settingsContainer.innerHTML = `
Date: Mon, 25 Aug 2025 13:39:50 +0200 Subject: [PATCH 08/36] zindex --- auto-image-complete-styles.css | 37 +++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/auto-image-complete-styles.css b/auto-image-complete-styles.css index deef55f..469a74b 100644 --- a/auto-image-complete-styles.css +++ b/auto-image-complete-styles.css @@ -10,6 +10,37 @@ max-width: 400px !important; } +/* Stats Container Positioning */ +#wplace-stats-container { + position: fixed !important; + top: 60px !important; + right: 20px !important; + z-index: 10001 !important; + max-width: 350px !important; +} + +/* Resize Dialog Containers */ +.resize-container { + position: fixed !important; + top: 50% !important; + left: 50% !important; + transform: translate(-50%, -50%) !important; + z-index: 100000 !important; + max-width: 90vw !important; + max-height: 90vh !important; +} + +.resize-overlay { + position: fixed !important; + top: 0 !important; + left: 0 !important; + width: 100% !important; + height: 100% !important; + background: rgba(0, 0, 0, 0.8) !important; + z-index: 99999 !important; + display: none !important; +} + /* CSS Custom Properties for Dynamic Values */ :root { /* Default Theme Colors */ @@ -247,7 +278,7 @@ border: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-accent); border-radius: var(--wplace-border-radius); padding: 0; - z-index: 10002; + z-index: 100001; display: none; color: var(--wplace-text); font-family: "Segoe UI", Roboto, sans-serif; @@ -507,7 +538,7 @@ width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); - z-index: 9999; + z-index: 100002; display: none; } @@ -644,7 +675,7 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); - z-index: 10002; + z-index: 100001; display: none; font-family: "Segoe UI", Roboto, sans-serif; min-width: 400px; From 1c086b8ddc211c43957d574ce2d611c4843eeb03 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 13:55:50 +0200 Subject: [PATCH 09/36] fix --- Auto-Image.js | 9 ++++++--- auto-image-complete-styles.css | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Auto-Image.js b/Auto-Image.js index 63493f3..2f22e98 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -4443,6 +4443,9 @@ document.body.appendChild(statsContainer) document.body.appendChild(settingsContainer) + // Show the main container after all elements are appended + container.style.display = "block" + const uploadBtn = container.querySelector("#uploadBtn") const resizeBtn = container.querySelector("#resizeBtn") const selectPosBtn = container.querySelector("#selectPosBtn") @@ -4609,9 +4612,9 @@ } } if (statsContainer && statsBtn) { - statsContainer.style.display = "block"; - statsBtn.innerHTML = ''; - statsBtn.title = "Hide Stats"; + // Stats container starts hidden - user clicks button to show + statsBtn.innerHTML = ''; + statsBtn.title = "Show Stats"; } const settingsBtn = container.querySelector("#settingsBtn") diff --git a/auto-image-complete-styles.css b/auto-image-complete-styles.css index 469a74b..39ede51 100644 --- a/auto-image-complete-styles.css +++ b/auto-image-complete-styles.css @@ -8,6 +8,7 @@ left: 20px !important; z-index: 10000 !important; max-width: 400px !important; + display: none !important; } /* Stats Container Positioning */ @@ -17,6 +18,7 @@ right: 20px !important; z-index: 10001 !important; max-width: 350px !important; + display: none !important; } /* Resize Dialog Containers */ @@ -28,6 +30,7 @@ z-index: 100000 !important; max-width: 90vw !important; max-height: 90vh !important; + display: none !important; } .resize-overlay { From f646ff6f3b89f0bae49f27dbbdf83e49826f2ef5 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:11:55 +0200 Subject: [PATCH 10/36] fix css? --- auto-image-complete-styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-image-complete-styles.css b/auto-image-complete-styles.css index 39ede51..1f42eb4 100644 --- a/auto-image-complete-styles.css +++ b/auto-image-complete-styles.css @@ -8,7 +8,7 @@ left: 20px !important; z-index: 10000 !important; max-width: 400px !important; - display: none !important; + display: none; } /* Stats Container Positioning */ From 7252e4b0fec0153cf46dad61df3fa9ce21aaaf43 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:44:32 +0200 Subject: [PATCH 11/36] feat: Update CSS and JS for decoupled styles and revert CSS link --- Auto-Farm.js | 624 ---------------- Auto-Image.js | 7 +- auto-image-complete-styles.css | 1282 ++++++++++++++++++-------------- 3 files changed, 743 insertions(+), 1170 deletions(-) delete mode 100644 Auto-Farm.js diff --git a/Auto-Farm.js b/Auto-Farm.js deleted file mode 100644 index 1a903bd..0000000 --- a/Auto-Farm.js +++ /dev/null @@ -1,624 +0,0 @@ -(async () => { - const CONFIG = { - START_X: 742, - START_Y: 1148, - PIXELS_PER_LINE: 100, - DELAY: 1000, - THEME: { - primary: '#000000', - secondary: '#111111', - accent: '#222222', - text: '#ffffff', - highlight: '#775ce3', - success: '#00ff00', - error: '#ff0000' - } - }; - - const state = { - running: false, - paintedCount: 0, - charges: { count: 0, max: 80, cooldownMs: 30000 }, - userInfo: null, - lastPixel: null, - minimized: false, - menuOpen: false, - language: 'en', - autoRefresh: true, - pausedForManual: false - }; - - const sleep = ms => new Promise(r => setTimeout(r, ms)); - const waitForSelector = async (selector, interval = 200, timeout = 5000) => { - const start = Date.now(); - while (Date.now() - start < timeout) { - const el = document.querySelector(selector); - if (el) return el; - await sleep(interval); - } - return null; - }; - - const originalFetch = window.fetch; - let capturedCaptchaToken = null; - window.fetch = async (url, options = {}) => { - if (typeof url === 'string' && url.includes('https://backend.wplace.live/s0/pixel/')) { - try { - const payload = JSON.parse(options.body || '{}'); - if (payload.t) { - console.log('✅ CAPTCHA Token Captured:', payload.t); - capturedCaptchaToken = payload.t; - if (state.pausedForManual) { - state.pausedForManual = false; - state.running = true; - updateUI( - state.language === 'pt' ? '🚀 Pintura reiniciada!' : '🚀 Farm resumed!', - 'success' - ); - paintLoop(); - } - } - } catch (e) { - } - } - return originalFetch(url, options); - }; - - const fetchAPI = async (url, options = {}) => { - try { - const res = await fetch(url, { - credentials: 'include', - ...options - }); - return await res.json(); - } catch (e) { - return null; - } - }; - - const getRandomPosition = () => ({ - x: Math.floor(Math.random() * CONFIG.PIXELS_PER_LINE), - y: Math.floor(Math.random() * CONFIG.PIXELS_PER_LINE) - }); - - const paintPixel = async (x, y) => { - const randomColor = Math.floor(Math.random() * 31) + 1; - const url = `https://backend.wplace.live/s0/pixel/${CONFIG.START_X}/${CONFIG.START_Y}`; - const payload = JSON.stringify({ coords: [x, y], colors: [randomColor], t: capturedCaptchaToken }); - try { - const res = await originalFetch(url, { - method: 'POST', - headers: { 'Content-Type': 'text/plain;charset=UTF-8' }, - credentials: 'include', - body: payload - }); - if (res.status === 403) { - console.error('❌ 403 Forbidden. CAPTCHA token might be invalid or expired.'); - capturedCaptchaToken = null; - stoppedForToken = true; - return 'token_error'; - } - const data = await res.json(); - return data; - } catch (e) { - return null; - } - }; - - const getCharge = async () => { - const data = await fetchAPI('https://backend.wplace.live/me'); - if (data) { - state.userInfo = data; - state.charges = { - count: Math.floor(data.charges.count), - max: Math.floor(data.charges.max), - cooldownMs: data.charges.cooldownMs - }; - if (state.userInfo.level) { - state.userInfo.level = Math.floor(state.userInfo.level); - } - } - return state.charges; - }; - - const detectUserLocation = async () => { - try { - const response = await fetch('https://ipapi.co/json/'); - const data = await response.json(); - if (data.country === 'BR') { - state.language = 'pt'; - } else if (data.country === 'US') { - state.language = 'en'; - } else { - state.language = 'en'; - } - } catch { - state.language = 'en'; - } - }; - - const paintLoop = async () => { - while (state.running) { - const { count, cooldownMs } = state.charges; - - if (count < 1) { - updateUI(state.language === 'pt' ? `⌛ Sem cargas. Esperando ${Math.ceil(cooldownMs/1000)}s...` : `⌛ No charges. Waiting ${Math.ceil(cooldownMs/1000)}s...`, 'status'); - await sleep(cooldownMs); - await getCharge(); - continue; - } - - const randomPos = getRandomPosition(); - const paintResult = await paintPixel(randomPos.x, randomPos.y); - if (paintResult === 'token_error') { - if (state.autoRefresh) { - await getCharge(); - if (state.charges.count < 2) { - if (!state.pausedForManual) { - updateUI( - state.language === 'pt' - ? '⚡ Aguardando pelo menos 2 cargas para auto-refresh...' - : 'Waiting for at least 2 charges for auto-refresh...', - 'status' - ); - state.pausedForManual = true; - } - while (state.charges.count < 2) { - await sleep(60000); - await getCharge(); - updateStats(); - } - state.pausedForManual = false; - } - updateUI( - state.language === 'pt' - ? '❌ Token expirado. Aguardando elemento Paint...' - : '❌ CAPTCHA token expired. Waiting for Paint button...', - 'error' - ); - const mainPaintBtn = await waitForSelector('button.btn.btn-primary.btn-lg, button.btn-primary.sm\\:btn-xl'); - if (mainPaintBtn) mainPaintBtn.click(); - await sleep(500); - updateUI( - state.language === 'pt' ? 'Selecionando transparente...' : 'Selecting transparent...', - 'status' - ); - const transBtn = await waitForSelector('button#color-0'); - if (transBtn) transBtn.click(); - await sleep(500); - const canvas = await waitForSelector('canvas'); - if (canvas) { - canvas.setAttribute('tabindex', '0'); - canvas.focus(); - const rect = canvas.getBoundingClientRect(); - const centerX = Math.round(rect.left + rect.width / 2); - const centerY = Math.round(rect.top + rect.height / 2); - const moveEvt = new MouseEvent('mousemove', { - clientX: centerX, - clientY: centerY, - bubbles: true - }); - canvas.dispatchEvent(moveEvt); - const keyDown = new KeyboardEvent('keydown', { key: ' ', code: 'Space', bubbles: true }); - const keyUp = new KeyboardEvent('keyup', { key: ' ', code: 'Space', bubbles: true }); - canvas.dispatchEvent(keyDown); - canvas.dispatchEvent(keyUp); - } - await sleep(500); - updateUI( - state.language === 'pt' ? 'Confirmando pintura...' : 'Confirming paint...', - 'status' - ); - let confirmBtn = await waitForSelector( - 'button.btn.btn-primary.btn-lg, button.btn.btn-primary.sm\\:btn-xl' - ); - if (!confirmBtn) { - const allPrimary = Array.from(document.querySelectorAll('button.btn-primary')); - confirmBtn = allPrimary.length ? allPrimary[allPrimary.length - 1] : null; - } - confirmBtn?.click(); - } else { - // insufficient charges or auto-refresh disabled - if (state.autoRefresh && state.charges.count < 2) { - updateUI( - state.language === 'pt' - ? '⚡ Cargas insuficientes para auto-refresh. Por favor, clique manualmente.' - : 'Insufficient charges for auto-refresh. Please click manually.', - 'error' - ); - } - if (!state.pausedForManual) { - updateUI( - state.language === 'pt' - ? 'Auto-refresh desativado. Por favor, clique no botão pintura manualmente.' - : 'Auto-refresh disabled. Please click the Paint button manually.', - 'status' - ); - state.pausedForManual = true; - } - state.running = false; - return; - } - await sleep(1000); - continue; - } - - if (paintResult?.painted === 1) { - state.paintedCount++; - state.lastPixel = { - x: CONFIG.START_X + randomPos.x, - y: CONFIG.START_Y + randomPos.y, - time: new Date() - }; - state.charges.count--; - - document.getElementById('paintEffect').style.animation = 'pulse 0.5s'; - setTimeout(() => { - document.getElementById('paintEffect').style.animation = ''; - }, 500); - - updateUI(state.language === 'pt' ? '✅ Pixel pintado!' : '✅ Pixel painted!', 'success'); - } else { - updateUI(state.language === 'pt' ? '❌ Falha ao pintar' : '❌ Failed to paint', 'error'); - } - - await sleep(CONFIG.DELAY); - updateStats(); - } - }; - - const createUI = () => { - if (state.menuOpen) return; - state.menuOpen = true; - - const fontAwesome = document.createElement('link'); - fontAwesome.rel = 'stylesheet'; - fontAwesome.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css'; - document.head.appendChild(fontAwesome); - - const style = document.createElement('style'); - style.textContent = ` - @keyframes pulse { - 0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }n - 70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); } - 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); } - } - @keyframes slideIn { - from { transform: translateY(20px); opacity: 0; } - to { transform: translateY(0); opacity: 1; } - } - .wplace-bot-panel { - position: fixed; - top: 20px; - right: 20px; - width: 250px; - background: ${CONFIG.THEME.primary}; - border: 1px solid ${CONFIG.THEME.accent}; - border-radius: 8px; - padding: 0; - box-shadow: 0 5px 15px rgba(0,0,0,0.5); - z-index: 9999; - font-family: 'Segoe UI', Roboto, sans-serif; - color: ${CONFIG.THEME.text}; - animation: slideIn 0.4s ease-out; - overflow: hidden; - } - .wplace-header { - padding: 12px 15px; - background: ${CONFIG.THEME.secondary}; - color: ${CONFIG.THEME.highlight}; - font-size: 16px; - font-weight: 600; - display: flex; - justify-content: space-between; - align-items: center; - cursor: move; - user-select: none; - } - .wplace-header-title { - display: flex; - align-items: center; - gap: 8px; - } - .wplace-header-controls { - display: flex; - gap: 10px; - } - .wplace-header-btn { - background: none; - border: none; - color: ${CONFIG.THEME.text}; - cursor: pointer; - opacity: 0.7; - transition: opacity 0.2s; - } - .wplace-header-btn:hover { - opacity: 1; - } - .wplace-content { - padding: 15px; - display: ${state.minimized ? 'none' : 'block'}; - } - .wplace-controls { - display: flex; - gap: 10px; - margin-bottom: 15px; - } - .wplace-btn { - flex: 1; - padding: 10px; - border: none; - border-radius: 6px; - font-weight: 600; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - gap: 8px; - transition: all 0.2s; - } - .wplace-btn:hover { - transform: translateY(-2px); - } - .wplace-btn-primary { - background: ${CONFIG.THEME.accent}; - color: white; - } - .wplace-btn-stop { - background: ${CONFIG.THEME.error}; - color: white; - } - .wplace-stats { - background: ${CONFIG.THEME.secondary}; - padding: 12px; - border-radius: 6px; - margin-bottom: 15px; - } - .wplace-stat-item { - display: flex; - justify-content: space-between; - padding: 6px 0; - font-size: 14px; - } - .wplace-stat-label { - display: flex; - align-items: center; - gap: 6px; - opacity: 0.8; - } - .wplace-status { - padding: 8px; - border-radius: 4px; - text-align: center; - font-size: 13px; - } - .status-default { - background: rgba(255,255,255,0.1); - } - .status-success { - background: rgba(0, 255, 0, 0.1); - color: ${CONFIG.THEME.success}; - } - .status-error { - background: rgba(255, 0, 0, 0.1); - color: ${CONFIG.THEME.error}; - } - #paintEffect { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - pointer-events: none; - border-radius: 8px; - } - `; - document.head.appendChild(style); - - const translations = { - pt: { - title: "WPlace Auto-Farm", - start: "Iniciar", - stop: "Parar", - ready: "Pronto para começar", - user: "Usuário", - pixels: "Pixels", - charges: "Cargas", - level: "Level" - }, - en: { - title: "WPlace Auto-Farm", - start: "Start", - stop: "Stop", - ready: "Ready to start", - user: "User", - pixels: "Pixels", - charges: "Charges", - level: "Level" - } - }; - - const t = translations[state.language] || translations.en; - - const panel = document.createElement('div'); - panel.className = 'wplace-bot-panel'; - panel.innerHTML = ` -
-
-
- - ${t.title} -
-
- -
-
-
-
- - -
- -
-
-
-
${state.language === 'pt' ? 'Carregando...' : 'Loading...'}
-
-
-
- -
- ${t.ready} -
-
- `; - - document.body.appendChild(panel); - - const header = panel.querySelector('.wplace-header'); - let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; - - header.onmousedown = dragMouseDown; - - function dragMouseDown(e) { - if (e.target.closest('.wplace-header-btn')) return; - - e = e || window.event; - e.preventDefault(); - pos3 = e.clientX; - pos4 = e.clientY; - document.onmouseup = closeDragElement; - document.onmousemove = elementDrag; - } - - function elementDrag(e) { - e = e || window.event; - e.preventDefault(); - pos1 = pos3 - e.clientX; - pos2 = pos4 - e.clientY; - pos3 = e.clientX; - pos4 = e.clientY; - panel.style.top = (panel.offsetTop - pos2) + "px"; - panel.style.left = (panel.offsetLeft - pos1) + "px"; - } - - function closeDragElement() { - document.onmouseup = null; - document.onmousemove = null; - } - - const toggleBtn = panel.querySelector('#toggleBtn'); - const minimizeBtn = panel.querySelector('#minimizeBtn'); - const statusText = panel.querySelector('#statusText'); - const content = panel.querySelector('.wplace-content'); - const statsArea = panel.querySelector('#statsArea'); - - toggleBtn.addEventListener('click', () => { - state.running = !state.running; - - if (state.running && !capturedCaptchaToken) { - updateUI(state.language === 'pt' ? '❌ Token não capturado. Clique em qualquer pixel primeiro.' : '❌ CAPTCHA token not captured. Please click any pixel manually first.', 'error'); - state.running = false; - return; - } - - if (state.running) { - toggleBtn.innerHTML = ` ${t.stop}`; - toggleBtn.classList.remove('wplace-btn-primary'); - toggleBtn.classList.add('wplace-btn-stop'); - updateUI(state.language === 'pt' ? '🚀 Pintura iniciada!' : '🚀 Painting started!', 'success'); - paintLoop(); - } else { - toggleBtn.innerHTML = ` ${t.start}`; - toggleBtn.classList.add('wplace-btn-primary'); - toggleBtn.classList.remove('wplace-btn-stop'); - statsArea.innerHTML = ''; - updateUI(state.language === 'pt' ? '⏹️ Parado' : '⏹️ Stopped', 'default'); - } - }); - - minimizeBtn.addEventListener('click', () => { - state.minimized = !state.minimized; - content.style.display = state.minimized ? 'none' : 'block'; - minimizeBtn.innerHTML = ``; - }); - - const autoRefreshCheckbox = panel.querySelector('#autoRefreshCheckbox'); - autoRefreshCheckbox.addEventListener('change', () => { - state.autoRefresh = autoRefreshCheckbox.checked; - }); - - window.addEventListener('beforeunload', () => { - state.menuOpen = false; - }); - }; - - window.updateUI = (message, type = 'default') => { - const statusText = document.querySelector('#statusText'); - if (statusText) { - statusText.textContent = message; - statusText.className = `wplace-status status-${type}`; - statusText.style.animation = 'none'; - void statusText.offsetWidth; - statusText.style.animation = 'slideIn 0.3s ease-out'; - } - }; - - window.updateStats = async () => { - await getCharge(); - const statsArea = document.querySelector('#statsArea'); - if (statsArea) { - const t = { - pt: { - user: "Usuário", - pixels: "Pixels", - charges: "Cargas", - level: "Level" - }, - en: { - user: "User", - pixels: "Pixels", - charges: "Charges", - level: "Level" - } - }[state.language] || { - user: "User", - pixels: "Pixels", - charges: "Charges", - level: "Level" - }; - - statsArea.innerHTML = ` -
-
${t.user}
-
${state.userInfo.name}
-
-
-
${t.pixels}
-
${state.paintedCount}
-
-
-
${t.charges}
-
${Math.floor(state.charges.count)}/${Math.floor(state.charges.max)}
-
-
-
${t.level}
-
${state.userInfo?.level || '0'}
-
- `; - } - }; - - await detectUserLocation(); - createUI(); - await getCharge(); - updateStats(); -})(); diff --git a/Auto-Image.js b/Auto-Image.js index 2f22e98..a50ace5 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -4493,12 +4493,7 @@ } if (!statsContainer || !statsArea || !closeStatsBtn) { - console.error("Stats UI elements not found:", { - statsContainer: !!statsContainer, - statsArea: !!statsArea, - closeStatsBtn: !!closeStatsBtn, - }) - } + // Note: base CSS now aligns with this layout: main panel at left:20px (width 280), stats at left:330px. const header = container.querySelector(".wplace-header") diff --git a/auto-image-complete-styles.css b/auto-image-complete-styles.css index 1f42eb4..9182f9d 100644 --- a/auto-image-complete-styles.css +++ b/auto-image-complete-styles.css @@ -1,338 +1,681 @@ -/* WPlace Auto-Image Bot - Complete CSS Styles */ -/* All styling separated from JavaScript */ +/* WPlace Auto-Image Bot - Unified CSS Styles (decoupled from JS) + Why: bring external CSS in-sync with the UI that Auto-Image.js renders, + fix layout (positions, widths, z-index), and ensure class names match JS + (e.g., .wplace-dragging) so buttons and panels behave correctly. */ -/* Main Container Base Styles */ +/* ========================= */ +/* Core animations (shared) */ +/* ========================= */ + @keyframes neonGlow { + 0%, + 100% { + text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, + 0 0 15px currentColor; + } + 50% { + text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, + 0 0 8px currentColor; + } +} + + @keyframes pixelBlink { + 0%, + 50% { + opacity: 1; + } + 51%, + 100% { + opacity: 0.7; + } +} + + @keyframes scanline { + 0% { + transform: translateY(-100%); + } + 100% { + transform: translateY(400px); + } +} + + @keyframes pulse { + 0% { + box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); + } + 70% { + box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); + } + 100% { + box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); + } +} + + @keyframes slideIn { + from { + transform: translateY(-10px); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } +} + + @keyframes slideDown { + from { + transform: translateX(-50%) translateY(-20px); + opacity: 0; + } + to { + transform: translateX(-50%) translateY(0); + opacity: 1; + } +} + + @keyframes shimmer { + 0% { + transform: translateX(-100%); + } + 100% { + transform: translateX(100%); + } +} + +/* ========================= */ +/* Main containers (fixed) */ +/* Align with JS structure */ +/* ========================= */ #wplace-image-bot-container { - position: fixed !important; - top: 20px !important; - left: 20px !important; - z-index: 10000 !important; - max-width: 400px !important; + /* Why fixed sizes/positions: matches JS expectations and preserves two-panel layout */ + position: fixed; + top: 20px; + left: 20px; + width: 280px; + max-height: calc(100vh - 40px); + padding: 0; + z-index: 9998; + animation: slideIn 0.4s ease-out; + overflow-y: auto; + overflow-x: hidden; + transition: all 0.3s ease; + user-select: none; + display: none; /* JS will set display: block inline when ready */ +} + +#wplace-image-bot-container.wplace-dragging { + transition: none; + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), + 0 0 0 2px rgba(255, 255, 255, 0.2); + transform: scale(1.02); + z-index: 9999; +} + +#wplace-image-bot-container.wplace-compact { + width: 240px; +} + +#wplace-image-bot-container.wplace-minimized { + width: 200px; + height: auto; + overflow: hidden; +} + +/* Stats container sits to the right of main (280 + 30 = 330) */ +#wplace-stats-container { + position: fixed; + top: 20px; + left: 330px; + width: 280px; + max-height: calc(100vh - 40px); + padding: 0; + z-index: 9997; + animation: slideIn 0.4s ease-out; + overflow-y: auto; + transition: all 0.3s ease; + user-select: none; display: none; } -/* Stats Container Positioning */ -#wplace-stats-container { - position: fixed !important; - top: 60px !important; - right: 20px !important; - z-index: 10001 !important; - max-width: 350px !important; - display: none !important; +#wplace-stats-container.wplace-dragging { + transition: none; } -/* Resize Dialog Containers */ -.resize-container { - position: fixed !important; - top: 50% !important; - left: 50% !important; - transform: translate(-50%, -50%) !important; - z-index: 100000 !important; - max-width: 90vw !important; - max-height: 90vh !important; - display: none !important; +/* Back-compat for legacy class (some earlier CSS used this) */ +.wplace-drag-active { + transition: none !important; + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), + 0 0 0 2px rgba(255, 255, 255, 0.2) !important; + transform: scale(1.02) !important; + z-index: 9999 !important; } -.resize-overlay { - position: fixed !important; - top: 0 !important; - left: 0 !important; - width: 100% !important; - height: 100% !important; - background: rgba(0, 0, 0, 0.8) !important; - z-index: 99999 !important; - display: none !important; +/* ========================= */ +/* Header and content blocks */ +/* ========================= */ +.wplace-header { + display: flex; + justify-content: space-between; + align-items: center; + cursor: move; + user-select: none; + transition: background 0.2s ease; + position: relative; + z-index: 2; + padding: 8px 12px; } -/* CSS Custom Properties for Dynamic Values */ -:root { - /* Default Theme Colors */ - --wplace-primary: #000000; - --wplace-secondary: #111111; - --wplace-accent: #775ce3; - --wplace-text: #ffffff; - --wplace-success: #00ff00; - --wplace-error: #ff0000; - --wplace-warning: #ffa500; - - /* Layout Properties */ - --wplace-border-width: 1px; - --wplace-border-style: solid; - --wplace-border-radius: 16px; - --wplace-padding: 16px; - - /* Animation Properties */ - --wplace-glow-enabled: 0; - --wplace-pixel-blink-enabled: 0; - --wplace-scanline-enabled: 0; - - /* Overlay Properties */ - --wplace-overlay-opacity: 0.6; +.wplace-header-title { + display: flex; + align-items: center; + gap: 6px; } -/* Theme Variants */ -.theme-cyberpunk { - --wplace-primary: #0a0a0a; - --wplace-secondary: #1a1a2e; - --wplace-accent: #00ffff; - --wplace-text: #00ff00; - --wplace-glow-enabled: 1; - --wplace-pixel-blink-enabled: 1; +.wplace-header-controls { + display: flex; + gap: 6px; } -.theme-neon { - --wplace-primary: #0f0f23; - --wplace-secondary: #16213e; - --wplace-accent: #ff006e; - --wplace-text: #ffffff; - --wplace-glow-enabled: 1; +.wplace-header-btn { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.2s; + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: none; + border-radius: 4px; + width: 18px; + height: 18px; + font-size: 10px; } -.theme-matrix { - --wplace-primary: #000000; - --wplace-secondary: #001100; - --wplace-accent: #00ff00; - --wplace-text: #00ff00; - --wplace-scanline-enabled: 1; +.wplace-header-btn:hover { + transform: scale(1.1); } -.theme-minimal { - --wplace-primary: #ffffff; - --wplace-secondary: #f5f5f5; - --wplace-accent: #007acc; - --wplace-text: #333333; +.wplace-content { + display: block; + position: relative; + z-index: 2; + padding: 12px; } -/* Base Animations */ -@keyframes neonGlow { - 0%, 100% { - text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor; - } - 50% { - text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor; - } +.wplace-content.wplace-hidden { + display: none; } -@keyframes pixelBlink { - 0%, 50% { opacity: 1; } - 51%, 100% { opacity: 0.7; } +/* Sections */ +.wplace-status-section { + margin-bottom: 12px; + padding: 8px; + background: rgba(255, 255, 255, 0.03); + border: 1px solid rgba(255, 255, 255, 0.1); } -@keyframes scanline { - 0% { transform: translateY(-100%); } - 100% { transform: translateY(400px); } +.wplace-section { + margin-bottom: 12px; + padding: 12px; + background: rgba(255, 255, 255, 0.03); + border: 1px solid rgba(255, 255, 255, 0.1); } -@keyframes pulse { - 0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); } - 70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); } - 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); } +.wplace-section-title { + font-size: 11px; + font-weight: 600; + margin-bottom: 8px; + display: flex; + align-items: center; + gap: 6px; + text-transform: uppercase; + letter-spacing: 0.5px; } -@keyframes slideIn { - from { transform: translateY(-10px); opacity: 0; } - to { transform: translateY(0); opacity: 1; } +/* ========================= */ +/* Controls and buttons */ +/* ========================= */ +.wplace-controls { + display: flex; + flex-direction: column; + gap: 8px; } -@keyframes slideDown { - from { transform: translateX(-50%) translateY(-20px); opacity: 0; } - to { transform: translateX(-50%) translateY(0); opacity: 1; } +.wplace-row { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 8px; } -@keyframes shimmer { - 0% { transform: translateX(-100%); } - 100% { transform: translateX(100%); } +.wplace-row.single { + grid-template-columns: 1fr; } -/* Conditional Animations Based on Theme */ -.theme-cyberpunk .wplace-header, -.theme-neon .wplace-header { - animation: neonGlow 2s ease-in-out infinite alternate; +.wplace-btn { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + padding: 8px 12px; + border-radius: 8px; + border: none; } -.theme-cyberpunk .fas, -.theme-cyberpunk .fa, -.theme-neon .fas, -.theme-neon .fa { - filter: drop-shadow(0 0 3px currentColor); +.wplace-btn::before { + content: ''; + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background: linear-gradient( + 90deg, + transparent, + rgba(255, 255, 255, 0.2), + transparent + ); + transition: left 0.5s; } -.theme-cyberpunk .wplace-btn:hover:not(:disabled), -.theme-cyberpunk .status-error, -.theme-cyberpunk .wplace-progress-bar::after { - animation: pixelBlink 0.5s infinite; +.wplace-btn:hover::before { + left: 100%; } -.theme-matrix::before { +.wplace-btn:hover:not(:disabled) { + box-shadow: 0 0 15px currentColor; +} + +.wplace-btn:active:not(:disabled) { + transform: translateY(0); +} + +.wplace-btn:disabled { + opacity: 0.3; + cursor: not-allowed; + transform: none !important; + box-shadow: none !important; +} + +.wplace-btn:disabled::before { + display: none; +} + +.wplace-btn-overlay.active { + background: linear-gradient(135deg, #29b6f6 0%, #8e2de2 100%); + box-shadow: 0 0 15px #8e2de2; +} + +/* ========================= */ +/* Stats and progress */ +/* ========================= */ +.wplace-stats { + margin-bottom: 8px; +} + +.wplace-stat-item { + display: flex; + justify-content: space-between; + padding: 4px 0; + font-size: 11px; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); +} + +.wplace-stat-item:last-child { + border-bottom: none; +} + +.wplace-stat-label { + display: flex; + align-items: center; + gap: 6px; + opacity: 0.9; + font-size: 10px; +} + +.wplace-stat-value { + font-weight: 600; +} + +.wplace-colors-section { + margin-top: 10px; + padding-top: 8px; + border-top: 1px solid rgba(255, 255, 255, 0.05); +} + +.wplace-stat-colors-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); + gap: 4px; + margin-top: 8px; + padding: 4px; + background: rgba(0, 0, 0, 0.2); + border-radius: 4px; + max-height: 80px; + overflow-y: auto; +} + +.wplace-stat-color-swatch { + width: 16px; + height: 16px; + border-radius: 3px; + border: 1px solid rgba(255, 255, 255, 0.1); + box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5); +} + +/* Progress */ +.wplace-progress { + width: 100%; + overflow: hidden; + position: relative; + background: rgba(0, 0, 0, 0.3); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 8px; + margin: 8px 0; + height: 6px; +} + +.wplace-progress-bar { + position: relative; + height: 6px; + transition: width 0.5s ease; +} + +.wplace-progress-bar::after { content: ''; position: absolute; top: 0; left: 0; right: 0; - height: 2px; - background: linear-gradient(90deg, transparent, var(--wplace-accent), transparent); - animation: scanline 3s linear infinite; - pointer-events: none; + bottom: 0; + background: linear-gradient( + 90deg, + transparent, + rgba(255, 255, 255, 0.3), + transparent + ); + animation: shimmer 2s infinite; } -/* Turnstile Container Styles */ -.wplace-turnstile-hidden { - position: fixed !important; - left: -99999px !important; - top: -99999px !important; - width: 1px !important; - height: 1px !important; - pointer-events: none !important; - opacity: 0 !important; - visibility: hidden !important; - z-index: -99999 !important; - overflow: hidden !important; -} - -.wplace-turnstile-overlay { - position: fixed !important; - bottom: 20px !important; - right: 20px !important; - z-index: 99999 !important; - background: rgba(0,0,0,0.9) !important; - border-radius: 12px !important; - padding: 20px !important; - box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important; - backdrop-filter: blur(10px) !important; - border: 1px solid rgba(255,255,255,0.2) !important; - color: var(--wplace-text) !important; - font-family: "Segoe UI", sans-serif !important; - min-width: 300px !important; - max-width: 400px !important; -} - -.wplace-turnstile-title { - font: 600 12px/1.3 "Segoe UI", sans-serif !important; - margin-bottom: 8px !important; - opacity: 0.9 !important; - color: var(--wplace-text) !important; -} - -.wplace-turnstile-host { - width: 100% !important; - min-height: 70px !important; -} - -.wplace-turnstile-hide-btn { - position: absolute !important; - top: 6px !important; - right: 6px !important; - font-size: 11px !important; - background: transparent !important; - color: var(--wplace-text) !important; - border: 1px solid rgba(255,255,255,0.2) !important; - border-radius: 6px !important; - padding: 2px 6px !important; - cursor: pointer !important; -} - -.wplace-turnstile-hide-btn:hover { - background: rgba(255,255,255,0.1) !important; -} - -/* Alert System */ -.wplace-alert { - position: fixed; - top: 20px; - left: 50%; - transform: translateX(-50%); - padding: 12px 20px; - border-radius: 8px; - color: white; - font-weight: 600; - z-index: 10001; - max-width: 400px; +/* ========================= */ +/* Status blocks */ +/* ========================= */ +.wplace-status { text-align: center; - animation: slideDown 0.3s ease-out; + position: relative; + overflow: hidden; + padding: 6px; + border: 1px solid; + border-radius: 8px; + font-size: 11px; } -.wplace-alert-success { - background: linear-gradient(135deg, #4caf50, #66bb6a); - box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); +.status-default { + background: rgba(255, 255, 255, 0.1); } -.wplace-alert-error { - background: linear-gradient(135deg, #f44336, #ef5350); - box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3); +.status-success { + background: rgba(0, 255, 0, 0.1); + box-shadow: 0 0 15px currentColor; } -.wplace-alert-warning { - background: linear-gradient(135deg, #ff9800, #ffb74d); - box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3); +.status-error { + background: rgba(255, 0, 0, 0.1); + box-shadow: 0 0 15px currentColor; } -.wplace-alert-info { - background: linear-gradient(135deg, #2196f3, #42a5f5); - box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3); +.status-warning { + background: rgba(255, 165, 0, 0.1); + box-shadow: 0 0 15px currentColor; } -/* Settings Container */ -.wplace-settings-container { +/* ========================= */ +/* Resize dialog */ +/* ========================= */ +.resize-container { + display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); - background: var(--wplace-primary); - border: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-accent); - border-radius: var(--wplace-border-radius); - padding: 0; - z-index: 100001; - display: none; - color: var(--wplace-text); - font-family: "Segoe UI", Roboto, sans-serif; - min-width: 400px; - max-width: 500px; - max-height: 80vh; - overflow-y: auto; - box-shadow: 0 20px 60px rgba(0,0,0,0.5); + z-index: 10000; + width: 90%; + max-width: 700px; + max-height: 90%; + overflow: auto; } -.wplace-settings-container.show { - display: block; - animation: slideIn 0.3s ease-out; -} - -/* Settings Header */ -.wplace-settings-header { - background: var(--wplace-secondary); - padding: var(--wplace-padding); - border-bottom: 1px solid var(--wplace-accent); +.resize-preview-wrapper { display: flex; - justify-content: space-between; + justify-content: center; + align-items: center; + background: rgba(0, 0, 0, 0.2); + margin: 15px 0; + height: 300px; + overflow: hidden; +} + +.resize-canvas-stack { + position: relative; + transform-origin: center center; + display: inline-block; +} + +.resize-base-canvas, +.resize-mask-canvas { + position: absolute; + left: 0; + top: 0; + image-rendering: pixelated; + image-rendering: -moz-crisp-edges; + image-rendering: crisp-edges; +} + +.resize-mask-canvas { + pointer-events: auto; +} + +.resize-tools { + display: flex; + gap: 8px; + align-items: center; + margin-top: 8px; + font-size: 12px; +} + +.resize-tools button { + padding: 6px 10px; + border-radius: 6px; + border: 1px solid rgba(255, 255, 255, 0.2); + background: rgba(255, 255, 255, 0.06); + color: #fff; + cursor: pointer; +} + +.wplace-btn.active, +.wplace-btn[aria-pressed='true'] { + box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, + 0 0 6px rgba(0, 0, 0, 0.2) !important; +} + +.mask-mode-group .wplace-btn.active, +.mask-mode-group .wplace-btn[aria-pressed='true'] { + box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, + 0 0 6px rgba(0, 0, 0, 0.2); +} + +.resize-controls { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 15px; align-items: center; } -.wplace-settings-title { - color: var(--wplace-accent); - font-size: 18px; - font-weight: 600; +.resize-slider { + width: 100%; + outline: none; + -webkit-appearance: none; +} + +.resize-zoom-controls { + grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; + margin-top: 15px; } -.wplace-settings-close { - background: none; - border: none; - color: var(--wplace-text); - font-size: 18px; +.resize-buttons { + display: flex; + gap: 10px; + justify-content: center; + margin-top: 20px; +} + +.resize-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.8); + z-index: 9999; + display: none; +} + +/* ========================= */ +/* Color grid */ +/* ========================= */ +.wplace-color-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); + gap: 10px; + padding-top: 8px; + max-height: 300px; + overflow-y: auto; +} + +.wplace-color-item { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; +} + +.wplace-color-item-name { + font-size: 9px; + color: #ccc; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 100%; +} + +.wplace-color-swatch { + width: 22px; + height: 22px; + border: 1px solid rgba(255, 255, 255, 0.2); + border-radius: 4px; cursor: pointer; - opacity: 0.7; - transition: opacity 0.2s; + transition: transform 0.1s ease, box-shadow 0.2s ease; + position: relative; + margin: 0 auto; } -.wplace-settings-close:hover { - opacity: 1; +.wplace-color-swatch.unavailable { + border-color: #666; + border-style: dashed; + cursor: not-allowed; +} + +.wplace-color-swatch:hover { + transform: scale(1.1); + z-index: 1; +} + +.wplace-color-swatch:not(.active) { + opacity: 0.3; + filter: grayscale(80%); +} + +.wplace-color-swatch.unavailable:not(.active) { + opacity: 0.2; + filter: grayscale(90%); +} + +.wplace-color-swatch.active::after { + content: '✔'; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: white; + font-size: 12px; + font-weight: bold; + text-shadow: 0 0 3px black; +} + +.wplace-color-divider { + border: none; + height: 1px; + background: rgba(255, 255, 255, 0.1); + margin: 8px 0; +} + +/* ========================= */ +/* Cooldown controls */ +/* ========================= */ +.wplace-cooldown-control { + margin-top: 8px; +} + +.wplace-cooldown-control label { + font-size: 11px; + margin-bottom: 4px; + display: block; +} + +.wplace-slider-container { + display: flex; + align-items: center; + gap: 8px; +} + +.wplace-slider { + flex: 1; + -webkit-appearance: none; + appearance: none; + height: 4px; + background: #444; + border-radius: 2px; + outline: none; +} + +.wplace-slider::-webkit-slider-thumb { + -webkit-appearance: none; + width: 14px; + height: 14px; + border-radius: 50%; + cursor: pointer; +} + +/* ========================= */ +/* Settings container (base) */ +/* ========================= */ +#wplace-settings-container { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 10001; + min-width: 400px; + max-width: 500px; } -/* Settings Content */ .wplace-settings { - padding: var(--wplace-padding); + padding: 16px; max-height: 400px; overflow-y: auto; } @@ -340,9 +683,6 @@ .wplace-setting-section { margin-bottom: 20px; padding: 12px; - background: rgba(255,255,255,0.03); - border: 1px solid rgba(255,255,255,0.1); - border-radius: 8px; } .wplace-setting-title { @@ -351,43 +691,36 @@ margin-bottom: 12px; font-size: 14px; font-weight: 600; - color: var(--wplace-accent); } .wplace-setting-title i { margin-right: 8px; } -/* Form Controls */ +/* ========================= */ +/* Form controls */ +/* ========================= */ .wplace-select { width: 100%; padding: 8px 12px; font-size: 14px; margin-bottom: 10px; - background: var(--wplace-secondary); - border: 1px solid var(--wplace-accent); - border-radius: 6px; - color: var(--wplace-text); } .wplace-select:focus { outline: none; - box-shadow: 0 0 0 2px rgba(119, 92, 227, 0.3); } .wplace-description { font-size: 12px; opacity: 0.8; line-height: 1.4; - color: var(--wplace-text); } -/* Speed Controls */ +/* Speed controls */ .wplace-speed-control { margin-top: 12px; padding: 12px; - background: rgba(255,255,255,0.03); - border-radius: 8px; } .wplace-speed-label { @@ -396,7 +729,6 @@ margin-bottom: 8px; font-size: 13px; font-weight: 600; - color: var(--wplace-text); } .wplace-speed-label i { @@ -417,7 +749,6 @@ cursor: pointer; -webkit-appearance: none; appearance: none; - background: #444; } .wplace-speed-slider::-webkit-slider-thumb { @@ -427,8 +758,7 @@ height: 18px; border-radius: 50%; cursor: pointer; - border: 2px solid var(--wplace-accent); - background: var(--wplace-accent); + border: 2px solid; } .wplace-speed-slider::-moz-range-thumb { @@ -436,8 +766,7 @@ height: 18px; border-radius: 50%; cursor: pointer; - border: 2px solid var(--wplace-accent); - background: var(--wplace-accent); + border: 2px solid; } .wplace-speed-display { @@ -446,194 +775,76 @@ gap: 4px; min-width: 90px; justify-content: flex-end; - padding: 5px 10px; - border-radius: 4px; - font-weight: 600; - background: var(--wplace-secondary); - color: var(--wplace-text); } -.wplace-speed-unit { - font-size: 11px; - opacity: 0.8; +/* ========================= */ +/* Turnstile overlay */ +/* ========================= */ +/* Hidden invisible widget host (token generator) */ +.wplace-turnstile-hidden { + position: fixed !important; + left: -99999px !important; + top: -99999px !important; + width: 1px !important; + height: 1px !important; + pointer-events: none !important; + opacity: 0 !important; + visibility: hidden !important; + z-index: -99999 !important; + overflow: hidden !important; } -/* Theme Customization */ -.wplace-theme-custom { - margin-top: 15px; - padding: 15px; - background: rgba(255,255,255,0.03); - border-radius: 8px; +/* Visible overlay (interactive fallback) */ +.wplace-turnstile-overlay { + position: fixed !important; + bottom: 20px !important; + right: 20px !important; + z-index: 99999 !important; + background: rgba(0, 0, 0, 0.9) !important; + border-radius: 12px !important; + padding: 20px !important; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important; + backdrop-filter: blur(10px) !important; + border: 1px solid rgba(255, 255, 255, 0.2) !important; + color: #fff !important; + font-family: 'Segoe UI', sans-serif !important; + min-width: 300px !important; + max-width: 400px !important; } -.wplace-custom-group { - margin-bottom: 15px; -} - -.wplace-custom-label { - display: flex; - align-items: center; - margin-bottom: 8px; - font-size: 13px; - font-weight: 600; - color: var(--wplace-text); -} - -.wplace-custom-label i { - margin-right: 8px; - width: 16px; -} - -.wplace-color-input-group { - display: flex; - gap: 8px; - align-items: center; -} - -.wplace-color-input { - width: 50px; - height: 30px; - border: none; - border-radius: 4px; - cursor: pointer; - background: transparent; -} - -.wplace-color-text { - flex: 1; - padding: 6px 10px; - border-radius: 4px; - font-size: 12px; - font-family: monospace; - background: var(--wplace-secondary); - border: 1px solid var(--wplace-accent); - color: var(--wplace-text); -} - -.wplace-animation-controls { - display: flex; - flex-direction: column; - gap: 8px; -} - -.wplace-checkbox-label { - display: flex; - align-items: center; - gap: 8px; - font-size: 12px; - cursor: pointer; - color: var(--wplace-text); -} - -.wplace-custom-actions { - display: flex; - gap: 10px; - margin-top: 20px; - border-top: 1px solid rgba(255,255,255,0.1); - padding-top: 15px; -} - -/* Overlay Styles */ -.wplace-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.8); - z-index: 100002; - display: none; -} - -.wplace-overlay.show { - display: block; -} - -/* Overlay visibility classes */ -.wplace-overlay-hidden { - display: none !important; -} - -.wplace-overlay-visible { - display: block !important; -} - -/* Responsive Design */ -@media (max-width: 768px) { - .wplace-settings-container { - min-width: 90vw; - max-width: 90vw; - margin: 20px; - } - - .wplace-turnstile-overlay { - bottom: 10px !important; - right: 10px !important; - left: 10px !important; - min-width: auto !important; - } - - .wplace-alert { - max-width: 90vw; - margin: 0 5vw; - } -} - -/* Dark/Light mode support */ -@media (prefers-color-scheme: light) { - .theme-auto { - --wplace-primary: #ffffff; - --wplace-secondary: #f5f5f5; - --wplace-accent: #007acc; - --wplace-text: #333333; - } -} - -@media (prefers-color-scheme: dark) { - .theme-auto { - --wplace-primary: #1e1e1e; - --wplace-secondary: #2d2d30; - --wplace-accent: #775ce3; - --wplace-text: #ffffff; - } -} - -/* =============================================== */ -/* EXTRACTED INLINE STYLES - PREVIOUSLY IN JS */ -/* =============================================== */ - -/* Turnstile Overlay Styles - extracted from createTurnstileOverlay */ .wplace-turnstile-title { - font: 600 12px/1.3 "Segoe UI", sans-serif; - margin-bottom: 8px; - opacity: 0.9; - color: var(--wplace-text, #ffffff); + font: 600 12px/1.3 'Segoe UI', sans-serif !important; + margin-bottom: 8px !important; + opacity: 0.9 !important; + color: #ffffff !important; } .wplace-turnstile-host { - width: 100%; - min-height: 70px; + width: 100% !important; + min-height: 70px !important; } .wplace-turnstile-hide-btn { - position: absolute; - top: 6px; - right: 6px; - font-size: 11px; - background: transparent; - color: var(--wplace-text, #ffffff); - border: 1px solid rgba(255, 255, 255, 0.2); - border-radius: 6px; - padding: 2px 6px; - cursor: pointer; - transition: background 0.2s ease; + position: absolute !important; + top: 6px !important; + right: 6px !important; + font-size: 11px !important; + background: transparent !important; + color: #ffffff !important; + border: 1px solid rgba(255, 255, 255, 0.2) !important; + border-radius: 6px !important; + padding: 2px 6px !important; + cursor: pointer !important; + transition: background 0.2s ease !important; } .wplace-turnstile-hide-btn:hover { - background: rgba(255, 255, 255, 0.1); + background: rgba(255, 255, 255, 0.1) !important; } -/* Alert System Styles - extracted from showAlert */ +/* ========================= */ +/* Alert system (used by JS) */ +/* ========================= */ .wplace-alert-base { position: fixed; top: 20px; @@ -647,11 +858,10 @@ max-width: 400px; text-align: center; animation: slideDown 0.3s ease-out; - box-shadow: 0 4px 12px rgba(0,0,0,0.3); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); font-family: 'Segoe UI', sans-serif; } -/* Alert type variants - extracted from showAlert colors object */ .wplace-alert-info { background: linear-gradient(135deg, #3498db, #2980b9); box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); @@ -672,7 +882,84 @@ box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3); } -/* Settings Container Base Styles - extracted from showSettings */ +/* ========================= */ +/* Modal overlay helpers */ +/* ========================= */ +.wplace-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.8); + z-index: 100002; + display: none; +} + +.wplace-overlay.show { + display: block; +} + +/* Overlay visibility helpers */ +.wplace-overlay-hidden { + display: none !important; +} + +.wplace-overlay-visible { + display: block !important; +} + +/* ========================= */ +/* Responsive tweaks */ +/* ========================= */ + @media (max-width: 768px) { + #wplace-image-bot-container { + left: 10px; + width: calc(100vw - 20px); + max-height: calc(100vh - 20px); + } + + #wplace-stats-container { + display: none !important; /* hide secondary panel on small screens */ + } + + .wplace-alert-base { + max-width: 90vw; + margin: 0 5vw; + } + + .wplace-turnstile-overlay { + bottom: 10px !important; + right: 10px !important; + left: 10px !important; + min-width: auto !important; + } +} + +/* ========================= */ +/* Auto light/dark support */ +/* ========================= */ + @media (prefers-color-scheme: light) { + .theme-auto { + --wplace-primary: #ffffff; + --wplace-secondary: #f5f5f5; + --wplace-accent: #007acc; + --wplace-text: #333333; + } +} + + @media (prefers-color-scheme: dark) { + .theme-auto { + --wplace-primary: #1e1e1e; + --wplace-secondary: #2d2d30; + --wplace-accent: #775ce3; + --wplace-text: #ffffff; + } +} + +/* ===================================== */ +/* Settings container variants (optional)*/ +/* ===================================== */ .wplace-settings-container-base { position: fixed; top: 50%; @@ -680,13 +967,13 @@ transform: translate(-50%, -50%); z-index: 100001; display: none; - font-family: "Segoe UI", Roboto, sans-serif; + font-family: 'Segoe UI', Roboto, sans-serif; min-width: 400px; max-width: 500px; max-height: 80vh; overflow-y: auto; animation: slideIn 0.3s ease-out; - border: 1px solid var(--wplace-accent, rgba(255,255,255,0.1)); + border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 0; } @@ -695,63 +982,9 @@ display: block; } -/* Dynamic Theme Background Classes */ -.wplace-theme-classic { - background: linear-gradient(135deg, var(--wplace-primary, #000000) 0%, #1a1a1a 100%); -} - -.wplace-theme-standard { - background: var(--wplace-primary, #000000); -} - -/* Settings Container Theme Variations */ -.wplace-settings-cyberpunk { - background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%); -} - -.wplace-settings-neon { - background: linear-gradient(135deg, #0f0f23 0%, #16213e 50%, #240046 100%); -} - -.wplace-settings-matrix { - background: linear-gradient(135deg, #000000 0%, #001100 50%, #002200 100%); -} - -.wplace-settings-retro { - background: linear-gradient(135deg, #2c3e50 0%, #3498db 50%, #9b59b6 100%); -} - -.wplace-settings-minimal { - background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%); -} - -.wplace-settings-synthwave { - background: linear-gradient(135deg, #1a0033 0%, #2d1b69 50%, #11998e 100%); -} - -.wplace-settings-vapor { - background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -} - -/* Color swatch states - extracted from updateColorGrid */ -.wplace-color-swatch.unavailable { - opacity: 0.4; - filter: grayscale(50%); -} - -/* Stats container visibility - extracted from toggleStats */ -.wplace-stats-container.hidden { - display: none; -} - -/* Additional utility classes for dynamic behavior */ -.wplace-drag-active { - transition: none !important; - box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.2) !important; - transform: scale(1.02) !important; - z-index: 9999 !important; -} - +/* ===================================== */ +/* Utility styles */ +/* ===================================== */ .wplace-paint-effect { animation: pulse 0.5s ease-out; } @@ -760,37 +993,6 @@ background: rgba(255, 0, 0, 0.4) !important; } -/* Animation modifier classes for conditional application */ -.wplace-glow-animation .wplace-header { - animation: neonGlow 2s ease-in-out infinite alternate; +.wplace-stats-container.hidden { + display: none; } - -.wplace-glow-animation .fas, -.wplace-glow-animation .fa { - filter: drop-shadow(0 0 3px currentColor); -} - -.wplace-blink-animation .wplace-btn:hover:not(:disabled) { - animation: pixelBlink 0.5s infinite; -} - -.wplace-blink-animation .status-error { - animation: pixelBlink 0.5s infinite; -} - -.wplace-blink-animation .wplace-progress-bar::after { - animation: pixelBlink 1s infinite; -} - -.wplace-scanline-animation::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 2px; - background: linear-gradient(90deg, transparent, var(--wplace-neon, #00ffff), transparent); - animation: scanline 3s linear infinite; - z-index: 1; - pointer-events: none; -} \ No newline at end of file From 825a333d3359e597d6343c3e060532a6b80fc7e7 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:46:37 +0200 Subject: [PATCH 12/36] restore AutoFarm. it was deleted by accident --- Auto-Farm.js | 624 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 624 insertions(+) create mode 100644 Auto-Farm.js diff --git a/Auto-Farm.js b/Auto-Farm.js new file mode 100644 index 0000000..1a903bd --- /dev/null +++ b/Auto-Farm.js @@ -0,0 +1,624 @@ +(async () => { + const CONFIG = { + START_X: 742, + START_Y: 1148, + PIXELS_PER_LINE: 100, + DELAY: 1000, + THEME: { + primary: '#000000', + secondary: '#111111', + accent: '#222222', + text: '#ffffff', + highlight: '#775ce3', + success: '#00ff00', + error: '#ff0000' + } + }; + + const state = { + running: false, + paintedCount: 0, + charges: { count: 0, max: 80, cooldownMs: 30000 }, + userInfo: null, + lastPixel: null, + minimized: false, + menuOpen: false, + language: 'en', + autoRefresh: true, + pausedForManual: false + }; + + const sleep = ms => new Promise(r => setTimeout(r, ms)); + const waitForSelector = async (selector, interval = 200, timeout = 5000) => { + const start = Date.now(); + while (Date.now() - start < timeout) { + const el = document.querySelector(selector); + if (el) return el; + await sleep(interval); + } + return null; + }; + + const originalFetch = window.fetch; + let capturedCaptchaToken = null; + window.fetch = async (url, options = {}) => { + if (typeof url === 'string' && url.includes('https://backend.wplace.live/s0/pixel/')) { + try { + const payload = JSON.parse(options.body || '{}'); + if (payload.t) { + console.log('✅ CAPTCHA Token Captured:', payload.t); + capturedCaptchaToken = payload.t; + if (state.pausedForManual) { + state.pausedForManual = false; + state.running = true; + updateUI( + state.language === 'pt' ? '🚀 Pintura reiniciada!' : '🚀 Farm resumed!', + 'success' + ); + paintLoop(); + } + } + } catch (e) { + } + } + return originalFetch(url, options); + }; + + const fetchAPI = async (url, options = {}) => { + try { + const res = await fetch(url, { + credentials: 'include', + ...options + }); + return await res.json(); + } catch (e) { + return null; + } + }; + + const getRandomPosition = () => ({ + x: Math.floor(Math.random() * CONFIG.PIXELS_PER_LINE), + y: Math.floor(Math.random() * CONFIG.PIXELS_PER_LINE) + }); + + const paintPixel = async (x, y) => { + const randomColor = Math.floor(Math.random() * 31) + 1; + const url = `https://backend.wplace.live/s0/pixel/${CONFIG.START_X}/${CONFIG.START_Y}`; + const payload = JSON.stringify({ coords: [x, y], colors: [randomColor], t: capturedCaptchaToken }); + try { + const res = await originalFetch(url, { + method: 'POST', + headers: { 'Content-Type': 'text/plain;charset=UTF-8' }, + credentials: 'include', + body: payload + }); + if (res.status === 403) { + console.error('❌ 403 Forbidden. CAPTCHA token might be invalid or expired.'); + capturedCaptchaToken = null; + stoppedForToken = true; + return 'token_error'; + } + const data = await res.json(); + return data; + } catch (e) { + return null; + } + }; + + const getCharge = async () => { + const data = await fetchAPI('https://backend.wplace.live/me'); + if (data) { + state.userInfo = data; + state.charges = { + count: Math.floor(data.charges.count), + max: Math.floor(data.charges.max), + cooldownMs: data.charges.cooldownMs + }; + if (state.userInfo.level) { + state.userInfo.level = Math.floor(state.userInfo.level); + } + } + return state.charges; + }; + + const detectUserLocation = async () => { + try { + const response = await fetch('https://ipapi.co/json/'); + const data = await response.json(); + if (data.country === 'BR') { + state.language = 'pt'; + } else if (data.country === 'US') { + state.language = 'en'; + } else { + state.language = 'en'; + } + } catch { + state.language = 'en'; + } + }; + + const paintLoop = async () => { + while (state.running) { + const { count, cooldownMs } = state.charges; + + if (count < 1) { + updateUI(state.language === 'pt' ? `⌛ Sem cargas. Esperando ${Math.ceil(cooldownMs/1000)}s...` : `⌛ No charges. Waiting ${Math.ceil(cooldownMs/1000)}s...`, 'status'); + await sleep(cooldownMs); + await getCharge(); + continue; + } + + const randomPos = getRandomPosition(); + const paintResult = await paintPixel(randomPos.x, randomPos.y); + if (paintResult === 'token_error') { + if (state.autoRefresh) { + await getCharge(); + if (state.charges.count < 2) { + if (!state.pausedForManual) { + updateUI( + state.language === 'pt' + ? '⚡ Aguardando pelo menos 2 cargas para auto-refresh...' + : 'Waiting for at least 2 charges for auto-refresh...', + 'status' + ); + state.pausedForManual = true; + } + while (state.charges.count < 2) { + await sleep(60000); + await getCharge(); + updateStats(); + } + state.pausedForManual = false; + } + updateUI( + state.language === 'pt' + ? '❌ Token expirado. Aguardando elemento Paint...' + : '❌ CAPTCHA token expired. Waiting for Paint button...', + 'error' + ); + const mainPaintBtn = await waitForSelector('button.btn.btn-primary.btn-lg, button.btn-primary.sm\\:btn-xl'); + if (mainPaintBtn) mainPaintBtn.click(); + await sleep(500); + updateUI( + state.language === 'pt' ? 'Selecionando transparente...' : 'Selecting transparent...', + 'status' + ); + const transBtn = await waitForSelector('button#color-0'); + if (transBtn) transBtn.click(); + await sleep(500); + const canvas = await waitForSelector('canvas'); + if (canvas) { + canvas.setAttribute('tabindex', '0'); + canvas.focus(); + const rect = canvas.getBoundingClientRect(); + const centerX = Math.round(rect.left + rect.width / 2); + const centerY = Math.round(rect.top + rect.height / 2); + const moveEvt = new MouseEvent('mousemove', { + clientX: centerX, + clientY: centerY, + bubbles: true + }); + canvas.dispatchEvent(moveEvt); + const keyDown = new KeyboardEvent('keydown', { key: ' ', code: 'Space', bubbles: true }); + const keyUp = new KeyboardEvent('keyup', { key: ' ', code: 'Space', bubbles: true }); + canvas.dispatchEvent(keyDown); + canvas.dispatchEvent(keyUp); + } + await sleep(500); + updateUI( + state.language === 'pt' ? 'Confirmando pintura...' : 'Confirming paint...', + 'status' + ); + let confirmBtn = await waitForSelector( + 'button.btn.btn-primary.btn-lg, button.btn.btn-primary.sm\\:btn-xl' + ); + if (!confirmBtn) { + const allPrimary = Array.from(document.querySelectorAll('button.btn-primary')); + confirmBtn = allPrimary.length ? allPrimary[allPrimary.length - 1] : null; + } + confirmBtn?.click(); + } else { + // insufficient charges or auto-refresh disabled + if (state.autoRefresh && state.charges.count < 2) { + updateUI( + state.language === 'pt' + ? '⚡ Cargas insuficientes para auto-refresh. Por favor, clique manualmente.' + : 'Insufficient charges for auto-refresh. Please click manually.', + 'error' + ); + } + if (!state.pausedForManual) { + updateUI( + state.language === 'pt' + ? 'Auto-refresh desativado. Por favor, clique no botão pintura manualmente.' + : 'Auto-refresh disabled. Please click the Paint button manually.', + 'status' + ); + state.pausedForManual = true; + } + state.running = false; + return; + } + await sleep(1000); + continue; + } + + if (paintResult?.painted === 1) { + state.paintedCount++; + state.lastPixel = { + x: CONFIG.START_X + randomPos.x, + y: CONFIG.START_Y + randomPos.y, + time: new Date() + }; + state.charges.count--; + + document.getElementById('paintEffect').style.animation = 'pulse 0.5s'; + setTimeout(() => { + document.getElementById('paintEffect').style.animation = ''; + }, 500); + + updateUI(state.language === 'pt' ? '✅ Pixel pintado!' : '✅ Pixel painted!', 'success'); + } else { + updateUI(state.language === 'pt' ? '❌ Falha ao pintar' : '❌ Failed to paint', 'error'); + } + + await sleep(CONFIG.DELAY); + updateStats(); + } + }; + + const createUI = () => { + if (state.menuOpen) return; + state.menuOpen = true; + + const fontAwesome = document.createElement('link'); + fontAwesome.rel = 'stylesheet'; + fontAwesome.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css'; + document.head.appendChild(fontAwesome); + + const style = document.createElement('style'); + style.textContent = ` + @keyframes pulse { + 0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }n + 70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); } + 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); } + } + @keyframes slideIn { + from { transform: translateY(20px); opacity: 0; } + to { transform: translateY(0); opacity: 1; } + } + .wplace-bot-panel { + position: fixed; + top: 20px; + right: 20px; + width: 250px; + background: ${CONFIG.THEME.primary}; + border: 1px solid ${CONFIG.THEME.accent}; + border-radius: 8px; + padding: 0; + box-shadow: 0 5px 15px rgba(0,0,0,0.5); + z-index: 9999; + font-family: 'Segoe UI', Roboto, sans-serif; + color: ${CONFIG.THEME.text}; + animation: slideIn 0.4s ease-out; + overflow: hidden; + } + .wplace-header { + padding: 12px 15px; + background: ${CONFIG.THEME.secondary}; + color: ${CONFIG.THEME.highlight}; + font-size: 16px; + font-weight: 600; + display: flex; + justify-content: space-between; + align-items: center; + cursor: move; + user-select: none; + } + .wplace-header-title { + display: flex; + align-items: center; + gap: 8px; + } + .wplace-header-controls { + display: flex; + gap: 10px; + } + .wplace-header-btn { + background: none; + border: none; + color: ${CONFIG.THEME.text}; + cursor: pointer; + opacity: 0.7; + transition: opacity 0.2s; + } + .wplace-header-btn:hover { + opacity: 1; + } + .wplace-content { + padding: 15px; + display: ${state.minimized ? 'none' : 'block'}; + } + .wplace-controls { + display: flex; + gap: 10px; + margin-bottom: 15px; + } + .wplace-btn { + flex: 1; + padding: 10px; + border: none; + border-radius: 6px; + font-weight: 600; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + transition: all 0.2s; + } + .wplace-btn:hover { + transform: translateY(-2px); + } + .wplace-btn-primary { + background: ${CONFIG.THEME.accent}; + color: white; + } + .wplace-btn-stop { + background: ${CONFIG.THEME.error}; + color: white; + } + .wplace-stats { + background: ${CONFIG.THEME.secondary}; + padding: 12px; + border-radius: 6px; + margin-bottom: 15px; + } + .wplace-stat-item { + display: flex; + justify-content: space-between; + padding: 6px 0; + font-size: 14px; + } + .wplace-stat-label { + display: flex; + align-items: center; + gap: 6px; + opacity: 0.8; + } + .wplace-status { + padding: 8px; + border-radius: 4px; + text-align: center; + font-size: 13px; + } + .status-default { + background: rgba(255,255,255,0.1); + } + .status-success { + background: rgba(0, 255, 0, 0.1); + color: ${CONFIG.THEME.success}; + } + .status-error { + background: rgba(255, 0, 0, 0.1); + color: ${CONFIG.THEME.error}; + } + #paintEffect { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + pointer-events: none; + border-radius: 8px; + } + `; + document.head.appendChild(style); + + const translations = { + pt: { + title: "WPlace Auto-Farm", + start: "Iniciar", + stop: "Parar", + ready: "Pronto para começar", + user: "Usuário", + pixels: "Pixels", + charges: "Cargas", + level: "Level" + }, + en: { + title: "WPlace Auto-Farm", + start: "Start", + stop: "Stop", + ready: "Ready to start", + user: "User", + pixels: "Pixels", + charges: "Charges", + level: "Level" + } + }; + + const t = translations[state.language] || translations.en; + + const panel = document.createElement('div'); + panel.className = 'wplace-bot-panel'; + panel.innerHTML = ` +
+
+
+ + ${t.title} +
+
+ +
+
+
+
+ + +
+ +
+
+
+
${state.language === 'pt' ? 'Carregando...' : 'Loading...'}
+
+
+
+ +
+ ${t.ready} +
+
+ `; + + document.body.appendChild(panel); + + const header = panel.querySelector('.wplace-header'); + let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; + + header.onmousedown = dragMouseDown; + + function dragMouseDown(e) { + if (e.target.closest('.wplace-header-btn')) return; + + e = e || window.event; + e.preventDefault(); + pos3 = e.clientX; + pos4 = e.clientY; + document.onmouseup = closeDragElement; + document.onmousemove = elementDrag; + } + + function elementDrag(e) { + e = e || window.event; + e.preventDefault(); + pos1 = pos3 - e.clientX; + pos2 = pos4 - e.clientY; + pos3 = e.clientX; + pos4 = e.clientY; + panel.style.top = (panel.offsetTop - pos2) + "px"; + panel.style.left = (panel.offsetLeft - pos1) + "px"; + } + + function closeDragElement() { + document.onmouseup = null; + document.onmousemove = null; + } + + const toggleBtn = panel.querySelector('#toggleBtn'); + const minimizeBtn = panel.querySelector('#minimizeBtn'); + const statusText = panel.querySelector('#statusText'); + const content = panel.querySelector('.wplace-content'); + const statsArea = panel.querySelector('#statsArea'); + + toggleBtn.addEventListener('click', () => { + state.running = !state.running; + + if (state.running && !capturedCaptchaToken) { + updateUI(state.language === 'pt' ? '❌ Token não capturado. Clique em qualquer pixel primeiro.' : '❌ CAPTCHA token not captured. Please click any pixel manually first.', 'error'); + state.running = false; + return; + } + + if (state.running) { + toggleBtn.innerHTML = ` ${t.stop}`; + toggleBtn.classList.remove('wplace-btn-primary'); + toggleBtn.classList.add('wplace-btn-stop'); + updateUI(state.language === 'pt' ? '🚀 Pintura iniciada!' : '🚀 Painting started!', 'success'); + paintLoop(); + } else { + toggleBtn.innerHTML = ` ${t.start}`; + toggleBtn.classList.add('wplace-btn-primary'); + toggleBtn.classList.remove('wplace-btn-stop'); + statsArea.innerHTML = ''; + updateUI(state.language === 'pt' ? '⏹️ Parado' : '⏹️ Stopped', 'default'); + } + }); + + minimizeBtn.addEventListener('click', () => { + state.minimized = !state.minimized; + content.style.display = state.minimized ? 'none' : 'block'; + minimizeBtn.innerHTML = ``; + }); + + const autoRefreshCheckbox = panel.querySelector('#autoRefreshCheckbox'); + autoRefreshCheckbox.addEventListener('change', () => { + state.autoRefresh = autoRefreshCheckbox.checked; + }); + + window.addEventListener('beforeunload', () => { + state.menuOpen = false; + }); + }; + + window.updateUI = (message, type = 'default') => { + const statusText = document.querySelector('#statusText'); + if (statusText) { + statusText.textContent = message; + statusText.className = `wplace-status status-${type}`; + statusText.style.animation = 'none'; + void statusText.offsetWidth; + statusText.style.animation = 'slideIn 0.3s ease-out'; + } + }; + + window.updateStats = async () => { + await getCharge(); + const statsArea = document.querySelector('#statsArea'); + if (statsArea) { + const t = { + pt: { + user: "Usuário", + pixels: "Pixels", + charges: "Cargas", + level: "Level" + }, + en: { + user: "User", + pixels: "Pixels", + charges: "Charges", + level: "Level" + } + }[state.language] || { + user: "User", + pixels: "Pixels", + charges: "Charges", + level: "Level" + }; + + statsArea.innerHTML = ` +
+
${t.user}
+
${state.userInfo.name}
+
+
+
${t.pixels}
+
${state.paintedCount}
+
+
+
${t.charges}
+
${Math.floor(state.charges.count)}/${Math.floor(state.charges.max)}
+
+
+
${t.level}
+
${state.userInfo?.level || '0'}
+
+ `; + } + }; + + await detectUserLocation(); + createUI(); + await getCharge(); + updateStats(); +})(); From 213b32c61b2635f4ffdbfb5ca304b38051242239 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:57:19 +0200 Subject: [PATCH 13/36] syntax error --- Auto-Image.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Auto-Image.js b/Auto-Image.js index a50ace5..fcd2120 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -4494,6 +4494,7 @@ if (!statsContainer || !statsArea || !closeStatsBtn) { // Note: base CSS now aligns with this layout: main panel at left:20px (width 280), stats at left:330px. + } const header = container.querySelector(".wplace-header") From 85b16ebe34997aeb8b27478119d080987bbc96a8 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:01:44 +0200 Subject: [PATCH 14/36] fix: Refactor settings container visibility logic to use class-based toggling --- Auto-Image.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Auto-Image.js b/Auto-Image.js index fcd2120..8f5097d 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -4620,32 +4620,32 @@ if (settingsBtn && closeSettingsBtn && applySettingsBtn) { settingsBtn.addEventListener("click", () => { - const isVisible = settingsContainer.style.display !== "none" + const isVisible = settingsContainer.classList.contains("show"); if (isVisible) { - settingsContainer.style.animation = "settingsFadeOut 0.3s ease-out forwards" + settingsContainer.style.animation = "settingsFadeOut 0.3s ease-out forwards"; + settingsContainer.classList.remove("show"); setTimeout(() => { - settingsContainer.style.display = "none" - settingsContainer.style.animation = "" - }, 300) + settingsContainer.style.animation = ""; + }, 300); } else { - settingsContainer.style.top = "50%" - settingsContainer.style.left = "50%" - settingsContainer.style.transform = "translate(-50%, -50%)" - settingsContainer.style.display = "block" - settingsContainer.style.animation = "settingsSlideIn 0.4s ease-out" + settingsContainer.style.top = "50%"; + settingsContainer.style.left = "50%"; + settingsContainer.style.transform = "translate(-50%, -50%)"; + settingsContainer.classList.add("show"); + settingsContainer.style.animation = "settingsSlideIn 0.4s ease-out"; } }) closeSettingsBtn.addEventListener("click", () => { - settingsContainer.style.animation = "settingsFadeOut 0.3s ease-out forwards" + settingsContainer.style.animation = "settingsFadeOut 0.3s ease-out forwards"; + settingsContainer.classList.remove("show"); setTimeout(() => { - settingsContainer.style.display = "none" - settingsContainer.style.animation = "" - settingsContainer.style.top = "50%" - settingsContainer.style.left = "50%" - settingsContainer.style.transform = "translate(-50%, -50%)" - }, 300) - }) + settingsContainer.style.animation = ""; + settingsContainer.style.top = "50%"; + settingsContainer.style.left = "50%"; + settingsContainer.style.transform = "translate(-50%, -50%)"; + }, 300); + }); applySettingsBtn.addEventListener("click", () => { // Sync advanced settings before save From 3760449cf53f8dd503b9c8403eadc4b5f6221f33 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:11:48 +0200 Subject: [PATCH 15/36] fix: Turnstile overlay and logging improvements --- Auto-Image.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Auto-Image.js b/Auto-Image.js index 8f5097d..152dbf1 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -1843,6 +1843,7 @@ } const overlay = this.ensureTurnstileOverlayContainer(); + overlay.classList.remove('wplace-overlay-hidden'); overlay.style.display = 'block'; const host = overlay.querySelector('#turnstile-overlay-host'); @@ -1851,6 +1852,7 @@ // Set a timeout for interactive mode const timeout = setTimeout(() => { console.warn('⏰ Interactive Turnstile widget timeout'); + overlay.classList.add('wplace-overlay-hidden'); overlay.style.display = 'none'; resolve(null); }, 60000); // 60 seconds for user interaction @@ -1862,7 +1864,8 @@ theme: 'light', callback: (token) => { clearTimeout(timeout); - overlay.style.display = 'none'; + overlay.classList.add('wplace-overlay-hidden'); + overlay.style.display = 'none'; console.log('✅ Interactive Turnstile completed successfully'); if (typeof token === 'string' && token.length > 20) { @@ -1874,7 +1877,8 @@ }, 'error-callback': (error) => { clearTimeout(timeout); - overlay.style.display = 'none'; + overlay.classList.add('wplace-overlay-hidden'); + overlay.style.display = 'none'; console.warn('❌ Interactive Turnstile error:', error); resolve(null); }, @@ -1885,6 +1889,7 @@ if (!widgetId) { clearTimeout(timeout); + overlay.classList.add('wplace-overlay-hidden'); overlay.style.display = 'none'; console.warn('❌ Failed to create interactive Turnstile widget'); resolve(null); @@ -6879,31 +6884,27 @@ try { console.log("🔧 Initializing Turnstile token generator..."); updateUI("initializingToken", "default"); - - // Pre-load Turnstile script first to avoid delays later + + console.log("Attempting to load Turnstile script..."); await Utils.loadTurnstile(); - + console.log("Turnstile script loaded. Attempting to generate token..."); + const token = await handleCaptchaWithRetry(); if (token) { setTurnstileToken(token); console.log("✅ Startup token generated successfully"); updateUI("tokenReady", "success"); Utils.showAlert("🔑 Token generator ready!", "success"); - enableFileOperations(); // Enable file operations since initial setup is complete + enableFileOperations(); } else { - console.warn("⚠️ Startup token generation failed, will retry when needed"); + console.warn("⚠️ Startup token generation failed (no token received), will retry when needed"); updateUI("tokenRetryLater", "warning"); - // Still enable file operations even if initial token generation fails - // Users can load progress and use manual/hybrid modes enableFileOperations(); } } catch (error) { - console.warn("⚠️ Startup token generation failed:", error); + console.error("❌ Critical error during Turnstile initialization:", error); // More specific error updateUI("tokenRetryLater", "warning"); - // Still enable file operations even if initial setup fails - // Users can load progress and use manual/hybrid modes enableFileOperations(); - // Don't show error alert for initialization failures, just log them } } From a19a3824f06fc67f0e792daab71d5810d219d193 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:28:00 +0200 Subject: [PATCH 16/36] update css files and urls --- Auto-Image.js | 2 +- auto-image-complete-styles.css | 998 --------------------------------- auto-image-styles.css | 581 +++++++++++++------ 3 files changed, 416 insertions(+), 1165 deletions(-) delete mode 100644 auto-image-complete-styles.css diff --git a/Auto-Image.js b/Auto-Image.js index 152dbf1..cc3bbdb 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -3239,7 +3239,7 @@ // Link external CSS files const cssLink = document.createElement('link'); cssLink.rel = 'stylesheet'; - cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/auto-image-complete-styles.css'; // TODO: Before merge change to https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css + cssLink.href = 'https://staninna.github.io/WPlace-AutoBOT/auto-image-styles.css'; // TODO: Before merge change to https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBOT/refs/heads/main/auto-image-styles.css cssLink.setAttribute('data-wplace-theme', 'true'); document.head.appendChild(cssLink); diff --git a/auto-image-complete-styles.css b/auto-image-complete-styles.css deleted file mode 100644 index 9182f9d..0000000 --- a/auto-image-complete-styles.css +++ /dev/null @@ -1,998 +0,0 @@ -/* WPlace Auto-Image Bot - Unified CSS Styles (decoupled from JS) - Why: bring external CSS in-sync with the UI that Auto-Image.js renders, - fix layout (positions, widths, z-index), and ensure class names match JS - (e.g., .wplace-dragging) so buttons and panels behave correctly. */ - -/* ========================= */ -/* Core animations (shared) */ -/* ========================= */ - @keyframes neonGlow { - 0%, - 100% { - text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, - 0 0 15px currentColor; - } - 50% { - text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, - 0 0 8px currentColor; - } -} - - @keyframes pixelBlink { - 0%, - 50% { - opacity: 1; - } - 51%, - 100% { - opacity: 0.7; - } -} - - @keyframes scanline { - 0% { - transform: translateY(-100%); - } - 100% { - transform: translateY(400px); - } -} - - @keyframes pulse { - 0% { - box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); - } - 70% { - box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); - } - 100% { - box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); - } -} - - @keyframes slideIn { - from { - transform: translateY(-10px); - opacity: 0; - } - to { - transform: translateY(0); - opacity: 1; - } -} - - @keyframes slideDown { - from { - transform: translateX(-50%) translateY(-20px); - opacity: 0; - } - to { - transform: translateX(-50%) translateY(0); - opacity: 1; - } -} - - @keyframes shimmer { - 0% { - transform: translateX(-100%); - } - 100% { - transform: translateX(100%); - } -} - -/* ========================= */ -/* Main containers (fixed) */ -/* Align with JS structure */ -/* ========================= */ -#wplace-image-bot-container { - /* Why fixed sizes/positions: matches JS expectations and preserves two-panel layout */ - position: fixed; - top: 20px; - left: 20px; - width: 280px; - max-height: calc(100vh - 40px); - padding: 0; - z-index: 9998; - animation: slideIn 0.4s ease-out; - overflow-y: auto; - overflow-x: hidden; - transition: all 0.3s ease; - user-select: none; - display: none; /* JS will set display: block inline when ready */ -} - -#wplace-image-bot-container.wplace-dragging { - transition: none; - box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), - 0 0 0 2px rgba(255, 255, 255, 0.2); - transform: scale(1.02); - z-index: 9999; -} - -#wplace-image-bot-container.wplace-compact { - width: 240px; -} - -#wplace-image-bot-container.wplace-minimized { - width: 200px; - height: auto; - overflow: hidden; -} - -/* Stats container sits to the right of main (280 + 30 = 330) */ -#wplace-stats-container { - position: fixed; - top: 20px; - left: 330px; - width: 280px; - max-height: calc(100vh - 40px); - padding: 0; - z-index: 9997; - animation: slideIn 0.4s ease-out; - overflow-y: auto; - transition: all 0.3s ease; - user-select: none; - display: none; -} - -#wplace-stats-container.wplace-dragging { - transition: none; -} - -/* Back-compat for legacy class (some earlier CSS used this) */ -.wplace-drag-active { - transition: none !important; - box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), - 0 0 0 2px rgba(255, 255, 255, 0.2) !important; - transform: scale(1.02) !important; - z-index: 9999 !important; -} - -/* ========================= */ -/* Header and content blocks */ -/* ========================= */ -.wplace-header { - display: flex; - justify-content: space-between; - align-items: center; - cursor: move; - user-select: none; - transition: background 0.2s ease; - position: relative; - z-index: 2; - padding: 8px 12px; -} - -.wplace-header-title { - display: flex; - align-items: center; - gap: 6px; -} - -.wplace-header-controls { - display: flex; - gap: 6px; -} - -.wplace-header-btn { - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.2s; - background: rgba(255, 255, 255, 0.1); - color: inherit; - border: none; - border-radius: 4px; - width: 18px; - height: 18px; - font-size: 10px; -} - -.wplace-header-btn:hover { - transform: scale(1.1); -} - -.wplace-content { - display: block; - position: relative; - z-index: 2; - padding: 12px; -} - -.wplace-content.wplace-hidden { - display: none; -} - -/* Sections */ -.wplace-status-section { - margin-bottom: 12px; - padding: 8px; - background: rgba(255, 255, 255, 0.03); - border: 1px solid rgba(255, 255, 255, 0.1); -} - -.wplace-section { - margin-bottom: 12px; - padding: 12px; - background: rgba(255, 255, 255, 0.03); - border: 1px solid rgba(255, 255, 255, 0.1); -} - -.wplace-section-title { - font-size: 11px; - font-weight: 600; - margin-bottom: 8px; - display: flex; - align-items: center; - gap: 6px; - text-transform: uppercase; - letter-spacing: 0.5px; -} - -/* ========================= */ -/* Controls and buttons */ -/* ========================= */ -.wplace-controls { - display: flex; - flex-direction: column; - gap: 8px; -} - -.wplace-row { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 8px; -} - -.wplace-row.single { - grid-template-columns: 1fr; -} - -.wplace-btn { - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.3s ease; - position: relative; - overflow: hidden; - padding: 8px 12px; - border-radius: 8px; - border: none; -} - -.wplace-btn::before { - content: ''; - position: absolute; - top: 0; - left: -100%; - width: 100%; - height: 100%; - background: linear-gradient( - 90deg, - transparent, - rgba(255, 255, 255, 0.2), - transparent - ); - transition: left 0.5s; -} - -.wplace-btn:hover::before { - left: 100%; -} - -.wplace-btn:hover:not(:disabled) { - box-shadow: 0 0 15px currentColor; -} - -.wplace-btn:active:not(:disabled) { - transform: translateY(0); -} - -.wplace-btn:disabled { - opacity: 0.3; - cursor: not-allowed; - transform: none !important; - box-shadow: none !important; -} - -.wplace-btn:disabled::before { - display: none; -} - -.wplace-btn-overlay.active { - background: linear-gradient(135deg, #29b6f6 0%, #8e2de2 100%); - box-shadow: 0 0 15px #8e2de2; -} - -/* ========================= */ -/* Stats and progress */ -/* ========================= */ -.wplace-stats { - margin-bottom: 8px; -} - -.wplace-stat-item { - display: flex; - justify-content: space-between; - padding: 4px 0; - font-size: 11px; - border-bottom: 1px solid rgba(255, 255, 255, 0.05); -} - -.wplace-stat-item:last-child { - border-bottom: none; -} - -.wplace-stat-label { - display: flex; - align-items: center; - gap: 6px; - opacity: 0.9; - font-size: 10px; -} - -.wplace-stat-value { - font-weight: 600; -} - -.wplace-colors-section { - margin-top: 10px; - padding-top: 8px; - border-top: 1px solid rgba(255, 255, 255, 0.05); -} - -.wplace-stat-colors-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); - gap: 4px; - margin-top: 8px; - padding: 4px; - background: rgba(0, 0, 0, 0.2); - border-radius: 4px; - max-height: 80px; - overflow-y: auto; -} - -.wplace-stat-color-swatch { - width: 16px; - height: 16px; - border-radius: 3px; - border: 1px solid rgba(255, 255, 255, 0.1); - box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5); -} - -/* Progress */ -.wplace-progress { - width: 100%; - overflow: hidden; - position: relative; - background: rgba(0, 0, 0, 0.3); - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 8px; - margin: 8px 0; - height: 6px; -} - -.wplace-progress-bar { - position: relative; - height: 6px; - transition: width 0.5s ease; -} - -.wplace-progress-bar::after { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: linear-gradient( - 90deg, - transparent, - rgba(255, 255, 255, 0.3), - transparent - ); - animation: shimmer 2s infinite; -} - -/* ========================= */ -/* Status blocks */ -/* ========================= */ -.wplace-status { - text-align: center; - position: relative; - overflow: hidden; - padding: 6px; - border: 1px solid; - border-radius: 8px; - font-size: 11px; -} - -.status-default { - background: rgba(255, 255, 255, 0.1); -} - -.status-success { - background: rgba(0, 255, 0, 0.1); - box-shadow: 0 0 15px currentColor; -} - -.status-error { - background: rgba(255, 0, 0, 0.1); - box-shadow: 0 0 15px currentColor; -} - -.status-warning { - background: rgba(255, 165, 0, 0.1); - box-shadow: 0 0 15px currentColor; -} - -/* ========================= */ -/* Resize dialog */ -/* ========================= */ -.resize-container { - display: none; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 10000; - width: 90%; - max-width: 700px; - max-height: 90%; - overflow: auto; -} - -.resize-preview-wrapper { - display: flex; - justify-content: center; - align-items: center; - background: rgba(0, 0, 0, 0.2); - margin: 15px 0; - height: 300px; - overflow: hidden; -} - -.resize-canvas-stack { - position: relative; - transform-origin: center center; - display: inline-block; -} - -.resize-base-canvas, -.resize-mask-canvas { - position: absolute; - left: 0; - top: 0; - image-rendering: pixelated; - image-rendering: -moz-crisp-edges; - image-rendering: crisp-edges; -} - -.resize-mask-canvas { - pointer-events: auto; -} - -.resize-tools { - display: flex; - gap: 8px; - align-items: center; - margin-top: 8px; - font-size: 12px; -} - -.resize-tools button { - padding: 6px 10px; - border-radius: 6px; - border: 1px solid rgba(255, 255, 255, 0.2); - background: rgba(255, 255, 255, 0.06); - color: #fff; - cursor: pointer; -} - -.wplace-btn.active, -.wplace-btn[aria-pressed='true'] { - box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, - 0 0 6px rgba(0, 0, 0, 0.2) !important; -} - -.mask-mode-group .wplace-btn.active, -.mask-mode-group .wplace-btn[aria-pressed='true'] { - box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, - 0 0 6px rgba(0, 0, 0, 0.2); -} - -.resize-controls { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 15px; - align-items: center; -} - -.resize-slider { - width: 100%; - outline: none; - -webkit-appearance: none; -} - -.resize-zoom-controls { - grid-column: 1 / -1; - display: flex; - align-items: center; - gap: 10px; - margin-top: 15px; -} - -.resize-buttons { - display: flex; - gap: 10px; - justify-content: center; - margin-top: 20px; -} - -.resize-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.8); - z-index: 9999; - display: none; -} - -/* ========================= */ -/* Color grid */ -/* ========================= */ -.wplace-color-grid { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); - gap: 10px; - padding-top: 8px; - max-height: 300px; - overflow-y: auto; -} - -.wplace-color-item { - display: flex; - flex-direction: column; - align-items: center; - gap: 4px; -} - -.wplace-color-item-name { - font-size: 9px; - color: #ccc; - text-align: center; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - width: 100%; -} - -.wplace-color-swatch { - width: 22px; - height: 22px; - border: 1px solid rgba(255, 255, 255, 0.2); - border-radius: 4px; - cursor: pointer; - transition: transform 0.1s ease, box-shadow 0.2s ease; - position: relative; - margin: 0 auto; -} - -.wplace-color-swatch.unavailable { - border-color: #666; - border-style: dashed; - cursor: not-allowed; -} - -.wplace-color-swatch:hover { - transform: scale(1.1); - z-index: 1; -} - -.wplace-color-swatch:not(.active) { - opacity: 0.3; - filter: grayscale(80%); -} - -.wplace-color-swatch.unavailable:not(.active) { - opacity: 0.2; - filter: grayscale(90%); -} - -.wplace-color-swatch.active::after { - content: '✔'; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - color: white; - font-size: 12px; - font-weight: bold; - text-shadow: 0 0 3px black; -} - -.wplace-color-divider { - border: none; - height: 1px; - background: rgba(255, 255, 255, 0.1); - margin: 8px 0; -} - -/* ========================= */ -/* Cooldown controls */ -/* ========================= */ -.wplace-cooldown-control { - margin-top: 8px; -} - -.wplace-cooldown-control label { - font-size: 11px; - margin-bottom: 4px; - display: block; -} - -.wplace-slider-container { - display: flex; - align-items: center; - gap: 8px; -} - -.wplace-slider { - flex: 1; - -webkit-appearance: none; - appearance: none; - height: 4px; - background: #444; - border-radius: 2px; - outline: none; -} - -.wplace-slider::-webkit-slider-thumb { - -webkit-appearance: none; - width: 14px; - height: 14px; - border-radius: 50%; - cursor: pointer; -} - -/* ========================= */ -/* Settings container (base) */ -/* ========================= */ -#wplace-settings-container { - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 10001; - min-width: 400px; - max-width: 500px; -} - -.wplace-settings { - padding: 16px; - max-height: 400px; - overflow-y: auto; -} - -.wplace-setting-section { - margin-bottom: 20px; - padding: 12px; -} - -.wplace-setting-title { - display: flex; - align-items: center; - margin-bottom: 12px; - font-size: 14px; - font-weight: 600; -} - -.wplace-setting-title i { - margin-right: 8px; -} - -/* ========================= */ -/* Form controls */ -/* ========================= */ -.wplace-select { - width: 100%; - padding: 8px 12px; - font-size: 14px; - margin-bottom: 10px; -} - -.wplace-select:focus { - outline: none; -} - -.wplace-description { - font-size: 12px; - opacity: 0.8; - line-height: 1.4; -} - -/* Speed controls */ -.wplace-speed-control { - margin-top: 12px; - padding: 12px; -} - -.wplace-speed-label { - display: flex; - align-items: center; - margin-bottom: 8px; - font-size: 13px; - font-weight: 600; -} - -.wplace-speed-label i { - margin-right: 6px; -} - -.wplace-speed-slider-container { - display: flex; - align-items: center; - gap: 12px; -} - -.wplace-speed-slider { - flex: 1; - height: 6px; - border-radius: 3px; - outline: none; - cursor: pointer; - -webkit-appearance: none; - appearance: none; -} - -.wplace-speed-slider::-webkit-slider-thumb { - -webkit-appearance: none; - appearance: none; - width: 18px; - height: 18px; - border-radius: 50%; - cursor: pointer; - border: 2px solid; -} - -.wplace-speed-slider::-moz-range-thumb { - width: 18px; - height: 18px; - border-radius: 50%; - cursor: pointer; - border: 2px solid; -} - -.wplace-speed-display { - display: flex; - align-items: center; - gap: 4px; - min-width: 90px; - justify-content: flex-end; -} - -/* ========================= */ -/* Turnstile overlay */ -/* ========================= */ -/* Hidden invisible widget host (token generator) */ -.wplace-turnstile-hidden { - position: fixed !important; - left: -99999px !important; - top: -99999px !important; - width: 1px !important; - height: 1px !important; - pointer-events: none !important; - opacity: 0 !important; - visibility: hidden !important; - z-index: -99999 !important; - overflow: hidden !important; -} - -/* Visible overlay (interactive fallback) */ -.wplace-turnstile-overlay { - position: fixed !important; - bottom: 20px !important; - right: 20px !important; - z-index: 99999 !important; - background: rgba(0, 0, 0, 0.9) !important; - border-radius: 12px !important; - padding: 20px !important; - box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important; - backdrop-filter: blur(10px) !important; - border: 1px solid rgba(255, 255, 255, 0.2) !important; - color: #fff !important; - font-family: 'Segoe UI', sans-serif !important; - min-width: 300px !important; - max-width: 400px !important; -} - -.wplace-turnstile-title { - font: 600 12px/1.3 'Segoe UI', sans-serif !important; - margin-bottom: 8px !important; - opacity: 0.9 !important; - color: #ffffff !important; -} - -.wplace-turnstile-host { - width: 100% !important; - min-height: 70px !important; -} - -.wplace-turnstile-hide-btn { - position: absolute !important; - top: 6px !important; - right: 6px !important; - font-size: 11px !important; - background: transparent !important; - color: #ffffff !important; - border: 1px solid rgba(255, 255, 255, 0.2) !important; - border-radius: 6px !important; - padding: 2px 6px !important; - cursor: pointer !important; - transition: background 0.2s ease !important; -} - -.wplace-turnstile-hide-btn:hover { - background: rgba(255, 255, 255, 0.1) !important; -} - -/* ========================= */ -/* Alert system (used by JS) */ -/* ========================= */ -.wplace-alert-base { - position: fixed; - top: 20px; - left: 50%; - transform: translateX(-50%); - padding: 12px 20px; - border-radius: 8px; - color: white; - font-weight: 600; - z-index: 10001; - max-width: 400px; - text-align: center; - animation: slideDown 0.3s ease-out; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); - font-family: 'Segoe UI', sans-serif; -} - -.wplace-alert-info { - background: linear-gradient(135deg, #3498db, #2980b9); - box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); -} - -.wplace-alert-success { - background: linear-gradient(135deg, #27ae60, #229954); - box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3); -} - -.wplace-alert-warning { - background: linear-gradient(135deg, #f39c12, #e67e22); - box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3); -} - -.wplace-alert-error { - background: linear-gradient(135deg, #e74c3c, #c0392b); - box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3); -} - -/* ========================= */ -/* Modal overlay helpers */ -/* ========================= */ -.wplace-overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.8); - z-index: 100002; - display: none; -} - -.wplace-overlay.show { - display: block; -} - -/* Overlay visibility helpers */ -.wplace-overlay-hidden { - display: none !important; -} - -.wplace-overlay-visible { - display: block !important; -} - -/* ========================= */ -/* Responsive tweaks */ -/* ========================= */ - @media (max-width: 768px) { - #wplace-image-bot-container { - left: 10px; - width: calc(100vw - 20px); - max-height: calc(100vh - 20px); - } - - #wplace-stats-container { - display: none !important; /* hide secondary panel on small screens */ - } - - .wplace-alert-base { - max-width: 90vw; - margin: 0 5vw; - } - - .wplace-turnstile-overlay { - bottom: 10px !important; - right: 10px !important; - left: 10px !important; - min-width: auto !important; - } -} - -/* ========================= */ -/* Auto light/dark support */ -/* ========================= */ - @media (prefers-color-scheme: light) { - .theme-auto { - --wplace-primary: #ffffff; - --wplace-secondary: #f5f5f5; - --wplace-accent: #007acc; - --wplace-text: #333333; - } -} - - @media (prefers-color-scheme: dark) { - .theme-auto { - --wplace-primary: #1e1e1e; - --wplace-secondary: #2d2d30; - --wplace-accent: #775ce3; - --wplace-text: #ffffff; - } -} - -/* ===================================== */ -/* Settings container variants (optional)*/ -/* ===================================== */ -.wplace-settings-container-base { - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: 100001; - display: none; - font-family: 'Segoe UI', Roboto, sans-serif; - min-width: 400px; - max-width: 500px; - max-height: 80vh; - overflow-y: auto; - animation: slideIn 0.3s ease-out; - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 16px; - padding: 0; -} - -.wplace-settings-container-base.show { - display: block; -} - -/* ===================================== */ -/* Utility styles */ -/* ===================================== */ -.wplace-paint-effect { - animation: pulse 0.5s ease-out; -} - -.wplace-settings-error { - background: rgba(255, 0, 0, 0.4) !important; -} - -.wplace-stats-container.hidden { - display: none; -} diff --git a/auto-image-styles.css b/auto-image-styles.css index 5ac4a82..9182f9d 100644 --- a/auto-image-styles.css +++ b/auto-image-styles.css @@ -1,48 +1,92 @@ -/* WPlace Auto-Image Bot Styles */ +/* WPlace Auto-Image Bot - Unified CSS Styles (decoupled from JS) + Why: bring external CSS in-sync with the UI that Auto-Image.js renders, + fix layout (positions, widths, z-index), and ensure class names match JS + (e.g., .wplace-dragging) so buttons and panels behave correctly. */ -/* Animations */ -@keyframes neonGlow { - 0%, 100% { - text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor; +/* ========================= */ +/* Core animations (shared) */ +/* ========================= */ + @keyframes neonGlow { + 0%, + 100% { + text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, + 0 0 15px currentColor; } 50% { - text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor; + text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, + 0 0 8px currentColor; } } -@keyframes pixelBlink { - 0%, 50% { opacity: 1; } - 51%, 100% { opacity: 0.7; } + @keyframes pixelBlink { + 0%, + 50% { + opacity: 1; + } + 51%, + 100% { + opacity: 0.7; + } } -@keyframes scanline { - 0% { transform: translateY(-100%); } - 100% { transform: translateY(400px); } + @keyframes scanline { + 0% { + transform: translateY(-100%); + } + 100% { + transform: translateY(400px); + } } -@keyframes pulse { - 0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); } - 70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); } - 100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); } + @keyframes pulse { + 0% { + box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); + } + 70% { + box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); + } + 100% { + box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); + } } -@keyframes slideIn { - from { transform: translateY(-10px); opacity: 0; } - to { transform: translateY(0); opacity: 1; } + @keyframes slideIn { + from { + transform: translateY(-10px); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } } -@keyframes shimmer { - 0% { transform: translateX(-100%); } - 100% { transform: translateX(100%); } + @keyframes slideDown { + from { + transform: translateX(-50%) translateY(-20px); + opacity: 0; + } + to { + transform: translateX(-50%) translateY(0); + opacity: 1; + } } -@keyframes slideDown { - from { transform: translateX(-50%) translateY(-20px); opacity: 0; } - to { transform: translateX(-50%) translateY(0); opacity: 1; } + @keyframes shimmer { + 0% { + transform: translateX(-100%); + } + 100% { + transform: translateX(100%); + } } -/* Main containers - will be dynamically styled based on theme */ +/* ========================= */ +/* Main containers (fixed) */ +/* Align with JS structure */ +/* ========================= */ #wplace-image-bot-container { + /* Why fixed sizes/positions: matches JS expectations and preserves two-panel layout */ position: fixed; top: 20px; left: 20px; @@ -55,26 +99,28 @@ overflow-x: hidden; transition: all 0.3s ease; user-select: none; + display: none; /* JS will set display: block inline when ready */ } #wplace-image-bot-container.wplace-dragging { transition: none; - box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 0 2px rgba(255,255,255,0.2); + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), + 0 0 0 2px rgba(255, 255, 255, 0.2); transform: scale(1.02); z-index: 9999; } +#wplace-image-bot-container.wplace-compact { + width: 240px; +} + #wplace-image-bot-container.wplace-minimized { width: 200px; height: auto; overflow: hidden; } -#wplace-image-bot-container.wplace-compact { - width: 240px; -} - -/* Stats Container */ +/* Stats container sits to the right of main (280 + 30 = 330) */ #wplace-stats-container { position: fixed; top: 20px; @@ -87,13 +133,25 @@ overflow-y: auto; transition: all 0.3s ease; user-select: none; + display: none; } #wplace-stats-container.wplace-dragging { transition: none; } -/* Header styles */ +/* Back-compat for legacy class (some earlier CSS used this) */ +.wplace-drag-active { + transition: none !important; + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), + 0 0 0 2px rgba(255, 255, 255, 0.2) !important; + transform: scale(1.02) !important; + z-index: 9999 !important; +} + +/* ========================= */ +/* Header and content blocks */ +/* ========================= */ .wplace-header { display: flex; justify-content: space-between; @@ -103,15 +161,18 @@ transition: background 0.2s ease; position: relative; z-index: 2; + padding: 8px 12px; } .wplace-header-title { display: flex; align-items: center; + gap: 6px; } .wplace-header-controls { display: flex; + gap: 6px; } .wplace-header-btn { @@ -120,35 +181,43 @@ align-items: center; justify-content: center; transition: all 0.2s; + background: rgba(255, 255, 255, 0.1); + color: inherit; + border: none; + border-radius: 4px; + width: 18px; + height: 18px; + font-size: 10px; } .wplace-header-btn:hover { transform: scale(1.1); } -/* Content areas */ .wplace-content { display: block; position: relative; z-index: 2; + padding: 12px; } .wplace-content.wplace-hidden { display: none; } +/* Sections */ .wplace-status-section { margin-bottom: 12px; padding: 8px; - background: rgba(255,255,255,0.03); - border: 1px solid rgba(255,255,255,0.1); + background: rgba(255, 255, 255, 0.03); + border: 1px solid rgba(255, 255, 255, 0.1); } .wplace-section { margin-bottom: 12px; padding: 12px; - background: rgba(255,255,255,0.03); - border: 1px solid rgba(255,255,255,0.1); + background: rgba(255, 255, 255, 0.03); + border: 1px solid rgba(255, 255, 255, 0.1); } .wplace-section-title { @@ -162,7 +231,9 @@ letter-spacing: 0.5px; } -/* Controls and buttons */ +/* ========================= */ +/* Controls and buttons */ +/* ========================= */ .wplace-controls { display: flex; flex-direction: column; @@ -187,6 +258,9 @@ transition: all 0.3s ease; position: relative; overflow: hidden; + padding: 8px 12px; + border-radius: 8px; + border: none; } .wplace-btn::before { @@ -196,7 +270,12 @@ left: -100%; width: 100%; height: 100%; - background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); + background: linear-gradient( + 90deg, + transparent, + rgba(255, 255, 255, 0.2), + transparent + ); transition: left 0.5s; } @@ -228,7 +307,9 @@ box-shadow: 0 0 15px #8e2de2; } -/* Stats display */ +/* ========================= */ +/* Stats and progress */ +/* ========================= */ .wplace-stats { margin-bottom: 8px; } @@ -236,7 +317,9 @@ .wplace-stat-item { display: flex; justify-content: space-between; - border-bottom: 1px solid rgba(255,255,255,0.05); + padding: 4px 0; + font-size: 11px; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); } .wplace-stat-item:last-child { @@ -248,6 +331,7 @@ align-items: center; gap: 6px; opacity: 0.9; + font-size: 10px; } .wplace-stat-value { @@ -257,7 +341,7 @@ .wplace-colors-section { margin-top: 10px; padding-top: 8px; - border-top: 1px solid rgba(255,255,255,0.05); + border-top: 1px solid rgba(255, 255, 255, 0.05); } .wplace-stat-colors-grid { @@ -266,7 +350,7 @@ gap: 4px; margin-top: 8px; padding: 4px; - background: rgba(0,0,0,0.2); + background: rgba(0, 0, 0, 0.2); border-radius: 4px; max-height: 80px; overflow-y: auto; @@ -276,31 +360,59 @@ width: 16px; height: 16px; border-radius: 3px; - border: 1px solid rgba(255,255,255,0.1); - box-shadow: inset 0 0 2px rgba(0,0,0,0.5); + border: 1px solid rgba(255, 255, 255, 0.1); + box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.5); } -/* Progress bars */ +/* Progress */ .wplace-progress { width: 100%; overflow: hidden; position: relative; + background: rgba(0, 0, 0, 0.3); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 8px; + margin: 8px 0; + height: 6px; } .wplace-progress-bar { position: relative; + height: 6px; transition: width 0.5s ease; } -/* Status indicators */ +.wplace-progress-bar::after { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient( + 90deg, + transparent, + rgba(255, 255, 255, 0.3), + transparent + ); + animation: shimmer 2s infinite; +} + +/* ========================= */ +/* Status blocks */ +/* ========================= */ .wplace-status { text-align: center; position: relative; overflow: hidden; + padding: 6px; + border: 1px solid; + border-radius: 8px; + font-size: 11px; } .status-default { - background: rgba(255,255,255,0.1); + background: rgba(255, 255, 255, 0.1); } .status-success { @@ -318,7 +430,9 @@ box-shadow: 0 0 15px currentColor; } -/* Resize container */ +/* ========================= */ +/* Resize dialog */ +/* ========================= */ .resize-container { display: none; position: fixed; @@ -336,56 +450,59 @@ display: flex; justify-content: center; align-items: center; - background: rgba(0,0,0,0.2); + background: rgba(0, 0, 0, 0.2); margin: 15px 0; height: 300px; overflow: hidden; } -.resize-canvas-stack { - position: relative; - transform-origin: center center; - display: inline-block; +.resize-canvas-stack { + position: relative; + transform-origin: center center; + display: inline-block; } -.resize-base-canvas, .resize-mask-canvas { - position: absolute; - left: 0; +.resize-base-canvas, +.resize-mask-canvas { + position: absolute; + left: 0; top: 0; image-rendering: pixelated; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; } -.resize-mask-canvas { - pointer-events: auto; +.resize-mask-canvas { + pointer-events: auto; } -.resize-tools { - display: flex; - gap: 8px; - align-items: center; - margin-top: 8px; - font-size: 12px; +.resize-tools { + display: flex; + gap: 8px; + align-items: center; + margin-top: 8px; + font-size: 12px; } -.resize-tools button { - padding: 6px 10px; - border-radius: 6px; - border: 1px solid rgba(255,255,255,0.2); - background: rgba(255,255,255,0.06); - color: #fff; - cursor: pointer; +.resize-tools button { + padding: 6px 10px; + border-radius: 6px; + border: 1px solid rgba(255, 255, 255, 0.2); + background: rgba(255, 255, 255, 0.06); + color: #fff; + cursor: pointer; } .wplace-btn.active, -.wplace-btn[aria-pressed="true"] { - box-shadow: 0 0 8px rgba(0,0,0,0.25) inset, 0 0 6px rgba(0,0,0,0.2) !important; +.wplace-btn[aria-pressed='true'] { + box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, + 0 0 6px rgba(0, 0, 0, 0.2) !important; } .mask-mode-group .wplace-btn.active, -.mask-mode-group .wplace-btn[aria-pressed="true"] { - box-shadow: 0 0 8px rgba(0,0,0,0.25) inset, 0 0 6px rgba(0,0,0,0.2); +.mask-mode-group .wplace-btn[aria-pressed='true'] { + box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, + 0 0 6px rgba(0, 0, 0, 0.2); } .resize-controls { @@ -427,7 +544,9 @@ display: none; } -/* Color grid */ +/* ========================= */ +/* Color grid */ +/* ========================= */ .wplace-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); @@ -457,7 +576,7 @@ .wplace-color-swatch { width: 22px; height: 22px; - border: 1px solid rgba(255,255,255,0.2); + border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 4px; cursor: pointer; transition: transform 0.1s ease, box-shadow 0.2s ease; @@ -501,11 +620,13 @@ .wplace-color-divider { border: none; height: 1px; - background: rgba(255,255,255,0.1); + background: rgba(255, 255, 255, 0.1); margin: 8px 0; } -/* Cooldown controls */ +/* ========================= */ +/* Cooldown controls */ +/* ========================= */ .wplace-cooldown-control { margin-top: 8px; } @@ -540,7 +661,9 @@ cursor: pointer; } -/* Settings container */ +/* ========================= */ +/* Settings container (base) */ +/* ========================= */ #wplace-settings-container { position: fixed; top: 50%; @@ -574,10 +697,27 @@ margin-right: 8px; } -.wplace-setting-content { - /* Content styling will be theme-dependent */ +/* ========================= */ +/* Form controls */ +/* ========================= */ +.wplace-select { + width: 100%; + padding: 8px 12px; + font-size: 14px; + margin-bottom: 10px; } +.wplace-select:focus { + outline: none; +} + +.wplace-description { + font-size: 12px; + opacity: 0.8; + line-height: 1.4; +} + +/* Speed controls */ .wplace-speed-control { margin-top: 12px; padding: 12px; @@ -637,113 +777,222 @@ justify-content: flex-end; } -#speedValue { +/* ========================= */ +/* Turnstile overlay */ +/* ========================= */ +/* Hidden invisible widget host (token generator) */ +.wplace-turnstile-hidden { + position: fixed !important; + left: -99999px !important; + top: -99999px !important; + width: 1px !important; + height: 1px !important; + pointer-events: none !important; + opacity: 0 !important; + visibility: hidden !important; + z-index: -99999 !important; + overflow: hidden !important; +} + +/* Visible overlay (interactive fallback) */ +.wplace-turnstile-overlay { + position: fixed !important; + bottom: 20px !important; + right: 20px !important; + z-index: 99999 !important; + background: rgba(0, 0, 0, 0.9) !important; + border-radius: 12px !important; + padding: 20px !important; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important; + backdrop-filter: blur(10px) !important; + border: 1px solid rgba(255, 255, 255, 0.2) !important; + color: #fff !important; + font-family: 'Segoe UI', sans-serif !important; + min-width: 300px !important; + max-width: 400px !important; +} + +.wplace-turnstile-title { + font: 600 12px/1.3 'Segoe UI', sans-serif !important; + margin-bottom: 8px !important; + opacity: 0.9 !important; + color: #ffffff !important; +} + +.wplace-turnstile-host { + width: 100% !important; + min-height: 70px !important; +} + +.wplace-turnstile-hide-btn { + position: absolute !important; + top: 6px !important; + right: 6px !important; + font-size: 11px !important; + background: transparent !important; + color: #ffffff !important; + border: 1px solid rgba(255, 255, 255, 0.2) !important; + border-radius: 6px !important; + padding: 2px 6px !important; + cursor: pointer !important; + transition: background 0.2s ease !important; +} + +.wplace-turnstile-hide-btn:hover { + background: rgba(255, 255, 255, 0.1) !important; +} + +/* ========================= */ +/* Alert system (used by JS) */ +/* ========================= */ +.wplace-alert-base { + position: fixed; + top: 20px; + left: 50%; + transform: translateX(-50%); + padding: 12px 20px; + border-radius: 8px; + color: white; font-weight: 600; - font-size: 14px; -} - -.wplace-speed-unit { - font-size: 11px; - opacity: 0.8; -} - -.wplace-speed-container { - display: flex; - align-items: center; - gap: 15px; - margin-bottom: 10px; -} - -.wplace-speed-display { - padding: 5px 10px; - border-radius: 4px; - font-weight: 600; - min-width: 80px; + z-index: 10001; + max-width: 400px; text-align: center; + animation: slideDown 0.3s ease-out; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); + font-family: 'Segoe UI', sans-serif; } -.wplace-select { +.wplace-alert-info { + background: linear-gradient(135deg, #3498db, #2980b9); + box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); +} + +.wplace-alert-success { + background: linear-gradient(135deg, #27ae60, #229954); + box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3); +} + +.wplace-alert-warning { + background: linear-gradient(135deg, #f39c12, #e67e22); + box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3); +} + +.wplace-alert-error { + background: linear-gradient(135deg, #e74c3c, #c0392b); + box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3); +} + +/* ========================= */ +/* Modal overlay helpers */ +/* ========================= */ +.wplace-overlay { + position: fixed; + top: 0; + left: 0; width: 100%; - padding: 8px 12px; - font-size: 14px; - margin-bottom: 10px; + height: 100%; + background: rgba(0, 0, 0, 0.8); + z-index: 100002; + display: none; } -.wplace-select:focus { - outline: none; +.wplace-overlay.show { + display: block; } -.wplace-description { - font-size: 12px; - opacity: 0.8; - line-height: 1.4; +/* Overlay visibility helpers */ +.wplace-overlay-hidden { + display: none !important; } -.wplace-theme-custom { - margin-top: 15px; - padding: 15px; +.wplace-overlay-visible { + display: block !important; } -.wplace-custom-group { - margin-bottom: 15px; +/* ========================= */ +/* Responsive tweaks */ +/* ========================= */ + @media (max-width: 768px) { + #wplace-image-bot-container { + left: 10px; + width: calc(100vw - 20px); + max-height: calc(100vh - 20px); + } + + #wplace-stats-container { + display: none !important; /* hide secondary panel on small screens */ + } + + .wplace-alert-base { + max-width: 90vw; + margin: 0 5vw; + } + + .wplace-turnstile-overlay { + bottom: 10px !important; + right: 10px !important; + left: 10px !important; + min-width: auto !important; + } } -.wplace-custom-label { - display: flex; - align-items: center; - margin-bottom: 8px; - font-size: 13px; - font-weight: 600; +/* ========================= */ +/* Auto light/dark support */ +/* ========================= */ + @media (prefers-color-scheme: light) { + .theme-auto { + --wplace-primary: #ffffff; + --wplace-secondary: #f5f5f5; + --wplace-accent: #007acc; + --wplace-text: #333333; + } } -.wplace-custom-label i { - margin-right: 8px; - width: 16px; + @media (prefers-color-scheme: dark) { + .theme-auto { + --wplace-primary: #1e1e1e; + --wplace-secondary: #2d2d30; + --wplace-accent: #775ce3; + --wplace-text: #ffffff; + } } -.wplace-color-input-group { - display: flex; - gap: 8px; - align-items: center; +/* ===================================== */ +/* Settings container variants (optional)*/ +/* ===================================== */ +.wplace-settings-container-base { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 100001; + display: none; + font-family: 'Segoe UI', Roboto, sans-serif; + min-width: 400px; + max-width: 500px; + max-height: 80vh; + overflow-y: auto; + animation: slideIn 0.3s ease-out; + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 16px; + padding: 0; } -.wplace-color-input { - width: 50px; - height: 30px; - border: none; - border-radius: 4px; - cursor: pointer; - background: transparent; +.wplace-settings-container-base.show { + display: block; } -.wplace-color-text { - flex: 1; - padding: 6px 10px; - border-radius: 4px; - font-size: 12px; - font-family: monospace; +/* ===================================== */ +/* Utility styles */ +/* ===================================== */ +.wplace-paint-effect { + animation: pulse 0.5s ease-out; } -.wplace-animation-controls { - display: flex; - flex-direction: column; - gap: 8px; +.wplace-settings-error { + background: rgba(255, 0, 0, 0.4) !important; } -.wplace-checkbox-label { - display: flex; - align-items: center; - gap: 8px; - font-size: 12px; - cursor: pointer; +.wplace-stats-container.hidden { + display: none; } - -.wplace-custom-actions { - display: flex; - gap: 10px; - margin-top: 20px; - border-top: 1px solid; - padding-top: 15px; -} - -/* Theme-specific overrides will be applied dynamically via JavaScript */ \ No newline at end of file From abb3c3fffeceec7bb7cdde0d412b63d3ea11d79f Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:37:14 +0200 Subject: [PATCH 17/36] update readme's --- NL.md | 2 +- README.md | 2 +- RU.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NL.md b/NL.md index 9b3827e..588e9d6 100644 --- a/NL.md +++ b/NL.md @@ -112,7 +112,7 @@ javascript:fetch("https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBO * [x] Ondersteuning voor kruistegels toevoegen * [x] AutoCaptcha-oplosser toevoegen * [x] Correcte kleur pixel overslaan toevoegen -* [ ] CSS scheiden +* [x] CSS scheiden --- diff --git a/README.md b/README.md index 8ccec8b..0bdcf05 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ javascript:fetch("https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBO - [x] Add Cross Tiles Support - [x] Add AutoCaptcha Solver - [x] Add Correct Color Pixel Skip -- [ ] Separate Css +- [x] Separate Css --- diff --git a/RU.md b/RU.md index cb07c8e..1c6b496 100644 --- a/RU.md +++ b/RU.md @@ -112,7 +112,7 @@ javascript:fetch("https://raw.githubusercontent.com/Wplace-AutoBot/WPlace-AutoBO - [x] Добавить поддержку перекрестных плиток - [x] Добавить средство автоподчеты - [x] Добавить правильный пропуск цветного пикселя -- [ ] Отдельный Css +- [x] Отдельный Css - [ ] Учебные пособия --- From 5906e4ceacbe517665efe92341e3acdc50fb1ab5 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 16:52:19 +0200 Subject: [PATCH 18/36] wip better style switch --- Auto-Image.js | 51 +++++++-- auto-image-styles.css | 257 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 247 insertions(+), 61 deletions(-) diff --git a/Auto-Image.js b/Auto-Image.js index cc3bbdb..672616b 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -177,19 +177,47 @@ const getCurrentTheme = () => CONFIG.THEMES[CONFIG.currentTheme] const switchTheme = (themeName) => { - if (CONFIG.THEMES[themeName]) { - CONFIG.currentTheme = themeName - saveThemePreference() + if (CONFIG.THEMES[themeName]) { + CONFIG.currentTheme = themeName + saveThemePreference() - // Remove existing theme styles - const existingStyle = document.querySelector('style[data-wplace-theme="true"]') - if (existingStyle) { - existingStyle.remove() - } + // APPLY THEME VARS/CLASS (new) + applyTheme() - // Recreate UI with new theme (cleanup is handled in createUI) - createUI() - } + // Recreate UI (kept for now) + createUI() + } +} + + // Add this helper (place it after getCurrentTheme/switchTheme definitions) + function applyTheme() { + const theme = getCurrentTheme(); + // Toggle theme class on documentElement so CSS vars cascade to our UI + document.documentElement.classList.remove('wplace-theme--classic', 'wplace-theme--neon'); + document.documentElement.classList.add( + CONFIG.currentTheme === 'Neon Retro' ? 'wplace-theme--neon' : 'wplace-theme--classic' + ); + + // Also set CSS variables explicitly in case you want runtime overrides + const root = document.documentElement; + const setVar = (k, v) => { try { root.style.setProperty(k, v); } catch {} }; + + setVar('--wplace-primary', theme.primary); + setVar('--wplace-secondary', theme.secondary); + setVar('--wplace-accent', theme.accent); + setVar('--wplace-text', theme.text); + setVar('--wplace-highlight', theme.highlight); + setVar('--wplace-success', theme.success); + setVar('--wplace-error', theme.error); + setVar('--wplace-warning', theme.warning); + + // Typography + look + setVar('--wplace-font', theme.fontFamily || "'Segoe UI', Roboto, sans-serif"); + setVar('--wplace-radius', (('' + (theme.borderRadius || '12px')))); + setVar('--wplace-border-style', (('' + (theme.borderStyle || 'solid')))); + setVar('--wplace-border-width', (('' + (theme.borderWidth || '1px')))); + setVar('--wplace-backdrop', (('' + (theme.backdropFilter || 'blur(10px)')))); + setVar('--wplace-border-color', 'rgba(255,255,255,0.1)'); } const saveThemePreference = () => { @@ -3223,6 +3251,7 @@ loadLanguagePreference() const theme = getCurrentTheme() + applyTheme() // <- new: set CSS vars and theme class before building UI const fontAwesome = document.createElement("link") fontAwesome.rel = "stylesheet" diff --git a/auto-image-styles.css b/auto-image-styles.css index 9182f9d..08d4998 100644 --- a/auto-image-styles.css +++ b/auto-image-styles.css @@ -3,18 +3,90 @@ fix layout (positions, widths, z-index), and ensure class names match JS (e.g., .wplace-dragging) so buttons and panels behave correctly. */ +/* ========================= */ +/* Theme tokens (CSS vars) */ +/* ========================= */ + +/* Default = Classic Autobot */ +:root { + --wplace-primary: #000000; + --wplace-secondary: #111111; + --wplace-accent: #222222; + --wplace-text: #ffffff; + --wplace-highlight: #775ce3; + --wplace-success: #00ff00; + --wplace-error: #ff0000; + --wplace-warning: #ffaa00; + + --wplace-radius: 12px; + --wplace-border-style: solid; + --wplace-border-width: 1px; + --wplace-border-color: rgba(255, 255, 255, 0.1); + --wplace-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), + 0 0 0 1px rgba(255, 255, 255, 0.1); + --wplace-backdrop: blur(10px); + --wplace-font: 'Segoe UI', Roboto, sans-serif; + + --wplace-z-overlay: 10000; + --wplace-z-alert: 10001; + --wplace-z-settings: 100001; + + /* feature toggles */ + --wplace-scanline: 0; + --wplace-pixel-blink: 0; +} + +/* Optional theme class hooks (you can switch these on body or html) */ +.wplace-theme--classic { + --wplace-primary: #000000; + --wplace-secondary: #111111; + --wplace-accent: #222222; + --wplace-text: #ffffff; + --wplace-highlight: #775ce3; + --wplace-success: #00ff00; + --wplace-error: #ff0000; + --wplace-warning: #ffaa00; + + --wplace-radius: 12px; + --wplace-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), + 0 0 0 1px rgba(255, 255, 255, 0.1); + --wplace-backdrop: blur(10px); + --wplace-font: 'Segoe UI', Roboto, sans-serif; + + --wplace-scanline: 0; + --wplace-pixel-blink: 0; +} + +.wplace-theme--neon { + --wplace-primary: #1a1a2e; + --wplace-secondary: #16213e; + --wplace-accent: #0f3460; + --wplace-text: #00ff41; + --wplace-highlight: #ff6b35; + --wplace-success: #39ff14; + --wplace-error: #ff073a; + --wplace-warning: #ffff00; + + --wplace-radius: 0; + --wplace-shadow: 0 0 20px rgba(0, 255, 65, 0.3), + inset 0 0 20px rgba(0, 255, 65, 0.1); + --wplace-backdrop: none; + --wplace-font: 'Press Start 2P', monospace; + + --wplace-scanline: 1; + --wplace-pixel-blink: 1; +} + /* ========================= */ /* Core animations (shared) */ /* ========================= */ @keyframes neonGlow { 0%, 100% { - text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, - 0 0 15px currentColor; + text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor; } 50% { - text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, - 0 0 8px currentColor; + text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor; } } @@ -100,12 +172,20 @@ transition: all 0.3s ease; user-select: none; display: none; /* JS will set display: block inline when ready */ + + /* Theme hooks */ + background: var(--wplace-primary); + color: var(--wplace-text); + border-radius: var(--wplace-radius); + box-shadow: var(--wplace-shadow); + font-family: var(--wplace-font); + backdrop-filter: var(--wplace-backdrop); + border: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-border-color); } #wplace-image-bot-container.wplace-dragging { transition: none; - box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), - 0 0 0 2px rgba(255, 255, 255, 0.2); + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.2); transform: scale(1.02); z-index: 9999; } @@ -134,6 +214,15 @@ transition: all 0.3s ease; user-select: none; display: none; + + /* Theme hooks */ + background: var(--wplace-primary); + color: var(--wplace-text); + border-radius: var(--wplace-radius); + box-shadow: var(--wplace-shadow); + font-family: var(--wplace-font); + backdrop-filter: var(--wplace-backdrop); + border: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-border-color); } #wplace-stats-container.wplace-dragging { @@ -143,8 +232,7 @@ /* Back-compat for legacy class (some earlier CSS used this) */ .wplace-drag-active { transition: none !important; - box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), - 0 0 0 2px rgba(255, 255, 255, 0.2) !important; + box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.2) !important; transform: scale(1.02) !important; z-index: 9999 !important; } @@ -162,6 +250,11 @@ position: relative; z-index: 2; padding: 8px 12px; + + /* Theme hooks */ + background: var(--wplace-secondary); + color: var(--wplace-highlight); + border-bottom: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-border-color); } .wplace-header-title { @@ -188,10 +281,15 @@ width: 18px; height: 18px; font-size: 10px; + /* Theme tweak */ + background: var(--wplace-accent); + color: var(--wplace-text); } .wplace-header-btn:hover { transform: scale(1.1); + background: var(--wplace-text); + color: var(--wplace-primary); } .wplace-content { @@ -211,6 +309,7 @@ padding: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: var(--wplace-radius); } .wplace-section { @@ -218,6 +317,7 @@ padding: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: var(--wplace-radius); } .wplace-section-title { @@ -229,6 +329,7 @@ gap: 6px; text-transform: uppercase; letter-spacing: 0.5px; + color: var(--wplace-highlight); } /* ========================= */ @@ -259,8 +360,11 @@ position: relative; overflow: hidden; padding: 8px 12px; - border-radius: 8px; + border-radius: var(--wplace-radius); border: none; + background: var(--wplace-accent); + color: var(--wplace-text); + font-family: var(--wplace-font); } .wplace-btn::before { @@ -270,12 +374,7 @@ left: -100%; width: 100%; height: 100%; - background: linear-gradient( - 90deg, - transparent, - rgba(255, 255, 255, 0.2), - transparent - ); + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.5s; } @@ -307,11 +406,42 @@ box-shadow: 0 0 15px #8e2de2; } +/* button variants via theme */ +.wplace-btn-start { + background: var(--wplace-success); + color: #000; +} + +.wplace-btn-stop { + background: var(--wplace-error); + color: #fff; +} + +.wplace-btn-select { + background: var(--wplace-highlight); + color: #000; +} + +.wplace-btn-upload { + background: var(--wplace-secondary); + border: 1px dashed var(--wplace-highlight); + color: var(--wplace-text); +} + +.wplace-btn-file { + background: var(--wplace-warning); + color: #000; +} + /* ========================= */ /* Stats and progress */ /* ========================= */ .wplace-stats { margin-bottom: 8px; + background: rgba(255, 255, 255, 0.03); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: var(--wplace-radius); + padding: 8px; } .wplace-stat-item { @@ -336,6 +466,7 @@ .wplace-stat-value { font-weight: 600; + color: var(--wplace-highlight); } .wplace-colors-section { @@ -369,9 +500,9 @@ width: 100%; overflow: hidden; position: relative; - background: rgba(0, 0, 0, 0.3); + background: var(--wplace-secondary); border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 8px; + border-radius: var(--wplace-radius); margin: 8px 0; height: 6px; } @@ -380,21 +511,14 @@ position: relative; height: 6px; transition: width 0.5s ease; + background: linear-gradient(135deg, var(--wplace-highlight) 0%, #9370db 100%); } .wplace-progress-bar::after { content: ''; position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: linear-gradient( - 90deg, - transparent, - rgba(255, 255, 255, 0.3), - transparent - ); + inset: 0; + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); animation: shimmer 2s infinite; } @@ -407,26 +531,34 @@ overflow: hidden; padding: 6px; border: 1px solid; - border-radius: 8px; + border-radius: var(--wplace-radius); font-size: 11px; } .status-default { background: rgba(255, 255, 255, 0.1); + border-color: var(--wplace-border-color); + color: var(--wplace-text); } .status-success { background: rgba(0, 255, 0, 0.1); + border-color: var(--wplace-success); + color: var(--wplace-success); box-shadow: 0 0 15px currentColor; } .status-error { background: rgba(255, 0, 0, 0.1); + border-color: var(--wplace-error); + color: var(--wplace-error); box-shadow: 0 0 15px currentColor; } .status-warning { background: rgba(255, 165, 0, 0.1); + border-color: var(--wplace-warning); + color: var(--wplace-warning); box-shadow: 0 0 15px currentColor; } @@ -439,11 +571,18 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); - z-index: 10000; + z-index: var(--wplace-z-overlay); width: 90%; max-width: 700px; max-height: 90%; overflow: auto; + + /* Theme */ + background: var(--wplace-primary); + border: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-text); + border-radius: var(--wplace-radius); + box-shadow: var(--wplace-shadow); + font-family: var(--wplace-font); } .resize-preview-wrapper { @@ -454,6 +593,7 @@ margin: 15px 0; height: 300px; overflow: hidden; + border: 1px solid var(--wplace-accent); } .resize-canvas-stack { @@ -495,14 +635,12 @@ .wplace-btn.active, .wplace-btn[aria-pressed='true'] { - box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, - 0 0 6px rgba(0, 0, 0, 0.2) !important; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, 0 0 6px rgba(0, 0, 0, 0.2) !important; } .mask-mode-group .wplace-btn.active, .mask-mode-group .wplace-btn[aria-pressed='true'] { - box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, - 0 0 6px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 8px rgba(0, 0, 0, 0.25) inset, 0 0 6px rgba(0, 0, 0, 0.2); } .resize-controls { @@ -669,9 +807,18 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); - z-index: 10001; + z-index: var(--wplace-z-alert); min-width: 400px; max-width: 500px; + + /* Theme */ + background: var(--wplace-primary); + color: var(--wplace-text); + font-family: var(--wplace-font); + border-radius: var(--wplace-radius); + box-shadow: var(--wplace-shadow); + backdrop-filter: var(--wplace-backdrop); + border: var(--wplace-border-width) var(--wplace-border-style) var(--wplace-border-color); } .wplace-settings { @@ -685,18 +832,6 @@ padding: 12px; } -.wplace-setting-title { - display: flex; - align-items: center; - margin-bottom: 12px; - font-size: 14px; - font-weight: 600; -} - -.wplace-setting-title i { - margin-right: 8px; -} - /* ========================= */ /* Form controls */ /* ========================= */ @@ -851,10 +986,10 @@ left: 50%; transform: translateX(-50%); padding: 12px 20px; - border-radius: 8px; + border-radius: var(--wplace-radius); color: white; font-weight: 600; - z-index: 10001; + z-index: var(--wplace-z-alert); max-width: 400px; text-align: center; animation: slideDown 0.3s ease-out; @@ -967,15 +1102,19 @@ transform: translate(-50%, -50%); z-index: 100001; display: none; - font-family: 'Segoe UI', Roboto, sans-serif; + font-family: var(--wplace-font); min-width: 400px; max-width: 500px; max-height: 80vh; overflow-y: auto; animation: slideIn 0.3s ease-out; border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 16px; + border-radius: var(--wplace-radius); padding: 0; + background: var(--wplace-primary); + color: var(--wplace-text); + box-shadow: var(--wplace-shadow); + backdrop-filter: var(--wplace-backdrop); } .wplace-settings-container-base.show { @@ -996,3 +1135,21 @@ .wplace-stats-container.hidden { display: none; } + +/* Theme flourishes for Neon (scanline/pixel blink) */ +.wplace-theme--neon #wplace-image-bot-container::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + height: 2px; + background: linear-gradient(90deg, transparent, var(--wplace-text), transparent); + z-index: 1; + pointer-events: none; + animation: scanline 3s linear infinite; +} + +.wplace-theme--neon .wplace-btn:hover:not(:disabled) { + animation: pixelBlink 0.5s infinite; +} \ No newline at end of file From 1cfb996a71c6420bcc03108e655440efc39c0320 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 18:06:34 +0200 Subject: [PATCH 19/36] theme application logic --- Auto-Image.js | 436 +++--------------------------------------- auto-image-styles.css | 2 +- 2 files changed, 31 insertions(+), 407 deletions(-) diff --git a/Auto-Image.js b/Auto-Image.js index 672616b..3e7f4a1 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -189,36 +189,38 @@ } } - // Add this helper (place it after getCurrentTheme/switchTheme definitions) - function applyTheme() { - const theme = getCurrentTheme(); - // Toggle theme class on documentElement so CSS vars cascade to our UI - document.documentElement.classList.remove('wplace-theme--classic', 'wplace-theme--neon'); - document.documentElement.classList.add( - CONFIG.currentTheme === 'Neon Retro' ? 'wplace-theme--neon' : 'wplace-theme--classic' - ); +// Add this helper (place it after getCurrentTheme/switchTheme definitions) +function applyTheme() { + const theme = getCurrentTheme(); + // Toggle theme class on documentElement so CSS vars cascade to our UI + document.documentElement.classList.remove('wplace-theme--classic', 'wplace-theme--neon'); + document.documentElement.classList.add( + CONFIG.currentTheme === 'Neon Retro' ? 'wplace-theme--neon' : 'wplace-theme--classic' + ); - // Also set CSS variables explicitly in case you want runtime overrides - const root = document.documentElement; - const setVar = (k, v) => { try { root.style.setProperty(k, v); } catch {} }; + // Also set CSS variables explicitly in case you want runtime overrides + const root = document.documentElement; + const setVar = (k, v) => { try { root.style.setProperty(k, v); } catch {} }; - setVar('--wplace-primary', theme.primary); - setVar('--wplace-secondary', theme.secondary); - setVar('--wplace-accent', theme.accent); - setVar('--wplace-text', theme.text); - setVar('--wplace-highlight', theme.highlight); - setVar('--wplace-success', theme.success); - setVar('--wplace-error', theme.error); - setVar('--wplace-warning', theme.warning); + setVar('--wplace-primary', theme.primary); + setVar('--wplace-secondary', theme.secondary); + setVar('--wplace-accent', theme.accent); + setVar('--wplace-text', theme.text); + setVar('--wplace-highlight', theme.highlight); + setVar('--wplace-success', theme.success); + setVar('--wplace-error', theme.error); + setVar('--wplace-warning', theme.warning); - // Typography + look - setVar('--wplace-font', theme.fontFamily || "'Segoe UI', Roboto, sans-serif"); - setVar('--wplace-radius', (('' + (theme.borderRadius || '12px')))); - setVar('--wplace-border-style', (('' + (theme.borderStyle || 'solid')))); - setVar('--wplace-border-width', (('' + (theme.borderWidth || '1px')))); - setVar('--wplace-backdrop', (('' + (theme.backdropFilter || 'blur(10px)')))); - setVar('--wplace-border-color', 'rgba(255,255,255,0.1)'); - } + // Typography + look + setVar('--wplace-font', theme.fontFamily || "'Segoe UI', Roboto, sans-serif"); + setVar('--wplace-radius', ('' + (theme.borderRadius || '12px'))); + setVar('--wplace-border-style', (('' + (theme.borderStyle || 'solid')))); + setVar('--wplace-border-width', (('' + (theme.borderWidth || '1px')))); + setVar('--wplace-backdrop', (('' + (theme.backdropFilter || 'blur(10px)')))); + setVar('--wplace-border-color', 'rgba(255,255,255,0.1)'); +} + + const saveThemePreference = () => { try { @@ -3272,385 +3274,6 @@ cssLink.setAttribute('data-wplace-theme', 'true'); document.head.appendChild(cssLink); - - // Apply theme-specific dynamic styles - const style = document.createElement("style") - style.setAttribute("data-wplace-theme-dynamic", "true") - - style.textContent = ` - /* Dynamic theme-specific styles */ - ${theme.animations.glow ? ` - .wplace-header { animation: neonGlow 2s ease-in-out infinite alternate; } - .fas, .fa { filter: drop-shadow(0 0 3px currentColor); } - ` : ""} - - ${theme.animations.pixelBlink ? ` - .wplace-btn:hover:not(:disabled) { animation: pixelBlink 0.5s infinite; } - .status-error { animation: pixelBlink 0.5s infinite; } - .wplace-progress-bar::after { animation: pixelBlink 1s infinite; } - ` : ""} - - ${theme.animations.scanline ? ` - #wplace-image-bot-container::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 2px; - background: linear-gradient(90deg, transparent, ${theme.neon}, transparent); - animation: scanline 3s linear infinite; - z-index: 1; - pointer-events: none; - } - ` : ""} - - /* Theme-specific container styles */ - #wplace-image-bot-container { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.primary} 0%, #1a1a1a 100%)` - : theme.primary - }; - border: ${theme.borderWidth} ${theme.borderStyle} ${CONFIG.currentTheme === "Classic Autobot" ? theme.accent : theme.text}; - border-radius: ${theme.borderRadius}; - box-shadow: ${theme.boxShadow}; - font-family: ${theme.fontFamily}; - color: ${theme.text}; - ${theme.backdropFilter ? `backdrop-filter: ${theme.backdropFilter};` : ""} - ${CONFIG.currentTheme === "Neon Retro" ? "image-rendering: pixelated;" : ""} - } - - ${CONFIG.currentTheme === "Neon Retro" ? ` - #wplace-image-bot-container::after { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: - repeating-linear-gradient( - 0deg, - transparent, - transparent 2px, - rgba(0, 255, 65, 0.03) 2px, - rgba(0, 255, 65, 0.03) 4px - ); - pointer-events: none; - z-index: 1; - } - ` : ""} - - #wplace-stats-container { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.primary} 0%, #1a1a1a 100%)` - : theme.primary - }; - border: ${theme.borderWidth} ${theme.borderStyle} ${CONFIG.currentTheme === "Classic Autobot" ? theme.accent : theme.text}; - border-radius: ${theme.borderRadius}; - box-shadow: ${theme.boxShadow}; - font-family: ${theme.fontFamily}; - color: ${theme.text}; - ${theme.backdropFilter ? `backdrop-filter: ${theme.backdropFilter};` : ""} - ${CONFIG.currentTheme === "Neon Retro" ? "image-rendering: pixelated;" : ""} - } - - .wplace-header { - padding: ${CONFIG.currentTheme === "Neon Retro" ? "8px 12px" : "8px 12px"}; - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.secondary} 0%, #2a2a2a 100%)` - : theme.secondary - }; - color: ${theme.highlight}; - font-size: ${CONFIG.currentTheme === "Neon Retro" ? "11px" : "13px"}; - font-weight: ${CONFIG.currentTheme === "Neon Retro" ? "normal" : "700"}; - border-bottom: ${CONFIG.currentTheme === "Neon Retro" ? "2px" : "1px"} solid ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255,255,255,0.1)" : theme.text}; - ${CONFIG.currentTheme === "Classic Autobot" ? "text-shadow: 0 1px 2px rgba(0,0,0,0.5);" : "text-transform: uppercase; letter-spacing: 1px;"} - font-family: ${theme.fontFamily}; - } - - .wplace-header-title { gap: ${CONFIG.currentTheme === "Neon Retro" ? "6px" : "6px"}; } - .wplace-header-controls { gap: ${CONFIG.currentTheme === "Neon Retro" ? "6px" : "6px"}; } - - .wplace-header-btn { - background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255,255,255,0.1)" : theme.accent}; - border: ${CONFIG.currentTheme === "Neon Retro" ? `2px solid ${theme.text}` : "none"}; - color: ${theme.text}; - border-radius: ${CONFIG.currentTheme === "Classic Autobot" ? "4px" : "0"}; - width: ${CONFIG.currentTheme === "Classic Autobot" ? "18px" : "auto"}; - height: ${CONFIG.currentTheme === "Classic Autobot" ? "18px" : "auto"}; - padding: ${CONFIG.currentTheme === "Neon Retro" ? "4px 6px" : "0"}; - font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "10px"}; - font-family: ${theme.fontFamily}; - ${CONFIG.currentTheme === "Neon Retro" ? "image-rendering: pixelated;" : ""} - } - .wplace-header-btn:hover { - background: ${CONFIG.currentTheme === "Classic Autobot" ? theme.accent : theme.text}; - color: ${CONFIG.currentTheme === "Classic Autobot" ? theme.text : theme.primary}; - ${CONFIG.currentTheme === "Neon Retro" ? `box-shadow: 0 0 10px ${theme.text};` : ""} - } - - .wplace-content { padding: ${CONFIG.currentTheme === "Neon Retro" ? "12px" : "12px"}; } - .wplace-section { border-radius: ${theme.borderRadius}; } - .wplace-section-title { color: ${theme.highlight}; } - - .wplace-btn { - padding: ${CONFIG.currentTheme === "Neon Retro" ? "12px 8px" : "8px 12px"}; - border: ${CONFIG.currentTheme === "Neon Retro" ? "2px solid" : "none"}; - border-radius: ${theme.borderRadius}; - font-weight: ${CONFIG.currentTheme === "Neon Retro" ? "normal" : "500"}; - gap: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "6px"}; - font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "11px"}; - font-family: ${theme.fontFamily}; - ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px; image-rendering: pixelated;" : ""} - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.accent} 0%, #4a4a4a 100%)` - : theme.accent - }; - ${CONFIG.currentTheme === "Classic Autobot" ? "border: 1px solid rgba(255,255,255,0.1);" : ""} - } - - ${CONFIG.currentTheme === "Classic Autobot" ? ` - .wplace-btn::before { - background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); - transition: left 0.5s ease; - } - .wplace-btn:hover:not(:disabled)::before { left: 100%; } - .wplace-btn:hover:not(:disabled) { - transform: translateY(-1px); - box-shadow: 0 4px 12px rgba(0,0,0,0.4); - } - ` : ` - .wplace-btn:hover:not(:disabled) { box-shadow: 0 0 15px currentColor; } - `} - - .wplace-btn-primary { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.accent} 0%, #6a5acd 100%)` - : theme.accent - }; - color: ${theme.text}; - ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.text};` : ""} - } - - .wplace-btn-upload { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.secondary} 0%, #4a4a4a 100%)` - : theme.purple - }; - color: ${theme.text}; - ${CONFIG.currentTheme === "Classic Autobot" - ? `border: 1px dashed ${theme.highlight};` - : `border-color: ${theme.text}; border-style: dashed;` - } - } - - .wplace-btn-start { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.success} 0%, #228b22 100%)` - : theme.success - }; - color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.primary}; - ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.success};` : ""} - } - - .wplace-btn-stop { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.error} 0%, #dc143c 100%)` - : theme.error - }; - color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.text}; - ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.error};` : ""} - } - - .wplace-btn-select { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.highlight} 0%, #9370db 100%)` - : theme.highlight - }; - color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.primary}; - ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.highlight};` : ""} - } - - .wplace-btn-file { - background: ${CONFIG.currentTheme === "Classic Autobot" - ? "linear-gradient(135deg, #ff8c00 0%, #ff7f50 100%)" - : theme.warning - }; - color: ${CONFIG.currentTheme === "Classic Autobot" ? "white" : theme.primary}; - ${CONFIG.currentTheme === "Neon Retro" ? `border-color: ${theme.warning};` : ""} - } - - .wplace-btn:disabled { opacity: ${CONFIG.currentTheme === "Classic Autobot" ? "0.5" : "0.3"}; } - - .wplace-stats { - background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255,255,255,0.03)" : theme.secondary}; - padding: ${CONFIG.currentTheme === "Neon Retro" ? "12px" : "8px"}; - border: ${CONFIG.currentTheme === "Neon Retro" ? `2px solid ${theme.text}` : "1px solid rgba(255,255,255,0.1)"}; - border-radius: ${theme.borderRadius}; - margin-bottom: ${CONFIG.currentTheme === "Neon Retro" ? "15px" : "8px"}; - ${CONFIG.currentTheme === "Neon Retro" ? "box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1);" : ""} - } - - .wplace-stat-item { - padding: ${CONFIG.currentTheme === "Neon Retro" ? "6px 0" : "4px 0"}; - font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "11px"}; - ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px;" : ""} - } - .wplace-stat-label { font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "10px"}; } - .wplace-stat-value { color: ${theme.highlight}; } - - .wplace-progress { - background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(0,0,0,0.3)" : theme.secondary}; - border: ${CONFIG.currentTheme === "Neon Retro" ? `2px solid ${theme.text}` : "1px solid rgba(255,255,255,0.1)"}; - border-radius: ${theme.borderRadius}; - margin: ${CONFIG.currentTheme === "Neon Retro" ? "10px 0" : "8px 0"}; - height: ${CONFIG.currentTheme === "Neon Retro" ? "16px" : "6px"}; - } - - ${CONFIG.currentTheme === "Neon Retro" ? ` - .wplace-progress::before { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: - repeating-linear-gradient( - 45deg, - transparent, - transparent 2px, - rgba(0, 255, 65, 0.1) 2px, - rgba(0, 255, 65, 0.1) 4px - ); - pointer-events: none; - } - ` : ""} - - .wplace-progress-bar { - height: ${CONFIG.currentTheme === "Neon Retro" ? "100%" : "6px"}; - background: ${CONFIG.currentTheme === "Classic Autobot" - ? `linear-gradient(135deg, ${theme.highlight} 0%, #9370db 100%)` - : `linear-gradient(90deg, ${theme.success}, ${theme.neon})` - }; - transition: width ${CONFIG.currentTheme === "Neon Retro" ? "0.3s" : "0.5s"} ease; - ${CONFIG.currentTheme === "Neon Retro" ? `box-shadow: 0 0 10px ${theme.success};` : ""} - } - - ${CONFIG.currentTheme === "Classic Autobot" ? ` - .wplace-progress-bar::after { - background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); - animation: shimmer 2s infinite; - } - ` : ` - .wplace-progress-bar::after { - background: ${theme.text}; - } - `} - - .wplace-status { - padding: ${CONFIG.currentTheme === "Neon Retro" ? "10px" : "6px"}; - border: ${CONFIG.currentTheme === "Neon Retro" ? "2px solid" : "1px solid"}; - border-radius: ${theme.borderRadius}; - font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "11px"}; - ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px;" : ""} - } - - .status-default { - background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255,255,255,0.1)" : theme.accent}; - border-color: ${theme.text}; - color: ${theme.text}; - } - .status-success { - background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(0, 255, 0, 0.1)" : theme.success}; - border-color: ${theme.success}; - color: ${CONFIG.currentTheme === "Classic Autobot" ? theme.success : theme.primary}; - box-shadow: 0 0 15px ${theme.success}; - } - .status-error { - background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255, 0, 0, 0.1)" : theme.error}; - border-color: ${theme.error}; - color: ${CONFIG.currentTheme === "Classic Autobot" ? theme.error : theme.text}; - box-shadow: 0 0 15px ${theme.error}; - } - .status-warning { - background: ${CONFIG.currentTheme === "Classic Autobot" ? "rgba(255, 165, 0, 0.1)" : theme.warning}; - border-color: ${theme.warning}; - color: ${CONFIG.currentTheme === "Classic Autobot" ? "orange" : theme.primary}; - box-shadow: 0 0 15px ${theme.warning}; - } - - /* Settings and other dynamic elements */ - .resize-container { - background: ${theme.primary}; - border: ${theme.borderWidth} ${theme.borderStyle} ${theme.text}; - border-radius: ${theme.borderRadius}; - box-shadow: ${CONFIG.currentTheme === "Classic Autobot" ? "0 0 20px rgba(0,0,0,0.5)" : "0 0 30px rgba(0, 255, 65, 0.5)"}; - font-family: ${theme.fontFamily}; - } - - .resize-preview-wrapper { border: 1px solid ${theme.accent}; } - - .resize-controls label { - font-size: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "12px"}; - ${CONFIG.currentTheme === "Neon Retro" ? "text-transform: uppercase; letter-spacing: 1px;" : ""} - color: ${theme.text}; - } - - .resize-slider { - height: ${CONFIG.currentTheme === "Neon Retro" ? "8px" : "4px"}; - background: ${CONFIG.currentTheme === "Classic Autobot" ? "#ccc" : theme.secondary}; - border: ${CONFIG.currentTheme === "Neon Retro" ? `2px solid ${theme.text}` : "none"}; - border-radius: ${theme.borderRadius}; - } - - ${CONFIG.currentTheme === "Neon Retro" ? ` - .resize-slider::-webkit-slider-thumb { - width: 16px; - height: 16px; - background: ${theme.highlight}; - border: 2px solid ${theme.text}; - border-radius: 0; - box-shadow: 0 0 5px ${theme.highlight}; - } - - .resize-slider::-moz-range-thumb { - width: 16px; - height: 16px; - background: ${theme.highlight}; - border: 2px solid ${theme.text}; - border-radius: 0; - box-shadow: 0 0 5px ${theme.highlight}; - } - ` : ""} - - .wplace-slider::-webkit-slider-thumb { background: ${theme.highlight}; } - - ${CONFIG.currentTheme === "Neon Retro" ? ` - input[type="checkbox"] { - width: 16px; - height: 16px; - border: 2px solid ${theme.text}; - background: ${theme.secondary}; - } - input[type="checkbox"]:checked { background: ${theme.success}; } - input[type="checkbox"]:checked::after { color: ${theme.primary}; } - ` : ""} - - /* Additional theme-specific styles */ - .wplace-btn.active, - .wplace-btn[aria-pressed="true"] { - background: ${theme.highlight} !important; - color: ${theme.primary} !important; - border-color: ${theme.text} !important; - } - - .wplace-btn.active i, - .wplace-btn[aria-pressed="true"] i { filter: drop-shadow(0 0 3px ${theme.primary}); } - ` - document.head.appendChild(style) - const container = document.createElement("div") container.id = "wplace-image-bot-container" container.innerHTML = ` @@ -6939,6 +6562,7 @@ // Load theme preference immediately on startup before creating UI loadThemePreference() + applyTheme() createUI().then(() => { // Generate token automatically after UI is ready diff --git a/auto-image-styles.css b/auto-image-styles.css index 08d4998..466c157 100644 --- a/auto-image-styles.css +++ b/auto-image-styles.css @@ -1152,4 +1152,4 @@ .wplace-theme--neon .wplace-btn:hover:not(:disabled) { animation: pixelBlink 0.5s infinite; -} \ No newline at end of file +} From 37c0997d8473216ecc1074a8a4db1cd15be52873 Mon Sep 17 00:00:00 2001 From: Staninna <26458805+Staninna@users.noreply.github.com> Date: Mon, 25 Aug 2025 19:54:07 +0200 Subject: [PATCH 20/36] refactor: decouple CSS from Settings and Resize dialogs Replace inline styles with semantic CSS classes for better maintainability --- Auto-Image.js | 486 ++++++++++++---------------------- auto-image-styles.css | 594 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 757 insertions(+), 323 deletions(-) diff --git a/Auto-Image.js b/Auto-Image.js index 3e7f4a1..d20eba5 100644 --- a/Auto-Image.js +++ b/Auto-Image.js @@ -3455,168 +3455,82 @@ function applyTheme() { `; settingsContainer.innerHTML = ` -
- ${theme.animations?.scanline ? ` -
- ` : ''} -
-

- +
+
+

+ ${Utils.t("settings")}

- +
-
+
-
-