1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- /**
- * 图标转换工具
- * 提供ICO格式图标转换的相关功能
- */
- /**
- * 获取在线图标转换工具列表
- * @returns {Array} 在线转换工具列表
- */
- export function getOnlineConverters() {
- return [
- {
- name: 'Favicon Generator',
- url: 'https://www.favicon-generator.org/',
- description: '功能全面的图标转换工具,支持多种尺寸和格式'
- },
- {
- name: 'Convertio',
- url: 'https://convertio.co/zh/png-ico/',
- description: '简单易用的PNG转ICO工具,支持多种格式互转'
- },
- {
- name: 'ICO Convert',
- url: 'https://icoconvert.com/',
- description: '专业的ICO转换工具,支持多尺寸图标打包'
- },
- {
- name: 'RealFaviconGenerator',
- url: 'https://realfavicongenerator.net/',
- description: '针对各种设备和平台优化的图标生成工具'
- }
- ];
- }
- /**
- * 打开在线ICO转换工具
- * @param {String} url - 在线工具URL
- */
- export function openConverter(url) {
- // #ifdef H5
- window.open(url, '_blank');
- // #endif
-
- // #ifndef H5
- // 复制URL到剪贴板
- uni.setClipboardData({
- data: url,
- success: function() {
- uni.showToast({
- title: '链接已复制到剪贴板',
- icon: 'none'
- });
- }
- });
- // #endif
- }
- /**
- * 获取图标尺寸建议
- * @returns {Array} 图标尺寸建议列表
- */
- export function getIconSizeTips() {
- return [
- {
- size: '16x16',
- usage: '浏览器标签图标、收藏夹图标'
- },
- {
- size: '32x32',
- usage: '标准Windows图标、文件资源管理器'
- },
- {
- size: '48x48',
- usage: 'Windows桌面图标、应用商店图标'
- },
- {
- size: '64x64',
- usage: '高DPI设备的图标'
- },
- {
- size: '128x128',
- usage: 'Mac OS应用图标、高分辨率设备'
- },
- {
- size: '256x256',
- usage: '现代操作系统大图标、应用商店图标'
- }
- ];
- }
- export default {
- getOnlineConverters,
- openConverter,
- getIconSizeTips
- }
|