-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.htm
82 lines (74 loc) · 1.84 KB
/
index.htm
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
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.0.22/webcomponents-lite.js"></script>
<script type="text/javascript" src="source/smart.element.js"></script>
<script>
Smart('smart-test', class TestElement extends Smart.BaseElement {
// properties.
static get properties() {
return {
'content': {
type: 'string'
}
};
}
static get listeners() {
return {
'click': '_clickHandler'
};
}
/** Changes the check state wneh widget container is clicked. */
_clickHandler(event) {
const that = this;
this.content = "Thanks for clicking me!";
}
/** Element's template. */
template() {
return '<div inner-h-t-m-l=\'[[content]]\'></div>';
}
/** Called when the element is ready. Used for one-time configuration of the Checkbox. */
ready() {
super.ready();
}
propertyChangedHandler(propertyName, oldValue, newValue) {
super.propertyChangedHandler(propertyName, oldValue, newValue);
}
});
</script>
<style>
.smart-container {
box-sizing: border-box;
font-family: inherit;
font-size: inherit;
display: block;
width: 100%;
height: 100%;
outline: none;
margin: 0;
padding: 0;
}
.smart-container * {
box-sizing: border-box;
}
smart-test {
background: #6200EE;
color: #fff;
display: inline-block;
border-radius: 5px;
border: 1px solid #6200EE;
text-align: center;
cursor: pointer;
padding: 5px 10px;
transition: all 0.3s;
}
smart-test:hover {
background: #FF0095;
border-color: #FF0095;
}
</style>
</head>
<body>
<smart-test content="Hello! I am Smart Element. You can click me."></smart-test>
</body>
</html>