feat(web): add navigation menu bar for logged-in users

- Add horizontal nav menu with 7 items: Profile, Characters, Sessions,
  Mechanics, Leaderboard, Settings, Help
- Implement responsive hamburger menu for mobile (≤768px)
- Create pages blueprint with stub routes for new pages
- Add "Coming Soon" styled stub templates with icons
- Include active state highlighting for current page

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-26 10:21:46 -06:00
parent 4d26c43d1d
commit 77d913fe50
10 changed files with 573 additions and 4 deletions

View File

@@ -28,14 +28,49 @@
<a href="/" class="logo">⚔️ Code of Conquest</a>
{% if current_user %}
<nav class="header-nav">
<span class="user-greeting">Welcome, {{ current_user.name or current_user.email }}!</span>
<!-- Desktop Navigation Menu -->
<nav class="nav-menu">
<a href="{{ url_for('pages.profile') }}" class="nav-item {% if request.path == '/profile' %}active{% endif %}">Profile</a>
<a href="{{ url_for('character_views.list_characters') }}" class="nav-item {% if request.path.startswith('/characters') %}active{% endif %}">Characters</a>
<a href="{{ url_for('pages.sessions') }}" class="nav-item {% if request.path == '/sessions' %}active{% endif %}">Sessions</a>
<a href="{{ url_for('pages.mechanics') }}" class="nav-item {% if request.path == '/mechanics' %}active{% endif %}">Mechanics</a>
<a href="{{ url_for('pages.leaderboard') }}" class="nav-item {% if request.path == '/leaderboard' %}active{% endif %}">Leaderboard</a>
<a href="{{ url_for('pages.settings') }}" class="nav-item {% if request.path == '/settings' %}active{% endif %}">Settings</a>
<a href="{{ url_for('pages.help_page') }}" class="nav-item {% if request.path == '/help' %}active{% endif %}">Help</a>
</nav>
<!-- User Info & Logout -->
<div class="header-user">
<span class="user-greeting">{{ current_user.name or current_user.email }}</span>
<form method="POST" action="{{ url_for('auth_views.logout') }}" class="logout-form">
<button type="submit" class="btn-link">Logout</button>
</form>
</nav>
</div>
<!-- Mobile Hamburger Button -->
<button class="hamburger-btn" onclick="toggleMobileMenu()" aria-label="Toggle menu">
<span class="hamburger-icon"></span>
</button>
{% endif %}
</div>
{% if current_user %}
<!-- Mobile Navigation Menu -->
<nav class="mobile-menu" id="mobileMenu">
<a href="{{ url_for('pages.profile') }}" class="mobile-nav-item {% if request.path == '/profile' %}active{% endif %}">Profile</a>
<a href="{{ url_for('character_views.list_characters') }}" class="mobile-nav-item {% if request.path.startswith('/characters') %}active{% endif %}">Characters</a>
<a href="{{ url_for('pages.sessions') }}" class="mobile-nav-item {% if request.path == '/sessions' %}active{% endif %}">Sessions</a>
<a href="{{ url_for('pages.mechanics') }}" class="mobile-nav-item {% if request.path == '/mechanics' %}active{% endif %}">Mechanics</a>
<a href="{{ url_for('pages.leaderboard') }}" class="mobile-nav-item {% if request.path == '/leaderboard' %}active{% endif %}">Leaderboard</a>
<a href="{{ url_for('pages.settings') }}" class="mobile-nav-item {% if request.path == '/settings' %}active{% endif %}">Settings</a>
<a href="{{ url_for('pages.help_page') }}" class="mobile-nav-item {% if request.path == '/help' %}active{% endif %}">Help</a>
<div class="mobile-menu-divider"></div>
<span class="mobile-user-greeting">{{ current_user.name or current_user.email }}</span>
<form method="POST" action="{{ url_for('auth_views.logout') }}" class="logout-form">
<button type="submit" class="mobile-nav-item mobile-logout">Logout</button>
</form>
</nav>
{% endif %}
</header>
<!-- Main Content -->
@@ -65,6 +100,36 @@
</p>
</footer>
<!-- Mobile Menu JavaScript -->
<script>
function toggleMobileMenu() {
const menu = document.getElementById('mobileMenu');
const btn = document.querySelector('.hamburger-btn');
menu.classList.toggle('open');
btn.classList.toggle('open');
}
// Close menu when clicking outside
document.addEventListener('click', function(event) {
const menu = document.getElementById('mobileMenu');
const btn = document.querySelector('.hamburger-btn');
if (menu && !menu.contains(event.target) && !btn.contains(event.target)) {
menu.classList.remove('open');
btn.classList.remove('open');
}
});
// Close menu on HTMX navigation
document.body.addEventListener('htmx:afterRequest', function() {
const menu = document.getElementById('mobileMenu');
const btn = document.querySelector('.hamburger-btn');
if (menu) {
menu.classList.remove('open');
btn.classList.remove('open');
}
});
</script>
<!-- JavaScript -->
{% block scripts %}{% endblock %}
</body>

View File

@@ -0,0 +1,25 @@
{% extends "base.html" %}
{% block title %}Help - Code of Conquest{% endblock %}
{% block content %}
<div class="page-container">
<div class="coming-soon-card">
<h1 class="page-title">Help & Guide</h1>
<div class="coming-soon-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"/>
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/>
<line x1="12" y1="17" x2="12.01" y2="17"/>
</svg>
</div>
<p class="coming-soon-text">Coming Soon</p>
<p class="coming-soon-description">
Find tutorials, FAQs, and guides to help you on your adventures.
</p>
<a href="{{ url_for('character_views.list_characters') }}" class="btn btn-primary">
Back to Characters
</a>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% extends "base.html" %}
{% block title %}Leaderboard - Code of Conquest{% endblock %}
{% block content %}
<div class="page-container">
<div class="coming-soon-card">
<h1 class="page-title">Leaderboard</h1>
<div class="coming-soon-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M6 9H4.5a2.5 2.5 0 0 1 0-5H6"/>
<path d="M18 9h1.5a2.5 2.5 0 0 0 0-5H18"/>
<path d="M4 22h16"/>
<path d="M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22"/>
<path d="M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22"/>
<path d="M18 2H6v7a6 6 0 0 0 12 0V2Z"/>
</svg>
</div>
<p class="coming-soon-text">Coming Soon</p>
<p class="coming-soon-description">
See how you rank against other adventurers. Compete for glory and honor.
</p>
<a href="{{ url_for('character_views.list_characters') }}" class="btn btn-primary">
Back to Characters
</a>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Mechanics - Code of Conquest{% endblock %}
{% block content %}
<div class="page-container">
<div class="coming-soon-card">
<h1 class="page-title">Game Mechanics</h1>
<div class="coming-soon-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"/>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>
</svg>
</div>
<p class="coming-soon-text">Coming Soon</p>
<p class="coming-soon-description">
Learn about combat, skills, equipment, and the rules of your adventure.
</p>
<a href="{{ url_for('character_views.list_characters') }}" class="btn btn-primary">
Back to Characters
</a>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Profile - Code of Conquest{% endblock %}
{% block content %}
<div class="page-container">
<div class="coming-soon-card">
<h1 class="page-title">Player Profile</h1>
<div class="coming-soon-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</svg>
</div>
<p class="coming-soon-text">Coming Soon</p>
<p class="coming-soon-description">
View your player statistics, achievements, and adventure history.
</p>
<a href="{{ url_for('character_views.list_characters') }}" class="btn btn-primary">
Back to Characters
</a>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block title %}Sessions - Code of Conquest{% endblock %}
{% block content %}
<div class="page-container">
<div class="coming-soon-card">
<h1 class="page-title">Game Sessions</h1>
<div class="coming-soon-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
<line x1="10" y1="9" x2="8" y2="9"/>
</svg>
</div>
<p class="coming-soon-text">Coming Soon</p>
<p class="coming-soon-description">
View and manage your active game sessions. Resume adventures where you left off.
</p>
<a href="{{ url_for('character_views.list_characters') }}" class="btn btn-primary">
Back to Characters
</a>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Settings - Code of Conquest{% endblock %}
{% block content %}
<div class="page-container">
<div class="coming-soon-card">
<h1 class="page-title">Settings</h1>
<div class="coming-soon-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
<circle cx="12" cy="12" r="3"/>
</svg>
</div>
<p class="coming-soon-text">Coming Soon</p>
<p class="coming-soon-description">
Customize your account preferences, notifications, and display options.
</p>
<a href="{{ url_for('character_views.list_characters') }}" class="btn btn-primary">
Back to Characters
</a>
</div>
</div>
{% endblock %}