Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * WYSIWYG (Content Editor) Module
- */
- /** @var \LightningFruit\AuCoyote\AcfFlexModule $_module */
- global $_module;
- if ( ! isset( $_module ) )
- throw new \Exception( __( 'No global module instance detected!', 'coyotetheme' ), '002');
- // Do more ACF prep stuff here, if needed
- // Add chosen color theme to module classes
- if ($colorTheme = get_sub_field('module_theme')) $_module->addClass('pwtheme-'.$colorTheme);
- // Adjust module header col-width
- $_module_header_col_width = 10;
- $enable_animations = get_sub_field('enable_animations');
- $icons_left = get_sub_field('icons_left_side');
- $icons_right = get_sub_field('icons_right_side');
- $shapes = array('and', 'circle-empty', 'circle-star', 'circle', 'dot-comma', 'exclamation', 'moon', 'paragraph-one', 'paragraph-two', 'question', 'quote', 'quotes', 'semi-circle-empty', 'semi-circle', 'star', 'three-circles', 'window-two', 'window');
- $size = array('small', 'medium', 'big', 'small', 'medium', 'big', 'small', 'medium', 'small', 'medium', 'big', 'small', 'medium', 'big', 'small', 'medium');
- $indent = array(25,50,0,-5,15,40,35,5,10,20,30,45,10,30,-5,50,40,15,20,5,35,0,25,45,40,-5,20,10,5,15,0,45,30,50,35,25);
- $colors = array('#F75437', '#9FF4E0', '#E64DA2', '#2554AA', '#FFCD58', '#FFCFC2', '#FABDF2', '#1AA882', '#9FF4E0', '#FE836B', '#B3C936', '#2554AA', '#CF7E0C', '#87AAEE', '#39D1A9', '#B3C936');
- ?>
- <section id="<?php echo esc_attr( $_module->getID() ); ?>" class="<?php echo esc_attr( $_module->getClasses() ) ?> <?php if ($enable_animations) {echo 'animations-enabled';} ?>">
- <?php
- if ($icons_left && $icons_left!=0) {
- $rand_shapes_left = array_rand($shapes, $icons_left);
- $rand_size_left = array_rand($size, $icons_left);
- $rand_color_left = array_rand($colors, $icons_left);
- $rand_vertical_left = array_rand($indent, $icons_left);
- echo '<div class="animations-left">';
- if ($icons_left <3) {
- for ($i = 0; $i < $icons_left; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- }
- else {
- switch ($icons_left) {
- case '3':
- echo '<div class="animations-top">';
- for ($i = 0; $i < 2; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-middle">';
- for ($i = 2; $i < $icons_left; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- echo '</div>';
- break;
- case '4':
- echo '<div class="animations-top">';
- for ($i = 0; $i < 2; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-middle">';
- echo '<div class="animation size-' . $size[$rand_size_left[2]] . ' ' . $shapes[$rand_shapes_left[2]] . '" style="margin-top: ' . $indent[$rand_vertical_left[2]]/10 . 'rem;color: ' . $colors[$rand_color_left[2]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[2]] . '.svg') . '</div>';
- echo '</div>';
- echo '<div class="animations-bottom">';
- echo '<div class="animation size-' . $size[$rand_size_left[3]] . ' ' . $shapes[$rand_shapes_left[3]] . '" style="margin-top: ' . $indent[$rand_vertical_left[3]]/10 . 'rem;color: ' . $colors[$rand_color_left[3]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[3]] . '.svg') . '</div>';
- echo '</div>';
- break;
- case '5':
- echo '<div class="animations-top">';
- for ($i = 0; $i < 2; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-middle">';
- echo '<div class="animation size-' . $size[$rand_size_left[2]] . ' ' . $shapes[$rand_shapes_left[2]] . '" style="margin-top: ' . $indent[$rand_vertical_left[2]]/10 . 'rem;color: ' . $colors[$rand_color_left[2]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[2]] . '.svg') . '</div>';
- echo '</div>';
- echo '<div class="animations-bottom">';
- for ($i = 3; $i < 5; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- echo '</div>';
- break;
- case '6':
- echo '<div class="animations-top">';
- echo '<div class="animation size-' . $size[$rand_size_left[0]] . ' ' . $shapes[$rand_shapes_left[0]] . '" style="margin-top: ' . $indent[$rand_vertical_left[0]]/10 . 'rem;color: ' . $colors[$rand_color_left[0]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[0]] . '.svg') . '</div>';
- echo '</div>';
- echo '<div class="animations-middle">';
- for ($i = 1; $i < 4; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-bottom">';
- for ($i = 4; $i < 6; $i++) {
- echo '<div class="animation size-' . $size[$rand_size_left[$i]] . ' ' . $shapes[$rand_shapes_left[$i]] . '" style="margin-top: ' . $indent[$rand_vertical_left[$i]]/10 . 'rem;color: ' . $colors[$rand_color_left[$i]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_left[$i]] . '.svg') . '</div>';
- }
- echo '</div>';
- break;
- }
- }
- echo '</div>';
- }
- ?>
- <div class="container"><!-- Bootstrap containers should be wrapped in a full-width wrapping element. Do not nest containers.-->
- <?php include get_stylesheet_directory() . '/partials/_module-header.php'; ?>
- <article class="row module-content justify-content-center">
- <div class="col-12 col-md-<?php echo $_col_width;?>">
- <?php the_sub_field( 'content' ); ?>
- </div>
- </article>
- </div>
- <?php
- if ($icons_right && $icons_right!=0) {
- $rand_shapes_right = array_rand($shapes, $icons_right);
- $rand_size_right = array_rand($size, $icons_right);
- $rand_indent_right = array_rand($indent, $icons_right);
- $rand_color_right = array_rand($colors, $icons_right);
- $rand_vertical_right = array_rand($indent, $icons_right);
- echo '<div class="animations-right">';
- if ($icons_right < 4) {
- for ($j = 0; $j < $icons_right; $j++) {
- echo '<div class="animation size-'.$size[$rand_size_right[$j]].' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: '.$indent[$rand_vertical_right[$j]]/10 .'rem; color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- }
- else {
- switch ($icons_right) {
- case '3':
- echo '<div class="animations-top">';
- for ($j = 0; $j < 2; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-middle">';
- for ($j = 2; $j < $icons_right; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- break;
- case '4':
- echo '<div class="animations-top">';
- for ($j = 0; $j < 2; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-middle">';
- echo '<div class="animation size-' . $size[$rand_size_right[2]] . ' ' . $shapes[$rand_shapes_right[2]] . '" style="margin-top: ' . $indent[$rand_vertical_right[2]]/10 . 'rem;color: ' . $colors[$rand_color_right[2]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[2]] . '.svg') . '</div>';
- echo '</div>';
- echo '<div class="animations-bottom">';
- echo '<div class="animation size-' . $size[$rand_size_right[3]] . ' ' . $shapes[$rand_shapes_right[3]] . '" style="margin-top: ' . $indent[$rand_vertical_right[3]]/10 . 'rem;color: ' . $colors[$rand_color_right[3]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[3]] . '.svg') . '</div>';
- echo '</div>';
- break;
- case '5':
- echo '<div class="animations-top">';
- for ($j = 0; $j < 2; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-middle">';
- echo '<div class="animation size-' . $size[$rand_size_right[2]] . ' ' . $shapes[$rand_shapes_right[2]] . '" style="margin-top: ' . $indent[$rand_vertical_right[2]]/10 . 'rem;color: ' . $colors[$rand_color_right[2]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[2]] . '.svg') . '</div>';
- echo '</div>';
- echo '<div class="animations-bottom">';
- for ($j = 3; $j < 5; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- break;
- case '6':
- echo '<div class="animations-top">';
- echo '<div class="animation size-' . $size[$rand_size_right[0]] . ' ' . $shapes[$rand_shapes_right[0]] . '" style="margin-top: ' . $indent[$rand_vertical_right[0]]/10 . 'rem;color: ' . $colors[$rand_color_right[0]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[0]] . '.svg') . '</div>';
- echo '</div>';
- echo '<div class="animations-middle">';
- for ($j = 1; $j < 4; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-bottom">';
- for ($j = 4; $j < 6; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- break;
- case '7':
- echo '<div class="animations-top">';
- echo '<div class="animation size-' . $size[$rand_size_right[0]] . ' ' . $shapes[$rand_shapes_right[0]] . '" style="margin-top: ' . $indent[$rand_vertical_right[0]]/10 . 'rem;color: ' . $colors[$rand_color_right[0]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[0]] . '.svg') . '</div>';
- echo '</div>';
- echo '<div class="animations-middle">';
- for ($j = 1; $j < 4; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- echo '<div class="animations-bottom">';
- for ($j = 4; $j < 7; $j++) {
- echo '<div class="animation size-' . $size[$rand_size_right[$j]] . ' ' . $shapes[$rand_shapes_right[$j]] . '" style="margin-top: ' . $indent[$rand_vertical_right[$j]]/10 . 'rem;color: ' . $colors[$rand_color_right[$j]] . '">' . print_svg(get_template_directory_uri() . '/dist/images/animations/' . $shapes[$rand_shapes_right[$j]] . '.svg') . '</div>';
- }
- echo '</div>';
- break;
- }
- }
- }
- ?>
- </section>
- <?php unset( $_module ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement