logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

search_bar.vue (1797B)


  1. <template>
  2. <div
  3. class="SearchBar"
  4. :class="{ '-expanded': !hidden }"
  5. >
  6. <button
  7. v-if="hidden"
  8. class="button-unstyled nav-icon"
  9. :title="$t('nav.search')"
  10. type="button"
  11. :aria-expanded="!hidden"
  12. @click.prevent.stop="toggleHidden"
  13. >
  14. <FAIcon
  15. fixed-width
  16. class="fa-scale-110 fa-old-padding"
  17. icon="search"
  18. />
  19. </button>
  20. <template v-else>
  21. <input
  22. id="search-bar-input"
  23. ref="searchInput"
  24. v-model="searchTerm"
  25. class="input search-bar-input"
  26. :placeholder="$t('nav.search')"
  27. type="text"
  28. @keyup.enter="find(searchTerm)"
  29. >
  30. <button
  31. class="button-default search-button"
  32. type="submit"
  33. :title="$t('nav.search')"
  34. @click="find(searchTerm)"
  35. >
  36. <FAIcon
  37. fixed-width
  38. icon="search"
  39. />
  40. </button>
  41. <button
  42. class="button-unstyled cancel-search"
  43. type="button"
  44. :title="$t('nav.search_close')"
  45. :aria-expanded="!hidden"
  46. @click.prevent.stop="toggleHidden"
  47. >
  48. <FAIcon
  49. fixed-width
  50. icon="times"
  51. class="cancel-icon fa-scale-110 fa-old-padding"
  52. />
  53. </button>
  54. <span class="spacer" />
  55. <span class="spacer" />
  56. </template>
  57. </div>
  58. </template>
  59. <script src="./search_bar.js"></script>
  60. <style lang="scss">
  61. .SearchBar {
  62. display: inline-flex;
  63. align-items: baseline;
  64. vertical-align: baseline;
  65. justify-content: flex-end;
  66. &.-expanded {
  67. width: 100%;
  68. }
  69. .search-bar-input,
  70. .search-button {
  71. height: 29px;
  72. }
  73. .search-bar-input {
  74. flex: 1 0 auto;
  75. }
  76. .cancel-search {
  77. height: 50px;
  78. }
  79. .cancel-icon {
  80. color: var(--text);
  81. }
  82. }
  83. </style>