Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Commit

Permalink
mobile support, fixes, improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
David Ralph committed Feb 20, 2022
1 parent 84e51e0 commit 7999ee2
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"bulma": "^0.9.3",
"cookie-session": "^2.0.0",
"eta": "^1.12.3",
"express": "^4.17.2",
"express-rate-limit": "^6.2.0",
"express": "^4.17.3",
"express-rate-limit": "^6.3.0",
"ini": "^2.0.0",
"leekslazylogger": "^4.1.4",
"node-vlc-http": "^1.2.0",
Expand Down
12 changes: 10 additions & 2 deletions src/modules/socket.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const helpers = require('./helpers');

module.exports = (io, vlc, refresh, config, log) => {
const checkDisconnect = (socket) => {
if (!socket.request.session.loggedIn && config.server.login_password !== 'NULL') {
Expand Down Expand Up @@ -101,9 +103,15 @@ module.exports = (io, vlc, refresh, config, log) => {
for (let i = 0; i < amount; i++) {
let newVolume;
if (type === 'decrease') {
newVolume = data[0].volume - 2;
if (Math.round(data[0].volume / 2.56) === 0) {
break;
}
newVolume = data[0].volume - 2.56;
} else if (type === 'increase') {
newVolume = data[0].volume + 2;
if (Math.round(data[0].volume / 2.56) === 100) {
break;
}
newVolume = data[0].volume + 2.56;
}
vlc.setVolume(newVolume);
data[0].volume = newVolume;
Expand Down
29 changes: 27 additions & 2 deletions src/public/assets/css/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
body {
touch-action: pan-y;
}

.shortcut {
background-color: #478ae2;
border-radius: 12px;
Expand All @@ -16,6 +20,7 @@

.controls {
margin-bottom: 1.5rem;
margin-top: 1.5rem;
}

.modal-card {
Expand All @@ -32,7 +37,11 @@
color: #ffffff;
}

.title, .subtitle, .label, .modal-card-title, .modal-card-body {
.title,
.subtitle,
.label,
.modal-card-title,
.modal-card-body {
color: #ffffff;
}

Expand All @@ -46,7 +55,8 @@
color: #ffffff !important;
}

.modal-card-head, .modal-card-foot {
.modal-card-head,
.modal-card-foot {
background-color: #363636;
}

Expand Down Expand Up @@ -97,3 +107,18 @@
margin-top: 10px;
display: none;
}

@media only screen and (max-width: 600px) {
.shortcut {
width: 25%;
margin: auto;
margin-bottom: 10px;
padding: 20px;
}

.modal-card {
width: 75%;
margin: auto;
margin-top: 50px;
}
}
3 changes: 2 additions & 1 deletion src/public/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const updating = document.getElementById('updating');
const submitbtn = document.getElementById('submitbtn');
const modal = document.getElementsByClassName('modal')[0];
const statusElement = document.getElementsByClassName('subtitle')[0];
const volumeslider = document.getElementById('volumeslider');

const showmodal = (type) => {
document.getElementById('volume-title').innerText = type + ' Volume';
Expand Down Expand Up @@ -46,7 +47,7 @@ const submitmodal = () => {
submitbtn.disabled = true;
};

document.getElementById('volumeslider').onchange = (e) => {
volumeslider.onchange = (e) => {
socket.emit('changevolumeexact', e.target.value);
}

Expand Down
4 changes: 3 additions & 1 deletion src/views/error.eta
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!DOCTYPE html>
<html>
<html lang='en'>

<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>vlc-bgm error</title>
<link rel='stylesheet' href='assets/css/bulma.min.css'>
<link rel='stylesheet' href='assets/css/index.css'>
Expand Down
8 changes: 5 additions & 3 deletions src/views/index.eta
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!DOCTYPE html>
<html>
<html lang='en'>

<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>vlc-bgm interface</title>
<link rel='stylesheet' href='assets/css/bulma.min.css'>
<link rel='stylesheet' href='assets/css/index.css'>
Expand Down Expand Up @@ -38,7 +40,7 @@
<p class='subtitle'>Volume control</p>
<div class='volumecontrol'>
<span>0%</span>
<input type='range' min='0' max='1000' value='50' step='10' name='volume' id='volumeslider'>
<input type='range' min='0' max='100' step='5' name='volume' id='volumeslider' value='<%= it.volume %>'
<span>100%</span>
</div>
</div>
Expand Down Expand Up @@ -71,7 +73,7 @@
<label for='amount'>Amount</label>
<br />
<span>1</span>
<input type='range' min='0' max='500' value='50' step='10' name='amount' id='amount'>
<input type='range' min='0' max='100' value='50' step='10' name='amount' id='amount'>
<span id='amountcurrent'>0 (50)</span>
<br />
<label for='speed'>Speed (ms)</label>
Expand Down
4 changes: 3 additions & 1 deletion src/views/licenses.eta
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!DOCTYPE html>
<html>
<html lang='en'>

<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>vlc-bgm licenses</title>
<link rel='stylesheet' href='assets/css/bulma.min.css'>
<link rel='stylesheet' href='assets/css/index.css'>
Expand Down
4 changes: 3 additions & 1 deletion src/views/login.eta
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!DOCTYPE html>
<html>
<html lang='en'>

<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>vlc-bgm login</title>
<link rel='stylesheet' href='assets/css/bulma.min.css'>
<link rel='stylesheet' href='assets/css/index.css'>
Expand Down

0 comments on commit 7999ee2

Please sign in to comment.