-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtestimonial.html
143 lines (136 loc) · 5.53 KB
/
testimonial.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!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>Testimonial component - 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>
<!-- *************************************************************** -->
<!-- Load React. -->
<script src="https://unpkg.com/react@18.3.1/umd/react.production.min.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.production.min.js" crossorigin></script>
<!-- *************************************************************** -->
<!-- include bundled scripts from packages -->
<script src="../dist/libCore.umd.js"></script>
</head>
<body>
<div class="container">
<div class="border p-4">
<!-- Provide target elements -->
<div id="default-testimonial"></div>
<div id="with-image-testimonial" class="border-top pt-2 mt-2"></div>
<div id="no-image-testimonial" class="border-top pt-2 mt-2"></div>
<div id="with-citation-testimonial" class="border-top pt-2 mt-2"></div>
<div id="highlight-gold-testimonial" class="border-top pt-2 mt-2"></div>
</div>
</div>
<script>
const itemColorCombinations = {
Gold: ["accent-gold"],
Maroon: ["accent-maroon"],
Gold_White_Text: ["text-white", "accent-gold"],
// eslint-disable-next-line quote-props
None: null,
};
const itemTitleColorCombinations = {
"Highlight gold": ["highlight-gold"],
"Highlight black": ["highlight-black"],
// eslint-disable-next-line quote-props
"None": null,
};
const itemQuoteColorCombinations = {
White: ["text-white"],
Maroon: ["text-maroon"],
None: null,
};
// Setup and initialize testimonial options.
AsuWebCore.initTestimonial({
targetSelector: "#default-testimonial",
props: {
quote: {
content: `We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.`,
cite: {
name: `Thomas Jefferson`,
description: `The Declaration of Independence`,
},
},
},
});
AsuWebCore.initTestimonial({
targetSelector: "#with-image-testimonial",
props: {
quote: {
content: `I used to wonder about that myself. Thought it was a bunch of mumbo-jumbo. A magical power holding together good and evil, the dark side and the light? Crazy thing is, it’s true. The Force, the Jedi — all of it. It’s all true.`,
cite: {
name: `Han Solo`,
},
},
imageSource: "https://placeimg.com/400/400/tech",
altText: "Pretend this is Han Solo",
itemStyle: {
containerCssClass: itemColorCombinations.Gold,
contentCssClass: itemQuoteColorCombinations.none,
},
},
});
AsuWebCore.initTestimonial({
targetSelector: "#no-image-testimonial",
props: {
quote: {
content: `Computers make excellent and efficient servants, but I have no wish to serve under them.`,
cite: {
name: `Spock`,
description: `First officer, USS Enterprise`,
},
},
itemStyle: {
containerCssClass: itemColorCombinations.Gold,
},
},
});
AsuWebCore.initTestimonial({
targetSelector: "#with-citation-testimonial",
props: {
quote: {
content: `ASU is a comprehensive public research university, measured not by whom we exclude, but rather by whom we include and how they succeed; advancing research and discovery of public value; and assuming fundamental responsibility for the economic, social, cultural and overall health of the communities it serves.`,
cite: {
name: `Michael M. Crow`,
description: `ASU Charter`,
},
},
imageSource: "https://placeimg.com/400/400/any",
altText: "Pretend this is Michael M. Crow, President of ASU",
itemStyle: {
containerCssClass: itemColorCombinations.Gold,
},
},
});
AsuWebCore.initTestimonial({
targetSelector: "#highlight-gold-testimonial",
props: {
quote: {
title: "Walt Disney",
content:
"Laughter is timeless, imagination has no age, dreams are forever.",
},
imageSource: "https://placeimg.com/300/300/nature",
altText: "Image of Walt DisneyImage of Walt Disney",
itemStyle: {
containerCssClass: itemColorCombinations.Gold,
titleCssClass: itemTitleColorCombinations["Highlight gold"],
},
},
});
</script>
<script src="./js/example-helper.js"></script>
</body>
</html>