Written by Pegawai ICT on . Posted in Penerbitan.
.fullscreen-wrapper {
display: flex;
justify-content: center;
margin-top: 20px;
}
.fullscreen-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 16px;
font-size: 16px;
font-family: 'Segoe UI', sans-serif;
background-color: #1e40af;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
transition: background-color 0.3s ease, transform 0.2s ease;
}
.fullscreen-btn:hover {
background-color: #1d4ed8;
transform: scale(1.03);
}
.fullscreen-btn svg {
stroke: white;
}
#exit-btn {
position: fixed;
top: 20px;
left: 20px; /* <- ubah dari right ke left */
padding: 8px 14px;
font-size: 20px;
background-color: rgba(30, 41, 175, 0.9);
color: white;
border: none;
border-radius: 50%;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
z-index: 1000;
display: none; /* sembunyi kecuali dalam fullscreen */
}
#exit-btn:hover {
background-color: rgba(29, 78, 216, 0.9);
}
const iframe = document.getElementById("heyzine-iframe");
const enterBtn = document.getElementById("enter-btn");
const exitBtn = document.getElementById("exit-btn");
function openFullscreen() {
if (iframe.requestFullscreen) {
iframe.requestFullscreen();
} else if (iframe.webkitRequestFullscreen) {
iframe.webkitRequestFullscreen();
} else if (iframe.msRequestFullscreen) {
iframe.msRequestFullscreen();
}
}
function closeFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
document.addEventListener("fullscreenchange", () => {
exitBtn.style.display = document.fullscreenElement ? "block" : "none";
});
Read more: BANCI ASAS KOMODITI TERNAKAN TAHUN 2024