<x-app-layout>
    <div class="">
        <div class="banner d-block d-md-none text-center m-auto" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto">
                <!--banner-->
            </div>
        </div>
        <div class="banner d-none d-md-block d-lg-none text-center m-auto" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto">
                <!--banner-->
            </div>
        </div>
        <div class="banner d-none d-lg-block text-center" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto">
                <!--banner-->
            </div>
        </div>
        <div class="row page-stats-area">
            <div class="col item">
                <div class="content-box">
                    <p class="title">Energy Balance</p>
                    <p class="amount">{{ Auth::user()->energy }} <span>Energy</span></p>
                </div>
                <div class="icon-area blue">
                    <i class="fas fa-coins icon"></i>
                </div>
            </div>
            <div class="col item">
                <div class="content-box">
                    <p class="title">Available Links</p>
                    <p class="amount">{{ $links_count }}</p>
                </div>
                <div class="icon-area green">
                    <i class="fas fa-link icon"></i>
                </div>
            </div>
            <div class="col item">
                <div class="content-box sltstmp" id="1634497850">
                    <p class="title">Time left</p>
                    <p class="amount">{{ $date }}</p>
                </div>
                <div class="icon-area red">
                    <i class="fas fa-clock icon"></i>
                </div>
            </div>
        </div>
        <div class="banner d-block d-md-none text-center m-auto" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto"></div>
        </div>
        <div class="banner d-none d-md-block d-lg-none text-center m-auto" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto">
                <!--banner-->
            </div>
        </div>
        <div class="banner d-none d-lg-block text-center" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto">
                <!--banner-->
            </div>
        </div>
        <div class="shortlinks">
            <p class="title">Shortlinks</p>
            <a href="{{ route('shortlinks.history') }}">
                <div class="button">
                    <p class="view"><i class="fas fa-history" style="margin-right: 5px;"></i> History</p>
                </div>
            </a>
            <div class="clearfix"></div>
            <p class="description">By visiting the shortlinks below, you will get free Energy which you can use for
                claiming over our faucet! After you finish the process, you will get Energy in the shown amount next
                to the shortlink.</b></p>
            <div class="clearfix"></div>
            <div class="list">
                @foreach($links as $key=>$value)
                <div class="item">
                    @if($value->views > $value->visits)
                    <i class="fas fa-link icon green"></i>
                    @else
                    <i class="fas fa-link icon red"></i>
                    @endif
                    <div class="desc">
                        <p class="name">{{ $value->name }}<span class="badge badge-info">{{ $value->energy }}
                                Energy</span>
                            <span class="badge badge-secondary">{{ $value->points }} Level Points</span>
                            @if($value->nsfw == 1)
                            <span class="badge badge-warning">NSFW</span>
                            @endif
                        </p>
                        <p class="info">Views Left: <span
                                id="views">{{ $value->views-$value->visits }}/{{ $value->views }}</span></p>
                    </div>
                    @if($value->views > $value->visits)
                    <form name="visit{{ $value->id }}" id="visit{{ $value->id }}" target="_blank" method="POST"
                        action="{{ route('shortlinks.visit', $value->id) }}">
                        @csrf
                        <button type="submit" form="visit{{ $value->id }}" class="btn btn-success visit-button"><i
                                class="fas fa-external-link-alt" style="margin-right: 5px;"></i> VISIT</button>
                    </form>
                    @endif
                    <div class="clearfix"></div>
                </div>
                @endforeach
            </div>
            <div class="explanation-area">
                <p class="badge badge-info">Energy</p>
                <p class="text">After completing the shortlink process, you will get Energy in the amount of the
                    badges!</p>
                <div class="clearfix"></div>
                <p class="badge badge-secondary">Level Points</p>
                <p class="text">Points will be added to your level upon completion of each shortlink.</p>
                <div class="clearfix"></div>
                <p class="badge badge-warning">NSFW</p>
                <p class="text">These shortlinks include Pornographic images. You take the responsibility of seeing this
                    images with visiting those shortlinks!</p>
            </div>
        </div>
        <div class="banner d-block d-md-none text-center m-auto" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto">
                <!--banner-->
            </div>
        </div>
        <div class="banner d-none d-md-block d-lg-none text-center m-auto" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto"></div>
        </div>
        <div class="banner d-none d-lg-block text-center" style="margin-top: 30px;">
            <div class="d-inline-block text-center m-auto"></div>
        </div>
        <x-footer></x-footer>
    </div>
</x-app-layout>