core-maugli 1.2.28 → 1.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/Nav.astro +6 -13
package/package.json
CHANGED
package/src/components/Nav.astro
CHANGED
@@ -9,6 +9,7 @@ import { LANGUAGES } from '../i18n/languages';
|
|
9
9
|
const lang = typeof maugliConfig.defaultLang === 'string' ? maugliConfig.defaultLang : 'en';
|
10
10
|
const languageObj = LANGUAGES.find((l) => l.code === lang) || LANGUAGES.find((l) => l.code === 'en');
|
11
11
|
const dict = languageObj?.dict && Object.keys(languageObj.dict).length > 0 ? languageObj.dict : LANGUAGES.find((l) => l.code === 'en')?.dict || {};
|
12
|
+
const langLabel = languageObj?.label || lang;
|
12
13
|
|
13
14
|
const navLinks = (maugliConfig.navLinks || []).map((link) => {
|
14
15
|
const d = dict as any;
|
@@ -18,8 +19,8 @@ const navLinks = (maugliConfig.navLinks || []).map((link) => {
|
|
18
19
|
};
|
19
20
|
});
|
20
21
|
|
21
|
-
const openMenuLabel =
|
22
|
-
const closeMenuLabel =
|
22
|
+
const openMenuLabel = dict.nav?.openMenu || 'Open menu';
|
23
|
+
const closeMenuLabel = dict.nav?.closeMenu || 'Close menu';
|
23
24
|
---
|
24
25
|
|
25
26
|
<nav class="fixed top-0 left-0 w-full z-50 bg-[var(--bg-main)] opacity-95 backdrop-blur-lg flex items-center justify-between pt-4 pb-4">
|
@@ -27,15 +28,7 @@ const closeMenuLabel = (dict as any).closeMenu || 'Close menu';
|
|
27
28
|
<a href={maugliConfig.brand.logoHref && maugliConfig.brand.logoHref.trim() ? maugliConfig.brand.logoHref : '/'} class="ml-6 flex-shrink-0 card-blur">
|
28
29
|
<picture>
|
29
30
|
<source srcset={maugliConfig.brand.logoDark} media="(prefers-color-scheme: dark)" />
|
30
|
-
<img
|
31
|
-
src={maugliConfig.brand.logoLight}
|
32
|
-
alt="Логотип"
|
33
|
-
width="48"
|
34
|
-
height="48"
|
35
|
-
class="w-12 h-12"
|
36
|
-
loading="eager"
|
37
|
-
decoding="async"
|
38
|
-
/>
|
31
|
+
<img src={maugliConfig.brand.logoLight} alt="Логотип" width="48" height="48" class="w-12 h-12" loading="eager" decoding="async" />
|
39
32
|
</picture>
|
40
33
|
</a>
|
41
34
|
<ul
|
@@ -125,8 +118,8 @@ const closeMenuLabel = (dict as any).closeMenu || 'Close menu';
|
|
125
118
|
</style>
|
126
119
|
|
127
120
|
<script>
|
128
|
-
const openLabel =
|
129
|
-
const closeLabel =
|
121
|
+
const openLabel = '{openMenuLabel}';
|
122
|
+
const closeLabel = '{closeMenuLabel}';
|
130
123
|
|
131
124
|
function menuToggle() {
|
132
125
|
const menu = document.querySelector('.menu');
|