Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancements]: fix carousel, full screen metadata improvements #524

Merged
merged 5 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 36 additions & 37 deletions src/renderer/components/grid-carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,46 +279,45 @@ export const SwiperGridCarousel = ({

return (
<CarouselContainer
ref={containerRef}
className="grid-carousel"
spacing="md"
>
<div ref={containerRef}>
{title ? (
<Title
{...title}
handleNext={handleNext}
handlePrev={handlePrev}
pagination={pagination}
/>
) : null}
<Swiper
ref={swiperRef}
resizeObserver
modules={[Virtual]}
slidesPerView={slideCount}
spaceBetween={20}
style={{ height: '100%', width: '100%' }}
onBeforeInit={(swiper) => {
swiperRef.current = swiper;
}}
onReachBeginning={handleOnReachBeginning}
onReachEnd={handleOnReachEnd}
onSlideChange={handleOnSlideChange}
onZoomChange={handleOnZoomChange}
{...swiperProps}
>
{slides.map((slideContent, index) => {
return (
<SwiperSlide
key={`${uniqueId}-${slideContent?.props?.data?.id}-${index}`}
virtualIndex={index}
>
{slideContent}
</SwiperSlide>
);
})}
</Swiper>
</div>
{title ? (
<Title
{...title}
handleNext={handleNext}
handlePrev={handlePrev}
pagination={pagination}
/>
) : null}
<Swiper
ref={swiperRef}
resizeObserver
modules={[Virtual]}
slidesPerView={slideCount}
spaceBetween={20}
style={{ height: '100%', width: '100%' }}
onBeforeInit={(swiper) => {
swiperRef.current = swiper;
}}
onReachBeginning={handleOnReachBeginning}
onReachEnd={handleOnReachEnd}
onSlideChange={handleOnSlideChange}
onZoomChange={handleOnZoomChange}
{...swiperProps}
>
{slides.map((slideContent, index) => {
return (
<SwiperSlide
key={`${uniqueId}-${slideContent?.props?.data?.id}-${index}`}
virtualIndex={index}
>
{slideContent}
</SwiperSlide>
);
})}
</Swiper>
</CarouselContainer>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Flex, Stack, Group, Center } from '@mantine/core';
import { useSetState } from '@mantine/hooks';
import { AnimatePresence, HTMLMotionProps, motion, Variants } from 'framer-motion';
import { useEffect, useRef, useLayoutEffect, useState, useCallback } from 'react';
import { useEffect, useRef, useLayoutEffect, useState, useCallback, Fragment } from 'react';
import { RiAlbumFill } from 'react-icons/ri';
import { generatePath } from 'react-router';
import { Link } from 'react-router-dom';
Expand Down Expand Up @@ -257,7 +257,6 @@ export const FullScreenPlayerImage = () => {
align="center"
order={1}
overflow="hidden"
pb="0.5rem"
style={{
textShadow: 'var(--fullscreen-player-text-shadow)',
}}
Expand All @@ -283,41 +282,48 @@ export const FullScreenPlayerImage = () => {
>
{currentSong?.album}{' '}
</TextTitle>
{currentSong?.artists?.map((artist, index) => (
<TextTitle
key={`fs-artist-${artist.id}`}
align="center"
order={3}
style={{
textShadow: 'var(--fullscreen-player-text-shadow)',
}}
>
{index > 0 && (
<TextTitle
key="fs-artists"
align="center"
order={3}
style={{
textShadow: 'var(--fullscreen-player-text-shadow)',
}}
>
{currentSong?.artists?.map((artist, index) => (
<Fragment key={`fs-artist-${artist.id}`}>
{index > 0 && (
<Text
$secondary
sx={{
display: 'inline-block',
padding: '0 0.5rem',
}}
>
</Text>
)}
<Text
sx={{
display: 'inline-block',
padding: '0 0.5rem',
$link
$secondary
component={Link}
style={{
textShadow: 'var(--fullscreen-player-text-shadow)',
}}
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})}
weight={600}
>
{artist.name}
</Text>
)}
<Text
$link
component={Link}
style={{
textShadow: 'var(--fullscreen-player-text-shadow)',
}}
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
albumArtistId: artist.id,
})}
weight={600}
>
{artist.name}
</Text>
</TextTitle>
))}
<Group position="center">
</Fragment>
))}
</TextTitle>
<Group
mt="sm"
position="center"
>
{currentSong?.container && (
<Badge size="lg">
{currentSong?.container} {currentSong?.bitRate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ export const FullScreenPlayerQueue = () => {
},
];

console.log('opacity', opacity);

return (
<GridContainer
className="full-screen-player-queue-container"
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/themes/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
--background-noise: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJhIiB4PSIwIiB5PSIwIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iLjc1IiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PGZlQ29sb3JNYXRyaXggdHlwZT0ic2F0dXJhdGUiIHZhbHVlcz0iMCIvPjwvZmlsdGVyPjxwYXRoIGZpbHRlcj0idXJsKCNhKSIgb3BhY2l0eT0iLjA1IiBkPSJNMCAwaDMwMHYzMDBIMHoiLz48L3N2Zz4=');
--current-song-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIxMDAgMTMwIDU3IDgwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjEwMCIgeT0iMTMwIiB3aWR0aD0iMTIiIGhlaWdodD0iMjAiIHN0eWxlPSJmaWxsOiByZ2IoMjE2LCAyMTYsIDIxNik7IHN0cm9rZTogcmdiKDAsIDAsIDApOyB0cmFuc2Zvcm0tb3JpZ2luOiAxMDZwe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MTMwIiB3aWR0aD0iMTIiIGhlaWdodD0iODAiIHN0eWxlPSJmaWxsOiByZ2IoMjE2LCAyMTYsIDIxNik7IHN0cm9rZTogcmdiKDAsIDAsIDApOyB0cmFuc2Zvcm0tb3JpZ2luOiAxNTFweCAxNzBweDsiPgogICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiB2YWx1ZXM9IjMwOzgwOzMwIiBiZWdpbj0iMC4xcyIgZHVyPSIxLjA1cyIga2V5VGltZXM9IjA7IDAuMzE1Nzk7IDEiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBjYWxjTW9kZT0ic3BsaW5lIiBrZXlTcGxpbmVzPSIwLjQyIDAgMC41OCAxOyAwLjQyIDAgMC41OCAxIi8+CiAgPC9yZWN0Pgo8L3N2Zz4=');
--bg-header-overlay: linear-gradient(transparent 0%, rgba(0, 0, 0, 50%) 100%),
--bg-header-overlay: linear-gradient(transparent 0%, rgba(0, 0, 0, 75%) 100%),
var(--background-noise);
--bg-subheader-overlay: linear-gradient(180deg, rgba(0, 0, 0, 5%) 0%, var(--main-bg) 100%),
var(--background-noise);
Expand All @@ -116,7 +116,7 @@
--table-fg: rgb(179, 179, 179);
--table-row-hover-bg: rgba(100, 100, 100, 20%);
--table-row-selected-bg: rgba(100, 100, 100, 40%);
--fullscreen-player-text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
--fullscreen-player-text-shadow: black 0px 0px 10px;

.ag-theme-alpine-dark {
--ag-font-family: var(--content-font-family);
Expand Down Expand Up @@ -188,9 +188,11 @@

.current-song {
background: var(--table-row-hover-bg);
box-shadow: inset 0 0 0 100vmax rgba(0, 0, 0, 0.3);

.current-song-child {
color: var(--primary-color) !important;
font-weight: 800;
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/renderer/themes/light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,14 @@ body[data-theme='defaultLight'] {
.ag-root ::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb-bg);
}

.current-song {
background: var(--table-row-hover-bg);
box-shadow: inset 0 0 0 100vmax rgba(255, 255, 255, 0.3);

.current-song-child {
color: var(--primary-color) !important;
font-weight: 800;
}
}
}
Loading