From 44792c0918b7d2e0c6c0aa6d83c47c66572eea73 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 7 Dec 2021 21:04:03 +0700 Subject: [PATCH] animated artworks --- .../cider-ui-tests/assets/transparent.png | Bin 0 -> 584 bytes resources/cider-ui-tests/index.js | 35 +++++++++++-- resources/cider-ui-tests/style.css | 48 ++++++++++++++++++ .../views/components/animatedartwork-view.ejs | 20 ++++++++ .../views/components/mediaitem-artwork.ejs | 5 +- resources/cider-ui-tests/views/main.ejs | 5 +- .../cider-ui-tests/views/pages/artist.ejs | 2 + .../views/pages/cider-playlist.ejs | 10 ++-- 8 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 resources/cider-ui-tests/assets/transparent.png create mode 100644 resources/cider-ui-tests/views/components/animatedartwork-view.ejs diff --git a/resources/cider-ui-tests/assets/transparent.png b/resources/cider-ui-tests/assets/transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..5da647730bd743e01046048ad159b4ef197cdf8c GIT binary patch literal 584 zcmeAS@N?(olHy`uVBq!ia0y~yU{nEN4mO}j+fSc2K#H+A$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBK4*bPWHAE+w=f7ZGR&GI0Tg6Q@^*J&_z!{$_AZ|c6k#v%^mS!_!phGn z#=EC#-glsoY-UJAiF1B#Zfaf$kjuc}T$GwvlA5AWo>`Ki;O^-gkfN8$4ir}`aRn*_ zNoMBfDTHL^rZN~A7#Ua@m;sT3k)f55sg<$u video`) + console.log('supported'); + var hls = new Hls(); + // bind them together + if (video){ + hls.attachMedia(video); + hls.on(Hls.Events.MEDIA_ATTACHED, function () { + console.log('video and hls.js are now bound together !'); + hls.loadSource(url); + hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) { + video.play(); + return ""; + }); + });} else { console.log("hso"); return "";} + } else { return "";} + }, getArtistPalette(artist){ if(artist["attributes"]["artwork"]) { return { @@ -258,7 +286,7 @@ const app = new Vue({ else if(!kind.toString().includes("radioStation") && !kind.toString().includes("song") && !kind.toString().includes("musicVideo") && !kind.toString().includes("uploadedVideo")) {app.page = (kind) + "_"+ (id); console.log("oks"); - app.getTypeFromID((kind),(id), (isLibrary));} else { + app.getTypeFromID((kind),(id), (isLibrary),{extend: "editorialVideo"});} else { app.playMediaItemById((id),(kind), (isLibrary), item.attributes.url ?? '') } document.querySelector("#app-content").scrollTop = 0 @@ -1041,4 +1069,5 @@ var checkIfScrollIsStatic = setInterval(() => { } position = document.getElementsByClassName('lyric-body')[0].scrollTop } catch (e){} - }, 50) \ No newline at end of file + }, 50); + diff --git a/resources/cider-ui-tests/style.css b/resources/cider-ui-tests/style.css index 6b5ab71b..f798839b 100644 --- a/resources/cider-ui-tests/style.css +++ b/resources/cider-ui-tests/style.css @@ -1365,6 +1365,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track { align-items: center; justify-content: space-between; min-height: 300px; + position: relative; } .artist-page .artist-image { @@ -1425,6 +1426,49 @@ input[type=range].web-slider::-webkit-slider-runnable-track { width: 100%; height: 100%; } +.mediaitem-artwork .animatedartwork-view-box .animated{ + position: absolute; + top: 0px; + width: 200px; + height: 200px; +} + +.mediaitem-artwork .animatedartwork-view-box .animated > video { + width: 200px; + height: 200px; +} + +.mediaitem-artwork .animatedartwork-view-box{ + position: absolute; + top: 0px; + width: 200px; + height: 200px; +} + +.artist-header .animated{ + width: 100%; + height: 100%; + align-self: center; + position: absolute; + overflow: hidden; + box-shadow: rgb(0 0 0 / 50%) 0 0 0 1000000px inset; +} + +.artist-header .row .col.flex-center{ + z-index: 4; +} + +.artist-header .animated > video { + overflow: hidden; + height: 100%; + width: 100%; + min-height: 56.25vw; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + +} .mediaitem-artwork.rounded { border-radius: 100%; @@ -1962,4 +2006,8 @@ input[type=range].web-slider::-webkit-slider-runnable-track { #apple-music-video-player-controls:hover{ opacity: 1; +} + +img[src=""] { + text-indent: -10000px; } \ No newline at end of file diff --git a/resources/cider-ui-tests/views/components/animatedartwork-view.ejs b/resources/cider-ui-tests/views/components/animatedartwork-view.ejs new file mode 100644 index 00000000..7f5a19c2 --- /dev/null +++ b/resources/cider-ui-tests/views/components/animatedartwork-view.ejs @@ -0,0 +1,20 @@ + + + \ No newline at end of file diff --git a/resources/cider-ui-tests/views/components/mediaitem-artwork.ejs b/resources/cider-ui-tests/views/components/mediaitem-artwork.ejs index e20320d2..4cae6dae 100644 --- a/resources/cider-ui-tests/views/components/mediaitem-artwork.ejs +++ b/resources/cider-ui-tests/views/components/mediaitem-artwork.ejs @@ -9,6 +9,9 @@
+
+ +
@@ -16,7 +19,7 @@ - + - \ No newline at end of file diff --git a/resources/cider-ui-tests/views/pages/artist.ejs b/resources/cider-ui-tests/views/pages/artist.ejs index c851f906..ac374e3b 100644 --- a/resources/cider-ui-tests/views/pages/artist.ejs +++ b/resources/cider-ui-tests/views/pages/artist.ejs @@ -1,6 +1,8 @@