PHP Code Editor
<?php /** * Konfigurasi Resolusi 720x480 */ $width = 720; $height = 480; // Parameter acak untuk gambar Picsum agar selalu berganti setiap refresh $randomSeed = rand(1, 99999); $imageUrl = "https://picsum.photos/{$width}/{$height}.jpg?random={$randomSeed}"; ?> <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Subtle CRT Glitch Engine - PHP 7.3</title> <style> body { background-color: #030303; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; overflow: hidden; } /* Container Monitor CRT */ #crt-monitor { position: relative; width: <?php echo $width; ?>px; height: <?php echo $height; ?>px; background: #000; border: 10px solid #1a1a1a; border-radius: 12px; overflow: hidden; box-shadow: 0 0 50px rgba(0,0,0,1); /* Transisi cepat untuk filter agar tidak terlalu kaku */ transition: filter 0.05s ease-out; } /* Layer Gambar Dasar (Selalu Bersih) */ .base-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('<?php echo $imageUrl; ?>'); background-size: cover; background-position: center; } /* Layer RGB Glitch (Intensitas Dibatasi 30-50%) */ .glitch-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('<?php echo $imageUrl; ?>'); background-size: cover; background-position: center; mix-blend-mode: screen; opacity: 0; /* Tersembunyi saat Off */ z-index: 5; pointer-events: none; } /* Filter Warna Subtle untuk RGB Split */ .red { filter: sepia(1) saturate(3) hue-rotate(-50deg); } .green { filter: sepia(1) saturate(3) hue-rotate(70deg); } .blue { filter: sepia(1) saturate(3) hue-rotate(190deg); } /* Tekstur Garis Scanline TV */ .scanlines { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient( rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50% ); background-size: 100% 4px; z-index: 10; pointer-events: none; } </style> </head> <body> <div id="crt-monitor"> <!-- Gambar Utama --> <div class="base-layer"></div> <!-- Layer Glitch yang di-update oleh JS --> <div class="glitch-layer red" id="r"></div> <div class="glitch-layer green" id="g"></div> <div class="glitch-layer blue" id="b"></div> <div class="scanlines"></div> </div> <script> const monitor = document.getElementById('crt-monitor'); const layers = [ document.getElementById('r'), document.getElementById('g'), document.getElementById('b') ]; let isGlitching = false; function updateGlitch() { // DURASI: 15% Peluang Aktif di setiap cycle // Menggunakan probabilitas rendah untuk menjaga status OFF tetap dominan if (!isGlitching && Math.random() > 0.985) { isGlitching = true; // Matikan kembali setelah durasi singkat (150ms) setTimeout(() => { isGlitching = false; // Reset Total saat OFF (Kembali Bersih) layers.forEach(l => { l.style.opacity = "0"; l.style.transform = "none"; }); monitor.style.filter = "none"; monitor.style.transform = "none"; }, 150); } if (isGlitching) { // 1. EFEK SHAKE (Getar Ringan) // Hanya menggetarkan maksimal 4-6 pixel agar tidak pusing const sx = (Math.random() - 0.5) * 8; const sy = (Math.random() - 0.5) * 4; monitor.style.transform = `translate(${sx}px, ${sy}px)`; // 2. KETEBALAN BRIGHTNESS & NEGATIVE (Dibatasi 30-50%) // Brightness: normal(1.0) sampai 1.3 (+30%) // Negative (Invert): normal(0.0) sampai 0.3 (30%) const brightness = 1 + (Math.random() * 0.3); const negative = Math.random() * 0.3; monitor.style.filter = `brightness(${brightness}) invert(${negative})`; // 3. EFEK RGB SPLIT (Halus) layers.forEach(l => { // Geser tipis horizontal (max 6px) const x = (Math.random() - 0.5) * 12; l.style.opacity = "0.35"; // Transparansi overlay hanya 35% l.style.transform = `translate(${x}px, 0px)`; }); } requestAnimationFrame(updateGlitch); } // Jalankan mesin glitch setelah halaman dimuat window.onload = updateGlitch; </script> </body> </html>
Run Code
<?php /** * Konfigurasi Resolusi 720x480 */ $width = 720; $height = 480; // Parameter acak untuk gambar Picsum agar selalu berganti setiap refresh $randomSeed = rand(1, 99999); $imageUrl = "https://picsum.photos/{$width}/{$height}.jpg?random={$randomSeed}"; ?> <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Subtle CRT Glitch Engine - PHP 7.3</title> <style> body { background-color: #030303; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; overflow: hidden; } /* Container Monitor CRT */ #crt-monitor { position: relative; width: <?php echo $width; ?>px; height: <?php echo $height; ?>px; background: #000; border: 10px solid #1a1a1a; border-radius: 12px; overflow: hidden; box-shadow: 0 0 50px rgba(0,0,0,1); /* Transisi cepat untuk filter agar tidak terlalu kaku */ transition: filter 0.05s ease-out; } /* Layer Gambar Dasar (Selalu Bersih) */ .base-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('<?php echo $imageUrl; ?>'); background-size: cover; background-position: center; } /* Layer RGB Glitch (Intensitas Dibatasi 30-50%) */ .glitch-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url('<?php echo $imageUrl; ?>'); background-size: cover; background-position: center; mix-blend-mode: screen; opacity: 0; /* Tersembunyi saat Off */ z-index: 5; pointer-events: none; } /* Filter Warna Subtle untuk RGB Split */ .red { filter: sepia(1) saturate(3) hue-rotate(-50deg); } .green { filter: sepia(1) saturate(3) hue-rotate(70deg); } .blue { filter: sepia(1) saturate(3) hue-rotate(190deg); } /* Tekstur Garis Scanline TV */ .scanlines { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient( rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50% ); background-size: 100% 4px; z-index: 10; pointer-events: none; } </style> </head> <body> <div id="crt-monitor"> <!-- Gambar Utama --> <div class="base-layer"></div> <!-- Layer Glitch yang di-update oleh JS --> <div class="glitch-layer red" id="r"></div> <div class="glitch-layer green" id="g"></div> <div class="glitch-layer blue" id="b"></div> <div class="scanlines"></div> </div> <script> const monitor = document.getElementById('crt-monitor'); const layers = [ document.getElementById('r'), document.getElementById('g'), document.getElementById('b') ]; let isGlitching = false; function updateGlitch() { // DURASI: 15% Peluang Aktif di setiap cycle // Menggunakan probabilitas rendah untuk menjaga status OFF tetap dominan if (!isGlitching && Math.random() > 0.985) { isGlitching = true; // Matikan kembali setelah durasi singkat (150ms) setTimeout(() => { isGlitching = false; // Reset Total saat OFF (Kembali Bersih) layers.forEach(l => { l.style.opacity = "0"; l.style.transform = "none"; }); monitor.style.filter = "none"; monitor.style.transform = "none"; }, 150); } if (isGlitching) { // 1. EFEK SHAKE (Getar Ringan) // Hanya menggetarkan maksimal 4-6 pixel agar tidak pusing const sx = (Math.random() - 0.5) * 8; const sy = (Math.random() - 0.5) * 4; monitor.style.transform = `translate(${sx}px, ${sy}px)`; // 2. KETEBALAN BRIGHTNESS & NEGATIVE (Dibatasi 30-50%) // Brightness: normal(1.0) sampai 1.3 (+30%) // Negative (Invert): normal(0.0) sampai 0.3 (30%) const brightness = 1 + (Math.random() * 0.3); const negative = Math.random() * 0.3; monitor.style.filter = `brightness(${brightness}) invert(${negative})`; // 3. EFEK RGB SPLIT (Halus) layers.forEach(l => { // Geser tipis horizontal (max 6px) const x = (Math.random() - 0.5) * 12; l.style.opacity = "0.35"; // Transparansi overlay hanya 35% l.style.transform = `translate(${x}px, 0px)`; }); } requestAnimationFrame(updateGlitch); } // Jalankan mesin glitch setelah halaman dimuat window.onload = updateGlitch; </script> </body> </html>
Run Code New Tab
Result