BottomControl.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div
  3. class="bottom-controls"
  4. :class="{ hidden: isHidden }"
  5. :style="{ bottom }"
  6. v-show="show"
  7. >
  8. <FloorSwitch />
  9. <tours />
  10. </div>
  11. </template>
  12. <script setup>
  13. import { computed } from "vue";
  14. import { useStore } from "vuex";
  15. import { ref } from "vue";
  16. import { useApp, getApp } from "@/app";
  17. import FloorSwitch from "./FloorSwitch";
  18. import tours from "./tours";
  19. const store = useStore();
  20. const show = ref(false);
  21. const isHidden = ref(false);
  22. const bottom = computed(() => {
  23. return store.getters.controlsBottom;
  24. });
  25. useApp().then((app) => {
  26. app.Scene.on("loaded", () => (show.value = true));
  27. });
  28. </script>
  29. <style lang="scss" scoped>
  30. .bottom-controls {
  31. width: 100%;
  32. position: absolute;
  33. left: 0;
  34. right: var(--editor-toolbox-width);
  35. bottom: 20px;
  36. height: 34px;
  37. display: flex;
  38. justify-content: space-between;
  39. transition: bottom 0.3s ease;
  40. z-index: 100;
  41. }
  42. :deep(.buttons) {
  43. pointer-events: all;
  44. display: flex;
  45. align-items: center;
  46. justify-content: space-around;
  47. height: 34px;
  48. border-radius: 17px;
  49. background-color: rgba(0, 0, 0, 0.3);
  50. > div {
  51. position: relative;
  52. margin-left: 20px;
  53. margin-right: 20px;
  54. cursor: pointer;
  55. &.active {
  56. color: var(--editor-main-color);
  57. }
  58. > i {
  59. font-size: 18px;
  60. }
  61. span {
  62. cursor: pointer;
  63. display: none;
  64. position: absolute;
  65. top: -20px;
  66. right: -15px;
  67. width: 24px;
  68. height: 24px;
  69. background-color: rgba(0, 0, 0, 0.5);
  70. border-radius: 50%;
  71. align-items: center;
  72. justify-content: center;
  73. color: var(--editor-main-color);
  74. transition: all 0.1s;
  75. &:hover {
  76. transform: scale(1.2);
  77. }
  78. &.disable {
  79. i {
  80. opacity: 0.5;
  81. }
  82. }
  83. }
  84. }
  85. }
  86. </style>