create-velocity-astro 1.0.4 → 1.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-velocity-astro",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Create Velocity - A CLI to scaffold production-ready Astro 6 + Tailwind v4 projects",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,126 @@
1
+ ---
2
+ import Button from '@/components/ui/Button.astro';
3
+ import Icon from '@/components/ui/Icon.astro';
4
+ import ThemeToggle from '@/components/layout/ThemeToggle.astro';
5
+ import LanguageSwitcher from '@/components/i18n/LanguageSwitcher.astro';
6
+ import { getLocaleFromPath, defaultLocale, localePath } from '@/i18n/config';
7
+
8
+ // Get current locale from URL
9
+ const currentPath = Astro.url.pathname;
10
+ const currentLocale = getLocaleFromPath(currentPath);
11
+
12
+ // Check if we're on the landing page to determine link behavior
13
+ const isLandingPage = currentPath === '/' || currentPath === `/${currentLocale}` || currentPath === `/${currentLocale}/`;
14
+
15
+ // Build locale-aware links
16
+ const homeLink = currentLocale === defaultLocale ? '/' : `/${currentLocale}`;
17
+ const featuresLink = isLandingPage ? '#features' : `${homeLink}#features`;
18
+ const ctaLink = isLandingPage ? '#cta' : `${homeLink}#cta`;
19
+ const componentsLink = localePath('/components', currentLocale);
20
+ const blogLink = localePath('/blog', currentLocale);
21
+ ---
22
+
23
+ <nav class="fixed top-0 left-0 right-0 z-50 border-b border-border bg-background/80 backdrop-blur-md">
24
+ <div class="mx-auto flex h-16 max-w-6xl items-center justify-between px-6">
25
+ <!-- Logo -->
26
+ <a href={homeLink} class="flex items-center gap-2">
27
+ <div class="h-6 w-6 bg-brand-500 rounded-sm"></div>
28
+ <span class="font-display text-xl font-bold tracking-tight text-foreground">Velocity</span>
29
+ </a>
30
+
31
+ <!-- Desktop Menu -->
32
+ <div class="hidden items-center gap-8 md:flex">
33
+ <a href={featuresLink} class="text-sm font-medium text-foreground-muted hover:text-foreground transition-colors">Features</a>
34
+ <a href={componentsLink} class="text-sm font-medium text-foreground-muted hover:text-foreground transition-colors">Components</a>
35
+ <a href={blogLink} class="text-sm font-medium text-foreground-muted hover:text-foreground transition-colors">Blog</a>
36
+ <a href={blogLink} class="text-sm font-medium text-foreground-muted hover:text-foreground transition-colors">Docs</a>
37
+ <div class="flex items-center gap-2">
38
+ <LanguageSwitcher />
39
+ <ThemeToggle />
40
+ <Button
41
+ variant="ghost"
42
+ size="sm"
43
+ icon
44
+ href="https://github.com/southwell-media/velocity"
45
+ target="_blank"
46
+ aria-label="View on GitHub"
47
+ >
48
+ <Icon name="github" size="sm" />
49
+ </Button>
50
+ <Button size="sm" href={ctaLink}>Get Started</Button>
51
+ </div>
52
+ </div>
53
+
54
+ <!-- Mobile Toggle -->
55
+ <button
56
+ type="button"
57
+ class="md:hidden p-2 text-foreground hover:bg-secondary rounded-md transition-colors"
58
+ id="mobile-menu-toggle"
59
+ aria-label="Toggle menu"
60
+ aria-expanded="false"
61
+ >
62
+ <span class="menu-icon">
63
+ <Icon name="menu" size="lg" />
64
+ </span>
65
+ <span class="close-icon hidden">
66
+ <Icon name="x" size="lg" />
67
+ </span>
68
+ </button>
69
+ </div>
70
+
71
+ <!-- Mobile Menu -->
72
+ <div id="mobile-menu" class="hidden absolute top-16 left-0 w-full bg-background border-b border-border p-6 md:hidden flex-col gap-4 shadow-lg">
73
+ <a href={featuresLink} class="text-base font-medium text-foreground-secondary hover:text-foreground transition-colors">Features</a>
74
+ <a href={componentsLink} class="text-base font-medium text-foreground-secondary hover:text-foreground transition-colors">Components</a>
75
+ <a href={blogLink} class="text-base font-medium text-foreground-secondary hover:text-foreground transition-colors">Blog</a>
76
+ <a href={blogLink} class="text-base font-medium text-foreground-secondary hover:text-foreground transition-colors">Docs</a>
77
+ <div class="flex items-center gap-3 pt-2 border-t border-border">
78
+ <LanguageSwitcher />
79
+ <ThemeToggle />
80
+ </div>
81
+ <Button fullWidth href={ctaLink}>Get Started</Button>
82
+ </div>
83
+ </nav>
84
+
85
+ <script>
86
+ function initMobileMenu() {
87
+ const toggle = document.getElementById('mobile-menu-toggle');
88
+ const menu = document.getElementById('mobile-menu');
89
+ const menuIcon = toggle?.querySelector('.menu-icon');
90
+ const closeIcon = toggle?.querySelector('.close-icon');
91
+
92
+ if (!toggle || !menu || !menuIcon || !closeIcon) return;
93
+
94
+ toggle.addEventListener('click', () => {
95
+ const isOpen = menu.classList.contains('hidden');
96
+
97
+ if (isOpen) {
98
+ menu.classList.remove('hidden');
99
+ menu.classList.add('flex');
100
+ menuIcon.classList.add('hidden');
101
+ closeIcon.classList.remove('hidden');
102
+ toggle.setAttribute('aria-expanded', 'true');
103
+ } else {
104
+ menu.classList.add('hidden');
105
+ menu.classList.remove('flex');
106
+ menuIcon.classList.remove('hidden');
107
+ closeIcon.classList.add('hidden');
108
+ toggle.setAttribute('aria-expanded', 'false');
109
+ }
110
+ });
111
+
112
+ // Close menu when clicking on links
113
+ menu.querySelectorAll('a').forEach((link) => {
114
+ link.addEventListener('click', () => {
115
+ menu.classList.add('hidden');
116
+ menu.classList.remove('flex');
117
+ menuIcon.classList.remove('hidden');
118
+ closeIcon.classList.add('hidden');
119
+ toggle.setAttribute('aria-expanded', 'false');
120
+ });
121
+ });
122
+ }
123
+
124
+ initMobileMenu();
125
+ document.addEventListener('astro:page-load', initMobileMenu);
126
+ </script>