diff --git a/package.json b/package.json index 6092f6b..e7e0bd1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/modules/socket.js b/src/modules/socket.js index e271034..53d3da6 100644 --- a/src/modules/socket.js +++ b/src/modules/socket.js @@ -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') { @@ -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; diff --git a/src/public/assets/css/index.css b/src/public/assets/css/index.css index 70fa40d..f56d00c 100644 --- a/src/public/assets/css/index.css +++ b/src/public/assets/css/index.css @@ -1,3 +1,7 @@ +body { + touch-action: pan-y; +} + .shortcut { background-color: #478ae2; border-radius: 12px; @@ -16,6 +20,7 @@ .controls { margin-bottom: 1.5rem; + margin-top: 1.5rem; } .modal-card { @@ -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; } @@ -46,7 +55,8 @@ color: #ffffff !important; } - .modal-card-head, .modal-card-foot { + .modal-card-head, + .modal-card-foot { background-color: #363636; } @@ -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; + } +} diff --git a/src/public/assets/js/index.js b/src/public/assets/js/index.js index 64d6abc..2d5ea20 100644 --- a/src/public/assets/js/index.js +++ b/src/public/assets/js/index.js @@ -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'; @@ -46,7 +47,7 @@ const submitmodal = () => { submitbtn.disabled = true; }; -document.getElementById('volumeslider').onchange = (e) => { +volumeslider.onchange = (e) => { socket.emit('changevolumeexact', e.target.value); } diff --git a/src/views/error.eta b/src/views/error.eta index 7d91088..a8ad7ba 100644 --- a/src/views/error.eta +++ b/src/views/error.eta @@ -1,7 +1,9 @@ - + + + vlc-bgm error diff --git a/src/views/index.eta b/src/views/index.eta index 94bdb68..bce02b7 100644 --- a/src/views/index.eta +++ b/src/views/index.eta @@ -1,7 +1,9 @@ - + + + vlc-bgm interface @@ -38,7 +40,7 @@

Volume control

0% - + 100%
@@ -71,7 +73,7 @@
1 - + 0 (50)
diff --git a/src/views/licenses.eta b/src/views/licenses.eta index 8423262..311fafb 100644 --- a/src/views/licenses.eta +++ b/src/views/licenses.eta @@ -1,7 +1,9 @@ - + + + vlc-bgm licenses diff --git a/src/views/login.eta b/src/views/login.eta index 44b07cd..c317b38 100644 --- a/src/views/login.eta +++ b/src/views/login.eta @@ -1,7 +1,9 @@ - + + + vlc-bgm login