Skip to content

Commit

Permalink
Added a blurred background to full and mini player
Browse files Browse the repository at this point in the history
- Updated app dependencies.
- Disabled prettier lint workflow because it doesn't detect the config file.
- Added a `how to use` prompt when visiting the lyrics editor for the first time.
  • Loading branch information
Sandakan committed Jul 12, 2024
1 parent 7cd905d commit e77aa3b
Show file tree
Hide file tree
Showing 13 changed files with 531 additions and 819 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
uses: wearerequired/lint-action@v2
with:
eslint: true
prettier: true
prettier: false
5 changes: 1 addition & 4 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ appId: com.sandakannipunajith.nora
productName: Nora
copyright: Copyright © 2024 Sandakan Nipunajith
icon: ./build/icon.ico
artifactName: '${productName} Setup ${version}-${os}-${arch}.${ext}'
artifactName: '${productName} v${version}-${os}-${arch}.${ext}'

directories:
buildResources: build
Expand Down Expand Up @@ -94,9 +94,6 @@ mac:
- x64
- arm64

dmg:
artifactName: '${name}-${version}.${ext}'

linux:
target:
- AppImage
Expand Down
1,264 changes: 469 additions & 795 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"metadataEditingSupportedExtensions": [
"mp3"
],
"removeReactStrictMode": true,
"removeReactStrictMode": false,
"showSongIdInsteadOfSongYear": false,
"supportedMusicExtensions": [
"mp3",
Expand Down Expand Up @@ -98,7 +98,7 @@
"electron-store": "^10.0.0",
"electron-updater": "^6.1.7",
"i18next": "^23.7.6",
"music-metadata": "^8.3.0",
"music-metadata": "^9.0.0",
"node-id3": "^0.2.6",
"node-vibrant": "^3.2.1-alpha.1",
"react-beautiful-dnd": "^13.1.1",
Expand Down Expand Up @@ -134,7 +134,7 @@
"eslint-plugin-react-refresh": "^0.4.6",
"husky": "^9.0.11",
"jest": "^29.7.0",
"material-symbols": "^0.20.0",
"material-symbols": "^0.21.0",
"postcss": "^8.4.35",
"prettier": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.6.1",
Expand Down
1 change: 1 addition & 0 deletions src/@types/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ declare global {
doNotShowBlacklistSongConfirm: boolean;
isReducedMotion: boolean;
doNotVerifyWhenOpeningLinks: boolean;
doNotShowHelpPageOnLyricsEditorStartUp: boolean;
showSongRemainingTime: boolean;
showArtistArtworkNearSongControls: boolean;
disableBackgroundArtworks: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/assets/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"goBack": "Go back",
"saveArtwork": "Save artwork",
"readMoreAboutTitle": "Read more about the `{{title}}`",
"doNotShowThisMessageAgain": "Do not show this message again.",
"doNotShowThisMessageAgain": "Do not show again.",
"artistConflictResolved": "Artist conflict resolved successfully.",
"featArtistSuggestionResolved": "Featuring artists suggestion resolved successfully.",
"hasInternet": "You are connected to internet.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import SeekBarSlider from '../SeekBarSlider';

// type Props = {};

const isArtistBackgroundsEnabled = true;
const isArtistBackgroundsEnabled = false;

const FullScreenPlayer = () =>
// (props: Props)
Expand Down Expand Up @@ -66,9 +66,9 @@ const FullScreenPlayer = () =>
fallbackSrc={DefaultSongCover}
loading="eager"
alt="Song Cover"
className="h-full w-full object-cover shadow-lg !blur-[2px] !brightness-[.25] transition-[filter] delay-100 duration-200 ease-in-out"
className={`h-full w-full object-cover shadow-lg blur-none !brightness-[.25] transition-[filter] delay-100 duration-200 ease-in-out ${isLyricsVisible ? '!blur-[2rem]' : '!blur-[2rem]'}`}
/>
<div className="absolute inset-0 h-full w-full bg-gradient-to-r from-black/50 to-black/5"></div>
{/* <div className="absolute inset-0 h-full w-full bg-gradient-to-r from-black/50 to-black/5"></div> */}
</div>
<TitleBar />
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ const LyricsEditingPage = () => {
[currentSongData.songId, songId]
);

useEffect(() => {
if (
changePromptMenuData &&
!localStorageData?.preferences?.doNotShowHelpPageOnLyricsEditorStartUp
) {
changePromptMenuData(true, <LyricsEditorHelpPrompt showDoNotShowAgainCheckbox />);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
if (lyrics) {
const lines: ExtendedEditingLyricsLineData[] = lyrics.map((lineData, index) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,48 @@ import { AppUpdateContext } from '../../contexts/AppUpdateContext';

import Button from '../Button';
import ShortcutButton from '../SettingsPage/ShortcutButton';
import Checkbox from '../Checkbox';
import { AppContext } from '../../contexts/AppContext';
import storage from '../../../src/utils/localStorage';

const AppShortcutsPrompt = lazy(() => import('../SettingsPage/AppShortcutsPrompt'));

const LyricsEditorHelpPrompt = () => {
type Props = {
showDoNotShowAgainCheckbox?: boolean;
};

const LyricsEditorHelpPrompt = (props: Props) => {
const { localStorageData } = useContext(AppContext);
const { changePromptMenuData } = useContext(AppUpdateContext);
const { t } = useTranslation();

const { showDoNotShowAgainCheckbox = false } = props;

return (
<div>
<div className="title-container mb-4 flex items-center text-3xl font-medium text-font-color-highlight dark:text-dark-font-color-highlight">
<span className="material-icons-round-outlined mr-2 text-4xl">help</span>{' '}
{t('lyricsEditorHelpPrompt.title')}
<div className="title-container mb-4 flex items-center justify-between text-font-color-highlight dark:text-dark-font-color-highlight">
<span className="flex items-center text-3xl font-medium">
<span className="material-icons-round-outlined mr-2 text-4xl">help</span>{' '}
{t('lyricsEditorHelpPrompt.title')}
</span>

{showDoNotShowAgainCheckbox && (
<Checkbox
id="doNotShowHelpPageOnLyricsEditorStartUpCheckbox"
className="no-blacklist-song-confirm-checkbox-container my-8"
labelContent={t('common.doNotShowThisMessageAgain')}
isChecked={
localStorageData &&
(localStorageData.preferences?.doNotShowHelpPageOnLyricsEditorStartUp || false)
}
checkedStateUpdateFunction={(state) => {
storage.preferences.setPreferences('doNotShowHelpPageOnLyricsEditorStartUp', state);
}}
/>
)}
</div>
<ul className="pl-4">

<ul className="list-outside list-disc pl-8">
<li>
<h3 className="text-xl font-medium">{t('lyricsEditorHelpPrompt.subTitle1')}</h3>
<div className="mb-6 py-2 pl-4">
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/src/components/LyricsPage/LyricLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ const LyricLine = (props: LyricProp) => {
})
: undefined
}
className={`highlight duration-250 mb-5 flex w-fit select-none flex-col items-center justify-center text-balance text-center text-5xl font-medium text-font-color-black transition-[transform,color,filter] first:mt-8 last:mb-4 empty:mb-16 dark:text-font-color-white ${
className={`highlight duration-250 z-0 mb-5 flex w-fit select-none flex-col items-center justify-center text-balance text-center text-5xl font-medium text-font-color-black transition-[transform,color,filter] first:mt-8 last:mb-4 empty:mb-16 dark:text-font-color-white ${
syncedLyrics
? `cursor-pointer ${
? `cursor-pointer blur-[1px] ${
isInRange
? '!scale-100 text-font-color-highlight !text-opacity-90 !blur-0 dark:!text-dark-font-color-highlight [&>div>span]:!mr-3'
: 'scale-[.7] !text-opacity-20 hover:!text-opacity-75'
}`
: '!text-4xl'
} ${playerType === 'mini' && '!mb-2 !text-2xl !text-font-color-white'} ${
} ${playerType === 'mini' && '!mb-2 !text-2xl !text-font-color-white blur-[1px]'} ${
playerType === 'full' &&
'!mb-6 origin-left !items-start !justify-start !text-left !text-6xl !text-font-color-white blur-[1px]'
'!mb-6 origin-left !items-start !justify-start !text-left !text-6xl !text-font-color-white blur-[2px]'
}`}
ref={lyricsRef}
onClick={() =>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/components/MiniPlayer/MiniPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export default function MiniPlayer(props: MiniPlayerProps) {
loading="eager"
alt="Song Cover"
className={`h-full w-full object-cover transition-[filter] delay-100 duration-200 ease-in-out group-focus-within:blur-[2px] group-focus-within:brightness-75 group-hover:blur-[2px] group-hover:brightness-75 group-focus:blur-[4px] group-focus:brightness-75 ${
isLyricsVisible ? '!blur-[2px] !brightness-[.25]' : ''
} ${!isCurrentSongPlaying ? 'blur-[2px] brightness-75' : 'blur-0 brightness-100'}`}
isLyricsVisible ? '!blur-[1rem] !brightness-[.25]' : ''
} ${!isCurrentSongPlaying ? 'blur-[1rem] brightness-75' : 'blur-0 brightness-100'}`}
/>
</div>
<LyricsContainer isLyricsVisible={isLyricsVisible} />
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/components/SongsPage/Song.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ const Song = forwardRef((props: SongProp, ref: ForwardedRef<HTMLDivElement>) =>
label: t('common.info'),
class: 'info',
iconName: 'info',
iconClassName: 'material-icons-round-outlined',
handlerFunction: goToSongInfoPage,
isDisabled: isMultipleSelectionsEnabled
},
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/utils/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const LOCAL_STORAGE_DEFAULT_TEMPLATE: LocalStorage = {
lyricsAutomaticallySaveState: 'NONE',
showTrackNumberAsSongIndex: true,
allowToPreventScreenSleeping: true,
enableImageBasedDynamicThemes: false
enableImageBasedDynamicThemes: false,
doNotShowHelpPageOnLyricsEditorStartUp: false
},
playback: {
currentSong: {
Expand Down

0 comments on commit e77aa3b

Please sign in to comment.