Hubungi Sales
// ===== Galeri — pakai foto LOKAL yang sudah ada =====
var GAL=[
{type:'photo',img:'gambar/WhatsApp Image 2026-08-22 at 16.42.29.jpeg',thumb:'gambar/WhatsApp Image 2026-08-22 at 16.42.29.jpeg',title:['Penyerahan Valve di Proyek Pabrik','Handover of valves at the plant project','工厂项目中的阀门交接'],span:'tall'},
{type:'video',img:'gambar/WhatsApp Video 2026-08-22 at 16.46.48.mp4',thumb:'gambar/WhatsApp Video 2026-08-22 at 16.46.48.mp4',title:['Perbaikan Safety Valve Hydrant','Hydrant Safety Valve Repair','消火栓安全阀维修'],span:'tall',videoSrc:'gambar/WhatsApp Video 2026-08-22 at 16.46.48.mp4'},
{type:'photo',img:'gambar/WhatsApp Image 2026-08-22 at 17.01.05.jpeg ',thumb:'gambar/WhatsApp Image 2026-08-22 at 17.01.05.jpeg ',title:['Tim Teknis di Lokasi Proyek','Technical Team on Site','项目现场技术团队'],span:'wide'},
{type:'photo',img:'gambar/WhatsApp Image 2026-08-23 at 21.51.36.jpeg',thumb:'gambar/WhatsApp Image 2026-08-23 at 21.51.36.jpeg',title:['Instalasi Piping System Industri','Industrial Piping Installation','工业管道安装'],span:'wide'},
{type:'photo',img:'gambar/WhatsApp Image 2026-08-23 at 21.58.22.jpeg',thumb:'gambar/WhatsApp Image 2026-08-23 at 21.58.22.jpeg',title:['Inspeksi Kualitas Sebelum Pengiriman','Quality Inspection Before Shipping','发货前质量检查'],span:'wide'},
{type:'video',img:'gambar/WhatsApp Video 2026-08-23 at 21.38.42.mp4 ',thumb:'gambar/WhatsApp Video 2026-08-23 at 21.38.42.mp4 ',title:['Loading Pengiriman Barang Ke lokasi Proyek','Loading goods for delivery to the project site.','装载货物,准备运往项目现场。'],span:'wide',videoSrc:'gambar/WhatsApp Video 2026-08-22 at 17.00.55.mp4'},
{type:'photo',img:'gambar/WhatsApp Image 2026-08-22 at 17.01.03 (2).jpeg ',thumb:'gambar/WhatsApp Image 2026-08-22 at 17.01.03 (2).jpeg ',title:['Pengecekan Safety Valve On-Site','Safety Valve On-Site Check','现场安全阀检查'],span:'wide'},
{type:'photo',img:'gambar/WhatsApp Image 2026-08-22 at 17.01.03.jpeg',thumb:'gambar/WhatsApp Image 2026-08-22 at 17.01.03.jpeg',title:['Packing & Pengemasan Aman','Safe Packing & Packaging','安全包装'],span:'wide'},
{type:'video',img:'gambar/WhatsApp Video 2026-08-23 at 22.01.26.mp4 ',thumb:'gambar/WhatsApp Video 2026-08-23 at 22.01.26.mp4 ',title:['Hidrotest ball Valve di line pipa sebelum di fungsikan','Hydrostatic testing of the ball valve in the pipeline prior to commissioning.','管道投运前对球阀进行的静水压试验。'],span:'wide',videoSrc:'gambar/WhatsApp Video 2026-08-23 at 22.01.26.mp4'},
];
// Function to render gallery
function renderGallery() {
const grid = document.getElementById('galleryGrid');
if (!grid) return;
GAL.forEach((item, index) => {
const div = document.createElement('div');
div.className = `gallery-item ${item.span || ''}`;
let mediaContent = '';
if (item.type === 'video') {
mediaContent = `
▶
`;
} else {
mediaContent = `
`;
}
div.innerHTML = `
${mediaContent}
${item.title[0]}
${item.title[1]}
`;
// Click event to open modal
div.addEventListener('click', () => openModal(item));
grid.appendChild(div);
});
}
// Modal functions
function openModal(item) {
const modal = document.getElementById('galleryModal');
const modalMedia = document.getElementById('modalMedia');
const modalTitle = document.getElementById('modalTitle');
let mediaHTML = '';
if (item.type === 'video') {
mediaHTML = `
Browser Anda tidak mendukung video tag.
`;
} else {
mediaHTML = `
`;
}
modalMedia.innerHTML = mediaHTML;
modalTitle.innerHTML = `
${item.title[0]}
${item.title[1]}
${item.title[2]}
`;
modal.style.display = 'block';
document.body.style.overflow = 'hidden';
}
function closeModal() {
const modal = document.getElementById('galleryModal');
const modalMedia = document.getElementById('modalMedia');
modal.style.display = 'none';
document.body.style.overflow = 'auto';
// Stop video if playing
const video = modalMedia.querySelector('video');
if (video) {
video.pause();
video.currentTime = 0;
}
}
// Close modal when clicking outside or on X
document.addEventListener('DOMContentLoaded', function() {
renderGallery();
const modal = document.getElementById('galleryModal');
const closeBtn = document.querySelector('.close-modal');
if (closeBtn) {
closeBtn.onclick = closeModal;
}
if (modal) {
modal.onclick = function(event) {
if (event.target === modal) {
closeModal();
}
}
}
// Close on Escape key
document.onkeydown = function(event) {
if (event.key === 'Escape') {
closeModal();
}
}
});