2023-06-09 03:37:38 -07:00
|
|
|
import { Group, Center } from '@mantine/core';
|
2023-03-28 14:19:23 -07:00
|
|
|
import { motion } from 'framer-motion';
|
2023-10-30 19:22:45 -07:00
|
|
|
import { useTranslation } from 'react-i18next';
|
2023-03-28 14:19:23 -07:00
|
|
|
import { HiOutlineQueueList } from 'react-icons/hi2';
|
|
|
|
|
import { RiFileMusicLine, RiFileTextLine, RiInformationFill } from 'react-icons/ri';
|
|
|
|
|
import styled from 'styled-components';
|
2023-06-05 02:57:20 -07:00
|
|
|
import { Button, TextTitle } from '/@/renderer/components';
|
2023-03-28 14:19:23 -07:00
|
|
|
import { PlayQueue } from '/@/renderer/features/now-playing';
|
|
|
|
|
import {
|
2023-07-01 19:10:05 -07:00
|
|
|
useFullScreenPlayerStore,
|
|
|
|
|
useFullScreenPlayerStoreActions,
|
2023-03-28 14:19:23 -07:00
|
|
|
} from '/@/renderer/store/full-screen-player.store';
|
2023-05-22 17:38:31 -07:00
|
|
|
import { Lyrics } from '/@/renderer/features/lyrics/lyrics';
|
2023-03-28 14:19:23 -07:00
|
|
|
|
|
|
|
|
const QueueContainer = styled.div`
|
2023-07-01 19:10:05 -07:00
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
height: 100%;
|
2023-03-28 14:19:23 -07:00
|
|
|
|
2023-07-01 19:10:05 -07:00
|
|
|
.ag-theme-alpine-dark {
|
2023-09-15 20:42:38 -07:00
|
|
|
--ag-header-background-color: rgb(0 0 0 / 0%) !important;
|
|
|
|
|
--ag-background-color: rgb(0 0 0 / 0%) !important;
|
|
|
|
|
--ag-odd-row-background-color: rgb(0 0 0 / 0%) !important;
|
2023-07-01 19:10:05 -07:00
|
|
|
}
|
2023-03-28 14:19:23 -07:00
|
|
|
|
2023-07-01 19:10:05 -07:00
|
|
|
.ag-header {
|
|
|
|
|
display: none !important;
|
|
|
|
|
}
|
2023-03-28 14:19:23 -07:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const ActiveTabIndicator = styled(motion.div)`
|
2023-07-01 19:10:05 -07:00
|
|
|
position: absolute;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 2px;
|
|
|
|
|
background: var(--main-fg);
|
2023-03-28 14:19:23 -07:00
|
|
|
`;
|
|
|
|
|
|
2023-06-03 23:21:00 -07:00
|
|
|
const HeaderItemWrapper = styled.div`
|
2023-07-01 19:10:05 -07:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 2;
|
2023-06-03 23:21:00 -07:00
|
|
|
`;
|
|
|
|
|
|
2023-09-10 22:03:46 +00:00
|
|
|
interface TransparendGridContainerProps {
|
|
|
|
|
opacity: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const GridContainer = styled.div<TransparendGridContainerProps>`
|
2023-07-01 19:10:05 -07:00
|
|
|
display: grid;
|
|
|
|
|
grid-template-rows: auto minmax(0, 1fr);
|
|
|
|
|
grid-template-columns: 1fr;
|
2023-09-15 20:42:38 -07:00
|
|
|
padding: 1rem;
|
2023-10-31 04:16:46 -07:00
|
|
|
/* stylelint-disable-next-line color-function-notation */
|
|
|
|
|
background: rgb(var(--main-bg-transparent), ${({ opacity }) => opacity}%);
|
2023-09-10 22:03:46 +00:00
|
|
|
border-radius: 5px;
|
2023-06-09 03:37:38 -07:00
|
|
|
`;
|
|
|
|
|
|
2023-03-28 14:19:23 -07:00
|
|
|
export const FullScreenPlayerQueue = () => {
|
2023-10-30 19:22:45 -07:00
|
|
|
const { t } = useTranslation();
|
2023-09-10 22:03:46 +00:00
|
|
|
const { activeTab, opacity } = useFullScreenPlayerStore();
|
2023-07-01 19:10:05 -07:00
|
|
|
const { setStore } = useFullScreenPlayerStoreActions();
|
2023-03-28 14:19:23 -07:00
|
|
|
|
2023-07-01 19:10:05 -07:00
|
|
|
const headerItems = [
|
|
|
|
|
{
|
|
|
|
|
active: activeTab === 'queue',
|
|
|
|
|
icon: <RiFileMusicLine size="1.5rem" />,
|
2023-10-31 04:17:15 -07:00
|
|
|
label: t('page.fullscreenPlayer.upNext'),
|
2023-07-01 19:10:05 -07:00
|
|
|
onClick: () => setStore({ activeTab: 'queue' }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
active: activeTab === 'related',
|
|
|
|
|
icon: <HiOutlineQueueList size="1.5rem" />,
|
2023-10-31 04:17:15 -07:00
|
|
|
label: t('page.fullscreenPlayer.related'),
|
2023-07-01 19:10:05 -07:00
|
|
|
onClick: () => setStore({ activeTab: 'related' }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
active: activeTab === 'lyrics',
|
|
|
|
|
icon: <RiFileTextLine size="1.5rem" />,
|
2023-10-31 04:17:15 -07:00
|
|
|
label: t('page.fullscreenPlayer.lyrics'),
|
2023-07-01 19:10:05 -07:00
|
|
|
onClick: () => setStore({ activeTab: 'lyrics' }),
|
|
|
|
|
},
|
|
|
|
|
];
|
2023-03-28 14:19:23 -07:00
|
|
|
|
2023-10-31 04:17:15 -07:00
|
|
|
console.log('opacity', opacity);
|
|
|
|
|
|
2023-07-01 19:10:05 -07:00
|
|
|
return (
|
2023-09-10 22:03:46 +00:00
|
|
|
<GridContainer
|
|
|
|
|
className="full-screen-player-queue-container"
|
|
|
|
|
opacity={opacity}
|
|
|
|
|
>
|
2023-07-01 19:10:05 -07:00
|
|
|
<Group
|
|
|
|
|
grow
|
|
|
|
|
align="center"
|
|
|
|
|
position="center"
|
2023-03-28 14:19:23 -07:00
|
|
|
>
|
2023-07-01 19:10:05 -07:00
|
|
|
{headerItems.map((item) => (
|
|
|
|
|
<HeaderItemWrapper key={`tab-${item.label}`}>
|
|
|
|
|
<Button
|
|
|
|
|
fullWidth
|
|
|
|
|
uppercase
|
|
|
|
|
fw="600"
|
|
|
|
|
pos="relative"
|
|
|
|
|
size="lg"
|
|
|
|
|
sx={{
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
color: item.active
|
|
|
|
|
? 'var(--main-fg) !important'
|
|
|
|
|
: 'var(--main-fg-secondary) !important',
|
|
|
|
|
letterSpacing: '1px',
|
|
|
|
|
}}
|
|
|
|
|
variant="subtle"
|
|
|
|
|
onClick={item.onClick}
|
|
|
|
|
>
|
|
|
|
|
{item.label}
|
|
|
|
|
</Button>
|
|
|
|
|
{item.active ? <ActiveTabIndicator layoutId="underline" /> : null}
|
|
|
|
|
</HeaderItemWrapper>
|
|
|
|
|
))}
|
|
|
|
|
</Group>
|
|
|
|
|
{activeTab === 'queue' ? (
|
|
|
|
|
<QueueContainer>
|
|
|
|
|
<PlayQueue type="fullScreen" />
|
|
|
|
|
</QueueContainer>
|
|
|
|
|
) : activeTab === 'related' ? (
|
|
|
|
|
<Center>
|
|
|
|
|
<Group>
|
|
|
|
|
<RiInformationFill size="2rem" />
|
|
|
|
|
<TextTitle
|
|
|
|
|
order={3}
|
|
|
|
|
weight={700}
|
|
|
|
|
>
|
2023-10-30 19:22:45 -07:00
|
|
|
{t('common.comingSoon', { postProcess: 'upperCase' })}
|
2023-07-01 19:10:05 -07:00
|
|
|
</TextTitle>
|
|
|
|
|
</Group>
|
|
|
|
|
</Center>
|
|
|
|
|
) : activeTab === 'lyrics' ? (
|
|
|
|
|
<Lyrics />
|
|
|
|
|
) : null}
|
|
|
|
|
</GridContainer>
|
|
|
|
|
);
|
2023-03-28 14:19:23 -07:00
|
|
|
};
|