|
4 | 4 | class="songdetail-wrapper absolute flex flex-col top-0 left-0 right-0 bottom-20 duration-300 app-region-nodrag bg-now-playing" |
5 | 5 | :class="{ |
6 | 6 | 'overflow-y-scroll': commentActive, |
7 | | - 'overflow-hidden': !commentActive, |
| 7 | + 'overflow-hidden justify-center': !commentActive, |
8 | 8 | slidedown: overlay.type !== 'track', |
9 | 9 | coverbg: settings.enableNowplayingCoverBackground |
10 | 10 | }"> |
|
38 | 38 | </svg> |
39 | 39 | </div>--> |
40 | 40 |
|
41 | | - <div class="playsong-detail my-0 mx-auto flex w-[60rem] z-10"> |
42 | | - <div class="detail-head overflow-hidden flex-none w-[30rem] 2xl:w-[500px] flex justify-center"> |
43 | | - <div class="detail-head-cover w-72 2xl:w-96 mt-32 2xl:mr-28 transition-all ease-in-out"> |
44 | | - <img class="w-full aspect-square object-cover rounded shadow-2xl" :src="currentPlaying?.img_url" @error="showImage($event, 'images/mycover.jpg')" /> |
| 41 | + <div class="playsong-detail flex self-center w-[60rem] z-10 justify-center" :class="{ 'mt-24': commentActive }"> |
| 42 | + <div class="detail-head overflow-hidden flex items-center mr-20"> |
| 43 | + <div class="detail-head-cover w-80 2xl:w-96 transition-all ease-in-out"> |
| 44 | + <img class="w-full aspect-square object-cover rounded-lg shadow-2xl" :src="currentPlaying?.img_url" @error="showImage($event, coverImg)" /> |
45 | 45 | </div> |
46 | 46 | <div class="detail-head-title"> |
47 | 47 | <!--<a title="加入收藏" class="clone" ng-click="showDialog(0, currentPlaying)">收藏</a> |
48 | 48 | <a open-url="currentPlaying.source_url" title="原始链接" class="link">原始链接</a>--> |
49 | 49 | </div> |
50 | 50 | </div> |
51 | | - <div class="detail-songinfo flex app-region-nodrag overflow-hidden mt-28 flex-col flex-1"> |
| 51 | + <div class="detail-songinfo flex w-96 app-region-nodrag overflow-hidden flex-col ml-8"> |
52 | 52 | <div class="title flex items-start"> |
53 | 53 | <h2 class="font-normal text-3xl mr-4 mb-4">{{ currentPlaying?.title }}</h2> |
54 | 54 | <span |
|
88 | 88 | </a> |
89 | 89 | </div> |
90 | 90 | </div> |
91 | | - <div class="lyric relative flex-none h-96 overflow-y-scroll"> |
92 | | - <div class="placeholder" /> |
| 91 | + <div class="lyric blur-mask relative flex-none h-[30rem] overflow-y-scroll"> |
| 92 | + <div class="placeholder h-1/3" /> |
93 | 93 | <p |
94 | 94 | v-for="line in lyricArray" |
95 | 95 | :key="line.lineNumber" |
96 | 96 | :data-line="line.lineNumber" |
97 | | - :style="{ fontWeight: lyricFontWeight, fontSize: `${lyricFontSize}px` }" |
| 97 | + :style="{ |
| 98 | + fontWeight: lyricFontWeight, |
| 99 | + fontSize: `${lyricFontSize * (isHighlighted(line.lineNumber, line.translationFlag) ? 1.2 : 1)}px`, |
| 100 | + filter: `blur(${line.lineNumber === (line.translationFlag ? lyricLineNumberTrans : lyricLineNumber) ? 0.25 : 0}px)` |
| 101 | + }" |
98 | 102 | :class="{ |
99 | | - highlight: (!line.translationFlag && line.lineNumber == lyricLineNumber) || (line.translationFlag && line.lineNumber == lyricLineNumberTrans), |
| 103 | + highlight: isHighlighted(line.lineNumber, line.translationFlag), |
100 | 104 | hidden: line.translationFlag && !settings.enableLyricTranslation, |
101 | 105 | 'mt-1': line.translationFlag, |
102 | 106 | 'mt-4': !line.translationFlag |
103 | 107 | }"> |
104 | 108 | {{ line.content }} |
105 | 109 | </p> |
106 | | - <div class="placeholder" /> |
| 110 | + <div class="placeholder h-1/3" /> |
107 | 111 | </div> |
108 | 112 | </div> |
109 | 113 | </div> |
110 | | - <div v-if="commentActive" class="mt-20 mb-8 mx-auto w-[42rem] z-10"> |
| 114 | + <div v-if="commentActive" class="mt-16 mb-8 self-center w-[42rem] z-10"> |
111 | 115 | <div>热门评论</div> |
112 | 116 | <ul> |
113 | 117 | <li v-for="comment in commentList" :key="comment.id" class="flex py-4 border-b border-default"> |
@@ -149,6 +153,7 @@ import useOverlay from '../composition/overlay'; |
149 | 153 | import usePlayer from '../composition/player'; |
150 | 154 | import useSettings from '../composition/settings'; |
151 | 155 | import { datetimeFormats } from '../i18n/index'; |
| 156 | +import coverImg from '../images/mycover.jpg'; |
152 | 157 | import type { Comment } from '../provider/types'; |
153 | 158 | import MediaService from '../services/MediaService'; |
154 | 159 | const { t, d } = useI18n({ |
@@ -176,6 +181,7 @@ const showPlaylist = (playlistId?: string) => { |
176 | 181 | }; |
177 | 182 |
|
178 | 183 | const toggleLyricTranslation = () => setSettings({ enableLyricTranslation: !settings.enableLyricTranslation }); |
| 184 | +const isHighlighted = (n: number, flag: boolean) => n == (flag ? lyricLineNumberTrans : lyricLineNumber); |
179 | 185 |
|
180 | 186 | const showImage = (e: any, url: any) => { |
181 | 187 | e.target.src = url; |
@@ -254,4 +260,9 @@ watchEffect(async () => { |
254 | 260 | .page .songdetail-wrapper .close svg { |
255 | 261 | stroke: var(--now-playing-close-icon-color); |
256 | 262 | } */ |
| 263 | +
|
| 264 | +.blur-mask { |
| 265 | + mask: linear-gradient(transparent 5%, black 20%, black 80%, transparent 95%); |
| 266 | + -webkit-mask: linear-gradient(transparent 5%, black 20%, black 80%, transparent 95%); |
| 267 | +} |
257 | 268 | </style> |
0 commit comments