Files
dragonroll/frontend/app/components/viewer/TopBar.vue
Aran Roig 1402045001
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m51s
Foundry and discord bot
2026-10-11 22:26:29 +02:00

83 lines
1.7 KiB
Vue

<script setup>
import TopSearchBar from './topbar/TopSearchBar.vue';
import { useCampaignService } from '~/services/Campaign.js';
import { ClearWindow, CreateWindow } from '~/services/Windows';
const { Campaign } = useCampaignService();
const campaignName = computed(() => Campaign.value?.name || 'Campaign');
function OpenCampaignSettings() {
if (!Campaign.value) return;
ClearWindow({ type: 'campaign_settings' });
CreateWindow('campaign_settings', { campaign: Campaign.value });
}
</script>
<template>
<div class="top-bar">
<div class="left">
<span class="top-bar-title">
<img src="/img/logo.png" alt="Dragonroll Logo" class="logo">
<span>{{ campaignName }}</span>
</span>
</div>
<div class="center">
<TopSearchBar></TopSearchBar>
</div>
<div class="right">
<button class="btn-primary settings-button sound-click" type="button" @click="OpenCampaignSettings">
{{ $t('main-menu.settings') }}
</button>
</div>
</div>
</template>
<style scoped>
.top-bar {
flex-grow: 0;
flex-shrink: 0;
min-height: 40px;
width: 100%;
background-color: var(--color-background-light);
display: flex;
}
.logo {
height: 32px;
width: 32px;
position: absolute;
top: 0px;
left: 6px;
}
.left {
flex: 1;
}
.center {
display: flex;
align-items: center;
}
.right {
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
padding: 0 10px;
}
.settings-button {
padding: 5px 10px;
}
.top-bar-title {
padding: 10px;
display: flex;
margin-left: 48px;
font-weight: bold;
}
</style>