Skip to content

Commit

Permalink
Merge pull request #21 from skeeks-cms/master-mob
Browse files Browse the repository at this point in the history
Шапка мобильной версии, добавить мобильный логотип, добавить покраску…
  • Loading branch information
skeeks-semenov authored Sep 20, 2019
2 parents b399b27 + d9d16d0 commit 6c0dfc0
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 17 deletions.
9 changes: 9 additions & 0 deletions src/UnifyTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ static public function initBeforeRender()
color: {$color} !important;
font-size: {$fz} !important;
}
.hamburger-inner, .hamburger-inner:after, .hamburger-inner:before {
background-color: {$color} !important;
}
.mm-menu.mm-theme-dark .mm-btn:after,
.mm-menu.mm-theme-dark .mm-btn:before,
.mm-menu.mm-theme-dark .mm-listview>li .mm-next:after{
Expand Down Expand Up @@ -316,6 +320,11 @@ static public function initBeforeRender()
*/
public $footer_logo = '';

/**
* @var string
*/
public $mobile_logo = '';

/**
* @var string
*/
Expand Down
32 changes: 19 additions & 13 deletions src/assets/src/css/unify-custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ h6,
/**
* Unify custom css
*/
#navBar {
max-width: 100%;
overflow: auto;
}
.navbar-brand .sx-logo-text{
bottom: 7px;
/*letter-spacing: 3px;*/
Expand Down Expand Up @@ -502,28 +498,38 @@ html.mm-right .mm-menu.mm-fx-menu-slide {
.hamburger {
padding: 10px;
}
/* Уменьшаем размер шрифта для мобилльной версии */
@media (max-width: 768px) {

@media (max-width: 1024px) {
.h1, .h2, .h3, .h4, .h5, .h6, .h7, h1, h2, h3, h4, h5, h6 {
line-height: 1.3;
line-height: 1.4;
}
.h1, h1 {
font-size: 1.5rem;
font-size: 2rem;
}
.h2, h2 {
font-size: 1.4rem;
font-size: 1.75rem;
}

}
@media (max-width: 1024px) {
/* Уменьшаем размер шрифта для мобилльной версии */
@media (max-width: 768px) {
.h1, .h2, .h3, .h4, .h5, .h6, .h7, h1, h2, h3, h4, h5, h6 {
line-height: 1.4;
line-height: 1.3;
}
.h1, h1 {
font-size: 2rem;
font-size: 1.5rem;
}
.h2, h2 {
font-size: 1.75rem;
font-size: 1.4rem;
}
.h3, h3 {
font-size: 1.3rem;
}
.h4, h4 {
font-size: 1.2rem;
}
.h5, h5 {
font-size: 1.1rem;
}

}
Expand Down
12 changes: 12 additions & 0 deletions src/components/UnifyThemeSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class UnifyThemeSettings extends Component
*/
public $footer_logo = '';

/**
* @var string
*/
public $mobile_logo = '';

/**
* @var string
*/
Expand Down Expand Up @@ -260,6 +265,7 @@ public function rules()
'logo',
'footer_logo',
'logo_text',
'mobile_logo',
'favicon',
'address',
'title',
Expand Down Expand Up @@ -335,6 +341,7 @@ public function attributeLabels()
'logo' => "Логотип",
'footer_logo' => "Логотип для футера",
'logo_text' => "Текст для логотипа",
'mobile_logo' => "Логотип для мобильного телефона",
'favicon' => "Фавикон",

'title' => "Короткое название сайта",
Expand Down Expand Up @@ -397,6 +404,7 @@ public function attributeHints()
'menu_color2' => 'Если задан второй цвет, меню будет окрашено градиентом из первого цвета в второй',
'footer' => "Нижняя часть сайта",
'footer_logo' => "Если логотип не будет задан, то возьмется фото основного логотипа",
'mobile_logo' => "Если логотип не будет задан, то возьмется фото основного логотипа",
'header_shadow' => "Тень под шапкой стоит задавать только если выбран вариант отображения шапки во всю ширину",
'body_outer' => "Задается для центрированных сайтов",
'is_header_sticky' => "Фиксированная шапка будет растянута на весь экран",
Expand Down Expand Up @@ -438,6 +446,10 @@ public function getConfigFormFields()
'class' => WidgetField::class,
'widgetClass' => OneImage::class,
],
'mobile_logo' => [
'class' => WidgetField::class,
'widgetClass' => OneImage::class,
],


'vk',
Expand Down
5 changes: 5 additions & 0 deletions src/views/headers/header-v2.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
*/
/* @var $this yii\web\View */
\skeeks\assets\unify\base\UnifyHsHeaderAsset::register($this);
\skeeks\assets\unify\base\UnifyHsDropdownAsset::register($this);

//$this->theme->bodyCssClass = $this->theme->bodyCssClass . " g-mt-80";

$this->registerJs(<<<JS
$(window).on('load', function () {
$.HSCore.components.HSDropdown.init($('[data-dropdown-target]'), {
});
// initialization of header
$.HSCore.components.HSHeader.init($('#js-header'));
$.HSCore.helpers.HSHamburgers.init('.hamburger');
Expand Down
4 changes: 1 addition & 3 deletions src/views/headers/header-v4.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
// initialization of HSDropdown component
$.HSCore.components.HSDropdown.init($('[data-dropdown-target]'), {
afterOpen: function(){
$(this).find('input[type="search"]').focus();
}
});
$(window).on('load', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/filters/assets/src/css/filters.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ ul.sx-filters-tree li, .sx-filters-tree ul li {
.sx-btn-filter, .sx-mobile-filters-hide {
display: none;
}
@media (max-width: 450px) {
@media (max-width: 766px) {
.sx-filters-block {
display: block;
position: fixed;
Expand Down

0 comments on commit 6c0dfc0

Please sign in to comment.