-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathimage-gallery.html
106 lines (103 loc) · 4.16 KB
/
image-gallery.html
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
101
102
103
104
105
106
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Image Gallery Carousel- Example page</title>
<!-- CSS only -->
<link
rel="stylesheet"
href="https://asu.github.io/asu-unity-stack/@asu/unity-bootstrap-theme/css/unity-bootstrap-theme.bundle.css"
/>
<!-- Load FontAwesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/v4-shims.min.js"
integrity="sha512-1ND726aZWs77iIUxmOoCUGluOmCT9apImcOVOcDCOSVAUxk3ZSJcuGsHoJ+i4wIOhXieZZx6rY9s6i5xEy1RPg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- include bundled scripts from Preact packages -->
<script src="../dist/vendor.umd.js"></script>
<script src="../dist/asuCarousel.umd.js"></script>
</head>
<body>
<div class="container" style = "height: 600px;">
<div class="d-grid justify-content-center border p-4">
<!-- Provide target divs for two carousels. Must have unique ids or class name. -->
<div id="imageGalleryCarouselContainer"></div>
</div>
</div>
<script>
var myCarouselItems = [
{
id: 0,
imageSource: "https://source.unsplash.com/random/300x200??a=-1",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
{
id: 1,
imageSource: "https://source.unsplash.com/random/300x200??a=0",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
{
id: 2,
imageSource: "https://source.unsplash.com/random/300x200?a=1",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
{
id: 3,
imageSource: "https://source.unsplash.com/random/300x200??a=2",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
{
id: 4,
imageSource: "https://source.unsplash.com/random/300x200??a=3",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
{
id: 5,
imageSource: "https://source.unsplash.com/random/300x200??a=4",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
{
id: 6,
imageSource: "https://source.unsplash.com/random/300x200?a=5",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
{
id: 7,
imageSource: "https://source.unsplash.com/random/300x200??a=6",
imageAltText:
"Random image with caption below. REPLACE with appropriate alt text for accessibility.",
},
];
myCarouselItems = myCarouselItems.map((item, index) => ({
...item,
title: `Content ${index + 1}`,
content: `Body copy goes here. Limit to 5 lines max. Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua eiusmod tempo.`,
}));
// Setup and initialize the Image carousel.
AsuWebCarousel.initImageGalleryCarousel({
targetSelector: "#imageGalleryCarouselContainer",
props: {
perView: 2,
imageItems: myCarouselItems,
imageAutoSize: false,// default true
maxWidth: "600px",
hasContent: true,
},
});
</script>
<script src="./js/example-helper.js"></script>
</body>
</html>