Skip to content

Commit

Permalink
moved alt slider to app.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
ericjohnson97 committed Feb 8, 2024
1 parent f342a3a commit dd104b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
{{ format(timeNow, 'E LLL do HH:mm') }}
</div>
</div>
<AltitudeSlider />
<Transition name="fade">
<div v-if="showBottomBarNow" class="bottom-container">
<SlideToConfirm />
Expand Down Expand Up @@ -155,6 +156,7 @@ import {
} from '@/libs/joystick/protocols/cockpit-actions'
import { useMissionStore } from '@/stores/mission'
import AltitudeSlider from './components/AltitudeSlider.vue'
import Dialog from './components/Dialog.vue'
import EditMenu from './components/EditMenu.vue'
import MiniWidgetContainer from './components/MiniWidgetContainer.vue'
Expand Down
12 changes: 10 additions & 2 deletions src/components/AltitudeSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ const formattedValue = computed(() => altitude_setpoint.value.toFixed(1))
font-size: 0.8rem;
}
.slider-div {
height: 100%;
width: 100%;
position: fixed;
right: 2%;
top: 25%;
bottom: 0;
width: 25px;
height: 50%;
display: flex;
flex-direction: column;
justify-content: center;
z-index: 100;
}
</style>
16 changes: 0 additions & 16 deletions src/views/WidgetsView.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<SnappingGrid v-if="store.showGrid && store.editingMode" :grid-interval="store.gridInterval" class="snapping-grid" />
<div class="widgets-view">
<div class="altitude-slider-container">
<AltitudeSlider />
</div>
<div v-for="view in store.viewsToShow" :key="view.hash" class="widget-view">
<template v-for="widget in view.widgets.slice().reverse()" :key="widget">
<WidgetHugger
Expand Down Expand Up @@ -61,7 +58,6 @@ import ImageView from '@/components/widgets/ImageView.vue'
import { useWidgetManagerStore } from '@/stores/widgetManager'
import { WidgetType } from '@/types/widgets'
import AltitudeSlider from '../components/AltitudeSlider.vue'
import SnappingGrid from '../components/SnappingGrid.vue'
import WidgetHugger from '../components/WidgetHugger.vue'
import Attitude from '../components/widgets/Attitude.vue'
Expand Down Expand Up @@ -112,16 +108,4 @@ const store = useWidgetManagerStore()
background-color: rgb(122, 25, 25);
z-index: 50;
}
.altitude-slider-container {
position: absolute; /* or absolute, depending on your layout */
right: 2%;
top: 25%;
bottom: 0;
width: 25px; /* Adjust width as necessary */
height: 50%;
display: flex;
flex-direction: column;
justify-content: center; /* Centers the slider vertically */
z-index: 100; /* Ensure it's above other content */
}
</style>

0 comments on commit dd104b1

Please sign in to comment.