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

76 строки
1.5 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, GroupAction } 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. }
  30. )
  31. }
  32. }
  33. </script>
  34. <style scoped>
  35. .choice-button,
  36. .choice-button:hover,
  37. .choice-button:active {
  38. width: 90%;
  39. margin: 5%;
  40. background: repeating-linear-gradient(45deg, #333, #333 20px, #222 20px, #222 40px);
  41. color: #ccc;
  42. font-size: 150%;
  43. border-color: #ccc;
  44. border-width: 3px;
  45. border-radius: 8px;
  46. border-style: outset;
  47. outline: none;
  48. padding: 0;
  49. }
  50. .choice-button:focus {
  51. background: repeating-linear-gradient(45deg, #444, #444 20px, #333 20px, #333 40px);
  52. }
  53. .choice-button.enabled {
  54. background: #555;
  55. }
  56. .choice-button.enabled:hover {
  57. background: #777;
  58. }
  59. .choice-button.enabled:active {
  60. background: #888;
  61. border-style: inset;
  62. }
  63. </style>