From 24901531342dc6e5e600f38076516f3e42abb15d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20de=20la=20Martini=C3=A8re?= Date: Thu, 3 Aug 2023 15:58:31 +0200 Subject: [PATCH] Re-think header --- package.json | 1 + .../components/Cover/Cover.module.css | 19 ++++++------ src/renderer/components/Cover/Cover.tsx | 21 ++++++++++--- .../DropzoneImport/DropzoneImport.module.css | 2 +- .../components/Header/Header.module.css | 5 ++- .../PlayerControls/PlayerControls.module.css | 5 +++ .../PlayerOptionsButtons/common.module.css | 8 ++--- .../PlayingBar/PlayingBar.module.css | 23 ++++++++------ .../components/PlayingBar/PlayingBar.tsx | 8 +++-- .../PlayingBarInfo/PlayingBarInfo.module.css | 31 ++++++++++--------- .../PlayingBarInfo/PlayingBarInfo.tsx | 21 ++++++------- .../components/Search/Search.module.css | 2 ++ .../TracksListHeaderCell.module.css | 2 +- src/renderer/styles/general.module.css | 8 ++++- src/shared/themes/dark-legacy.json | 2 +- src/shared/themes/dark.json | 2 +- src/shared/themes/light.json | 2 +- yarn.lock | 8 +++++ 18 files changed, 105 insertions(+), 65 deletions(-) diff --git a/package.json b/package.json index 9a07fb164..c140a4385 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ }, "dependencies": { "@electron/remote": "^2.0.10", + "@radix-ui/react-aspect-ratio": "^1.0.3", "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-slider": "^1.1.2", "@tanstack/react-virtual": "3.0.0-beta.54", diff --git a/src/renderer/components/Cover/Cover.module.css b/src/renderer/components/Cover/Cover.module.css index 655e4d553..c9bdbd3ee 100644 --- a/src/renderer/components/Cover/Cover.module.css +++ b/src/renderer/components/Cover/Cover.module.css @@ -1,21 +1,22 @@ .cover { - width: 48px; - height: 48px; - margin-right: 10px; - background-position: center; - background-size: cover; + object-fit: cover; + width: 100%; + height: 100%; text-align: center; - border-style: solid; - border-color: var(--border-color); - border-width: 0 1px; display: flex; align-items: center; justify-content: center; box-sizing: content-box; } +.empty { + border: solid 1px var(--border-color); + border-width: 0 1px; + box-sizing: border-box; +} + .cover__note { font-family: monospace; /* the sexy one */ - font-size: 30px; + font-size: 28px; line-height: 28px; } diff --git a/src/renderer/components/Cover/Cover.tsx b/src/renderer/components/Cover/Cover.tsx index 42b28a2dd..ce2d1f324 100644 --- a/src/renderer/components/Cover/Cover.tsx +++ b/src/renderer/components/Cover/Cover.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from 'react'; +import * as AspectRatio from '@radix-ui/react-aspect-ratio'; import { Track } from '../../../shared/types/museeks'; @@ -26,14 +27,24 @@ export default function Cover(props: Props) { const encodedCoverPath = encodeURI(coverPath) .replace(/'/g, "\\'") .replace(/"/g, '\\"'); - const inlineStyles = { backgroundImage: `url('${encodedCoverPath}')` }; - return
; + return ( + + Album cover + + ); } return ( -
-
-
+ +
+ {/** billion dollar problem: convert emoji to text, good luck 🎵 */} +
+
+
); } diff --git a/src/renderer/components/DropzoneImport/DropzoneImport.module.css b/src/renderer/components/DropzoneImport/DropzoneImport.module.css index 9f0f498dc..d703011d9 100644 --- a/src/renderer/components/DropzoneImport/DropzoneImport.module.css +++ b/src/renderer/components/DropzoneImport/DropzoneImport.module.css @@ -2,7 +2,7 @@ position: fixed; inset: 0; pointer-events: none; - background: var(--faded); + background: var(--faded-bg); z-index: 1000; display: flex; flex-direction: column; diff --git a/src/renderer/components/Header/Header.module.css b/src/renderer/components/Header/Header.module.css index 3e9073b36..c9379cec4 100644 --- a/src/renderer/components/Header/Header.module.css +++ b/src/renderer/components/Header/Header.module.css @@ -17,7 +17,7 @@ color: var(--header-color); padding: 0 10px; display: flex; - align-items: center; + align-items: stretch; justify-content: space-between; height: 50px; flex: 0 0 auto; @@ -27,7 +27,6 @@ } .header__mainControls { - width: 220px; flex: 0 0 auto; display: flex; align-items: center; @@ -36,7 +35,7 @@ .header__search { -webkit-app-region: no-drag; - width: 220px; + margin-left: 12px; flex: 0 0 auto; display: flex; justify-content: flex-end; diff --git a/src/renderer/components/PlayerControls/PlayerControls.module.css b/src/renderer/components/PlayerControls/PlayerControls.module.css index dd0deae21..f7c76039a 100644 --- a/src/renderer/components/PlayerControls/PlayerControls.module.css +++ b/src/renderer/components/PlayerControls/PlayerControls.module.css @@ -30,3 +30,8 @@ } } } + +.playerOptions { + display: flex; + flex-direction: column; +} diff --git a/src/renderer/components/PlayerOptionsButtons/common.module.css b/src/renderer/components/PlayerOptionsButtons/common.module.css index df9fae02c..95a3a5949 100644 --- a/src/renderer/components/PlayerOptionsButtons/common.module.css +++ b/src/renderer/components/PlayerOptionsButtons/common.module.css @@ -2,8 +2,8 @@ display: flex; align-items: center; justify-content: center; - height: 16px; - width: 16px; + height: 20px; + width: 20px; } .button { @@ -11,7 +11,7 @@ border: 0; color: inherit; background: transparent; - font-size: 18px; + font-size: 20px; &.active { .icon > svg { @@ -21,7 +21,7 @@ .icon > svg { fill: currentcolor; - width: 16px; + width: 18px; height: auto; } } diff --git a/src/renderer/components/PlayingBar/PlayingBar.module.css b/src/renderer/components/PlayingBar/PlayingBar.module.css index efdebb0e6..2bbf77b45 100644 --- a/src/renderer/components/PlayingBar/PlayingBar.module.css +++ b/src/renderer/components/PlayingBar/PlayingBar.module.css @@ -1,23 +1,19 @@ .playingBar { display: flex; align-items: center; - justify-content: space-between; text-align: center; + height: 100%; } .playingBar__cover { - width: 60px; - flex: 0 0 auto; -} - -.playingBar__queue { - -webkit-app-region: no-drag; - width: 60px; - flex: 0 0 auto; - position: relative; + flex-shrink: 0; + width: 49px; + overflow: hidden; } .queueToggle { + line-height: 22px; + margin-left: 12px; color: inherit; border: 0; background: transparent; @@ -37,3 +33,10 @@ display: block; } } + +.playerOptions { + -webkit-app-region: no-drag; + flex-shrink: 0; + display: flex; + align-items: center; +} diff --git a/src/renderer/components/PlayingBar/PlayingBar.tsx b/src/renderer/components/PlayingBar/PlayingBar.tsx index e688e8962..ba6f5ce26 100644 --- a/src/renderer/components/PlayingBar/PlayingBar.tsx +++ b/src/renderer/components/PlayingBar/PlayingBar.tsx @@ -5,6 +5,8 @@ import Queue from '../Queue/Queue'; import PlayingBarInfos from '../PlayingBarInfo/PlayingBarInfo'; import Cover from '../Cover/Cover'; import usePlayerStore from '../../stores/usePlayerStore'; +import ButtonRepeat from '../PlayerOptionsButtons/ButtonRepeat'; +import ButtonShuffle from '../PlayerOptionsButtons/ButtonShuffle'; import styles from './PlayingBar.module.css'; @@ -28,7 +30,9 @@ export default function PlayingBar() { shuffle={shuffle} repeat={repeat} /> -
+
+ +