<?php
header('Content-Type: application/json');

$host = $_SERVER['HTTP_HOST'];

$sites = [
    'telenovelastotal.com' => [
        'name' => 'Telenovelas Total',
        'short' => 'Telenovelas',
        'icons' => '/imagenes/telenovelas-total/icons'
    ],
    'lametiche.com' => [
        'name' => 'La Metiche',
        'short' => 'Metiche',
        'icons' => '/imagenes/lametiche/icons'
    ],
    'nfltotal.com' => [
        'name' => 'NFL Total',
        'short' => 'NFL',
        'icons' => '/imagenes/nfl-total/icons'
    ],
];

foreach ($sites as $domain => $data) {
    if (strpos($host, $domain) !== false) {
        echo json_encode([
            'name' => $data['name'],
            'short_name' => $data['short'],
            'icons' => [
                [
                    'src' => $data['icons'].'/icon-192x192.png',
                    'sizes' => '192x192',
                    'type' => 'image/png'
                ],
                [
                    'src' => $data['icons'].'/icon-512x512.png',
                    'sizes' => '512x512',
                    'type' => 'image/png'
                ]
            ],
            'theme_color' => '#000000',
            'background_color' => '#000000',
            'display' => 'standalone'
        ], JSON_UNESCAPED_SLASHES);
        exit;
    }
}

echo '{}';
