Guest User

Untitled

a guest
Aug 27th, 2021
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.57 KB | None | 0 0
  1. <?php
  2.  
  3. if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
  4.  
  5. /**
  6. * IMPORTANT:
  7. * ==========
  8. *
  9. * class vevent hentry has been removed with 4.5.5. https://github.com/KriesiMedia/wp-themes/issues/2157
  10. * If we do not encounter any problems related CSS can also be removed later.
  11. *
  12. * @added_by guenter
  13. */
  14.  
  15. //add color styles
  16. if( ! function_exists( 'avia_events_dynamic_css' ) )
  17. {
  18. add_filter( 'avia_dynamic_css_output', 'avia_events_dynamic_css', 10, 2 );
  19.  
  20. function avia_events_dynamic_css( $output, $color_set )
  21. {
  22. /*color sets*/
  23. foreach( $color_set as $key => $colors ) // iterates over the color sets: usually $key is either: header_color, main_color, footer_color, socket_color
  24. {
  25. $key = '.' . $key;
  26. extract( $colors );
  27.  
  28. // elements that will only appear in the main content area
  29. if( $key == '.main_color' )
  30. {
  31. $constant_font = avia_backend_calc_preceived_brightness( $primary, 230 ) ? '#ffffff' : $bg;
  32. $button_border = avia_backend_calculate_similar_color( $primary, 'darker', 2 );
  33. $button_border2 = avia_backend_calculate_similar_color( $secondary, 'darker', 2 );
  34. $bg3 = avia_backend_calculate_similar_color( $bg2, 'darker', 1 );
  35.  
  36. $output .= "
  37.  
  38. $key .tribe-events-single ul.tribe-related-events li, $key .tribe-week-grid-block div, $key .tribe-events-grid .tribe-grid-content-wrap .column,
  39. $key .tribe-events-loop .tribe-events-event-meta, #top $key .tribe-events-list-event-title.entry-title, #top $key .tribe-events-list-event-title,
  40. $key #tribe-events-content table.tribe-events-calendar, $key #tribe-events-content .tribe-events-calendar td, body .datepicker.dropdown-menu,
  41. #top $key .tribe-events-tooltip, $key .recurring-info-tooltip, $key .vevent.tribe-events-photo-event .tribe-events-photo-event-wrap,
  42. body .datepicker table, body .datepicker table td, body .datepicker table th, #top #tribe-mobile-container .hentry.vevent,
  43. $key .tribe-events-venue .tribe-events-venue-meta, $key .tribe-mini-calendar-dayofweek, $key .tribe-mini-calendar td, $key .tribe-mini-calendar th
  44. {
  45. border-color: $border;
  46. }
  47.  
  48. .single-tribe_events $key #tribe-events-content .tribe-events-event-meta dt, $key .tribe-events-list-separator-month,
  49. $key .tribe-grid-allday .hentry.vevent>div, $key .tribe-grid-body div[id*='tribe-events-event-'] .hentry.vevent,
  50. #top.tribe-theme-enfold.single-tribe_events .tribe-events-single-event-title,
  51. .tribe-events-related-events-title,
  52. .tribe-events-single ul.tribe-related-events li .tribe-related-events-title,
  53. .tribe-common--breakpoint-medium.tribe-common .tribe-common-h4--min-medium, .tribe-events-single ul.tribe-related-events li,
  54. .tribe-events-meta-group .tribe-events-single-section-title, #top.tribe-theme-enfold.single-tribe_events .tribe-events-schedule h3
  55. {color:$heading;}
  56.  
  57. #top $key .tribe-week-grid-hours{color: $color;}
  58.  
  59. #top .tribe-events-content p,
  60. .tribe-events-content ol,
  61. .tribe-events-content p,
  62. .tribe-events-content ul,
  63. .tribe-common .tribe-common-b2 {
  64. color: $color;
  65. }
  66.  
  67. $key #tribe-events-pg-template .tribe-events-notices, $key #tribe-events-pg-template .tribe-events-notices strong{
  68. background: $primary;
  69. color: $constant_font;
  70. }
  71.  
  72. $key #tribe-events-bar, $key #tribe-events-bar:before, $key #tribe-events-bar:after, $key .tribe-grid-allday .hentry.vevent>div, $key .tribe-grid-body div[id*='tribe-events-event-'] .hentry.vevent, $key .tribe-mini-calendar-dayofweek, $key .tribe-mini-calendar-event .list-date{
  73. background: $bg3;
  74. border-color: $border;
  75. }
  76.  
  77. body .datepicker.dropdown-menu,
  78. #top $key #tribe-bar-form input[type='text'], $key .tribe-mini-calendar td, $key .tribe-mini-calendar-event .list-date .list-dayname,
  79. #top $key .tribe-events-tooltip, $key .recurring-info-tooltip, $key .tribe-events-tooltip .tribe-events-arrow
  80. {
  81. background: $bg;
  82. color: $meta;
  83. }
  84.  
  85. body .datepicker-dropdown:after{
  86. border-bottom-color:$bg;
  87. }
  88.  
  89. $key .vevent.tribe-events-photo-event .tribe-events-photo-event-wrap, $key .av-tribe-events-content-wrap, $key #tribe-events .av-single-event-meta-bar-inner{
  90. background: $bg2;
  91. }
  92.  
  93. $key .tribe-grid-allday, $key .tribe-week-grid-hours, $key .tribe-events-distance,
  94. body .datepicker table tr td.day, .datepicker table tr td span, #top #wrap_all $key td.tribe-events-othermonth,
  95. $key .tribe-events-calendar td.tribe-events-past div[id*='tribe-events-daynum-'], $key .tribe-events-calendar td.tribe-events-past div[id*='tribe-events-daynum-']>a
  96. {
  97. background: $bg2;
  98. color: $meta;
  99. }
  100.  
  101. $key .tribe-bar-views-inner, $key #tribe-bar-views .tribe-bar-views-list .tribe-bar-views-option a,
  102. $key .tribe-events-calendar div[id*='tribe-events-daynum-'], $key .tribe-events-calendar div[id*='tribe-events-daynum-'] a
  103. {
  104. background:$bg3;
  105. color: $color;
  106. }
  107.  
  108. $key #tribe-events-content .tribe-events-calendar td, $key .tribe-week-grid-block,
  109. $key #tribe-bar-views .tribe-bar-views-list .tribe-bar-views-option a:hover{
  110. background:$bg;
  111. }
  112.  
  113. .single-tribe_events $key .tribe-events-cost, $key #tribe-events-content .tribe-events-calendar td,
  114. $key .tribe-events-adv-list-widget .tribe-events-event-cost, #top #wrap_all $key .tribe-events-event-meta a,
  115. $key .tribe-events-schedule .recurringinfo a, $key .tribe-related-event-info .recurringinfo a,
  116. #top .tribe-events-pro .tribe-events-pro-venue__meta-address-directions-link,
  117. #top .tribe-events-pro .tribe-events-pro-venue__meta-website-link,
  118. #top .tribe-events-pro .tribe-events-pro-organizer__meta-email-link,
  119. #top .tribe-events-pro .tribe-events-pro-organizer__meta-website-link{
  120. color: $primary;
  121. }
  122.  
  123. body .datepicker table tr td span:hover,
  124. body .datepicker table tr td.day:hover, body .datepicker table tr td.day.focused,
  125. #top #wrap_all $key .tribe-events-button:hover, $key .tribe-events .tribe-events-c-ical__link:hover {
  126. background-color: $secondary;
  127. color:$constant_font;
  128. border-color:$button_border2;
  129. }
  130.  
  131. $key .tribe-mini-calendar .tribe-events-has-events div[id*='daynum-'] a:before, $key .tribe-venue-widget-venue-name,
  132. $key .tribe-mini-calendar-nav span,
  133. body .datepicker table tr td.active.active, body .datepicker table tr td span.active.active,
  134. body .datepicker table tr td.active.active:hover, body .datepicker table tr td span.active.active:hover,
  135. body .datepicker thead tr:first-child th:hover, body .datepicker tfoot tr th:hover,
  136. #top $key .tribe-events-tooltip h3, $key div.tribe-countdown-text, $key .tribe-mini-calendar-nav td,
  137. $key .tribe-events-calendar th, $key .tribe-events-grid .tribe-grid-header , $key .tribe-events-grid .tribe-grid-header .column,
  138. #top #wrap_all $key .tribe-events-button, $key .tribe-events-list .tribe-events-event-cost span,
  139. $key .tribe-events-calendar td.tribe-events-present div[id*='tribe-events-daynum-'],
  140. $key .tribe-events-calendar td.tribe-events-present div[id*='tribe-events-daynum-']>a,
  141. $key .tribe-grid-allday .hentry.vevent>div, $key .tribe-grid-body div[id*='tribe-events-event-'] .hentry.vevent,
  142. $key .tribe-mini-calendar .tribe-events-has-events:hover a, $key .tribe-mini-calendar .tribe-events-has-events:hover a:hover,
  143. $key .tribe-mini-calendar .tribe-events-has-events.tribe-mini-calendar-today a, $key .tribe-events .tribe-events-c-ical__link
  144. {
  145. background-color: $primary;
  146. color:$constant_font;
  147. border-color:$button_border;
  148. }
  149.  
  150. $key #tribe-events .time-details, $key .single-tribe_events .tribe-events-schedule, .single-tribe_events $key .tribe-events-schedule h3,
  151. .single-tribe_events $key .tribe-events-event-meta dd, $key .recurringinfo, $key .tribe-mini-calendar-no-event, $key .tribe-mini-calendar-dayofweek,
  152. $key .tribe-mini-calendar-event .list-date .list-daynumber, $key .av-upcoming-event-data
  153. {
  154. color: $meta;
  155. }
  156.  
  157. $key .tribe-mini-calendar .tribe-events-has-events div[id*='daynum-']:hover a:before{background-color: $constant_font;}
  158.  
  159. .datepicker .datepicker-switch{color:$heading !important;}
  160.  
  161.  
  162. @media only screen and (max-width: 768px) {
  163. $key .tribe-events-sub-nav li a{
  164. background-color: $primary;
  165. color:$constant_font;
  166. }
  167.  
  168.  
  169. #top $key #tribe-events-content .tribe-events-calendar td, $key .tribe-events-calendar td div[id*='tribe-events-daynum-'], $key .tribe-events-calendar td div[id*='tribe-events-daynum-']>a{background:$bg;}
  170. #top $key #tribe-events-content td.tribe-events-past, #top $key #tribe-events-content td.tribe-events-othermonth{background:$bg2;}
  171. #top $key #tribe-events-content .tribe-events-calendar td.tribe-events-present{background:$primary;}
  172. #top $key #tribe-events-content td.tribe-events-has-events, #top $key #tribe-events-content td.tribe-events-has-events div[id*='tribe-events-daynum-'],
  173. #top $key #tribe-events-content td.tribe-events-has-events div[id*='tribe-events-daynum-']>a, $key .tribe-mobile-day-date
  174. {background:$primary; color: $constant_font; }
  175.  
  176. #top $key .tribe-events-calendar .tribe-events-has-events:after{background: $constant_font; }
  177.  
  178.  
  179.  
  180. }
  181.  
  182. @media only screen and (max-width: 768px) {
  183.  
  184. $key .tribe-events-loop .tribe-events-event-meta, $key .tribe-events-list .tribe-events-venue-details{border-color: $border; background-color:$bg2; }
  185.  
  186. }
  187.  
  188.  
  189. ";
  190. }
  191.  
  192. $fallback_fonts = array(
  193. "'HelveticaNeue'",
  194. "'Helvetica Neue'",
  195. "'Helvetica-Neue'",
  196. 'Helvetica',
  197. 'Arial',
  198. 'sans-serif'
  199. );
  200. $heading_font = avia_get_option( 'google_webfont' ) . ',' . implode( ',', $fallback_fonts );
  201. $content_font = avia_get_option( 'default_font' ) . ',' . implode( ',', $fallback_fonts );
  202. $content_font_size = avia_get_option( 'color-default_font_size' );
  203.  
  204. $output .= "
  205. #top.tribe-theme-enfold.single-tribe_events .tribe-events-single-event-title,
  206. .tribe-events-related-events-title,
  207. .tribe-events-single ul.tribe-related-events li .tribe-related-events-title,
  208. .tribe-common--breakpoint-medium.tribe-common .tribe-common-h4--min-medium {
  209. font-family: $heading_font;
  210. }
  211.  
  212. .tribe-events-content ol,
  213. .tribe-events-content p,
  214. .tribe-events-content ul,
  215. .tribe-common .tribe-common-b2{
  216. font-family: $content_font;
  217. font-size: $content_font_size;
  218. }
  219. ";
  220.  
  221. //unset all vars with the help of variable vars :)
  222. foreach( $colors as $key => $val )
  223. {
  224. unset( $$key );
  225. }
  226.  
  227. }
  228.  
  229. return $output;
  230. }
  231. }
  232.  
Advertisement
Add Comment
Please, Sign In to add comment