-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbutton.html
89 lines (83 loc) · 2.93 KB
/
button.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
<!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>Button 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="d-flex justify-content-center border p-4">
<!-- Provide target elements. -->
<div id="default-button"></div>
<div id="icon-button"></div>
<div id="small-gold-button"></div>
<div id="link-button"></div>
<div id="blank-link-button"></div>
</div>
</div>
<script>
// Setup and initialize button options.
AsuWebCore.initButton({
targetSelector: "#default-button",
props: {
label: "Default Button",
onClick: () => alert('Button clicked'),
},
});
AsuWebCore.initButton({
targetSelector: "#icon-button",
props: {
color: "gold",
icon: ["fab", "drupal"],
label: "Icon Button",
onClick: () => alert('Button clicked'),
},
});
AsuWebCore.initButton({
targetSelector: "#small-gold-button",
props: {
color: "gold",
label: "Small Gold Button",
onClick: () => alert('Button clicked'),
size: "small",
},
});
AsuWebCore.initButton({
targetSelector: "#link-button",
props: {
color: "maroon",
href: "/#example-link",
label: "Link Button",
},
});
AsuWebCore.initButton({
targetSelector: "#blank-link-button",
props: {
color: "maroon",
href: "/#example-link",
label: "Link Button",
target: "_blank",
},
});
</script>
<script src="./js/example-helper.js"></script>
</body>
</html>