header.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. use app\models\News;
  3. use app\models\Informers;
  4. $curs = Informers::GetСurrency();
  5. $temp = Informers::GetTemperature();
  6. ?>
  7. <div id="adfox_167402977594575081"></div> <!-- фулскрин -->
  8. <header>
  9. <div class="container">
  10. <?=$this->render("@app/views/_etc/banners/headerBanner")?>
  11. <div class="row">
  12. <div class="col-md-1 d-none d-lg-block">
  13. <div class="header-center__info" style="height:198px;">
  14. <ul class="header-center__info-list">
  15. <li class="header-center__info-item"><a href="/weather"><span class="header-center__info-link"><?=$temp?>°, Барнаул</span></a></li>
  16. <?php if( $curs ): //Смотри, так красивше же гораздо? ?>
  17. <li class="header-center__info-item"><span id="USD" class="header-center__info-link <?=($curs['USD']['dynamics'] == 'up')?'header-center__info-link_up':'header-center__info-link_down'?>">$&nbsp;<?=$curs['USD']['value']?></span></li>
  18. <li class="header-center__info-item"><span id="EUR" class="header-center__info-link <?=($curs['EUR']['dynamics'] == 'up')?'header-center__info-link_up':'header-center__info-link_down'?>">€&nbsp;<?=$curs['EUR']['value']?></span></li>
  19. <li class="header-center__info-item"><span id="CNY" class="header-center__info-link <?=($curs['CNY']['dynamics'] == 'up')?'header-center__info-link_up':'header-center__info-link_down'?>">Ұ&nbsp;<?=$curs['CNY']['value']?></span></li>
  20. <li class="header-center__info-item"><span id="BTC" class="header-center__info-link <?=($curs['BTC']['dynamics'] == 'up')?'header-center__info-link_up':'header-center__info-link_down'?>">&#8383;&nbsp;<?=$curs['BTC']['value']?></span></li>
  21. <?php endif;?>
  22. </ul>
  23. </div>
  24. </div>
  25. <div class="col-lg-7 col-md-9 stories-cel">
  26. <?=$this->render("stories")?>
  27. </div>
  28. <div class="col-md-4">
  29. <?=$this->render("@app/views/_etc/header/header_comments")?>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="nav-cont">
  34. <div id="js-header-bottom-id" class="header__bottom js-header-bottom">
  35. <div class="burger">
  36. <div class="hamburger hamburger--squeeze js-hamburger">
  37. <div class="hamburger-box">
  38. <div class="hamburger-inner"></div>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="header-bottom container">
  43. <div class="header-bottom__wrapper section-wrapper">
  44. <main class="header-bottom__main">
  45. <div class="header-bottom__logo"><a href="/" class="header-bottom__logo-link"><img src="/img/amic-logo.svg" width="91" height="28" alt="logo"></a></div>
  46. <div class="header-bottom__nav">
  47. <nav class="header-nav">
  48. <ul class="header-nav__list">
  49. <li class="header-nav__item"><a href="/news" class="header-nav__link" title="Лента новостей">
  50. Новости
  51. </a></li>
  52. <li class="header-nav__item"><a href="/articles" class="header-nav__link" title="Статьи">
  53. Читай
  54. </a></li>
  55. <li class="header-nav__item"><a href="/podcasts" class="header-nav__link" title="Подкасты">
  56. Слушай
  57. </a></li>
  58. <li class="header-nav__item"><a href="/video" class="header-nav__link" title="Видео проекты">
  59. Смотри
  60. </a></li>
  61. <li class="header-nav__item"><span class="burgerd">...</span></li>
  62. </ul>
  63. </nav>
  64. </div>
  65. </main>
  66. <aside class="header-bottom__side">
  67. <div class="header-bottom__buttons">
  68. <div class="header-bottom__button">
  69. <a href="https://fmprod.ru/radiostantsii/item/evropa-plyus/" target="_blank" class="button button_grey">
  70. <span class="button__text tg">▶ Слушать радио</span>
  71. </a>
  72. </div>
  73. <div class="header-bottom__button">
  74. <a href="https://t.me/amic_ru" target="_blank" class="button button_grey button_grey-tg">
  75. <span class="button__icon">
  76. <svg style="width: 17px;height: 14px;" class="icon icon-tg"><use xlink:href="/svg/symbol/sprite-styled.svg#tg"></use></svg>
  77. </span>
  78. <span class="button__text tg">&nbsp;Телеграм-канал</span>
  79. </a>
  80. </div>
  81. <?=$this->render("@app/views/layouts/filters")?>
  82. </div>
  83. </aside>
  84. <div class="actions">
  85. <div class="desktop-search">
  86. <form action="/search" method="get" class="search_form">
  87. <input type="hidden" value="<?=Yii::$app->controller->id?>" name="index">
  88. <input type="text" class="search_input" name="q" aria-label="Поиск">
  89. <button>Найти</button>
  90. </form>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </header>
  98. <?
  99. $this->registerJs(
  100. <<<JS
  101. window.addEventListener("DOMContentLoaded",function () {
  102. let header = document.getElementById("js-header-bottom-id");
  103. let height = header.offsetHeight;
  104. header.parentNode.style.height = height+"px";
  105. let position = header.parentNode.offsetTop;
  106. $(window).scroll( function (){
  107. if(window.scrollY>=position){
  108. if(!header.classList.contains("fixed")) header.classList.add("fixed");
  109. } else {
  110. if(header.classList.contains("fixed")) header.classList.remove("fixed");
  111. }
  112. });
  113. });
  114. JS
  115. ,
  116. $this::POS_END,
  117. 'headerfixer'
  118. );