-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
168 lines (167 loc) · 7.2 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'; img-src 'self' data:; connect-src 'self' https://api.lifx.com;">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'; img-src 'self' data:; connect-src 'self' https://api.lifx.com;">
<title>LIFX</title>
<meta name="description" content="A simple app (unofficial) to control LIFX lights over the Internet.">
<meta name="author" content="Adam777">
<meta name="theme-color" content="#fff">
<link rel="manifest" href="./manifest.json">
<link rel="icon" type="image/png" href="./assets/images/icon.png">
<meta property="og:image" content="./assets/images/icon.png">
<link rel="stylesheet" href="./assets/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/css/bootstrap-icons.min.css">
<link rel="stylesheet" href="./assets/css/style.min.css">
<script src="./assets/js/bootstrap.bundle.min.js"></script>
<script src="./assets/js/script.min.js"></script>
</head>
<body>
<div class="container pt-3">
<div class="row">
<div class="col">
<h1>LIFX</h1>
</div>
<div id="top-container" class="col" style="display: none;">
<div class="d-flex justify-content-end align-items-center">
<div id="settings-only" style="display: none;">
<span id="app-version" class="me-3 align-middle">v1.1.0</span>
<a class="me-3" href="https://github.com/Adam777Z/lifx" target="_blank" rel="noopener noreferrer" title="View on GitHub"><i class="bi bi-github fs-2"></i></a>
</div>
<a id="reload-link" class="me-3" href="#" title="Reload" style="display: none;"><i class="bi bi-arrow-clockwise fs-2"></i></a>
<a class="settings-link" href="#" title="Settings"><i class="bi bi-gear-fill fs-2"></i></a>
</div>
</div>
</div>
<div id="error-alert" class="row" style="display: none;">
<div class="col">
<div class="alert alert-danger" role="alert">Error.</div>
</div>
</div>
<div id="token-alert" class="row" style="display: none;">
<div class="col">
<div class="alert alert-danger" role="alert">Please set your LIFX personal access token in <a class="settings-link" href="#"><i class="bi bi-gear-fill me-1"></i>Settings</a>.</div>
</div>
</div>
<div id="spinner-container" class="row" style="display: none;">
<div class="col d-flex justify-content-center">
<div class="spinner-border text-primary" style="width: 15rem; height: 15rem; border-width: 1rem;" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
</div>
<div id="section-settings" style="display: none;">
<div class="row">
<div class="col">
<div class="alert alert-primary" role="alert">Get your LIFX personal access token <a href="https://cloud.lifx.com/" target="_blank" rel="nofollow noopener noreferrer">here</a>.</div>
</div>
</div>
<div class="row">
<div class="col-auto">
<label for="lifx_app_token" class="col-form-label">LIFX personal access token</label>
</div>
<div class="col-auto">
<input type="password" id="lifx_app_token" class="form-control">
</div>
<div class="col-auto">
<button type="button" id="save-token" class="btn btn-primary">Save</button>
</div>
<div class="col-auto">
<button type="button" id="delete-token-btn" class="btn btn-danger" style="display: none;">Delete</button>
</div>
<div class="col-auto">
<button type="button" id="delete-all-settings-btn" class="btn btn-danger" style="display: none;">Delete all Settings</button>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-check">
<input type="checkbox" id="debug-enabled" class="form-check-input" value="1">
<label class="form-check-label" for="debug-enabled">Debug</label>
</div>
</div>
</div>
<div class="row">
<div class="col">
<button type="button" id="back-btn" class="btn btn-primary"><i class="bi bi-arrow-left-circle"></i> Back</button>
</div>
</div>
</div>
<div id="section-lights" style="display: none;">
<div class="row g-3 align-items-center mb-3">
<div class="col-auto">
<select id="lights" class="form-select" aria-label="Lights">
<option value="all">All</option>
</select>
</div>
</div>
</div>
<div id="section-main" style="display: none;">
<div class="row g-3 align-items-center mb-3">
<div class="col-auto">
<label class="form-check-label" for="power-switch"><i class="bi bi-power fs-2"></i></label>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="power-switch">
</div>
</div>
</div>
<div class="row g-3 align-items-center mb-3">
<div class="col-auto">
<button type="button" id="fade-btn" class="btn btn-primary">Fade on/off</button>
</div>
<div class="col-auto">
<label for="lifx_app_token" class="col-form-label">Duration</label>
</div>
<div class="col-auto">
<input type="number" id="duration-h" class="form-control d-inline-block" style="width: 70px;" step="1" min="0" max="23" value="0"> h
<input type="number" id="duration-m" class="form-control d-inline-block" style="width: 70px;" step="1" min="0" max="59" value="0"> m
<input type="number" id="duration-s" class="form-control d-inline-block" style="width: 70px;" step="1" min="0" max="59" value="0"> s
<div class="d-inline-block ms-2">
<div class="form-check form-check-inline ms-2 me-0 electron-only" style="display: none;">
<input class="form-check-input" type="checkbox" id="quit">
<label class="form-check-label" for="quit">Quit</label>
</div>
<div class="form-check form-check-inline ms-2 me-0 electron-windows-only" style="display: none;">
<input class="form-check-input" type="checkbox" id="lock">
<label class="form-check-label" for="lock">Lock</label>
</div>
<div class="form-check form-check-inline ms-2 me-0 electron-windows-only" style="display: none;">
<input class="form-check-input" type="checkbox" id="sleep">
<label class="form-check-label" for="sleep">Sleep</label>
</div>
</div>
</div>
</div>
<div class="row g-3 align-items-center">
<div class="col-auto">
<label for="brightness" class="form-label d-inline-block">Brightness</label>
</div>
<div class="col-auto">
<input type="range" id="brightness" class="form-range d-inline-block" step="0.01" min="0.01" max="1" value="1">
</div>
<div class="col-auto">
<span id="current-brightness" class="d-inline-block form-label pe-none"></span>
</div>
</div>
</div>
<div id="section-offline" style="display: none;">
<div class="row g-3 align-items-center mb-3">
<div class="col-auto">
<span id="status">Disconnected</span>
</div>
</div>
</div>
<div id="section-debug" style="display: none;">
<div class="row mt-3">
<div class="col">
<pre id="debug-info"></pre>
</div>
</div>
</div>
</div>
</body>
</html>