forked from tiny-pilot/tinypilot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
status-bar.html
61 lines (54 loc) · 1.49 KB
/
status-bar.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
<template id="status-bar-template">
<style>
@import "css/style.css";
:host {
display: flex;
height: 31px;
flex-direction: row;
align-items: center;
padding: 0 1.25rem;
color: white;
font-size: 0.9rem;
background-color: var(--brand-metallic-medium);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.spacer {
flex: 1;
}
</style>
<div class="item">
<connection-indicator id="connection-indicator"></connection-indicator>
</div>
<div class="spacer"></div>
<div class="item">
<keystroke-history id="keystroke-history"></keystroke-history>
</div>
</template>
<script>
(function () {
const doc = (document._currentScript || document.currentScript)
.ownerDocument;
const template = doc.querySelector("#status-bar-template");
customElements.define(
"status-bar",
class extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: "open" });
this.shadowRoot.appendChild(template.content.cloneNode(true));
}
get connectionIndicator() {
return this.shadowRoot.getElementById("connection-indicator");
}
get keystrokeHistory() {
return this.shadowRoot.getElementById("keystroke-history");
}
}
);
})();
</script>