Bottom.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <div class="header__bottom js-header-bottom" id="js-header-bottom-id">
  3. <div class="header-bottom section">
  4. <div class="header-bottom__wrapper section-wrapper">
  5. <div class="cabbit">
  6. <nuxt-link to="/news/novgod2023">
  7. <img v-if="!isMobile()" src="/png/cabbit.png" alt="Год кролика">
  8. </nuxt-link>
  9. </div>
  10. <main class="header-bottom__main">
  11. <div class="header-bottom__logo">
  12. <nuxt-link v-if="isMain" class="header-bottom__logo-link" to="/">
  13. <!--BaseIcon :name="'amic-logo'" /-->
  14. <img :src="logo" />
  15. </nuxt-link>
  16. <a v-else class="header-bottom__logo-link" href="/">
  17. <!--BaseIcon :name="'amic-logo'" /-->
  18. <img :src="logo" />
  19. </a>
  20. </div>
  21. <!--div class="header-bottom__action m-hidden">
  22. <button class="button button_icon">
  23. <span class="button__icon">
  24. <BaseIcon :name="'filter'" clear />
  25. </span>
  26. </button>
  27. </div-->
  28. <div class="header-bottom__nav">
  29. <NavBar />
  30. </div>
  31. <!--<div class="header-bottom__banner">
  32. <a class="header-bottom__banner-link" href="javascript:void(0)"
  33. ><img src="@/assets/img/vtb.png" alt="ВТБ"
  34. /></a>
  35. </div>-->
  36. </main>
  37. <aside class="header-bottom__side">
  38. <div class="header-bottom__buttons">
  39. <div class="header-bottom__button">
  40. <a
  41. class="button button_grey"
  42. href="https://fmprod.ru/radiostantsii/item/evropa-plyus/"
  43. target="_blank"
  44. ><span class="button__text tg">▶ Слушать радио</span></a
  45. >
  46. </div>
  47. <div class="header-bottom__button">
  48. <a
  49. class="button button_grey button_grey-tg"
  50. href="https://t.me/+zf9tbqRD9o0zOWI6"
  51. target="_blank"
  52. ><span class="button__icon"> <BaseIcon :name="'tg'" /></span
  53. ><span class="button__text tg">Телеграм-канал</span></a
  54. >
  55. </div>
  56. <!--<div class="header-bottom__button">
  57. <button class="button button_grey">
  58. <span class="button__text">Предложить новость</span>
  59. </button>
  60. </div>-->
  61. </div>
  62. <div class="header-bottom__actions">
  63. <div class="header-bottom__action">
  64. <Search />
  65. </div>
  66. <div class="header-bottom__action">
  67. <nuxt-link
  68. :to="{ name: 'user' }"
  69. tag="button"
  70. class="button button_icon"
  71. >
  72. <span class="button__icon">
  73. <BaseIcon :name="'user'" clear
  74. /></span>
  75. </nuxt-link>
  76. </div>
  77. <div class="header-bottom__action header-bottom__categories">
  78. <button class="button button_icon" @click="categoriesMenuToggle">
  79. <span class="button__icon">
  80. <BaseIcon name="dots"
  81. /></span>
  82. </button>
  83. </div>
  84. </div>
  85. <div class="header-bottom__burger-wrapper">
  86. <button
  87. class="header-bottom__burger button"
  88. @click="mobileMenuToggle"
  89. >
  90. <span> </span><span> </span>
  91. </button>
  92. </div>
  93. <div></div>
  94. </aside>
  95. <div v-if="menu" class="mobile-menu">
  96. <div class="amic-logo-invert">
  97. <img :src="require('~/static/svg/symbol/amic-logo.svg')" />
  98. </div>
  99. <button
  100. class="header-bottom__burger burger-cross button"
  101. @click="mobileMenuToggle"
  102. >
  103. <span></span><span></span>
  104. </button>
  105. <ul class="mobile-menu-list">
  106. <li>
  107. <a href="/news">Новости</a>
  108. </li>
  109. <li>
  110. <a href="/articles">Читай</a>
  111. </li>
  112. <li>
  113. <a href="/podcasts">Слушай</a>
  114. </li>
  115. <li>
  116. <a href="/video">Смотри</a>
  117. </li>
  118. </ul>
  119. <FooterSocials />
  120. <br/><br/>
  121. <a
  122. class="button button_grey"
  123. href="https://fmprod.ru/radiostantsii/item/evropa-plyus/"
  124. target="_blank"
  125. ><span class="button__text tg">▶ Слушать радио</span></a
  126. >
  127. <br/><br/>
  128. <a
  129. class="button button_grey button_grey-tg"
  130. href="https://t.me/+zf9tbqRD9o0zOWI6"
  131. target="_blank"
  132. >
  133. <span class="button__icon"> <BaseIcon :name="'tg'" /></span>
  134. <span class="button__text">Телеграм-канал</span>
  135. </a>
  136. </div>
  137. <div v-if="menuCategories" class="mobile-menu mobile-menu-categories">
  138. <button
  139. class="header-bottom__burger burger-cross button"
  140. @click="categoriesMenuToggle"
  141. >
  142. <span></span><span></span>
  143. </button>
  144. <ul class="mobile-menu-list">
  145. <li v-for="categoryLink in links" :key="categoryLink.alias">
  146. <nuxt-link :to="{ name : 'news-category', params: { category : categoryLink.alias} }">
  147. {{ categoryLink.name }}
  148. </nuxt-link>
  149. </li>
  150. </ul>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. </template>
  156. <script>
  157. import { mapGetters } from "vuex"
  158. export default {
  159. data() {
  160. return {
  161. menu: false,
  162. menuCategories: false,
  163. navbar: null,
  164. sticky: null,
  165. };
  166. },
  167. methods: {
  168. isMobile() {
  169. return this.$device.isMobile
  170. },
  171. mobileMenuToggle() {
  172. this.menu = !this.menu;
  173. },
  174. async categoriesMenuToggle() {
  175. this.menuCategories = !this.menuCategories;
  176. if(this.categoriesList.data) return;
  177. await this.$store.dispatch("modules/news/setCategoriesList");
  178. },
  179. onscrolling() {
  180. if (!this.navbar) {
  181. this.navbar = document.getElementById("js-header-bottom-id");
  182. this.sticky = this.navbar.offsetTop;
  183. }
  184. if (window.pageYOffset >= this.sticky) {
  185. this.navbar.classList.add("header__bottom_fixed");
  186. } else {
  187. this.navbar.classList.remove("header__bottom_fixed");
  188. }
  189. },
  190. },
  191. mounted() {
  192. window.addEventListener('scroll', this.onscrolling);
  193. },
  194. computed: {
  195. ...mapGetters({
  196. categoriesList : "modules/news/categoriesList"
  197. }),
  198. nzk_logo(){
  199. return require('~/static/png/nzk_logo.png');
  200. },
  201. isMain() {
  202. return this.$route.path !== '/'
  203. },
  204. links() {
  205. if(!this.categoriesList.data) return [];
  206. let list = this.categoriesList.data.filter((link) => {
  207. return link.alias !== 'articles' && link.alias !== 'video' && link.alias !== 'podcasts'
  208. })
  209. return list
  210. },
  211. logo() {
  212. //By route
  213. if(this.$route.name && this.$route.name.includes('video')) {
  214. return require('~/static/svg/symbol/amic-logo-video.svg');
  215. }
  216. //By color theme
  217. switch(this.$colorMode.value) {
  218. case 'dark': return require('~/static/svg/symbol/amic-logo-dark.svg');
  219. default: return require('~/static/svg/symbol/amic-logo.svg');
  220. }
  221. }
  222. },
  223. watch: {
  224. $route(to, from) {
  225. if (this.navbar) {
  226. this.navbar.classList.remove("header__bottom_fixed");
  227. this.navbar = null;
  228. }
  229. if(this.menuCategories) {
  230. this.menuCategories = false;
  231. }
  232. this.onscrolling();
  233. },
  234. },
  235. };
  236. </script>
  237. <style lang="less">
  238. .header-bottom__wrapper{
  239. position: relative;
  240. }
  241. .cabbit{
  242. position: absolute;
  243. top: -65px;
  244. left: 5px;
  245. height: 65px;
  246. overflow: hidden;
  247. img{
  248. height: 100%;
  249. }
  250. }
  251. .button_grey-tg {
  252. margin-right: 40px;
  253. }
  254. .header__bottom {
  255. position: absolute;
  256. width: 100%;
  257. left: 0;
  258. bottom: 0;
  259. background-color: #fff;
  260. &_fixed {
  261. position: fixed;
  262. top: 0;
  263. bottom: auto;
  264. z-index: 100;
  265. animation: headerFixed 0.3s linear;
  266. box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
  267. }
  268. }
  269. .header__bottom_fixed {
  270. }
  271. .header-bottom {
  272. &__logo-link {
  273. img {
  274. @media (max-width: 576px) {
  275. height: 18px;
  276. }
  277. }
  278. }
  279. &__categories {
  280. display: none;
  281. @media (max-width: 1000px) {
  282. display: block;
  283. }
  284. }
  285. &__nav{
  286. position: relative;
  287. }
  288. }
  289. .mobile-menu {
  290. position: fixed;
  291. background-color: rgba(59, 85, 115, 1);
  292. left: 0;
  293. max-height: 100vh;
  294. height: 100%;
  295. right: 0;
  296. animation: translate 0.2s ease;
  297. z-index: 100000;
  298. top: 0;
  299. padding: 20px;
  300. overflow: auto;
  301. .amic-logo-invert {
  302. height: 18px;
  303. filter: invert(100%);
  304. }
  305. .header-bottom__burger {
  306. width: 24px;
  307. }
  308. .mobile-menu-list {
  309. margin: 60px 0;
  310. li {
  311. margin: 20px 0;
  312. color: rgba(255, 255, 255, 0.5);
  313. font-size: 22px;
  314. font-weight: bold;
  315. a {
  316. color: white;
  317. }
  318. }
  319. }
  320. }
  321. .burger-cross {
  322. position: absolute;
  323. right: 20px;
  324. top: 30px;
  325. span:first-child {
  326. top: auto !important;
  327. background: white;
  328. transform: translateY(-50%) rotate(45deg) !important;
  329. }
  330. span:last-child {
  331. background: white;
  332. transform: translateY(-50%) rotate(-45deg) !important;
  333. bottom: auto !important;
  334. }
  335. }
  336. @keyframes translate {
  337. 0% {
  338. transform: translateX(100%);
  339. }
  340. 100% {
  341. transform: translateX(0%);
  342. }
  343. }
  344. .nzk_desktop_banner{
  345. position: absolute;
  346. width: 100px;
  347. top: -15px;
  348. right: -135px;
  349. }
  350. </style>