<?php
$jsonImg = '../img/animation/wall_info.json';
$imgData = file_exists($jsonImg) ? json_decode(file_get_contents($jsonImg), true)[0] : ["ImageName" => "#020617", "Upload_type" => "by_color"];

if ($imgData['Upload_type'] == "by_color") {
    $bgStyle = "background:" . $imgData['ImageName'] . ";";
} else {
    $imgUrl = ($imgData['Upload_type'] == "by_file") ? substr($imgData['ImageName'], 1) : $imgData['ImageName'];
    $bgStyle = "background-image: url('$imgUrl'); background-size: cover; background-position: center; background-repeat: no-repeat;";
}
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <style>
        * { margin:0; padding:0; box-sizing: border-box; }
        body, html { 
            width: 100%; 
            height: 100%; 
            <?= $bgStyle ?> 
            background-attachment: fixed; 
            overflow: hidden; 
        }
    </style>
</head>
<body>
    </body>
</html>
