要在 Workers 上搭建一个美观大气的网址导航站,我们可以利用 HTML + Tailwind CSS + Workers 的 Serverless 架构,做到:
-
无需服务器
-
免费托管
-
支持自定义网址、图标、分类
-
页面美观,响应式设计
-
addEventListener("fetch", event => { event.respondWith(handleRequest(event.request)); }); async function handleRequest(request) { const html = ` <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>网址导航</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> /* 全局样式 */ body { margin: 0; padding: 0; background: #f7f7f7; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: #333; } .container { width: 95%; max-width: 1200px; margin: 0 auto; padding: 1rem; } h1 { text-align: center; margin-bottom: 1rem; } /* 搜索栏样式 */ .search-bar { display: flex; flex-wrap: wrap; justify-content: center; margin-bottom: 1rem; } .search-bar input { flex: 1 1 200px; padding: 0.5rem; margin-right: 0.5rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; } .search-bar select { padding: 0.5rem; margin-right: 0.5rem; border: 1px solid #ddd; border-radius: 4px;

&spm=1001.2101.3001.5002&articleId=148048937&d=1&t=3&u=3ac3dabb7f8f4e5cb4ec964c46667f24)
426

被折叠的 条评论
为什么被折叠?



