{{ define "main" }}

<div class="container warn">

    <h1>Warning</h1>
    <p>This website contains mature content meant for adults and is not suitable for minors.</p>
    <p>By clicking the link below you certify you are over the age of majority in your country.</p>
    <p>Consumer discretion is advised.</p>
    
    <a id="warn-certify" class="warn-certify" href="/" onclick="return warnCertify();">Let me in.</a>

</div>

<script>
    window.onload = onLoad;

    function onLoad() {
        if (!window.URLSearchParams) {
            return;
        }
        
        var params = new URLSearchParams(window.location.search);
        if (!params.has(`redirectURI`))
        {
            return;
        }

        var redirectURI = params.get(`redirectURI`);

        document.getElementById(`warn-certify`).href = redirectURI;
    }

    function warnCertify() {
        window.localStorage.setItem('warned', true);
        return true;
    }

</script>

{{ end }}