AI资讯

2025 最新 Svgwave 工具解析:实时生成可定制 SVG 波浪动画助力网页背景设计

2025-07-17
1363次阅读
2025 最新 Svgwave 工具解析:实时生成可定制 SVG 波浪动画助力网页背景设计

? 2025 最新 Svgwave 工具解析:实时生成可定制 SVG 波浪动画助力网页背景设计


在如今的网页设计领域,动态背景已经成为提升用户体验和视觉吸引力的关键元素。2025 年,Svgwave 工具凭借其强大的功能和便捷的操作,成为了设计师和开发者们的新宠。这款工具能够实时生成可定制的 SVG 波浪动画,为网页背景设计带来了无限可能。

? 核心功能与技术特性


Svgwave 是一个开源项目,基于 Preact、Tailwind CSS 和 Webpack 构建,具有轻量级、高性能的特点。它允许用户通过简单的界面自定义和调整波浪样式,以满足不同的主题需求。用户可以调整波浪层数、波峰和波谷数量、颜色等属性,还能实时预览效果,所见即所得。

此外,Svgwave 支持导出为 SVG 或 PNG 格式,方便用户将生成的波浪应用到网站或 UI 设计中。生成的 SVG 代码可以直接嵌入 HTML,无需额外处理,减少了前端工程师的工作量。同时,Svgwave 还支持 JSON 格式输入,允许用户保存和加载他们的波形设置,这为协作和重复使用设计提供了便利。

? 应用场景与优势


Svgwave 的应用场景非常广泛。在网页设计中,它可以用于制作吸引眼球的动态 SVG 背景,提升网站的整体视觉效果。例如,登录框背景、产品官网动态波浪分隔符等。在移动端开发中,它可以为 App 生成加载页波浪过渡效果。在广告或营销领域,它可以结合品牌主色调生成专属波浪背景,用于活动页面、社交媒体 Banner 图等。

与其他 SVG 工具相比,Svgwave 具有明显的优势。它的参数化波形设计非常灵活,支持调整波浪层数、波峰数量、振幅高度及波形复杂度等。视觉风格定制方面,它提供了线性 / 径向渐变模式,支持多色节点及透明度调节。输出与兼容性也很强,一键生成 SVG、PNG 及 CSS 代码,适配不同开发场景。

?️ 使用教程与最佳实践


使用 Svgwave 非常简单。用户只需访问 Svgwave 的官方网站,即可开始创建自己的波浪动画。在界面中,用户可以通过滑动条实时调节波浪间距、偏移量等参数,还能开启 “波浪翻转” 功能和 “渐变动画” 选项。如果不确定怎么做比较好看,点击 “随机化” 按钮即可立即产生某个样式。

在使用过程中,有一些最佳实践需要注意。例如,复杂波形(>5 层)建议使用 定义重复路径,减少 DOM 节点数量。动画效果建议通过 CSS @keyframes 实现,避免直接操作 DOM 属性。响应式设计中,通过媒体查询调整波形振幅(如移动端缩小 30%)。

? SEO 优化与性能提升


Svgwave 生成的 SVG 文件在 SEO 方面具有天然的优势。SVG 是基于 XML 语法的矢量图形,图形的里面的文本内容可以直接被浏览器、搜索引擎和无障碍读屏软件读取。此外,SVG 文件大小通常比位图小,加载速度更快,这有助于提升网页的性能和用户体验。

为了进一步优化 SEO 和性能,用户可以采取一些措施。例如,在 SVG 文件中添加 和 <desc> 标签,满足 WCAG 2.1 无障碍标准。启用 will-change: transform 属性,提升动画帧率。提供 “懒加载” 选项,通过 Intersection Observer API 实现波形在视口内按需渲染。</div><br> <h3>? 与其他工具的对比分析</h3><br> <div>与其他 SVG 波浪生成工具相比,Svgwave 具有明显的优势。例如,与 Get Waves 相比,Svgwave 提供了更多的自定义选项和实时预览功能。与 Haikei 相比,Svgwave 更专注于波浪动画的生成,操作更加简单便捷。与 SVG Artista 相比,Svgwave 不需要编写 CSS 代码,降低了使用门槛。</div><br> <div>当然,其他工具也有各自的特点。例如,Boxy SVG 是一个功能强大的矢量图形编辑器,适合专业设计师使用。Blobmaker.app 则擅长生成有机外观的 SVG 形状。用户可以根据自己的需求选择适合的工具。</div><br> <h3>?? 开发集成与生态项目</h3><br> <div>Svgwave 可以与其他前端框架如 React、Vue 等进行集成,创建组件化复用。例如,可以封装成 React 或 Vue 的自定义组件,便于在这些现代框架中重用波浪效果,提升开发效率。此外,Svgwave 还支持与 Figma、Sketch 等设计工具插件集成,实现设计 - 开发流程闭环。</div><br> <div>在技术生态方面,Svgwave 与 Preact、Tailwind CSS 和 Webpack 等项目密切合作。Preact 是一个轻量级的 React 替代方案,用于构建高性能的 UI 组件。Tailwind CSS 是一个实用优先的 CSS 框架,用于快速构建自定义 UI。Webpack 是一个模块打包器,用于打包和优化前端资源。通过结合这些生态项目,Svgwave 能够提供高效、灵活且美观的波浪生成功能,满足各种设计需求。</div><br> <h3>? 性能优化与常见问题解决方案</h3><br> <div>在使用 Svgwave 时,可能会遇到一些性能问题。例如,在资源受限的环境(如某些移动设备)中,复杂的波浪动画可能会导致卡顿。为了解决这个问题,用户可以尝试减少 SVG 元素数量或将它们合并成更少的对象,减少 SVG 的路径长度,或使用 translate 代替 top 或 left 属性。</div><br> <div>此外,用户还可以通过调整波浪参数来优化性能。例如,减少波浪层数、降低波峰和波谷的数量、简化波形复杂度等。在移动端,建议适当缩小波形振幅,以提高动画帧率。</div><br> <h3>? 未来发展趋势与展望</h3><br> <div>随着网页设计的不断发展,动态背景和 SVG 技术的应用将会越来越广泛。Svgwave 作为一款优秀的 SVG 波浪生成工具,未来有望在功能和性能上进一步提升。例如,增加更多的自定义选项、优化动画效果、提升移动端兼容性等。</div><br> <div>同时,Svgwave 还可以与其他技术如 WebGL、Three.js 等结合,实现更加复杂的 3D 动态效果。此外,随着人工智能技术的发展,Svgwave 可能会引入机器学习算法,自动生成符合用户需求的波浪动画,进一步提高设计效率。</div><br> <div>总之,Svgwave 是一款非常实用的 SVG 波浪生成工具,它为网页背景设计带来了无限可能。无论是设计师还是开发者,都可以通过 Svgwave 轻松创建出独特、美观的动态波浪效果,提升网站的视觉吸引力和用户体验。该文章由dudu123.com嘟嘟 ai 导航整理,嘟嘟 AI 导航汇集全网优质网址资源和最新优质 AI 工具。</div><br> </div> </div> <!-- 标签和分享 --> <div class="flex flex-col md:flex-row justify-between items-start md:items-center pt-8 mt-8 border-t border-gray-200 dark:border-gray-700"> <div class="mb-4 md:mb-0"> <span class="text-gray-700 dark:text-gray-300 mr-2">标签:</span> <span class="news-tag bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-3 py-1 rounded-full text-sm">AI资讯</span> </div> <div class="flex space-x-3"> <span class="text-gray-700 dark:text-gray-300">分享:</span> <a href="javascript:void(0)" onclick="shareToWeChat()" class="social-share w-10 h-10 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center text-blue-600 dark:text-blue-400"> <i class="fa-brands fa-weixin"></i> </a> <a href="javascript:void(0)" onclick="shareToWeibo('2025 最新 Svgwave 工具解析:实时生成可定制 SVG 波浪动画助力网页背景设计', window.location.href)" class="social-share w-10 h-10 rounded-full bg-gray-100 dark:bg-gray-700 flex items-center justify-center text-gray-600 dark:text-gray-400"> <i class="fa-brands fa-weibo"></i> </a> <a href="javascript:void(0)" onclick="shareToTwitter('2025 最新 Svgwave 工具解析:实时生成可定制 SVG 波浪动画助力网页背景设计', window.location.href)" class="social-share w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white"> <i class="fa-brands fa-twitter"></i> </a> <a href="javascript:void(0)" onclick="copyLink()" class="social-share w-10 h-10 rounded-full bg-green-100 dark:bg-green-900 flex items-center justify-center text-green-600 dark:text-green-400"> <i class="fa-solid fa-link"></i> </a> </div> </div> </div> <!-- 上一篇/下一篇 --> <div class="flex flex-col md:flex-row justify-between gap-6 mb-8"> <a href="/ai/2U5DgEmxbHnspQQe58X4yWobaquLW59bQ2HpWpG5GdO.html" class="card group flex-1 bg-white dark:bg-gray-800 rounded-xl shadow-card dark:shadow-card-dark p-5"> <div class="flex items-center"> <i class="fa-solid fa-arrow-left text-gray-500 dark:text-gray-400 mr-3 group-hover:text-blue-600 dark:group-hover:text-blue-400"></i> <div> <p class="text-gray-500 dark:text-gray-400 text-sm mb-1">上一篇</p> <h3 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 line-clamp-2">如何用 FreeEssayWriter.AI 节省论文写作时间?免费使用 + 防抄袭检测全攻略</h3> </div> </div> </a> <a href="/ai/eOz8NieDLVP2UQYpJKWa4PVbbPP5YCLeS2goiHSE9AY.html" class="card group flex-1 bg-white dark:bg-gray-800 rounded-xl shadow-card dark:shadow-card-dark p-5"> <div class="flex items-center text-right flex-row-reverse"> <i class="fa-solid fa-arrow-right text-gray-500 dark:text-gray-400 ml-3 group-hover:text-blue-600 dark:group-hover:text-blue-400"></i> <div> <p class="text-gray-500 dark:text-gray-400 text-sm mb-1">下一篇</p> <h3 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 line-clamp-2">学生党必备 FreeEssayWriter.AI:免费生成论文,内置防抄袭检测,输入主题快速出稿</h3> </div> </div> </a> </div> <!-- 评论区 --> <div class="bg-white dark:bg-gray-800 rounded-xl shadow-card dark:shadow-card-dark p-6"> <div class="flex justify-between items-center mb-6"> <h3 class="text-2xl font-bold text-gray-800 dark:text-white">用户评论 (0)</h3> <button class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition flex items-center"> <i class="fa-solid fa-pen mr-2"></i> 发表评论 </button> </div> <div class="space-y-6"> <!-- 暂无评论 --> <div class="text-center py-8"> <i class="fa-regular fa-comments text-5xl text-gray-300 dark:text-gray-600 mb-4"></i> <p class="text-gray-500 dark:text-gray-400">暂无评论,快来发表第一条评论吧!</p> </div> </div> </div> </div> <!-- 右侧边栏 --> <div class="w-full lg:w-1/4"> <!-- 网站信息 --> <div class="bg-white dark:bg-gray-800 rounded-xl shadow-card dark:shadow-card-dark p-6 mb-8"> <div class="flex items-center mb-4"> <div class="w-12 h-12 rounded-lg bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center mr-4"> <i class="fa-solid fa-robot text-white text-xl"></i> </div> <div> <h3 class="font-bold text-gray-800 dark:text-white">AI导航</h3> <p class="text-gray-600 dark:text-gray-400 text-sm">AI资源与工具导航</p> </div> </div> <p class="text-gray-700 dark:text-gray-300 text-sm"> 汇聚全球最优质的人工智能工具与资源,助力您的创新之旅。关注前沿AI技术发展与实际应用案例。 </p> <div class="flex space-x-3 mt-4"> <a href="javascript:void(0)" onclick="shareToTwitter('2025 最新 Svgwave 工具解析:实时生成可定制 SVG 波浪动画助力网页背景设计', window.location.href)" class="text-gray-500 hover:text-blue-600 dark:hover:text-blue-400"> <i class="fa-brands fa-twitter"></i> </a> <a href="javascript:void(0)" onclick="shareToWeChat()" class="text-gray-500 hover:text-blue-600 dark:hover:text-blue-400"> <i class="fa-brands fa-weixin"></i> </a> <a href="javascript:void(0)" onclick="shareToWeibo('2025 最新 Svgwave 工具解析:实时生成可定制 SVG 波浪动画助力网页背景设计', window.location.href)" class="text-gray-500 hover:text-blue-600 dark:hover:text-blue-400"> <i class="fa-brands fa-weibo"></i> </a> </div> </div> <!-- 热门资讯排行榜 --> <div class="bg-white dark:bg-gray-800 rounded-xl shadow-card dark:shadow-card-dark p-6 mb-8"> <h3 class="text-xl font-bold text-gray-800 dark:text-white mb-4 pb-2 border-b border-gray-200 dark:border-gray-700">热门资讯榜</h3> <div class="space-y-4"> <!-- 排行项目 1 --> <a href="/ai/ScpZGH33FFnzZOu5AB93mcDOpC1ifLW70xrIeUAoOU0.html" class="flex items-center group"> <div class="w-8 h-8 rounded-lg bg-gradient-to-br from-yellow-500 to-orange-500 flex items-center justify-center text-white font-bold mr-3 group-hover:scale-110 transition"> 1 </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 2025 茅茅虫 AI 写作升级 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm flex items-center mt-1"> <i class="fa-solid fa-eye mr-1"></i> 444次阅读 </p> </div> </a> <!-- 排行项目 2 --> <a href="/ai/M1lq4QB2rgmLx7XJijrCmYrQPJmXdq0Ldp2CSLIFlAQ.html" class="flex items-center group"> <div class="w-8 h-8 rounded-lg bg-gradient-to-br from-gray-400 to-gray-500 flex items-center justify-center text-white font-bold mr-3 group-hover:scale-110 transition"> 2 </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> Kagi Search 多引擎聚 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm flex items-center mt-1"> <i class="fa-solid fa-eye mr-1"></i> 415次阅读 </p> </div> </a> <!-- 排行项目 3 --> <a href="/ai/uU3M3LpdGi0bSrC4BL4bSujf292AjVLbQJ7WOCDG9ug.html" class="flex items-center group"> <div class="w-8 h-8 rounded-lg bg-gradient-to-br from-amber-700 to-amber-800 flex items-center justify-center text-white font-bold mr-3 group-hover:scale-110 transition"> 3 </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> TextFlip AI 与传统检 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm flex items-center mt-1"> <i class="fa-solid fa-eye mr-1"></i> 402次阅读 </p> </div> </a> <!-- 排行项目 4 --> <a href="/ai/2FSZBakvxU4MK2L5VFeIquNhIdsIrKOOSA7mlUzoHNu.html" class="flex items-center group"> <div class="w-8 h-8 rounded-lg bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-white font-bold mr-3 group-hover:scale-110 transition"> 4 </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 达摩院・寻光 AI 视频创作:多 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm flex items-center mt-1"> <i class="fa-solid fa-eye mr-1"></i> 150次阅读 </p> </div> </a> <!-- 排行项目 5 --> <a href="/ai/ozSadIY4Cvq6OGMYGCVxHSdGJ2fMRU68NFRr19rcYXK.html" class="flex items-center group"> <div class="w-8 h-8 rounded-lg bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-white font-bold mr-3 group-hover:scale-110 transition"> 5 </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 有道灵动翻译大模型升级!网页翻译 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm flex items-center mt-1"> <i class="fa-solid fa-eye mr-1"></i> 648次阅读 </p> </div> </a> <!-- 排行项目 6 --> <a href="/ai/MjRwYAMegS71vRghJA6Rep1R2NZXt08nc0UAXbT1q4M.html" class="flex items-center group"> <div class="w-8 h-8 rounded-lg bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-white font-bold mr-3 group-hover:scale-110 transition"> 6 </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 完美游戏论坛攻略中心:2025 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm flex items-center mt-1"> <i class="fa-solid fa-eye mr-1"></i> 582次阅读 </p> </div> </a> <!-- 排行项目 7 --> <a href="/ai/tzk4c91xcDlzq7zXjPlD9MrsXPOKBWZNNFcf6Qe5SCk.html" class="flex items-center group"> <div class="w-8 h-8 rounded-lg bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-white font-bold mr-3 group-hover:scale-110 transition"> 7 </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 中国网络社会组织联合会功能解析: </h4> <p class="text-gray-600 dark:text-gray-400 text-sm flex items-center mt-1"> <i class="fa-solid fa-eye mr-1"></i> 543次阅读 </p> </div> </a> <!-- 查看全部按钮 --> <!-- <div class="pt-4"> <a href="news.php" class="text-blue-600 dark:text-blue-400 hover:underline text-sm flex items-center"> 查看全部热门资讯 <i class="fa-solid fa-arrow-right ml-2 text-xs"></i> </a> </div> --> </div> </div> <!-- 推荐资讯 --> <div class="bg-white dark:bg-gray-800 rounded-xl shadow-card dark:shadow-card-dark p-6"> <h3 class="text-xl font-bold text-gray-800 dark:text-white mb-4 pb-2 border-b border-gray-200 dark:border-gray-700">推荐阅读</h3> <div class="space-y-5"> <!-- 推荐项目 --> <a href="/ai/HCPjacLwlItn0HF20vCTJIISr4cLV3PATLdS6wLdpsA.html" class="group flex items-start"> <div class="w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 mr-4"> <img src="https://cdn.yyp.net/wp-content/uploads/2025/07/50c7b316121f86436bfd1585e0d2bb60.jpg" alt="麻辣社区智能检测纠错功能:2025 新版优化用户体验升级" class="w-full h-full object-cover group-hover:scale-105 transition"> </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 麻辣社区智能检测纠错功能:20 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm mt-1"> <i class="fa-solid fa-calendar-days mr-1"></i> 2025-07-18 </p> </div> </a> <!-- 推荐项目 --> <a href="/ai/dkyYdVReYb0she2u3ywyzGwhjYoI1F7cU5rFUkJKbQQ.html" class="group flex items-start"> <div class="w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 mr-4"> <img src="https://cdn.yyp.net/wp-content/uploads/2025/06/5d3cf80467b9ed423d43f2829cd0a73d.jpg" alt="emojiu.cc 如何免费生成个性化表情符号?适用于社交媒体的表情下载攻略" class="w-full h-full object-cover group-hover:scale-105 transition"> </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> emojiu.cc 如何免费生 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm mt-1"> <i class="fa-solid fa-calendar-days mr-1"></i> 2025-07-18 </p> </div> </a> <!-- 推荐项目 --> <a href="/ai/LHKaMXuAZz0XRmCqcVD5VTFRbNigPHlNVgUtriGpJIA.html" class="group flex items-start"> <div class="w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 mr-4"> <img src="https://cdn.yyp.net/wp-content/uploads/2025/06/e1774a832411dfb8ebae8cff08348efe.jpg" alt="积加 ERP vs 传统工具对比:智能补货与库存实时监控如何优化供应链?" class="w-full h-full object-cover group-hover:scale-105 transition"> </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 积加 ERP vs 传统工具对 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm mt-1"> <i class="fa-solid fa-calendar-days mr-1"></i> 2025-07-18 </p> </div> </a> <!-- 推荐项目 --> <a href="/ai/3SzS8j4st8FWx2HKgWLKDCwmX9EduqCftlqZaTErkCc.html" class="group flex items-start"> <div class="w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 mr-4"> <img src="https://cdn.yyp.net/wp-content/uploads/2025/07/b78b9af9209d1ec086c70112965bf1dc.jpg" alt="自动生成字幕准确吗?实测这款工具支持 100 + 语言,精准度超高!" class="w-full h-full object-cover group-hover:scale-105 transition"> </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> 自动生成字幕准确吗?实测这款工 </h4> <p class="text-gray-600 dark:text-gray-400 text-sm mt-1"> <i class="fa-solid fa-calendar-days mr-1"></i> 2025-07-18 </p> </div> </a> <!-- 推荐项目 --> <a href="/ai/kDMDRWTAMk9KI8UTotByPAMiYUlXK3CYApm7Mmx5Rsk.html" class="group flex items-start"> <div class="w-16 h-16 rounded-lg overflow-hidden flex-shrink-0 mr-4"> <img src="https://cdn.yyp.net/wp-content/uploads/2025/07/5c28a1f5d8b499e226610f582f8993af.jpg" alt="iO Paint 功能全解析:融合 LaMa 模型的专业级图像处理体验" class="w-full h-full object-cover group-hover:scale-105 transition"> </div> <div> <h4 class="font-semibold text-gray-800 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition line-clamp-2"> iO Paint 功能全解析: </h4> <p class="text-gray-600 dark:text-gray-400 text-sm mt-1"> <i class="fa-solid fa-calendar-days mr-1"></i> 2025-07-18 </p> </div> </a> </div> </div> </div> </div> </main> <!-- 页脚 --> <footer class="bg-gray-100 dark:bg-gray-900 border-t border-gray-200 dark:border-gray-800 mt-16 py-12"> <div class="container mx-auto px-4"> <div class="grid grid-cols-1 md:grid-cols-4 gap-8"> <div> <div class="flex items-center mb-4"> <div class="w-10 h-10 rounded-lg bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center"> <i class="fa-solid fa-robot text-white text-xl"></i> </div> <span class="text-xl font-bold text-gray-800 dark:text-white ml-2">AI导航</span> </div> <p class="text-gray-600 dark:text-gray-400 text-sm"> 汇聚全球最优质的人工智能工具与资源,助力您的创新之旅。 </p> </div> <div> <h3 class="text-lg font-semibold mb-4 text-gray-800 dark:text-white">快速链接</h3> <ul class="space-y-2"> <li><a href="/" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">首页</a></li> <li><a href="/hotsites/" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">热门工具</a></li> <li><a href="/newsites/" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">最新资源</a></li> <li><a href="/ai/" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">Ai资讯</a></li> </ul> </div> <div> <h3 class="text-lg font-semibold mb-4 text-gray-800 dark:text-white">热门分类</h3> <ul class="space-y-2"> <li><a href="#" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">对话AI</a></li> <li><a href="#" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">图像生成</a></li> <li><a href="#" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">编程开发</a></li> <li><a href="#" class="text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition">视频处理</a></li> </ul> </div> <div> <h3 class="text-lg font-semibold mb-4 text-gray-800 dark:text-white">订阅更新</h3> <p class="text-gray-600 dark:text-gray-400 text-sm mb-4"> 获取最新AI工具和资源推荐 </p> <div class="flex"> <input type="email" placeholder="您的邮箱地址" class="flex-1 px-4 py-2 rounded-l-lg border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500" > <button class="bg-blue-600 text-white px-4 py-2 rounded-r-lg hover:bg-blue-700 transition"> <i class="fa-solid fa-paper-plane"></i> </button> </div> </div> </div> <div class="border-t border-gray-200 dark:border-gray-800 mt-10 pt-6 flex flex-col md:flex-row justify-between items-center"> <p class="text-gray-500 dark:text-gray-500 text-sm"> © 2023 AI导航. 保留所有权利。 </p> <p class="text-gray-500 dark:text-gray-500 text-sm"> <a href="http://beian.miit.gov.cn/" rel="nofollow">ICP备案:豫B2-20110008-14</a> </p> <div class="flex space-x-4 mt-4 md:mt-0"> <a href="javascript:void(0)" onclick="shareToWeChat()" class="text-gray-500 dark:text-gray-500 hover:text-blue-600 dark:hover:text-blue-400 transitio"> <i class="fa-brands fa-weixin"></i> </a> <a href="javascript:void(0)" onclick="shareToWeibo('AI导航', window.location.href)" class="text-gray-500 dark:text-gray-500 hover:text-blue-600 dark:hover:text-blue-400 transitio"> <i class="fa-brands fa-weibo"></i> </a> <a href="javascript:void(0)" onclick="shareToTwitter('AI导航', window.location.href)" class="text-gray-500 dark:text-gray-500 hover:text-blue-600 dark:hover:text-blue-400 transition"> <i class="fa-brands fa-twitter"></i> </a> </div> </div> </div> </footer> <script src="/staticai/qrcode.min.js"></script> <script> // 分享功能 function shareToWeChat() { // 获取当前页面URL const url = window.location.href; // 创建二维码容器 const qrModal = document.createElement('div'); qrModal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50'; const qrContainer = document.createElement('div'); qrContainer.className = 'bg-white dark:bg-gray-800 p-6 rounded-xl shadow-lg max-w-sm w-full relative'; // 创建标题 const title = document.createElement('h3'); title.className = 'text-xl font-bold text-gray-800 dark:text-white mb-4 text-center'; title.textContent = '微信扫码分享'; // 创建关闭按钮 const closeBtn = document.createElement('button'); closeBtn.className = 'absolute top-4 right-4 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200'; closeBtn.innerHTML = '<i class="fa-solid fa-times"></i>'; closeBtn.onclick = () => document.body.removeChild(qrModal); // 创建QR码容器 const qrBox = document.createElement('div'); qrBox.className = 'flex justify-center items-center mb-4'; // 提示文字 const hint = document.createElement('p'); hint.className = 'text-center text-gray-600 dark:text-gray-400 text-sm'; hint.textContent = '请使用微信"扫一扫"扫描上方二维码'; // 组装DOM qrContainer.appendChild(title); qrContainer.appendChild(qrBox); qrContainer.appendChild(hint); qrContainer.appendChild(closeBtn); qrModal.appendChild(qrContainer); document.body.appendChild(qrModal); // 检查QRCode库是否已加载 if (typeof QRCode === 'function') { // 使用QRCode.js生成二维码 try { new QRCode(qrBox, { text: url, width: 200, height: 200, colorDark: "#000000", colorLight: "#ffffff", correctLevel: QRCode.CorrectLevel.H }); } catch (e) { // 如果生成二维码失败,回退到使用图片形式 qrBox.innerHTML = `<img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(url)}" width="200" height="200" alt="二维码">`; } } else { // 如果QRCode库未加载,使用外部API生成二维码图片 qrBox.innerHTML = `<img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(url)}" width="200" height="200" alt="二维码">`; } // 点击模态框背景关闭 qrModal.addEventListener('click', function(e) { if (e.target === qrModal) { document.body.removeChild(qrModal); } }); } function shareToWeibo(title, url) { const weiboUrl = `http://service.weibo.com/share/share.php?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`; window.open(weiboUrl, '_blank', 'width=700,height=500'); } function shareToTwitter(title, url) { const twitterUrl = `https://twitter.com/intent/tweet?text=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}`; window.open(twitterUrl, '_blank', 'width=700,height=500'); } // 深色模式切换 const themeToggle = document.getElementById('theme-toggle'); const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)'); // 初始化主题 if (localStorage.getItem('theme') === 'dark' || (!localStorage.getItem('theme') && prefersDarkScheme.matches)) { document.documentElement.classList.add('dark'); } else { document.documentElement.classList.remove('dark'); } themeToggle.addEventListener('click', () => { if (document.documentElement.classList.contains('dark')) { document.documentElement.classList.remove('dark'); localStorage.setItem('theme', 'light'); } else { document.documentElement.classList.add('dark'); localStorage.setItem('theme', 'dark'); } }); // 移动端菜单切换 const mobileMenuButton = document.getElementById('mobile-menu-button'); const mobileNav = document.getElementById('mobile-nav'); mobileMenuButton.addEventListener('click', () => { mobileNav.classList.toggle('open'); }); // 处理系统主题变化 prefersDarkScheme.addEventListener('change', e => { if (!localStorage.getItem('theme')) { if (e.matches) { document.documentElement.classList.add('dark'); } else { document.documentElement.classList.remove('dark'); } } }); </script> </body> </html> <script> function copyLink() { const url = window.location.href; // 使用现代API复制到剪贴板 if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(url) .then(() => { showNotification('链接已复制到剪贴板'); }) .catch(err => { console.error('无法复制链接: ', err); fallbackCopyLink(url); }); } else { fallbackCopyLink(url); } } function fallbackCopyLink(text) { // 创建临时输入框 const input = document.createElement('input'); input.style.position = 'fixed'; input.style.opacity = 0; input.value = text; document.body.appendChild(input); input.select(); // 尝试复制 try { const successful = document.execCommand('copy'); if (successful) { showNotification('链接已复制到剪贴板'); } else { showNotification('复制失败,请手动复制链接', 'error'); } } catch (err) { console.error('无法复制链接: ', err); showNotification('复制失败,请手动复制链接', 'error'); } // 移除临时元素 document.body.removeChild(input); } function showNotification(message, type = 'success') { // 创建通知元素 const notification = document.createElement('div'); notification.className = `fixed bottom-4 right-4 px-6 py-3 rounded-lg shadow-lg text-white ${type === 'success' ? 'bg-green-500' : 'bg-red-500'} transition-all duration-300 transform translate-y-full opacity-0`; notification.textContent = message; document.body.appendChild(notification); // 显示通知 setTimeout(() => { notification.style.transform = 'translateY(0)'; notification.style.opacity = '1'; }, 10); // 3秒后隐藏通知 setTimeout(() => { notification.style.transform = 'translateY(full)'; notification.style.opacity = '0'; // 动画结束后移除元素 setTimeout(() => { document.body.removeChild(notification); }, 300); }, 3000); } </script> </body> </html>