frame.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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" :tip="action.tip" />
  17. </span>
  18. </div>
  19. </div>
  20. </template>
  21. <script lang="ts" setup>
  22. import { AnimationModelFrame } from "@/api";
  23. import { ui18n } from "@/lang";
  24. const actions = [
  25. { key: "translate", icon: "a-move", tip: ui18n.t("fuse.move") },
  26. { key: "rotate", icon: "a-rotate", tip: ui18n.t("fuse.flip") },
  27. { key: "scale", icon: "a-zoom", tip: ui18n.t("fuse.scale") },
  28. // { key: "originTranslate", icon: "a-anchor" },
  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: calc(var(--editor-menu-right) + var(--editor-toolbox-width));
  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 4px;
  49. span {
  50. width: 32px;
  51. height: 32px;
  52. display: flex;
  53. border-radius: 4px;
  54. align-items: center;
  55. margin: 0 2px;
  56. cursor: pointer;
  57. justify-content: center;
  58. .icon {
  59. font-size: 18px;
  60. }
  61. &.active {
  62. background: rgba(0, 200, 175, 0.3);
  63. }
  64. }
  65. }
  66. </style>