diff --git a/packages/web/components/New/ArtistRow.tsx b/packages/web/components/New/ArtistRow.tsx index 8d16257..d3a6c6e 100644 --- a/packages/web/components/New/ArtistRow.tsx +++ b/packages/web/components/New/ArtistRow.tsx @@ -38,19 +38,21 @@ const ArtistRow = ({
{/* Title */} {title && ( -

+

{title}

)} {/* Artists */} {artists && ( -
+
{artists.map(artist => ( -
+
))} @@ -59,12 +61,9 @@ const ArtistRow = ({ {/* Placeholder */} {placeholderRow && !artists && ( -
+
{[...new Array(placeholderRow * 5).keys()].map(i => ( -
+
{ - const breakpoint = useBreakpoint() - const isMobile = ['sm', 'md'].includes(breakpoint) + const isMobile = useIsMobile() return ( { position: 'fixed', bottom: isMobile ? 'auto' : 0, right: 0, - top: isMobile ? 0 : 1, + top: isMobile ? 0 : 'auto', left: 'auto', }, }} diff --git a/packages/web/components/New/LayoutMobile.tsx b/packages/web/components/New/LayoutMobile.tsx index 7304196..e4e9e5e 100644 --- a/packages/web/components/New/LayoutMobile.tsx +++ b/packages/web/components/New/LayoutMobile.tsx @@ -14,7 +14,7 @@ const LayoutMobile = () => { return (
-
+
@@ -47,6 +47,19 @@ const LayoutMobile = () => {
+ + {/* Notch background */} + {isIOS && isSafari && isPWA && ( +
+ )}
) } diff --git a/packages/web/components/New/PlayLikedSongsCard.tsx b/packages/web/components/New/PlayLikedSongsCard.tsx index f127eb2..5f8680b 100644 --- a/packages/web/components/New/PlayLikedSongsCard.tsx +++ b/packages/web/components/New/PlayLikedSongsCard.tsx @@ -67,7 +67,7 @@ const PlayLikedSongsCard = () => { return (
void + className?: string }) => { return ( -
+
{tabs.map(tab => (
{ return ( -
+
diff --git a/packages/web/components/New/TrackList.tsx b/packages/web/components/New/TrackList.tsx index a4d79fa..8d8983c 100644 --- a/packages/web/components/New/TrackList.tsx +++ b/packages/web/components/New/TrackList.tsx @@ -5,6 +5,7 @@ import { player } from '@/web/store' import { useSnapshot } from 'valtio' import Wave from './Wave' import Icon from '@/web/components/Icon' +import useIsMobile from '@/web/hooks/useIsMobile' const TrackList = ({ tracks, @@ -20,9 +21,14 @@ const TrackList = ({ () => playerSnapshot.track, [playerSnapshot.track] ) + const isMobile = useIsMobile() const handleClick = (e: React.MouseEvent, trackID: number) => { - if (e.detail === 2) onPlay?.(trackID) + if (isMobile) { + onPlay?.(trackID) + } else { + if (e.detail === 2) onPlay?.(trackID) + } } const playing = useMemo( @@ -38,7 +44,12 @@ const TrackList = ({ onClick={e => handleClick(e, track.id)} className='group relative flex items-center py-2 text-16 font-medium text-neutral-200 transition duration-300 ease-in-out' > -
{String(track.no).padStart(2, '0')}
+ {/* Track no */} +
+ {String(track.no).padStart(2, '0')} +
+ + {/* Track name */}
{track.name} {playingTrack?.id === track.id && ( @@ -47,7 +58,9 @@ const TrackList = ({
)}
-
+ + {/* Desktop context menu */} +
{/* */}
@@ -58,7 +71,14 @@ const TrackList = ({ {/* */}
-
+ + {/* Mobile menu */} +
+
+
+ + {/* Track duration */} +
{formatDuration(track.dt, 'en', 'hh:mm:ss')}
diff --git a/packages/web/components/New/TrackListHeader.tsx b/packages/web/components/New/TrackListHeader.tsx index 3c1fc06..e9b8558 100644 --- a/packages/web/components/New/TrackListHeader.tsx +++ b/packages/web/components/New/TrackListHeader.tsx @@ -4,6 +4,7 @@ import Icon from '@/web/components/Icon' import dayjs from 'dayjs' import { useMemo } from 'react' import Image from './Image' +import useIsMobile from '@/web/hooks/useIsMobile' const TrackListHeader = ({ album, @@ -18,18 +19,22 @@ const TrackListHeader = ({ const duration = album?.songs?.reduce((acc, cur) => acc + cur.dt, 0) || 0 return formatDuration(duration, 'en', 'hh[hr] mm[min]') }, [album?.songs]) + const isMobile = useIsMobile() const cover = album?.picUrl || playlist?.coverImgUrl || '' return (
+ {/* Cover */} {/* Blur bg */} - + {!isMobile && ( + + )}
-
+ {/* Name */} +
{album?.name || playlist?.name}
-
+ + {/* Creator */} +
{album?.artist.name || playlist?.creator.nickname}
-
+ + {/* Extra info */} +
+ {/* Album info */} {!!album && ( <> {album?.mark === 1056768 && ( - + )}{' '} {dayjs(album?.publishTime || 0).year()} · {album?.songs.length}{' '} - Tracks, {albumDuration} + tracks, {albumDuration} )} + + {/* Playlist info */} {!!playlist && ( <> Updated at {formatDate(playlist?.updateTime || 0, 'en')} ·{' '} - {playlist.trackCount} Tracks + {playlist.trackCount} tracks )}
-
- {album?.description || playlist?.description} -
+ + {/* Description */} + {!isMobile && ( +
+ {album?.description || playlist?.description} +
+ )}
-
+ {/* Actions */} +
+
+ + +
- -
diff --git a/packages/web/hooks/useBreakpoint.ts b/packages/web/hooks/useBreakpoint.ts index f1c7701..3d08218 100644 --- a/packages/web/hooks/useBreakpoint.ts +++ b/packages/web/hooks/useBreakpoint.ts @@ -1,10 +1,10 @@ import { createBreakpoint } from 'react-use' const useBreakpoint = createBreakpoint({ - sm: 767, - md: 1023, - lg: 1279, - xl: 1535, + sm: 640, + md: 768, + lg: 1024, + xl: 1280, '2xl': 1536, }) as () => 'sm' | 'md' | 'lg' | 'xl' | '2xl' diff --git a/packages/web/index.html b/packages/web/index.html index 4d71e08..1c1cf5b 100644 --- a/packages/web/index.html +++ b/packages/web/index.html @@ -4,8 +4,10 @@ - + + + YesPlayMusic diff --git a/packages/web/pages/New/Album.tsx b/packages/web/pages/New/Album.tsx index dbd3c93..aed7cfe 100644 --- a/packages/web/pages/New/Album.tsx +++ b/packages/web/pages/New/Album.tsx @@ -25,7 +25,9 @@ const MoreByArtist = ({ album }: { album?: Album }) => { album => ['专辑', 'EP/Single', 'EP'].includes(album.type) && album.size > 1 ) - const singles = allReleases.filter(album => album.type === 'Single') + const singles = allReleases.filter( + album => album.type === 'Single' || album.size === 1 + ) const qualifiedAlbums = [...filteredAlbums, ...singles] @@ -63,17 +65,10 @@ const MoreByArtist = ({ album }: { album?: Album }) => { return (
{/* Dividing line */} -
+
{/* Title */} -
+
MORE BY{' '} {
- +
) } @@ -120,7 +115,7 @@ const Album = () => { diff --git a/packages/web/pages/New/My.tsx b/packages/web/pages/New/My.tsx index cfbf52f..52d8b52 100644 --- a/packages/web/pages/New/My.tsx +++ b/packages/web/pages/New/My.tsx @@ -78,13 +78,14 @@ const My = () => { tabs={tabs} value={selectedTab} onChange={(id: string) => setSelectedTab(id)} + className='px-2.5 lg:px-0' />
diff --git a/packages/web/styles/global.css b/packages/web/styles/global.css index aee1fd5..f0db938 100644 --- a/packages/web/styles/global.css +++ b/packages/web/styles/global.css @@ -138,4 +138,5 @@ a { html { background-color: black; + min-height: calc(100% + env(safe-area-inset-top)); } diff --git a/packages/web/tailwind.config.js b/packages/web/tailwind.config.js index a567e86..91461da 100644 --- a/packages/web/tailwind.config.js +++ b/packages/web/tailwind.config.js @@ -28,18 +28,7 @@ module.exports = { 900: '#7EB000', }, day: { - 100: '#FCFCFC', - 200: '#F8F8F8', - 300: '#F4F4F4', - 400: '#F0F0F0', - 500: '#EDEDED', - 600: '#E9E9E9', - 700: '#E5E5E5', - 800: '#E2E2E2', - 900: '#DEDEDE', - }, - night: { - 50: '#545454', + 50: '#B6B6B6', 100: '#535353', 200: '#505050', 300: '#484848', @@ -48,6 +37,17 @@ module.exports = { 600: '#0E0E0E', 700: '#060606', 800: '#020202', + }, + night: { + 50: '#BFBFBF', + 100: '#A8A8A8', + 200: '#7B7B7B', + 300: '#606060', + 400: '#585858', + 500: '#4A4A4A', + 600: '#464646', + 700: '#3F3F3F', + 800: '#373737', 900: '#313131', }, neutral: { @@ -82,10 +82,14 @@ module.exports = { 12: '12px', 20: '20px', 24: '24px', + 48: '48px', }, fontFamily: { mono: ['Roboto Mono', 'ui-monospace'], }, + margin: { + 7.5: '1.875rem', + }, }, }, variants: {},