|
|
|
@ -7,11 +7,20 @@ |
|
|
|
import { onMount } from 'svelte'; |
|
|
|
import { onMount } from 'svelte'; |
|
|
|
|
|
|
|
|
|
|
|
let userPubkey = $state<string | null>(null); |
|
|
|
let userPubkey = $state<string | null>(null); |
|
|
|
|
|
|
|
let mobileMenuOpen = $state(false); |
|
|
|
|
|
|
|
|
|
|
|
onMount(async () => { |
|
|
|
onMount(async () => { |
|
|
|
await checkAuth(); |
|
|
|
await checkAuth(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toggleMobileMenu() { |
|
|
|
|
|
|
|
mobileMenuOpen = !mobileMenuOpen; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function closeMobileMenu() { |
|
|
|
|
|
|
|
mobileMenuOpen = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function checkAuth() { |
|
|
|
async function checkAuth() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (isNIP07Available()) { |
|
|
|
if (isNIP07Available()) { |
|
|
|
@ -50,12 +59,15 @@ |
|
|
|
<img src="/GR_logo.png" alt="GitRepublic Logo" class="main-logo" /> |
|
|
|
<img src="/GR_logo.png" alt="GitRepublic Logo" class="main-logo" /> |
|
|
|
<h1>gitrepublic</h1> |
|
|
|
<h1>gitrepublic</h1> |
|
|
|
</a> |
|
|
|
</a> |
|
|
|
<nav> |
|
|
|
<button class="mobile-menu-toggle" onclick={toggleMobileMenu} aria-label="Toggle menu"> |
|
|
|
|
|
|
|
<span class="hamburger-icon">☰</span> |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
<nav class:mobile-open={mobileMenuOpen}> |
|
|
|
<div class="nav-links"> |
|
|
|
<div class="nav-links"> |
|
|
|
<a href="/" class:active={isActive('/') && $page.url.pathname === '/'}>Repositories</a> |
|
|
|
<a href="/" class:active={isActive('/') && $page.url.pathname === '/'} onclick={closeMobileMenu}>Repositories</a> |
|
|
|
<a href="/search" class:active={isActive('/search')}>Search</a> |
|
|
|
<a href="/search" class:active={isActive('/search')} onclick={closeMobileMenu}>Search</a> |
|
|
|
<a href="/signup" class:active={isActive('/signup')}>Sign Up</a> |
|
|
|
<a href="/signup" class:active={isActive('/signup')} onclick={closeMobileMenu}>Sign Up</a> |
|
|
|
<a href="/docs" class:active={isActive('/docs')}>Docs</a> |
|
|
|
<a href="/docs" class:active={isActive('/docs')} onclick={closeMobileMenu}>Docs</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</nav> |
|
|
|
</nav> |
|
|
|
<div class="auth-section"> |
|
|
|
<div class="auth-section"> |
|
|
|
@ -170,10 +182,32 @@ |
|
|
|
flex-shrink: 0; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.mobile-menu-toggle { |
|
|
|
|
|
|
|
display: none; |
|
|
|
|
|
|
|
background: transparent; |
|
|
|
|
|
|
|
border: 1px solid var(--border-color); |
|
|
|
|
|
|
|
border-radius: 0.375rem; |
|
|
|
|
|
|
|
padding: 0.5rem; |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
color: var(--text-primary); |
|
|
|
|
|
|
|
font-size: 1.5rem; |
|
|
|
|
|
|
|
line-height: 1; |
|
|
|
|
|
|
|
transition: all 0.2s ease; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.mobile-menu-toggle:hover { |
|
|
|
|
|
|
|
background: var(--bg-secondary); |
|
|
|
|
|
|
|
border-color: var(--accent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.hamburger-icon { |
|
|
|
|
|
|
|
display: block; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Mobile responsive styles */ |
|
|
|
/* Mobile responsive styles */ |
|
|
|
@media (max-width: 768px) { |
|
|
|
@media (max-width: 768px) { |
|
|
|
.header-container { |
|
|
|
.header-container { |
|
|
|
flex-direction: column; |
|
|
|
flex-wrap: wrap; |
|
|
|
padding: 1rem; |
|
|
|
padding: 1rem; |
|
|
|
gap: 1rem; |
|
|
|
gap: 1rem; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -187,20 +221,49 @@ |
|
|
|
width: 40px; |
|
|
|
width: 40px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.mobile-menu-toggle { |
|
|
|
|
|
|
|
display: block; |
|
|
|
|
|
|
|
order: 2; |
|
|
|
|
|
|
|
margin-left: auto; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
nav { |
|
|
|
nav { |
|
|
|
|
|
|
|
order: 3; |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
max-height: 0; |
|
|
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
transition: max-height 0.3s ease; |
|
|
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
align-items: stretch; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nav.mobile-open { |
|
|
|
|
|
|
|
max-height: 500px; |
|
|
|
|
|
|
|
padding-top: 1rem; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.nav-links { |
|
|
|
.nav-links { |
|
|
|
flex-wrap: wrap; |
|
|
|
flex-direction: column; |
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
gap: 0.5rem; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
gap: 0.5rem; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.nav-links a { |
|
|
|
.nav-links a { |
|
|
|
font-size: 0.875rem; |
|
|
|
font-size: 0.875rem; |
|
|
|
padding: 0.4rem 0.6rem; |
|
|
|
padding: 0.75rem 1rem; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
text-align: left; |
|
|
|
|
|
|
|
border-radius: 0.375rem; |
|
|
|
|
|
|
|
background: var(--bg-secondary); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.nav-links a:hover { |
|
|
|
|
|
|
|
background: var(--bg-tertiary); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.nav-links a.active { |
|
|
|
|
|
|
|
background: var(--accent); |
|
|
|
|
|
|
|
color: white; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.nav-links a.active::after { |
|
|
|
.nav-links a.active::after { |
|
|
|
@ -208,9 +271,10 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.auth-section { |
|
|
|
.auth-section { |
|
|
|
width: 100%; |
|
|
|
order: 1; |
|
|
|
justify-content: center; |
|
|
|
width: auto; |
|
|
|
flex-wrap: wrap; |
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
gap: 0.5rem; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.auth-section button { |
|
|
|
.auth-section button { |
|
|
|
@ -237,14 +301,13 @@ |
|
|
|
width: 32px; |
|
|
|
width: 32px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.nav-links { |
|
|
|
.auth-section { |
|
|
|
flex-direction: column; |
|
|
|
gap: 0.25rem; |
|
|
|
width: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.nav-links a { |
|
|
|
.auth-section button { |
|
|
|
width: 100%; |
|
|
|
font-size: 0.75rem; |
|
|
|
text-align: center; |
|
|
|
padding: 0.35rem 0.6rem; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|
|