<!doctype html>
<html lang="pt-BR">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="icon" href="/img-sys/icons/favicon-pause-32x32.png" sizes="32x32" />
    <link rel="icon" href="/img-sys/icons/favicon-pause-192x192.png" sizes="192x192" />
    <link rel="apple-touch-icon-precomposed" href="/img-sys/icons/favicon-pause-180x180.png" />
    <meta name="msapplication-TileImage" content="/img-sys/icons/favicon-pause-270x270.png" />

    <title></title>

    <!-- Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300|Nunito:700" rel="stylesheet">

    <!-- Styles -->
    <style>
        html, body {
            background-color: #6535D8;
            color: #fff;
            font-family: 'Nunito Sans', sans-serif;
            font-weight: 300;
            height: 100vh;
            margin: 0;
        }

        .full-height {
            height: 100vh;
        }

        .flex-center {
            align-items: center;
            display: flex;
            justify-content: center;
        }

        .position-ref {
            position: relative;
        }

        .content {
            padding: 10px;
            text-align: center;
            font-size: 16px;
        }

        @media (min-width: 768px) {
            .content {
                padding: 20px;
                font-size: 22px;
            }
        }

        .title {
            font-family: 'Nunito', sans-serif;
            font-size: 36px;
            font-weight: 700;
            line-height: 1.1;
        }

        @media (min-width: 768px) {
            .title {
                font-size: 50px;
            }
        }

        .links > a {
            color: #fff;
            padding: 0 25px;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: .1rem;
            text-decoration: none;
            text-transform: uppercase;
        }

        .m-b-md {
            margin-bottom: 30px;
        }

        #loading {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1000;
            background-color: white;
        }

        #loading:before {
            content: "";
            display: block;
            position: absolute;
            top: 50%;
            left: 50%;
            width: 80px;
            border: 12px solid #6C757E;
            border-radius: 50%;
            margin-top: -52px;
            margin-left: -52px;
            aspect-ratio: 1;
            animation: l20-1 0.8s infinite linear alternate, l20-2 1.6s infinite linear;
        }

        @keyframes l20-1 {
            0%    {clip-path: polygon(50% 50%,0       0,  50%   0%,  50%    0%, 50%    0%, 50%    0%, 50%    0% )}
            12.5% {clip-path: polygon(50% 50%,0       0,  50%   0%,  100%   0%, 100%   0%, 100%   0%, 100%   0% )}
            25%   {clip-path: polygon(50% 50%,0       0,  50%   0%,  100%   0%, 100% 100%, 100% 100%, 100% 100% )}
            50%   {clip-path: polygon(50% 50%,0       0,  50%   0%,  100%   0%, 100% 100%, 50%  100%, 0%   100% )}
            62.5% {clip-path: polygon(50% 50%,100%    0, 100%   0%,  100%   0%, 100% 100%, 50%  100%, 0%   100% )}
            75%   {clip-path: polygon(50% 50%,100% 100%, 100% 100%,  100% 100%, 100% 100%, 50%  100%, 0%   100% )}
            100%  {clip-path: polygon(50% 50%,50%  100%,  50% 100%,   50% 100%,  50% 100%, 50%  100%, 0%   100% )}
        }

        @keyframes l20-2 { 
            0%    {transform:scaleY(1)  rotate(0deg)}
            49.99%{transform:scaleY(1)  rotate(135deg)}
            50%   {transform:scaleY(-1) rotate(0deg)}
            100%  {transform:scaleY(-1) rotate(-135deg)}
        }
    </style>
</head>
<body>
    <div id="loading"></div>
    <div id="main-content" class="flex-center position-ref full-height">
        <div class="content">
            <div id="section-title" class="title m-b-md">
                Site suspenso
            </div>
            <p id="section-subtitle">
                Este site está suspenso temporariamente.<br>Para mais informações, entre em contato com o responsável pela hospedagem.
            </p>
        </div>
    </div>
    <script type="text/javascript">
        (function() {
            window.onload = function() {
                var xhr = new XMLHttpRequest(),
                    domain = window.location.hostname,
                    hasPageTitle = false;

                xhr.open("POST", "https://api-suspension-screen.webserverhost.top/screen-config");
                xhr.setRequestHeader("Content-Type", "application/json");
                xhr.responseType = "json";

                xhr.onload = function() {
                    if (xhr.status === 200)
                    {
                        var data = xhr.response.data;

                        if (data.screen_config)
                        {
                            var config = data.screen_config;

                            if (config.page_title) {
                                document.title = config.page_title;
                                hasPageTitle = true;
                            }
                            if (config.section_title) {
                                document.getElementById("section-title").innerText = config.section_title;
                            }
                            if (config.section_subtitle) {
                                document.getElementById("section-subtitle").innerText = config.section_subtitle;
                            }
                            if (config.background_color) {
                                document.getElementById("main-content").style.backgroundColor = config.background_color;
                            }
                            if (config.text_color) {
                                document.getElementById("main-content").style.color = config.text_color;
                            }
                        }
                    }
                    else if (xhr.status !== 200) {
                        console.log("Error loading suspension screen data");
                    }

                    if (!hasPageTitle) {
                        document.title = "Site suspenso";
                    }

                    document.getElementById("loading").remove();
                };
                xhr.send('{"hosting_name":"'+ domain +'"}');
            };
        })();
    </script>
</body>
</html>
