Feast 2.0!
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

78 строки
1.6 KiB

  1. <template>
  2. <button :class="{ 'choice-button': true, 'enabled': choice.accessible(world) }">
  3. {{ choice.name }}
  4. <div class="tooltip-template">
  5. <div class="tooltip-title">{{ choice.name }}</div>
  6. <div class="tooltip-body">{{ choice.desc }}</div>
  7. </div>
  8. </button>
  9. </template>
  10. <script lang="ts">
  11. import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator'
  12. import { Action } from '@/game/combat'
  13. import { Creature } from '@/game/creature'
  14. import { Place, Direction, Choice, World } from '@/game/world'
  15. import tippy from 'tippy.js'
  16. @Component({})
  17. export default class ChoiceButton extends Vue {
  18. @Prop()
  19. choice!: Choice
  20. @Prop()
  21. world!: World
  22. mounted () {
  23. const elem = this.$el
  24. const tooltip = this.$el.querySelector(".tooltip-template") as HTMLElement
  25. tippy(
  26. elem,
  27. {
  28. content: tooltip,
  29. touch: ["hold", 500]
  30. }
  31. )
  32. }
  33. }
  34. </script>
  35. <style scoped>
  36. .choice-button,
  37. .choice-button:hover,
  38. .choice-button:active {
  39. width: calc(100%-16pt);
  40. margin: 8pt;
  41. background: repeating-linear-gradient(45deg, #333, #333 20px, #222 20px, #222 40px);
  42. color: #ccc;
  43. font-size: 1.25rem;
  44. border-color: #ccc;
  45. border-width: 3px;
  46. border-radius: 8px;
  47. border-style: outset;
  48. outline: none;
  49. padding: 4pt;
  50. user-select: none;
  51. }
  52. .choice-button:focus {
  53. background: repeating-linear-gradient(45deg, #444, #444 20px, #333 20px, #333 40px);
  54. }
  55. .choice-button.enabled {
  56. background: #555;
  57. }
  58. .choice-button.enabled:hover {
  59. background: #777;
  60. }
  61. .choice-button.enabled:active {
  62. background: #888;
  63. border-style: inset;
  64. }
  65. </style>