From 02e13cb642532ef30ac863c0288da694c36554bf Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Tue, 26 Sep 2023 23:51:33 +0200 Subject: [PATCH 1/4] wip --- src/views/Home.vue | 132 ++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 80 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index a3ac45e..f3c87c2 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -2,30 +2,31 @@
- - + +
-
+
@@ -160,6 +114,9 @@ export default { this.$store.dispatch("boxes/loadNewest"); this.$store.dispatch("tracks/loadMostListened"); this.$store.dispatch("videos/loadMostViewed"); + + this.$store.dispatch("albums/loadAlbums", true); + this.$store.dispatch("artists/loadArtists", true); }, loadNextPage() { this.scrollPosition = this.$refs.welcome.scrollTop; @@ -194,6 +151,8 @@ export default { serverInfo: "serverInfo", mostListened: "tracks/mostListened", mostViewed: "videos/mostViewed", + albums: ["albums/collection"], + artists: ["artists/collection"], }), historyToggleText() { return this.historyAll ? "less..." : "more..."; @@ -221,4 +180,17 @@ export default { #history.more { max-height: initial; } + +#banner { + position: relative; +} + +#collage { + bottom: 0; + top: 0; + left: 0; + right: 0; + opacity: 0.25; + position: absolute; +} \ No newline at end of file From 7ebce51c2de151d70e6c4e90aa55b7278d2be1fe Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Wed, 27 Sep 2023 16:51:44 +0200 Subject: [PATCH 2/4] load random covers --- public/config.json | 4 ++-- src/store/modules/albums/actions.js | 5 +++++ src/store/modules/albums/getters.js | 3 +++ src/store/modules/albums/mutations.js | 3 +++ src/store/modules/albums/state.js | 1 + src/views/Home.vue | 8 +++----- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/public/config.json b/public/config.json index a3b7d4a..f966bb7 100644 --- a/public/config.json +++ b/public/config.json @@ -1,5 +1,5 @@ { - "backend_de": "http://localhost:31204", - "backend_dev": "https://webplay.rocks", + "backend_dev": "http://localhost:31204", + "backend_de": "https://webplay.rocks", "backend": "https://webplay.rocks" } \ No newline at end of file diff --git a/src/store/modules/albums/actions.js b/src/store/modules/albums/actions.js index 301ddb5..90bb4f6 100644 --- a/src/store/modules/albums/actions.js +++ b/src/store/modules/albums/actions.js @@ -176,5 +176,10 @@ export default { resolve(); }); }); + }, + loadRandomCovers(context, count) { + axios.get(context.rootGetters.server + "/api/albums/random/" + count, context.rootGetters.headers).then((res) => { + context.commit("setRandomCovers", res.data); + }); } } \ No newline at end of file diff --git a/src/store/modules/albums/getters.js b/src/store/modules/albums/getters.js index 94440bf..cecc746 100644 --- a/src/store/modules/albums/getters.js +++ b/src/store/modules/albums/getters.js @@ -32,5 +32,8 @@ export default { }, newest(state) { return state.newest; + }, + randomCovers(state) { + return state.randomCovers; } } \ No newline at end of file diff --git a/src/store/modules/albums/mutations.js b/src/store/modules/albums/mutations.js index dafa403..c1c8222 100644 --- a/src/store/modules/albums/mutations.js +++ b/src/store/modules/albums/mutations.js @@ -76,5 +76,8 @@ export default { } }); state.newest = albums; + }, + setRandomCovers(state, covers) { + state.randomCovers = covers; } } \ No newline at end of file diff --git a/src/store/modules/albums/state.js b/src/store/modules/albums/state.js index e504bbe..6fb4e5f 100644 --- a/src/store/modules/albums/state.js +++ b/src/store/modules/albums/state.js @@ -2,6 +2,7 @@ export default { collection: [], newest: [], selectedAlbum: { tracks: [], covers: {}, share: {} }, + randomCovers: [], page: 1, loading: false, eos: false diff --git a/src/views/Home.vue b/src/views/Home.vue index f3c87c2..c04b288 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -8,9 +8,7 @@ - - - +
@@ -115,6 +113,7 @@ export default { this.$store.dispatch("tracks/loadMostListened"); this.$store.dispatch("videos/loadMostViewed"); + this.$store.dispatch("albums/loadRandomCovers", 24); this.$store.dispatch("albums/loadAlbums", true); this.$store.dispatch("artists/loadArtists", true); }, @@ -151,8 +150,7 @@ export default { serverInfo: "serverInfo", mostListened: "tracks/mostListened", mostViewed: "videos/mostViewed", - albums: ["albums/collection"], - artists: ["artists/collection"], + randomCovers: ["albums/randomCovers"], }), historyToggleText() { return this.historyAll ? "less..." : "more..."; From d0b4590664b624004424c77999d23c99cb4e0119 Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Wed, 27 Sep 2023 22:10:16 +0200 Subject: [PATCH 3/4] ready to use --- public/config.json | 4 ++-- src/views/Home.vue | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/config.json b/public/config.json index f966bb7..a3b7d4a 100644 --- a/public/config.json +++ b/public/config.json @@ -1,5 +1,5 @@ { - "backend_dev": "http://localhost:31204", - "backend_de": "https://webplay.rocks", + "backend_de": "http://localhost:31204", + "backend_dev": "https://webplay.rocks", "backend": "https://webplay.rocks" } \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue index c04b288..8fec13e 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -5,10 +5,10 @@
- - + + - +
@@ -113,7 +113,7 @@ export default { this.$store.dispatch("tracks/loadMostListened"); this.$store.dispatch("videos/loadMostViewed"); - this.$store.dispatch("albums/loadRandomCovers", 24); + this.$store.dispatch("albums/loadRandomCovers", 48); this.$store.dispatch("albums/loadAlbums", true); this.$store.dispatch("artists/loadArtists", true); }, @@ -188,7 +188,7 @@ export default { top: 0; left: 0; right: 0; - opacity: 0.25; + opacity: 0.2; position: absolute; } \ No newline at end of file From a9d705298a1162982c6a32309c88ce02a730ba59 Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Wed, 27 Sep 2023 22:13:10 +0200 Subject: [PATCH 4/4] don't reload random covers --- src/views/Home.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index 8fec13e..0215f5d 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -112,10 +112,11 @@ export default { this.$store.dispatch("boxes/loadNewest"); this.$store.dispatch("tracks/loadMostListened"); this.$store.dispatch("videos/loadMostViewed"); - - this.$store.dispatch("albums/loadRandomCovers", 48); - this.$store.dispatch("albums/loadAlbums", true); - this.$store.dispatch("artists/loadArtists", true); + if (this.randomCovers.length == 0) { + this.$store.dispatch("albums/loadRandomCovers", 48); + this.$store.dispatch("albums/loadAlbums", true); + this.$store.dispatch("artists/loadArtists", true); + } }, loadNextPage() { this.scrollPosition = this.$refs.welcome.scrollTop;