From 62238a6f20bb82a04c457a94ca760bcea19d53bd Mon Sep 17 00:00:00 2001 From: KUN1007 Date: Mon, 13 Nov 2023 23:52:32 +0800 Subject: [PATCH] feat: add hamburgerItem --- src/components/top-bar/Hamburger.vue | 34 +++++++++++++++++---- src/components/top-bar/KUNGalgameTopBar.vue | 2 +- src/components/top-bar/hamburgerItem.ts | 22 +++++++++++++ src/language/en.ts | 15 +++++++++ src/language/zh.ts | 15 +++++++++ 5 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 src/components/top-bar/hamburgerItem.ts diff --git a/src/components/top-bar/Hamburger.vue b/src/components/top-bar/Hamburger.vue index c46006fd..4476c770 100644 --- a/src/components/top-bar/Hamburger.vue +++ b/src/components/top-bar/Hamburger.vue @@ -2,7 +2,7 @@ @@ -20,18 +20,22 @@ defineEmits(['showKUNGalgameHamburger'])
- + - {{ $tm(`header['${kun.name}']`) }} + {{ $tm(`header.hamburger.${kun.name}`) }}
- + - + + +
+ {{ $tm('header.hamburger.home') }} +
@@ -54,8 +58,9 @@ defineEmits(['showKUNGalgameHamburger']) } .container { + height: 100vh; position: absolute; - width: 277px; + width: 247px; padding: 10px; background-color: var(--kungalgame-trans-white-2); border: 1px solid var(--kungalgame-blue-1); @@ -88,4 +93,21 @@ defineEmits(['showKUNGalgameHamburger']) font-size: 20px; } } + +.home { + width: 100%; + padding: 10px; + + a { + padding: 5px 10px; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + border-radius: 5px; + font-size: 20px; + border: 1px solid var(--kungalgame-blue-4); + color: var(--kungalgame-blue-4); + } +} diff --git a/src/components/top-bar/KUNGalgameTopBar.vue b/src/components/top-bar/KUNGalgameTopBar.vue index 39e1e1fe..25407f55 100644 --- a/src/components/top-bar/KUNGalgameTopBar.vue +++ b/src/components/top-bar/KUNGalgameTopBar.vue @@ -71,7 +71,7 @@ onBeforeRouteLeave(() => { - {{ $tm(`header['${kun.name}']`) }} + {{ $tm(`header.${kun.name}`) }} diff --git a/src/components/top-bar/hamburgerItem.ts b/src/components/top-bar/hamburgerItem.ts new file mode 100644 index 00000000..ea497f01 --- /dev/null +++ b/src/components/top-bar/hamburgerItem.ts @@ -0,0 +1,22 @@ +// Interface for individual items in the top navigation bar +interface Hamburger { + index: number + name: string + router: string +} + +// Items in the top navigation bar +// (be sure to include '/' here, or child routes may have issues!!!) +export const hamburgerItem: Hamburger[] = [ + { index: 1, name: 'pool', router: '/pool' }, + { index: 2, name: 'create', router: '/edit' }, + { index: 3, name: 'technique', router: '/technique' }, + { index: 4, name: 'about', router: '/kungalgame' }, + { index: 5, name: 'ranking', router: '/ranking' }, + { index: 6, name: 'update', router: '/update-log' }, + { index: 7, name: 'bylaw', router: '/bylaw' }, + { index: 8, name: 'balance', router: '/balance' }, + { index: 9, name: 'nonMoe', router: '/non-moe' }, + { index: 10, name: 'thanks', router: '/thanks-list' }, + { index: 11, name: 'join', router: '/contact' }, +] diff --git a/src/language/en.ts b/src/language/en.ts index 2f79f4d8..ab07aa82 100644 --- a/src/language/en.ts +++ b/src/language/en.ts @@ -6,6 +6,21 @@ export default { technique: 'TECHNIQUE', about: 'ABOUT', return: 'HOME', + hamburger: { + name: 'KUN Visual Novel', + pool: 'Pool', + create: 'Create Topic', + technique: 'Technique', + about: 'About Us', + ranking: 'Ranking', + update: 'Update Log', + bylaw: 'Regulations', + balance: 'P & L', + nonMoe: 'Non-moe', + thanks: 'Thanks List', + join: 'Join / Contacts', + home: 'Back Home', + }, settings: { name: 'Settings', mode: 'Mode', diff --git a/src/language/zh.ts b/src/language/zh.ts index 7747e0b8..49d8ab8b 100644 --- a/src/language/zh.ts +++ b/src/language/zh.ts @@ -6,6 +6,21 @@ export default { technique: '技术交流', about: '关于我们', return: '返回主页', + hamburger: { + name: '鲲 Galgame', + pool: '所有话题', + create: '发布话题', + technique: '技术交流', + about: '关于我们', + ranking: '排行榜单', + update: '更新日志', + bylaw: '执行条例', + balance: '收支公示', + nonMoe: '不萌记录', + thanks: '感谢名单', + join: '加入 / 联系', + home: '返回主页', + }, settings: { name: '设置面板', mode: '模式切换',