Domain Bidding System
200 characters remaining
3994
// 字符计数功能 const messageInput = document.getElementById('message'); const charCount = document.getElementById('charCount'); messageInput.addEventListener('input', function() { const remaining = 200 - this.value.length; charCount.textContent = remaining; if (remaining < 50) { charCount.style.color = remaining < 20 ? '#FF3B30' : '#FF9500'; } else { charCount.style.color = '#86868b'; } }); // 添加表单提交动画 const form = document.getElementById('bidForm'); form.addEventListener('submit', function() { const button = this.querySelector('button[type="submit"]'); button.innerHTML = 'Submitting...'; button.disabled = true; }); // 刷新验证码 document.getElementById('refreshCaptcha').addEventListener('click', function() { fetch('refresh_captcha.php') .then(response => response.text()) .then(code => { document.getElementById('captchaDisplay').textContent = code; document.getElementById('captcha').value = ''; }); }); // 明暗模式切换 const themeToggle = document.getElementById('themeToggle'); const sunIcon = document.getElementById('sunIcon'); const moonIcon = document.getElementById('moonIcon'); // 检查本地存储中的主题偏好 if (localStorage.getItem('theme') === 'dark') { document.body.classList.add('dark-mode'); sunIcon.style.display = 'block'; moonIcon.style.display = 'none'; } else { sunIcon.style.display = 'none'; moonIcon.style.display = 'block'; } themeToggle.addEventListener('click', function() { document.body.classList.toggle('dark-mode'); if (document.body.classList.contains('dark-mode')) { localStorage.setItem('theme', 'dark'); sunIcon.style.display = 'block'; moonIcon.style.display = 'none'; } else { localStorage.setItem('theme', 'light'); sunIcon.style.display = 'none'; moonIcon.style.display = 'block'; } });