-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
184 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
web/wp-content/themes/cncf-twenty-two/components/event-multiple-banner.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Event Banner - Multiple | ||
* | ||
* @package WordPress | ||
* @subpackage cncf-theme | ||
* @since 1.0.0 | ||
*/ | ||
|
||
// load slick css. | ||
wp_enqueue_style( 'slick-css', get_template_directory_uri() . '/build/slick.min.css', array(), filemtime( get_template_directory() . '/build/slick.min.css' ), 'all' ); | ||
|
||
// load main slick. | ||
wp_enqueue_script( 'slick', get_template_directory_uri() . '/source/js/libraries/slick.min.js', array( 'jquery' ), filemtime( get_template_directory() . '/source/js/libraries/slick.min.js' ), true ); | ||
|
||
// load slick events config. | ||
wp_enqueue_script( 'slick-events-config', get_template_directory_uri() . '/source/js/on-demand/slick-events-config.js', array( 'jquery', 'slick' ), filemtime( get_template_directory() . '/source/js/on-demand/slick-events-config.js' ), true ); | ||
|
||
$the_query = $args['the_query']; | ||
|
||
?> | ||
|
||
<h3 class="has-normal-font-size header-lines">Forthcoming Events</h3> | ||
|
||
<div class="home-events-slider"> | ||
<?php | ||
while ( $the_query->have_posts() ) { | ||
$the_query->the_post(); | ||
get_template_part( 'components/event-banner' ); | ||
} | ||
?> | ||
</div> | ||
<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div> | ||
<div class="wp-block-separator is-style-thin-line"></div> | ||
<?php // Keep this spacer as its conditionally needed based on an event being displayed. ?> | ||
<div style="height:100px" aria-hidden="true" | ||
class="wp-block-spacer is-style-60-100"></div> |
21 changes: 21 additions & 0 deletions
21
web/wp-content/themes/cncf-twenty-two/components/event-single-banner.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* Event Banner - Single | ||
* | ||
* @package WordPress | ||
* @subpackage cncf-theme | ||
* @since 1.0.0 | ||
*/ | ||
|
||
?> | ||
|
||
<h3 class="has-normal-font-size header-lines">The Next CNCF Event</h3> | ||
|
||
<div class="event-banner has-animation-scale-2" role="banner"> | ||
<?php | ||
get_template_part( 'components/event-banner' ); | ||
?> | ||
</div> | ||
<?php // Keep this spacer as its conditionally needed based on an event being displayed. ?> | ||
<div style="height:100px" aria-hidden="true" | ||
class="wp-block-spacer is-style-60-100"></div> |
1 change: 1 addition & 0 deletions
1
web/wp-content/themes/cncf-twenty-two/images/slider-arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
web/wp-content/themes/cncf-twenty-two/images/slider-arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
web/wp-content/themes/cncf-twenty-two/source/js/on-demand/slick-events-config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Events Banner - Slick Config | ||
* | ||
* @package WordPress | ||
* @since 1.0.0 | ||
*/ | ||
|
||
jQuery( document ).ready( | ||
function( $ ) { | ||
eventSlider( $ ); | ||
|
||
} | ||
); | ||
|
||
function eventSlider($) { | ||
|
||
const slider = $( '.home-events-slider' ); | ||
|
||
if ( ! slider ) { | ||
return; | ||
} | ||
|
||
slider.slick( | ||
{ | ||
infinite: true, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
swipeToSlide: true, | ||
draggable: false, | ||
autoplay: true, | ||
autoplaySpeed: 5000, | ||
cssEase: "linear", | ||
lazyLoad: "ondemand", | ||
pauseOnHover: true, | ||
pauseOnFocus: false, | ||
prevArrow: '<img class="slick-prev" src="/wp-content/themes/cncf-twenty-two/images/slider-arrow-left.svg" />', | ||
nextArrow: '<img class="slick-next" src="/wp-content/themes/cncf-twenty-two/images/slider-arrow-right.svg" />' | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.