From 1123bed31807d7d3efd80368315cdec62997f43a Mon Sep 17 00:00:00 2001 From: Nadir Technologies Date: Sat, 30 Dec 2023 17:10:52 +0000 Subject: [PATCH] UI improvements --- player.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/player.js b/player.js index dd3de12..5f77882 100644 --- a/player.js +++ b/player.js @@ -130,18 +130,30 @@ function analyse() { var r = Math.round(highVolume / 255 * 100); if (r < 10) { + r = `00${r}`; + } + + else if (r < 100) { r = `0${r}`; } var g = Math.round(midVolume / 255 * 100); if (g < 10) { + g = `00${g}`; + } + + else if (g < 100) { g = `0${g}`; } var b = Math.round(lowVolume / 255 * 100); if (b < 10) { + b = `00${b}`; + } + + else if (r < 100) { b = `0${b}`; } @@ -162,18 +174,30 @@ function analyse() { var r = Math.round(midVolume / 255 * 100); if (r < 10) { + r = `00${r}`; + } + + else if (r < 100) { r = `0${r}`; } var g = Math.round(lowVolume / 255 * 100); if (g < 10) { + g = `00${g}`; + } + + else if (g < 100) { g = `0${g}`; } var b = Math.round(highVolume / 255 * 100); if (b < 10) { + b = `00${b}`; + } + + else if (r < 100) { b = `0${b}`; } @@ -194,18 +218,30 @@ function analyse() { var r = Math.round(lowVolume / 255 * 100); if (r < 10) { + r = `00${r}`; + } + + else if (r < 100) { r = `0${r}`; } var g = Math.round(midVolume / 255 * 100); if (g < 10) { + g = `00${g}`; + } + + else if (g < 100) { g = `0${g}`; } var b = Math.round(highVolume / 255 * 100); if (b < 10) { + b = `00${b}`; + } + + else if (r < 100) { b = `0${b}`; } @@ -225,18 +261,30 @@ function analyse() { var r = Math.round((midVolume * 2) / 255 * 100); if (r < 10) { + r = `00${r}`; + } + + else if (r < 100) { r = `0${r}`; } var g = Math.round(highVolume / 255 * 100); if (g < 10) { + g = `00${g}`; + } + + else if (g < 100) { g = `0${g}`; } var b = Math.round((lowVolume / 2) / 255 * 100); if (b < 10) { + b = `00${b}`; + } + + else if (b < 100) { b = `0${b}`; }