+ `).join("");
+
+ document.querySelectorAll(".song").forEach((songElement, index) => {
+ songElement.addEventListener("click", () => {
+ getIndex(index)
+ console.log('индекс', index);
+
+ playSong(songs[index]);
+ });
+ });
+};
+
+// Функция для фильтрации треков на основе поискового запроса
+export const searchSongs = (query) => {
+ query = query.toLowerCase();
+ filteredSongs = songs.filter(song =>
+ song.title.toLowerCase().includes(query) ||
+ song.artist.toLowerCase().includes(query)
+ );
+ initializePlayer(filteredSongs);
+ renderSongs(filteredSongs); // Перерисовываем список на основе результатов поиска
+};
\ No newline at end of file
diff --git a/js/upload.js b/js/upload.js
new file mode 100644
index 0000000..2022782
--- /dev/null
+++ b/js/upload.js
@@ -0,0 +1,28 @@
+export const AddNewSongs = () => {
+ document.getElementById('uploadForm').addEventListener('submit', function (event) {
+ event.preventDefault();
+
+ const title = document.getElementById('title').value;
+ const artist = document.getElementById('artist').value;
+ const audioFile = document.getElementById('audio').files[0];
+ const cover = document.getElementById('cover').value;
+
+ const formData = new FormData();
+ formData.append('title', title);
+ formData.append('artist', artist);
+ formData.append('audio', audioFile);
+ formData.append('cover', cover);
+
+ fetch('http://127.0.0.1:5000/upload', {
+ method: 'POST',
+ body: formData
+ })
+ .then(response => response.json())
+ .then(data => {
+ document.getElementById('message').innerText = data.message;
+ })
+ .catch(error => {
+ document.getElementById('message').innerText = 'Error: ' + error.message;
+ });
+ });
+};
diff --git a/js/utils.js b/js/utils.js
new file mode 100644
index 0000000..ac551e1
--- /dev/null
+++ b/js/utils.js
@@ -0,0 +1,34 @@
+export const formatTime = (time) => {
+ const minutes = Math.floor(time / 60);
+ const seconds = Math.floor(time % 60).toString().padStart(2, "0");
+ return `${minutes}:${seconds}`;
+};
+
+export const shuffle = (array) => {
+ for (let i = array.length - 1; i > 0; i--) {
+ const j = Math.floor(Math.random() * (i + 1));
+ [array[i], array[j]] = [array[j], array[i]];
+ }
+ return array;
+};
+
+// Изменение цвета вслед за точкой на временной шкале
+
+
+// Функция для обновления значения кастомного свойства CSS
+export function updateBackground(rangeInput) {
+ const value = rangeInput.value;
+ const min = rangeInput.min ? rangeInput.min : 0;
+ const max = rangeInput.max ? rangeInput.max : 100;
+ const percentage = (value - min) / (max - min) * 100;
+
+ rangeInput.addEventListener('mousedown', function () {
+ rangeInput.style.setProperty('--thumb-width', '10px');
+ })
+
+ rangeInput.addEventListener('mouseup', function () {
+ rangeInput.style.setProperty('--thumb-width', '0px');
+ })
+
+ rangeInput.style.setProperty('--value', `${percentage}%`);
+}
\ No newline at end of file
diff --git a/js/visualizer.js b/js/visualizer.js
new file mode 100644
index 0000000..d1bee92
--- /dev/null
+++ b/js/visualizer.js
@@ -0,0 +1,31 @@
+export const startVisualizer = (VisualizerAudio, audioContext) => {
+ const analyser = audioContext.createAnalyser();
+ analyser.fftSize = 256;
+
+ const source = audioContext.createMediaElementSource(VisualizerAudio);
+ source.connect(analyser);
+ analyser.connect(audioContext.destination);
+
+ const canvas = document.getElementById("visualizerCanvas");
+ const ctx = canvas.getContext("2d");
+
+ function renderFrame() {
+ requestAnimationFrame(renderFrame);
+ const bufferLength = analyser.frequencyBinCount;
+ const dataArray = new Uint8Array(bufferLength);
+ analyser.getByteFrequencyData(dataArray);
+
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ const barWidth = (canvas.width / bufferLength) * 2.5;
+ let x = 0;
+
+ dataArray.forEach((value) => {
+ const barHeight = value / 2;
+ ctx.fillStyle = `rgb(${value + 100}, 50, 150)`;
+ ctx.fillRect(x, canvas.height - barHeight, barWidth, barHeight);
+ x += barWidth + 1;
+ });
+ }
+
+ renderFrame();
+};
diff --git a/media/ANNA TSUCHIYA - Rose.mp3 b/media/ANNA TSUCHIYA - Rose.mp3
deleted file mode 100644
index 23aa9a0..0000000
Binary files a/media/ANNA TSUCHIYA - Rose.mp3 and /dev/null differ
diff --git a/media/Ado - Odo.mp3 b/media/Ado - Odo.mp3
deleted file mode 100644
index 0355831..0000000
Binary files a/media/Ado - Odo.mp3 and /dev/null differ
diff --git a/media/Ado - Show.mp3 b/media/Ado - Show.mp3
deleted file mode 100644
index 09ffac2..0000000
Binary files a/media/Ado - Show.mp3 and /dev/null differ
diff --git a/media/Ado - Unravel.mp3 b/media/Ado - Unravel.mp3
deleted file mode 100644
index cd35a97..0000000
Binary files a/media/Ado - Unravel.mp3 and /dev/null differ
diff --git a/media/Ado - Usseewa.mp3 b/media/Ado - Usseewa.mp3
deleted file mode 100644
index db52081..0000000
Binary files a/media/Ado - Usseewa.mp3 and /dev/null differ
diff --git a/media/Animadrop - Stuck in a Timeloop.mp3 b/media/Animadrop - Stuck in a Timeloop.mp3
deleted file mode 100644
index b16ac65..0000000
Binary files a/media/Animadrop - Stuck in a Timeloop.mp3 and /dev/null differ
diff --git a/media/Apashe - Work (ft. Vo Williams).mp3 b/media/Apashe - Work (ft. Vo Williams).mp3
deleted file mode 100644
index 3f8c13d..0000000
Binary files a/media/Apashe - Work (ft. Vo Williams).mp3 and /dev/null differ
diff --git a/media/Asper X - Bad Trip.mp3 b/media/Asper X - Bad Trip.mp3
deleted file mode 100644
index 837126f..0000000
Binary files a/media/Asper X - Bad Trip.mp3 and /dev/null differ
diff --git a/media/BABYMETAL - BxMxC.mp3 b/media/BABYMETAL - BxMxC.mp3
deleted file mode 100644
index cb305db..0000000
Binary files a/media/BABYMETAL - BxMxC.mp3 and /dev/null differ
diff --git a/media/BABYMETAL - Divine Attack - Shingeki.mp3 b/media/BABYMETAL - Divine Attack - Shingeki.mp3
deleted file mode 100644
index 03668cb..0000000
Binary files a/media/BABYMETAL - Divine Attack - Shingeki.mp3 and /dev/null differ
diff --git a/media/BABYMETAL - Karate.mp3 b/media/BABYMETAL - Karate.mp3
deleted file mode 100644
index 59efaa6..0000000
Binary files a/media/BABYMETAL - Karate.mp3 and /dev/null differ
diff --git a/media/BABYMETAL feat. F.HERO - PA PA YA!!.mp3 b/media/BABYMETAL feat. F.HERO - PA PA YA!!.mp3
deleted file mode 100644
index bb3fc49..0000000
Binary files a/media/BABYMETAL feat. F.HERO - PA PA YA!!.mp3 and /dev/null differ
diff --git "a/media/BABYMETAL feat. Joakim Brod\303\251n - Oh! MAJINAI.mp3" "b/media/BABYMETAL feat. Joakim Brod\303\251n - Oh! MAJINAI.mp3"
deleted file mode 100644
index 47ee39e..0000000
Binary files "a/media/BABYMETAL feat. Joakim Brod\303\251n - Oh! MAJINAI.mp3" and /dev/null differ
diff --git a/media/Bad Omens - THE DEATH OF PEACE OF MIND.mp3 b/media/Bad Omens - THE DEATH OF PEACE OF MIND.mp3
deleted file mode 100644
index e935891..0000000
Binary files a/media/Bad Omens - THE DEATH OF PEACE OF MIND.mp3 and /dev/null differ
diff --git "a/media/Creepy Nuts - \343\202\252\343\203\210\343\203\216\343\202\261(Otonoke).mp3" "b/media/Creepy Nuts - \343\202\252\343\203\210\343\203\216\343\202\261(Otonoke).mp3"
deleted file mode 100644
index f6281f5..0000000
Binary files "a/media/Creepy Nuts - \343\202\252\343\203\210\343\203\216\343\202\261(Otonoke).mp3" and /dev/null differ
diff --git a/media/Eurielle - City of the dead.mp3 b/media/Eurielle - City of the dead.mp3
deleted file mode 100644
index 5a4ad80..0000000
Binary files a/media/Eurielle - City of the dead.mp3 and /dev/null differ
diff --git "a/media/FIZICA - \320\223\320\276\321\202\321\215\320\274 2.mp3" "b/media/FIZICA - \320\223\320\276\321\202\321\215\320\274 2.mp3"
deleted file mode 100644
index 859f7c7..0000000
Binary files "a/media/FIZICA - \320\223\320\276\321\202\321\215\320\274 2.mp3" and /dev/null differ
diff --git "a/media/FIZICA - \320\223\320\276\321\202\321\215\320\274 3.mp3" "b/media/FIZICA - \320\223\320\276\321\202\321\215\320\274 3.mp3"
deleted file mode 100644
index 249f671..0000000
Binary files "a/media/FIZICA - \320\223\320\276\321\202\321\215\320\274 3.mp3" and /dev/null differ
diff --git "a/media/FIZICA - \320\223\320\276\321\202\321\215\320\274.mp3" "b/media/FIZICA - \320\223\320\276\321\202\321\215\320\274.mp3"
deleted file mode 100644
index 4ffcf13..0000000
Binary files "a/media/FIZICA - \320\223\320\276\321\202\321\215\320\274.mp3" and /dev/null differ
diff --git "a/media/FIZICA - \320\247\320\276\320\272\320\265\321\200.mp3" "b/media/FIZICA - \320\247\320\276\320\272\320\265\321\200.mp3"
deleted file mode 100644
index 58d161d..0000000
Binary files "a/media/FIZICA - \320\247\320\276\320\272\320\265\321\200.mp3" and /dev/null differ
diff --git a/media/Falling In Reverse - ZOMBIFIED.mp3 b/media/Falling In Reverse - ZOMBIFIED.mp3
deleted file mode 100644
index ac6ba95..0000000
Binary files a/media/Falling In Reverse - ZOMBIFIED.mp3 and /dev/null differ
diff --git "a/media/GroTTesque - \320\241\321\202\320\260\320\273\321\214\320\275\320\276\320\265 \321\201\320\265\321\200\320\264\321\206\320\265.mp3" "b/media/GroTTesque - \320\241\321\202\320\260\320\273\321\214\320\275\320\276\320\265 \321\201\320\265\321\200\320\264\321\206\320\265.mp3"
deleted file mode 100644
index 54cb492..0000000
Binary files "a/media/GroTTesque - \320\241\321\202\320\260\320\273\321\214\320\275\320\276\320\265 \321\201\320\265\321\200\320\264\321\206\320\265.mp3" and /dev/null differ
diff --git a/media/Halestorm - I Miss The Misery.mp3 b/media/Halestorm - I Miss The Misery.mp3
deleted file mode 100644
index 6aecad6..0000000
Binary files a/media/Halestorm - I Miss The Misery.mp3 and /dev/null differ
diff --git a/media/Halsey - Control.mp3 b/media/Halsey - Control.mp3
deleted file mode 100644
index 67804b9..0000000
Binary files a/media/Halsey - Control.mp3 and /dev/null differ
diff --git a/media/Hidden Citizens feat. Keeley Bumford - Immortalized.mp3 b/media/Hidden Citizens feat. Keeley Bumford - Immortalized.mp3
deleted file mode 100644
index 0192e3f..0000000
Binary files a/media/Hidden Citizens feat. Keeley Bumford - Immortalized.mp3 and /dev/null differ
diff --git "a/media/Hidden Citizens feat. Ra\314\212nya - Let Me Out.mp3" "b/media/Hidden Citizens feat. Ra\314\212nya - Let Me Out.mp3"
deleted file mode 100644
index 96118cf..0000000
Binary files "a/media/Hidden Citizens feat. Ra\314\212nya - Let Me Out.mp3" and /dev/null differ
diff --git "a/media/Hidden Citizens feat. Ra\314\212nya - Paint It Black.mp3" "b/media/Hidden Citizens feat. Ra\314\212nya - Paint It Black.mp3"
deleted file mode 100644
index 8da9941..0000000
Binary files "a/media/Hidden Citizens feat. Ra\314\212nya - Paint It Black.mp3" and /dev/null differ
diff --git "a/media/Louna - \320\237\320\276\320\273\321\216\321\201\320\260.mp3" "b/media/Louna - \320\237\320\276\320\273\321\216\321\201\320\260.mp3"
deleted file mode 100644
index 435ea2b..0000000
Binary files "a/media/Louna - \320\237\320\276\320\273\321\216\321\201\320\260.mp3" and /dev/null differ
diff --git a/media/MIYAVI - Other Side.mp3 b/media/MIYAVI - Other Side.mp3
deleted file mode 100644
index 3efddfc..0000000
Binary files a/media/MIYAVI - Other Side.mp3 and /dev/null differ
diff --git "a/media/Norma Tale - \320\232\320\270\321\201\321\202\320\276\321\207\320\272\320\260 II.mp3" "b/media/Norma Tale - \320\232\320\270\321\201\321\202\320\276\321\207\320\272\320\260 II.mp3"
deleted file mode 100644
index 579ce25..0000000
Binary files "a/media/Norma Tale - \320\232\320\270\321\201\321\202\320\276\321\207\320\272\320\260 II.mp3" and /dev/null differ
diff --git "a/media/RAVANNA - \320\226\320\263\320\270.mp3" "b/media/RAVANNA - \320\226\320\263\320\270.mp3"
deleted file mode 100644
index dcca1e0..0000000
Binary files "a/media/RAVANNA - \320\226\320\263\320\270.mp3" and /dev/null differ
diff --git "a/media/RAVANNA feat. Ai Mori - \320\232\320\276\320\274\320\260.mp3" "b/media/RAVANNA feat. Ai Mori - \320\232\320\276\320\274\320\260.mp3"
deleted file mode 100644
index 58f38b4..0000000
Binary files "a/media/RAVANNA feat. Ai Mori - \320\232\320\276\320\274\320\260.mp3" and /dev/null differ
diff --git a/media/RIOT - Overkill.mp3 b/media/RIOT - Overkill.mp3
deleted file mode 100644
index cd044c2..0000000
Binary files a/media/RIOT - Overkill.mp3 and /dev/null differ
diff --git a/media/Rammstein - Sonne.mp3 b/media/Rammstein - Sonne.mp3
deleted file mode 100644
index 3219612..0000000
Binary files a/media/Rammstein - Sonne.mp3 and /dev/null differ
diff --git a/media/SKYND - Chris Watts.mp3 b/media/SKYND - Chris Watts.mp3
deleted file mode 100644
index 9d9738d..0000000
Binary files a/media/SKYND - Chris Watts.mp3 and /dev/null differ
diff --git a/media/SKYND - Elisa Lam.mp3 b/media/SKYND - Elisa Lam.mp3
deleted file mode 100644
index 460fddb..0000000
Binary files a/media/SKYND - Elisa Lam.mp3 and /dev/null differ
diff --git a/media/SKYND - Jim Jones(2019).mp3 b/media/SKYND - Jim Jones(2019).mp3
deleted file mode 100644
index 368904d..0000000
Binary files a/media/SKYND - Jim Jones(2019).mp3 and /dev/null differ
diff --git a/media/SKYND - Katherine Knight.mp3 b/media/SKYND - Katherine Knight.mp3
deleted file mode 100644
index 9f35337..0000000
Binary files a/media/SKYND - Katherine Knight.mp3 and /dev/null differ
diff --git a/media/SKYND - Lay down your life.mp3 b/media/SKYND - Lay down your life.mp3
deleted file mode 100644
index ebbc4f7..0000000
Binary files a/media/SKYND - Lay down your life.mp3 and /dev/null differ
diff --git a/media/SKYND - Michelle Carter.mp3 b/media/SKYND - Michelle Carter.mp3
deleted file mode 100644
index d0e1aaa..0000000
Binary files a/media/SKYND - Michelle Carter.mp3 and /dev/null differ
diff --git a/media/SKYND - Richard Ramirez.mp3 b/media/SKYND - Richard Ramirez.mp3
deleted file mode 100644
index 3dc7676..0000000
Binary files a/media/SKYND - Richard Ramirez.mp3 and /dev/null differ
diff --git a/media/SKYND - Tyler Hadley.mp3 b/media/SKYND - Tyler Hadley.mp3
deleted file mode 100644
index 9338dc6..0000000
Binary files a/media/SKYND - Tyler Hadley.mp3 and /dev/null differ
diff --git a/media/SKYND feat. Bill $Aber - Columbine (feat. Bill $Aber).mp3 b/media/SKYND feat. Bill $Aber - Columbine (feat. Bill $Aber).mp3
deleted file mode 100644
index 9a1e2e2..0000000
Binary files a/media/SKYND feat. Bill $Aber - Columbine (feat. Bill $Aber).mp3 and /dev/null differ
diff --git a/media/SKYND feat. Jonathan Davis - Gary Heidnik (feat. Jonathan Davis).mp3 b/media/SKYND feat. Jonathan Davis - Gary Heidnik (feat. Jonathan Davis).mp3
deleted file mode 100644
index a99da77..0000000
Binary files a/media/SKYND feat. Jonathan Davis - Gary Heidnik (feat. Jonathan Davis).mp3 and /dev/null differ
diff --git a/media/blueberry - EVA 3.mp3 b/media/blueberry - EVA 3.mp3
deleted file mode 100644
index f832717..0000000
Binary files a/media/blueberry - EVA 3.mp3 and /dev/null differ
diff --git "a/media/pyrokinesis - \320\233\320\265\320\263\320\265\320\275\320\264\320\260 \320\276 \320\221\320\276\320\263\320\270\320\275\320\265 \320\223\321\200\320\276\320\267.mp3" "b/media/pyrokinesis - \320\233\320\265\320\263\320\265\320\275\320\264\320\260 \320\276 \320\221\320\276\320\263\320\270\320\275\320\265 \320\223\321\200\320\276\320\267.mp3"
deleted file mode 100644
index 39bcd18..0000000
Binary files "a/media/pyrokinesis - \320\233\320\265\320\263\320\265\320\275\320\264\320\260 \320\276 \320\221\320\276\320\263\320\270\320\275\320\265 \320\223\321\200\320\276\320\267.mp3" and /dev/null differ
diff --git a/pages/add-songs.html b/pages/add-songs.html
new file mode 100644
index 0000000..18d5b9f
--- /dev/null
+++ b/pages/add-songs.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
Добавление новой песни
+
+
+
\ No newline at end of file
diff --git a/pages/song_page.html b/pages/song_page.html
new file mode 100644
index 0000000..e69de29
diff --git a/pages/tracks.html b/pages/tracks.html
new file mode 100644
index 0000000..0cf0039
--- /dev/null
+++ b/pages/tracks.html
@@ -0,0 +1,7 @@
+
+