diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-01 10:52:54 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-01 10:52:54 +0200 |
| commit | 1b4732acdf222b4766eaa19a037c5e13599cb342 (patch) | |
| tree | a1beecdbf3aadee33323d74848adc1c1d0fcdb35 /views/profile | |
| parent | c8cdadfabea0120526a6e0366710f9256fc999b4 (diff) | |
| download | nowayforward_human-1b4732acdf222b4766eaa19a037c5e13599cb342.tar nowayforward_human-1b4732acdf222b4766eaa19a037c5e13599cb342.tar.gz nowayforward_human-1b4732acdf222b4766eaa19a037c5e13599cb342.zip | |
feat(views/profile): Show archives and lists as proper nav buttons
Diffstat (limited to 'views/profile')
| -rw-r--r-- | views/profile/index.php | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/views/profile/index.php b/views/profile/index.php index 58a43e2..a0ef2e7 100644 --- a/views/profile/index.php +++ b/views/profile/index.php @@ -13,11 +13,13 @@ <h1 class="username"><?= $user->Username ?></h1> </section> - <div class="card-blank-afterspace"></div> + <div class="user-blank-afterspace"></div> - <h2 onclick="openArchives()">Archives</h2> - <h2 onclick="openLists()">Lists</h2> - <section id="user-archives"> + <nav id="user-nav"> + <button id="openArchives" onclick="openArchives()">Archives</button> + <button id="openLists" onclick="openLists()" class="not-selected">Lists</button> + </nav> + <section id="userArchives"> <?php foreach ($user->archives() as $page) { include $VIEWS_DIR . '/archive/item.php'; @@ -26,7 +28,7 @@ ?> </section> - <section id="user-lists" hidden> + <section id="userLists" hidden> <?php foreach($user->archiveLists() as $list): ?> <section> <?= $list->Name ?> @@ -36,14 +38,20 @@ </section> <script type="text/javascript"> - const userArchives = document.getElementById('user-archives'); - const userLists = document.getElementById('user-lists'); + const elemOpenArchives = document.getElementById('openArchives'); + const elemOpenLists = document.getElementById('openLists'); + const userArchives = document.getElementById('userArchives'); + const userLists = document.getElementById('userLists'); function openArchives() { + elemOpenArchives.classList.remove('not-selected'); + elemOpenLists.classList.add('not-selected'); userArchives.hidden = false; userLists.hidden = true; } function openLists() { + elemOpenArchives.classList.add('not-selected'); + elemOpenLists.classList.remove('not-selected'); userArchives.hidden = true; userLists.hidden = false; } |
