mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor: immich logo assets (#16850)
This commit is contained in:
parent
f69d7e7bad
commit
a65ce2ac55
9 changed files with 8 additions and 338 deletions
|
|
@ -1,13 +1,10 @@
|
|||
<script lang="ts">
|
||||
import logoDarkUrl from '$lib/assets/immich-logo-inline-dark.svg';
|
||||
import logoLightUrl from '$lib/assets/immich-logo-inline-light.svg';
|
||||
import logoNoText from '$lib/assets/immich-logo.svg';
|
||||
import { content as alternativeLogo } from '$lib/assets/immich-logo.json';
|
||||
import { Theme } from '$lib/constants';
|
||||
import { colorTheme } from '$lib/stores/preferences.store';
|
||||
import { immichLogo, immichLogoInlineDark, immichLogoInlineLight, immichLogoJson } from '@immich/ui';
|
||||
import { DateTime } from 'luxon';
|
||||
import type { HTMLImgAttributes } from 'svelte/elements';
|
||||
import { t } from 'svelte-i18n';
|
||||
import type { HTMLImgAttributes } from 'svelte/elements';
|
||||
|
||||
interface Props extends HTMLImgAttributes {
|
||||
noText?: boolean;
|
||||
|
|
@ -16,16 +13,15 @@
|
|||
|
||||
let { noText = false, draggable = false, ...rest }: Props = $props();
|
||||
|
||||
const logoUrl = $derived(
|
||||
noText ? immichLogo : $colorTheme.value == Theme.LIGHT ? immichLogoInlineLight : immichLogoInlineDark,
|
||||
);
|
||||
|
||||
const today = DateTime.now().toLocal();
|
||||
</script>
|
||||
|
||||
{#if today.month === 4 && today.day === 1}
|
||||
<img src="data:image/png;base64, {alternativeLogo}" alt={$t('immich_logo')} class="h-20" {draggable} />
|
||||
<img src="data:image/png;base64, {immichLogoJson.content}" alt={$t('immich_logo')} class="h-14" {draggable} />
|
||||
{:else}
|
||||
<img
|
||||
src={noText ? logoNoText : $colorTheme.value == Theme.LIGHT ? logoLightUrl : logoDarkUrl}
|
||||
alt={$t('immich_logo')}
|
||||
{draggable}
|
||||
{...rest}
|
||||
/>
|
||||
<img src={logoUrl} alt={$t('immich_logo')} {draggable} {...rest} />
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue