SliderTop.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <div class="video-slider-top" v-if="list.length">
  3. <div class="video-slider-items">
  4. <VueSlickCarousel v-bind="settings">
  5. <div class="video-slider-item-wrapper" v-for="item in list" :key="item.id">
  6. <div class="video-slider-item">
  7. <nuxt-link :to="getLink(item)" class="video_big_slider_link">
  8. <div class="item-image">
  9. <img :src="item.image.url" :alt="item.image.title" />
  10. </div>
  11. <div class="item-info">
  12. <div class="item-category">{{ item.category.name }}</div>
  13. <div class="item-title" v-html="item.title"></div>
  14. <div class="item-row">
  15. <div class="item-text" v-html="item.description"></div>
  16. <div class="item-button">
  17. <div class="button button_play_video">
  18. <span class="button__text">▶&nbsp;&nbsp;Смотреть</span>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. </nuxt-link>
  24. </div>
  25. </div>
  26. <template #prevArrow="arrowOption">
  27. <button class="video-slider-prev">
  28. <BaseIcon name="h-slider-prev" clear />
  29. </button>
  30. </template>
  31. <template #nextArrow="arrowOption">
  32. <button class="video-slider-next">
  33. <BaseIcon name="h-slider-next" clear />
  34. </button>
  35. </template>
  36. </VueSlickCarousel>
  37. </div>
  38. <div class="video-slider-bg">
  39. <img :src="require('~/assets/img/slider-video/bg.png')" />
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import VueSlickCarousel from "vue-slick-carousel";
  45. export default {
  46. components: {
  47. VueSlickCarousel,
  48. },
  49. props: {
  50. list: {
  51. type: Array,
  52. required: true,
  53. },
  54. },
  55. data: () => ({
  56. settings: {
  57. draggable: false,
  58. dots: true,
  59. arrows: true,
  60. },
  61. }),
  62. methods: {
  63. getLink(news) {
  64. return {
  65. name: "video-category-alias",
  66. params: {
  67. category: news.category.alias,
  68. alias: news.alias,
  69. },
  70. };
  71. },
  72. },
  73. };
  74. </script>
  75. <style lang="less" scoped>
  76. .video_big_slider_link{
  77. padding: inherit;
  78. color: inherit;
  79. margin: inherit;
  80. .item-info{
  81. position: absolute;
  82. bottom: 0;
  83. }
  84. }
  85. .video-slider-top {
  86. color: white;
  87. position: relative;
  88. }
  89. .button_play_video{
  90. background: rgba(255,255,255,.15);
  91. padding: 15px 30px;
  92. border-radius: 50px;
  93. color: white;
  94. &:hover{
  95. background: rgba(255,255,255,.2);
  96. }
  97. }
  98. .video-slider {
  99. &-item {
  100. display: flex;
  101. flex-direction: column;
  102. position: relative;
  103. width: 100%;
  104. aspect-ratio: 1306 / 612;
  105. }
  106. &-items {
  107. position: relative;
  108. z-index: 1;
  109. box-shadow: 0px 26px 38px -11px rgba(255, 0, 214, 0.25);
  110. }
  111. &-bg {
  112. z-index: 0;
  113. position: absolute;
  114. bottom: 0;
  115. transform: translateY(50%);
  116. img {
  117. width: 100%;
  118. height: auto;
  119. }
  120. }
  121. &-prev,
  122. &-next {
  123. position: absolute;
  124. transform: translateY(-50%);
  125. top: 50%;
  126. width: 30px;
  127. height: 50px;
  128. .icon {
  129. width: 100%;
  130. height: 100%;
  131. fill: rgba(255, 255, 255, 0.3);
  132. }
  133. }
  134. &-prev {
  135. left: -40px;
  136. }
  137. &-next {
  138. right: -40px;
  139. }
  140. @media screen and (max-width: 1300px) {
  141. &-items {
  142. max-width: 90%;
  143. margin: 0 auto;
  144. }
  145. }
  146. @media screen and (max-width: 900px) {
  147. &-prev,
  148. &-next {
  149. width: 18px;
  150. height: 30px;
  151. }
  152. &-prev {
  153. left: -25px;
  154. }
  155. &-next {
  156. right: -25px;
  157. }
  158. }
  159. @media screen and (max-width: 720px) {
  160. &-prev,
  161. &-next {
  162. display: none;
  163. }
  164. &-items {
  165. max-width: 100%;
  166. }
  167. }
  168. @media screen and (max-width: 320px) {
  169. &-prev,
  170. &-next {
  171. width: 16px;
  172. height: 28px;
  173. }
  174. &-prev {
  175. left: 2px;
  176. z-index: 3;
  177. }
  178. &-next {
  179. right: 6px;
  180. z-index: 3;
  181. }
  182. }
  183. }
  184. ::v-deep .slick {
  185. &-dots {
  186. position: absolute;
  187. bottom: -28px;
  188. width: 100%;
  189. margin-top: 48px;
  190. }
  191. }
  192. .item {
  193. &-info {
  194. margin-top: auto;
  195. padding: 50px;
  196. position: relative;
  197. max-width: 70%;
  198. }
  199. &-image {
  200. z-index: 0;
  201. position: absolute;
  202. width: 100%;
  203. height: 100%;
  204. left: 0;
  205. top: 0;
  206. filter: brightness(70%);
  207. img {
  208. width: 100%;
  209. height: 100%;
  210. object-fit: cover;
  211. }
  212. }
  213. &-category {
  214. margin-left: -50px;
  215. display: inline-flex;
  216. padding: 8px 50px;
  217. background-color: #f6911f;
  218. clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
  219. }
  220. &-title {
  221. margin-top: 20px;
  222. font-size: 48px;
  223. line-height: 120%;
  224. }
  225. &-text {
  226. line-height: 140%;
  227. }
  228. &-row {
  229. margin-top: 20px;
  230. display: flex;
  231. align-items: flex-start;
  232. max-width: 80%;
  233. }
  234. &-button {
  235. margin-left: 30px;
  236. }
  237. @media screen and (max-width: 1280px) {
  238. &-title {
  239. font-size: 3vw;
  240. }
  241. }
  242. @media screen and (max-width: 960px) {
  243. &-text {
  244. display: none;
  245. }
  246. }
  247. @media screen and (max-width: 720px) {
  248. &-category {
  249. font-size: 14px;
  250. padding: 4px 25px;
  251. margin-left: -50px;
  252. }
  253. &-image {
  254. background-color: #3B5573;
  255. }
  256. &-image>img {
  257. display: none;
  258. }
  259. &-info {
  260. max-width: 100%;
  261. height: 100%;
  262. }
  263. &-button {
  264. margin-left: 0;
  265. }
  266. &-text {
  267. display: none;
  268. }
  269. }
  270. @media screen and (max-width: 496px) {
  271. &-category {
  272. top: 16px;
  273. position: absolute;
  274. margin-left: -40px;
  275. }
  276. &-row {
  277. margin-top: 8px;
  278. }
  279. &-info {
  280. padding: 40px;
  281. }
  282. }
  283. @media screen and (max-width: 419px) {
  284. &-button>.button_play_video {
  285. padding: 10px 20px;
  286. }
  287. }
  288. @media screen and (max-width: 375px) {
  289. &-category {
  290. display: none;
  291. }
  292. &-info {
  293. padding: 35px;
  294. }
  295. }
  296. @media screen and (max-width: 320px) {
  297. &-info {
  298. padding: 25px;
  299. }
  300. }
  301. }
  302. </style>