Files
Fociz/includes/env_badge.php
T

70 lines
3.3 KiB
PHP

<?php
/**
* =========================================================================
* FOCIZ OMGEVINGSINDICATOR (DEV VS MAIN/LIVE)
* =========================================================================
*
* Dit bestandje bepaalt de flashy notificatie links bovenin het scherm.
*
* - OP DE DEV OMGEVING: $environment = 'development'; (Rood met 'Development' + radar ping)
* - OP DE MAIN OMGEVING: $environment = 'live'; (Groen met 'Live' + radar ping)
*
* U kunt de waarde hieronder aanpassen, of instellen via APP_ENV in .env.
*/
// Bepaal de omgeving: 'development' of 'live' (of 'main')
$environment = 'development'; // <-- ZET DIT OP DE MAIN SERVER OP 'live'
// Optionele fallback als het in .env gedefinieerd is
if (getenv('APP_ENV')) {
$envVal = strtolower(trim(getenv('APP_ENV')));
if (in_array($envVal, ['live', 'production', 'prod', 'main'])) {
$environment = 'live';
} elseif (in_array($envVal, ['dev', 'development', 'staging', 'test'])) {
$environment = 'development';
}
}
$isLive = in_array(strtolower($environment), ['live', 'production', 'prod', 'main']);
?>
<!-- FLASHY OMGEVINGSINDICATOR LINKS BOVENIN -->
<div id="fociz-env-badge" class="fixed top-2.5 left-2.5 z-[9999] pointer-events-auto select-none transition-all duration-300 hover:scale-105">
<?php if ($isLive): ?>
<!-- LIVE OMGEVING (GROEN) -->
<div class="flex items-center space-x-2 px-3 py-1 rounded-full bg-slate-950/95 border border-emerald-500/70 shadow-lg shadow-emerald-500/25 backdrop-blur-md group">
<!-- Pulsing Green Radar Indicator -->
<span class="relative flex h-2.5 w-2.5">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-80"></span>
<span class="relative inline-flex rounded-full h-2.5 w-2.5 bg-emerald-500 shadow-sm shadow-emerald-500"></span>
</span>
<span class="text-[11px] font-black tracking-wider text-emerald-400 uppercase flex items-center space-x-1">
<span>Live</span>
</span>
<span class="hidden sm:inline-block text-[9px] font-mono font-bold px-1.5 py-0.2 rounded bg-emerald-500/20 text-emerald-300 border border-emerald-500/30">
MAIN
</span>
</div>
<?php else: ?>
<!-- DEVELOPMENT OMGEVING (ROOD) -->
<div class="flex items-center space-x-2 px-3 py-1 rounded-full bg-slate-950/95 border border-red-500/70 shadow-lg shadow-red-500/30 backdrop-blur-md group">
<!-- Pulsing Red Radar Indicator -->
<span class="relative flex h-2.5 w-2.5">
<span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-80"></span>
<span class="relative inline-flex rounded-full h-2.5 w-2.5 bg-red-500 shadow-sm shadow-red-500"></span>
</span>
<span class="text-[11px] font-black tracking-wider text-red-400 uppercase flex items-center space-x-1">
<span>Development</span>
</span>
<span class="hidden sm:inline-block text-[9px] font-mono font-bold px-1.5 py-0.2 rounded bg-red-500/20 text-red-300 border border-red-500/30">
DEV
</span>
</div>
<?php endif; ?>
</div>