Browse Source

more formatting changes

main
Silberengel 4 weeks ago
parent
commit
8f42b472e1
  1. 7
      src/app.css
  2. 99
      src/lib/components/NavBar.svelte
  3. 3
      src/routes/docs/+page.svelte
  4. 3
      src/routes/docs/nip34/+page.svelte
  5. 7
      src/routes/signup/+page.svelte

7
src/app.css

@ -816,12 +816,7 @@ pre code {
color: var(--text-secondary); color: var(--text-secondary);
} }
/* Docs page */ /* All pages use the same container width for consistency */
.container-wide {
max-width: 1000px;
margin: 0 auto;
padding: 2rem;
}
/* Highlight.js Syntax Highlighting - Consistent dark-gray background */ /* Highlight.js Syntax Highlighting - Consistent dark-gray background */
.hljs { .hljs {

99
src/lib/components/NavBar.svelte

@ -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>

3
src/routes/docs/+page.svelte

@ -40,10 +40,9 @@
}); });
</script> </script>
<div class="container-wide"> <div class="container">
<header> <header>
<h1>Documentation</h1> <h1>Documentation</h1>
<p class="subtitle">Complete tutorial and walkthrough for decentralized git hosting</p>
</header> </header>
<main class="docs-content"> <main class="docs-content">

3
src/routes/docs/nip34/+page.svelte

@ -40,10 +40,9 @@
}); });
</script> </script>
<div class="container-wide"> <div class="container">
<header> <header>
<h1>GitRepublic Documentation</h1> <h1>GitRepublic Documentation</h1>
<p class="subtitle">Complete tutorial and walkthrough for decentralized git hosting</p>
</header> </header>
<main class="docs-content"> <main class="docs-content">

7
src/routes/signup/+page.svelte

@ -221,15 +221,10 @@
<div class="container"> <div class="container">
<header> <header>
<h1>gitrepublic</h1> <h1>Create or Update Repository Announcement</h1>
<nav>
<a href="/">Repositories</a>
<a href="/signup">Sign Up</a>
</nav>
</header> </header>
<main> <main>
<h2>Create or Update Repository Announcement</h2>
{#if !nip07Available} {#if !nip07Available}
<div class="warning"> <div class="warning">

Loading…
Cancel
Save