{% extends "wide/layout.html.twig" %}

{% block content %}
    <div id="home">
        <h1 class="title">{{ name|default('Paytoshi Faucet') }}</h1>
        <h3 class="headline">{{ description|default('...faucet? Paytoshi!') }}</h3>
        <hr />
        <div class="custom-content">
            {{ content.header_box|raw }}
        </div>
        <hr />
        <div class="faucet">
            {% include "default/alerts.html.twig" %}
            <div class="rewards">
                <h3>Claim your reward</h3>

                <div class="reward-list">
                    {% for r in rewards %}
                        <span class="reward">{{ r.amount }}</span>
                    {% endfor %}
                </div>
                <div class="rewards_average">(Average: {{ rewards_average }} satoshi)</div>
                <h4>Get a reward every {{ waiting_interval / 60 }} mins!</h4>
            </div>

            <hr>

            <form action="{{ urlFor('reward') }}" novalidate="novalidate" method="POST" class="form">
                <div class="form-group">
                    <div class="lead">
                        Enter your Bitcoin address
                    </div>
                    <input class="form-control input-lg" type="text" name="address" 
                           value="{% if address is defined %}{{ address }}{% endif %}" 
                           placeholder="Bitcoin address">
                </div>

                <div class="custom-content">
                    {{ content.center1_box|raw }}
                </div>

                <div class="form-group captcha">
                    <center>
                        {% include "default/" ~ captcha.name ~ ".html.twig" with { server: captcha.server, public_key: captcha.public_key } %}
                    </center>
                </div>

                <div class="custom-content">
                    {{ content.center2_box|raw }}
                </div>

                <h3>What is a Bitcoin Faucet?</h3>
                <p>
                    A faucet is a FREE Bitcoin site paying out up to {{ rewards_max }} satoshi every hour. Each time you visit this page and complete the captcha you will receive a payout amount randomly selected from the available amounts shown above. You will receive your payment directly to your <a href="https://paytoshi.org">Paytoshi wallet.</a><br/>
                    <a href="{{ urlFor('faq') }}">Read more</a>
                </p>

                <button class="form-control input-lg btn-info get-reward">Get a reward!</button>
                <input type="hidden" name="referral" value="{{ referral }}">

                <div class="custom-content">
                    {{ content.center3_box|raw }}
                </div>

            </form>

            <div class="well well-sm referral-box">Earn {{ referral_percentage }}% referral bonus! 
                Share your referral URL:<br>{{ base_url ~ '/?r=' ~ address|default('Bitcoin Address') }}</div>

        </div>
    </div>
{% endblock %}