index.html 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>TrendRadar 配置文件编辑器</title>
  7. <!-- Tailwind CSS -->
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <!-- FontAwesome -->
  10. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  11. <!-- js-yaml -->
  12. <script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script>
  13. <!-- SortableJS (拖拽排序库) -->
  14. <script src="https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.0/Sortable.min.js"></script>
  15. <!-- 自定义样式 -->
  16. <link rel="stylesheet" href="./assets/style.css">
  17. </head>
  18. <body class="bg-gray-100 text-gray-800 font-sans h-screen flex flex-col overflow-hidden">
  19. <!-- 顶部导航 -->
  20. <nav class="bg-white shadow-sm border-b border-gray-200 flex-shrink-0 z-20">
  21. <div class="max-w-full mx-auto px-4 sm:px-6 lg:px-8 h-14 flex items-center justify-between">
  22. <a href="https://github.com/sansan0/TrendRadar" target="_blank" class="flex items-center gap-3 hover:opacity-80 transition-opacity">
  23. <i class="fa-solid fa-sliders text-blue-600 text-lg"></i>
  24. <span class="font-bold text-lg tracking-tight text-gray-900">TrendRadar <span class="text-gray-500 text-xs font-normal ml-2">可视化配置编辑器 </span></span>
  25. </a>
  26. <!-- 隐私安全提示 -->
  27. <div class="hidden lg:flex items-center text-xs text-gray-500 bg-gray-50 px-3 py-1.5 rounded-full border border-gray-100 select-none">
  28. <i class="fa-solid fa-shield-halved mr-1.5 text-green-500"></i>
  29. <span>纯静态页面,数据仅保存在你的本地浏览器,请放心使用</span>
  30. </div>
  31. <div class="flex gap-3">
  32. <button onclick="openLoadConfigModal()" class="text-xs text-blue-600 hover:text-blue-800 underline flex items-center gap-1">
  33. <i class="fa-solid fa-cloud-arrow-down"></i>加载官网最新配置
  34. </button>
  35. <button onclick="copyResult()" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-1.5 rounded text-sm font-medium transition-colors shadow-sm">
  36. <i class="fa-regular fa-copy mr-1.5"></i>复制配置
  37. </button>
  38. <button onclick="openSupportModal()" class="bg-gradient-to-r from-orange-400 to-pink-500 hover:from-orange-500 hover:to-pink-600 text-white px-4 py-1.5 rounded text-sm font-medium transition-all shadow-md hover:shadow-lg flex items-center gap-1.5">
  39. <i class="fa-solid fa-heart-pulse"></i>支持一下
  40. </button>
  41. </div>
  42. </div>
  43. </nav>
  44. <!-- 主界面:左右分栏 -->
  45. <main class="flex-grow flex overflow-hidden">
  46. <!-- 左侧:源代码编辑器 (Source) -->
  47. <div class="w-1/2 flex flex-col border-r border-gray-200 bg-[#1e1e1e]">
  48. <!-- Tab 切换 -->
  49. <div class="flex items-center bg-[#252526] border-b border-[#333]">
  50. <button id="tab-config" onclick="switchTab('config')" class="tab-button active px-4 py-2 text-xs font-bold text-gray-300 hover:bg-[#2d2d30] transition-colors border-b-2 border-blue-500">
  51. <i class="fa-solid fa-code mr-2"></i>config.yaml
  52. </button>
  53. <button id="tab-frequency" onclick="switchTab('frequency')" class="tab-button px-4 py-2 text-xs font-bold text-gray-500 hover:bg-[#2d2d30] transition-colors border-b-2 border-transparent">
  54. <i class="fa-solid fa-filter mr-2"></i>frequency_words.txt
  55. </button>
  56. <button id="tab-timeline" onclick="switchTab('timeline')" class="tab-button px-4 py-2 text-xs font-bold text-gray-500 hover:bg-[#2d2d30] transition-colors border-b-2 border-transparent">
  57. <i class="fa-solid fa-calendar-week mr-2"></i>timeline.yaml
  58. </button>
  59. <div class="flex-grow"></div>
  60. <!-- 保存时间显示 -->
  61. <div id="save-time-config" class="save-time-badge px-3 text-[10px] text-gray-500 flex items-center gap-1">
  62. <i class="fa-regular fa-clock"></i>
  63. <span id="config-save-label" class="hidden">已保存: </span>
  64. <span id="config-save-time" class="text-gray-400" title="未保存">未保存</span>
  65. </div>
  66. <div id="save-time-frequency" class="save-time-badge hidden px-3 text-[10px] text-gray-500 flex items-center gap-1">
  67. <i class="fa-regular fa-clock"></i>
  68. <span id="frequency-save-label" class="hidden">已保存: </span>
  69. <span id="frequency-save-time" class="text-gray-400" title="未保存">未保存</span>
  70. </div>
  71. <div id="save-time-timeline" class="save-time-badge hidden px-3 text-[10px] text-gray-500 flex items-center gap-1">
  72. <i class="fa-regular fa-clock"></i>
  73. <span id="timeline-save-label" class="hidden">已保存: </span>
  74. <span id="timeline-save-time" class="text-gray-400" title="未保存">未保存</span>
  75. </div>
  76. </div>
  77. <!-- Config 编辑器 -->
  78. <div id="yaml-editor-wrap" class="tab-content highlight-editor-wrap flex-grow w-full h-full bg-[#1e1e1e]">
  79. <div id="yaml-backdrop" class="highlight-backdrop"></div>
  80. <textarea id="yaml-editor" class="highlight-textarea" spellcheck="false"></textarea>
  81. </div>
  82. <!-- Frequency 编辑器 -->
  83. <div id="frequency-editor-wrap" class="tab-content hidden highlight-editor-wrap flex-grow w-full h-full bg-[#1e1e1e]">
  84. <div id="frequency-backdrop" class="highlight-backdrop"></div>
  85. <textarea id="frequency-editor" class="highlight-textarea" spellcheck="false"></textarea>
  86. </div>
  87. <!-- Timeline 编辑器 -->
  88. <div id="timeline-editor-wrap" class="tab-content hidden highlight-editor-wrap flex-grow w-full h-full bg-[#1e1e1e]">
  89. <div id="timeline-backdrop" class="highlight-backdrop"></div>
  90. <textarea id="timeline-editor" class="highlight-textarea" spellcheck="false"></textarea>
  91. </div>
  92. </div>
  93. <!-- 右侧:可视化配置 (Visual) -->
  94. <div class="w-1/2 flex flex-col bg-gray-50">
  95. <div class="flex items-center justify-between px-6 py-3 bg-white border-b border-gray-200">
  96. <div class="flex items-center gap-3">
  97. <span class="text-sm font-bold text-gray-700"><i class="fa-solid fa-list-check mr-2"></i><span id="right-panel-title">配置模块</span></span>
  98. <button id="version-check-btn" onclick="checkVersion()" class="text-xs bg-indigo-500 hover:bg-indigo-600 text-white px-3 py-1 rounded shadow-sm transition-all flex items-center gap-1.5" title="检测 config.yaml 版本">
  99. <i class="fa-solid fa-code-compare"></i>
  100. <span>版本检测</span>
  101. </button>
  102. <button onclick="resetToDefault()" class="text-xs text-gray-400 hover:text-red-500 transition-colors px-2 py-1" title="重置当前内容为默认状态">
  103. <i class="fa-solid fa-rotate-left"></i>
  104. </button>
  105. </div>
  106. </div>
  107. <!-- 模块导航栏 -->
  108. <div id="module-nav" class="tab-content bg-white border-b border-gray-200 px-4 py-2 flex flex-wrap gap-1">
  109. </div>
  110. <!-- Config 可视化面板 -->
  111. <div id="config-panel" class="tab-content flex-grow overflow-y-auto p-6 space-y-6">
  112. </div>
  113. <!-- Frequency 可视化面板 -->
  114. <div id="frequency-panel" class="tab-content hidden flex-grow overflow-y-auto p-6 space-y-6">
  115. </div>
  116. <!-- Timeline 可视化面板 -->
  117. <div id="timeline-panel" class="tab-content hidden flex-grow overflow-y-auto p-6 space-y-6">
  118. </div>
  119. </div>
  120. </main>
  121. <!-- RSS 添加弹窗 -->
  122. <div id="rss-modal" class="modal-overlay hidden">
  123. <div class="modal-content">
  124. <div class="flex items-center justify-between mb-4">
  125. <h3 class="text-lg font-bold text-gray-800"><i class="fa-solid fa-rss mr-2 text-orange-500"></i>添加 RSS 源</h3>
  126. <button onclick="closeRssModal()" class="text-gray-400 hover:text-gray-600"><i class="fa-solid fa-times text-xl"></i></button>
  127. </div>
  128. <div class="space-y-4">
  129. <div>
  130. <label class="block text-xs font-bold text-gray-600 mb-1">源 ID(唯一标识,英文)</label>
  131. <input type="text" id="rss-id" placeholder="例如: my-blog" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  132. </div>
  133. <div>
  134. <label class="block text-xs font-bold text-gray-600 mb-1">显示名称</label>
  135. <input type="text" id="rss-name" placeholder="例如: 我的博客" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  136. </div>
  137. <div>
  138. <label class="block text-xs font-bold text-gray-600 mb-1">RSS URL</label>
  139. <input type="text" id="rss-url" placeholder="https://example.com/feed.xml" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  140. </div>
  141. <div>
  142. <label class="block text-xs font-bold text-gray-600 mb-1">最大文章年龄(天,可选)</label>
  143. <input type="number" id="rss-max-age" placeholder="留空使用全局设置" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  144. </div>
  145. </div>
  146. <!-- RSS 灵感折叠区 -->
  147. <div class="mt-5 border-t border-gray-100 pt-4">
  148. <button type="button" onclick="toggleRssTips()" class="w-full flex items-center justify-between text-xs text-orange-600 hover:text-orange-700 bg-orange-50 hover:bg-orange-100 px-3 py-2 rounded-lg transition-all group">
  149. <span class="font-bold flex items-center gap-1.5">
  150. <i class="fa-regular fa-lightbulb"></i> RSS 订阅灵感 & 参考库 <span class="font-normal opacity-70 ml-1">(内附常用源)</span>
  151. </span>
  152. <i id="rss-tips-icon" class="fa-solid fa-chevron-down transition-transform duration-200 text-orange-400 group-hover:text-orange-600" style="transform: rotate(180deg);"></i>
  153. </button>
  154. <div id="rss-tips-panel" class="mt-2 space-y-3 pl-1">
  155. <!-- 必应新闻 -->
  156. <div class="bg-white border border-gray-100 rounded-lg p-3 shadow-sm">
  157. <div class="flex items-center gap-2 mb-2">
  158. <i class="fa-brands fa-microsoft text-blue-500"></i>
  159. <span class="font-bold text-gray-700">Bing 新闻 (支持任意关键词)</span>
  160. </div>
  161. <div class="grid grid-cols-2 gap-2 mb-2">
  162. <button onclick="fillRssUrl('https://www.bing.com/news/search?q=科技+编程&format=RSS')" class="text-left text-[10px] border border-gray-200 hover:border-blue-400 hover:bg-blue-50 hover:text-blue-600 rounded px-2 py-1.5 transition-colors truncate" title="点击填入">
  163. 🚀 科技/编程
  164. </button>
  165. <button onclick="fillRssUrl('https://www.bing.com/news/search?q=全球新闻&format=RSS')" class="text-left text-[10px] border border-gray-200 hover:border-blue-400 hover:bg-blue-50 hover:text-blue-600 rounded px-2 py-1.5 transition-colors truncate" title="点击填入">
  166. 🌍 全球新闻
  167. </button>
  168. <button onclick="fillRssUrl('https://www.bing.com/news/search?q=人工智能&format=RSS')" class="text-left text-[10px] border border-gray-200 hover:border-blue-400 hover:bg-blue-50 hover:text-blue-600 rounded px-2 py-1.5 transition-colors truncate" title="点击填入">
  169. 🤖 人工智能
  170. </button>
  171. <button onclick="fillRssUrl('https://www.bing.com/news/search?q=黄金价格+走势&format=RSS')" class="text-left text-[10px] border border-gray-200 hover:border-blue-400 hover:bg-blue-50 hover:text-blue-600 rounded px-2 py-1.5 transition-colors truncate" title="点击填入">
  172. 💰 黄金/财经
  173. </button>
  174. </div>
  175. <div class="text-[10px] text-gray-400">
  176. 💡 小贴士:修改 URL 中的 <code class="bg-gray-100 px-1 rounded text-gray-600">q=</code> 参数即可监控任何你感兴趣的话题。
  177. </div>
  178. </div>
  179. <!-- 更多参考 -->
  180. <div class="bg-white border border-gray-100 rounded-lg p-3 shadow-sm">
  181. <div class="flex items-center gap-2 mb-2">
  182. <i class="fa-solid fa-book-open text-purple-500"></i>
  183. <span class="font-bold text-gray-700">更多 RSS 源参考</span>
  184. </div>
  185. <div class="flex flex-wrap gap-2 text-xs">
  186. <a href="https://github.com/tuan3w/awesome-tech-rss" target="_blank" class="text-blue-600 hover:underline flex items-center bg-blue-50 px-2 py-1 rounded">
  187. <i class="fa-brands fa-github mr-1"></i>科技/编程
  188. </a>
  189. <a href="https://github.com/plenaryapp/awesome-rss-feeds" target="_blank" class="text-blue-600 hover:underline flex items-center bg-blue-50 px-2 py-1 rounded">
  190. <i class="fa-brands fa-github mr-1"></i>全球新闻
  191. </a>
  192. </div>
  193. </div>
  194. <!-- 免责声明 -->
  195. <div class="text-[10px] text-gray-400 italic leading-relaxed px-1">
  196. <i class="fa-solid fa-shield-halved mr-1 text-gray-300"></i>免责声明:以上 RSS 示例及第三方工具均源自互联网,开发者未一一验证其长期有效性,请你在使用前自行核实。
  197. </div>
  198. </div>
  199. </div>
  200. <div class="flex justify-end gap-2 mt-6">
  201. <button onclick="closeRssModal()" class="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg">取消</button>
  202. <button onclick="confirmAddRss()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">添加</button>
  203. </div>
  204. </div>
  205. </div>
  206. <!-- 平台添加弹窗 -->
  207. <div id="platform-modal" class="modal-overlay hidden">
  208. <div class="modal-content">
  209. <div class="flex items-center justify-between mb-4">
  210. <h3 class="text-lg font-bold text-gray-800"><i class="fa-solid fa-layer-group mr-2 text-green-600"></i>添加热榜平台</h3>
  211. <button onclick="closePlatformModal()" class="text-gray-400 hover:text-gray-600"><i class="fa-solid fa-times text-xl"></i></button>
  212. </div>
  213. <!-- 标签页切换 -->
  214. <div class="flex border-b border-gray-200 mb-4">
  215. <button onclick="switchPlatformTab('select')" id="tab-platform-select" class="flex-1 py-2 text-sm font-bold text-blue-600 border-b-2 border-blue-600 transition-colors">
  216. <i class="fa-solid fa-list mr-1"></i>选择预设
  217. </button>
  218. <button onclick="switchPlatformTab('custom')" id="tab-platform-custom" class="flex-1 py-2 text-sm font-bold text-gray-500 border-b-2 border-transparent hover:text-gray-700 transition-colors">
  219. <i class="fa-solid fa-pen-to-square mr-1"></i>手动输入
  220. </button>
  221. </div>
  222. <!-- 1. 选择预设平台 -->
  223. <div id="platform-select-panel" class="space-y-4">
  224. <div id="available-platforms-list" class="space-y-2 max-h-60 overflow-y-auto pr-1">
  225. <!-- 动态生成可用平台 -->
  226. </div>
  227. <div id="no-platforms-tip" class="hidden text-center py-6 text-gray-500 text-sm bg-gray-50 rounded">
  228. <i class="fa-solid fa-check-circle text-green-500 mr-2"></i>所有预设平台已添加
  229. </div>
  230. </div>
  231. <!-- 2. 手动输入平台 -->
  232. <div id="platform-custom-panel" class="hidden space-y-4">
  233. <div class="bg-blue-50 border border-blue-100 rounded p-3 mb-3 text-xs text-blue-800">
  234. <i class="fa-solid fa-info-circle mr-1"></i>自定义平台需要后端爬虫支持,此处仅用于配置占位。
  235. </div>
  236. <div>
  237. <label class="block text-xs font-bold text-gray-600 mb-1">平台 Key(英文)</label>
  238. <input type="text" id="custom-platform-key" placeholder="例如: sspai" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  239. </div>
  240. <div>
  241. <label class="block text-xs font-bold text-gray-600 mb-1">显示名称</label>
  242. <input type="text" id="custom-platform-name" placeholder="例如: 少数派" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
  243. </div>
  244. </div>
  245. <div class="flex justify-end gap-2 mt-6">
  246. <button onclick="closePlatformModal()" class="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg">取消</button>
  247. <button onclick="confirmAddPlatform()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">添加</button>
  248. </div>
  249. </div>
  250. </div>
  251. <!-- 词组类型选择弹窗 -->
  252. <div id="wordgroup-type-modal" class="modal-overlay hidden">
  253. <div class="modal-content max-w-2xl">
  254. <div class="flex items-center justify-between mb-4">
  255. <h3 class="text-lg font-bold text-gray-800"><i class="fa-solid fa-layer-group mr-2 text-blue-500"></i>选择词组类型</h3>
  256. <button onclick="closeWordGroupTypeModal()" class="text-gray-400 hover:text-gray-600"><i class="fa-solid fa-times text-xl"></i></button>
  257. </div>
  258. <div class="space-y-3">
  259. <!-- 组别名类型 -->
  260. <div onclick="confirmAddWordGroup('group')" class="cursor-pointer border-2 border-orange-200 bg-orange-50 rounded-lg p-4 hover:border-orange-400 hover:bg-orange-100 transition-all">
  261. <div class="flex items-center gap-3">
  262. <span class="text-xs bg-orange-500 text-white px-2 py-1 rounded font-bold">组别名</span>
  263. <span class="font-bold text-gray-800">多关键词词组(推荐)</span>
  264. </div>
  265. <div class="mt-2 text-sm text-gray-600">
  266. <div class="font-mono bg-white rounded p-2 text-xs border border-orange-200">
  267. <div class="text-orange-600">[东亚]</div>
  268. <div>日本</div>
  269. <div>韩国</div>
  270. <div>朝鲜</div>
  271. </div>
  272. <div class="mt-2 text-xs text-gray-500">
  273. <i class="fa-solid fa-check-circle text-orange-500 mr-1"></i>适用于:多个关键词归为一组,统一显示为组名
  274. </div>
  275. </div>
  276. </div>
  277. <!-- 单个别名类型 -->
  278. <div onclick="confirmAddWordGroup('alias')" class="cursor-pointer border-2 border-teal-200 bg-teal-50 rounded-lg p-4 hover:border-teal-400 hover:bg-teal-100 transition-all">
  279. <div class="flex items-center gap-3">
  280. <span class="text-xs bg-teal-500 text-white px-2 py-1 rounded font-bold">单个别名</span>
  281. <span class="font-bold text-gray-800">正则/关键词 + 别名</span>
  282. </div>
  283. <div class="mt-2 text-sm text-gray-600">
  284. <div class="font-mono bg-white rounded p-2 text-xs border border-teal-200">
  285. <div>/胖东来|于东来/ <span class="text-teal-600">=></span> 胖东来</div>
  286. </div>
  287. <div class="mt-2 text-xs text-gray-500">
  288. <i class="fa-solid fa-check-circle text-teal-500 mr-1"></i>适用于:用正则匹配多个词,显示为一个别名(前后有空行分隔)
  289. </div>
  290. </div>
  291. </div>
  292. <!-- 连续别名类型 -->
  293. <div onclick="confirmAddWordGroup('multi-alias')" class="cursor-pointer border-2 border-purple-200 bg-purple-50 rounded-lg p-4 hover:border-purple-400 hover:bg-purple-100 transition-all">
  294. <div class="flex items-center gap-3">
  295. <span class="text-xs bg-purple-500 text-white px-2 py-1 rounded font-bold">连续别名组</span>
  296. <span class="font-bold text-gray-800">多个相关品牌/词组</span>
  297. </div>
  298. <div class="mt-2 text-sm text-gray-600">
  299. <div class="font-mono bg-white rounded p-2 text-xs border border-purple-200">
  300. <div>/智元|灵犀|稚晖君/ <span class="text-purple-600">=></span> 智元机器人</div>
  301. <div>/众擎|EngineAI/ <span class="text-purple-600">=></span> 众擎机器人</div>
  302. </div>
  303. <div class="mt-2 text-xs text-gray-500">
  304. <i class="fa-solid fa-check-circle text-purple-500 mr-1"></i>适用于:多个相关品牌放在一起(<strong>无空行分隔</strong>)
  305. </div>
  306. </div>
  307. </div>
  308. <!-- 普通词组类型 -->
  309. <div onclick="confirmAddWordGroup('plain')" class="cursor-pointer border-2 border-gray-200 bg-gray-50 rounded-lg p-4 hover:border-gray-400 hover:bg-gray-100 transition-all">
  310. <div class="flex items-center gap-3">
  311. <span class="text-xs bg-gray-500 text-white px-2 py-1 rounded font-bold">普通词组</span>
  312. <span class="font-bold text-gray-800">简单关键词</span>
  313. </div>
  314. <div class="mt-2 text-sm text-gray-600">
  315. <div class="font-mono bg-white rounded p-2 text-xs border border-gray-200">
  316. <div>申奥</div>
  317. </div>
  318. <div class="mt-2 text-xs text-gray-500">
  319. <i class="fa-solid fa-check-circle text-gray-500 mr-1"></i>适用于:单个或少量普通关键词
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. <div class="flex justify-end gap-2 mt-6">
  325. <button onclick="closeWordGroupTypeModal()" class="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg">取消</button>
  326. </div>
  327. </div>
  328. </div>
  329. <!-- 支持项目弹窗 -->
  330. <div id="support-modal" class="modal-overlay hidden">
  331. <div class="modal-content support-modal-content max-w-5xl w-[95%] max-h-[90vh] overflow-y-auto p-8">
  332. <div class="flex items-center justify-between mb-8">
  333. <div class="flex items-center gap-4">
  334. <div class="w-12 h-12 bg-orange-50 rounded-full flex items-center justify-center text-orange-500 shadow-sm relative overflow-hidden">
  335. <div class="absolute inset-0 bg-orange-400 opacity-20 animate-ping"></div>
  336. <i class="fa-solid fa-heart text-2xl animate-pulse relative z-10"></i>
  337. </div>
  338. <div>
  339. <h3 class="text-2xl font-bold text-gray-800 tracking-tight">觉得好用?支持一下 ✨</h3>
  340. <p class="text-sm text-gray-500 mt-1">若 TrendRadar 曾为你捕捉价值,不妨为它注入动力,助其持续进化</p>
  341. </div>
  342. </div>
  343. <button onclick="closeSupportModal()" class="w-10 h-10 flex items-center justify-center rounded-full hover:bg-gray-100 text-gray-400 transition-colors">
  344. <i class="fa-solid fa-times text-xl"></i>
  345. </button>
  346. </div>
  347. <div class="grid grid-cols-1 md:grid-cols-4 gap-6">
  348. <a href="https://github.com/sansan0/TrendRadar" target="_blank" class="support-card group border-orange-200 bg-orange-50/30">
  349. <div class="support-card-num opacity-50">01</div>
  350. <div class="support-icon text-orange-500 bg-orange-100 group-hover:bg-orange-200 mb-4 group-hover:scale-110 transition-transform">
  351. <i class="fa-solid fa-star text-2xl"></i>
  352. </div>
  353. <h4 class="text-lg font-bold text-gray-800 mb-2">点亮 Star</h4>
  354. <p class="text-sm text-gray-500 mb-6 text-center leading-relaxed">只需 1 秒,让更多人发现它</p>
  355. <span class="support-btn bg-gradient-to-r from-orange-400 to-red-500 shadow-lg shadow-orange-200 group-hover:shadow-xl group-hover:from-orange-500 group-hover:to-red-600">立即前往 GitHub</span>
  356. </a>
  357. <div class="support-card group">
  358. <div class="support-card-num">02</div>
  359. <div class="support-icon text-green-600 bg-green-50 group-hover:bg-green-100 mb-4">
  360. <i class="fa-brands fa-weixin text-2xl"></i>
  361. </div>
  362. <h4 class="text-lg font-bold text-gray-800 mb-2">不迷路</h4>
  363. <p class="text-sm text-gray-500 mb-4 text-center">第一时间获取更新通知</p>
  364. <div class="w-36 h-36 bg-white border border-gray-100 rounded-xl p-2 shadow-sm group-hover:shadow-md transition-shadow">
  365. <img src="./assets/weixin.webp" alt="微信公众号" class="w-full h-full object-contain">
  366. </div>
  367. <p class="text-xs text-gray-400 mt-3">扫码加入社区</p>
  368. </div>
  369. <div class="support-card group">
  370. <div class="support-card-num">03</div>
  371. <div class="support-icon text-emerald-600 bg-emerald-50 group-hover:bg-emerald-100 mb-4">
  372. <i class="fa-solid fa-hand-holding-heart text-2xl"></i>
  373. </div>
  374. <h4 class="text-lg font-bold text-gray-800 mb-2">随心赞赏</h4>
  375. <p class="text-sm text-gray-500 mb-4 text-center">金额随意,1 元也是鼓励 (´▽`ʃ♡ƪ)</p>
  376. <div class="w-36 h-36 bg-white border border-gray-100 rounded-xl p-2 shadow-sm group-hover:shadow-md transition-shadow">
  377. <img src="https://cdn-1258574687.cos.ap-shanghai.myqcloud.com/img/%2F2026%2F01%2F18ecce7c224ce0ea4c59394c29e408f8-e0d1db45.webp" alt="微信支付" class="w-full h-full object-contain">
  378. </div>
  379. <p class="text-xs text-gray-400 mt-3">微信扫码 • 丰俭由人</p>
  380. </div>
  381. <a href="https://sansan0.github.io/mao-map/" target="_blank" class="support-card group">
  382. <div class="support-card-num">04</div>
  383. <div class="support-icon text-red-500 bg-red-50 group-hover:bg-red-100 mb-4">
  384. <i class="fa-solid fa-map-location-dot text-2xl"></i>
  385. </div>
  386. <h4 class="text-lg font-bold text-gray-800 mb-2">探索更多</h4>
  387. <p class="text-sm text-gray-500 mb-6 text-center leading-relaxed">另一个用心的作品</p>
  388. <span class="support-btn bg-red-50 text-red-600 group-hover:bg-red-100 group-hover:text-red-700 border border-red-100">去看看</span>
  389. </a>
  390. </div>
  391. <div class="mt-8 pt-6 border-t border-gray-100 text-center">
  392. <p class="text-sm text-gray-400 font-serif italic tracking-wide">"开源不易,感谢每一份支持"</p>
  393. </div>
  394. </div>
  395. </div>
  396. <!-- 新建调度模式弹窗 -->
  397. <div id="tl-new-preset-modal" class="modal-overlay hidden">
  398. <div class="modal-content">
  399. <div class="flex items-center justify-between mb-4">
  400. <h3 class="text-lg font-bold text-gray-800"><i class="fa-solid fa-calendar-plus mr-2 text-purple-600"></i>新建调度模式</h3>
  401. <button onclick="closeTlNewPresetModal()" class="text-gray-400 hover:text-gray-600"><i class="fa-solid fa-times text-xl"></i></button>
  402. </div>
  403. <div class="space-y-4">
  404. <div>
  405. <label class="block text-xs font-bold text-gray-600 mb-1">模式标识 (key)</label>
  406. <input type="text" id="tl-new-preset-key" placeholder="英文标识,如 my_schedule" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 text-sm">
  407. <p class="text-[10px] text-gray-400 mt-1">仅支持英文、数字和下划线,将作为 YAML 中的 key</p>
  408. </div>
  409. <div>
  410. <label class="block text-xs font-bold text-gray-600 mb-1">显示名称</label>
  411. <input type="text" id="tl-new-preset-name" placeholder="如:我的调度" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 text-sm">
  412. </div>
  413. <div>
  414. <label class="block text-xs font-bold text-gray-600 mb-1">描述(可选)</label>
  415. <input type="text" id="tl-new-preset-desc" placeholder="简短描述此模式的用途" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 text-sm">
  416. </div>
  417. <div>
  418. <label class="block text-xs font-bold text-gray-600 mb-1">基于模板</label>
  419. <select id="tl-new-preset-template" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 text-sm">
  420. <option value="">空白模板(仅采集,不推送不分析)</option>
  421. </select>
  422. <p class="text-[10px] text-gray-400 mt-1">复制已有模式的全部配置作为起点</p>
  423. </div>
  424. </div>
  425. <div class="flex justify-end gap-2 mt-6">
  426. <button onclick="closeTlNewPresetModal()" class="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg">取消</button>
  427. <button onclick="confirmTlNewPreset()" class="px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700">创建</button>
  428. </div>
  429. </div>
  430. </div>
  431. <!-- 新增时间段弹窗 -->
  432. <div id="tl-new-period-modal" class="modal-overlay hidden">
  433. <div class="modal-content">
  434. <div class="flex items-center justify-between mb-4">
  435. <h3 class="text-lg font-bold text-gray-800"><i class="fa-solid fa-clock-rotate-left mr-2 text-blue-600"></i>新增时间段</h3>
  436. <button onclick="closeTlNewPeriodModal()" class="text-gray-400 hover:text-gray-600"><i class="fa-solid fa-times text-xl"></i></button>
  437. </div>
  438. <div class="space-y-4">
  439. <div>
  440. <label class="block text-xs font-bold text-gray-600 mb-1">时间段标识 (key)</label>
  441. <input type="text" id="tl-new-period-key" placeholder="英文标识,如 morning_push" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm">
  442. <p class="text-[10px] text-gray-400 mt-1">仅支持英文、数字和下划线</p>
  443. </div>
  444. <div>
  445. <label class="block text-xs font-bold text-gray-600 mb-1">显示名称</label>
  446. <input type="text" id="tl-new-period-name" placeholder="如:晨间推送" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm">
  447. </div>
  448. <div class="grid grid-cols-2 gap-4">
  449. <div>
  450. <label class="block text-xs font-bold text-gray-600 mb-1">开始时间</label>
  451. <input type="time" id="tl-new-period-start" value="09:00" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm">
  452. </div>
  453. <div>
  454. <label class="block text-xs font-bold text-gray-600 mb-1">结束时间</label>
  455. <input type="time" id="tl-new-period-end" value="11:00" class="w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm">
  456. </div>
  457. </div>
  458. <div class="bg-blue-50 border border-blue-100 rounded p-3 text-xs text-blue-700">
  459. <i class="fa-solid fa-info-circle mr-1"></i>如果开始时间 > 结束时间(如 22:00~01:00),将自动识别为跨午夜时间段。
  460. </div>
  461. </div>
  462. <div class="flex justify-end gap-2 mt-6">
  463. <button onclick="closeTlNewPeriodModal()" class="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg">取消</button>
  464. <button onclick="confirmTlNewPeriod()" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">添加</button>
  465. </div>
  466. </div>
  467. </div>
  468. <script src="./assets/script.js"></script>
  469. </body>
  470. </html>