Upload Your Photo

Click or drag your photo here

Supports JPG, PNG formats, max 5MB

Receive Your Artwork

Lilo and Stitch & Stitch and Lilo Example Results

Lilo and Stitch Style Art 1, stitch and lilo AI艺术示例 Lilo and Stitch Style Art 2, stitch and lilo AI艺术示例 Lilo and Stitch Style Art 3, stitch and lilo AI艺术示例

Why Choose Us

Fast Conversion

Using advanced AI technology, transform your photos into beautiful Disney-style art within 24 hours

Privacy Protection

We value your privacy. Uploaded photos are only used for art creation and no other purposes

Perfect Match

Specially optimized for Lilo & Stitch style, ensuring your photos perfectly blend into the Disney world

// 初始化登录模态框 function initializeLoginModal() { console.log('🎯 ===== 开始初始化登录模态框 ====='); // 防止重复初始化 if (window.loginModalInitialized) { console.log('⚠️ 登录模态框已经初始化过,跳过'); return; } window.loginModalInitialized = true; console.log('✅ 设置登录模态框初始化标志'); // Login Modal const loginBtn = document.getElementById('loginBtn'); const loginModal = document.getElementById('loginModal'); const closeModal = document.getElementById('closeModal'); console.log('🔍 检查登录按钮绑定:', { loginBtn: !!loginBtn, loginModal: !!loginModal, alreadyBound: loginBtn ? loginBtn.hasAttribute('data-modal-bound') : false }); if (loginBtn && loginModal && !loginBtn.hasAttribute('data-modal-bound')) { loginBtn.setAttribute('data-modal-bound', 'true'); loginBtn.addEventListener('click', function(e) { console.log('🔘 登录按钮被点击!'); e.preventDefault(); e.stopPropagation(); showModal(); }); console.log('✅ 登录按钮事件绑定完成'); } else { console.log('⚠️ 登录按钮事件绑定失败或已绑定'); } if (closeModal && !closeModal.hasAttribute('data-modal-bound')) { closeModal.setAttribute('data-modal-bound', 'true'); closeModal.addEventListener('click', function() { hideModal(); }); } // 点击模态框外部关闭 if (loginModal && !loginModal.hasAttribute('data-modal-bound')) { loginModal.setAttribute('data-modal-bound', 'true'); loginModal.addEventListener('click', function(e) { if (e.target === loginModal) { hideModal(); } }); } // ESC键关闭弹窗(只绑定一次) if (!window.escKeyBound) { window.escKeyBound = true; document.addEventListener('keydown', function(e) { if (e.key === 'Escape' && !loginModal.classList.contains('hidden')) { hideModal(); } }); } // 显示弹窗的函数 function showModal() { console.log('🚀 showModal() 被调用'); const modalContent = document.getElementById('loginModalContent'); console.log('🔍 模态框元素检查:', { loginModal: !!loginModal, modalContent: !!modalContent, currentClasses: loginModal ? loginModal.className : 'N/A' }); // 显示模态框 loginModal.classList.remove('hidden'); loginModal.style.display = 'flex'; console.log('✅ 模态框应该已显示,当前状态:', { display: loginModal.style.display, classes: loginModal.className }); // 添加动画类 loginModal.classList.add('modal-show'); loginModal.classList.remove('modal-hide'); // 延迟添加内容动画,确保背景先显示 setTimeout(() => { if (modalContent) { modalContent.classList.add('modal-content-show'); modalContent.classList.remove('modal-content-hide'); modalContent.style.opacity = '1'; modalContent.style.transform = 'scale(1) translateY(0)'; } }, 50); // 检查是否需要显示备用Google登录 setTimeout(() => { if (typeof checkAndShowFallback === 'function') { checkAndShowFallback(); } // Google登录按钮事件绑定已在showFallbackLogin中处理,避免重复绑定 }, 200); } // 隐藏弹窗的函数 function hideModal() { const modalContent = document.getElementById('loginModalContent'); // 添加隐藏动画类 loginModal.classList.add('modal-hide'); loginModal.classList.remove('modal-show'); if (modalContent) { modalContent.classList.add('modal-content-hide'); modalContent.classList.remove('modal-content-show'); modalContent.style.opacity = '0'; modalContent.style.transform = 'scale(0.9) translateY(-20px)'; } // 动画完成后隐藏模态框 setTimeout(() => { loginModal.classList.add('hidden'); loginModal.style.display = 'none'; // 重置动画类 loginModal.classList.remove('modal-hide', 'modal-show'); if (modalContent) { modalContent.classList.remove('modal-content-hide', 'modal-content-show'); modalContent.style.opacity = '0'; modalContent.style.transform = 'scale(0.95) translateY(-20px)'; } }, 300); } // 将函数暴露到全局作用域,以便其他地方调用 window.showLoginModal = showModal; window.hideLoginModal = hideModal; // 导航栏滚动效果现在由ui.js处理 // Upload Functionality const uploadArea = document.getElementById('uploadArea'); const previewContainer = document.getElementById('previewContainer'); const previewImage = document.getElementById('previewImage'); const successMessage = document.getElementById('successMessage'); uploadArea.addEventListener('click', function() { const fileInput = document.createElement('input'); fileInput.type = 'file'; fileInput.accept = 'image/jpeg, image/png'; fileInput.addEventListener('change', function(e) { const file = e.target.files[0]; if (file) { handleFileUpload(file); } }); fileInput.click(); }); // Drag and Drop uploadArea.addEventListener('dragover', function(e) { e.preventDefault(); uploadArea.classList.add('border-purple-500', 'bg-purple-50'); }); uploadArea.addEventListener('dragleave', function() { uploadArea.classList.remove('border-purple-500', 'bg-purple-50'); }); uploadArea.addEventListener('drop', function(e) { e.preventDefault(); uploadArea.classList.remove('border-purple-500', 'bg-purple-50'); const file = e.dataTransfer.files[0]; if (file && (file.type === 'image/jpeg' || file.type === 'image/png')) { handleFileUpload(file); } else { if (window.ui && window.ui.showToast) { window.ui.showToast('请上传JPG或PNG格式的图片', 'error'); } else { alert('请上传JPG或PNG格式的图片'); } } }); function handleFileUpload(file) { if (file.size > 5 * 1024 * 1024) { if (window.ui && window.ui.showToast) { window.ui.showToast('文件大小不能超过5MB', 'error'); } else { alert('文件大小不能超过5MB'); } return; } const reader = new FileReader(); reader.onload = function(e) { previewImage.src = e.target.result; previewContainer.classList.remove('hidden'); uploadArea.classList.add('hidden'); successMessage.classList.remove('hidden'); }; reader.readAsDataURL(file); } // Form Submission const emailInput = document.getElementById('emailInput'); const emailError = document.getElementById('emailError'); const submitBtn = document.getElementById('submitBtn'); submitBtn.addEventListener('click', function() { const email = emailInput.value.trim(); const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(email)) { emailError.classList.remove('hidden'); return; } emailError.classList.add('hidden'); if (window.ui && window.ui.showToast) { window.ui.showToast('感谢您的提交!我们将在24小时内将您的Lilo & Stitch风格艺术作品发送到您的邮箱。'); } else { alert('感谢您的提交!我们将在24小时内将您的Lilo & Stitch风格艺术作品发送到您的邮箱。'); } // Reset form previewContainer.classList.add('hidden'); successMessage.classList.add('hidden'); uploadArea.classList.remove('hidden'); emailInput.value = ''; }); // Google登录已经通过链接直接跳转到后端处理 // 不需要额外的表单提交处理 // 处理 Google OAuth 回调 const urlParams = new URLSearchParams(window.location.search); const token = urlParams.get('token'); const success = urlParams.get('success'); const error = urlParams.get('error'); if (token && success === 'google_login') { // Google登录成功的处理已经在ui.js的checkLoginStatus中自动处理 // 这里不需要重复处理 } else if (error) { let errorMessage = 'Google 登录失败'; switch (error) { case 'no_code': errorMessage = 'Google 授权失败:未获取到授权码'; break; case 'no_token': errorMessage = 'Google 授权失败:未获取到访问令牌'; break; case 'no_email': errorMessage = 'Google 授权失败:未获取到邮箱信息'; break; case 'oauth_failed': errorMessage = 'Google OAuth 处理失败'; break; } if (window.ui && window.ui.showToast) { window.ui.showToast(errorMessage, 'error'); } else { alert(errorMessage); } // 清理 URL 参数 window.history.replaceState({}, document.title, window.location.pathname); } // 登录状态检查已经在ui.js的initLoginState中自动处理 } // 当DOM加载完成或立即执行初始化 // 延迟执行以确保UI.js已经完全加载 function delayedInit() { console.log('🚀 开始延迟初始化登录模态框...'); setTimeout(() => { initializeLoginModal(); // 确保UserMenu模块也能绑定登录按钮 if (window.UserMenu && window.UserMenu.bindLoginButton) { window.UserMenu.bindLoginButton(); } }, 800); // 增加延迟确保所有模块都已加载 } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', delayedInit); } else { delayedInit(); } // 额外的备用初始化,确保登录按钮事件绑定 setTimeout(() => { const loginBtn = document.getElementById('loginBtn'); if (loginBtn && !loginBtn.hasAttribute('data-final-bound')) { console.log('🔧 执行最终登录按钮绑定检查...'); loginBtn.setAttribute('data-final-bound', 'true'); // 移除可能的重复事件监听器 const newBtn = loginBtn.cloneNode(true); loginBtn.parentNode.replaceChild(newBtn, loginBtn); // 重新绑定事件 newBtn.addEventListener('click', function(e) { console.log('🔘 登录按钮被点击(最终绑定)'); e.preventDefault(); e.stopPropagation(); if (window.showLoginModal) { window.showLoginModal(); } else { console.error('❌ showLoginModal函数未找到'); } }); console.log('✅ 最终登录按钮事件绑定完成'); } }, 1500);