Skip to content

Commit 11dc299

Browse files
committed
Optimsed for mobile
1 parent 638554c commit 11dc299

File tree

3 files changed

+40
-60
lines changed

3 files changed

+40
-60
lines changed

www/src/components/CTA.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export function CTA() {
1515

1616
<div className="relative">
1717
<h2 className="text-2xl sm:text-3xl md:text-4xl font-bold mb-4">
18-
Start Protecting Your
19-
<span className="text-gradient from-primary via-accent to-accent-purple"> Code Today</span>
18+
<span className="block sm:inline">Start Protecting</span>
19+
<span className="text-gradient from-primary via-accent to-accent-purple block sm:inline"> Your Code Today</span>
2020
</h2>
2121
<p className="text-base sm:text-lg text-muted-foreground mb-6 sm:mb-8 max-w-2xl mx-auto px-4">
2222
Join developers who trust Gitea Mirror to keep their repositories safe and accessible.

www/src/components/GitHubButton.tsx

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,39 @@ export function GitHubButton() {
2222
}, []);
2323

2424
return (
25-
<Button variant="outline" size="sm" className="hover:bg-primary/10 hover:border-primary/30 hover:text-foreground transition-all duration-300" asChild>
26-
<a href="https://github.com/RayLabsHQ/gitea-mirror" target="_blank" rel="noopener noreferrer" className="flex items-center">
27-
<Github className="w-4 h-4 mr-2" />
28-
<span>Star on GitHub</span>
29-
{stars !== null && (
30-
<>
31-
<span className="mx-2 text-muted-foreground"></span>
32-
<Star className="w-3 h-3 mr-1" />
33-
<span>{stars}</span>
34-
</>
35-
)}
36-
</a>
37-
</Button>
25+
<>
26+
{/* Mobile version - compact with text */}
27+
<Button
28+
variant="outline"
29+
size="sm"
30+
className="md:hidden hover:bg-primary/10 hover:border-primary/30 hover:text-foreground transition-all duration-300 px-3"
31+
asChild
32+
>
33+
<a href="https://github.com/RayLabsHQ/gitea-mirror" target="_blank" rel="noopener noreferrer" className="flex items-center gap-1.5">
34+
<Star className="w-4 h-4" />
35+
<span className="font-semibold">{stars || '—'}</span>
36+
</a>
37+
</Button>
38+
39+
{/* Desktop version - full button */}
40+
<Button
41+
variant="outline"
42+
size="sm"
43+
className="hidden md:flex hover:bg-primary/10 hover:border-primary/30 hover:text-foreground transition-all duration-300"
44+
asChild
45+
>
46+
<a href="https://github.com/RayLabsHQ/gitea-mirror" target="_blank" rel="noopener noreferrer" className="flex items-center">
47+
<Github className="w-4 h-4 mr-2" />
48+
<span>Star on GitHub</span>
49+
{stars !== null && (
50+
<>
51+
<span className="mx-2 text-muted-foreground"></span>
52+
<Star className="w-3 h-3 mr-1" />
53+
<span>{stars}</span>
54+
</>
55+
)}
56+
</a>
57+
</Button>
58+
</>
3859
);
3960
}

www/src/components/Header.tsx

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import React, { useState, useEffect } from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import { ThemeToggle } from './ThemeToggle';
3-
import { Menu, X } from 'lucide-react';
4-
import { Button } from './ui/button';
53
import { GitHubButton } from './GitHubButton';
64

75
export function Header() {
8-
const [isMenuOpen, setIsMenuOpen] = useState(false);
96
const [isScrolled, setIsScrolled] = useState(false);
107

118
useEffect(() => {
@@ -23,10 +20,6 @@ export function Header() {
2320
{ href: '#installation', label: 'Installation' }
2421
];
2522

26-
const handleNavClick = () => {
27-
setIsMenuOpen(false);
28-
};
29-
3023
return (
3124
<header className={`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${
3225
isScrolled ? 'backdrop-blur-lg bg-background/80 border-b shadow-sm' : 'bg-background/50'
@@ -45,7 +38,7 @@ export function Header() {
4538
alt="Gitea Mirror Logo"
4639
className="h-6 w-6 hidden dark:block"
4740
/>
48-
<span className="text-xl font-bold hidden sm:inline">Gitea Mirror</span>
41+
<span className="text-lg sm:text-xl font-bold">Gitea Mirror</span>
4942
</a>
5043

5144
{/* Desktop Navigation */}
@@ -68,47 +61,13 @@ export function Header() {
6861
</div>
6962

7063
{/* Mobile Actions */}
71-
<div className="flex md:hidden items-center gap-2">
64+
<div className="flex md:hidden items-center gap-3">
65+
<GitHubButton />
7266
<ThemeToggle />
73-
<Button
74-
variant="ghost"
75-
size="icon"
76-
onClick={() => setIsMenuOpen(!isMenuOpen)}
77-
aria-label="Toggle menu"
78-
className="w-10 h-10"
79-
>
80-
{isMenuOpen ? (
81-
<X className="h-5 w-5" />
82-
) : (
83-
<Menu className="h-5 w-5" />
84-
)}
85-
</Button>
8667
</div>
8768
</div>
8869
</div>
8970

90-
{/* Mobile Menu */}
91-
<div className={`md:hidden transition-all duration-300 ease-in-out ${
92-
isMenuOpen ? 'max-h-96 opacity-100' : 'max-h-0 opacity-0 overflow-hidden'
93-
}`}>
94-
<div className="bg-background/95 backdrop-blur-lg border-b">
95-
<nav className="px-4 py-4 space-y-3">
96-
{navLinks.map((link) => (
97-
<a
98-
key={link.href}
99-
href={link.href}
100-
onClick={handleNavClick}
101-
className="block py-2 text-base font-medium text-muted-foreground hover:text-foreground transition-colors"
102-
>
103-
{link.label}
104-
</a>
105-
))}
106-
<div className="pt-3 border-t">
107-
<GitHubButton />
108-
</div>
109-
</nav>
110-
</div>
111-
</div>
11271
</header>
11372
);
11473
}

0 commit comments

Comments
 (0)