From e1ef74cc1cd067d1629b9134aa163cb81bebbafb Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Sun, 5 May 2024 19:44:37 +0400 Subject: [PATCH] Simpliest frontend UI --- frontend/index.html | 34 +++++++++++++++++++++++++++++++++- frontend/script.js | 18 ++++++++++++++++++ frontend/style.css | 11 +++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 frontend/script.js create mode 100644 frontend/style.css diff --git a/frontend/index.html b/frontend/index.html index 7f153c0..e7d6623 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1 +1,33 @@ - + + + + + + musicdlp + + + + +
+ + +
+
+ +
+
+ +
+
+
+ +
+
+ +
+ + diff --git a/frontend/script.js b/frontend/script.js new file mode 100644 index 0000000..74a6ee1 --- /dev/null +++ b/frontend/script.js @@ -0,0 +1,18 @@ +addEventListener('DOMContentLoaded', () => { + /** @type{HTMLInputElement} */ + const urlField = document.getElementById('url') + /** @type{HTMLSelectElement} */ + const site = document.getElementById('site-select') + + document.getElementById('guess-site-btn').addEventListener('click', () => { + const url = urlField.value + if (url.includes('/watch?v=') || url.includes('/playlist?list=')) { + if (site.value == 'yt_proxied') { + return + } + site.value = 'youtube' + } else if (url.includes('://music.yandex.')) { + site.value = 'yandex' + } + }) +}) diff --git a/frontend/style.css b/frontend/style.css new file mode 100644 index 0000000..b2ec405 --- /dev/null +++ b/frontend/style.css @@ -0,0 +1,11 @@ +body { + margin: 0; + padding: 0.5rem; + + display: flex; + flex-direction: column; + align-items: center; + row-gap: 0.25rem; + + font-family: 'Noto Sans', 'Roboto', 'Ubuntu', sans-serif; +}