From 5112ff5ae7291b16131f6805da2006e8869069d9 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 22 Jun 2020 00:14:28 +0100 Subject: [PATCH] Updated the client --- public/index.js | 5 +++++ public/style.css | 41 +++++++++++++++++++++++++++++-------- public/youtubedombuilder.js | 28 +++++++++++++++++-------- src/config.js | 4 ++-- 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/public/index.js b/public/index.js index 8ace029..174f002 100644 --- a/public/index.js +++ b/public/index.js @@ -5,6 +5,11 @@ let Socket = io(); console.log('Starting up'); })(); +function DownloadButtonPressed(format, id) +{ + alert(`${format} ${id}`); +} + const VideoInput = document.getElementById('VideosToRecord'); VideoInput.oninput = () => diff --git a/public/style.css b/public/style.css index 4e33f34..6af456b 100644 --- a/public/style.css +++ b/public/style.css @@ -34,19 +34,42 @@ h { font-weight: 400; } -#VideoContainer { - padding: 30px, 0px, 30px, 0px; +.table { + width: 60%; } -#VideoBox { - padding-top: 10px; - font-weight: lighter; +.thumbnail { + max-width: 150%; + height: auto; } -#Updater { - position: absolute; - top: 5px; - right: 10px;} +.videotitle { + font-size: 1rem; +} + +.channel { + font-size: 0.9rem; +} + +.views { + font-size: 0.9rem; +} + +.desc { + font-size: 0.8rem; + display: inline-block; + text-overflow: ellipsis; + word-wrap: break-word; + overflow: hidden; + line-height: 1.2em; + max-height: 2.4em; + font-style: italic; +} + +.downloadbuttons { + font-size: 0.8rem; + +} #copyright { position: absolute; diff --git a/public/youtubedombuilder.js b/public/youtubedombuilder.js index 5a1cc8e..c376f84 100644 --- a/public/youtubedombuilder.js +++ b/public/youtubedombuilder.js @@ -43,20 +43,32 @@ function ResolvedBasic(BasicResolution) function VideoElement(id, title, desc, views, thumbnail, channel, runtime) { - // assumes the div has already been created + + + // format views so theres commas + // in it ennit - Will is a stupid + // "Fuck you, of course it's a string" - b_boy_ww 2020 + views = parseInt(views); + views = views.toLocaleString('en-US'); + return ` - +
- - + + - - - + + + + - + + + + +
${title}${title}
${channel}${views}${runtime}${channel}${views} views
${desc}${desc}
`; diff --git a/src/config.js b/src/config.js index 5d5800a..2fda035 100644 --- a/src/config.js +++ b/src/config.js @@ -9,8 +9,8 @@ module.exports.Load = () => ListenPort: 8080, PublicDirectory: 'public', StorageDirectory: './tmp/', - CacheCleanInterval: 30000, // 5 mins - CacheTimeToUse: 60000, // 10 mins + CacheCleanInterval: 300000, // 5 mins + CacheTimeToUse: 600000, // 10 mins } Logger.Log('Configuration loaded'); }