568 lines
20 KiB
HTML
568 lines
20 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="vi">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Tin tức & Chuyên môn - Worker App</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.0/css/all.min.css">
|
|
<style>
|
|
:root {
|
|
--primary-color: #2563eb;
|
|
--primary-dark: #1d4ed8;
|
|
--secondary-color: #64748b;
|
|
--success-color: #10b981;
|
|
--warning-color: #f59e0b;
|
|
--danger-color: #ef4444;
|
|
--background-color: #f8fafc;
|
|
--card-background: #ffffff;
|
|
--text-primary: #1e293b;
|
|
--text-secondary: #64748b;
|
|
--border-color: #e2e8f0;
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background-color: var(--background-color);
|
|
color: var(--text-primary);
|
|
line-height: 1.6;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
.header {
|
|
background: var(--card-background);
|
|
border-bottom: 1px solid var(--border-color);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.header-content {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 1rem;
|
|
max-width: 480px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.back-button {
|
|
background: none;
|
|
border: none;
|
|
color: var(--primary-color);
|
|
font-size: 1.25rem;
|
|
cursor: pointer;
|
|
padding: 0.5rem;
|
|
border-radius: 0.5rem;
|
|
transition: background-color 0.2s;
|
|
}
|
|
|
|
.back-button:hover {
|
|
background-color: #f1f5f9;
|
|
}
|
|
|
|
.header-title {
|
|
font-size: 1.125rem;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.search-button {
|
|
background: none;
|
|
border: none;
|
|
color: var(--secondary-color);
|
|
font-size: 1.25rem;
|
|
cursor: pointer;
|
|
padding: 0.5rem;
|
|
border-radius: 0.5rem;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.search-button:hover {
|
|
background-color: #f1f5f9;
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
.container {
|
|
max-width: 480px;
|
|
margin: 0 auto;
|
|
background: var(--card-background);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.content {
|
|
padding: 1rem;
|
|
padding-bottom: 100px;
|
|
}
|
|
|
|
.categories-section {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
|
|
.categories-tabs {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
overflow-x: auto;
|
|
padding-bottom: 0.5rem;
|
|
-webkit-overflow-scrolling: touch;
|
|
}
|
|
|
|
.category-tab {
|
|
flex-shrink: 0;
|
|
padding: 0.5rem 1rem;
|
|
background: #f1f5f9;
|
|
color: var(--text-secondary);
|
|
border: none;
|
|
border-radius: 1.5rem;
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.category-tab.active {
|
|
background: var(--primary-color);
|
|
color: white;
|
|
}
|
|
|
|
.category-tab:hover:not(.active) {
|
|
background: #e2e8f0;
|
|
}
|
|
|
|
.featured-section {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 1.125rem;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
margin-bottom: 1rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.featured-card {
|
|
background: var(--card-background);
|
|
border-radius: 1rem;
|
|
overflow: hidden;
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
border: 1px solid var(--border-color);
|
|
margin-bottom: 1rem;
|
|
transition: all 0.3s ease;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.featured-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
|
|
}
|
|
|
|
.featured-image {
|
|
width: 100%;
|
|
height: 200px;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.featured-content {
|
|
padding: 1.25rem;
|
|
}
|
|
|
|
.featured-title {
|
|
font-size: 1.125rem;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
margin-bottom: 0.75rem;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.featured-desc {
|
|
font-size: 0.875rem;
|
|
color: var(--text-secondary);
|
|
line-height: 1.5;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.featured-meta {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 0.75rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.meta-left {
|
|
display: flex;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.meta-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.category-badge {
|
|
background: var(--primary-color);
|
|
color: white;
|
|
padding: 0.25rem 0.75rem;
|
|
border-radius: 1rem;
|
|
font-size: 0.75rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.news-list-section {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.news-card {
|
|
background: var(--card-background);
|
|
border-radius: 0.75rem;
|
|
padding: 1rem;
|
|
margin-bottom: 1rem;
|
|
border: 1px solid var(--border-color);
|
|
transition: all 0.2s ease;
|
|
cursor: pointer;
|
|
display: flex;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.news-card:hover {
|
|
border-color: var(--primary-color);
|
|
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
|
|
}
|
|
|
|
.news-thumbnail {
|
|
width: 80px;
|
|
height: 80px;
|
|
border-radius: 0.5rem;
|
|
object-fit: cover;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.news-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.news-title {
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
color: var(--text-primary);
|
|
margin-bottom: 0.5rem;
|
|
line-height: 1.3;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.news-excerpt {
|
|
font-size: 0.75rem;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 0.5rem;
|
|
line-height: 1.4;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.news-meta {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
font-size: 0.75rem;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.load-more {
|
|
text-align: center;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.load-more-button {
|
|
background: var(--card-background);
|
|
color: var(--primary-color);
|
|
border: 2px solid var(--primary-color);
|
|
padding: 0.75rem 2rem;
|
|
border-radius: 0.75rem;
|
|
font-size: 0.875rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.load-more-button:hover {
|
|
background: var(--primary-color);
|
|
color: white;
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
.content {
|
|
padding: 0.75rem;
|
|
padding-bottom: 100px;
|
|
}
|
|
|
|
.news-card {
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.news-thumbnail {
|
|
width: 100%;
|
|
height: 120px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<!-- Header -->
|
|
<header class="header">
|
|
<div class="header-content">
|
|
<button class="back-button" onclick="goBack()">
|
|
<i class="fas fa-arrow-left"></i>
|
|
</button>
|
|
<h1 class="header-title">Tin tức & Chuyên môn</h1>
|
|
<button class="search-button" onclick="toggleSearch()">
|
|
<i class="fas fa-search"></i>
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Content -->
|
|
<div class="content">
|
|
<!-- Categories -->
|
|
<div class="categories-section">
|
|
<div class="categories-tabs">
|
|
<button class="category-tab active" onclick="filterCategory('all')">Tất cả</button>
|
|
<button class="category-tab" onclick="filterCategory('trends')">Xu hướng</button>
|
|
<button class="category-tab" onclick="filterCategory('technique')">Kỹ thuật</button>
|
|
<button class="category-tab" onclick="filterCategory('pricing')">Bảng giá</button>
|
|
<button class="category-tab" onclick="filterCategory('projects')">Dự án</button>
|
|
<button class="category-tab" onclick="filterCategory('tips')">Mẹo hay</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Featured Article -->
|
|
<div class="featured-section">
|
|
<h2 class="section-title">
|
|
<i class="fas fa-star"></i>
|
|
Nổi bật
|
|
</h2>
|
|
|
|
<div class="featured-card" onclick="openNews('featured-1')">
|
|
<img src="https://images.unsplash.com/photo-1503387762-592deb58ef4e?w=400&h=200&fit=crop"
|
|
alt="Bài viết nổi bật"
|
|
class="featured-image">
|
|
<div class="featured-content">
|
|
<h3 class="featured-title">5 xu hướng gạch men phòng tắm được ưa chuộng năm 2024</h3>
|
|
<p class="featured-desc">
|
|
Khám phá những mẫu gạch men hiện đại, sang trọng cho không gian phòng tắm.
|
|
Từ những tone màu trung tính đến các họa tiết độc đáo, cùng tìm hiểu các xu hướng đang được yêu thích nhất.
|
|
</p>
|
|
<div class="featured-meta">
|
|
<div class="meta-left">
|
|
<div class="meta-item">
|
|
<i class="fas fa-calendar"></i>
|
|
<span>15/11/2024</span>
|
|
</div>
|
|
<div class="meta-item">
|
|
<i class="fas fa-eye"></i>
|
|
<span>2.3K lượt xem</span>
|
|
</div>
|
|
<div class="meta-item">
|
|
<i class="fas fa-clock"></i>
|
|
<span>5 phút đọc</span>
|
|
</div>
|
|
</div>
|
|
<span class="category-badge">Xu hướng</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- News List -->
|
|
<div class="news-list-section">
|
|
<h2 class="section-title">
|
|
<i class="fas fa-newspaper"></i>
|
|
Mới nhất
|
|
</h2>
|
|
|
|
<div class="news-card" onclick="openNews('news-1')">
|
|
<img src="https://images.unsplash.com/photo-1586023492125-27b2c045efd7?w=80&h=80&fit=crop"
|
|
alt="Tin tức"
|
|
class="news-thumbnail">
|
|
<div class="news-info">
|
|
<h3 class="news-title">Hướng dẫn thi công gạch granite 60x60 chuyên nghiệp</h3>
|
|
<p class="news-excerpt">Quy trình thi công chi tiết từ A-Z cho thầy thợ xây dựng. Các bước chuẩn bị, kỹ thuật thi công và kinh nghiệm thực tế.</p>
|
|
<div class="news-meta">
|
|
<span><i class="fas fa-calendar"></i> 12/11/2024</span>
|
|
<span><i class="fas fa-eye"></i> 1.8K lượt xem</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="news-card" onclick="openNews('news-2')">
|
|
<img src="https://images.unsplash.com/photo-1560448204-e02f11c3d0e2?w=80&h=80&fit=crop"
|
|
alt="Tin tức"
|
|
class="news-thumbnail">
|
|
<div class="news-info">
|
|
<h3 class="news-title">Bảng giá gạch men cao cấp mới nhất tháng 11/2024</h3>
|
|
<p class="news-excerpt">Cập nhật bảng giá chi tiết các dòng sản phẩm gạch men nhập khẩu. So sánh giá các thương hiệu hàng đầu.</p>
|
|
<div class="news-meta">
|
|
<span><i class="fas fa-calendar"></i> 10/11/2024</span>
|
|
<span><i class="fas fa-eye"></i> 3.1K lượt xem</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="news-card" onclick="openNews('news-3')">
|
|
<img src="https://images.unsplash.com/photo-1545558014-8692077e9b5c?w=80&h=80&fit=crop"
|
|
alt="Tin tức"
|
|
class="news-thumbnail">
|
|
<div class="news-info">
|
|
<h3 class="news-title">Mẹo chọn gạch ốp tường phòng bếp đẹp và bền</h3>
|
|
<p class="news-excerpt">Những lưu ý quan trọng khi chọn gạch ốp tường cho khu vực bếp. Tư vấn về chất liệu, màu sắc và kích thước phù hợp.</p>
|
|
<div class="news-meta">
|
|
<span><i class="fas fa-calendar"></i> 08/11/2024</span>
|
|
<span><i class="fas fa-eye"></i> 1.5K lượt xem</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="news-card" onclick="openNews('news-4')">
|
|
<img src="https://images.unsplash.com/photo-1484101403633-562f891dc89a?w=80&h=80&fit=crop"
|
|
alt="Tin tức"
|
|
class="news-thumbnail">
|
|
<div class="news-info">
|
|
<h3 class="news-title">Dự án biệt thự Quận 2: Ứng dụng gạch men cao cấp</h3>
|
|
<p class="news-excerpt">Case study về việc sử dụng gạch men trong dự án biệt thự 300m². Chia sẻ kinh nghiệm và bài học từ thầu thợ.</p>
|
|
<div class="news-meta">
|
|
<span><i class="fas fa-calendar"></i> 05/11/2024</span>
|
|
<span><i class="fas fa-eye"></i> 2.7K lượt xem</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="news-card" onclick="openNews('news-5')">
|
|
<img src="https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=80&h=80&fit=crop"
|
|
alt="Tin tức"
|
|
class="news-thumbnail">
|
|
<div class="news-info">
|
|
<h3 class="news-title">Công cụ hỗ trợ tính toán diện tích gạch chính xác</h3>
|
|
<p class="news-excerpt">Hướng dẫn sử dụng các công cụ và ứng dụng giúp tính toán diện tích gạch cần thiết cho công trình một cách chính xác nhất.</p>
|
|
<div class="news-meta">
|
|
<span><i class="fas fa-calendar"></i> 03/11/2024</span>
|
|
<span><i class="fas fa-eye"></i> 1.2K lượt xem</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Load More -->
|
|
<div class="load-more">
|
|
<button class="load-more-button" onclick="loadMoreNews()">
|
|
<i class="fas fa-plus"></i>
|
|
Xem thêm tin tức
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function goBack() {
|
|
window.history.back();
|
|
}
|
|
|
|
function toggleSearch() {
|
|
// Implement search functionality
|
|
alert('Tính năng tìm kiếm đang được phát triển');
|
|
}
|
|
|
|
function filterCategory(category) {
|
|
// Update active tab
|
|
document.querySelectorAll('.category-tab').forEach(tab => {
|
|
tab.classList.remove('active');
|
|
});
|
|
event.target.classList.add('active');
|
|
|
|
// Filter news based on category (demo implementation)
|
|
console.log('Filtering by category:', category);
|
|
|
|
// In a real app, this would filter the news list
|
|
showToast(`Đã lọc theo danh mục: ${getCategoryName(category)}`);
|
|
}
|
|
|
|
function getCategoryName(category) {
|
|
const names = {
|
|
'all': 'Tất cả',
|
|
'trends': 'Xu hướng',
|
|
'technique': 'Kỹ thuật',
|
|
'pricing': 'Bảng giá',
|
|
'projects': 'Dự án',
|
|
'tips': 'Mẹo hay'
|
|
};
|
|
return names[category] || 'Tất cả';
|
|
}
|
|
|
|
function openNews(newsId) {
|
|
// Navigate to news detail page
|
|
window.location.href = `news-detail.html?id=${newsId}`;
|
|
}
|
|
|
|
function loadMoreNews() {
|
|
// Simulate loading more news
|
|
const button = event.target;
|
|
const originalText = button.innerHTML;
|
|
|
|
button.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Đang tải...';
|
|
button.disabled = true;
|
|
|
|
setTimeout(() => {
|
|
button.innerHTML = originalText;
|
|
button.disabled = false;
|
|
showToast('Đã tải thêm 5 tin tức mới');
|
|
}, 1500);
|
|
}
|
|
|
|
function showToast(message) {
|
|
const toast = document.createElement('div');
|
|
toast.className = 'fixed top-20 left-1/2 transform -translate-x-1/2 bg-green-500 text-white px-4 py-2 rounded-lg z-50 transition-all duration-300';
|
|
toast.textContent = message;
|
|
document.body.appendChild(toast);
|
|
|
|
setTimeout(() => {
|
|
toast.style.opacity = '0';
|
|
setTimeout(() => {
|
|
document.body.removeChild(toast);
|
|
}, 300);
|
|
}, 2000);
|
|
}
|
|
|
|
// Animation on load
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const cards = document.querySelectorAll('.news-card, .featured-card');
|
|
cards.forEach((card, index) => {
|
|
card.style.opacity = '0';
|
|
card.style.transform = 'translateY(20px)';
|
|
card.style.transition = 'all 0.5s ease';
|
|
|
|
setTimeout(() => {
|
|
card.style.opacity = '1';
|
|
card.style.transform = 'translateY(0)';
|
|
}, index * 100);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |