diff --git a/README.md b/README.md index b4e8c03cd..39b1dd471 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
- - Grimmory + + Grimmory **Grimmory is a self-hosted digital library for people who take their reading seriously.** diff --git a/assets/logo-with-text-light.svg b/assets/logo-with-text-light.svg new file mode 100644 index 000000000..0e5f55f99 --- /dev/null +++ b/assets/logo-with-text-light.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/logo-with-text.svg b/assets/logo-with-text.svg index dda05869a..397942496 100644 --- a/assets/logo-with-text.svg +++ b/assets/logo-with-text.svg @@ -1,27 +1,63 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/logo.svg b/assets/logo.svg index f799e0923..51989ab47 100644 --- a/assets/logo.svg +++ b/assets/logo.svg @@ -1,15 +1,15 @@ - - - - + + + + - - - + + + - - - + + + diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico index 23dc628a4..26baea066 100644 Binary files a/frontend/public/favicon.ico and b/frontend/public/favicon.ico differ diff --git a/frontend/src/app/shared/components/setup/setup.component.html b/frontend/src/app/shared/components/setup/setup.component.html index 222e76102..c1e45d7e2 100644 --- a/frontend/src/app/shared/components/setup/setup.component.html +++ b/frontend/src/app/shared/components/setup/setup.component.html @@ -6,17 +6,17 @@
- + - - + + - - + + diff --git a/frontend/src/app/shared/layout/theme/favicon-service.spec.ts b/frontend/src/app/shared/layout/theme/favicon-service.spec.ts index 47d7093c6..d083897dc 100644 --- a/frontend/src/app/shared/layout/theme/favicon-service.spec.ts +++ b/frontend/src/app/shared/layout/theme/favicon-service.spec.ts @@ -3,7 +3,7 @@ import {describe, expect, it, vi} from 'vitest'; import {FaviconService} from './favicon-service'; describe('FaviconService', () => { - it('updates an existing favicon link with a generated SVG URL', () => { + it('updates the SVG favicon link with a generated SVG URL', async () => { const favicon = {type: '', href: ''} as HTMLLinkElement; const querySelectorSpy = vi.spyOn(document, 'querySelector').mockReturnValue(favicon); const createObjectUrlSpy = vi.spyOn(URL, 'createObjectURL').mockReturnValue('blob:favicon'); @@ -11,8 +11,12 @@ describe('FaviconService', () => { const service = new FaviconService(); service.updateFavicon('#abcdef', '#123456'); - expect(querySelectorSpy).toHaveBeenCalledWith("link[rel*='icon']"); + expect(querySelectorSpy).toHaveBeenCalledWith("link[rel~='icon'][type='image/svg+xml']"); expect(createObjectUrlSpy).toHaveBeenCalledOnce(); + const svg = await (createObjectUrlSpy.mock.calls[0][0] as Blob).text(); + expect(svg).toContain('stop-color="#abcdef"'); + expect(svg).toContain('stop-color="#123456"'); + expect(svg).toContain('fill="#FF2126"'); expect(favicon.type).toBe('image/svg+xml'); expect(favicon.href).toBe('blob:favicon'); }); diff --git a/frontend/src/app/shared/layout/theme/favicon-service.ts b/frontend/src/app/shared/layout/theme/favicon-service.ts index 9cd89f95e..7af5374f6 100644 --- a/frontend/src/app/shared/layout/theme/favicon-service.ts +++ b/frontend/src/app/shared/layout/theme/favicon-service.ts @@ -6,7 +6,7 @@ export class FaviconService { private svgTemplate = (startColor: string, endColor: string) => ` - + @@ -27,7 +27,7 @@ export class FaviconService { URL.revokeObjectURL(this.currentUrl); } - let favicon = document.querySelector("link[rel*='icon']") as HTMLLinkElement; + let favicon = document.querySelector("link[rel~='icon'][type='image/svg+xml']") as HTMLLinkElement; if (!favicon) { favicon = document.createElement('link'); favicon.rel = 'icon'; diff --git a/frontend/src/app/shared/service/app-theme.service.spec.ts b/frontend/src/app/shared/service/app-theme.service.spec.ts index 56b103c0a..0c1a45072 100644 --- a/frontend/src/app/shared/service/app-theme.service.spec.ts +++ b/frontend/src/app/shared/service/app-theme.service.spec.ts @@ -29,6 +29,8 @@ function createThemeComputedStyle(): CSSStyleDeclaration { ['0', '50', '100', '200', '300', '400', '500', '600', '700', '800', '900', '950'].forEach((stop) => { values.set(`--color-surface-${stop}`, `surface-${stop}`); }); + values.set('--color-logo-start', 'logo-start'); + values.set('--color-logo-end', 'logo-end'); return { getPropertyValue: (propertyName: string) => values.get(propertyName) ?? '', @@ -106,8 +108,8 @@ describe('AppThemeService', () => { expect(rootStyle.getPropertyValue('--color-app')).toBe(''); expect(rootStyle.getPropertyValue('--color-card')).toBe(''); expect(faviconServiceMock.updateFavicon).toHaveBeenCalledWith( - 'primary-300', - 'primary-500' + 'logo-start', + 'logo-end' ); }); @@ -122,8 +124,8 @@ describe('AppThemeService', () => { expect(rootStyle.getPropertyValue('--primary-300')).toBe(''); expect(rootStyle.getPropertyValue('--color-card')).toBe(''); expect(faviconServiceMock.updateFavicon).toHaveBeenLastCalledWith( - 'primary-300', - 'primary-500' + 'logo-start', + 'logo-end' ); }); diff --git a/frontend/src/app/shared/service/app-theme.service.ts b/frontend/src/app/shared/service/app-theme.service.ts index 4a0b1e69c..b7c4e2913 100644 --- a/frontend/src/app/shared/service/app-theme.service.ts +++ b/frontend/src/app/shared/service/app-theme.service.ts @@ -267,8 +267,8 @@ export class AppThemeService { private updateFavicon(): void { const styles = getComputedStyle(this.document.documentElement); this.faviconService.updateFavicon( - styles.getPropertyValue('--color-primary-300').trim(), - styles.getPropertyValue('--color-primary-500').trim(), + styles.getPropertyValue('--color-logo-start').trim(), + styles.getPropertyValue('--color-logo-end').trim(), ); } } diff --git a/frontend/src/assets/favicon.svg b/frontend/src/assets/favicon.svg index e61fbd6ec..21e1c7d03 100644 --- a/frontend/src/assets/favicon.svg +++ b/frontend/src/assets/favicon.svg @@ -1,15 +1,11 @@ - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/frontend/src/assets/styles/tailwind.css b/frontend/src/assets/styles/tailwind.css index 3150db0c0..67a1315cf 100644 --- a/frontend/src/assets/styles/tailwind.css +++ b/frontend/src/assets/styles/tailwind.css @@ -253,6 +253,8 @@ --color-surface-800: var(--color-stone-800); --color-surface-900: var(--color-stone-900); --color-surface-950: var(--color-stone-950); + --color-logo-start: #fdba74; + --color-logo-end: #f97316; } .dark[data-app-theme="grimmory"] { diff --git a/frontend/src/index.html b/frontend/src/index.html index 2deea71f8..b37ed7571 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -7,8 +7,8 @@ - - + +