<?php
declare(strict_types=1);

require_once __DIR__ . '/config.php';
require_once __DIR__ . '/includes/functions.php';

header('Content-Type: application/manifest+json; charset=utf-8');

$appName = app_setting($pdo, 'app_name', 'I Am Yielded Men');
$shortName = app_setting($pdo, 'app_short_name', 'IAY Men');
$themeColor = app_setting($pdo, 'theme_color', '#d4af37');
$backgroundColor = app_setting($pdo, 'background_color', '#0b1220');
$appIcon = app_setting($pdo, 'app_icon_path', '/men/images/iamyieldedvov.jpg');

echo json_encode([
    'name' => $appName,
    'short_name' => $shortName,
    'start_url' => '/men/',
    'display' => 'standalone',
    'background_color' => $backgroundColor,
    'theme_color' => $themeColor,
    'icons' => [
        [
            'src' => $appIcon,
            'sizes' => '192x192',
            'type' => 'image/jpeg'
        ],
        [
            'src' => $appIcon,
            'sizes' => '512x512',
            'type' => 'image/jpeg'
        ]
    ]
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
