{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template theme_liquid/slider

    Front page slider.

    Example context (json):
    {
        "slidelink": "https://example.com",
        "slideimage": "https://example.com/image.jpg",
        "slidetext": "Example text."
    }
}}

<div class="frontpage-slider mb-5">
    <div class="swiper" data-swiper-options='{
    "spaceBetween": 0,
    "pagination": {
        "el": ".swiper-pagination",
        "type":  "progressbar"
    },
    "navigation": {
        "prevEl": ".btn-prev",
        "nextEl": ".btn-next"
    }
    }'>
        <div class="swiper-wrapper">
            {{#slides}}
                {{#slidestatus}}
                    <div class="swiper-slide">
                        {{#slidelink}}
                            <a href="{{{slidelink}}}" class="ratio ratio-16x9">
                                <div class="image-wrapper">
                                    {{#slideimage}}
                                        <img src="{{{slideimage}}}" alt="{{{slidetext}}}">
                                    {{/slideimage}}
                                    {{^slideimage}}
                                        <img src="{{config.wwwroot}}/theme/liquid/pix/sample_slider.webp" alt="{{{slidetext}}}">
                                    {{/slideimage}}
                                </div>
                                {{#slidetext}}
                                    <div class="content-wrapper">
                                        {{{slidetext}}}
                                    </div>
                                {{/slidetext}}
                            </a>
                        {{/slidelink}}
                        {{^slidelink}}
                            <div class="ratio ratio-16x9">
                                {{#slideimage}}
                                    <div class="image-wrapper">
                                        <img src="{{{slideimage}}}">
                                    </div>
                                {{/slideimage}}
                                {{#slidetext}}
                                    <div class="content-wrapper">
                                        {{{slidetext}}}
                                    </div>
                                {{/slidetext}}
                            </div>
                        {{/slidelink}}
                    </div>
                {{/slidestatus}}
            {{/slides}}
        </div>

        <button type="button" class="btn btn-prev btn-icon btn-sm btn-outline-primary rounded-circle" aria-label="Prev">
            <i class="fa fa-chevron-left"></i>
        </button>

        <button type="button" class="btn btn-next btn-icon btn-sm btn-outline-primary rounded-circle" aria-label="Next">
            <i class="fa fa-chevron-right"></i>
        </button>

        <div class="swiper-pagination"></div>
    </div>
</div>