6
0

top-navigation-bar.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div class="top-navigation">
  3. <img class="burger"
  4. src="@/assets/icons/three-bars.svg"
  5. alt="Menü"
  6. v-if="!window.wide"
  7. :class="{ rotation: window.menu }"
  8. @click="$emit('side', null)">
  9. <div class="name">
  10. {{ currentProject ? currentProject.name : 'PyCS' }}
  11. </div>
  12. <div class="jobs" v-if="activeJobCount > 0">
  13. {{ activeJobCount }} {{ activeJobCount === 1 ? 'job' : 'jobs' }} running
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: "top-navigation-bar",
  20. props: ['window', 'currentProject'],
  21. computed: {
  22. activeJobCount: function() {
  23. if (!this.currentProject)
  24. return 0;
  25. return Object.keys(this.currentProject.jobs)
  26. .map(key => this.currentProject.jobs[key])
  27. .filter(job => !job.finished)
  28. .length;
  29. }
  30. }
  31. }
  32. </script>
  33. <style scoped>
  34. .top-navigation {
  35. background-color: #3f3f3f;
  36. color: whitesmoke;
  37. display: flex;
  38. padding: 1rem;
  39. flex-direction: row;
  40. align-items: center;
  41. }
  42. .burger {
  43. transition: transform 0.6s;
  44. filter: invert(1);
  45. width: 2rem;
  46. margin-right: 0.75rem;
  47. }
  48. .burger.rotation {
  49. transform: rotate(90deg);
  50. }
  51. .name {
  52. font-weight: bold;
  53. font-family: "Roboto Condensed";
  54. flex-grow: 1;
  55. white-space: nowrap;
  56. text-overflow: ellipsis;
  57. overflow-x: hidden;
  58. }
  59. .jobs {
  60. font-family: "Roboto Condensed";
  61. white-space: nowrap;
  62. }
  63. </style>