Skip to content

Commit

Permalink
issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgimenez committed Feb 18, 2019
1 parent 1197370 commit 159cd41
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 66 deletions.
32 changes: 32 additions & 0 deletions assets/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,36 @@ jQuery(document).ready(function($) {
scrollTop: $el_next_section.offset().top
}, 700);
});
/**
*
* Dois itens da seção fazer-parte seguir o mesmo tamanho (altura)
*
*/
var set_fazer_parte_dynamic_styles = function() {
if ( $( window ).width() < 900 ) {
return;
}
var $content_1 = $( '.section-fazer-parte .fazer-parte-content-1' );
var $content_2 = $( '.section-fazer-parte .fazer-parte-content-2' );
if ( $content_1.outerHeight() > $content_2.outerHeight() ) {
var height = $content_1.outerHeight();
$( '.section-fazer-parte .fazer-parte-content-2' ).css( 'min-height', height + 'px' );
}
if ( $content_2.outerHeight() > $content_1.outerHeight() ) {
var height = $content_2.outerHeight();
$( '.section-fazer-parte .fazer-parte-content-1' ).css( 'min-height', height + 'px' );
}
console.log( $( '.section-fazer-parte .fazer-parte-content-1 img' ).width() );
console.log( $( '.section-fazer-parte .fazer-parte-content-1 .section-title' ).width() );
var content_1_img_width = $( '.section-fazer-parte .fazer-parte-content-1 img' ).outerWidth( false ) - $( '.section-fazer-parte .fazer-parte-content-1 .section-title' ).outerWidth( false );
$( '.section-fazer-parte .fazer-parte-content-1 .section-title' ).css( 'margin-left', content_1_img_width + 'px');

}
if ( 0 != $( '.section-fazer-parte').length ) {
set_fazer_parte_dynamic_styles();
$( window ).on( 'resize', function(){
set_fazer_parte_dynamic_styles();
});
}

});
36 changes: 0 additions & 36 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,6 @@ function csem_coletivo_customize_after_register( $wp_customize ) {
'options' => $option_pages
)
) );
// Featured page content source
$wp_customize->add_setting( coletivo_add_settings('coletivo_fazer-parte_content_source_1'),
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 'content',
)
);
$wp_customize->add_control( coletivo_add_settings('coletivo_fazer-parte_content_source_1'),
array(
'label' => esc_html__('Content source', 'coletivo'),
'section' => 'coletivo_fazer-parte_content',
'type' => 'select',
'choices' => array(
'content' => esc_html__( 'Full Page Content', 'coletivo' ),
'excerpt' => esc_html__( 'Page Excerpt', 'coletivo' ),
),
)
);
// More Button
$wp_customize->add_setting( coletivo_add_settings('coletivo_fazer-parte_more_text_1'),
array(
Expand Down Expand Up @@ -197,24 +179,6 @@ function csem_coletivo_customize_after_register( $wp_customize ) {
'options' => $option_pages
)
) );
// Featured page content source
$wp_customize->add_setting( coletivo_add_settings('coletivo_fazer-parte_content_source_2'),
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => 'content',
)
);
$wp_customize->add_control( coletivo_add_settings('coletivo_fazer-parte_content_source_2'),
array(
'label' => esc_html__('Content source', 'coletivo'),
'section' => 'coletivo_fazer-parte_content',
'type' => 'select',
'choices' => array(
'content' => esc_html__( 'Full Page Content', 'coletivo' ),
'excerpt' => esc_html__( 'Page Excerpt', 'coletivo' ),
),
)
);
// More Button
$wp_customize->add_setting( coletivo_add_settings('coletivo_fazer-parte_more_text_2'),
array(
Expand Down
48 changes: 21 additions & 27 deletions section-parts/section-fazer-parte.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
$coletivo_fazerparte_id = coletivo_get_theme_mod( 'coletivo_fazer-parte_id', esc_html__('fazer-parte', 'coletivo') );
$coletivo_fazerparte_disable = coletivo_get_theme_mod( 'coletivo_fazer-parte_disable' ) == 1 ? true : false ;
$coletivo_fazerparte_more_text = coletivo_get_theme_mod( 'coletivo_fazer-parte_more_text', esc_html__('Discover', 'coletivo') );
$coletivo_fazerparte_more_text_1 = coletivo_get_theme_mod( 'coletivo_fazer-parte_more_text_1', esc_html__('Discover', 'coletivo') );
$coletivo_fazerparte_more_text_2 = coletivo_get_theme_mod( 'coletivo_fazer-parte_more_text_2', esc_html__('Discover', 'coletivo') );
$coletivo_fazerparte_desc = coletivo_get_theme_mod( 'coletivo_fazer-parte_desc');
if ( coletivo_is_selective_refresh() ) {
$coletivo_fazerparte_disable = false;
Expand All @@ -19,21 +20,17 @@
$post = get_post( $post_id );
setup_postdata( $post );
?>
<h2 class="section-title"><?php the_title(); ?></h2>
<div class="section-desc">
<?php
if ( $content_source == 'excerpt' ) {
the_excerpt();
} else {
the_content();
}

?>
</div>
<div class="the-thumb">
<?php the_post_thumbnail( 'large' );?>
<h2 class="section-title"><?php the_title(); ?></h2>
</div><!-- .the-thumb -->
<div class="section-desc">
<?php the_excerpt();?>
</div>
<br />
<?php if ( $coletivo_fazerparte_more_text != '' ) : ?>
<?php if ( $coletivo_fazerparte_more_text_1 != '' ) : ?>
<a id="fazerparte" class="btn btn-theme-primary btn-lg" href="<?php echo esc_url( get_permalink()) ;?>">
<?php echo esc_html( $coletivo_fazerparte_more_text ); ?>
<?php echo esc_html( $coletivo_fazerparte_more_text_1 ); ?>
</a>
<?php endif;?>
</div>
Expand All @@ -45,21 +42,18 @@
$post = get_post( $post_id );
setup_postdata( $post );
?>
<h2 class="section-title"><?php the_title(); ?></h2>
<div class="section-desc">
<?php
if ( $content_source == 'excerpt' ) {
the_excerpt();
} else {
the_content();
}
<div class="the-thumb">
<h2 class="section-title"><?php the_title(); ?></h2>
<?php the_post_thumbnail( 'large' );?>
</div><!-- .the-thumb -->
<div class="section-desc">
<?php the_excerpt();?>
</div>

?>
</div>
<br />
<?php if ( $coletivo_fazerparte_more_text != '' ) : ?>
<a id="fazerparte" class="btn btn-theme-primary btn-lg" href="<?php echo esc_url( get_permalink()) ;?>">
<?php echo esc_html( $coletivo_fazerparte_more_text ); ?>
<?php if ( $coletivo_fazerparte_more_text_2 != '' ) : ?>
<a class="btn btn-theme-primary btn-lg" href="<?php echo esc_url( get_permalink()) ;?>">
<?php echo esc_html( $coletivo_fazerparte_more_text_2 ); ?>
</a>
<?php endif;?>
</div>
Expand Down
100 changes: 97 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/
box-shadow: 51vw 65px 215px 106px rgba(0,0,0,0.67);
transition: 1200ms ease all;
left: 0;
}
}
@media screen and ( max-width: 900px ) {
.menu-logo-toggle {
width:100%;
left:-101vw;
}
}
}
.menu-logo-toggle .site-branding {
padding-top: 70px;
Expand Down Expand Up @@ -131,4 +131,98 @@ body.home .hero-content-style1 h2.hero-large-text {
padding-top:25vh;
padding-bottom: 0;
}
}
}
/**
*
* Home - Section Fazer Parte
*
*/
.section-fazer-parte {
padding-top:0 !important;
}
.section-fazer-parte .container {
width:100%;
max-width: 100%;
margin: 0;
padding:0;
}
.section-fazer-parte .section-title-area {
width: 50%;
margin-bottom: 0 !important;
padding-bottom: 50px;
}
.section-fazer-parte .section-title-area.fazer-parte-content-1 {
background:#e8e8e8;
float:left;
padding-left:10vw;
}
.section-fazer-parte .section-title-area.fazer-parte-content-2 {
background: #d8d8d8;
float:right;
padding-right:10vw;
}
.section-fazer-parte .section-desc {
padding-right: 35px;
padding-left: 35px;
text-align: left;
font-size: 19px;
}
.section-fazer-parte .fazer-parte-content-2 h2.section-title {
background: #d8d8d8;
display: inline-block;
position: absolute;
max-width: 350px;
text-align: left;
padding-left: 35px;
font-size: 35px;
border-bottom-right-radius: 50px;
padding-bottom: 20px;
}
.section-fazer-parte .fazer-parte-content-2 .the-thumb {
width: 100%;
padding-top: 80px;
}
.section-fazer-parte .fazer-parte-content-2 .the-thumb img {
border-top-right-radius: 50px;
}

.section-fazer-parte .fazer-parte-content-1 .the-thumb img {
border-bottom-left-radius: 50px;
}
.section-fazer-parte .fazer-parte-content-1 h2.section-title {
background:#e8e8e8;
display:block;
position: absolute;
max-width: 350px;
text-align: left;
padding-left: 35px;
font-size: 35px;
border-top-left-radius: 50px;
margin-top: -103px;
margin-left: 120px;
padding-top: 20px;
}
.section-fazer-parte .btn {
float:left;
margin-left: 35px;
border-radius: 30px;
}
@media screen and ( max-width: 1000px ) {
.section-fazer-parte .section-title-area.fazer-parte-content-1 {
padding-left:0;
}
.section-fazer-parte .section-title-area.fazer-parte-content-2 {
padding-right:0;
}
}
@media screen and ( max-width: 900px ) {
.section-fazer-parte .section-title-area.fazer-parte-content-1 {
width:100%;
}
.section-fazer-parte .section-title-area.fazer-parte-content-2 {
width:100%;
}
.section-fazer-parte .fazer-parte-content-1 h2.section-title {
right:0;
}
}

0 comments on commit 159cd41

Please sign in to comment.