Skip to content

Commit f7ef47f

Browse files
authored
A smaller experimental header (#264)
1 parent 1777713 commit f7ef47f

3 files changed

Lines changed: 45 additions & 44 deletions

File tree

src/composables/useSettings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ const defaultMode = 'global'
3131
const availableModes: { id: string; label: string }[] = [
3232
{
3333
id: 'global',
34-
label: 'Global Predictions',
34+
label: 'Global',
3535
},
3636
{
3737
id: 'inference',
38-
label: 'My Inference',
38+
label: 'Custom',
3939
},
4040
// {
4141
// id: 'edit',

src/styles/sidebar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
top: 1rem;
44
z-index: 1000;
55
min-height: 50px;
6-
max-height: calc(100vh - 5rem);
6+
max-height: calc(100vh - 7rem);
77
display: flex;
88
flex-direction: column;
99
background-color: rgba(0, 0, 0, 0.9);
@@ -20,7 +20,7 @@
2020
@media (width <=1200px) {
2121
.sidebar {
2222
top: 4rem !important;
23-
max-height: calc(100vh - 8.5rem);
23+
max-height: calc(100vh - 10rem);
2424
}
2525
}
2626

src/views/MapView.vue

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,22 @@ function setModeValue(newValue: number) {
4040
class="logo"
4141
@click="aboutDialog = true"
4242
/>
43-
<v-item-group
44-
selected-class="bg-primary"
45-
mandatory
46-
v-model="modeValue"
47-
@update:model-value="setModeValue"
48-
class="mode-switch"
49-
>
50-
<v-item v-for="tab in availableModes" :key="tab.id" v-slot="{ selectedClass, toggle }">
51-
<v-card :class="['d-flex align-center', selectedClass]" @click="toggle">
52-
<div class="mode-switch-btn flex-grow-1 text-center">{{ tab.label }}</div>
53-
</v-card>
54-
</v-item>
55-
</v-item-group>
43+
<v-card variant="outlined" rounded="lg" class="switch">
44+
<span class="switch-label">Predictions</span>
45+
<v-divider vertical></v-divider>
46+
<v-btn-toggle
47+
v-model="modeValue"
48+
mandatory
49+
divided
50+
color="primary"
51+
rounded="0"
52+
@update:model-value="setModeValue"
53+
>
54+
<v-btn v-for="(tab, index) in availableModes" :key="tab.id" :value="index">
55+
{{ tab.label }}
56+
</v-btn>
57+
</v-btn-toggle>
58+
</v-card>
5659
</header>
5760

5861
<MapComponent />
@@ -89,18 +92,38 @@ function setModeValue(newValue: number) {
8992
transform: translateX(-50%);
9093
z-index: 1000;
9194
background-color: rgba(0, 0, 0, 0.5);
92-
padding: 0.25rem 0.5rem 0.5rem 0.5rem;
95+
padding: 0 0.5rem;
9396
border-radius: 0 0 1rem 1rem;
94-
font-size: 1.33rem;
95-
font-weight: 600;
96-
text-align: center;
97+
height: 3.5rem;
98+
display: flex;
99+
align-items: center;
100+
gap: 0.25rem;
97101
}
98102
99103
#title .logo {
100-
height: 64px;
104+
height: 3.5rem;
101105
cursor: pointer;
102106
}
103107
108+
#title .switch {
109+
margin: 0.25rem;
110+
height: 2.5rem;
111+
display: flex;
112+
align-items: center;
113+
overflow: hidden;
114+
background: transparent;
115+
}
116+
117+
#title .switch-label {
118+
padding: 0 0.75rem;
119+
font-weight: 600;
120+
}
121+
122+
#title .switch :deep(.v-btn) {
123+
padding: 0 0.75rem;
124+
min-width: unset;
125+
}
126+
104127
.map-view {
105128
position: absolute;
106129
top: 0;
@@ -111,32 +134,10 @@ function setModeValue(newValue: number) {
111134
height: 100%;
112135
}
113136
114-
.mode-switch {
115-
display: flex;
116-
gap: 0.5rem;
117-
}
118-
119-
.mode-switch-btn {
120-
font-size: 1.1rem;
121-
padding: 0.2rem 0.5rem;
122-
white-space: nowrap;
123-
}
124137
.info-btn {
125138
position: absolute;
126139
top: 0.5rem;
127140
right: 0.5rem;
128141
z-index: 1001;
129142
}
130-
131-
@media (width <= 1200px) {
132-
#title {
133-
display: flex;
134-
}
135-
#title .logo {
136-
height: 40px;
137-
}
138-
.mode-switch-btn {
139-
font-size: 1rem;
140-
}
141-
}
142143
</style>

0 commit comments

Comments
 (0)