forked from finos/perspective
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logo.js
65 lines (58 loc) · 1.33 KB
/
logo.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
import {render, html} from "lit-html";
class PerspectiveLogo extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({mode: "open"});
this._inverted = false;
render(this._template, shadowRoot);
}
get _template() {
return html`
${this._style}
<div class="outer">
<div class="inner">PER<span>SPECTIVE</span></div>
</div>
`;
}
get _style() {
let x = "",
y = "";
if (this._inverted) {
x = "background-";
} else {
y = "background-";
}
let content = `
:host .inner {
line-height: initial;
margin-bottom: -0.28em;
margin-top: -0.35em;
}
:host .outer {
overflow: hidden;
}
:host {
display: inline-block;
position: relative;
${x}color: rgb(249, 249, 249);
${y}color: #242526;
font-family: "Source Code Pro";
font-weight: bold;
font-size: 2em;
padding: 24px;
letter-spacing: -0.166em;
}
:host span {
padding-left: 0.05em;
margin-left: -0.05em;
${x}color: #242526;
${y}color: rgb(249, 249, 249);
}`;
return html`
<style>
${content}
</style>
`;
}
}
window.customElements.define("perspective-logo", PerspectiveLogo);