|
@@ -1,96 +0,0 @@
|
1
|
|
-<link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
|
2
|
|
-
|
3
|
|
-<template id="card-front">
|
4
|
|
- <style type='text/css'>
|
5
|
|
- :host {
|
6
|
|
- /* Fill the whole area of the shadow root */
|
7
|
|
- width: 100%;
|
8
|
|
- height: 100%;
|
9
|
|
- /* Border */
|
10
|
|
- padding: 6px;
|
11
|
|
- border-radius: 4px;
|
12
|
|
- box-sizing: border-box;
|
13
|
|
- /* Flex display of children */
|
14
|
|
- position: relative;
|
15
|
|
- display: flex;
|
16
|
|
- flex-direction: column;
|
17
|
|
- /* Font */
|
18
|
|
- font-family: 'Noto Sans', 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif;
|
19
|
|
- font-size: 8pt;
|
20
|
|
- }
|
21
|
|
-
|
22
|
|
- ::content > card-title:first-child {
|
23
|
|
- margin-top: -2px;
|
24
|
|
- margin-bottom: 4px;
|
25
|
|
- }
|
26
|
|
-
|
27
|
|
- ::content > card-title:last-child {
|
28
|
|
- margin-top: 4px;
|
29
|
|
- margin-bottom: -2px;
|
30
|
|
- }
|
31
|
|
- </style>
|
32
|
|
-
|
33
|
|
- <style type='text/css' id="color-style">
|
34
|
|
- :host {
|
35
|
|
- color: blue;
|
36
|
|
- background-color: blue;
|
37
|
|
- border-color: blue;
|
38
|
|
- }
|
39
|
|
- ::content card-rule /deep/ svg {
|
40
|
|
- fill: blue;
|
41
|
|
- }
|
42
|
|
-
|
43
|
|
- </style>
|
44
|
|
-
|
45
|
|
-
|
46
|
|
- <content></content>
|
47
|
|
-
|
48
|
|
-</template>
|
49
|
|
-
|
50
|
|
-<script>
|
51
|
|
- (function (window, document) {
|
52
|
|
- var elemName = 'card-front';
|
53
|
|
- var mainDoc = document;
|
54
|
|
- var importDoc = document.currentScript.ownerDocument;
|
55
|
|
-
|
56
|
|
- var proto = Object.create(HTMLElement.prototype);
|
57
|
|
- Object.defineProperty(proto, "color", {
|
58
|
|
- get: function () {
|
59
|
|
- return "";
|
60
|
|
- },
|
61
|
|
- set: function (value) {
|
62
|
|
- var root = this.shadowRoot;
|
63
|
|
- var style = root.getElementById("color-style");
|
64
|
|
- style.innerHTML = "\
|
65
|
|
- :host {\
|
66
|
|
- color: "+value+";\
|
67
|
|
- background-color: " + value + ";\
|
68
|
|
- border-color: " + value + ";\
|
69
|
|
- }\
|
70
|
|
- ::content card-rule /deep/ svg {\
|
71
|
|
- fill: " + value + ";\
|
72
|
|
- }\
|
73
|
|
- ::content card-boxes /deep/ svg rect {\
|
74
|
|
- stroke: " + value + ";\
|
75
|
|
- }\
|
76
|
|
- ";
|
77
|
|
- }
|
78
|
|
- });
|
79
|
|
- proto.createdCallback = function () {
|
80
|
|
- var template = importDoc.getElementById(elemName);
|
81
|
|
- var clone = mainDoc.importNode(template.content, true);
|
82
|
|
- var root = this.createShadowRoot();
|
83
|
|
- root.appendChild(clone);
|
84
|
|
-
|
85
|
|
- this.color = this.getAttribute('color') || "black";
|
86
|
|
- }
|
87
|
|
- proto.attributeChangedCallback = function (name, oldValue, newValue) {
|
88
|
|
- switch (name) {
|
89
|
|
- case "color": this.color = newValue; break;
|
90
|
|
- }
|
91
|
|
- }
|
92
|
|
-
|
93
|
|
- mainDoc.registerElement(elemName, { prototype: proto });
|
94
|
|
-
|
95
|
|
- })(window, document);
|
96
|
|
-</script>
|