diff --git a/web/index.html b/web/index.html index 97acf7e..c423c0d 100644 --- a/web/index.html +++ b/web/index.html @@ -3,6 +3,9 @@ + + + Sonda diff --git a/web/public/apple-touch-icon.png b/web/public/apple-touch-icon.png new file mode 100644 index 0000000..7fc7e89 Binary files /dev/null and b/web/public/apple-touch-icon.png differ diff --git a/web/public/favicon.svg b/web/public/favicon.svg index 6893eb1..e184378 100644 --- a/web/public/favicon.svg +++ b/web/public/favicon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/web/public/icon-192.png b/web/public/icon-192.png new file mode 100644 index 0000000..b03c8e6 Binary files /dev/null and b/web/public/icon-192.png differ diff --git a/web/public/icon-512.png b/web/public/icon-512.png new file mode 100644 index 0000000..b315aa2 Binary files /dev/null and b/web/public/icon-512.png differ diff --git a/web/src/auth/LoginPage.tsx b/web/src/auth/LoginPage.tsx index a25ded9..3f225b9 100644 --- a/web/src/auth/LoginPage.tsx +++ b/web/src/auth/LoginPage.tsx @@ -1,6 +1,7 @@ import { useState, type FormEvent } from 'react' import { useTranslation } from 'react-i18next' import { ApiError } from '@/api/client' +import Logo from '@/components/Logo' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' @@ -32,14 +33,7 @@ export default function LoginPage() { return (
-
- - {t('app.name')} -
+

{creating ? t('auth.registerTitle') : t('auth.signInTitle')}

@@ -76,7 +70,7 @@ export default function LoginPage() { {open && setOpen(false)} />} diff --git a/web/src/components/Logo.test.tsx b/web/src/components/Logo.test.tsx new file mode 100644 index 0000000..f4cec10 --- /dev/null +++ b/web/src/components/Logo.test.tsx @@ -0,0 +1,26 @@ +import { render, screen } from '@testing-library/react' +import { expect, test } from 'vitest' +import Logo from './Logo' + +test('the logo is a picture named after the app, in the colours of the theme', () => { + const { container } = render() + const svg = screen.getByRole('img', { name: 'Sonda' }) + expect(svg).toBe(container.querySelector('svg')) + const paths = Array.from(container.querySelectorAll('path')) + expect(paths.map((p) => p.getAttribute('fill'))).toEqual(['var(--foreground)', 'var(--primary)']) + expect(paths.every((p) => (p.getAttribute('d') ?? '').length > 500)).toBe(true) +}) + +test('the mark is the O alone, in the accent colour', () => { + const { container } = render() + expect(screen.getByRole('img', { name: 'Sonda' })).toBeInTheDocument() + const paths = container.querySelectorAll('path') + expect(paths).toHaveLength(1) + expect(paths[0].getAttribute('fill')).toBe('var(--primary)') + expect(container.querySelector('svg')?.getAttribute('viewBox')).not.toBe(render().container.querySelector('svg')?.getAttribute('viewBox')) +}) + +test('a size can be given by a class', () => { + const { container } = render() + expect(container.querySelector('svg')).toHaveClass('h-7', 'w-auto') +}) diff --git a/web/src/components/Logo.tsx b/web/src/components/Logo.tsx new file mode 100644 index 0000000..7874d81 --- /dev/null +++ b/web/src/components/Logo.tsx @@ -0,0 +1,20 @@ +import { MARK, MARK_BOX, WORD_BOX, WORD_ONDA, WORD_S } from './logoPaths' + +/** + * The logo of Sonda: "sONDA", the s in the text colour and the rest, whose O is a sea wave, in the accent colour of the + * theme. `mark` is the O alone, for where there is no room for the word. It is a picture with the name of the app. + */ +export default function Logo({ name, mark = false, className }: { name: string; mark?: boolean; className?: string }) { + return ( + + {mark ? ( + + ) : ( + <> + + + + )} + + ) +} diff --git a/web/src/components/Scrubber.tsx b/web/src/components/Scrubber.tsx index 097a719..fef02c0 100644 --- a/web/src/components/Scrubber.tsx +++ b/web/src/components/Scrubber.tsx @@ -33,7 +33,7 @@ export default function Scrubber({ positionMs, durationMs, onSeek, variant }: Sc onChange={(e) => onSeek(Number(e.target.value))} className={cn( 'cursor-pointer disabled:cursor-default', - variant === 'line' ? 'h-1 w-full accent-primary' : 'absolute inset-0 h-full w-full opacity-0', + variant === 'line' ? 'h-6 w-full accent-primary' : 'absolute inset-0 h-full w-full opacity-0', )} /> ) diff --git a/web/src/components/cards.tsx b/web/src/components/cards.tsx index 1f197e7..5351329 100644 --- a/web/src/components/cards.tsx +++ b/web/src/components/cards.tsx @@ -10,7 +10,7 @@ export const CARD_GRID = 'grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] g export function ArtistCard({ artist }: { artist: Artist }) { const { t } = useTranslation() return ( - + {artist.name} @@ -24,7 +24,7 @@ export function ArtistCard({ artist }: { artist: Artist }) { export function AlbumCard({ album }: { album: Album }) { return ( - + {album.title} diff --git a/web/src/components/layout/PlayerBar.tsx b/web/src/components/layout/PlayerBar.tsx index 5843761..d56926b 100644 --- a/web/src/components/layout/PlayerBar.tsx +++ b/web/src/components/layout/PlayerBar.tsx @@ -39,9 +39,9 @@ export default function PlayerBar() { return (