Feast 2.0!
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

120 řádky
2.4 KiB

  1. <template>
  2. <div class="explore-layout">
  3. <div class="explore-log">
  4. </div>
  5. <div class="explore-worldinfo">
  6. <p class="worldinfo-date">{{ world.time.format("MMMM Do YYYY") }}</p>
  7. <p class="worldinfo-time">{{ world.time.format("h:mm:ss A")}}</p>
  8. </div>
  9. <div class="explore-info">
  10. <h2 class="location-name">{{ location.name }}</h2>
  11. <p class="location-desc">{{ location.desc }}</p>
  12. </div>
  13. <div class="explore-nav">
  14. <NavButton @click.native="location=location.connections[direction]" v-for="direction in Object.keys(location.connections)" :key="direction" :style="navBtnCss(direction)" :location="location" :direction="direction" />
  15. </div>
  16. <div class="explore-actions">
  17. </div>
  18. </div>
  19. </template>
  20. <script lang="ts">
  21. import { Component, Prop, Vue } from 'vue-property-decorator'
  22. import { Direction, World, Place } from '@/game/world'
  23. import NavButton from './NavButton.vue'
  24. @Component({
  25. components: {
  26. NavButton
  27. }
  28. })
  29. export default class Explore extends Vue {
  30. get location () {
  31. return this.world.player.location
  32. }
  33. set location (loc: Place) {
  34. this.world.player.location = loc
  35. }
  36. @Prop({ type: World })
  37. world!: World
  38. navBtnCss (dir: Direction) {
  39. return {
  40. '--nav-direction': dir
  41. }
  42. }
  43. }
  44. </script>
  45. <style scoped>
  46. .explore-layout {
  47. position: relative;
  48. display: grid;
  49. grid-template-areas: "log worldinfo"
  50. "log info "
  51. "log actions "
  52. "nav actions ";
  53. grid-template-rows: 0.5fr 2fr 1fr 1fr;
  54. grid-template-columns: 2fr 1fr;
  55. width: 100%;
  56. height: 100%;
  57. }
  58. .explore-log {
  59. grid-area: log;
  60. background: #222;
  61. }
  62. .explore-worldinfo {
  63. grid-area: worldinfo;
  64. background: #111;
  65. }
  66. .worldinfo-date,
  67. .worldinfo-time {
  68. font-size: 125%;
  69. }
  70. .explore-info {
  71. grid-area: info;
  72. background: #333;
  73. display: flex;
  74. flex-direction: column;
  75. flex-wrap: none;
  76. justify-content: start;
  77. align-items: center;
  78. }
  79. .location-name {
  80. font-size: 200%;
  81. }
  82. .location-desc {
  83. font-size: 150%;
  84. }
  85. .explore-nav {
  86. grid-area: nav;
  87. background: #444;
  88. display: grid;
  89. justify-content: center;
  90. align-content: center;
  91. grid-template-areas: "Northwest North Northeast"
  92. "West Center East "
  93. "Southwest South Southeast";
  94. grid-template-rows: 1fr 1fr 1fr;
  95. grid-template-columns: 1fr 1fr 1fr;
  96. }
  97. .explore-actions {
  98. grid-area: actions;
  99. background: #555;
  100. }
  101. </style>