UU漫画网
首页
分类
排行榜
书架
我的
登录
☰
首页
分类
排行榜
书架
我的
登录
⬅ 返回
衣锦还乡 - 第11話
🏠 首页
上一话
下一话
🚀
返回作品目录
🚀
🏠
首页
🔍
分类
📚
书架
👤
我的
×
🧠 域名记忆法
帮您快速记住永久域名,不再迷路
UU
→
UU
(优优)
网址
→
wangzhi
(网址拼音)
www.uu
wangzhi
.com
💡 记住:
优优网址
=
UUwangzhi
🏠 这就是您回家的永久地址!
✅ 我已知晓
⏰ 稍后提醒
📱 保存图片
{ this.show(); }, 1500); } }, // 判断是否应该显示弹窗 shouldShow: function () { try { // 优先检查localStorage const hiddenTime = localStorage.getItem(this.storageKey); if (hiddenTime) { const now = new Date().getTime(); const hidden = parseInt(hiddenTime); // 检查是否已过24小时 (24 * 60 * 60 * 1000 = 86400000毫秒) if ((now - hidden) <= 86400000) { return false; // 未过期,不显示 } } // 检查Cookie状态(服务端可能已经处理过) const cookieConfirmed = this.getCookie('uu_memory_confirmed'); if (cookieConfirmed) { const now = Math.floor(new Date().getTime() / 1000); const confirmed = parseInt(cookieConfirmed); // 检查Cookie是否在24小时内 if ((now - confirmed) <= 86400) { return false; // Cookie未过期,不显示 } } return true; // 都过期了或不存在,显示弹窗 } catch (e) { // 如果检查失败,默认显示 return true; } }, // 获取Cookie值的辅助方法 getCookie: function (name) { try { const value = '; ' + document.cookie; const parts = value.split('; ' + name + '='); if (parts.length === 2) { return parts.pop().split(';').shift(); } } catch (e) { console.log('无法读取Cookie'); } return null; }, // 显示弹窗 show: function () { const overlay = document.getElementById('uuMemoryOverlay'); if (overlay) { overlay.classList.add('show'); // 防止背景滚动 document.body.style.overflow = 'hidden'; } }, // 关闭弹窗 close: function () { const overlay = document.getElementById('uuMemoryOverlay'); if (overlay) { overlay.classList.remove('show'); // 恢复背景滚动 document.body.style.overflow = ''; } }, // 确认已知晓(24小时内不再显示) confirm: function () { try { // 记录当前时间戳到localStorage const now = new Date().getTime(); localStorage.setItem(this.storageKey, now.toString()); // 同步状态到服务端Cookie this.syncToServer(now); } catch (e) { console.log('无法保存到localStorage'); } this.close(); }, // 同步确认状态到服务端 syncToServer: function (timestamp) { try { // 设置Cookie,24小时过期 const expires = new Date(); expires.setTime(expires.getTime() + (24 * 60 * 60 * 1000)); // 24小时 document.cookie = 'uu_memory_confirmed=' + Math.floor(timestamp / 1000) + '; expires=' + expires.toUTCString() + '; path=/; SameSite=Lax'; } catch (e) { console.log('无法设置Cookie'); } }, // 重置提醒(用于测试) reset: function () { try { // 清除localStorage localStorage.removeItem(this.storageKey); // 清除Cookie document.cookie = 'uu_memory_confirmed=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; console.log('域名记忆提醒已重置(localStorage和Cookie都已清除)'); } catch (e) { console.log('无法清除存储'); } }, // 保存图片功能 - 使用纯Canvas绘制 saveImage: function () { const saveBtn = document.querySelector('.uu-btn-save'); if (!saveBtn) { this.showToast('❌ 无法找到保存按钮'); return; } // 显示加载状态 const originalText = saveBtn.textContent; saveBtn.textContent = '🔄 生成中...'; saveBtn.disabled = true; try { // 创建Canvas const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); // 设置画布尺寸 canvas.width = 500; canvas.height = 400; // 绘制背景渐变 const gradient = ctx.createLinearGradient(0, 0, 0, canvas.height); gradient.addColorStop(0, '#667eea'); gradient.addColorStop(1, '#764ba2'); ctx.fillStyle = gradient; ctx.fillRect(0, 0, canvas.width, canvas.height); // 设置字体 ctx.font = 'bold 24px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif'; ctx.fillStyle = 'white'; ctx.textAlign = 'center'; // 绘制标题 ctx.fillText('🧠 域名记忆法', canvas.width / 2, 50); // 绘制副标题 ctx.font = '14px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif'; ctx.fillStyle = 'rgba(255, 255, 255, 0.9)'; ctx.fillText('帮您快速记住永久域名,不再迷路', canvas.width / 2, 75); // 绘制记忆流程 ctx.font = '18px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif'; // UU → 优优 ctx.fillStyle = 'rgba(255, 255, 255, 0.2)'; ctx.fillRect(100, 110, 80, 40); ctx.fillStyle = 'white'; ctx.fillText('UU', 140, 135); ctx.fillStyle = '#ffd700'; ctx.fillText('→', 200, 135); ctx.fillStyle = 'rgba(255, 215, 0, 0.2)'; ctx.fillRect(220, 110, 80, 40); ctx.fillStyle = 'white'; ctx.fillText('优优', 260, 135); // 网址 → wangzhi ctx.fillStyle = 'rgba(255, 255, 255, 0.2)'; ctx.fillRect(100, 170, 80, 40); ctx.fillStyle = 'white'; ctx.fillText('网址', 140, 195); ctx.fillStyle = '#ffd700'; ctx.fillText('→', 200, 195); ctx.fillStyle = 'rgba(255, 215, 0, 0.2)'; ctx.fillRect(220, 170, 120, 40); ctx.fillStyle = 'white'; ctx.fillText('wangzhi', 280, 195); // 绘制最终域名 ctx.fillStyle = 'rgba(255, 255, 255, 0.95)'; ctx.fillRect(50, 230, 400, 50); ctx.fillStyle = '#333'; ctx.font = 'bold 22px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif'; ctx.fillText('www.uuwangzhi.com', canvas.width / 2, 260); // 绘制提示 ctx.font = '16px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif'; ctx.fillStyle = 'white'; ctx.fillText('💡 记住:优优网址 = UUwangzhi', canvas.width / 2, 320); ctx.fillText('🏠 这就是您回家的永久地址!', canvas.width / 2, 350); // 创建下载链接 const link = document.createElement('a'); link.download = 'UU漫画域名记忆法.png'; link.href = canvas.toDataURL('image/png'); // 触发下载 document.body.appendChild(link); link.click(); document.body.removeChild(link); // 恢复按钮状态 saveBtn.textContent = originalText; saveBtn.disabled = false; // 显示成功提示 this.showToast('✅ 图片已保存到下载文件夹'); } catch (error) { console.error('生成图片失败:', error); saveBtn.textContent = originalText; saveBtn.disabled = false; this.showToast('❌ 保存失败,请重试'); } }, // 显示提示消息 showToast: function (message) { // 创建提示元素 const toast = document.createElement('div'); toast.textContent = message; toast.style.cssText = ` position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.8); color: white; padding: 12px 20px; border-radius: 25px; font-size: 14px; z-index: 10000; animation: fadeInOut 2s ease-in-out; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; `; // 添加动画样式 const style = document.createElement('style'); style.textContent = ` @keyframes fadeInOut { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } } `; document.head.appendChild(style); document.body.appendChild(toast); // 2秒后移除 setTimeout(() => { if (toast.parentNode) { toast.parentNode.removeChild(toast); } if (style.parentNode) { style.parentNode.removeChild(style); } }, 2000); } }; // 页面加载完成后初始化 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { UUMemory.init(); }); } else { UUMemory.init(); } // 点击遮罩层关闭弹窗 document.addEventListener('click', function (e) { if (e.target && e.target.id === 'uuMemoryOverlay') { UUMemory.close(); } }); // ESC键关闭弹窗 document.addEventListener('keydown', function (e) { if (e.key === 'Escape') { UUMemory.close(); } }); // 防止弹窗内部点击冒泡 document.addEventListener('click', function (e) { if (e.target && e.target.closest('.uu-memory-modal')) { e.stopPropagation(); } });
反馈
×
📝 章节问题反馈
发现图片缺失或其他问题?请告诉我们,我们会尽快修复!
问题类型:
请选择问题类型
图片缺失
图片损坏
图片顺序错误
加载缓慢
其他问题
详细描述:
联系方式(可选):
取消
提交反馈