文章點擊後,顯示 80%比例 markdowm文章內文跟顯示區塊,背景變暗,點擊背景空白區域就關掉文章 - Initial Deployment
Browse files- README.md +6 -4
- index.html +790 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: purple
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: self-site
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: purple
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,790 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="zh-TW">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>文章列表頁面</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<script>
|
| 10 |
+
tailwind.config = {
|
| 11 |
+
theme: {
|
| 12 |
+
extend: {
|
| 13 |
+
colors: {
|
| 14 |
+
primary: '#3b82f6',
|
| 15 |
+
secondary: '#1e40af',
|
| 16 |
+
accent: '#f97316',
|
| 17 |
+
dark: '#1e293b',
|
| 18 |
+
light: '#f8fafc'
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
</script>
|
| 24 |
+
<style>
|
| 25 |
+
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&display=swap');
|
| 26 |
+
|
| 27 |
+
body {
|
| 28 |
+
font-family: 'Noto Sans TC', sans-serif;
|
| 29 |
+
background-color: #f1f5f9;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.article-card {
|
| 33 |
+
transition: all 0.3s ease;
|
| 34 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.article-card:hover {
|
| 38 |
+
transform: translateY(-5px);
|
| 39 |
+
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.hot-badge {
|
| 43 |
+
background: linear-gradient(45deg, #f97316, #ea580c);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.popular-badge {
|
| 47 |
+
background: linear-gradient(45deg, #3b82f6, #1d4ed8);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.recent-badge {
|
| 51 |
+
background: linear-gradient(45deg, #10b981, #059669);
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.pagination-btn {
|
| 55 |
+
transition: all 0.2s ease;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.pagination-btn:hover {
|
| 59 |
+
background-color: #e2e8f0;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.pagination-btn.active {
|
| 63 |
+
background-color: #3b82f6;
|
| 64 |
+
color: white;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.sort-btn.active {
|
| 68 |
+
background-color: #dbeafe;
|
| 69 |
+
color: #3b82f6;
|
| 70 |
+
border-color: #3b82f6;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
.sticky-top {
|
| 74 |
+
position: sticky;
|
| 75 |
+
top: 20px;
|
| 76 |
+
}
|
| 77 |
+
</style>
|
| 78 |
+
</head>
|
| 79 |
+
<body class="min-h-screen">
|
| 80 |
+
<!-- 頁首 -->
|
| 81 |
+
<header class="relative bg-gradient-to-r from-blue-900 via-purple-900 to-indigo-900 text-white shadow-lg overflow-hidden">
|
| 82 |
+
<!-- 裝飾元素 -->
|
| 83 |
+
<div class="absolute top-0 left-0 w-full h-full opacity-10">
|
| 84 |
+
<div class="absolute top-10 right-10 w-64 h-64 bg-purple-500 rounded-full mix-blend-soft-light filter blur-3xl"></div>
|
| 85 |
+
<div class="absolute bottom-10 left-10 w-96 h-96 bg-indigo-500 rounded-full mix-blend-soft-light filter blur-3xl"></div>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<div class="container mx-auto px-4 py-4 relative z-10">
|
| 89 |
+
<div class="flex flex-col lg:flex-row justify-between items-center gap-4">
|
| 90 |
+
<div class="flex items-center w-full lg:w-auto">
|
| 91 |
+
<i class="fas fa-newspaper text-primary text-3xl mr-3"></i>
|
| 92 |
+
<h1 class="text-2xl lg:text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-accent">hoansu</h1>
|
| 93 |
+
<span class="mx-3 text-gray-300 opacity-50">|</span>
|
| 94 |
+
<h2 class="text-xl lg:text-2xl font-semibold text-gray-100">文章列表</h2>
|
| 95 |
+
</div>
|
| 96 |
+
<div class="flex items-center w-full lg:w-auto space-x-3">
|
| 97 |
+
<button id="postArticleBtn" class="bg-gradient-to-r from-primary to-accent hover:from-secondary hover:to-purple-600 text-white px-4 py-2.5 rounded-lg transition-all duration-300 shadow-lg transform hover:scale-105 flex items-center text-sm lg:text-base">
|
| 98 |
+
<i class="fas fa-plus mr-2"></i> 發表文章
|
| 99 |
+
</button>
|
| 100 |
+
<div class="relative flex-1 max-w-xs lg:max-w-md">
|
| 101 |
+
<input type="text" placeholder="搜尋文章..." class="w-full bg-white bg-opacity-10 backdrop-blur-sm border border-white border-opacity-20 rounded-lg px-4 py-2.5 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent text-white placeholder-gray-300 text-sm lg:text-base">
|
| 102 |
+
<i class="fas fa-search absolute right-3 top-3 text-gray-300 text-sm"></i>
|
| 103 |
+
</div>
|
| 104 |
+
<button id="authBtn" class="bg-white bg-opacity-20 hover:bg-opacity-30 text-white px-4 py-2.5 rounded-lg transition-all duration-300 flex items-center text-sm lg:text-base">
|
| 105 |
+
<i class="fas fa-user mr-2"></i> 登入
|
| 106 |
+
</button>
|
| 107 |
+
</div>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
</header>
|
| 111 |
+
|
| 112 |
+
<!-- 登入表單模態框 -->
|
| 113 |
+
<div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 114 |
+
<div class="bg-white rounded-xl p-8 w-full max-w-md">
|
| 115 |
+
<div class="flex justify-between items-center mb-6">
|
| 116 |
+
<h3 class="text-2xl font-bold text-gray-800">會員登入</h3>
|
| 117 |
+
<button id="closeLoginModal" class="text-gray-500 hover:text-gray-700">
|
| 118 |
+
<i class="fas fa-times"></i>
|
| 119 |
+
</button>
|
| 120 |
+
</div>
|
| 121 |
+
<form id="loginForm">
|
| 122 |
+
<div class="mb-4">
|
| 123 |
+
<label class="block text-gray-700 mb-2" for="username">帳號</label>
|
| 124 |
+
<input type="text" id="username" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary" placeholder="請輸入帳號" required>
|
| 125 |
+
</div>
|
| 126 |
+
<div class="mb-6">
|
| 127 |
+
<label class="block text-gray-700 mb-2" for="password">密碼</label>
|
| 128 |
+
<input type="password" id="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary" placeholder="請輸入密碼" required>
|
| 129 |
+
</div>
|
| 130 |
+
<div class="flex justify-between items-center">
|
| 131 |
+
<button type="button" class="text-gray-600 hover:text-gray-800">忘記密碼?</button>
|
| 132 |
+
<button type="submit" class="bg-gradient-to-r from-primary to-accent hover:from-secondary hover:to-purple-600 text-white px-6 py-2.5 rounded-lg transition-all duration-300">
|
| 133 |
+
登入
|
| 134 |
+
</button>
|
| 135 |
+
</div>
|
| 136 |
+
</form>
|
| 137 |
+
<div class="mt-6 text-center">
|
| 138 |
+
<p class="text-gray-600">還沒有帳號? <a href="#" class="text-primary hover:underline">立即註冊</a></p>
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<main class="container mx-auto px-4 py-8">
|
| 144 |
+
<div class="flex flex-col lg:flex-row gap-8">
|
| 145 |
+
<!-- 主要內容區 -->
|
| 146 |
+
<div class="w-full lg:w-3/4">
|
| 147 |
+
<!-- 置頂熱門文章 -->
|
| 148 |
+
<section class="mb-10">
|
| 149 |
+
<div class="flex items-center mb-6">
|
| 150 |
+
<i class="fas fa-fire text-accent mr-2"></i>
|
| 151 |
+
<h2 class="text-2xl font-bold text-gray-800">熱門文章</h2>
|
| 152 |
+
<div class="ml-2 bg-red-100 text-red-800 text-xs font-semibold px-2.5 py-0.5 rounded">
|
| 153 |
+
置頂
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
|
| 157 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
| 158 |
+
<!-- 熱門文章 1 -->
|
| 159 |
+
<div class="article-card bg-white rounded-xl overflow-hidden border border-gray-200">
|
| 160 |
+
<div class="relative">
|
| 161 |
+
<img src="https://images.unsplash.com/photo-1499750310107-5fef28a66643?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80" alt="熱門文章" class="w-full h-48 object-cover">
|
| 162 |
+
<div class="absolute top-4 right-4 bg-red-500 text-white text-xs font-bold px-2 py-1 rounded">
|
| 163 |
+
熱門
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
<div class="p-5">
|
| 167 |
+
<div class="flex items-center mb-2">
|
| 168 |
+
<span class="popular-badge text-white text-xs font-bold px-2 py-1 rounded mr-2">人氣 98%</span>
|
| 169 |
+
<span class="text-gray-500 text-sm">2023-10-15</span>
|
| 170 |
+
</div>
|
| 171 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2">如何提升產品設計的用戶體驗</h3>
|
| 172 |
+
<p class="text-gray-600 mb-4">在競爭激烈的市場中,優秀的用戶體驗是產品成功的關鍵因素。本文將探討...</p>
|
| 173 |
+
<div class="flex justify-between items-center">
|
| 174 |
+
<div class="flex items-center">
|
| 175 |
+
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="作者" class="w-8 h-8 rounded-full mr-2">
|
| 176 |
+
<span class="text-gray-700">張美華</span>
|
| 177 |
+
</div>
|
| 178 |
+
<div class="flex space-x-2">
|
| 179 |
+
<span class="text-gray-500"><i class="far fa-eye mr-1"></i> 1.2k</span>
|
| 180 |
+
<span class="text-gray-500"><i class="far fa-comment mr-1"></i> 42</span>
|
| 181 |
+
<span class="text-gray-500"><i class="far fa-heart mr-1"></i> 87</span>
|
| 182 |
+
</div>
|
| 183 |
+
</div>
|
| 184 |
+
</div>
|
| 185 |
+
</div>
|
| 186 |
+
|
| 187 |
+
<!-- 熱門文章 2 -->
|
| 188 |
+
<div class="article-card bg-white rounded-xl overflow-hidden border border-gray-200">
|
| 189 |
+
<div class="relative">
|
| 190 |
+
<img src="https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80" alt="熱門文章" class="w-full h-48 object-cover">
|
| 191 |
+
<div class="absolute top-4 right-4 bg-red-500 text-white text-xs font-bold px-2 py-1 rounded">
|
| 192 |
+
熱門
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
<div class="p-5">
|
| 196 |
+
<div class="flex items-center mb-2">
|
| 197 |
+
<span class="popular-badge text-white text-xs font-bold px-2 py-1 rounded mr-2">人氣 95%</span>
|
| 198 |
+
<span class="text-gray-500 text-sm">2023-10-12</span>
|
| 199 |
+
</div>
|
| 200 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2">2024年科技趨勢預測</h3>
|
| 201 |
+
<p class="text-gray-600 mb-4">隨著技術的快速發展,了解未來趨勢對於企業和個人都至關重要。本文將...</p>
|
| 202 |
+
<div class="flex justify-between items-center">
|
| 203 |
+
<div class="flex items-center">
|
| 204 |
+
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="作者" class="w-8 h-8 rounded-full mr-2">
|
| 205 |
+
<span class="text-gray-700">李志明</span>
|
| 206 |
+
</div>
|
| 207 |
+
<div class="flex space-x-2">
|
| 208 |
+
<span class="text-gray-500"><i class="far fa-eye mr-1"></i> 2.1k</span>
|
| 209 |
+
<span class="text-gray-500"><i class="far fa-comment mr-1"></i> 68</span>
|
| 210 |
+
<span class="text-gray-500"><i class="far fa-heart mr-1"></i> 124</span>
|
| 211 |
+
</div>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<!-- 熱門文章 3 -->
|
| 217 |
+
<div class="article-card bg-white rounded-xl overflow-hidden border border-gray-200">
|
| 218 |
+
<div class="relative">
|
| 219 |
+
<img src="https://images.unsplash.com/photo-1460925895917-afdab827c52f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80" alt="熱門文章" class="w-full h-48 object-cover">
|
| 220 |
+
<div class="absolute top-4 right-4 bg-red-500 text-white text-xs font-bold px-2 py-1 rounded">
|
| 221 |
+
熱門
|
| 222 |
+
</div>
|
| 223 |
+
</div>
|
| 224 |
+
<div class="p-5">
|
| 225 |
+
<div class="flex items-center mb-2">
|
| 226 |
+
<span class="popular-badge text-white text-xs font-bold px-2 py-1 rounded mr-2">人氣 92%</span>
|
| 227 |
+
<span class="text-gray-500 text-sm">2023-10-10</span>
|
| 228 |
+
</div>
|
| 229 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2">數據分析在商業決策中的應用</h3>
|
| 230 |
+
<p class="text-gray-600 mb-4">數據驅動決策已成為現代企業的核心競爭力。本文將分享如何有效利用...</p>
|
| 231 |
+
<div class="flex justify-between items-center">
|
| 232 |
+
<div class="flex items-center">
|
| 233 |
+
<img src="https://randomuser.me/api/portraits/women/68.jpg" alt="作者" class="w-8 h-8 rounded-full mr-2">
|
| 234 |
+
<span class="text-gray-700">王雅婷</span>
|
| 235 |
+
</div>
|
| 236 |
+
<div class="flex space-x-2">
|
| 237 |
+
<span class="text-gray-500"><i class="far fa-eye mr-1"></i> 1.8k</span>
|
| 238 |
+
<span class="text-gray-500"><i class="far fa-comment mr-1"></i> 53</span>
|
| 239 |
+
<span class="text-gray-500"><i class="far fa-heart mr-1"></i> 96</span>
|
| 240 |
+
</div>
|
| 241 |
+
</div>
|
| 242 |
+
</div>
|
| 243 |
+
</div>
|
| 244 |
+
</div>
|
| 245 |
+
</section>
|
| 246 |
+
|
| 247 |
+
<!-- 排序選項 -->
|
| 248 |
+
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center mb-6 p-4 bg-white rounded-lg shadow-sm">
|
| 249 |
+
<div class="flex flex-wrap items-center mb-2 sm:mb-0">
|
| 250 |
+
<h3 class="text-xl font-bold text-gray-800 mr-4">所有文章</h3>
|
| 251 |
+
<div id="activeFilters" class="flex flex-wrap gap-2">
|
| 252 |
+
<!-- 活躍的篩選器標籤會在此處動態添加 -->
|
| 253 |
+
</div>
|
| 254 |
+
</div>
|
| 255 |
+
<div class="flex space-x-2">
|
| 256 |
+
<button id="sortRecent" class="sort-btn active px-4 py-2 rounded-lg border border-gray-300 text-gray-700 flex items-center">
|
| 257 |
+
<i class="fas fa-clock mr-2"></i> 最新時間
|
| 258 |
+
</button>
|
| 259 |
+
<button id="sortPopular" class="sort-btn px-4 py-2 rounded-lg border border-gray-300 text-gray-700 flex items-center">
|
| 260 |
+
<i class="fas fa-fire mr-2"></i> 人氣熱度
|
| 261 |
+
</button>
|
| 262 |
+
</div>
|
| 263 |
+
</div>
|
| 264 |
+
|
| 265 |
+
<!-- 文章列表 -->
|
| 266 |
+
<div id="articleList" class="space-y-6 mb-10">
|
| 267 |
+
<!-- 文章項目將通過JavaScript動態生成 -->
|
| 268 |
+
</div>
|
| 269 |
+
|
| 270 |
+
<!-- 分頁 -->
|
| 271 |
+
<div class="flex justify-center mt-10">
|
| 272 |
+
<nav class="flex items-center space-x-1">
|
| 273 |
+
<button class="pagination-btn w-10 h-10 rounded-full flex items-center justify-center">
|
| 274 |
+
<i class="fas fa-chevron-left"></i>
|
| 275 |
+
</button>
|
| 276 |
+
<button class="pagination-btn w-10 h-10 rounded-full flex items-center justify-center active">1</button>
|
| 277 |
+
<button class="pagination-btn w-10 h-10 rounded-full flex items-center justify-center">2</button>
|
| 278 |
+
<button class="pagination-btn w-10 h-10 rounded-full flex items-center justify-center">3</button>
|
| 279 |
+
<button class="pagination-btn w-10 h-10 rounded-full flex items-center justify-center">4</button>
|
| 280 |
+
<button class="pagination-btn w-10 h-10 rounded-full flex items-center justify-center">5</button>
|
| 281 |
+
<button class="pagination-btn w-10 h-10 rounded-full flex items-center justify-center">
|
| 282 |
+
<i class="fas fa-chevron-right"></i>
|
| 283 |
+
</button>
|
| 284 |
+
</nav>
|
| 285 |
+
</div>
|
| 286 |
+
</div>
|
| 287 |
+
|
| 288 |
+
<!-- 側邊欄 -->
|
| 289 |
+
<div class="w-full lg:w-1/4">
|
| 290 |
+
<div class="sticky-top">
|
| 291 |
+
<!-- 分類 -->
|
| 292 |
+
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
| 293 |
+
<h3 class="text-lg font-bold text-gray-800 mb-4">文章分類</h3>
|
| 294 |
+
<ul class="space-y-2" id="categoryList">
|
| 295 |
+
<li class="flex justify-between items-center py-2 border-b border-gray-100">
|
| 296 |
+
<a href="#" class="text-gray-700 hover:text-primary flex items-center category-link" data-category="科技趨勢">
|
| 297 |
+
<i class="fas fa-laptop-code mr-2 text-primary"></i> 科技趨勢
|
| 298 |
+
</a>
|
| 299 |
+
<span class="bg-gray-100 text-gray-600 text-xs font-medium px-2 py-0.5 rounded-full">24</span>
|
| 300 |
+
</li>
|
| 301 |
+
<li class="flex justify-between items-center py-2 border-b border-gray-100">
|
| 302 |
+
<a href="#" class="text-gray-700 hover:text-primary flex items-center category-link" data-category="設計">
|
| 303 |
+
<i class="fas fa-paint-brush mr-2 text-primary"></i> 設計
|
| 304 |
+
</a>
|
| 305 |
+
<span class="bg-gray-100 text-gray-600 text-xs font-medium px-2 py-0.5 rounded-full">18</span>
|
| 306 |
+
</li>
|
| 307 |
+
<li class="flex justify-between items-center py-2 border-b border-gray-100">
|
| 308 |
+
<a href="#" class="text-gray-700 hover:text-primary flex items-center category-link" data-category="商業">
|
| 309 |
+
<i class="fas fa-chart-line mr-2 text-primary"></i> 商業
|
| 310 |
+
</a>
|
| 311 |
+
<span class="bg-gray-100 text-gray-600 text-xs font-medium px-2 py-0.5 rounded-full">32</span>
|
| 312 |
+
</li>
|
| 313 |
+
<li class="flex justify-between items-center py-2 border-b border-gray-100">
|
| 314 |
+
<a href="#" class="text-gray-700 hover:text-primary flex items-center category-link" data-category="生活">
|
| 315 |
+
<i class="fas fa-heartbeat mr-2 text-primary"></i> 生活
|
| 316 |
+
</a>
|
| 317 |
+
<span class="bg-gray-100 text-gray-600 text-xs font-medium px-2 py-0.5 rounded-full">41</span>
|
| 318 |
+
</li>
|
| 319 |
+
<li class="flex justify-between items-center py-2">
|
| 320 |
+
<a href="#" class="text-gray-700 hover:text-primary flex items-center category-link" data-category="教育">
|
| 321 |
+
<i class="fas fa-graduation-cap mr-2 text-primary"></i> 教育
|
| 322 |
+
</a>
|
| 323 |
+
<span class="bg-gray-100 text-gray-600 text-xs font-medium px-2 py-0.5 rounded-full">15</span>
|
| 324 |
+
</li>
|
| 325 |
+
</ul>
|
| 326 |
+
</div>
|
| 327 |
+
|
| 328 |
+
<!-- 熱門標籤 -->
|
| 329 |
+
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
| 330 |
+
<h3 class="text-lg font-bold text-gray-800 mb-4">熱門標籤</h3>
|
| 331 |
+
<div class="flex flex-wrap gap-2">
|
| 332 |
+
<span class="bg-blue-100 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded">人工智慧</span>
|
| 333 |
+
<span class="bg-green-100 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded">用戶體驗</span>
|
| 334 |
+
<span class="bg-purple-100 text-purple-800 text-xs font-medium px-2.5 py-0.5 rounded">區塊鏈</span>
|
| 335 |
+
<span class="bg-yellow-100 text-yellow-800 text-xs font-medium px-2.5 py-0.5 rounded">數據分析</span>
|
| 336 |
+
<span class="bg-red-100 text-red-800 text-xs font-medium px-2.5 py-0.5 rounded">雲端計算</span>
|
| 337 |
+
<span class="bg-indigo-100 text-indigo-800 text-xs font-medium px-2.5 py-0.5 rounded">數位轉型</span>
|
| 338 |
+
<span class="bg-pink-100 text-pink-800 text-xs font-medium px-2.5 py-0.5 rounded">創業</span>
|
| 339 |
+
<span class="bg-teal-100 text-teal-800 text-xs font-medium px-2.5 py-0.5 rounded">行銷策略</span>
|
| 340 |
+
</div>
|
| 341 |
+
</div>
|
| 342 |
+
|
| 343 |
+
</div>
|
| 344 |
+
</div>
|
| 345 |
+
</div>
|
| 346 |
+
</main>
|
| 347 |
+
|
| 348 |
+
<!-- 頁腳 -->
|
| 349 |
+
<footer class="relative bg-gradient-to-r from-blue-900 via-purple-900 to-indigo-900 text-white pt-16 pb-8 mt-12 overflow-hidden">
|
| 350 |
+
<!-- 裝飾元素 -->
|
| 351 |
+
<div class="absolute top-0 left-0 w-full h-full opacity-10">
|
| 352 |
+
<div class="absolute top-20 left-10 w-64 h-64 bg-purple-500 rounded-full mix-blend-soft-light filter blur-3xl"></div>
|
| 353 |
+
<div class="absolute bottom-10 right-10 w-96 h-96 bg-indigo-500 rounded-full mix-blend-soft-light filter blur-3xl"></div>
|
| 354 |
+
</div>
|
| 355 |
+
|
| 356 |
+
<div class="container mx-auto px-4 relative z-10">
|
| 357 |
+
<div class="flex flex-col md:flex-row justify-between mb-12">
|
| 358 |
+
<div class="mb-10 md:mb-0 md:w-1/3">
|
| 359 |
+
<div class="flex items-center mb-6">
|
| 360 |
+
<i class="fas fa-newspaper text-primary text-2xl mr-3"></i>
|
| 361 |
+
<h3 class="text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-primary to-accent">hoansu</h3>
|
| 362 |
+
</div>
|
| 363 |
+
<p class="text-gray-300 mb-6 max-w-md leading-relaxed">這裡是個人知識分享與生活紀錄的地方,希望我的文章能為您帶來啟發與幫助。</p>
|
| 364 |
+
<div class="flex space-x-4">
|
| 365 |
+
<a href="#" class="w-10 h-10 rounded-full bg-white bg-opacity-10 flex items-center justify-center hover:bg-opacity-20 transition-all duration-300">
|
| 366 |
+
<i class="fab fa-facebook-f"></i>
|
| 367 |
+
</a>
|
| 368 |
+
<a href="#" class="w-10 h-10 rounded-full bg-white bg-opacity-10 flex items-center justify-center hover:bg-opacity-20 transition-all duration-300">
|
| 369 |
+
<i class="fab fa-twitter"></i>
|
| 370 |
+
</a>
|
| 371 |
+
<a href="#" class="w-10 h-10 rounded-full bg-white bg-opacity-10 flex items-center justify-center hover:bg-opacity-20 transition-all duration-300">
|
| 372 |
+
<i class="fab fa-instagram"></i>
|
| 373 |
+
</a>
|
| 374 |
+
<a href="#" class="w-10 h-10 rounded-full bg-white bg-opacity-10 flex items-center justify-center hover:bg-opacity-20 transition-all duration-300">
|
| 375 |
+
<i class="fab fa-linkedin-in"></i>
|
| 376 |
+
</a>
|
| 377 |
+
</div>
|
| 378 |
+
</div>
|
| 379 |
+
|
| 380 |
+
<div class="grid grid-cols-2 md:grid-cols-3 gap-8 md:w-2/3">
|
| 381 |
+
<div>
|
| 382 |
+
<h4 class="text-lg font-semibold mb-6 relative inline-block">
|
| 383 |
+
關於我
|
| 384 |
+
<span class="absolute bottom-0 left-0 w-10 h-0.5 bg-accent"></span>
|
| 385 |
+
</h4>
|
| 386 |
+
<ul class="space-y-3">
|
| 387 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 388 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 個人簡介
|
| 389 |
+
</a></li>
|
| 390 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 391 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 創作理念
|
| 392 |
+
</a></li>
|
| 393 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 394 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 聯絡方式
|
| 395 |
+
</a></li>
|
| 396 |
+
</ul>
|
| 397 |
+
</div>
|
| 398 |
+
<div>
|
| 399 |
+
<h4 class="text-lg font-semibold mb-6 relative inline-block">
|
| 400 |
+
文章分類
|
| 401 |
+
<span class="absolute bottom-0 left-0 w-10 h-0.5 bg-accent"></span>
|
| 402 |
+
</h4>
|
| 403 |
+
<ul class="space-y-3">
|
| 404 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 405 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 技術分享
|
| 406 |
+
</a></li>
|
| 407 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 408 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 生活點滴
|
| 409 |
+
</a></li>
|
| 410 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 411 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 閱讀筆記
|
| 412 |
+
</a></li>
|
| 413 |
+
</ul>
|
| 414 |
+
</div>
|
| 415 |
+
<div>
|
| 416 |
+
<h4 class="text-lg font-semibold mb-6 relative inline-block">
|
| 417 |
+
快速連結
|
| 418 |
+
<span class="absolute bottom-0 left-0 w-10 h-0.5 bg-accent"></span>
|
| 419 |
+
</h4>
|
| 420 |
+
<ul class="space-y-3">
|
| 421 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 422 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 首頁
|
| 423 |
+
</a></li>
|
| 424 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 425 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 最新文章
|
| 426 |
+
</a></li>
|
| 427 |
+
<li><a href="#" class="text-gray-300 hover:text-white transition-colors duration-300 flex items-start">
|
| 428 |
+
<i class="fas fa-chevron-right text-xs mt-1 mr-2 text-accent"></i> 熱門文章
|
| 429 |
+
</a></li>
|
| 430 |
+
</ul>
|
| 431 |
+
</div>
|
| 432 |
+
</div>
|
| 433 |
+
</div>
|
| 434 |
+
|
| 435 |
+
<div class="border-t border-gray-700 border-opacity-30 pt-8">
|
| 436 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 437 |
+
<p class="text-gray-400 mb-4 md:mb-0">© 2023 hoansu. 保留所有權利.</p>
|
| 438 |
+
<div class="flex space-x-6">
|
| 439 |
+
<a href="#" class="text-gray-400 hover:text-white transition-colors duration-300">隱私權政策</a>
|
| 440 |
+
<a href="#" class="text-gray-400 hover:text-white transition-colors duration-300">服務條款</a>
|
| 441 |
+
<a href="#" class="text-gray-400 hover:text-white transition-colors duration-300">聯絡我們</a>
|
| 442 |
+
</div>
|
| 443 |
+
</div>
|
| 444 |
+
</div>
|
| 445 |
+
</div>
|
| 446 |
+
</footer>
|
| 447 |
+
|
| 448 |
+
<script>
|
| 449 |
+
// 用戶狀態管理
|
| 450 |
+
let currentUser = null;
|
| 451 |
+
|
| 452 |
+
// 文章數據
|
| 453 |
+
const articles = [
|
| 454 |
+
{
|
| 455 |
+
id: 1,
|
| 456 |
+
title: "人工智能在醫療領域的應用前景",
|
| 457 |
+
excerpt: "探討AI技術如何改善診斷準確性和治療方案,提升醫療服務效率。",
|
| 458 |
+
author: "林曉明",
|
| 459 |
+
authorAvatar: "https://randomuser.me/api/portraits/men/41.jpg",
|
| 460 |
+
date: "2023-10-18",
|
| 461 |
+
views: 1240,
|
| 462 |
+
comments: 32,
|
| 463 |
+
likes: 68,
|
| 464 |
+
category: "科技趨勢",
|
| 465 |
+
popularity: 85,
|
| 466 |
+
image: "https://images.unsplash.com/photo-1576091160550-2173dba999ef?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 467 |
+
},
|
| 468 |
+
{
|
| 469 |
+
id: 2,
|
| 470 |
+
title: "UI/UX設計中的色彩心理學",
|
| 471 |
+
excerpt: "了解色彩如何影響用戶情緒和行為,創建更有效的設計方案。",
|
| 472 |
+
author: "張雅琪",
|
| 473 |
+
authorAvatar: "https://randomuser.me/api/portraits/women/67.jpg",
|
| 474 |
+
date: "2023-10-17",
|
| 475 |
+
views: 892,
|
| 476 |
+
comments: 18,
|
| 477 |
+
likes: 42,
|
| 478 |
+
category: "設計",
|
| 479 |
+
popularity: 72,
|
| 480 |
+
image: "https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 481 |
+
},
|
| 482 |
+
{
|
| 483 |
+
id: 3,
|
| 484 |
+
title: "數位轉型對傳統企業的挑戰",
|
| 485 |
+
excerpt: "分析傳統企業在數位轉型過程中面臨的關鍵問題和解決方案。",
|
| 486 |
+
author: "王大維",
|
| 487 |
+
authorAvatar: "https://randomuser.me/api/portraits/men/52.jpg",
|
| 488 |
+
date: "2023-10-16",
|
| 489 |
+
views: 1560,
|
| 490 |
+
comments: 45,
|
| 491 |
+
likes: 89,
|
| 492 |
+
category: "商業",
|
| 493 |
+
popularity: 91,
|
| 494 |
+
image: "https://images.unsplash.com/photo-1552664730-d307ca884978?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 495 |
+
},
|
| 496 |
+
{
|
| 497 |
+
id: 4,
|
| 498 |
+
title: "遠程工作的效率提升技巧",
|
| 499 |
+
excerpt: "分享在家中辦公時保持高效生產力的實用方法和工具。",
|
| 500 |
+
author: "陳美玲",
|
| 501 |
+
authorAvatar: "https://randomuser.me/api/portraits/women/33.jpg",
|
| 502 |
+
date: "2023-10-15",
|
| 503 |
+
views: 2105,
|
| 504 |
+
comments: 67,
|
| 505 |
+
likes: 124,
|
| 506 |
+
category: "生活",
|
| 507 |
+
popularity: 95,
|
| 508 |
+
image: "https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 509 |
+
},
|
| 510 |
+
{
|
| 511 |
+
id: 5,
|
| 512 |
+
title: "區塊鏈技術的未來發展方向",
|
| 513 |
+
excerpt: "探討區塊鏈技術在金融、供應鏈等領域的潛在應用和挑戰。",
|
| 514 |
+
author: "劉志豪",
|
| 515 |
+
authorAvatar: "https://randomuser.me/api/portraits/men/63.jpg",
|
| 516 |
+
date: "2023-10-14",
|
| 517 |
+
views: 956,
|
| 518 |
+
comments: 28,
|
| 519 |
+
likes: 51,
|
| 520 |
+
category: "科技趨勢",
|
| 521 |
+
popularity: 68,
|
| 522 |
+
image: "https://images.unsplash.com/photo-1620336655052-b57986f5a26a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 523 |
+
},
|
| 524 |
+
{
|
| 525 |
+
id: 6,
|
| 526 |
+
title: "如何建立個人品牌影響力",
|
| 527 |
+
excerpt: "從內容創作到社群經營,打造個人專業形象的完整指南。",
|
| 528 |
+
author: "黃雅慧",
|
| 529 |
+
authorAvatar: "https://randomuser.me/api/portraits/women/78.jpg",
|
| 530 |
+
date: "2023-10-13",
|
| 531 |
+
views: 1780,
|
| 532 |
+
comments: 53,
|
| 533 |
+
likes: 98,
|
| 534 |
+
category: "商業",
|
| 535 |
+
popularity: 87,
|
| 536 |
+
image: "https://images.unsplash.com/photo-1551836022-d5d88e9218df?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 537 |
+
},
|
| 538 |
+
{
|
| 539 |
+
id: 7,
|
| 540 |
+
title: "2024年前端開發技術趨勢",
|
| 541 |
+
excerpt: "React、Vue、Angular等主流框架的發展方向和新特性。",
|
| 542 |
+
author: "吳建宏",
|
| 543 |
+
authorAvatar: "https://randomuser.me/api/portraits/men/84.jpg",
|
| 544 |
+
date: "2023-10-12",
|
| 545 |
+
views: 2340,
|
| 546 |
+
comments: 78,
|
| 547 |
+
likes: 156,
|
| 548 |
+
category: "科技趨勢",
|
| 549 |
+
popularity: 98,
|
| 550 |
+
image: "https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 551 |
+
},
|
| 552 |
+
{
|
| 553 |
+
id: 8,
|
| 554 |
+
title: "創業初期的資金籌措策略",
|
| 555 |
+
excerpt: "介紹天使投資、風險投資等不同資金來源的優缺點和申請要點。",
|
| 556 |
+
author: "林美娟",
|
| 557 |
+
authorAvatar: "https://randomuser.me/api/portraits/women/29.jpg",
|
| 558 |
+
date: "2023-10-11",
|
| 559 |
+
views: 1420,
|
| 560 |
+
comments: 41,
|
| 561 |
+
likes: 73,
|
| 562 |
+
category: "商業",
|
| 563 |
+
popularity: 82,
|
| 564 |
+
image: "https://images.unsplash.com/photo-1460925895917-afdab827c52f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 565 |
+
},
|
| 566 |
+
{
|
| 567 |
+
id: 9,
|
| 568 |
+
title: "心理健康與工作壓力管理",
|
| 569 |
+
excerpt: "現代職場中如何識別和應對壓力,維持身心健康。",
|
| 570 |
+
author: "張志明",
|
| 571 |
+
authorAvatar: "https://randomuser.me/api/portraits/men/12.jpg",
|
| 572 |
+
date: "2023-10-10",
|
| 573 |
+
views: 1890,
|
| 574 |
+
comments: 56,
|
| 575 |
+
likes: 102,
|
| 576 |
+
category: "生活",
|
| 577 |
+
popularity: 93,
|
| 578 |
+
image: "https://images.unsplash.com/photo-1481487196290-c152efe083f5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 579 |
+
},
|
| 580 |
+
{
|
| 581 |
+
id: 10,
|
| 582 |
+
title: "機器學習入門指南",
|
| 583 |
+
excerpt: "為初學者提供機器學習的核心概念、學習路徑和實用資源。",
|
| 584 |
+
author: "陳雅文",
|
| 585 |
+
authorAvatar: "https://randomuser.me/api/portraits/women/54.jpg",
|
| 586 |
+
date: "2023-10-09",
|
| 587 |
+
views: 3120,
|
| 588 |
+
comments: 92,
|
| 589 |
+
likes: 187,
|
| 590 |
+
category: "科技趨勢",
|
| 591 |
+
popularity: 99,
|
| 592 |
+
image: "https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=600&q=80"
|
| 593 |
+
}
|
| 594 |
+
];
|
| 595 |
+
|
| 596 |
+
// 當前排序方式
|
| 597 |
+
let currentSort = 'recent';
|
| 598 |
+
// 當前篩選的類別
|
| 599 |
+
let activeFilters = [];
|
| 600 |
+
|
| 601 |
+
// 渲染文章列表
|
| 602 |
+
function renderArticles(articlesToRender) {
|
| 603 |
+
const articleList = document.getElementById('articleList');
|
| 604 |
+
articleList.innerHTML = '';
|
| 605 |
+
|
| 606 |
+
articlesToRender.forEach(article => {
|
| 607 |
+
const articleElement = document.createElement('div');
|
| 608 |
+
articleElement.className = 'article-card bg-white rounded-xl overflow-hidden border border-gray-200 flex flex-col md:flex-row';
|
| 609 |
+
|
| 610 |
+
articleElement.innerHTML = `
|
| 611 |
+
<div class="md:w-1/3">
|
| 612 |
+
<img src="${article.image}" alt="${article.title}" class="w-full h-full object-cover">
|
| 613 |
+
</div>
|
| 614 |
+
<div class="p-6 md:w-2/3">
|
| 615 |
+
<div class="flex items-center mb-3">
|
| 616 |
+
<span class="bg-gray-100 text-gray-800 text-xs font-medium px-2.5 py-0.5 rounded mr-2">${article.category}</span>
|
| 617 |
+
${currentSort === 'popular' ?
|
| 618 |
+
`<span class="popular-badge text-white text-xs font-bold px-2 py-1 rounded mr-2">人氣 ${article.popularity}%</span>` :
|
| 619 |
+
`<span class="recent-badge text-white text-xs font-bold px-2 py-1 rounded mr-2">最新</span>`
|
| 620 |
+
}
|
| 621 |
+
<span class="text-gray-500 text-sm">${article.date}</span>
|
| 622 |
+
</div>
|
| 623 |
+
<h3 class="text-xl font-bold text-gray-800 mb-2">${article.title}</h3>
|
| 624 |
+
<p class="text-gray-600 mb-4">${article.excerpt}</p>
|
| 625 |
+
<div class="flex justify-between items-center">
|
| 626 |
+
<div class="flex items-center">
|
| 627 |
+
<img src="${article.authorAvatar}" alt="${article.author}" class="w-8 h-8 rounded-full mr-2">
|
| 628 |
+
<span class="text-gray-700">${article.author}</span>
|
| 629 |
+
</div>
|
| 630 |
+
<div class="flex space-x-4">
|
| 631 |
+
<span class="text-gray-500 flex items-center"><i class="far fa-eye mr-1"></i> ${article.views}</span>
|
| 632 |
+
<span class="text-gray-500 flex items-center"><i class="far fa-comment mr-1"></i> ${article.comments}</span>
|
| 633 |
+
<span class="text-gray-500 flex items-center"><i class="far fa-heart mr-1"></i> ${article.likes}</span>
|
| 634 |
+
</div>
|
| 635 |
+
</div>
|
| 636 |
+
</div>
|
| 637 |
+
`;
|
| 638 |
+
|
| 639 |
+
articleList.appendChild(articleElement);
|
| 640 |
+
});
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
// 排序功能
|
| 644 |
+
function sortArticles(sortBy) {
|
| 645 |
+
currentSort = sortBy;
|
| 646 |
+
|
| 647 |
+
// 更新按鈕樣式
|
| 648 |
+
document.getElementById('sortRecent').classList.toggle('active', sortBy === 'recent');
|
| 649 |
+
document.getElementById('sortPopular').classList.toggle('active', sortBy === 'popular');
|
| 650 |
+
|
| 651 |
+
let filteredArticles = [...articles];
|
| 652 |
+
|
| 653 |
+
// 應用類別篩選
|
| 654 |
+
if (activeFilters.length > 0) {
|
| 655 |
+
filteredArticles = filteredArticles.filter(article =>
|
| 656 |
+
activeFilters.includes(article.category)
|
| 657 |
+
);
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
// 應用排序
|
| 661 |
+
if (sortBy === 'recent') {
|
| 662 |
+
filteredArticles.sort((a, b) => new Date(b.date) - new Date(a.date));
|
| 663 |
+
} else if (sortBy === 'popular') {
|
| 664 |
+
filteredArticles.sort((a, b) => b.popularity - a.popularity);
|
| 665 |
+
}
|
| 666 |
+
|
| 667 |
+
renderArticles(filteredArticles);
|
| 668 |
+
}
|
| 669 |
+
|
| 670 |
+
// 更新篩選器標籤顯示
|
| 671 |
+
function updateFilterTags() {
|
| 672 |
+
const filterContainer = document.getElementById('activeFilters');
|
| 673 |
+
filterContainer.innerHTML = '';
|
| 674 |
+
|
| 675 |
+
activeFilters.forEach(category => {
|
| 676 |
+
const tag = document.createElement('span');
|
| 677 |
+
tag.className = 'bg-blue-100 text-blue-800 text-xs font-medium px-2.5 py-0.5 rounded flex items-center';
|
| 678 |
+
tag.innerHTML = `
|
| 679 |
+
${category}
|
| 680 |
+
<button class="ml-1 remove-filter" data-category="${category}">
|
| 681 |
+
<i class="fas fa-times text-xs"></i>
|
| 682 |
+
</button>
|
| 683 |
+
`;
|
| 684 |
+
filterContainer.appendChild(tag);
|
| 685 |
+
});
|
| 686 |
+
|
| 687 |
+
// 綁定移除篩選器事件
|
| 688 |
+
document.querySelectorAll('.remove-filter').forEach(button => {
|
| 689 |
+
button.addEventListener('click', function() {
|
| 690 |
+
const category = this.getAttribute('data-category');
|
| 691 |
+
removeFilter(category);
|
| 692 |
+
});
|
| 693 |
+
});
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
// 添加篩選器
|
| 697 |
+
function addFilter(category) {
|
| 698 |
+
if (!activeFilters.includes(category)) {
|
| 699 |
+
activeFilters.push(category);
|
| 700 |
+
updateFilterTags();
|
| 701 |
+
sortArticles(currentSort);
|
| 702 |
+
}
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
// 移除篩選器
|
| 706 |
+
function removeFilter(category) {
|
| 707 |
+
activeFilters = activeFilters.filter(filter => filter !== category);
|
| 708 |
+
updateFilterTags();
|
| 709 |
+
sortArticles(currentSort);
|
| 710 |
+
}
|
| 711 |
+
|
| 712 |
+
// 初始化頁面
|
| 713 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 714 |
+
// 渲染初始文章列表(按時間排序)
|
| 715 |
+
sortArticles('recent');
|
| 716 |
+
|
| 717 |
+
// 綁定排序按鈕事件
|
| 718 |
+
document.getElementById('sortRecent').addEventListener('click', () => sortArticles('recent'));
|
| 719 |
+
document.getElementById('sortPopular').addEventListener('click', () => sortArticles('popular'));
|
| 720 |
+
|
| 721 |
+
// 綁定類別點擊事件
|
| 722 |
+
document.querySelectorAll('.category-link').forEach(link => {
|
| 723 |
+
link.addEventListener('click', function(e) {
|
| 724 |
+
e.preventDefault();
|
| 725 |
+
const category = this.getAttribute('data-category');
|
| 726 |
+
addFilter(category);
|
| 727 |
+
});
|
| 728 |
+
});
|
| 729 |
+
|
| 730 |
+
// 登入/登出按鈕事件
|
| 731 |
+
const authBtn = document.getElementById('authBtn');
|
| 732 |
+
const loginModal = document.getElementById('loginModal');
|
| 733 |
+
const closeLoginModal = document.getElementById('closeLoginModal');
|
| 734 |
+
const loginForm = document.getElementById('loginForm');
|
| 735 |
+
const postArticleBtn = document.getElementById('postArticleBtn');
|
| 736 |
+
|
| 737 |
+
authBtn.addEventListener('click', function() {
|
| 738 |
+
if (currentUser) {
|
| 739 |
+
// 登出
|
| 740 |
+
currentUser = null;
|
| 741 |
+
authBtn.innerHTML = '<i class="fas fa-user mr-2"></i> 登入';
|
| 742 |
+
postArticleBtn.disabled = true;
|
| 743 |
+
postArticleBtn.classList.add('opacity-50', 'cursor-not-allowed');
|
| 744 |
+
alert('您已成功登出');
|
| 745 |
+
} else {
|
| 746 |
+
// 顯示登入表單
|
| 747 |
+
loginModal.classList.remove('hidden');
|
| 748 |
+
}
|
| 749 |
+
});
|
| 750 |
+
|
| 751 |
+
closeLoginModal.addEventListener('click', function() {
|
| 752 |
+
loginModal.classList.add('hidden');
|
| 753 |
+
});
|
| 754 |
+
|
| 755 |
+
loginForm.addEventListener('submit', function(e) {
|
| 756 |
+
e.preventDefault();
|
| 757 |
+
const username = document.getElementById('username').value;
|
| 758 |
+
const password = document.getElementById('password').value;
|
| 759 |
+
|
| 760 |
+
// 簡單驗證(實際應用中應與伺服器驗證)
|
| 761 |
+
if (username && password) {
|
| 762 |
+
currentUser = { username: username };
|
| 763 |
+
authBtn.innerHTML = `<i class="fas fa-user mr-2"></i> ${username} (登出)`;
|
| 764 |
+
postArticleBtn.disabled = false;
|
| 765 |
+
postArticleBtn.classList.remove('opacity-50', 'cursor-not-allowed');
|
| 766 |
+
loginModal.classList.add('hidden');
|
| 767 |
+
alert('登入成功!');
|
| 768 |
+
} else {
|
| 769 |
+
alert('請輸入帳號和密碼');
|
| 770 |
+
}
|
| 771 |
+
});
|
| 772 |
+
|
| 773 |
+
// 發表文章按鈕事件
|
| 774 |
+
postArticleBtn.addEventListener('click', function() {
|
| 775 |
+
if (!currentUser) {
|
| 776 |
+
alert('請先登入以發表文章');
|
| 777 |
+
loginModal.classList.remove('hidden');
|
| 778 |
+
return;
|
| 779 |
+
}
|
| 780 |
+
alert('發表文章功能已啟用!');
|
| 781 |
+
// 這裡可以添加發表文章的邏輯
|
| 782 |
+
});
|
| 783 |
+
|
| 784 |
+
// 初始化按鈕狀態
|
| 785 |
+
postArticleBtn.disabled = true;
|
| 786 |
+
postArticleBtn.classList.add('opacity-50', 'cursor-not-allowed');
|
| 787 |
+
});
|
| 788 |
+
</script>
|
| 789 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=suanan/self-site" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 790 |
+
</html>
|