-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathnodecg-widget-obs.html
94 lines (82 loc) · 2.45 KB
/
nodecg-widget-obs.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
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
<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../iron-pages/iron-pages.html">
<link rel="import" href="../nodecg-toast/nodecg-toast.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="nodecg-widget-obs-controls.html">
<link rel="import" href="nodecg-widget-obs-led.html">
<dom-module id="nodecg-widget-obs">
<template>
<style>
:host {
display: block;
}
#tabs {
--paper-tabs-selection-bar-color: #5BA664;
--paper-tabs-selection-bar: {
border-bottom-width: 5px;
};
}
.tab {
--paper-tab-ink: #5BA664;
--paper-tab: {
padding: 0;
@apply --layout-horizontal;
@apply --layout-center;
};
--paper-tab-content: {
border-left: 0.5px solid transparent;
border-right: 0.5px solid transparent;
font-size: 16px;
font-weight: bold;
min-width: 1px;
padding: 0 10px;
};
--paper-tab-content-unselected: {
background-color: #E8E8E8;
border-left: 0.5px solid #E8E8E8;
border-right: 0.5px solid #E8E8E8;
}
}
.tab-led {
@apply --layout-flex-none;
}
.tab-namespace {
@apply --layout-flex;
min-width: 1px;
overflow: hidden;
text-overflow: ellipsis;
}
paper-tab nodecg-widget-obs-led {
margin-right: 9px;
}
#pages {
padding: var(--nodecg-widget-obs-padding, 10px);
}
[hidden] {
display: none !important;
}
</style>
<paper-tabs id="tabs" selected="{{selected}}" hidden="[[_lessThan(numNamespaces, 2)]]">
<template is="dom-repeat" items="[[namespaces]]" as="namespace">
<paper-tab class="tab">
<nodecg-widget-obs-led class="tab-led" color="green"></nodecg-widget-obs-led>
<span class="tab-namespace" title="[[namespace]]">[[namespace]]</span>
</paper-tab>
</template>
</paper-tabs>
<iron-pages id="pages" selected="[[selected]]">
<template is="dom-repeat" items="[[namespaces]]" as="namespace">
<nodecg-widget-obs-controls
namespace="[[namespace]]"
on-status-changed="_handleControlsStatusChanged"
on-connected="_handleControlsConnected"
on-disconnected="_handleControlsDisconnected"
on-connection-failure="_handleControlsConnectionFailure">
</nodecg-widget-obs-controls>
</template>
</iron-pages>
<nodecg-toast id="toast"></nodecg-toast>
</template>
<script src="nodecg-widget-obs.js"></script>
</dom-module>