Skip to content

Commit

Permalink
issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgimenez committed Feb 7, 2019
1 parent 479e8d3 commit 99c71d4
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 13 deletions.
Binary file added assets/images/icon-close-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/icon-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions assets/js/geral.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
*
* Funções gerais
*
*/
jQuery(document).ready(function($) {
/**
*
* Exibe o menu no clique
*
*/
$( '.csem-open-menu' ).on( 'click', function( e ) {
console.log( this )
if ( $( this ).hasClass( 'open' ) ) {
$( this ).removeClass( 'open' );
$( '.menu-logo-toggle' ).removeClass( 'open' );
} else {
$( '.menu-logo-toggle' ).addClass( 'open' );
$( this ).addClass( 'open' );
}
});
});
7 changes: 3 additions & 4 deletions assets/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
*
*/
jQuery(document).ready(function($) {
if ( 0 === $( 'body.home').length ) {
return;
}
/**
*
* Checa se o elemento esta visivel no scroll
*
*/
if ( 0 === $( 'body.home').length ) {
return;
}
console.log( 'qaq');
$( 'a[href="#proxima"]' ).on( 'click', function( e) {
var $el_next_section = $( this ).parent().parent().parent().next( 'section' );
$( 'html, body' ).animate({
Expand Down
34 changes: 33 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,37 @@
function csem_theme_scripts() {
// Enfileira o script
wp_enqueue_script( 'csem-theme-home', get_stylesheet_directory_uri() . '/assets/js/home.js', array( 'jquery'), '1.0', true );
wp_enqueue_script( 'csem-theme-geral', get_stylesheet_directory_uri() . '/assets/js/geral.js', array( 'jquery'), '1.0', true );

}
add_action( 'wp_enqueue_scripts', 'csem_theme_scripts' );
add_action( 'wp_enqueue_scripts', 'csem_theme_scripts' );

/**
*
* Sobrepoe a função padrão do tema pai "coletivo_site_header"
*
*/
function coletivo_site_header() {
?>
<header id="masthead" class="site-header" role="banner">
<a href="#" class="csem-open-menu">
<img src="<?php echo get_stylesheet_directory_uri();?>/assets/images/icon-menu.png" class="open">
<img src="<?php echo get_stylesheet_directory_uri();?>/assets/images/icon-close-menu.png" class="closed">
</a>
</header><!-- #masthead -->
<nav class="menu-logo-toggle" >
<div class="site-branding">
<?php
coletivo_site_logo();
?>
</div>
<nav id="site-navigation" class="main-navigation" role="navigation">
<ul class="coletivo-menu">
<?php wp_nav_menu(array('theme_location' => 'primary', 'container' => '', 'items_wrap' => '%3$s')); ?>
</ul>
</nav>
<!-- #site-navigation -->
</nav>

<?php
}
87 changes: 79 additions & 8 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,85 @@ Underscores is distributed under the terms of the GNU GPL v2 or later.
Normalizing styles have been helped along thanks to the fine work of
Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/
*/

/**
* GERAL - Menu Lateral com toggle
*/
.menu-logo-toggle {
position: fixed;
height: 300vh;
width: 45vw;
top:0;
left:-50vw;
background: #ebebeb;
transition:1s ease all;
z-index: 99;
}
.menu-logo-toggle.open {
box-shadow: 51vw 65px 215px 106px rgba(0,0,0,0.67);
transition: 1200ms ease all;
left: 0;
}

body.admin-bar .menu-logo-toggle {
top:32px;
}
.menu-logo-toggle .site-branding {
padding-top: 70px;
margin-left: 12vw;
}
.menu-logo-toggle .site-branding .site-title, .menu-logo-toggle .site-branding .site-description {
display: none;
}
#site-navigation {
margin-left: 12vw;
}
#site-navigation ul {
display: block;
padding-top: 30px;
}
#site-navigation ul li {
display: inline-block;
width: 100%;
padding-bottom:15px;
}
#site-navigation ul li a {
font-size: 18px;
}
header#masthead {
background: none;
box-shadow: none;
width:128px;
margin-top:30vh;
z-index: 999;
}
header#masthead .csem-open-menu {
background: #ca1921;
border-radius: 50%;
display: inline-block;
width: 64px;
height:64px;
margin-left: 15px;
}
header#masthead .csem-open-menu img {
width: 48px;
height: 48px;
margin-left: 7px;
margin-bottom: 8px;
}
.csem-open-menu.open img.open {
display: none;
}
.csem-open-menu img.closed {
display: none;
}
.csem-open-menu.open img.closed {
display: inline;
width: 43px !important;
height: 43px !important;
margin-left: 11px !important;
margin-bottom: 11px !important;
}
/**
* Home - Section Hero
*/
Expand All @@ -40,14 +119,6 @@ body.home .hero-content-style1 .btn-danger{
body.home .hero-content-style1 h2.hero-large-text {
padding-bottom: 6vh;
}
body.home header#masthead {
transition: 700ms ease all;
opacity: 0;
}
body.home header#masthead.show {
transition: 700ms ease all;
opacity: 1;
}
@media screen and (max-width: 900px ) {
body.home .hero__content {
padding-top:25vh;
Expand Down

0 comments on commit 99c71d4

Please sign in to comment.