Commit 91e647db authored by Simon's avatar Simon

in progress

parent 761e47a5
......@@ -4,7 +4,7 @@
:root {
/*--layout-width: 976px;*/
--layout-width: 73.125em; /* 1170px */
--layout-width: 1210px; /* 1170px */
}
/* critical:end */
/* ------------- Elements: anchor ------------- */
/* critical:start */
a { color: var(--color--gray); }
a { color: inherit; }
/* critical:end */
a {
......
......@@ -5,7 +5,7 @@
body {
font-size: var(--typo--font-size);
line-height: var(--typo--line-height);
color: var(--color--gray);
color: var(--color--gray-darker);
@media (--max--small) {
font-family: var(--typo--font-family);
......
......@@ -2,8 +2,8 @@
/* critical:start */
.l-inner { max-width: var(--layout-width); margin-right: auto; margin-left: auto; padding-right: 1em; padding-left: 1em; }
.l-inner { max-width: var(--layout-width); margin-right: auto; margin-left: auto; padding-right: 20px; padding-left: 20px; }
/* critical:end */
.l-inner--header { display: flex; flex-direction: row; }
.l-inner--header { display: flex; flex-direction: row; align-items: center; }
......@@ -4,7 +4,7 @@
.l-nav {
@media (--min--small) {
flex: 1 1 100%;
flex: 1 1 auto;
}
}
......
......@@ -6,4 +6,5 @@ no cosmetic design patterns. Class only styles from here onwards. Classes here a
o-: Signify that something is an Object, and that it may be used in any number of unrelated contexts to the one you can currently see it in. Making modifications to these types of class could potentially have knock-on effects in a lot of other unrelated places. Tread carefully.
========================================================================== */
@import '_object--btn.css';
@import '_object--nav.css';
/* ------------- Object: button ------------- */
/* critical:start */
.o-btn { border: 0; color: #fff; background: var(--color--green); padding: 12px 24px; cursor: pointer; border-radius: 3px;
&:hover { background: var(--color--green-darker); }
}
.c-btn--header { margin-right: 28px; }
/*.o-nav--item { display: block; }*/
/*.o-nav--link { display: block; }*/
/* critical:end */
/*.o-nav { user-select: none; }*/
......@@ -18,6 +18,7 @@ c-: Signify that something is a Component. This is a concrete, implementation-sp
@import '_component--jobs-pagination.css';
@import '_component--logo.css';
@import '_component--nav.css';
@import '_component--phone.css';
@import '_component--search.css';
@import '_component--share.css';
......
......@@ -2,9 +2,9 @@
/* critical:start */
.c-logo { display: block; width: 81px; margin-right: 89px; padding: 11px 0; text-decoration: none; }
.c-logo--svg { display: block; }
/* critical:end */
.c-logo { text-decoration: none; }
......@@ -4,7 +4,7 @@
.c-nav { }
.c-nav--main { display: flex; z-index: 300; padding-left: 224px;
.c-nav--main { display: flex;
/* @media (--max--small) {
margin: 20px 0;
}
......@@ -16,12 +16,16 @@
.c-nav--sub { display: none; }
/* critical:end */
.c-nav--main-item { position: relative; height: 70px; margin-right: 26px; padding: 24px 0 0; }
.c-nav--main-anchor { display: block; padding: 5px 0; text-transform: uppercase; border-bottom: 2px solid transparent; text-decoration: none; }
.c-nav--main-item { position: relative; height: 70px; margin-right: 26px; padding: 24px 0 0; z-index: 500; }
.c-nav--main-anchor { display: block; padding: 5px 0; text-transform: uppercase; border-bottom: 2px solid transparent; text-decoration: none; color: var(--color--gray);
&:hover { border-bottom-color: var(--color--gray-dark); color: var(--color--gray-dark); }
}
.c-nav--sub { position: absolute; top: 100%; padding: 0 1em 0 6px; overflow: hidden; }
.c-nav--sub-item { height: 46px; line-height: 46; }
.c-nav--sub-anchor { color: #fff; text-transform: uppercase; white-space: nowrap; }
.c-nav--sub { position: absolute; top: 100%; }
.c-nav--sub-item { margin-right: 45px; }
.c-nav--sub-anchor { display: block; padding: 17px 0; color: #fff; text-transform: uppercase; white-space: nowrap; text-decoration: none;
&:hover { color: var(--color--green); }
}
/*.c-nav--item { margin: 10px; }*/
......@@ -31,6 +35,6 @@
.c-nav--region { }
.c-nav--lang { display: flex;
li { padding: 0 5px; }
.c-nav--lang {
li { }
}
/* ------------- Component: phone ------------- */
/* critical:start */
.c-phone { white-space: nowrap; margin-right: 35px; padding: 10px 0; text-decoration: none; color: inherit;
svg { float: left; margin: -6px 5px 0 0; }
}
/* critical:end */
......@@ -19,4 +19,4 @@
}
.is-nav--main-anchor-active { border-bottom-color: var(--color--gray-dark); color: var(--color--gray-dark); }
.is-nav--sub-anchor-active { text-decoration: none; }
.is-nav--sub-anchor-active { color: var(--color--green-darker); }
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -49,13 +49,6 @@ define('cityID', $cityID);
<?php
global $post;
global $section;
$section = get_post_meta( $post->ID, 'section', true );
// int $post_id, string $key = '', bool $single = false
// echo '<h1>Lorem meta: ' . get_post_meta( $post->ID, 'section', true ) . '</h1>';
// debug( get_post_meta( $post->ID) ) ;
?>
<body>
......@@ -71,17 +64,25 @@ $section = get_post_meta( $post->ID, 'section', true );
<div class="l-inner l-inner--header">
<a href="<?php echo pll_home_url(); ?>" class="c-logo" title="<?php echo get_the_title( get_option('page_on_front') ); ?>">
<svg width="133px" height="78px" class="c-logo--svg">
<svg width="81px" height="47px" class="c-logo--svg">
<use xlink:href="#biuro-logo"></use>
</svg>
</a>
<nav class="l-nav">
<?php
get_template_part( 'template-parts/menus/menu', 'main' );
get_template_part( 'template-parts/menus/menu', 'main' );
?>
</nav>
<a href="tel:+37064902392" class="c-phone">
<svg xmlns="http://www.w3.org/2000/svg" width="21px" height="22px" viewBox="0 0 21 22">
<path d="M20.0073662,1.61350199 C20.5897947,1.74475969 20.9999499,2.26157937 20.9999499,2.86039004 C20.9999499,13.2496151 12.5794702,21.6249937 2.23534623,21.6249937 C1.63653556,21.6249937 1.11971588,21.2148385 0.984372653,20.6283244 L0.0328044109,16.4980528 C-0.106624349,15.8951166 0.205077636,15.2798837 0.775209486,15.0337905 L5.2212686,13.1265685 C5.74217381,12.9009831 6.35740672,13.0527486 6.71833535,13.4916227 L8.52714413,15.7023356 C11.3695122,14.3078077 13.6786783,11.994556 15.0732063,9.15627347 L12.8624533,7.34750474 C12.4236192,6.98653606 12.2718538,6.37130315 12.4974392,5.850438 L14.4046612,1.4002533 C14.6507543,0.830121445 15.2700728,0.51841946 15.873009,0.65784822 L20.0073662,1.61350199 Z M2.25993953,20.3124969 C11.8780807,20.3002002 19.6751564,12.5072501 19.6833675,2.88910892 L15.598197,1.9457518 L13.7114827,6.35079539 L16.6974051,8.79121926 C14.7122776,13.0240297 12.4112825,15.3331958 8.16208992,17.3265745 L5.72166605,14.3406521 L1.3165824,16.2273664 L2.25993953,20.3124969 Z"></path>
</svg> +370 649 02392
</a>
<button class="o-btn c-btn--header"><?php _e('Get a job offer', 'biuro_theme'); ?></button> <!-- Gauk darbo pasiūlymą -->
<?php
get_template_part( 'template-parts/menus/menu', 'language' );
?>
......@@ -96,18 +97,6 @@ $section = get_post_meta( $post->ID, 'section', true );
?>
</div>
<div class="l-inner">
<?php
/*
delog( get_search_query(), 'Search Query');
delog( get_post_type(), 'Post type');
delog( get_page_template_slug(), 'slug');
delog( is_front_page(), 'is_front_page');
delog( is_search(), 'is_search');
*/
?>
</div>
<div id="main" class="l-content">
<?php
......
......@@ -63,7 +63,7 @@
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "4a39df4fc069760248ad";
/******/ var hotCurrentHash = "a252b4caac14ab9ae6ef";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
......
<?php
global $section;
$menu_name = 'main-menu';
$locations = get_nav_menu_locations();
$menu = $locations ? wp_get_nav_menu_object( $locations[ $menu_name ] ) : null;
$menu_items = $menu ? wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) ) : array();
$items = array();
$ID = get_the_ID();
$no = 0;
$main = '';
function isSubActive($childID, $ID) {
if (!$ID) {
return false;
}
if ($childID == $ID) {
return true;
}
return ( get_post_meta( $childID, 'divisions-page', true )&& pods( 'division' )->find( array( 'limit' => 1, 'where'=>"page-id.ID = " . $ID ) )->total() ) ? true : false;
}
foreach( $menu_items as $menu_item ) {
if ($menu_item->menu_item_parent == 0) {
$no++;
$items[$menu_item->ID]['props'] = $menu_item;
$items[$menu_item->ID]['no'] = $no;
$items[$menu_item->ID]['active'] = ($menu_item->object_id == $ID) ? true : false;
} else {
$items[$menu_item->menu_item_parent]['children'][] = $menu_item;
if ($menu_item->object_id == $ID) {
$items[$menu_item->menu_item_parent]['active'] = true;
}
}
}
$menu_name = 'main-menu';
$locations = get_nav_menu_locations();
$menu = $locations ? wp_get_nav_menu_object( $locations[ $menu_name ] ) : null;
$menu_items = $menu ? wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) ) : array();
$items = array();
$ID = get_the_ID();
$no = 0;
$main = '';
function isSubActive($childID, $ID) {
if (!$ID):
return false;
endif;
if ($childID == $ID):
return true;
endif;
return ( get_post_meta( $childID, 'divisions-page', true )&& pods( 'division' )->find( array( 'limit' => 1, 'where'=>"page-id.ID = " . $ID ) )->total() ) ? true : false;
}
foreach( $menu_items as $menu_item ):
if ($menu_item->menu_item_parent == 0):
$no++;
$items[$menu_item->ID]['props'] = $menu_item;
$items[$menu_item->ID]['no'] = $no;
$items[$menu_item->ID]['active'] = ($menu_item->object_id == $ID) ? true : false;
else:
$items[$menu_item->menu_item_parent]['children'][] = $menu_item;
if ($menu_item->object_id == $ID):
$items[$menu_item->menu_item_parent]['active'] = true;
endif;
endif;
endforeach;
$main .= '<ul class="o-nav c-nav--main">';
foreach($items as $item) {
$children = array_key_exists('children', $item);
$url = ($children) ? $item['children'][0]->url : $item['props']->url;
$main .= '<ul class="o-nav c-nav--main">';
foreach($items as $item) :
$children = array_key_exists('children', $item);
$url = ($children) ? $item['children'][0]->url : $item['props']->url;
$sectionCSS = ($section == get_post_meta( $item['props']->object_id, 'section', true )) ? 'is-nav--main-item-active' : '';
$main .= '<li class="c-nav--main-item ' . $sectionCSS . '">';
$sectionCSS = ( get_post_meta( $post->ID, 'section', true) == get_post_meta( $item['props']->object_id, 'section', true )) ? 'is-nav--main-item-active' : '';
$main .= '<li class="c-nav--main-item ' . $sectionCSS . '">';
$classCSS = ($item['active']) ? 'is-nav--main-anchor-active"' : '';
$main .= '<a href="' . $url . '" title="' . get_the_title($item['props']->object_id) . '" class="c-nav--main-anchor ' . $classCSS . '">' . $item['props']->title . '</a>';
$classCSS = ($item['active']) ? 'is-nav--main-anchor-active"' : '';
$main .= '<a href="' . $url . '" title="' . get_the_title($item['props']->object_id) . '" class="c-nav--main-anchor ' . $classCSS . '">' . $item['props']->title . '</a>';
if ( $children ) :
$main .= '<ul class="o-nav c-nav--sub">';
if ( $children ) :
$main .= '<ul class="o-nav c-nav--sub">';
foreach($item['children'] as $child) :
foreach($item['children'] as $child) :
$classCSS = isSubActive($child->object_id, $ID ) ? 'is-nav--sub-anchor-active' : '';
$main .= '<li class="c-nav--sub-item"><a href="' . $child->url . '" title="' . get_the_title($child->object_id) . '" class="c-nav--sub-anchor ' . $classCSS .'">' . $child->title . '</a></li>';
endforeach;
// $classCSS = ($child->object_id == $ID ) ? 'is-nav--sub-anchor-active' : '';
$classCSS = isSubActive($child->object_id, $ID ) ? 'is-nav--sub-anchor-active' : '';
$main .= '<li class="c-nav--sub-item"><a href="' . $child->url . '" title="' . get_the_title($child->object_id) . '" class="c-nav--sub-anchor ' . $classCSS .'">' . $child->title . '</a></li>';
endforeach;
$main .= '</ul>';
endif;
$main .= '</ul>';
endif;
$main .= '</li>';
endforeach;
$main .= '</li>';
}
$main .= '</ul>';
$main .= '</ul>';
echo $main;
?>
echo $main;
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment