summaryrefslogtreecommitdiff
path: root/src/web/_views/header.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/_views/header.php')
-rw-r--r--src/web/_views/header.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/web/_views/header.php b/src/web/_views/header.php
new file mode 100644
index 0000000..7c60197
--- /dev/null
+++ b/src/web/_views/header.php
@@ -0,0 +1,62 @@
+<?php /* Copyright (c) 2024 Freya Murphy */ ?>
+<?php /* vi: syntax=php */ ?>
+<?php
+ $self = $this->main->user();
+ $this->view('header_empty', $data);
+?>
+ <header class="nav">
+ <div class="nav-left">
+ <span class="logo">xssbook</span>
+ </div>
+ <div class="nav-center" :class="{hidden: !visible}">
+ <a
+ id="action-home"
+ class="btn"
+ href="/home"
+ title="<?=lang('action_home_tip')?>"
+ >
+ <i class="mi mi-lg">home</i>
+ <span><?=lang('action_home_text')?></span>
+ </a>
+ <a
+ id="action-people"
+ class="btn"
+ href="/people"
+ title="<?=lang('action_people_tip')?>"
+ >
+ <i class="mi mi-lg">people</i>
+ <span><?=lang('action_people_text')?></span>
+ </a>
+ <a
+ id="action-chat"
+ class="btn"
+ href="/chat"
+ title="<?=lang('action_chat_tip')?>"
+ >
+ <i class="mi mi-lg">chat</i>
+ <span><?=lang('action_chat_text')?></span>
+ </a>
+ </div>
+ <div class="nav-right">
+ <button
+ id="action-hamburger"
+ title="<?=lang('action_hamburger_tip')?>"
+ >
+ <i class="mi mi-lg">menu</i>
+ </button>
+ <?php if($self): ?>
+ <?php $this->view('template/pfp', array(
+ 'user' => $self,
+ 'class' => 'pfp-sm ml',
+ )); ?>
+ <?php else: ?>
+ <?=ilang('action_login', class: 'btn', href: '/auth/login')?>
+ <?php endif; ?>
+ </div>
+ <script>
+ $('#action-hamburger').on('click', function() {
+ let menu = $('.nav-center');
+ menu.toggleClass('visible');
+ });
+ </script>
+ </header>