From 159cd41e690cb5608c51263039d437b12fd2dacc Mon Sep 17 00:00:00 2001 From: matheusgimenez Date: Mon, 18 Feb 2019 00:27:24 -0300 Subject: [PATCH] issue #3 --- assets/js/home.js | 32 +++++++++ functions.php | 36 ---------- section-parts/section-fazer-parte.php | 48 ++++++------- style.css | 100 +++++++++++++++++++++++++- 4 files changed, 150 insertions(+), 66 deletions(-) diff --git a/assets/js/home.js b/assets/js/home.js index fd2cdf9..c54f3cf 100644 --- a/assets/js/home.js +++ b/assets/js/home.js @@ -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(); + }); + } + }); diff --git a/functions.php b/functions.php index 087dbfb..04d7d56 100644 --- a/functions.php +++ b/functions.php @@ -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( @@ -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( diff --git a/section-parts/section-fazer-parte.php b/section-parts/section-fazer-parte.php index 38783af..f1ee052 100644 --- a/section-parts/section-fazer-parte.php +++ b/section-parts/section-fazer-parte.php @@ -1,7 +1,8 @@ -

-
- -
+
+ +

+
+
+ +

- + - + @@ -45,21 +42,18 @@ $post = get_post( $post_id ); setup_postdata( $post ); ?> -

-
- +

+ +
+
+ +
- ?> -
- - - + + + diff --git a/style.css b/style.css index 600ca2b..081bd9a 100644 --- a/style.css +++ b/style.css @@ -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; @@ -131,4 +131,98 @@ body.home .hero-content-style1 h2.hero-large-text { padding-top:25vh; padding-bottom: 0; } -} \ No newline at end of file +} +/** + * + * 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; + } +}