Advertisement
maximus87

www

Aug 27th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.99 KB | None | 0 0
  1. <?php
  2. /**
  3. * WYSIWYG (Content Editor) Module
  4. */
  5.  
  6. /** @var \LightningFruit\AuCoyote\AcfFlexModule $_module */
  7. global $_module;
  8. if ( ! isset( $_module ) )
  9. throw new \Exception( __( 'No global module instance detected!', 'coyotetheme' ), '002');
  10.  
  11. // Do more ACF prep stuff here, if needed
  12.  
  13. // Add chosen color theme to module classes
  14. if ($colorTheme = get_sub_field('module_theme')) $_module->addClass('pwtheme-'.$colorTheme);
  15.  
  16. // Adjust module header col-width
  17. $_module_header_col_width = 10;
  18.  
  19. $enable_animations = get_sub_field('enable_animations');
  20. $icons_left = get_sub_field('icons_left_side');
  21. $icons_right = get_sub_field('icons_right_side');
  22. $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');
  23. $size = array('small', 'medium', 'big', 'small', 'medium', 'big', 'small', 'medium', 'small', 'medium', 'big', 'small', 'medium', 'big', 'small', 'medium');
  24. $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);
  25. $colors = array('#F75437', '#9FF4E0', '#E64DA2', '#2554AA', '#FFCD58', '#FFCFC2', '#FABDF2', '#1AA882', '#9FF4E0', '#FE836B', '#B3C936', '#2554AA', '#CF7E0C', '#87AAEE', '#39D1A9', '#B3C936');
  26. ?>
  27.  
  28. <section id="<?php echo esc_attr( $_module->getID() ); ?>" class="<?php echo esc_attr( $_module->getClasses() ) ?> <?php if ($enable_animations) {echo 'animations-enabled';} ?>">
  29. <?php
  30. if ($icons_left && $icons_left!=0) {
  31. $rand_shapes_left = array_rand($shapes, $icons_left);
  32. $rand_size_left = array_rand($size, $icons_left);
  33. $rand_color_left = array_rand($colors, $icons_left);
  34. $rand_vertical_left = array_rand($indent, $icons_left);
  35. echo '<div class="animations-left">';
  36. if ($icons_left <3) {
  37. for ($i = 0; $i < $icons_left; $i++) {
  38. 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>';
  39. }
  40. }
  41. else {
  42. switch ($icons_left) {
  43. case '3':
  44. echo '<div class="animations-top">';
  45. for ($i = 0; $i < 2; $i++) {
  46. 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>';
  47. }
  48. echo '</div>';
  49. echo '<div class="animations-middle">';
  50. for ($i = 2; $i < $icons_left; $i++) {
  51. 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>';
  52. }
  53. echo '</div>';
  54. break;
  55. case '4':
  56. echo '<div class="animations-top">';
  57. for ($i = 0; $i < 2; $i++) {
  58. 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>';
  59. }
  60. echo '</div>';
  61. echo '<div class="animations-middle">';
  62. 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>';
  63. echo '</div>';
  64. echo '<div class="animations-bottom">';
  65. 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>';
  66. echo '</div>';
  67. break;
  68. case '5':
  69. echo '<div class="animations-top">';
  70. for ($i = 0; $i < 2; $i++) {
  71. 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>';
  72. }
  73. echo '</div>';
  74. echo '<div class="animations-middle">';
  75. 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>';
  76. echo '</div>';
  77. echo '<div class="animations-bottom">';
  78. for ($i = 3; $i < 5; $i++) {
  79. 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>';
  80. }
  81. echo '</div>';
  82. break;
  83. case '6':
  84. echo '<div class="animations-top">';
  85. 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>';
  86. echo '</div>';
  87. echo '<div class="animations-middle">';
  88. for ($i = 1; $i < 4; $i++) {
  89. 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>';
  90. }
  91. echo '</div>';
  92. echo '<div class="animations-bottom">';
  93. for ($i = 4; $i < 6; $i++) {
  94. 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>';
  95. }
  96. echo '</div>';
  97. break;
  98. }
  99. }
  100. echo '</div>';
  101. }
  102. ?>
  103. <div class="container"><!-- Bootstrap containers should be wrapped in a full-width wrapping element. Do not nest containers.-->
  104.  
  105. <?php include get_stylesheet_directory() . '/partials/_module-header.php'; ?>
  106.  
  107. <article class="row module-content justify-content-center">
  108. <div class="col-12 col-md-<?php echo $_col_width;?>">
  109. <?php the_sub_field( 'content' ); ?>
  110. </div>
  111. </article>
  112.  
  113. </div>
  114. <?php
  115. if ($icons_right && $icons_right!=0) {
  116. $rand_shapes_right = array_rand($shapes, $icons_right);
  117. $rand_size_right = array_rand($size, $icons_right);
  118. $rand_indent_right = array_rand($indent, $icons_right);
  119. $rand_color_right = array_rand($colors, $icons_right);
  120. $rand_vertical_right = array_rand($indent, $icons_right);
  121. echo '<div class="animations-right">';
  122. if ($icons_right < 4) {
  123. for ($j = 0; $j < $icons_right; $j++) {
  124. 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>';
  125. }
  126. }
  127. else {
  128. switch ($icons_right) {
  129. case '3':
  130. echo '<div class="animations-top">';
  131. for ($j = 0; $j < 2; $j++) {
  132. 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>';
  133. }
  134. echo '</div>';
  135. echo '<div class="animations-middle">';
  136. for ($j = 2; $j < $icons_right; $j++) {
  137. 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>';
  138. }
  139. echo '</div>';
  140. break;
  141. case '4':
  142. echo '<div class="animations-top">';
  143. for ($j = 0; $j < 2; $j++) {
  144. 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>';
  145. }
  146. echo '</div>';
  147. echo '<div class="animations-middle">';
  148. 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>';
  149. echo '</div>';
  150. echo '<div class="animations-bottom">';
  151. 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>';
  152. echo '</div>';
  153. break;
  154. case '5':
  155. echo '<div class="animations-top">';
  156. for ($j = 0; $j < 2; $j++) {
  157. 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>';
  158. }
  159. echo '</div>';
  160. echo '<div class="animations-middle">';
  161. 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>';
  162. echo '</div>';
  163. echo '<div class="animations-bottom">';
  164. for ($j = 3; $j < 5; $j++) {
  165. 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>';
  166. }
  167. echo '</div>';
  168. break;
  169. case '6':
  170. echo '<div class="animations-top">';
  171. 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>';
  172. echo '</div>';
  173. echo '<div class="animations-middle">';
  174. for ($j = 1; $j < 4; $j++) {
  175. 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>';
  176. }
  177. echo '</div>';
  178. echo '<div class="animations-bottom">';
  179. for ($j = 4; $j < 6; $j++) {
  180. 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>';
  181. }
  182. echo '</div>';
  183. break;
  184. case '7':
  185. echo '<div class="animations-top">';
  186. 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>';
  187. echo '</div>';
  188. echo '<div class="animations-middle">';
  189. for ($j = 1; $j < 4; $j++) {
  190. 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>';
  191. }
  192. echo '</div>';
  193. echo '<div class="animations-bottom">';
  194. for ($j = 4; $j < 7; $j++) {
  195. 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>';
  196. }
  197. echo '</div>';
  198. break;
  199. }
  200. }
  201. }
  202. ?>
  203. </section>
  204.  
  205. <?php unset( $_module ); ?>
  206.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement