-
-
Notifications
You must be signed in to change notification settings - Fork 289
Expand file tree
/
Copy pathstatus-bar.html
More file actions
75 lines (67 loc) · 1.87 KB
/
status-bar.html
File metadata and controls
75 lines (67 loc) · 1.87 KB
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
<template id="status-bar-template">
<style>
@import "css/style.css";
:host {
display: flex;
height: 31px; /* Needs to be in sync with on-screen keyboard offset */
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="item">
<!-- prettier-ignore -->
<video-stream-indicator
id="video-stream-indicator"
{% if use_webrtc_remote_screen %}
desired-mode="H264"
{% else %}
desired-mode="MJPEG"
{% endif %}
></video-stream-indicator>
</div>
<div class="spacer"></div>
<div class="item">
<keystroke-history id="keystroke-history"></keystroke-history>
</div>
</template>
<script type="module">
(function () {
const template = document.querySelector("#status-bar-template");
customElements.define(
"status-bar",
class extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: "open" }).appendChild(
template.content.cloneNode(true)
);
}
get connectionIndicator() {
return this.shadowRoot.getElementById("connection-indicator");
}
get videoStreamIndicator() {
return this.shadowRoot.getElementById("video-stream-indicator");
}
get keystrokeHistory() {
return this.shadowRoot.getElementById("keystroke-history");
}
}
);
})();
</script>