Advertisement
emesten

Untitled

Aug 4th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. <template lang="pug">
  2. .container
  3. .search-bar
  4. .search-icon
  5. MagnifyIcon(title="")
  6. .search-field
  7. input(type="text" placeholder="Tv series' name")
  8. .shows
  9. Spinner(v-if="isFetching" size="big")
  10. .show(v-else v-for="show in shows")
  11. router-link(:to=" {name: 'Show', params: { id: show.tvdbId }}")
  12. .show-cover
  13. img(:src="defaultCover")
  14. .show-title
  15. div {{ show.seriesName }}
  16.  
  17. </template>
  18.  
  19. <script>
  20. import MagnifyIcon from 'vue-material-design-icons/magnify.vue';
  21. import Spinner from '../../components/Spinner'
  22.  
  23. export default {
  24. name: 'Search',
  25. data() {
  26. return {
  27. isFetching: true,
  28. defaultCover: '/static/shows/default.png',
  29. shows: null
  30. }
  31. },
  32. components: {
  33. MagnifyIcon,
  34. Spinner
  35. },
  36. async created() {
  37. const url = 'http://'+this.$domain+'/api/Search/Created';
  38. const request = await fetch(url, {
  39. method: 'GET',
  40. credentials: 'include'
  41. });
  42. const response = await request.json();
  43. this.shows = response.data;
  44. this.isFetching = false;
  45. }
  46. }
  47. </script>
  48.  
  49. <style scoped>
  50.  
  51. .container {
  52. width: 100%;
  53. height: 100%;
  54. display: flex;
  55. flex-flow: column;
  56. align-items: center;
  57. overflow: auto;
  58. }
  59.  
  60. .search-bar {
  61. margin-top: 3rem;
  62. display: flex;
  63. flex-flow: row;
  64. }
  65.  
  66. .search-icon {
  67. display: flex;
  68. justify-content: center;
  69. align-items: center;
  70. width: 3.5rem;
  71. height: 3.6rem;
  72. background-color: var(--dec-10);
  73. }
  74.  
  75. input[type="text"] {
  76. border: none;
  77. outline: none;
  78. height: 2rem;
  79. width: 70rem;
  80. background-color: var(--bg-8);
  81. padding: .8rem;
  82. color: var(--bg-0);
  83. font-size: 0.9rem;
  84. }
  85.  
  86. .shows {
  87. width: 90%;
  88. margin-top: 5rem;
  89. display: flex;
  90. flex-flow: row;
  91. flex-wrap: wrap;
  92. justify-content: center;
  93. align-items: center;
  94. }
  95.  
  96. .show {
  97. width: 20%;
  98. height: 20rem;
  99. display: flex;
  100. flex-flow: column;
  101. justify-content: center;
  102. align-items: center;
  103. text-align: center;
  104. }
  105.  
  106. .show > * {
  107. cursor: pointer;
  108. }
  109.  
  110. .show-cover > img {
  111. width: 200px;
  112. height: 280px;
  113. z-index: -999;
  114. opacity: 0.8;
  115. }
  116.  
  117. .show-title {
  118. z-index: 1;
  119. font-size: 10px;
  120. width: 200px;
  121. overflow: hidden;
  122. height: 2rem;
  123. margin-top: -1.4rem;
  124. background-color: var(--bg-9);
  125. display: flex;
  126. justify-content: center;
  127. align-items: center;
  128. font-weight: bold;
  129. }
  130.  
  131. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement