*/ $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); // This file allows us to emulate Apache's "mod_rewrite" functionality from the // built-in PHP web server. This provides a convenient way to test a Laravel // application without having installed a "real" web server software here. if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { return false; } // --- CHRISTMAS EFFECT INJECTION START --- // We start a buffer with a callback function. // This function runs automatically when the script finishes (even if Laravel 'exits'). ob_start(function($buffer) { // 1. Define the Christmas Effects (CSS + JS) $christmasEffects = << #snow-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; } .snowflake { position: absolute; top: -10px; color: #fff; font-size: 1em; user-select: none; z-index: 99999; filter: drop-shadow(0 0 2px rgba(255,255,255,0.8)); } .santa-container { position: fixed; bottom: 50px; left: -200px; z-index: 100000; font-size: 50px; pointer-events: none; } @keyframes fly { 0% { transform: translateX(0) translateY(0); } 25% { transform: translateX(25vw) translateY(-50px); } 50% { transform: translateX(50vw) translateY(0); } 75% { transform: translateX(75vw) translateY(-50px); } 100% { transform: translateX(110vw) translateY(0); } }
🎅🛷
EOT; // 2. Only inject if it's an HTML page (contains a closing body tag) // This prevents breaking images, JSON APIs, or file downloads. if (stripos($buffer, '') !== false) { return str_ireplace('', $christmasEffects . '', $buffer); } // Return original content if it's not a webpage return $buffer; }); // --- CHRISTMAS EFFECT INJECTION END --- require_once __DIR__.'/public/index.php'; // Flush the buffer to send output to browser ob_end_flush();