zhengyiming
1 天以前 c0bcba49bef43b880978ff63b2ac00f1ba5c5c6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
  <div class="translate-navigation-bar" :style="barStyle">
    <TransparentNavigationBar
      v-bind="_commonNavigationBarProps"
      :is-absolute="false"
      mode="dark"
      navigationArrowWhite
      :style="{ opacity: 1 - rangeValue }"
    >
    </TransparentNavigationBar>
    <CommonNavigationBar v-bind="_commonNavigationBarProps" :style="{ opacity: rangeValue }" />
  </div>
</template>
 
<script setup lang="ts">
import { commonNavigationBarProps } from './commonNavigationBar';
import { useSystemStore } from '@/stores/modules/system';
import { CSSProperties } from 'vue';
import TransparentNavigationBar from './TransparentNavigationBar.vue';
import CommonNavigationBar from './CommonNavigationBar.vue';
import { usePickProps } from 'senin-mini/hooks';
 
defineOptions({
  name: 'TranslateNavigationBar',
});
 
const systemStore = useSystemStore();
 
const props = defineProps({
  ...commonNavigationBarProps,
  rangeValue: {
    type: Number,
    default: 0,
  },
});
 
const _commonNavigationBarProps = usePickProps(props, commonNavigationBarProps);
 
const barStyle = computed(() => {
  return {
    height: systemStore.navigationBarHeight + 'px',
  } as CSSProperties;
});
</script>
 
<style lang="scss">
@import '@/styles/common.scss';
 
.translate-navigation-bar {
  position: relative;
 
  .navigation-bar-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
}
</style>