-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathblog.html
More file actions
541 lines (477 loc) · 19.8 KB
/
blog.html
File metadata and controls
541 lines (477 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Blog - Trần Hữu Đạt | Digital Garden</title>
<link rel="icon" type="image/png" href="assets/favicon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/components/base.css" />
<link rel="stylesheet" href="css/components/header.css" />
<link rel="stylesheet" href="css/components/footer.css" />
<link rel="stylesheet" href="css/components/theme.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<style>
/* 1. Hero Section & Search */
/* Tìm đoạn này trong thẻ <style> của blog.html */
.blog-hero {
text-align: center;
padding: 80px 20px 50px;
/* --- SỬA DÒNG NÀY --- */
/* Cũ: background: linear-gradient(...) -> Xóa đi */
/* Mới: Dùng biến màu nền Card (tự động tối khi Dark Mode) */
background: var(--bg-card);
border: 1px solid var(--border-color);
/* Thêm viền mỏng cho nét */
border-top: none;
/* Bỏ viền trên để liền mạch với Header */
/* -------------------- */
margin-bottom: 40px;
border-radius: 0 0 30px 30px;
}
.blog-hero h1 {
font-size: 2.8rem;
margin-bottom: 15px;
background: linear-gradient(90deg, #6c5ce7, #a29bfe);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 800;
}
.blog-hero p {
max-width: 600px;
margin: 0 auto 35px;
color: var(--text-secondary, #666);
font-size: 1.1rem;
line-height: 1.6;
}
.blog-controls {
max-width: 800px;
margin: 0 auto;
display: flex;
flex-direction: column;
gap: 25px;
align-items: center;
}
/* 2. Thanh Tìm Kiếm */
.search-box {
position: relative;
width: 100%;
max-width: 500px;
}
.search-box input {
width: 100%;
padding: 15px 25px;
padding-right: 50px;
border-radius: 50px;
border: 2px solid var(--border-color, #eee);
background: var(--bg-card, #fff);
color: var(--text-primary, #333);
font-family: 'Sora', sans-serif;
font-size: 1rem;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.search-box input:focus {
outline: none;
border-color: var(--primary-color, #6c5ce7);
box-shadow: 0 4px 20px rgba(108, 92, 231, 0.15);
}
.search-box i {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
color: var(--text-secondary, #999);
font-size: 1.2rem;
}
/* 3. Bộ lọc Tags */
.filter-tags {
display: flex;
flex-wrap: wrap;
gap: 12px;
justify-content: center;
}
.filter-btn {
padding: 8px 20px;
border-radius: 25px;
border: 1px solid var(--border-color, #eee);
background: var(--bg-card, #fff);
color: var(--text-secondary, #666);
cursor: pointer;
transition: all 0.3s ease;
font-size: 0.95rem;
font-weight: 500;
font-family: 'Sora', sans-serif;
}
.filter-btn:hover {
transform: translateY(-2px);
border-color: var(--primary-color, #6c5ce7);
color: var(--primary-color, #6c5ce7);
}
.filter-btn.active {
background: var(--primary-color, #6c5ce7);
color: #fff;
border-color: var(--primary-color, #6c5ce7);
box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}
/* 4. Grid Layout */
.posts-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
gap: 40px;
padding-bottom: 80px;
}
.post-card {
background: var(--bg-card, #fff);
border-radius: 20px;
overflow: hidden;
border: 1px solid var(--border-color, #eee);
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
height: 100%;
text-decoration: none;
/* Removed underline */
color: inherit;
/* Inherit text color */
}
.post-card:hover {
transform: translateY(-8px);
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
border-color: transparent;
}
.card-image {
height: 220px;
background-color: #f0f0f0;
overflow: hidden;
position: relative;
}
.card-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.6s ease;
}
.post-card:hover .card-image img {
transform: scale(1.08);
}
.post-card-content {
padding: 25px;
display: flex;
flex-direction: column;
flex-grow: 1;
}
.post-meta-mini {
font-size: 0.85rem;
color: var(--text-secondary, #777);
margin-bottom: 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
.post-meta-mini i {
margin-right: 5px;
}
.post-tags {
margin-bottom: 12px;
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.tag {
font-size: 0.75rem;
padding: 4px 10px;
background: rgba(108, 92, 231, 0.1);
color: var(--primary-color, #6c5ce7);
border-radius: 6px;
font-weight: 600;
}
.post-card-title {
font-size: 1.35rem;
margin-bottom: 12px;
color: var(--text-primary, #333);
line-height: 1.4;
font-weight: 700;
}
.post-card-title a {
text-decoration: none;
color: inherit;
transition: color 0.2s;
}
*/ .post-card:hover .post-card-title {
color: var(--primary-color, #6c5ce7);
}
.post-card-excerpt {
font-size: 0.95rem;
color: var(--text-secondary, #666);
margin-bottom: 25px;
line-height: 1.6;
flex-grow: 1;
}
.card-footer {
margin-top: auto;
border-top: 1px solid var(--border-color, #eee);
padding-top: 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.read-more-link {
color: var(--primary-color, #6c5ce7);
font-weight: 700;
text-decoration: none;
font-size: 0.95rem;
display: inline-flex;
align-items: center;
gap: 5px;
transition: gap 0.3s;
}
.post-card:hover .read-more-link {
gap: 10px;
}
/* Animation cho việc lọc */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Mobile Responsive */
@media (max-width: 768px) {
.blog-hero h1 {
font-size: 2rem;
}
.posts-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="scroll-progress-bar"></div>
<header class="main-header">
<a class="logo" href="index.html"><span>tranhuudat</span>2004</a>
<div class="header-navigation">
<nav class="main-nav">
<a href="index.html#hero">Home</a>
<a href="index.html#about">About</a>
<a href="index.html#skills">Skills</a>
<a href="project.html">Projects</a>
<a href="index.html#experience">Experience</a>
<a href="blog.html" class="is-active">Blog</a>
<a href="index.html#contact">Contact</a>
</nav>
<a href="download-resume.html" class="resume-button">Resume</a>
<button id="theme-toggle" class="theme-toggle-btn">
<i class="fas fa-sun"></i>
<i class="fas fa-moon"></i>
</button>
</div>
</header>
<main class="container">
<section class="blog-hero">
<h1>My Digital Garden</h1>
<p>Nơi mình chia sẻ kiến thức, ghi chú và những điều hay ho học được trong hành trình làm lập trình viên.
</p>
<div class="blog-controls">
<div class="search-box">
<input type="text" id="searchInput" placeholder="Tìm kiếm bài viết (VD: Unity, Web)...">
<i class="fas fa-search"></i>
</div>
<div class="filter-tags">
<button class="filter-btn active" data-filter="all">All</button>
<button class="filter-btn" data-filter="unity">Unity</button>
<button class="filter-btn" data-filter="web">Web Dev</button>
<button class="filter-btn" data-filter="tutorial">Tutorial</button>
<button class="filter-btn" data-filter="life">Life</button>
</div>
</div>
</section>
<section class="posts-grid">
<a href="blog/post-mixamo-unity.html" class="post-card" data-tags="unity 3d tutorial game dev">
<div class="card-image">
<img src="assets/mixamo.png" alt="Thumbnail Mixamo Unity">
</div>
<div class="post-card-content">
<div class="post-meta-mini">
<span><i class="far fa-calendar"></i> 14/10/2025</span>
<span><i class="far fa-clock"></i> 5 min read</span>
</div>
<div class="post-tags">
<span class="tag">Unity</span>
<span class="tag">3D</span>
<span class="tag">Tutorial</span>
</div>
<h2 class="post-card-title">
Hướng Dẫn: Tải Model & Animation Từ Mixamo Cho Unity (Chuẩn 2025)
</h2>
<p class="post-card-excerpt">
Quy trình chuẩn để tải và import nhân vật 3D từ Mixamo vào Unity, tối ưu hóa animation và sửa
lỗi texture thường gặp.
</p>
<div class="card-footer">
<span class="read-more-link">Đọc tiếp <i class="fas fa-arrow-right"></i></span>
</div>
</div>
</a>
<a href="#" class="post-card" data-tags="unity github web tutorial">
<div class="card-image">
<img src="assets/unity-githubpage.png" alt="Thumbnail GitHub Pages">
</div>
<div class="post-card-content">
<div class="post-meta-mini">
<span><i class="far fa-calendar"></i> 15/10/2025</span>
<span><i class="far fa-clock"></i> 8 min read</span>
</div>
<div class="post-tags">
<span class="tag">Unity</span>
<span class="tag">GitHub</span>
<span class="tag">Web</span>
</div>
<h2 class="post-card-title">
Deploy Game Unity WebGL lên GitHub Pages và Fix lỗi nén
</h2>
<p class="post-card-excerpt">
Hướng dẫn chi tiết cách đưa game Unity của bạn lên web miễn phí, xử lý triệt để lỗi nén
Brotli/Gzip.
</p>
<div class="card-footer">
<span class="read-more-link">Đọc tiếp <i class="fas fa-arrow-right"></i></span>
</div>
</div>
</a>
<a href="#" class="post-card" data-tags="web design life">
<div class="card-image">
<img src="assets/placeholder-600x400.png" alt="Thumbnail Portfolio">
</div>
<div class="post-card-content">
<div class="post-meta-mini">
<span><i class="far fa-calendar"></i> 01/10/2025</span>
<span><i class="far fa-clock"></i> 3 min read</span>
</div>
<div class="post-tags">
<span class="tag">Web</span>
<span class="tag">Life</span>
</div>
<h2 class="post-card-title">
Hành trình xây dựng Portfolio cá nhân của mình
</h2>
<p class="post-card-excerpt">
Chia sẻ về quá trình lên ý tưởng, thiết kế và code trang web portfolio này từ con số 0.
</p>
<div class="card-footer">
<span class="read-more-link">Đọc tiếp <i class="fas fa-arrow-right"></i></span>
</div>
</div>
</a>
<div id="no-results"
style="display: none; text-align: center; width: 100%; grid-column: 1 / -1; padding: 40px;">
<i class="fas fa-search" style="font-size: 3rem; color: #ddd; margin-bottom: 20px;"></i>
<p style="color: var(--text-secondary); font-size: 1.2rem;">Không tìm thấy bài viết nào phù hợp với từ
khóa này.</p>
<button onclick="resetFilter()"
style="margin-top: 15px; padding: 10px 20px; border: 1px solid var(--primary-color); background: transparent; color: var(--primary-color); border-radius: 20px; cursor: pointer;">Xóa
bộ lọc</button>
</div>
</section>
</main>
<footer class="main-footer">
<div class="container footer-container">
<div class="footer-column footer-about">
<h3 class="footer-logo"><span>tranhuudat</span>2004</h3>
<p>A passionate Web Developer dedicated to building beautiful and useful applications.</p>
</div>
<div class="footer-column footer-links">
<h4 class="footer-title">Quick Links</h4>
<ul>
<li><a href="index.html#hero">Home</a></li>
<li><a href="assets/resume.pdf" download>Resume</a></li>
<li><a href="project.html">Projects</a></li>
<li><a href="index.html#contact">Contact</a></li>
</ul>
</div>
<div class="footer-column footer-connect">
<h4 class="footer-title">Connect with Me</h4>
<ul>
<li><a href="https://github.com/TranHuuDat2004" target="_blank"><i class="fab fa-github"></i>
GitHub</a></li>
<li><a href="https://linkedin.com/in/tranhuudat2004" target="_blank"><i
class="fab fa-linkedin-in"></i> LinkedIn</a></li>
<li><a href="mailto:tranhuudat.cv@gmail.com"><i class="fas fa-envelope"></i> Email</a></li>
</ul>
</div>
</div>
<div class="footer-copyright">
<div class="container">
<p>Copyright © <span id="currentYear"></span> Trần Hữu Đạt. All rights reserved.</p>
</div>
</div>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function () {
const searchInput = document.getElementById('searchInput');
const filterBtns = document.querySelectorAll('.filter-btn');
const postCards = document.querySelectorAll('.post-card');
const noResultsMsg = document.getElementById('no-results');
// Cập nhật năm footer
document.getElementById('currentYear').textContent = new Date().getFullYear();
// Hàm lọc chính
function filterPosts() {
const searchTerm = searchInput.value.toLowerCase().trim();
const activeBtn = document.querySelector('.filter-btn.active');
const activeTag = activeBtn ? activeBtn.getAttribute('data-filter') : 'all';
let visibleCount = 0;
postCards.forEach(card => {
// Lấy dữ liệu bài viết
const title = card.querySelector('.post-card-title').innerText.toLowerCase();
const tags = card.getAttribute('data-tags').toLowerCase();
const desc = card.querySelector('.post-card-excerpt').innerText.toLowerCase();
// Điều kiện tìm kiếm (Có trong Tiêu đề OR Tags OR Mô tả)
const matchesSearch = title.includes(searchTerm) || tags.includes(searchTerm) || desc.includes(searchTerm);
// Điều kiện Tag (Nếu All thì luôn đúng, ngược lại phải chứa tag)
const matchesTag = activeTag === 'all' || tags.includes(activeTag);
if (matchesSearch && matchesTag) {
card.style.display = 'flex';
card.style.animation = 'fadeIn 0.5s ease';
visibleCount++;
} else {
card.style.display = 'none';
}
});
// Ẩn hiện thông báo
if (visibleCount === 0) {
noResultsMsg.style.display = 'block';
} else {
noResultsMsg.style.display = 'none';
}
}
// Sự kiện gõ phím
searchInput.addEventListener('input', filterPosts);
// Sự kiện bấm nút Tag
filterBtns.forEach(btn => {
btn.addEventListener('click', () => {
// Xóa class active cũ
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
// Thêm class active mới
btn.classList.add('active');
filterPosts();
});
});
// Hàm reset (cho nút Xóa bộ lọc)
window.resetFilter = function () {
searchInput.value = '';
document.querySelector('.filter-btn[data-filter="all"]').click();
}
});
</script>
</body>
<!-- === TẢI CÁC SECTION CHUNG === -->
<script src="js/blog-script.js"></script>
<script src="js/load-components.js"></script>
</html>