-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
192 lines (180 loc) · 8.56 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!--
~ Copyright © 2018 Valentin Sickert
~ This work is free. You can redistribute it and/or modify it under the
~ terms of the Do What The Fuck You Want To Public License, Version 2,
~ as published by Sam Hocevar. See the LICENSE file or http://www.wtfpl.net/
~ for more details.
-->
<!--
~ Created by: Valentin Sickert
~ Date: 29.10.18 23:37
~ Project: cover-display
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="author" content="Valentin Sickert">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cover Display</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.5.13/css/mdb.min.css" rel="stylesheet">
<link href="./assets/css/easy-autocomplete.min.css" type="text/css" rel="stylesheet">
<link href="./assets/css/preloader.min.css" rel="stylesheet" type="text/css">
<link href="./assets/css/style.min.css" rel="stylesheet" type="text/css">
</head>
<body class="d-flex flex-column justify-content-center">
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
</div>
<div class="modal fade right" id="donationModal" tabindex="-1" role="dialog" aria-labelledby="donationModalLabel" aria-hidden="true" data-backdrop='false'>
<div class="modal-dialog modal-sm modal-side modal-top-right" role="document">
<div class="modal-content">
<div class="modal-header text-white elegant-color">
<h5 class="modal-title" id="donationModalLabel">You like this work?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body stylish-color text-white text-justify">
If you like my work I would appreciate a small donation.
I do this work in my free time.
</div>
<div class="modal-footer elegant-color py-1">
<a class="btn btn-dark-green mx-auto" href="https://paypal.me/lapotor" target="_blank"><i class="fas fa-hand-holding-usd"
style="font-size: 1.5em"></i> Donate</a>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col"></div>
<div class="col-md-6 col-12">
<h3 class="display-3 mb-0">
Cover Display
</h3>
<h3 class="mb-2">
<small class="text-muted"><em>by <a href="https://github.com/lapotor">Lapotor</a></em></small>
</h3>
<p class="text-justify mb-5">The artworks get loaded from <b>itunes.apple.com</b> directly in the clients browser. I have no rights on the those
artworks.</p>
<div class="md-form">
<input type="text" placeholder="Station Name" id="station" class="form-control" required>
<label for="station">Station Name</label>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<div class="md-form">
<i class="fas fa-arrows-alt-h prefix"></i>
<input type="number" id="width" class="form-control is-invalid">
<label for="width">
Width
</label>
<div class="invalid-feedback">
You need to fill that.
</div>
</div>
</div>
<div class="col-md-6">
<div class="md-form">
<i class="fas fa-arrows-alt-v prefix"></i>
<input type="number" id="height" class="form-control" aria-describedby="heightHelper">
<label for="height">
Height
</label>
<small id="heightHelper" class="form-text text-muted">
This field is optional. If not filled it will be set to the as "width".
</small>
</div>
</div>
</div>
</div>
<div class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" id="onAirShow">
<label class="custom-control-label" for="onAirShow">Show if your station is 'On Air' or 'Off Air'</label>
</div>
<select class="browser-default custom-select hidden" id="position">
<option selected disabled hidden>-- Select the display position --</option>
<option value="in">In cover</option>
<option value="bottom">Below cover</option>
</select>
<hr class="hr">
<div class="md-form mt-5">
<input type="text" id="url" class="form-control" value="" readonly>
<label for="url" class="disabled">Cover URL</label>
</div>
</div>
<div class="col"></div>
</div>
<div class="row">
<div class="col"></div>
<div class="col-md-6 col-12 text-right">
<small><i>This work is hosted on GitHub under the <a href="https://github.com/Lapotor/cover-display/blob/master/LICENSE">WTFPL</a>. Help on <a
href="https://github.com/Lapotor/cover-display/">GitHub.com</a></i></small>
<br/>
<small><i>The Site is hosted on GitHub. Their privacy policy can be found here: <a href="https://help.github.com/articles/github-privacy-statement/">GitHub
Privacy</a></i></small>
</div>
<div class="col"></div>
</div>
</div>
<script src="./assets/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.5.13/js/mdb.min.js"></script>
<script src="./assets/js/jquery.easy-autocomplete.min.js" type="text/javascript"></script>
<script type="text/javascript">
$.getJSON("https://api.laut.fm/stations", function (stations) {
$('body').addClass('loaded');
var options = {
data: stations,
getValue: "name",
list: {
match: {
enabled: true
},
}
};
$("#station").easyAutocomplete(options);
setTimeout(function () {
$('#donationModal').modal('show');
}, 5000);
});
</script>
<script type="text/javascript">
$(document).on("change paste keyup", "#station, #width, #height, #onAirShow, #position", function () {
if (!$("label[for='url']").hasClass("active")) {
$("label[for='url']").addClass("active")
}
let url = "https://cover.lapotor.de/cover.html?station=" + $("#station").val() + "&width=" + $("#width").val();
if (!($("#height").val() == null || $("#station").val() == 0 || $("#height").val() == "")) {
url = url + "&height=" + $("#height").val()
}
if ($('#onAirShow').is(':checked')) {
url = url + "&onair=true";
$('#position').removeClass('hidden');
if ($('#position').val() != 'null') {
if ($('#position').val() == 'in') {
url = url + "&position=in";
} else if ($('#position').val() == 'bottom') {
url = url + "&position=bottom";
}
}
} else {
$('#position').addClass('hidden');
}
if (!($("#width").val() == null || $("#width").val() == 0 || $("#width").val() == "")) {
$("#width").removeClass("is-invalid")
} else {
$("#width").addClass("is-invalid")
}
$("#url").attr("value", url)
})
</script>
</body>
</html>