From ee179989484f0bbed6bc20a9c9ec8dcfa24a3eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D0=B8=D1=88=D0=B8=D0=BD=D0=B0=29?= <Аришина)@DESKTOP-OUE59OV> Date: Wed, 6 Nov 2024 12:48:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B2=D0=B5=D1=80=D1=81=D1=82=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- README.md | 2 +- data.json | 260 +++++++++--------- package-lock.json | 33 ++- package.json | 1 + src/App.css | 8 +- src/App.tsx | 36 +-- src/components/cardComponents/AdCard.tsx | 2 +- src/components/layoutComponents/AdBlock.tsx | 2 +- src/components/layoutComponents/MenuBlock.tsx | 36 ++- .../menuComponents/ChartSongsBlock.tsx | 45 +++ .../{SongsBlock.tsx => NewSongsBlock.tsx} | 55 +--- .../Templates/numeredSongsTemplate.tsx | 56 ++++ .../Templates/songsTemplate.tsx | 59 ++++ .../songComponents/CurrentTrack.tsx | 78 +++--- src/components/songComponents/Track.tsx | 25 -- src/models/IModels.ts | 1 + src/pages/Homepage.tsx | 11 +- 18 files changed, 408 insertions(+), 304 deletions(-) create mode 100644 src/components/menuComponents/ChartSongsBlock.tsx rename src/components/menuComponents/{SongsBlock.tsx => NewSongsBlock.tsx} (51%) create mode 100644 src/components/menuComponents/Templates/numeredSongsTemplate.tsx create mode 100644 src/components/menuComponents/Templates/songsTemplate.tsx delete mode 100644 src/components/songComponents/Track.tsx diff --git a/.gitignore b/.gitignore index c7333e80..5b11227d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ *.vsix node_modules -*storybook.log \ No newline at end of file +*storybook.log \ No newline at end of file diff --git a/README.md b/README.md index 819aca86..2722308a 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ 5. Валидация форм Должен был добавить плеер с воспроизведением песен, но из-за ошибок, про которые я написал выше, не удалось. -Пришлось жестко передать объект песни прямо в коде компонента. +Пришлось жестко передать объект песни прямо в коде компонента. \ No newline at end of file diff --git a/data.json b/data.json index 591e0c3f..11f186e1 100644 --- a/data.json +++ b/data.json @@ -78,7 +78,7 @@ "genre_name": "Rock" }, { - "id": "1", + "id": "6", "song_name": "Smells Like Poop", "band_id": "1", "band_name": "Nevroz", @@ -93,7 +93,7 @@ "genre_name": "Rock" }, { - "id": "2", + "id": "7", "song_name": "Song 3", "band_id": "1", "band_name": "Nevroz", @@ -108,7 +108,7 @@ "genre_name": "Rock" }, { - "id": "3", + "id": "8", "song_name": "Ругань из-за Стёпы", "band_id": "2", "band_name": "noizemchik", @@ -124,7 +124,7 @@ "genre_name": "Rock" }, { - "id": "4", + "id": "9", "song_name": "Crazy Frog", "band_id": "3", "band_name": "DSPD", @@ -138,126 +138,6 @@ "genreid": "1", "genre_name": "Rock" }, - { - "id": "5", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, - { - "id": "5", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, - { - "id": "5", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, - { - "id": "5", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, - { - "id": "6", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, - { - "id": "7", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, - { - "id": "8", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, - { - "id": "9", - "song_name": "Кем я стал", - "band_id": "3", - "band_name": "DSPD", - "albumid": "3", - "album_name": "Album 3", - "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", - "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", - "playlists": [ - "3" - ], - "genreid": "1", - "genre_name": "Rock" - }, { "id": "10", "song_name": "Кем я стал", @@ -265,14 +145,14 @@ "band_name": "DSPD", "albumid": "3", "album_name": "Album 3", - "source": "source_path", - "cover": "https://sun9-11.userapi.com/impg/yfCwuWXI6NkFVC2HvMlegM2qWLlenkeiiRyvNQ/jpH8m1wlLqs.jpg?size=604x604&quality=95&sign=60a1d1877b49631fb6078db88715fc88&c_uniq_tag=UKrig2vg02reyBH_ML0OKeqt5gm_2jpwEXD7NJBUXoQ&type=album", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", "playlists": [ "3" ], "genreid": "1", "genre_name": "Rock" - }, + }, { "id": "11", "song_name": "Кем я стал", @@ -280,6 +160,126 @@ "band_name": "DSPD", "albumid": "3", "album_name": "Album 3", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "12", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "13", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "14", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "15", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "18", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "19", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", + "source": "/src/songs/DSPD feat. даня хренников - Кем я стал_(audio-lord.ru).mp3", + "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "20", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", + "source": "source_path", + "cover": "https://sun9-11.userapi.com/impg/yfCwuWXI6NkFVC2HvMlegM2qWLlenkeiiRyvNQ/jpH8m1wlLqs.jpg?size=604x604&quality=95&sign=60a1d1877b49631fb6078db88715fc88&c_uniq_tag=UKrig2vg02reyBH_ML0OKeqt5gm_2jpwEXD7NJBUXoQ&type=album", + "playlists": [ + "3" + ], + "genreid": "1", + "genre_name": "Rock" + }, + { + "id": "21", + "song_name": "Кем я стал", + "band_id": "3", + "band_name": "DSPD", + "albumid": "3", + "album_name": "Album 3", "source": "source_path", "cover": "https://avatars.yandex.net/get-music-content/10129881/f3cf1afc.a.30561322-1/m1000x1000?webp=falseh", "playlists": [ @@ -289,7 +289,7 @@ "genre_name": "Rock" }, { - "id": "12", + "id": "22", "song_name": "Кем я стал", "band_id": "3", "band_name": "DSPD", @@ -304,7 +304,7 @@ "genre_name": "Rock" }, { - "id": "13", + "id": "23", "song_name": "Song 3", "band_id": "1", "band_name": "Nevroz", @@ -319,7 +319,7 @@ "genre_name": "Rock" }, { - "id": "14", + "id": "24", "song_name": "Song 3", "band_id": "1", "band_name": "Nevroz", diff --git a/package-lock.json b/package-lock.json index 67468a63..eca48890 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "axios": "^1.7.4", "node-fetch": "^2.6.7", "react": "^18.3.1", + "react-audio-player-component": "^1.2.4", "react-dom": "^18.3.1", "react-dotenv": "^0.1.3", "react-google-recaptcha": "^3.1.0", @@ -24632,6 +24633,32 @@ "react": ">=16.4.1" } }, + "node_modules/react-audio-player-component": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/react-audio-player-component/-/react-audio-player-component-1.2.4.tgz", + "integrity": "sha512-bW/mJzFagOzDRJouknPSHEkImwzvKwt0JQBf9nuOQ+tF/MYhwHurNWDoLxAZvhWGGG6dQ9kL2RSFBKsDTa3Irg==", + "license": "MIT", + "dependencies": { + "react-audio-visualize": "^1.1.3" + }, + "engines": { + "node": ">=18.15.0" + }, + "peerDependencies": { + "react": ">=16.2.0", + "react-dom": ">=16.2.0" + } + }, + "node_modules/react-audio-visualize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-audio-visualize/-/react-audio-visualize-1.2.0.tgz", + "integrity": "sha512-rfO5nmT0fp23gjU0y2WQT6+ZOq2ZsuPTMphchwX1PCz1Di4oaIr6x7JZII8MLrbHdG7UB0OHfGONTIsWdh67kQ==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.2.0", + "react-dom": ">=16.2.0" + } + }, "node_modules/react-colorful": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-5.6.1.tgz", @@ -27940,9 +27967,9 @@ } }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", + "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", "license": "0BSD" }, "node_modules/tsutils": { diff --git a/package.json b/package.json index abbb917b..94425e82 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "axios": "^1.7.4", "node-fetch": "^2.6.7", "react": "^18.3.1", + "react-audio-player-component": "^1.2.4", "react-dom": "^18.3.1", "react-dotenv": "^0.1.3", "react-google-recaptcha": "^3.1.0", diff --git a/src/App.css b/src/App.css index 4d2cafdf..9f6d1ad0 100644 --- a/src/App.css +++ b/src/App.css @@ -90,11 +90,12 @@ } .song-table-row { - + margin-top: 50px !important; + margin-bottom: 50px !important; } .song-table-row:hover { - outline: #9b9b9b solid 1px !important; + outline: #9d0000 solid 3px !important; outline-offset: -1px !important; } @@ -133,7 +134,6 @@ .play-song-button:hover:after { opacity: 1; } - .current-song-cover { object-fit: scale-down; } @@ -180,5 +180,5 @@ } .bg-gradient { - background-image: linear-gradient(-45deg, red 0%, yellow 25%, yellow 51%, #ad0000 100%); + background-image: linear-gradient(-45deg, red 0%, orange 25%, orange 51%, #ad0000 100%); } \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 862f1a78..8f13210d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,21 +1,6 @@ -import React, { useEffect } from 'react'; import { Routes, Route} from 'react-router-dom'; -import logo from './logo.svg'; import './App.css'; -import { Button } from 'antd'; -import {Track} from './components/songComponents/Track'; -import {Header} from './components/layoutComponents/Header'; -import {Playlist} from './components/cardComponents//Playlist'; -import {Footer} from './components/layoutComponents/Footer'; -import {CurrentTrack} from './components/songComponents/CurrentTrack'; -import {SongsBlock} from './components/menuComponents/SongsBlock'; -import { ISong, IAlbum, IGenre, IBand, IPlaylist, IAdvertisement } from './models/IModels'; -import axios from 'axios'; -import { PlaylistsBlock } from './components/menuComponents/PlaylistsBlock'; -import { MenuBlock } from './components/layoutComponents/MenuBlock'; -import { getAds, getGenres, getPlaylists, getSongs } from './API/api'; -import { AdBlock } from './components/layoutComponents/AdBlock'; import { Homepage } from './pages/Homepage'; import { Loginpage } from './pages/Loginpage'; @@ -28,16 +13,15 @@ function App() { return (