-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlayout.html
More file actions
100 lines (88 loc) · 3.13 KB
/
Copy pathlayout.html
File metadata and controls
100 lines (88 loc) · 3.13 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
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Layout options - macro-carousel demo</title>
<link rel="stylesheet" href="css/third-party/prism.css">
<link rel="stylesheet" href="css/demo.css">
</head>
<body>
<h1 id="title">Layout options</h1>
<a id="backToIndex" href="index.html">See all demos</a>
<template id="demoTemplate">
<style>
macro-carousel {
/* Removing the gap bewteen slides */
--macro-carousel-gap: 0px;
/* Setting a minimum and a maximum height for the slides */
--macro-carousel-slide-min-height: 200px;
--macro-carousel-slide-max-height: 400px;
/*
* Horizontal padding ensures that the navigation buttons don't
* overlap with the slides.
*/
padding: 0 60px;
margin: 0 10px;
}
/*
* All slides by default, will stretch to fill all the available space.
* The height of the slider (and therefore of the slides) is set by either
* assigning a height to the slides, or to the x-slides.
* In this example, .slide:nth-child(2) is responsible for pushing the
* height of the slider to 400px.
*/
.slide {
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(to bottom right, #c6f7cc, #6f9874);
box-shadow: inset 0px 0px 20px 0px rgba(0, 0, 0, .05);
color: white;
font-size: 5em;
font-family: sans-serif;
}
/*
* Chaning the align-self property on the slides changes their vertical
* alignment. CHaning this property also means that the slides won't
* stretch to fill all the available space in its container — it will
* therefore assume its minimum height, set via the
* --macro-carousel-slide-min-height property.
*/
.slide:nth-child(1) {
align-self: flex-start;
}
/*
* This slide will be 400px height (because of the
* --macro-carousel-slide-max-height property).
*
*/
.slide:nth-child(2) {
height: 500px;
}
/* Same as per .slide:nth-child(1) */
.slide:nth-child(3) {
align-self: center;
}
/* Same as per .slide:nth-child(1) */
.slide:nth-child(5) {
align-self: flex-end;
}
</style>
<macro-carousel slides-per-view="3" navigation>
<article class="slide">Slide 1</article>
<article class="slide">Slide 2</article>
<article class="slide">Slide 3</article>
<article class="slide">Slide 4</article>
<article class="slide">Slide 5</article>
<article class="slide">Slide 6</article>
</macro-carousel>
</template>
<script defer src="js/third-party/inert.min.js"></script>
<script defer src="js/third-party/focus-visible.js"></script>
<script defer src="js/third-party/prism.js" data-manual></script>
<script defer src="js/third-party/webcomponents-bundle.js"></script>
<script defer src="js/demo.js"></script>
</body>
</html>