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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="vi">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Cửa Hàng Pháp Duyên - Vật Phẩm Tâm Linh</title>
|
| 7 |
+
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
|
| 10 |
+
<script>
|
| 11 |
+
tailwind.config = {
|
| 12 |
+
theme: {
|
| 13 |
+
extend: {
|
| 14 |
+
colors: {
|
| 15 |
+
'phap-duyen-vang': '#F59E0B', // Vàng saffron
|
| 16 |
+
'phap-duyen-nau': '#5B4B49', // Nâu đất đậm
|
| 17 |
+
'phap-duyen-nen': '#FEFDFB', // Kem/Nền trắng ngà
|
| 18 |
+
'facebook': '#1877F2',
|
| 19 |
+
'twitter': '#1DA1F2',
|
| 20 |
+
'youtube': '#FF0000',
|
| 21 |
+
},
|
| 22 |
+
fontFamily: {
|
| 23 |
+
'sans': ['Inter', 'sans-serif'],
|
| 24 |
+
'serif': ['"Noto Serif"', 'serif']
|
| 25 |
+
},
|
| 26 |
+
animation: {
|
| 27 |
+
'fade-in': 'fade-in 0.3s ease-out',
|
| 28 |
+
},
|
| 29 |
+
keyframes: {
|
| 30 |
+
'fade-in': {
|
| 31 |
+
'0%': { opacity: '0', transform: 'scale(0.95)' },
|
| 32 |
+
'100%': { opacity: '1', transform: 'scale(1)' },
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
</script>
|
| 39 |
+
|
| 40 |
+
<style>
|
| 41 |
+
.video-container {
|
| 42 |
+
position: relative;
|
| 43 |
+
padding-bottom: 56.25%; /* 16:9 */
|
| 44 |
+
height: 0;
|
| 45 |
+
overflow: hidden;
|
| 46 |
+
border-radius: 0.5rem;
|
| 47 |
+
}
|
| 48 |
+
.video-container iframe {
|
| 49 |
+
position: absolute;
|
| 50 |
+
top: 0;
|
| 51 |
+
left: 0;
|
| 52 |
+
width: 100%;
|
| 53 |
+
height: 100%;
|
| 54 |
+
}
|
| 55 |
+
</style>
|
| 56 |
+
</head>
|
| 57 |
+
<body class="bg-phap-duyen-nen">
|
| 58 |
+
|
| 59 |
+
<div class="max-w-md mx-auto min-h-screen bg-white text-phap-duyen-nau shadow-xl">
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
<header class="bg-phap-duyen-nau text-white p-5 text-center rounded-t-lg relative z-10">
|
| 64 |
+
<h1 class="text-3xl font-serif font-bold text-phap-duyen-vang">Pháp Duyên</h1>
|
| 65 |
+
<p class="text-sm text-gray-200 mt-1">Gieo duyên lành, gặt quả thiện</p>
|
| 66 |
+
|
| 67 |
+
<div class="flex justify-center space-x-6 mt-4">
|
| 68 |
+
|
| 69 |
+
<a href="https://www.facebook.com/profile.php?id=61581831332376" target="_blank" rel="noopener noreferrer" class="hover:opacity-80 transition-opacity" title="Facebook">
|
| 70 |
+
<span class="sr-only">Facebook</span>
|
| 71 |
+
<img src="/static/facebook.png" alt="Facebook Icon" class="w-6 h-6">
|
| 72 |
+
</a>
|
| 73 |
+
|
| 74 |
+
<a href="https://www.youtube.com/channel/UCcLHjyFoquOScNkUWVNF57A/" target="_blank" rel="noopener noreferrer" class="hover:opacity-80 transition-opacity" title="YouTube">
|
| 75 |
+
<span class="sr-only">YouTube</span>
|
| 76 |
+
<img src="/static/youtube.png" alt="YouTube Icon" class="w-6 h-6">
|
| 77 |
+
</a>
|
| 78 |
+
|
| 79 |
+
<a href="https://s.shopee.vn/6KwIWAo9Yq?share_channel_code=5" target="_blank" rel="noopener noreferrer" class="hover:opacity-80 transition-opacity" title="TikTok">
|
| 80 |
+
<span class="sr-only">TikTok</span>
|
| 81 |
+
<img src="/static/tiktok.png" alt="TikTok Icon" class="w-6 h-6">
|
| 82 |
+
</a>
|
| 83 |
+
|
| 84 |
+
<a href="https://s.shopee.vn/6KwIWAo9Yq?share_channel_code=5" target="_blank" rel="noopener noreferrer" class="hover:opacity-80 transition-opacity" title="Twitter (X)">
|
| 85 |
+
<span class="sr-only">Twitter (X)</span>
|
| 86 |
+
<img src="/static/twitter.png" alt="Twitter Icon" class="w-6 h-6">
|
| 87 |
+
</a>
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
</div>
|
| 92 |
+
</header>
|
| 93 |
+
|
| 94 |
+
<nav class="flex justify-around bg-white p-2 sticky top-0 z-10 shadow-md">
|
| 95 |
+
<button id="btn-products" class="flex-1 py-3 px-4 text-center text-sm font-semibold transition-all duration-300 border-b-4 border-phap-duyen-vang text-phap-duyen-nau">
|
| 96 |
+
Sản Phẩm
|
| 97 |
+
</button>
|
| 98 |
+
<button id="btn-lectures" class="flex-1 py-3 px-4 text-center text-sm font-semibold transition-all duration-300 border-b-4 border-transparent text-gray-500 hover:text-phap-duyen-nau">
|
| 99 |
+
Pháp Thoại
|
| 100 |
+
</button>
|
| 101 |
+
</nav>
|
| 102 |
+
|
| 103 |
+
<main id="products-section" class="p-4">
|
| 104 |
+
<h2 class="text-xl font-bold text-phap-duyen-nau border-b-2 border-phap-duyen-vang pb-2 mb-4">
|
| 105 |
+
Sản Phẩm Tâm Linh
|
| 106 |
+
</h2>
|
| 107 |
+
|
| 108 |
+
<div class="bg-yellow-50 border border-yellow-200 text-yellow-800 p-3 rounded-lg text-sm mb-4">
|
| 109 |
+
Mỗi sản phẩm bạn mua là một sự ủng hộ quý báu, giúp Pháp Duyên có thêm kinh phí để thực hiện và chia sẻ nhiều bài pháp thoại ý nghĩa hơn.
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<div class="grid grid-cols-2 gap-4">
|
| 113 |
+
|
| 114 |
+
{% for product in products %}
|
| 115 |
+
|
| 116 |
+
<a href="{{ product.shopee_link_processed }}"
|
| 117 |
+
target="_blank"
|
| 118 |
+
rel="noopener noreferrer"
|
| 119 |
+
class="block rounded-lg shadow-md overflow-hidden border border-gray-100 bg-phap-duyen-nen group hover:shadow-lg transition-shadow duration-200">
|
| 120 |
+
|
| 121 |
+
<img src="{{ product.image_url_processed }}"
|
| 122 |
+
alt="{{ product.name }}" class="w-full h-36 object-cover">
|
| 123 |
+
|
| 124 |
+
<div class="p-3">
|
| 125 |
+
<h3 class="font-semibold text-sm truncate">{{ product.name }}</h3>
|
| 126 |
+
<p class="text-xs text-gray-500">{{ product.description }}</p>
|
| 127 |
+
<p class="text-base font-bold text-red-700 mt-1">{{ product.price }}</p>
|
| 128 |
+
|
| 129 |
+
<div class="w-full bg-phap-duyen-vang text-white py-1.5 rounded-md mt-2 text-sm font-semibold text-center group-hover:bg-yellow-600 transition-colors">
|
| 130 |
+
Chi Tiết
|
| 131 |
+
</div>
|
| 132 |
+
</div>
|
| 133 |
+
</a> {% endfor %}
|
| 134 |
+
</div> </main>
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
<main id="lectures-section" class="p-4 space-y-6 hidden">
|
| 138 |
+
<h2 class="text-xl font-bold text-phap-duyen-nau border-b-2 border-phap-duyen-vang pb-2 mb-4">
|
| 139 |
+
Pháp Thoại & Giảng Đạo
|
| 140 |
+
</h2>
|
| 141 |
+
|
| 142 |
+
{% for video in videos %}
|
| 143 |
+
<div class="rounded-lg shadow-md border border-gray-100 bg-white">
|
| 144 |
+
<div class="video-container">
|
| 145 |
+
<iframe
|
| 146 |
+
src="https://www.youtube.com/embed/{{ video.youtube_id }}"
|
| 147 |
+
title="YouTube video player"
|
| 148 |
+
frameborder="0"
|
| 149 |
+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
| 150 |
+
allowfullscreen>
|
| 151 |
+
</iframe>
|
| 152 |
+
</div>
|
| 153 |
+
<div class="p-3">
|
| 154 |
+
<button class="open-modal-btn w-full bg-red-600 text-white py-2 rounded-md mt-2 text-sm font-semibold hover:bg-red-700 transition-colors">
|
| 155 |
+
Tuỳ hỷ ủng hộ
|
| 156 |
+
</button>
|
| 157 |
+
</div>
|
| 158 |
+
</div>
|
| 159 |
+
{% endfor %}
|
| 160 |
+
</main>
|
| 161 |
+
|
| 162 |
+
<footer class="bg-phap-duyen-nau text-gray-200 p-6 text-center text-sm rounded-b-lg mt-6">
|
| 163 |
+
<p class="font-bold text-white mb-2">Liên Hệ & Góp Duyên</p>
|
| 164 |
+
<p>Email: <a href="mailto:phapduyen.contact@example.com" class="text-phap-duyen-vang hover:underline">phapduyen.contact@example.com</a></p>
|
| 165 |
+
<p class="mt-2 text-xs">Hãy theo dõi chúng tôi trên mạng xã hội để cập nhật những bài pháp thoại mới nhất!</p>
|
| 166 |
+
<p class="mt-4 text-xs text-gray-400">© 2025 Pháp Duyên. Bảo lưu mọi quyền.</p>
|
| 167 |
+
</footer>
|
| 168 |
+
|
| 169 |
+
</div> <div id="donationModal" class="fixed inset-0 bg-black bg-opacity-70 z-50 hidden items-center justify-center p-4 animate-fade-in">
|
| 170 |
+
<div class="bg-white rounded-lg p-6 w-full max-w-sm mx-auto text-center relative shadow-xl">
|
| 171 |
+
<button id="closeModalButton" class="absolute top-2 right-3 text-gray-400 hover:text-gray-700 text-3xl font-bold">×</button>
|
| 172 |
+
<h3 class="text-xl font-bold text-phap-duyen-nau mb-3">Tuỳ hỷ ủng hộ</h3>
|
| 173 |
+
<p class="text-sm text-gray-600 mb-4">
|
| 174 |
+
Sự ủng hộ của quý vị, dù lớn hay nhỏ, đều là động lực vô giá giúp Pháp Duyên tiếp tục gieo duyên lành qua nhiều bài pháp thoại ý nghĩa hơn.
|
| 175 |
+
</p>
|
| 176 |
+
<img src="https://placehold.co/250x250/eee/333?text=Mã+QR+Ủng+Hộ"
|
| 177 |
+
alt="Mã QR Ngân Hàng" class="w-48 h-48 mx-auto rounded-md border">
|
| 178 |
+
<div class="bg-gray-50 p-3 rounded-md mt-4 text-left text-sm border">
|
| 179 |
+
<p class="mt-2 text-xs italic">Xin chân thành cảm niệm công đức của quý vị!</p>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
|
| 184 |
+
<script>
|
| 185 |
+
// Lấy các phần tử DOM
|
| 186 |
+
const btnProducts = document.getElementById('btn-products');
|
| 187 |
+
const btnLectures = document.getElementById('btn-lectures');
|
| 188 |
+
|
| 189 |
+
const productsSection = document.getElementById('products-section');
|
| 190 |
+
const lecturesSection = document.getElementById('lectures-section');
|
| 191 |
+
|
| 192 |
+
const donationModal = document.getElementById('donationModal');
|
| 193 |
+
const closeModalButton = document.getElementById('closeModalButton');
|
| 194 |
+
const openModalButtons = document.querySelectorAll('.open-modal-btn');
|
| 195 |
+
|
| 196 |
+
// Định nghĩa các lớp CSS cho tab
|
| 197 |
+
const activeClasses = 'border-phap-duyen-vang text-phap-duyen-nau';
|
| 198 |
+
const inactiveClasses = 'border-transparent text-gray-500 hover:text-phap-duyen-nau';
|
| 199 |
+
|
| 200 |
+
// Hàm chung để đặt tab active
|
| 201 |
+
function setActiveTab(activeBtn, inactiveBtn, activeSection, inactiveSection) {
|
| 202 |
+
activeBtn.classList.remove(...inactiveClasses.split(' '));
|
| 203 |
+
activeBtn.classList.add(...activeClasses.split(' '));
|
| 204 |
+
|
| 205 |
+
inactiveBtn.classList.remove(...activeClasses.split(' '));
|
| 206 |
+
inactiveBtn.classList.add(...inactiveClasses.split(' '));
|
| 207 |
+
|
| 208 |
+
activeSection.classList.remove('hidden');
|
| 209 |
+
inactiveSection.classList.add('hidden');
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
// Sự kiện khi nhấn nút "Sản Phẩm"
|
| 213 |
+
if (btnProducts) {
|
| 214 |
+
btnProducts.addEventListener('click', () => {
|
| 215 |
+
setActiveTab(btnProducts, btnLectures, productsSection, lecturesSection);
|
| 216 |
+
});
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
// Sự kiện khi nhấn nút "Pháp Thoại"
|
| 220 |
+
if (btnLectures) {
|
| 221 |
+
btnLectures.addEventListener('click', () => {
|
| 222 |
+
setActiveTab(btnLectures, btnProducts, lecturesSection, productsSection);
|
| 223 |
+
});
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
// ----- Code cho Modal -----
|
| 227 |
+
|
| 228 |
+
// Gắn sự kiện cho tất cả các nút "Tuỳ hỷ ủng hộ"
|
| 229 |
+
openModalButtons.forEach(button => {
|
| 230 |
+
button.addEventListener('click', () => {
|
| 231 |
+
if (donationModal) {
|
| 232 |
+
donationModal.style.display = 'flex';
|
| 233 |
+
}
|
| 234 |
+
});
|
| 235 |
+
});
|
| 236 |
+
|
| 237 |
+
// Sự kiện đóng modal (khi nhấn nút X)
|
| 238 |
+
if (closeModalButton) {
|
| 239 |
+
closeModalButton.addEventListener('click', () => {
|
| 240 |
+
if (donationModal) {
|
| 241 |
+
donationModal.style.display = 'none';
|
| 242 |
+
}
|
| 243 |
+
});
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
// Sự kiện đóng modal (khi nhấn vào nền mờ bên ngoài)
|
| 247 |
+
if (donationModal) {
|
| 248 |
+
donationModal.addEventListener('click', (event) => {
|
| 249 |
+
if (event.target === donationModal) {
|
| 250 |
+
donationModal.style.display = 'none';
|
| 251 |
+
}
|
| 252 |
+
});
|
| 253 |
+
}
|
| 254 |
+
</script>
|
| 255 |
+
|
| 256 |
+
</body>
|
| 257 |
+
</html>
|