forked from open-lms-open-source/moodle-theme_snap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarousel.mustache
More file actions
87 lines (78 loc) · 3.3 KB
/
carousel.mustache
File metadata and controls
87 lines (78 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{{!
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_boost/carousel
Example context (json):
{
"slides": [
{
"index": 1,
"active": "",
"name": "slide_one",
"image": "",
"title": "Slide title",
"subtitle": "Slide subtitle"
},
{
"index": 2,
"active": "",
"name": "slide_two",
"image": "",
"title": "Slide title",
"subtitle": "Slide subtitle"
}
]
}
}}
<section id="snap-site-carousel" class="carousel slide" data-ride="carousel" aria-label="{{covercarousellabel}}">
<span class="sr-only">{{carouselsronlytext}}</span>
<div class="carousel-inner" id="snap-carousel-container">
<!-- Previous and next buttons. -->
<div class="carousel-controls">
<a class="carousel-control-prev" href="#snap-site-carousel" role="button" data-slide="prev">
<i class="carousel-control-prev-icon fa-solid fa-circle-arrow-left" aria-hidden="true"></i>
<span class="sr-only">Previous slide</span>
</a>
<a class="carousel-control-next" href="#snap-site-carousel" role="button" data-slide="next">
<i class="carousel-control-next-icon fa-solid fa-circle-arrow-right" aria-hidden="true"></i>
<span class="sr-only">Next slide</span>
</a>
</div>
<!-- Carousel slides. -->
{{#slides}}
<div class="carousel-item carousel-{{name}} {{active}}">
<div class="carousel-slide" style="background-image:url({{{image}}});">
<div class="carousel-caption">
<h1>{{title}}</h1>
<p>{{subtitle}}</p>
</div>
</div>
</div>
{{/slides}}
</div>
<!-- Pause/resume button. -->
<div id="carousel-play-resume-buttons" class="{{carouselhidecontrols}}">
<button id="play-button" role="button" class="btn btn-default btn-xs" aria-label="{{carouselplaybutton}}">
<span class="icon fa fa-play fa-fw"></span>
</button>
<button id="pause-button" role="button" class="btn btn-default btn-xs" aria-label="{{carouselpausebutton}}">
<span class="icon fa fa-pause fa-fw"></span>
</button>
</div>
<div class="carousel-indicators js-only">
{{#slides}}
<button data-target="#snap-site-carousel" data-slide-to="{{index}}" class="{{active}}" aria-label="slide-{{index}}"></button>
{{/slides}}
</div>
</section>