|
1 | 1 | <script lang="ts"> |
2 | 2 | import { slide } from 'svelte/transition'; |
| 3 | + import { onMount } from 'svelte'; |
3 | 4 | import { trackEvent } from '$lib/actions/analytics'; |
4 | 5 | import { createAccordion, melt } from '@melt-ui/svelte'; |
5 | 6 |
|
6 | 7 | export let noBorder = false; |
| 8 | + let logoSrc = '/images/logos/appwrite.svg'; |
7 | 9 |
|
8 | 10 | const { |
9 | 11 | elements: { content, heading, item, root, trigger }, |
|
107 | 109 | { label: 'Security', href: '/docs/advanced/security' } |
108 | 110 | ] |
109 | 111 | }; |
| 112 | +
|
| 113 | + const syncBrandLogo = () => { |
| 114 | + logoSrc = document.body.classList.contains('brand-pink') |
| 115 | + ? '/images/logos/appwrite.svg' |
| 116 | + : '/images/logos/appwrite-green.svg'; |
| 117 | + }; |
| 118 | +
|
| 119 | + onMount(() => { |
| 120 | + syncBrandLogo(); |
| 121 | +
|
| 122 | + const brandObserver = new MutationObserver(syncBrandLogo); |
| 123 | + brandObserver.observe(document.body, { attributes: true, attributeFilter: ['class'] }); |
| 124 | +
|
| 125 | + return () => { |
| 126 | + brandObserver.disconnect(); |
| 127 | + }; |
| 128 | + }); |
110 | 129 | </script> |
111 | 130 |
|
112 | 131 | <nav |
113 | 132 | aria-label="Footer" |
114 | 133 | class="web-footer-nav relative mt-24" |
115 | 134 | class:web-u-sep-block-start={!noBorder} |
116 | 135 | > |
117 | | - <img class="web-logo" src="/images/logos/appwrite.svg" alt="appwrite" height="24" width="130" /> |
| 136 | + <img class="web-logo" src={logoSrc} alt="appwrite" height="24" width="130" /> |
118 | 137 | <ul class="web-footer-nav-main-list" use:melt={$root}> |
119 | 138 | {#each Object.entries(links) as [title, items]} |
120 | 139 | <li class="web-footer-nav-main-item web-is-not-mobile"> |
|
0 commit comments