mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
新增 BattleReportDialog、SpyReportDialog、NumberWithTooltip 等组件,完善舰队模拟器功能。重构并引入 Sheet、Sidebar、Tooltip、Skeleton 等 UI 组件,优化界面结构。实现 battle.worker 支持战斗计算,增加 universeStore、fleetStorageLogic 等核心逻辑,完善多语言与类型定义。
20 lines
666 B
TypeScript
20 lines
666 B
TypeScript
import type { ComputedRef, Ref } from 'vue'
|
|
import { createContext } from 'reka-ui'
|
|
|
|
export const SIDEBAR_COOKIE_NAME = 'sidebar_state'
|
|
export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|
export const SIDEBAR_WIDTH = '16rem'
|
|
export const SIDEBAR_WIDTH_MOBILE = '18rem'
|
|
export const SIDEBAR_WIDTH_ICON = '3rem'
|
|
export const SIDEBAR_KEYBOARD_SHORTCUT = 'b'
|
|
|
|
export const [useSidebar, provideSidebarContext] = createContext<{
|
|
state: ComputedRef<'expanded' | 'collapsed'>
|
|
open: Ref<boolean>
|
|
setOpen: (value: boolean) => void
|
|
isMobile: Ref<boolean>
|
|
openMobile: Ref<boolean>
|
|
setOpenMobile: (value: boolean) => void
|
|
toggleSidebar: () => void
|
|
}>('Sidebar')
|