header.php 6.6 KB

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