feat: menambah popup informasi pada ikon tentang aplikasi
This commit is contained in:
@@ -940,4 +940,33 @@ window.addEventListener('offline', updateConnectionStatus);
|
||||
|
||||
// Jalankan saat pertama kali dimuat
|
||||
document.addEventListener('DOMContentLoaded', updateConnectionStatus);
|
||||
updateConnectionStatus();
|
||||
updateConnectionStatus();
|
||||
|
||||
// ==========================================
|
||||
// 17. MODAL TENTANG APLIKASI
|
||||
// ==========================================
|
||||
var aboutBtn = document.getElementById('about-btn');
|
||||
var aboutModal = document.getElementById('about-modal');
|
||||
var aboutCloseBtn = document.getElementById('about-close-btn');
|
||||
var aboutOkBtn = document.getElementById('about-ok-btn');
|
||||
|
||||
if (aboutBtn && aboutModal) {
|
||||
aboutBtn.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
aboutModal.classList.add('active');
|
||||
});
|
||||
|
||||
var closeModal = function () {
|
||||
aboutModal.classList.remove('active');
|
||||
};
|
||||
|
||||
if (aboutCloseBtn) aboutCloseBtn.addEventListener('click', closeModal);
|
||||
if (aboutOkBtn) aboutOkBtn.addEventListener('click', closeModal);
|
||||
|
||||
// Tutup modal jika klik area luar modal-content
|
||||
aboutModal.addEventListener('click', function (e) {
|
||||
if (e.target === aboutModal) {
|
||||
closeModal();
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user