Oppo A5 Vitality Edition chính thức ra mắt với camera 50MP và Dimensity 6300

Đăng bởi: Ngày: 19/03/2025

Mới đây, Oppo đã chính thức công bố mẫu điện thoại Oppo A5 Vitality Edition tại Trung Quốc, một phiên bản được điều chỉnh và cải tiến hơn của dòng điện thoại A5 đã ra mắt trước đó. Với sự xuất hiện của phiên bản này, thị trường smartphone tầm trung hứa hẹn sẽ có thêm một lựa chọn chất lượng cho người tiêu dùng.

{ // Mobile Menu Logic const mobileMenuButton = document.getElementById('mobile-menu-button'); const mobileMenu = document.getElementById('mobile-menu'); if(mobileMenuButton && mobileMenu) { mobileMenuButton.addEventListener('click', () => { mobileMenu.classList.toggle('hidden'); }); } // Collapsible Description Logic (for Archive pages) const toggleButton = document.querySelector('.collapsible-description-toggle'); if (toggleButton) { const contentWrapper = toggleButton.closest('.collapsible-description-wrapper'); const content = contentWrapper.querySelector('.collapsible-description-content'); toggleButton.addEventListener('click', function () { contentWrapper.classList.toggle('active'); if (content.style.maxHeight) { content.style.maxHeight = null; } else { content.style.maxHeight = content.scrollHeight + "px"; } }); } // ========== Top Banner Ad Logic v2 ========== const topBanner = document.getElementById('top-banner-ad'); const adIns = document.getElementById('top-banner-ad-ins'); const closeBannerBtn = document.getElementById('close-banner-btn'); if (topBanner && adIns && closeBannerBtn) { const BANNER_CLOSED_KEY = 'bannerManuallyClosed'; const showBanner = () => { if (sessionStorage.getItem(BANNER_CLOSED_KEY) !== 'true') { topBanner.classList.add('banner-visible'); topBanner.classList.remove('banner-hidden'); } }; const hideBanner = () => { topBanner.classList.add('banner-hidden'); topBanner.classList.remove('banner-visible'); }; closeBannerBtn.addEventListener('click', () => { hideBanner(); sessionStorage.setItem(BANNER_CLOSED_KEY, 'true'); }); const observer = new MutationObserver((mutationsList, observer) => { for(const mutation of mutationsList) { if (mutation.type === 'attributes' && mutation.attributeName === 'data-ad-status') { if (adIns.getAttribute('data-ad-status') === 'filled') { showBanner(); observer.disconnect(); } } } }); observer.observe(adIns, { attributes: true }); window.addEventListener('scroll', function() { if (topBanner.classList.contains('banner-visible') && sessionStorage.getItem(BANNER_CLOSED_KEY) !== 'true') { let scrollTop = window.pageYOffset || document.documentElement.scrollTop; if (scrollTop > 10) { hideBanner(); } else { showBanner(); } } }, { passive: true }); if (adIns.getAttribute('data-ad-status') === 'filled') { showBanner(); observer.disconnect(); } } // ========== BẮT ĐẦU: TỰ ĐỘNG WRAP VIDEO YOUTUBE CHO RESPONSIVE ========== const postContent = document.querySelector('.post-content-area'); if (postContent) { // Tìm tất cả iframe của YouTube trong khu vực nội dung bài viết const iframes = postContent.querySelectorAll('iframe[src*="youtube.com"], iframe[src*="googleusercontent.com/youtube"]'); iframes.forEach(iframe => { // Chỉ xử lý những iframe chưa được wrap if (!iframe.parentElement.classList.contains('tns-video-responsive-wrapper')) { // Tạo một div mới để bao bọc const wrapper = document.createElement('div'); wrapper.className = 'tns-video-responsive-wrapper'; // Chèn div wrapper vào trước iframe iframe.parentNode.insertBefore(wrapper, iframe); // Di chuyển iframe vào bên trong div wrapper wrapper.appendChild(iframe); } }); } // ========== KẾT THÚC: TỰ ĐỘNG WRAP VIDEO YOUTUBE ========== // ========== BẮT ĐẦU: LOGIC BÀI VIẾT LIÊN QUAN VÔ TẬN (LOGIC MỚI) ========== const infiniteContainer = document.getElementById('infinite-related-container'); if (infiniteContainer) { const initialPostId = parseInt(infiniteContainer.dataset.originalPostId, 10); let excludedPostIDs = [initialPostId]; const loadingIndicatorHTML = `

Đang tìm bài viết hay...

`; // Hàm để tải lưới 3 bài viết vào một placeholder const loadGridInto = (placeholder) => { if (!placeholder) return; placeholder.innerHTML = loadingIndicatorHTML; const postIdForTags = parseInt(placeholder.dataset.postId, 10); const formData = new FormData(); formData.append('action', 'tns_get_related_grid'); formData.append('nonce', tns_ajax_object.get_grid_nonce); formData.append('original_post_id', postIdForTags); formData.append('exclude_ids', JSON.stringify(excludedPostIDs)); fetch(tns_ajax_object.ajax_url, { method: 'POST', body: formData }) .then(response => response.text()) .then(html => { const wrapper = document.createElement('div'); wrapper.innerHTML = ` `; placeholder.replaceWith(wrapper); // Cập nhật danh sách loại trừ wrapper.querySelectorAll('.related-card-arrow').forEach(card => { const newId = parseInt(card.dataset.postid, 10); if (!excludedPostIDs.includes(newId)) { excludedPostIDs.push(newId); } }); }) .catch(error => { console.error('Lỗi khi tải lưới bài viết:', error); placeholder.innerHTML = '
Không thể tải bài viết liên quan.
'; }); }; // Tải lưới ban đầu const initialPlaceholder = document.createElement('div'); initialPlaceholder.className = 'next-related-posts-placeholder'; initialPlaceholder.dataset.postId = initialPostId; infiniteContainer.appendChild(initialPlaceholder); loadGridInto(initialPlaceholder); // Gán sự kiện click (sử dụng event delegation cho toàn bộ container) infiniteContainer.addEventListener('click', function(e) { const arrowButton = e.target.closest('.related-card-arrow'); if (arrowButton) { const postIdToLoad = parseInt(arrowButton.dataset.postid, 10); if (!postIdToLoad) return; // Thêm ID sắp tải vào danh sách loại trừ ngay if (!excludedPostIDs.includes(postIdToLoad)) { excludedPostIDs.push(postIdToLoad); } const currentGridSection = arrowButton.closest('.next-related-posts-section'); if (!currentGridSection) return; // Hiển thị loading và tải bài viết currentGridSection.innerHTML = loadingIndicatorHTML; const formData = new FormData(); formData.append('action', 'tns_load_single_ajax_post'); formData.append('nonce', tns_ajax_object.get_post_nonce); formData.append('post_id', postIdToLoad); fetch(tns_ajax_object.ajax_url, { method: 'POST', body: formData }) .then(response => response.text()) .then(html => { // Thay thế khu vực lưới hiện tại bằng nội dung bài viết mới // Nội dung này đã bao gồm placeholder cho lưới tiếp theo currentGridSection.outerHTML = html; // Tìm placeholder mới vừa được thêm vào const newPlaceholder = infiniteContainer.querySelector('.next-related-posts-placeholder'); // Tải lưới mới vào placeholder đó loadGridInto(newPlaceholder); }) .catch(error => { console.error('Lỗi khi tải nội dung bài viết:', error); currentGridSection.innerHTML = '
Không thể tải nội dung. Vui lòng thử lại.
'; }); } }); } // ========== KẾT THÚC: LOGIC BÀI VIẾT LIÊN QUAN VÔ TẬN ========== });