-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvo-merklogo.js
134 lines (122 loc) · 5.92 KB
/
vo-merklogo.js
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
import {LitElement, html} from './node_modules/vodomg-litelement/@polymer/lit-element/lit-element.js';
/**
* `vo-merklogo` Het logo van de Vlaamse overheid
*
* @customElement
* @polymer
* @demo demo/vo-merklogo.html
*/
class VoMerklogo extends LitElement {
static get properties() {
return {
/**
* Achtergrondkleur in hex, rgb or rgba.
*/
kleur: String,
/**
* Tekst die naast het logo zal gerenderd worden.
*/
tekst: String
};
}
/**
* Rendert het element.
*
* @return {TemplateResult}
*/
render() {
return html`
<style>
:host {
display: flex;
flex-grow: 0;
flex-shrink: 0;
}
#leeuw {
display: block;
position: relative; /* nodig voor position:absolute van :after */
height: 0;
width: 0;
flex-grow: 0;
flex-shrink: 0;
border-style: solid;
border-bottom-width: 44px;
border-left-width: 29px;
border-top-width: 0;
border-right-width: 16px;
border-color: rgb(228, 228, 228);
border-right-color: transparent !important;
}
#leeuw:after {
content: '';
display: block;
position: absolute;
right: 2px;
top: 9px;
height: 27px;
width: 17px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAbCAYAAACa9mScAAAEk0lEQVR42pxV228UVRyendnt3mb2fpm9dtvdtrDixmrSIN4SNfiEJSXBB9MQkWBMJKjhBR8Mf4DwpA8kKglqKBgSrSUkEpsgSIwPoC3strSL3V7YS7d7m73MXmbX76zsppqK6CRnZs6cc77f9/t+l6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ODldhU9Igp4kqfQBEfUJUQNWW05dJLJDymNzcakrlVHqqtt00Raz2rgsMcNl2/ke8mmsG9/yYs+NS/j0MgdH7/MR0n4v4LHhSO8beAfG6r0tw+/LYB8Xh4Xfy95GxL6+R0p9rBvfkZvN36TCNhTxC+ZswPP+shP8C3JdS3P7BbllzRX+AW4mIELSL5qxAAAAAElFTkSuQmCC');
background-size: 17px 27px;
}
#tekst {
display: flex;
align-self: stretch;
flex-direction: column;
justify-content: flex-start;
font-family: "Flanders Art", Calibri, sans-serif;
}
#hoofdlijn {
font-size: 15px;
line-height: 15px;
margin-top: 11px;
margin-right: 11px;
}
#bijlijn {
font-size: 8px;
line-height: 8px;
margin-top: -2px;
margin-left: 2px;
}
</style>
<div id="leeuw"></div>
${this._tekstTemplate}
`;
}
/**
* Kijkt naar welke properties aangepast zijn, en verwerkt deze aanpassingen.
*
* @param changedProperties
*/
updated(changedProperties) {
if (changedProperties.has('kleur')) {
this._wijzigAchtergrondKleur(this.kleur);
}
}
/**
* Wijzigt de achtergrondkleur naar de `kleur` als die bepaald is.
*
* @param kleur
* @private
*/
_wijzigAchtergrondKleur(kleur) {
this.style.backgroundColor = kleur;
}
/**
* Genereert en geeft de tekst template.
*
* @return {TemplateResult}
*/
get _tekstTemplate() {
if (this.tekst) {
return html`
<div id="tekst">
<div id="hoofdlijn">Vlaanderen</div>
<div id="bijlijn">${this.tekst}</div>
</div>
`;
}
}
}
customElements.define('vo-merklogo', VoMerklogo);