-
Notifications
You must be signed in to change notification settings - Fork 0
/
performanceComponent.html
100 lines (92 loc) · 2.47 KB
/
performanceComponent.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
<template id="perf-comp">
<style type="text/css">
#perf{
display: flex;
flex-direction : column;
width : 400px;
height : 400px;
border : 2px solid black;
border-radius: 5px;
font-family: "Times New Roman", Georgia, Serif;
}
::content li{
list-style-type: none;
display: flex;
justify-content: center;
}
#code{
display : flex;
flex : 1;
background-color: cornsilk;
justify-content: center;
align-items : center;
}
#result-header{
display: flex;
height : 20px;
border-top: 1px solid black;
border-bottom: 1px solid black;
text-align: center;
}
#result-set{
display : flex;
height : 50px;
flex-flow : row wrap;
}
#result{
flex : 1;
}
.browser{
background-color: aquamarine;
}
.chrome{
background-color: antiquewhite;
}
.mozilla{
background-color: lightyellow;
}
.ie{
background-color: bisque;
}
hr{
margin : 0px;
}
</style>
<div id="perf">
<div id="code"><content select="code"></content></div>
<div id="result-header">
<div id="result" class="browser">Browser</div>
<div id="result" class="chrome">Chrome</div>
<div id="result" class="mozilla">Mozilla</div>
<div id="result" class="ie">IE</div>
</div>
<div id="result-set">
<div id="result" class="browser"><content select="li.firstBrowser"></content></div>
<div id="result" class="chrome"><content select="li.firstChrome"></content></div>
<div id="result" class="mozilla"><content select="li.firstMozilla"></content></div>
<div id="result" class="ie"><content select="li.firstIE"></content></div>
</div>
<hr/>
<div id="result-set">
<div id="result" class="browser"><content select="li.secBrowser"></content></div>
<div id="result" class="chrome"><content select="li.secChrome"></content></div>
<div id="result" class="mozilla"><content select="li.secMozilla"></content></div>
<div id="result" class="ie"><content select="li.secIE"></content></div>
</div>
</div>
</template>
<script type="text/javascript">
var thisdoc = document._currentScript.ownerDocument;
var template = thisdoc.getElementById("perf-comp");
var proto = Object.create(HTMLElement.prototype);
proto.createdCallback = function(){
this.setAttribute('role','performance-card')
};
proto.attachedCallback = function(){
var clone = document.importNode(template.content , true);
this.createShadowRoot().appendChild(clone);
};
document.registerElement('performance-card',{
prototype : proto
});
</script>>