首页
关于
Search
1
ARK Server Manager (方舟开服器简易教程)
1,140 阅读
2
Hyper-V虚拟机无法启动提示Start Pxe over IPv4解决方法
881 阅读
3
HTTP代理格式含义
606 阅读
4
关于山东联通最新光猫中兴F677v2无法改桥接的问题
488 阅读
5
虚拟显示器
458 阅读
说说
游戏
方舟
软件
Linux
Ubuntu
Openwrt
Docker
分享
QZRS
WEB
登录
Search
标签搜索
Openwrt
丶曲終人散ゞ
累计撰写
87
篇文章
累计收到
160
条评论
首页
栏目
说说
游戏
方舟
软件
Linux
Ubuntu
Openwrt
Docker
分享
QZRS
WEB
页面
关于
搜索到
87
篇与
的结果
2025-10-07
GitHub 上的 那些神仙开源项目
Video2X 视频增强工具,主要功能是通过超分辨率超分辨率(提升视频分辨率)和帧插值(提高视频帧率)来改善视频质量 mpv_PlayKit 基于MPV播放器修改版本 软件屏蔽器 Malware-Patch(软件屏蔽器)是一个用于 Windows 平台的工具,主要功能是阻止指定软件的管理员授权(UAC 授权),且无需在后台持续运行。 QtScrcpy 基于Scrcpy 项目开发的工具,支持通过 USB 或网络连接 Android 设备,并实现设备屏幕的显示和控制,且无需 root 权限。核心特点 Umi-OCR 可批量处理的离线 OCR(光学字符识别)软件
2025年10月07日
8 阅读
1 评论
0 点赞
2025-10-06
移动新光猫九联UNG853H破解超级密码
今天搞了个移动千兆宽带玩玩。因为便宜。瞎折腾。第一步进入后台打开http://192.168.1.1/webcmcc/telnet.html看到浏览器提示open telnet success就成功打开telnet了使用CMD或者支持telnet第三方工具。帐号密码在光猫后面。输入指令vi /config/workb/backup_lastgood.xml然后在输入/CMCCAdmin就看到了
2025年10月06日
10 阅读
2 评论
0 点赞
2025-09-16
此内容被密码保护
加密文章,请前往内页查看详情
2025年09月16日
5 阅读
0 评论
0 点赞
2025-09-15
WEB实用工具集
多功能在线实用工具 tailwind.config = { theme: { extend: { colors: { primary: '#3B82F6', secondary: '#10B981', accent: '#8B5CF6', dark: '#1E293B', light: '#F8FAFC', calculator: { bg: '#1C1C1C', button: { gray: '#505050', orange: '#FF9500', lightGray: '#D4D4D2' } } }, fontFamily: { inter: ['Inter', 'system-ui', 'sans-serif'], }, } } } @layer utilities { .content-auto { content-visibility: auto; } .tool-card { @apply bg-white rounded-xl shadow-md hover:shadow-lg transition-all duration-300 p-5 border border-gray-100; } .btn-primary { @apply bg-primary hover:bg-primary/90 text-white font-medium py-2 px-4 rounded-lg transition-all duration-200; } .btn-secondary { @apply bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-2 px-4 rounded-lg transition-all duration-200; } .input-field { @apply w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-primary outline-none transition-all; } .section-title { @apply text-[clamp(1.5rem,3vw,2.5rem)] font-bold text-dark mb-6 relative inline-block; } .section-title::after { content: ''; @apply absolute left-0 bottom-0 w-1/3 h-1 bg-primary rounded-full; } /* 进制转换器专用样式 */ .number-input { @apply w-full px-4 py-3 rounded-lg border-2 transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary/50; } .card { @apply bg-white rounded-xl shadow-lg p-6 transition-all duration-300 hover:shadow-xl; } .btn { @apply px-6 py-3 rounded-lg font-medium transition-all duration-300 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-offset-2; } /* 计算器专用样式 */ .calc-container { @apply bg-calculator-bg rounded-3xl p-6 shadow-2xl max-w-xs mx-auto overflow-hidden; } .calc-display { @apply w-full bg-calculator-bg text-white text-right py-8 px-4 text-[clamp(2rem,5vw,3rem)] font-bold border-none focus:ring-0; } .calc-btn { @apply rounded-full flex items-center justify-center text-[clamp(1.2rem,3vw,1.5rem)] font-medium transition-all duration-200 active:scale-95; } .calc-btn-gray { @apply bg-calculator-button-gray text-white hover:bg-gray-400; } .calc-btn-orange { @apply bg-calculator-button-orange text-white hover:bg-orange-400; } .calc-btn-light { @apply bg-calculator-button-lightGray text-gray-800 hover:bg-gray-300; } /* 照片压缩工具专用样式 */ .shadow-soft { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); } .transition-custom { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .scale-hover { @apply hover:scale-105 transition-all duration-300; } } 实用工具集 JSON工具 加解密 文本工具 计算器 进制转换 编码转换 照片压缩 JSON工具 加解密 文本工具 计算器 进制转换 编码转换 照片压缩 在线实用工具 集成JSON处理、加解密、文本格式化、计算器、进制转换、编码转换和照片压缩等多种实用工具,满足您的日常开发与生活需求 开始使用 工具列表 工具概览 JSON工具 包含JSON在线解析、格式化、校验等功能,轻松处理JSON数据。 查看详情 加解密工具 提供多种加密解密算法,保护您的数据安全。 查看详情 文本工具 文本压缩、格式化、大小写转换等实用文本处理功能。 查看详情 高级计算器 科学计算器,支持复杂数学运算、三角函数和表达式计算。 查看详情 进制转换器 支持二进制、八进制、十进制和十六进制之间的相互转换。 查看详情 编码转换 多种编码格式之间的转换,包括Base64、URL编码等。 查看详情 照片压缩 浏览器端处理图片压缩,支持JPG/PNG/WebP格式,保护隐私安全。 查看详情 JSON工具 格式化 压缩 校验 清空 复制结果 输入JSON 输出结果 加解密工具 加密算法 AES DES Base64 MD5 SHA-1 密钥 (AES/DES) 加密 解密 清空 复制结果 输入内容 输出结果 文本工具 全部大写 全部小写 首字母大写 反转文本 统计字数 清空 复制结果 输入文本 处理结果 字符数: 0 单词数: 0 行数: 0 高级计算器 标准 科学 sin cos tan log ln √ x² x³ 1/x π C CE ← ÷ 7 8 9 × 4 5 6 - 1 2 3 + ± 0 . = 计算历史 暂无计算记录 清除历史记录 进制转换器 进制转换工具 输入 数值 当前进制 二进制 八进制 十进制 十六进制 转换 转换结果 二进制 八进制 十进制 十六进制 转换历史 暂无历史记录 编码转换 转换类型 Base64 URL编码 HTML实体 Unicode 编码 解码 清空 复制结果 输入内容 输出结果 照片压缩工具 上传图片 支持JPG、PNG等格式,文件将在浏览器中处理,不会上传到服务器 选择图片 重新选择 压缩设置 压缩质量: 80% 数值越低,压缩率越高,画质可能下降越明显 输出格式 JPEG PNG WebP (现代格式) 选择压缩后的图片格式 开始压缩 压缩前后对比 原图 暂无图片 尺寸: -- 大小: -- 格式: -- 压缩后 暂无图片 尺寸: -- 大小: -- 格式: -- 下载压缩图片 提示信息将显示在这里 正在处理图片... // 导航栏滚动效果 window.addEventListener('scroll', function() { const navbar = document.getElementById('navbar'); if (window.scrollY > 10) { navbar.classList.add('py-2', 'shadow'); navbar.classList.remove('py-3', 'shadow-sm'); } else { navbar.classList.add('py-3', 'shadow-sm'); navbar.classList.remove('py-2', 'shadow'); } }); // 移动端菜单切换 const menuToggle = document.getElementById('menu-toggle'); const mobileMenu = document.getElementById('mobile-menu'); menuToggle.addEventListener('click', function() { if (mobileMenu.classList.contains('opacity-0')) { mobileMenu.classList.remove('opacity-0', '-translate-y-full', 'pointer-events-none'); mobileMenu.classList.add('opacity-100', 'translate-y-0', 'pointer-events-auto'); menuToggle.innerHTML = ''; } else { mobileMenu.classList.add('opacity-0', '-translate-y-full', 'pointer-events-none'); mobileMenu.classList.remove('opacity-100', 'translate-y-0', 'pointer-events-auto'); menuToggle.innerHTML = ''; } }); // 平滑滚动 document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); // 关闭移动菜单(如果打开) if (!mobileMenu.classList.contains('opacity-0')) { mobileMenu.classList.add('opacity-0', '-translate-y-full', 'pointer-events-none'); mobileMenu.classList.remove('opacity-100', 'translate-y-0', 'pointer-events-auto'); menuToggle.innerHTML = ''; } document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); // JSON工具功能 const jsonInput = document.getElementById('json-input'); const jsonOutput = document.getElementById('json-output'); const jsonStatus = document.getElementById('json-status'); // 格式化JSON document.getElementById('json-format').addEventListener('click', function() { try { const obj = JSON.parse(jsonInput.value); jsonOutput.textContent = JSON.stringify(obj, null, 2); showStatus('success', 'JSON格式化成功'); } catch (e) { showStatus('error', 'JSON格式错误: ' + e.message); } }); // 压缩JSON document.getElementById('json-minify').addEventListener('click', function() { try { const obj = JSON.parse(jsonInput.value); jsonOutput.textContent = JSON.stringify(obj); showStatus('success', 'JSON压缩成功'); } catch (e) { showStatus('error', 'JSON格式错误: ' + e.message); } }); // 校验JSON document.getElementById('json-validate').addEventListener('click', function() { try { JSON.parse(jsonInput.value); showStatus('success', 'JSON格式有效'); } catch (e) { showStatus('error', 'JSON格式无效: ' + e.message); } }); // 清空JSON document.getElementById('json-clear').addEventListener('click', function() { jsonInput.value = ''; jsonOutput.textContent = ''; jsonStatus.classList.add('hidden'); }); // 复制JSON结果 document.getElementById('json-copy').addEventListener('click', function() { navigator.clipboard.writeText(jsonOutput.textContent) .then(() => showStatus('success', '已复制到剪贴板')) .catch(err => showStatus('error', '复制失败: ' + err)); }); // 显示状态信息 function showStatus(type, message) { jsonStatus.textContent = message; jsonStatus.classList.remove('hidden', 'text-green-600', 'text-red-600'); if (type === 'success') { jsonStatus.classList.add('text-green-600'); } else { jsonStatus.classList.add('text-red-600'); } // 3秒后隐藏状态 setTimeout(() => { jsonStatus.classList.add('hidden'); }, 3000); } // 加解密工具功能 const cryptoInput = document.getElementById('crypto-input'); const cryptoOutput = document.getElementById('crypto-output'); const cryptoKey = document.getElementById('crypto-key'); let selectedAlgorithm = 'aes'; // 算法选择 document.querySelectorAll('.crypto-algorithm-btn').forEach(btn => { btn.addEventListener('click', function() { // 更新按钮样式 document.querySelectorAll('.crypto-algorithm-btn').forEach(b => { b.classList.remove('btn-primary', 'active'); b.classList.add('btn-secondary'); }); this.classList.remove('btn-secondary'); this.classList.add('btn-primary', 'active'); // 更新选中的算法 selectedAlgorithm = this.getAttribute('data-algorithm'); // 显示或隐藏密钥输入框 if (selectedAlgorithm === 'aes' || selectedAlgorithm === 'des') { document.getElementById('crypto-key-container').classList.remove('hidden'); } else { document.getElementById('crypto-key-container').classList.add('hidden'); } }); }); // 加密 document.getElementById('encrypt-btn').addEventListener('click', function() { if (!cryptoInput.value.trim()) { alert('请输入需要加密的内容'); return; } try { let result = ''; switch(selectedAlgorithm) { case 'aes': case 'des': if (!cryptoKey.value.trim()) { alert('请输入密钥'); return; } // 简化的加密实现(实际应用中应使用更安全的加密库) result = simpleEncrypt(cryptoInput.value, cryptoKey.value); break; case 'base64': result = btoa(unescape(encodeURIComponent(cryptoInput.value))); break; case 'md5': result = md5(cryptoInput.value); break; case 'sha1': result = sha1(cryptoInput.value); break; } cryptoOutput.value = result; } catch (e) { alert('加密失败: ' + e.message); } }); // 解密 document.getElementById('decrypt-btn').addEventListener('click', function() { if (!cryptoInput.value.trim()) { alert('请输入需要解密的内容'); return; } try { let result = ''; switch(selectedAlgorithm) { case 'aes': case 'des': if (!cryptoKey.value.trim()) { alert('请输入密钥'); return; } // 简化的解密实现 result = simpleDecrypt(cryptoInput.value, cryptoKey.value); break; case 'base64': result = decodeURIComponent(escape(atob(cryptoInput.value))); break; case 'md5': case 'sha1': alert('MD5和SHA-1是单向哈希算法,无法解密'); return; } cryptoOutput.value = result; } catch (e) { alert('解密失败: ' + e.message); } }); // 清空加解密内容 document.getElementById('crypto-clear').addEventListener('click', function() { cryptoInput.value = ''; cryptoOutput.value = ''; cryptoKey.value = ''; }); // 复制加解密结果 document.getElementById('crypto-copy').addEventListener('click', function() { navigator.clipboard.writeText(cryptoOutput.value) .then(() => alert('已复制到剪贴板')) .catch(err => alert('复制失败: ' + err)); }); // 简单的加密解密实现(仅作演示,实际应用需使用专业加密库) function simpleEncrypt(text, key) { let result = ''; for (let i = 0; i < text.length; i++) { const textCharCode = text.charCodeAt(i); const keyCharCode = key.charCodeAt(i % key.length); result += String.fromCharCode(textCharCode ^ keyCharCode); } return btoa(result); } function simpleDecrypt(text, key) { let decoded = atob(text); let result = ''; for (let i = 0; i < decoded.length; i++) { const textCharCode = decoded.charCodeAt(i); const keyCharCode = key.charCodeAt(i % key.length); result += String.fromCharCode(textCharCode ^ keyCharCode); } return result; } // MD5哈希实现(简化版) function md5(str) { // 实际应用中应使用更完善的MD5实现 let hash = 0; for (let i = 0; i < str.length; i++) { const char = str.charCodeAt(i); hash = ((hash alert('复制失败: ' + err)); }); // 增强版计算器功能 const calcDisplay = document.getElementById('calc-display'); const calcHistory = document.getElementById('calc-history'); const calculationHistory = document.getElementById('calculation-history'); const scientificFunctions = document.getElementById('scientific-functions'); const standardModeBtn = document.getElementById('standard-mode'); const scientificModeBtn = document.getElementById('scientific-mode'); let currentValue = '0'; let previousValue = null; let operator = null; let resetOnNextInput = false; let calculationHistoryList = []; // 模式切换 standardModeBtn.addEventListener('click', () => { scientificFunctions.classList.add('hidden'); standardModeBtn.classList.remove('calc-btn-gray'); standardModeBtn.classList.add('calc-btn-light'); scientificModeBtn.classList.remove('calc-btn-light'); scientificModeBtn.classList.add('calc-btn-gray'); }); scientificModeBtn.addEventListener('click', () => { scientificFunctions.classList.remove('hidden'); scientificModeBtn.classList.remove('calc-btn-gray'); scientificModeBtn.classList.add('calc-btn-light'); standardModeBtn.classList.remove('calc-btn-light'); standardModeBtn.classList.add('calc-btn-gray'); }); // 数字和运算符按钮点击事件 document.querySelectorAll('.calc-btn[data-value]').forEach(btn => { btn.addEventListener('click', function() { const value = this.getAttribute('data-value'); // 数字和小数点 if (!isNaN(value) || value === '.') { handleNumberInput(value); } // 运算符 else if (['+', '-', '*', '/', '%'].includes(value)) { handleOperator(value); } // 等于 else if (value === '=') { calculateResult(); } // 清除全部 else if (value === 'C') { clearCalculator(); } // 清除当前输入 else if (value === 'CE') { currentValue = '0'; updateDisplay(); } // 退格 else if (value === '←') { backspace(); } // 正负号 else if (value === '+/-') { toggleSign(); } }); }); // 科学函数按钮点击事件 document.querySelectorAll('.calc-btn[data-func]').forEach(btn => { btn.addEventListener('click', function() { const func = this.getAttribute('data-func'); handleScientificFunction(func); }); }); // 清除历史记录 document.getElementById('clear-history').addEventListener('click', () => { calculationHistoryList = []; updateCalculationHistory(); }); // 处理数字输入 function handleNumberInput(value) { if (resetOnNextInput) { currentValue = '0'; resetOnNextInput = false; } // 处理小数点 if (value === '.') { if (!currentValue.includes('.')) { currentValue += '.'; } updateDisplay(); return; } // 处理数字 if (currentValue === '0') { currentValue = value; } else { // 限制最大长度 if (currentValue.length < 15) { currentValue += value; } } updateDisplay(); } // 处理运算符 function handleOperator(op) { if (operator && previousValue !== null && !resetOnNextInput) { // 如果已经有运算符,则先计算结果 calculateResult(false); } previousValue = currentValue; operator = op; resetOnNextInput = true; // 更新历史显示 calcHistory.textContent = `${previousValue} ${getOperatorSymbol(operator)}`; } // 处理科学函数 function handleScientificFunction(func) { const num = parseFloat(currentValue); let result; switch(func) { case 'sin': result = Math.sin(num * Math.PI / 180); // 角度转弧度 break; case 'cos': result = Math.cos(num * Math.PI / 180); break; case 'tan': result = Math.tan(num * Math.PI / 180); break; case 'log': result = Math.log10(num); break; case 'ln': result = Math.log(num); break; case 'sqrt': result = Math.sqrt(num); break; case 'pow': result = Math.pow(num, 2); break; case 'pow3': result = Math.pow(num, 3); break; case '1/x': result = 1 / num; break; case 'pi': result = Math.PI; break; default: return; } // 处理计算错误 if (isNaN(result) || !isFinite(result)) { currentValue = "错误"; } else { // 格式化结果 currentValue = formatNumber(result); resetOnNextInput = true; } updateDisplay(); } // 计算结果 function calculateResult(addToHistory = true) { if (!operator || previousValue === null) return; const prev = parseFloat(previousValue); const curr = parseFloat(currentValue); let result; // 更新历史显示 calcHistory.textContent = `${previousValue} ${getOperatorSymbol(operator)} ${currentValue} =`; // 执行计算 switch(operator) { case '+': result = prev + curr; break; case '-': result = prev - curr; break; case '*': result = prev * curr; break; case '/': if (curr === 0) { currentValue = "错误"; updateDisplay(); return; } result = prev / curr; break; case '%': result = prev % curr; break; default: return; } // 格式化结果 currentValue = formatNumber(result); // 添加到历史记录 if (addToHistory) { const historyItem = { expression: `${previousValue} ${getOperatorSymbol(operator)} ${curr}`, result: currentValue, timestamp: new Date().toLocaleTimeString() }; calculationHistoryList.unshift(historyItem); if (calculationHistoryList.length > 10) { calculationHistoryList.pop(); } updateCalculationHistory(); } operator = null; previousValue = null; resetOnNextInput = true; updateDisplay(); } // 格式化数字显示 function formatNumber(num) { // 处理大数和小数显示 if (Math.abs(num) > 1e12 || (Math.abs(num) < 1e-6 && num !== 0)) { return num.toExponential(6); } // 处理小数位数 if (num % 1 !== 0) { // 保留最多6位小数 return parseFloat(num.toFixed(6)).toString(); } // 限制整数长度 const str = num.toString(); return str.length > 15 ? num.toExponential(6) : str; } // 获取运算符符号 function getOperatorSymbol(op) { const symbols = { '+': '+', '-': '-', '*': '×', '/': '÷', '%': '%' }; return symbols[op] || op; } // 清空计算器 function clearCalculator() { currentValue = '0'; previousValue = null; operator = null; resetOnNextInput = false; calcHistory.textContent = ''; updateDisplay(); } // 退格 function backspace() { if (currentValue === "错误") { currentValue = "0"; } else if (currentValue.length > 1) { currentValue = currentValue.slice(0, -1); } else { currentValue = '0'; } updateDisplay(); } // 正负号切换 function toggleSign() { if (currentValue !== "0" && currentValue !== "错误") { currentValue = (parseFloat(currentValue) * -1).toString(); updateDisplay(); } } // 更新计算器显示 function updateDisplay() { // 限制显示长度 if (currentValue.length > 15) { calcDisplay.value = currentValue.substring(0, 15) + '...'; } else { calcDisplay.value = currentValue; } } // 更新计算历史记录显示 function updateCalculationHistory() { if (calculationHistoryList.length === 0) { calculationHistory.innerHTML = '暂无计算记录'; return; } calculationHistory.innerHTML = ''; calculationHistoryList.forEach(item => { const historyEntry = document.createElement('div'); historyEntry.className = 'py-2 px-3 bg-gray-50 rounded-lg'; historyEntry.innerHTML = ` ${item.expression} ${item.timestamp} ${item.result} `; calculationHistory.appendChild(historyEntry); }); } // 编码转换工具功能 const encodingInput = document.getElementById('encoding-input'); const encodingOutput = document.getElementById('encoding-output'); let selectedEncodingType = 'url'; // 默认选中URL编码 // 编码类型选择 document.querySelectorAll('.encoding-type-btn').forEach(btn => { btn.addEventListener('click', function() { // 更新按钮样式 document.querySelectorAll('.encoding-type-btn').forEach(b => { b.classList.remove('btn-primary', 'active'); b.classList.add('btn-secondary'); }); this.classList.remove('btn-secondary'); this.classList.add('btn-primary', 'active'); // 更新选中的编码类型 selectedEncodingType = this.getAttribute('data-type'); // 自动处理当前输入(如果有内容) if (encodingInput.value.trim()) { // 保持当前操作(编码或解码) const lastOperation = localStorage.getItem('lastEncodingOperation') || 'encode'; if (lastOperation === 'encode') { document.getElementById('encode-btn').click(); } else { document.getElementById('decode-btn').click(); } } }); }); // 编码 document.getElementById('encode-btn').addEventListener('click', function() { if (!encodingInput.value.trim()) { alert('请输入需要编码的内容'); return; } try { let result = ''; switch(selectedEncodingType) { case 'base64': result = btoa(unescape(encodeURIComponent(encodingInput.value))); break; case 'url': result = encodeURIComponent(encodingInput.value); break; case 'html': result = htmlEncode(encodingInput.value); break; case 'unicode': result = unicodeEncode(encodingInput.value); break; } encodingOutput.value = result; // 记录最后操作类型 localStorage.setItem('lastEncodingOperation', 'encode'); } catch (e) { alert('编码失败: ' + e.message); } }); // 解码 document.getElementById('decode-btn').addEventListener('click', function() { if (!encodingInput.value.trim()) { alert('请输入需要解码的内容'); return; } try { let result = ''; switch(selectedEncodingType) { case 'base64': result = decodeURIComponent(escape(atob(encodingInput.value))); break; case 'url': result = decodeURIComponent(encodingInput.value); break; case 'html': result = htmlDecode(encodingInput.value); break; case 'unicode': result = unicodeDecode(encodingInput.value); break; } encodingOutput.value = result; // 记录最后操作类型 localStorage.setItem('lastEncodingOperation', 'decode'); } catch (e) { alert('解码失败: ' + e.message); } }); // 清空编码内容 document.getElementById('encoding-clear').addEventListener('click', function() { encodingInput.value = ''; encodingOutput.value = ''; }); // 复制编码结果 document.getElementById('encoding-copy').addEventListener('click', function() { navigator.clipboard.writeText(encodingOutput.value) .then(() => alert('已复制到剪贴板')) .catch(err => alert('复制失败: ' + err)); }); // HTML实体编码 function htmlEncode(str) { return str.replace(/[&"']/g, char => { const entities = { '&': '&', '': '>', '"': '"', "'": ''' }; return entities[char]; }); } // HTML实体解码 function htmlDecode(str) { const el = document.createElement('div'); el.innerHTML = str; return el.textContent; } // Unicode编码 function unicodeEncode(str) { return str.split('').map(char => '\\u' + char.charCodeAt(0).toString(16).padStart(4, '0')).join(''); } // Unicode解码 function unicodeDecode(str) { return str.replace(/\\u([0-9a-fA-F]{4})/g, (match, hex) => String.fromCharCode(parseInt(hex, 16))); } // 进制转换器功能 // 当前选中的进制 let selectedBase = 10; // 历史记录数组 let history = []; // DOM 元素 const inputValue = document.getElementById('inputValue'); const convertBtn = document.getElementById('convertBtn'); const baseBtns = document.querySelectorAll('.base-btn'); const binaryOutput = document.getElementById('binaryOutput'); const octalOutput = document.getElementById('octalOutput'); const decimalOutput = document.getElementById('decimalOutput'); const hexOutput = document.getElementById('hexOutput'); const historyList = document.getElementById('historyList'); const copyBtns = document.querySelectorAll('.copy-btn'); // 进制按钮点击事件 baseBtns.forEach(btn => { btn.addEventListener('click', () => { // 移除所有按钮的活动状态 baseBtns.forEach(b => b.classList.remove('bg-primary/10', 'border-primary', 'text-primary')); baseBtns.forEach(b => b.classList.add('border-gray-300', 'text-gray-700')); // 添加当前按钮的活动状态 btn.classList.remove('border-gray-300', 'text-gray-700'); btn.classList.add('bg-primary/10', 'border-primary', 'text-primary'); // 更新选中的进制 selectedBase = parseInt(btn.dataset.base); }); }); // 默认选中十进制 baseBtns[2].click(); // 转换按钮点击事件 convertBtn.addEventListener('click', convertNumber); // 输入框回车事件 inputValue.addEventListener('keypress', (e) => { if (e.key === 'Enter') { convertNumber(); } }); // 复制按钮点击事件 copyBtns.forEach(btn => { btn.addEventListener('click', () => { const targetId = btn.dataset.target; const targetElement = document.getElementById(targetId); // 复制到剪贴板 targetElement.select(); document.execCommand('copy'); // 显示复制成功提示 const originalText = btn.innerHTML; btn.innerHTML = ''; btn.classList.add('text-secondary'); setTimeout(() => { btn.innerHTML = originalText; btn.classList.remove('text-secondary'); }, 2000); }); }); // 转换数字函数 function convertNumber() { const input = inputValue.value.trim(); if (!input) { showToast('请输入要转换的数值', 'error'); return; } try { // 验证输入是否符合当前进制 if (!validateInput(input, selectedBase)) { showToast(`输入的数值不符合${getBaseName(selectedBase)}格式`, 'error'); return; } // 转换为十进制 const decimalValue = parseInt(input, selectedBase); // 转换为各种进制 binaryOutput.value = decimalValue.toString(2); octalOutput.value = decimalValue.toString(8); decimalOutput.value = decimalValue.toString(10); hexOutput.value = decimalValue.toString(16).toUpperCase(); // 添加到历史记录 addToHistory(input, selectedBase); // 显示成功提示 showToast('转换成功', 'success'); } catch (error) { showToast('转换失败,请检查输入', 'error'); console.error(error); } } // 验证输入是否符合进制格式 function validateInput(input, base) { const patterns = { 2: /^[01]+$/, 8: /^[0-7]+$/, 10: /^\d+$/, 16: /^[0-9A-Fa-f]+$/ }; return patterns[base].test(input); } // 获取进制名称 function getBaseName(base) { const names = { 2: '二进制', 8: '八进制', 10: '十进制', 16: '十六进制' }; return names[base]; } // 添加到历史记录 function addToHistory(input, base) { const timestamp = new Date().toLocaleString(); const historyItem = { input, base, timestamp }; // 添加到数组开头 history.unshift(historyItem); // 限制历史记录数量 if (history.length > 10) { history.pop(); } // 更新历史记录UI updateHistoryUI(); } // 更新历史记录UI function updateHistoryUI() { if (history.length === 0) { historyList.innerHTML = '暂无历史记录'; return; } historyList.innerHTML = ''; history.forEach((item, index) => { const historyEntry = document.createElement('div'); historyEntry.className = `py-3 ${index === history.length - 1 ? '' : 'pb-3'}`; historyEntry.innerHTML = ` ${item.input} (${getBaseName(item.base)}) ${item.timestamp} 恢复 `; historyList.appendChild(historyEntry); }); // 添加历史记录项点击事件 document.querySelectorAll('.history-item-btn').forEach(btn => { btn.addEventListener('click', () => { const index = parseInt(btn.dataset.index); const item = history[index]; inputValue.value = item.input; // 选中对应的进制按钮 baseBtns.forEach(b => { if (parseInt(b.dataset.base) === item.base) { b.click(); } }); // 触发转换 convertNumber(); }); }); } // 照片压缩工具功能 // 全局变量 let originalImageData = null; let compressedImageData = null; let isImageUploaded = false; // DOM 元素 const fileUpload = document.getElementById('file-upload'); const fileName = document.getElementById('file-name'); const resetUpload = document.getElementById('reset-upload'); const uploadContainer = document.getElementById('upload-container'); const compressionSettings = document.getElementById('compression-settings'); const previewSection = document.getElementById('preview-section'); const infoSection = document.getElementById('info-section'); const infoMessage = document.getElementById('info-message'); const qualitySlider = document.getElementById('quality'); const qualityValue = document.getElementById('quality-value'); const outputFormat = document.getElementById('output-format'); const compressBtn = document.getElementById('compress-btn'); const downloadBtn = document.getElementById('download-btn'); const originalImage = document.getElementById('original-image'); const compressedImage = document.getElementById('compressed-image'); const originalPlaceholder = document.getElementById('original-placeholder'); const compressedPlaceholder = document.getElementById('compressed-placeholder'); const originalDimensions = document.getElementById('original-dimensions'); const originalSize = document.getElementById('original-size'); const originalFormat = document.getElementById('original-format'); const compressedDimensions = document.getElementById('compressed-dimensions'); const compressedSize = document.getElementById('compressed-size'); const compressedFormat = document.getElementById('compressed-format'); const loadingOverlay = document.getElementById('loading-overlay'); // 事件监听器 fileUpload.addEventListener('change', handleFileUpload); resetUpload.addEventListener('click', resetUploadedFile); qualitySlider.addEventListener('input', updateQualityValue); compressBtn.addEventListener('click', compressImage); downloadBtn.addEventListener('click', downloadCompressedImage); // 显示质量值 function updateQualityValue() { qualityValue.textContent = qualitySlider.value; } // 处理文件上传 function handleFileUpload(e) { const file = e.target.files[0]; if (!file) return; // 检查是否是图片文件 if (!file.type.startsWith('image/')) { showToast('请上传有效的图片文件', 'error'); resetUploadedFile(); return; } // 防止重复上传相同文件 if (isImageUploaded) { showToast('已上传图片,请先压缩或重新选择', 'warning'); return; } // 读取文件并显示 const reader = new FileReader(); reader.onload = function(event) { const base64Data = event.target.result; // 创建图片对象获取尺寸信息 const img = new Image(); img.onload = function() { // 存储原始图片数据 originalImageData = { base64: base64Data, width: img.width, height: img.height, size: file.size, format: file.type.split('/')[1] }; // 更新UI updateOriginalImageUI(); fileName.textContent = file.name; fileName.classList.remove('hidden'); resetUpload.classList.remove('hidden'); compressionSettings.classList.remove('hidden'); previewSection.classList.remove('hidden'); uploadContainer.classList.remove('border-dashed', 'border-gray-200'); uploadContainer.classList.add('border-primary'); isImageUploaded = true; showToast('图片上传成功,请调整压缩设置并点击"开始压缩"', 'info'); }; img.src = base64Data; }; reader.readAsDataURL(file); } // 重置上传 function resetUploadedFile() { fileUpload.value = ''; fileName.classList.add('hidden'); resetUpload.classList.add('hidden'); uploadContainer.classList.add('border-dashed', 'border-gray-200'); uploadContainer.classList.remove('border-primary'); // 重置图片数据 originalImageData = null; compressedImageData = null; isImageUploaded = false; // 重置UI resetOriginalImageUI(); resetCompressedImageUI(); compressionSettings.classList.add('hidden'); previewSection.classList.add('hidden'); infoSection.classList.add('hidden'); downloadBtn.disabled = true; } // 更新原始图片UI function updateOriginalImageUI() { originalImage.src = originalImageData.base64; originalImage.classList.remove('hidden'); originalPlaceholder.classList.add('hidden'); originalDimensions.textContent = `${originalImageData.width} × ${originalImageData.height} 像素`; originalSize.textContent = formatFileSize(originalImageData.size); originalFormat.textContent = originalImageData.format.toUpperCase(); } // 重置原始图片UI function resetOriginalImageUI() { originalImage.src = ''; originalImage.classList.add('hidden'); originalPlaceholder.classList.remove('hidden'); originalDimensions.textContent = '--'; originalSize.textContent = '--'; originalFormat.textContent = '--'; } // 重置压缩图片UI function resetCompressedImageUI() { compressedImage.src = ''; compressedImage.classList.add('hidden'); compressedPlaceholder.classList.remove('hidden'); compressedDimensions.textContent = '--'; compressedSize.textContent = '--'; compressedFormat.textContent = '--'; } // 显示提示信息 function showToast(message, type = 'info') { infoMessage.textContent = message; infoSection.classList.remove('hidden'); // 设置不同类型的样式 infoSection.className = ''; if (type === 'info') { infoSection.classList.add('bg-blue-50', 'border-l-4', 'border-primary', 'p-4', 'rounded-r-lg', 'mb-10'); infoMessage.classList.add('text-blue-700'); infoMessage.classList.remove('text-yellow-700', 'text-red-700'); } else if (type === 'warning') { infoSection.classList.add('bg-yellow-50', 'border-l-4', 'border-yellow-400', 'p-4', 'rounded-r-lg', 'mb-10'); infoMessage.classList.add('text-yellow-700'); infoMessage.classList.remove('text-blue-700', 'text-red-700'); } else if (type === 'error') { infoSection.classList.add('bg-red-50', 'border-l-4', 'border-red-400', 'p-4', 'rounded-r-lg', 'mb-10'); infoMessage.classList.add('text-red-700'); infoMessage.classList.remove('text-blue-700', 'text-yellow-700'); } // 5秒后自动隐藏 setTimeout(() => { infoSection.classList.add('hidden'); }, 5000); } // 格式化文件大小 function formatFileSize(bytes) { if (bytes < 1024) return bytes + ' B'; else if (bytes < 1048576) return (bytes / 1024).toFixed(2) + ' KB'; else return (bytes / 1048576).toFixed(2) + ' MB'; } // 计算Base64数据大小 function getBase64FileSize(base64String) { // Base64编码的字符串大小计算: (长度 * 3) / 4 - 填充字符数 const padding = (base64String.endsWith('==') ? 2 : base64String.endsWith('=') ? 1 : 0); const fileSizeInBytes = (base64String.length * 3 / 4) - padding; return Math.round(fileSizeInBytes); } // 压缩图片 function compressImage() { if (!originalImageData) return; showLoading(true); resetCompressedImageUI(); // 使用setTimeout避免UI阻塞 setTimeout(() => { try { const img = new Image(); img.onload = function() { // 创建canvas元素 const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); // 设置初始尺寸为原图尺寸 let width = img.width; let height = img.height; // 获取用户设置 const quality = qualitySlider.value / 100; const format = outputFormat.value; // 首次压缩尝试 canvas.width = width; canvas.height = height; ctx.drawImage(img, 0, 0, width, height); // 根据格式获取Base64数据 let base64Data; if (format === 'jpeg') { base64Data = canvas.toDataURL('image/jpeg', quality); } else if (format === 'webp') { base64Data = canvas.toDataURL('image/webp', quality); } else { // png // PNG格式不支持quality参数,我们需要通过其他方式压缩 base64Data = canvas.toDataURL('image/png'); } // 计算压缩后大小 let compressedSize = getBase64FileSize(base64Data.split(',')[1]); // 强制确保压缩后大小小于原图大小 let iterations = 0; const maxIterations = 20; // 防止无限循环 // 如果压缩后的大小仍然大于原图,继续压缩 while (compressedSize >= originalImageData.size && iterations < maxIterations) { iterations++; // 每次迭代减小10%的尺寸 width = Math.round(width * 0.9); height = Math.round(height * 0.9); // 确保尺寸不会过小 if (width < 10 || height < 10) break; // 重新绘制并压缩 canvas.width = width; canvas.height = height; ctx.drawImage(img, 0, 0, width, height); if (format === 'jpeg') { base64Data = canvas.toDataURL('image/jpeg', Math.max(0.1, quality - (iterations * 0.1))); } else if (format === 'webp') { base64Data = canvas.toDataURL('image/webp', Math.max(0.1, quality - (iterations * 0.1))); } else { // png // 对于PNG,我们通过减小尺寸来压缩 base64Data = canvas.toDataURL('image/png'); } compressedSize = getBase64FileSize(base64Data.split(',')[1]); } // 存储压缩后的图片数据 compressedImageData = { base64: base64Data, width: width, height: height, size: compressedSize, format: format }; // 更新UI updateCompressedImageUI(); downloadBtn.disabled = false; // 计算压缩率 const rate = ((1 - compressedSize / originalImageData.size) * 100).toFixed(1); showToast(`图片压缩成功,压缩率: ${rate}%`, 'info'); showLoading(false); }; img.src = originalImageData.base64; } catch (error) { showInfo(`压缩失败: ${error.message}`, 'error'); showLoading(false); } }, 100); } // 更新压缩图片UI function updateCompressedImageUI() { if (!compressedImageData) return; compressedImage.src = compressedImageData.base64; compressedImage.classList.remove('hidden'); compressedPlaceholder.classList.add('hidden'); compressedDimensions.textContent = `${compressedImageData.width} × ${compressedImageData.height} 像素`; compressedSize.textContent = formatFileSize(compressedImageData.size); compressedFormat.textContent = compressedImageData.format.toUpperCase(); } // 下载压缩后的图片 function downloadCompressedImage() { if (!compressedImageData) return; const link = document.createElement('a'); link.href = compressedImageData.base64; // 生成文件名 const originalName = fileName.textContent.split('.').slice(0, -1).join('.'); link.download = `${originalName}_compressed.${compressedImageData.format}`; document.body.appendChild(link); link.click(); document.body.removeChild(link); showToast('图片已下载', 'info'); } // 显示/隐藏加载动画 function showLoading(show) { if (show) { loadingOverlay.classList.remove('hidden'); } else { loadingOverlay.classList.add('hidden'); } } // 初始化版权信息 window.addEventListener('DOMContentLoaded', function() { const year = new Date().getFullYear(); document.getElementById('copyright').textContent = `© ${year} 实用工具集 - 保留所有权利`; document.getElementById('copyright-protected').textContent = "在线实用工具集 - 提供便捷的日常工具服务"; });
2025年09月15日
11 阅读
0 评论
1 点赞
2025-09-15
重张系统之后个人常用软件。
用了7.8年的windows10 LTSC系统昨天重装了。因为BUG问题。没有彻底解决问题。无奈重装。重装之后发现一个问题就是自己常用软件没了。通过快捷方式启动有些是有问题的这个懂的都懂。不如直接覆盖安装。然后想到偶尔会帮朋友也装一下常用软件。故此记录一下。123云盘汇总: 123云盘下载 云盘收录下面所有版本。但非即使更新。可能版本会有落后。所有版本均为优先X86 64位版本。杀毒: 火绒 个人感觉足够用了。压缩: Banzip破解版或者7zip 办公: WPS Office 10.1.0.7224 纯净版(无联网) WPS Office 10.1.0.7224 纯净版(无联网)这个版本很纯净 无联网。基本功能够用。PDF查看器:SumatraPDF 不喜欢浏览器查看PDF。此款软件小巧好用。本地播放器: Potplayer 个人更喜欢MPV但这个适用性比较强。输入法: 小狼毫输入法 仁者见仁智者见智。看个人爱好。文本查看器: Notepad-- 基本够用,需求较高考虑微软VisualStudio
2025年09月15日
12 阅读
0 评论
0 点赞
1
2
...
18