-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
170 lines (168 loc) · 5.91 KB
/
index.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link href="css/bootstrap.min.css" rel="stylesheet"> -->
<link href="css/bootstrap-theme.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<script src="js/vue.js"></script>
<link rel="icon" type="image/png" href="img/icon-192.png">
<link rel="apple-touch-icon" href="img/icon-192.png">
<link rel="manifest" href="/manifest.json">
<title>Sonos Home</title>
<style>
.btn {
margin-right: 10px;
}
input.volume[type=range] {
width: 50%;
min-width: 100px;
}
.input-group.volume {
width: 50%;
min-width: 100px;
}
a.selector {
cursor: pointer;
}
span.refresh {
margin-top: 10px;
margin-right: 10px;
cursor: pointer;
font-size: 20px;
}
</style>
</head>
<body>
<div class="container-fluid" id="app">
<span class="navbar-right glyphicon glyphicon-refresh refresh" v-on:click="update"></span>
<ul class="nav nav-tabs">
<li v-for="zone in zones" role="presentation" v-bind:class="{active : zone.isActive}" v-on:click="switchZoneController(zone)"><a href="#">{{zone.name}}</a></li>
</ul>
<div class="container-fluid">
<zone-page
v-if="zones.length"
v-bind:zone="zones | activeZone"
v-bind:players="allPlayers"
inline-template>
<div class="row">
<div class="col-sm-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Player</h3>
</div>
<div class="panel-body">
<div class="btn-group-vertical" role="group" aria-label="Player List">
<button type="button" class="btn"
v-bind:class="{
'btn-success': player.isActive,
'btn-default': !player.isActive
}"
v-for="player in players"
v-on:click="changePlayerZone(player, zone)">
{{player.player.name}}
<span class="glyphicon pull-right"
v-bind:class="{
'glyphicon-unchecked': !player.isActive,
'glyphicon-check': player.isActive
}" aria-hidden="true"></span>
</button>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Volume</h3>
</div>
<div class="panel-body">
<li v-for="player in players" v-if="player.isActive">
<label>{{player.player.name}}:</label>
<input type="range" min="0" max="100" v-model="player.player.volume" v-on:change="changeVolume(player)" class="volume">
<div class="input-group volume">
<input type="text" class="form-control" placeholder="23" v-model="player.player.volume">
<span class="input-group-btn">
<button class="btn btn-default" type="button" v-on:click="changeVolume(player)">Set!</button>
</span>
</div>
</li>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title" v-if="zone.isPlaying">Currently Playing</h3>
<h3 class="panel-title" v-if="!zone.isPlaying">Currently Paused</h3>
</div>
<div class="panel-body">
<button type="button" class="btn"
v-bind:class="{
'btn-warning': zone.isPlaying,
'btn-success': !zone.isPlaying
}"
v-on:click="playPause(zone)">
<span class="glyphicon"
v-bind:class="{
'glyphicon glyphicon-play': !zone.isPlaying,
'glyphicon glyphicon-pause': zone.isPlaying
}" aria-hidden="true">
</span>
<span v-if="zone.isPlaying">Pause</span>
<span v-if="!zone.isPlaying">Play</span>
</button>
</div>
</div>
</div>
</div>
</zone-page>
<div class="row">
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Radio stations</h3>
</div>
<div class="panel-body">
<div class="list-group">
<a class="list-group-item selector" v-for="radio in radiostations" v-on:click="playRadio(radio)">
{{radio.name}}
</a>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Favorites</h3>
</div>
<div class="panel-body">
<div class="list-group">
<a class="list-group-item selector" v-for="favorite in favorites" v-on:click="playRadio(favorite)">
{{favorite.name}}
</a>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Custom URL</h3>
</div>
<div class="panel-body">
<div class="input-group">
<input type="text" class="form-control" placeholder="http://www.esbme.com/musicstream.mp3" id="costumURL">
<span class="input-group-btn">
<button class="btn btn-default" type="button" v-on:click="playURL">Play!</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<script src="js/app.js"></script>