frame.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div>
  3. <div class="am-ctrl-pano strengthen">
  4. <span
  5. v-for="action in actions"
  6. ctrl
  7. :class="{ active: frameAction === action.key }"
  8. @click="
  9. $emit('changeFrameAction', {
  10. action: frameAction === action.key ? undefined : action.key,
  11. frame: data,
  12. })
  13. "
  14. class="fun-ctrl"
  15. >
  16. <ui-icon :type="action.icon" />
  17. </span>
  18. </div>
  19. </div>
  20. </template>
  21. <script lang="ts" setup>
  22. import { AnimationModelFrame } from "@/api";
  23. import { ref } from "vue";
  24. const actions = [
  25. { key: "translate", icon: "close" },
  26. { key: "rotate", icon: "close" },
  27. { key: "scale", icon: "close" },
  28. { key: "originTranslate", icon: "close" },
  29. ];
  30. defineProps<{ data: AnimationModelFrame; frameAction?: string }>();
  31. defineEmits<{
  32. (e: "changeFrameAction", d: { action?: string; frame: AnimationModelFrame }): void;
  33. }>();
  34. </script>
  35. <style lang="scss" scoped>
  36. .am-ctrl-pano {
  37. z-index: 99;
  38. position: absolute;
  39. top: calc(var(--editor-head-height) + var(--header-top));
  40. margin: 20px;
  41. right: 0;
  42. border-radius: 4px;
  43. height: 40px;
  44. background: rgba(27, 27, 28, 0.8);
  45. display: flex;
  46. align-items: center;
  47. justify-content: space-between;
  48. padding: 0 10px;
  49. span {
  50. width: 32px;
  51. height: 32px;
  52. font-size: 16px;
  53. display: flex;
  54. border-radius: 4px;
  55. align-items: center;
  56. cursor: pointer;
  57. justify-content: center;
  58. &.active {
  59. background: rgba(0, 200, 175, 0.3);
  60. }
  61. }
  62. }
  63. </style>