| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 |
// $weather_effect_settings is provided by the calling function scope. |
| 4 |
|
| 5 |
if ( isset( $weather_effect_settings['weather_occasion'] ) ) { |
| 6 |
$weather_occasion = $weather_effect_settings['weather_occasion']; |
| 7 |
} else { |
| 8 |
$weather_occasion = ''; |
| 9 |
} |
| 10 |
|
| 11 |
// ---- Season-agnostic variable reads ---- |
| 12 |
|
| 13 |
// Spring |
| 14 |
$spring_min_size_leaf = isset( $weather_effect_settings['spring_min_size_leaf'] ) ? $weather_effect_settings['spring_min_size_leaf'] : ''; |
| 15 |
$spring_max_size_leaf = isset( $weather_effect_settings['spring_max_size_leaf'] ) ? $weather_effect_settings['spring_max_size_leaf'] : ''; |
| 16 |
$spring_flakes_leaf = isset( $weather_effect_settings['spring_flakes_leaf'] ) ? $weather_effect_settings['spring_flakes_leaf'] : ''; |
| 17 |
$spring_speed = isset( $weather_effect_settings['spring_speed'] ) ? $weather_effect_settings['spring_speed'] : ''; |
| 18 |
|
| 19 |
// Summer |
| 20 |
$summer_min_size_leaf = isset( $weather_effect_settings['summer_min_size_leaf'] ) ? $weather_effect_settings['summer_min_size_leaf'] : ''; |
| 21 |
$summer_max_size_leaf = isset( $weather_effect_settings['summer_max_size_leaf'] ) ? $weather_effect_settings['summer_max_size_leaf'] : ''; |
| 22 |
$summer_flakes_leaf = isset( $weather_effect_settings['summer_flakes_leaf'] ) ? $weather_effect_settings['summer_flakes_leaf'] : ''; |
| 23 |
$summer_speed = isset( $weather_effect_settings['summer_speed'] ) ? $weather_effect_settings['summer_speed'] : ''; |
| 24 |
|
| 25 |
// Halloween |
| 26 |
$halloween_min_size_leaf = isset( $weather_effect_settings['halloween_min_size_leaf'] ) ? $weather_effect_settings['halloween_min_size_leaf'] : ''; |
| 27 |
$halloween_max_size_leaf = isset( $weather_effect_settings['halloween_max_size_leaf'] ) ? $weather_effect_settings['halloween_max_size_leaf'] : ''; |
| 28 |
$halloween_flakes_leaf = isset( $weather_effect_settings['halloween_flakes_leaf'] ) ? $weather_effect_settings['halloween_flakes_leaf'] : ''; |
| 29 |
$halloween_speed = isset( $weather_effect_settings['halloween_speed'] ) ? $weather_effect_settings['halloween_speed'] : ''; |
| 30 |
|
| 31 |
// Rain |
| 32 |
$rain_min_size_leaf = isset( $weather_effect_settings['rain_min_size_leaf'] ) ? $weather_effect_settings['rain_min_size_leaf'] : ''; |
| 33 |
$rain_max_size_leaf = isset( $weather_effect_settings['rain_max_size_leaf'] ) ? $weather_effect_settings['rain_max_size_leaf'] : ''; |
| 34 |
$rain_flakes_leaf = isset( $weather_effect_settings['rain_flakes_leaf'] ) ? $weather_effect_settings['rain_flakes_leaf'] : ''; |
| 35 |
$rain_speed = isset( $weather_effect_settings['rain_speed'] ) ? $weather_effect_settings['rain_speed'] : ''; |
| 36 |
|
| 37 |
// Thanksgiving |
| 38 |
$thanksgiving_min_size_leaf = isset( $weather_effect_settings['thanksgiving_min_size_leaf'] ) ? $weather_effect_settings['thanksgiving_min_size_leaf'] : ''; |
| 39 |
$thanksgiving_max_size_leaf = isset( $weather_effect_settings['thanksgiving_max_size_leaf'] ) ? $weather_effect_settings['thanksgiving_max_size_leaf'] : ''; |
| 40 |
$thanksgiving_flakes_leaf = isset( $weather_effect_settings['thanksgiving_flakes_leaf'] ) ? $weather_effect_settings['thanksgiving_flakes_leaf'] : ''; |
| 41 |
$thanksgiving_speed = isset( $weather_effect_settings['thanksgiving_speed'] ) ? $weather_effect_settings['thanksgiving_speed'] : ''; |
| 42 |
|
| 43 |
// Valentine |
| 44 |
$valentine_min_size_leaf = isset( $weather_effect_settings['valentine_min_size_leaf'] ) ? $weather_effect_settings['valentine_min_size_leaf'] : ''; |
| 45 |
$valentine_max_size_leaf = isset( $weather_effect_settings['valentine_max_size_leaf'] ) ? $weather_effect_settings['valentine_max_size_leaf'] : ''; |
| 46 |
$valentine_flakes_leaf = isset( $weather_effect_settings['valentine_flakes_leaf'] ) ? $weather_effect_settings['valentine_flakes_leaf'] : ''; |
| 47 |
$valentine_speed = isset( $weather_effect_settings['valentine_speed'] ) ? $weather_effect_settings['valentine_speed'] : ''; |
| 48 |
|
| 49 |
// New Year |
| 50 |
$newyear_min_size_leaf = isset( $weather_effect_settings['newyear_min_size_leaf'] ) ? $weather_effect_settings['newyear_min_size_leaf'] : ''; |
| 51 |
$newyear_max_size_leaf = isset( $weather_effect_settings['newyear_max_size_leaf'] ) ? $weather_effect_settings['newyear_max_size_leaf'] : ''; |
| 52 |
$newyear_flakes_leaf = isset( $weather_effect_settings['newyear_flakes_leaf'] ) ? $weather_effect_settings['newyear_flakes_leaf'] : ''; |
| 53 |
$newyear_speed = isset( $weather_effect_settings['newyear_speed'] ) ? $weather_effect_settings['newyear_speed'] : ''; |
| 54 |
?> |
| 55 |
<?php if ( $weather_occasion == 'christmas_check' ) : ?> |
| 56 |
<?php |
| 57 |
$christmas_types = isset( $weather_effect_settings['christmas_types'] ) ? $weather_effect_settings['christmas_types'] : ''; |
| 58 |
$ball = isset( $weather_effect_settings['ball'] ) ? $weather_effect_settings['ball'] : ''; |
| 59 |
$bell = isset( $weather_effect_settings['bell'] ) ? $weather_effect_settings['bell'] : ''; |
| 60 |
$candy = isset( $weather_effect_settings['candy'] ) ? $weather_effect_settings['candy'] : ''; |
| 61 |
$gift = isset( $weather_effect_settings['gift'] ) ? $weather_effect_settings['gift'] : ''; |
| 62 |
$snowman = isset( $weather_effect_settings['snowman'] ) ? $weather_effect_settings['snowman'] : ''; |
| 63 |
$snow_flake = isset( $weather_effect_settings['snow_flake'] ) ? $weather_effect_settings['snow_flake'] : ''; |
| 64 |
$christmas_min_size_leaf = isset( $weather_effect_settings['christmas_min_size_leaf'] ) ? $weather_effect_settings['christmas_min_size_leaf'] : ''; |
| 65 |
$christmas_max_size_leaf = isset( $weather_effect_settings['christmas_max_size_leaf'] ) ? $weather_effect_settings['christmas_max_size_leaf'] : ''; |
| 66 |
$christmas_flakes_leaf = isset( $weather_effect_settings['christmas_flakes_leaf'] ) ? $weather_effect_settings['christmas_flakes_leaf'] : ''; |
| 67 |
$christmas_speed = isset( $weather_effect_settings['christmas_speed'] ) ? $weather_effect_settings['christmas_speed'] : ''; |
| 68 |
$christmas_ball = isset( $weather_effect_settings['christmas_ball'] ) ? $weather_effect_settings['christmas_ball'] : ''; |
| 69 |
$christmas_bell = isset( $weather_effect_settings['christmas_bell'] ) ? $weather_effect_settings['christmas_bell'] : ''; |
| 70 |
$christmas_candy = isset( $weather_effect_settings['christmas_candy'] ) ? $weather_effect_settings['christmas_candy'] : ''; |
| 71 |
$christmas_gift = isset( $weather_effect_settings['christmas_gift'] ) ? $weather_effect_settings['christmas_gift'] : ''; |
| 72 |
$christmas_snowman = isset( $weather_effect_settings['christmas_snowman'] ) ? $weather_effect_settings['christmas_snowman'] : ''; |
| 73 |
$christmas_snow_flake = isset( $weather_effect_settings['christmas_snow_flake'] ) ? $weather_effect_settings['christmas_snow_flake'] : ''; |
| 74 |
$master_round = isset( $weather_effect_settings['master_round'] ) ? $weather_effect_settings['master_round'] : ''; |
| 75 |
$round_type = isset( $weather_effect_settings['round_type'] ) ? $weather_effect_settings['round_type'] : ''; |
| 76 |
$min_size_round = isset( $weather_effect_settings['min_size_round'] ) ? $weather_effect_settings['min_size_round'] : ''; |
| 77 |
$max_size_round = isset( $weather_effect_settings['max_size_round'] ) ? $weather_effect_settings['max_size_round'] : ''; |
| 78 |
$master_shadows = isset( $weather_effect_settings['master_shadows'] ) ? $weather_effect_settings['master_shadows'] : ''; |
| 79 |
$shadow_type = isset( $weather_effect_settings['shadow_type'] ) ? $weather_effect_settings['shadow_type'] : ''; |
| 80 |
$flakes_shadow = isset( $weather_effect_settings['flakes_shadow'] ) ? $weather_effect_settings['flakes_shadow'] : ''; |
| 81 |
$img_base = plugin_dir_url( __FILE__ ) . 'assets/images/christmas/'; |
| 82 |
?> |
| 83 |
<script> |
| 84 |
jQuery(document).ready(function(){ |
| 85 |
<?php if ( $christmas_types == 'snow_effect' ) : ?> |
| 86 |
<?php if ( $ball == 'ball' ) { ?> |
| 87 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $img_base . $christmas_ball . '.png' ); ?>", minSize: <?php echo esc_js( (int) $christmas_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $christmas_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $christmas_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $christmas_speed ); ?> }); |
| 88 |
<?php } ?> |
| 89 |
<?php if ( $bell == 'bell' ) { ?> |
| 90 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $img_base . $christmas_bell . '.png' ); ?>", minSize: <?php echo esc_js( (int) $christmas_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $christmas_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $christmas_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $christmas_speed ); ?> }); |
| 91 |
<?php } ?> |
| 92 |
<?php if ( $candy == 'candy' ) { ?> |
| 93 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $img_base . $christmas_candy . '.png' ); ?>", minSize: <?php echo esc_js( (int) $christmas_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $christmas_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $christmas_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $christmas_speed ); ?> }); |
| 94 |
<?php } ?> |
| 95 |
<?php if ( $gift == 'gift' ) { ?> |
| 96 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $img_base . $christmas_gift . '.png' ); ?>", minSize: <?php echo esc_js( (int) $christmas_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $christmas_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $christmas_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $christmas_speed ); ?> }); |
| 97 |
<?php } ?> |
| 98 |
<?php if ( $snowman == 'snowman' ) { ?> |
| 99 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $img_base . $christmas_snowman . '.png' ); ?>", minSize: <?php echo esc_js( (int) $christmas_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $christmas_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $christmas_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $christmas_speed ); ?> }); |
| 100 |
<?php } ?> |
| 101 |
<?php if ( $snow_flake == 'snow_flake' ) { ?> |
| 102 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $img_base . $christmas_snow_flake . '.png' ); ?>", minSize: <?php echo esc_js( (int) $christmas_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $christmas_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $christmas_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $christmas_speed ); ?> }); |
| 103 |
<?php } ?> |
| 104 |
<?php elseif ( $christmas_types == 'snowfall_master' ) : ?> |
| 105 |
<?php if ( $master_round == 'true' ) { ?> |
| 106 |
jQuery(document).snowfall({ round: <?php echo esc_js( $round_type ); ?>, minSize: <?php echo esc_js( (int) $min_size_round ); ?>, maxSize: <?php echo esc_js( (int) $max_size_round ); ?> }); |
| 107 |
<?php } ?> |
| 108 |
<?php if ( $master_shadows == 'true' ) { ?> |
| 109 |
snowFall.snow(document.body, { shadow: <?php echo esc_js( $shadow_type ); ?>, flakeCount: <?php echo esc_js( (int) $flakes_shadow ); ?> }); |
| 110 |
<?php } ?> |
| 111 |
<?php endif; ?> |
| 112 |
}); |
| 113 |
</script> |
| 114 |
<?php endif; ?> |
| 115 |
|
| 116 |
<?php if ( $weather_occasion == 'winter_check' ) : ?> |
| 117 |
<?php |
| 118 |
$snow_types = isset( $weather_effect_settings['snow_types'] ) ? $weather_effect_settings['snow_types'] : ''; |
| 119 |
$ice_cube = isset( $weather_effect_settings['ice_cube'] ) ? $weather_effect_settings['ice_cube'] : ''; |
| 120 |
$min_size_christmas = isset( $weather_effect_settings['min_size_christmas'] ) ? $weather_effect_settings['min_size_christmas'] : ''; |
| 121 |
$max_size_christmas = isset( $weather_effect_settings['max_size_christmas'] ) ? $weather_effect_settings['max_size_christmas'] : ''; |
| 122 |
$flake_christmas = isset( $weather_effect_settings['flake_christmas'] ) ? $weather_effect_settings['flake_christmas'] : ''; |
| 123 |
$min_size_falling = isset( $weather_effect_settings['min_size_falling'] ) ? $weather_effect_settings['min_size_falling'] : ''; |
| 124 |
$max_size_falling = isset( $weather_effect_settings['max_size_falling'] ) ? $weather_effect_settings['max_size_falling'] : ''; |
| 125 |
$snow_falling_time = isset( $weather_effect_settings['snow_falling_time'] ) ? $weather_effect_settings['snow_falling_time'] : ''; |
| 126 |
$snow_falling_color = isset( $weather_effect_settings['snow_falling_color'] ) ? $weather_effect_settings['snow_falling_color'] : ''; |
| 127 |
?> |
| 128 |
<script> |
| 129 |
<?php if ( $snow_types == 'winter_snow' ) : ?> |
| 130 |
jQuery(document).ready(function(){ |
| 131 |
jQuery(document).snowfall({ deviceorientation: false, round: <?php echo esc_js( $ice_cube ); ?>, minSize: <?php echo esc_js( (int) $min_size_christmas ); ?>, maxSize: <?php echo esc_js( (int) $max_size_christmas ); ?>, flakeCount: <?php echo esc_js( (int) $flake_christmas ); ?> }); |
| 132 |
setTimeout(function(){ jQuery(document).snowfall("clear"); }, 30000); |
| 133 |
}); |
| 134 |
<?php elseif ( $snow_types == 'falling_snow' ) : ?> |
| 135 |
jQuery(document).ready(function(){ |
| 136 |
jQuery.fn.snow({ minSize: <?php echo (int) $min_size_falling; ?>, maxSize: <?php echo (int) $max_size_falling; ?>, newOn: <?php echo (int) $snow_falling_time; ?>, flakeColor: <?php echo wp_json_encode( (strpos($snow_falling_color, '#') === 0) ? $snow_falling_color : '#' . $snow_falling_color ); ?>, durationMillis: 30000 }); |
| 137 |
}); |
| 138 |
<?php endif; ?> |
| 139 |
</script> |
| 140 |
<style>.we-flake{ color: <?php echo esc_html( (strpos($snow_falling_color, '#') === 0) ? $snow_falling_color : '#' . $snow_falling_color ); ?> !important; }</style> |
| 141 |
<?php endif; ?> |
| 142 |
|
| 143 |
<?php if ( $weather_occasion == 'autumn_check' ) : ?> |
| 144 |
<?php |
| 145 |
$leaf = isset( $weather_effect_settings['leaf'] ) ? $weather_effect_settings['leaf'] : ''; |
| 146 |
$autumn_leaf = isset( $weather_effect_settings['autumn_leaf'] ) ? $weather_effect_settings['autumn_leaf'] : ''; |
| 147 |
$autumn_min_size = isset( $weather_effect_settings['autumn_min_size_leaf'] ) ? $weather_effect_settings['autumn_min_size_leaf'] : ''; |
| 148 |
$autumn_max_size = isset( $weather_effect_settings['autumn_max_size_leaf'] ) ? $weather_effect_settings['autumn_max_size_leaf'] : ''; |
| 149 |
$autumn_flakes = isset( $weather_effect_settings['autumn_flakes_leaf'] ) ? $weather_effect_settings['autumn_flakes_leaf'] : ''; |
| 150 |
$autumn_speed = isset( $weather_effect_settings['autumn_speed'] ) ? $weather_effect_settings['autumn_speed'] : ''; |
| 151 |
?> |
| 152 |
<script> |
| 153 |
jQuery(document).ready(function(){ |
| 154 |
<?php if ( $leaf == 'leaf' ) { ?> |
| 155 |
snowFall.snow(document.body, { image: "<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/autumn/' . $autumn_leaf . '.png' ); ?>", minSize: <?php echo esc_js( (int) $autumn_min_size ); ?>, maxSize: <?php echo esc_js( (int) $autumn_max_size ); ?>, flakeCount: <?php echo esc_js( (int) $autumn_flakes ); ?>, maxSpeed: <?php echo esc_js( (int) $autumn_speed ); ?> }); |
| 156 |
<?php } ?> |
| 157 |
}); |
| 158 |
</script> |
| 159 |
<?php endif; ?> |
| 160 |
|
| 161 |
<?php if ( $weather_occasion == 'spring_check' ) : ?> |
| 162 |
<?php |
| 163 |
$leaf_spring = isset( $weather_effect_settings['leaf_spring'] ) ? $weather_effect_settings['leaf_spring'] : ''; |
| 164 |
$spring_leaf = isset( $weather_effect_settings['spring_leaf'] ) ? $weather_effect_settings['spring_leaf'] : ''; |
| 165 |
?> |
| 166 |
<script> |
| 167 |
jQuery(document).ready(function(){ |
| 168 |
<?php if ( $leaf_spring == 'leaf_spring' ) { ?> |
| 169 |
snowFall.snow(document.body, { image: "<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/spring/' . $spring_leaf . '.png' ); ?>", minSize: <?php echo esc_js( (int) $spring_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $spring_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $spring_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $spring_speed ); ?> }); |
| 170 |
<?php } ?> |
| 171 |
}); |
| 172 |
</script> |
| 173 |
<?php endif; ?> |
| 174 |
|
| 175 |
<?php if ( $weather_occasion == 'summer_check' ) : ?> |
| 176 |
<?php |
| 177 |
$drink = isset( $weather_effect_settings['drink'] ) ? $weather_effect_settings['drink'] : ''; |
| 178 |
$summer_drink = isset( $weather_effect_settings['summer_drink'] ) ? $weather_effect_settings['summer_drink'] : ''; |
| 179 |
$sun = isset( $weather_effect_settings['sun'] ) ? $weather_effect_settings['sun'] : ''; |
| 180 |
$summer_sun = isset( $weather_effect_settings['summer_sun'] ) ? $weather_effect_settings['summer_sun'] : ''; |
| 181 |
?> |
| 182 |
<script> |
| 183 |
jQuery(document).ready(function(){ |
| 184 |
<?php if ( $drink == 'drink' ) { ?> |
| 185 |
snowFall.snow(document.body, { image: "<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/summer/' . $summer_drink . '.png' ); ?>", minSize: <?php echo esc_js( (int) $summer_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $summer_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $summer_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $summer_speed ); ?> }); |
| 186 |
<?php } ?> |
| 187 |
<?php if ( $sun == 'sun' ) { ?> |
| 188 |
snowFall.snow(document.body, { image: "<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/summer/' . $summer_sun . '.png' ); ?>", minSize: <?php echo esc_js( (int) $summer_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $summer_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $summer_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $summer_speed ); ?> }); |
| 189 |
<?php } ?> |
| 190 |
}); |
| 191 |
</script> |
| 192 |
<?php endif; ?> |
| 193 |
|
| 194 |
<?php if ( $weather_occasion == 'halloween_check' ) : ?> |
| 195 |
<?php |
| 196 |
$ghost = isset( $weather_effect_settings['ghost'] ) ? $weather_effect_settings['ghost'] : ''; |
| 197 |
$halloween_ghost = isset( $weather_effect_settings['halloween_ghost'] ) ? $weather_effect_settings['halloween_ghost'] : ''; |
| 198 |
$bats = isset( $weather_effect_settings['bats'] ) ? $weather_effect_settings['bats'] : ''; |
| 199 |
$halloween_bats = isset( $weather_effect_settings['halloween_bats'] ) ? $weather_effect_settings['halloween_bats'] : ''; |
| 200 |
$moon = isset( $weather_effect_settings['moon'] ) ? $weather_effect_settings['moon'] : ''; |
| 201 |
$halloween_moon = isset( $weather_effect_settings['halloween_moon'] ) ? $weather_effect_settings['halloween_moon'] : ''; |
| 202 |
$pumpkin = isset( $weather_effect_settings['pumpkin'] ) ? $weather_effect_settings['pumpkin'] : ''; |
| 203 |
$halloween_pumpkin = isset( $weather_effect_settings['halloween_pumpkin'] ) ? $weather_effect_settings['halloween_pumpkin'] : ''; |
| 204 |
$web = isset( $weather_effect_settings['web'] ) ? $weather_effect_settings['web'] : ''; |
| 205 |
$halloween_web = isset( $weather_effect_settings['halloween_web'] ) ? $weather_effect_settings['halloween_web'] : ''; |
| 206 |
$witch = isset( $weather_effect_settings['witch'] ) ? $weather_effect_settings['witch'] : ''; |
| 207 |
$halloween_witch = isset( $weather_effect_settings['halloween_witch'] ) ? $weather_effect_settings['halloween_witch'] : ''; |
| 208 |
$h_img_base = plugin_dir_url( __FILE__ ) . 'assets/images/halloween/'; |
| 209 |
?> |
| 210 |
<script> |
| 211 |
jQuery(document).ready(function(){ |
| 212 |
<?php if ( $ghost == 'ghost' ) { ?> |
| 213 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $h_img_base . $halloween_ghost . '.png' ); ?>", minSize: <?php echo esc_js( (int) $halloween_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $halloween_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $halloween_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $halloween_speed ); ?> }); |
| 214 |
<?php } ?> |
| 215 |
<?php if ( $bats == 'bats' ) { ?> |
| 216 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $h_img_base . $halloween_bats . '.png' ); ?>", minSize: <?php echo esc_js( (int) $halloween_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $halloween_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $halloween_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $halloween_speed ); ?> }); |
| 217 |
<?php } ?> |
| 218 |
<?php if ( $moon == 'moon' ) { ?> |
| 219 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $h_img_base . $halloween_moon . '.png' ); ?>", minSize: <?php echo esc_js( (int) $halloween_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $halloween_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $halloween_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $halloween_speed ); ?> }); |
| 220 |
<?php } ?> |
| 221 |
<?php if ( $pumpkin == 'pumpkin' ) { ?> |
| 222 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $h_img_base . $halloween_pumpkin . '.png' ); ?>", minSize: <?php echo esc_js( (int) $halloween_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $halloween_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $halloween_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $halloween_speed ); ?> }); |
| 223 |
<?php } ?> |
| 224 |
<?php if ( $web == 'web' ) { ?> |
| 225 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $h_img_base . $halloween_web . '.png' ); ?>", minSize: <?php echo esc_js( (int) $halloween_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $halloween_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $halloween_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $halloween_speed ); ?> }); |
| 226 |
<?php } ?> |
| 227 |
<?php if ( $witch == 'witch' ) { ?> |
| 228 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $h_img_base . $halloween_witch . '.png' ); ?>", minSize: <?php echo esc_js( (int) $halloween_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $halloween_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $halloween_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $halloween_speed ); ?> }); |
| 229 |
<?php } ?> |
| 230 |
}); |
| 231 |
</script> |
| 232 |
<?php endif; ?> |
| 233 |
|
| 234 |
<?php if ( $weather_occasion == 'rainy_check' ) : ?> |
| 235 |
<?php |
| 236 |
$umbrella = isset( $weather_effect_settings['umbrella'] ) ? $weather_effect_settings['umbrella'] : ''; |
| 237 |
$rain_umbrella = isset( $weather_effect_settings['rain_umbrella'] ) ? $weather_effect_settings['rain_umbrella'] : ''; |
| 238 |
$drop = isset( $weather_effect_settings['drop'] ) ? $weather_effect_settings['drop'] : ''; |
| 239 |
$rain_drops = isset( $weather_effect_settings['rain_drops'] ) ? $weather_effect_settings['rain_drops'] : ''; |
| 240 |
$cloud = isset( $weather_effect_settings['cloud'] ) ? $weather_effect_settings['cloud'] : ''; |
| 241 |
$rain_cloud = isset( $weather_effect_settings['rain_cloud'] ) ? $weather_effect_settings['rain_cloud'] : ''; |
| 242 |
$r_img_base = plugin_dir_url( __FILE__ ) . 'assets/images/rain/'; |
| 243 |
?> |
| 244 |
<script> |
| 245 |
jQuery(document).ready(function(){ |
| 246 |
<?php if ( $umbrella == 'umbrella' ) { ?> |
| 247 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $r_img_base . $rain_umbrella . '.png' ); ?>", minSize: <?php echo esc_js( (int) $rain_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $rain_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $rain_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $rain_speed ); ?> }); |
| 248 |
<?php } ?> |
| 249 |
<?php if ( $drop == 'drop' ) { ?> |
| 250 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $r_img_base . $rain_drops . '.png' ); ?>", minSize: <?php echo esc_js( (int) $rain_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $rain_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $rain_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $rain_speed ); ?> }); |
| 251 |
<?php } ?> |
| 252 |
<?php if ( $cloud == 'cloud' ) { ?> |
| 253 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $r_img_base . $rain_cloud . '.png' ); ?>", minSize: <?php echo esc_js( (int) $rain_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $rain_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $rain_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $rain_speed ); ?> }); |
| 254 |
<?php } ?> |
| 255 |
}); |
| 256 |
</script> |
| 257 |
<?php endif; ?> |
| 258 |
|
| 259 |
<?php if ( $weather_occasion == 'thanks_giving_check' ) : ?> |
| 260 |
<?php |
| 261 |
$turkey = isset( $weather_effect_settings['turkey'] ) ? $weather_effect_settings['turkey'] : ''; |
| 262 |
$thanksgiving_turkey = isset( $weather_effect_settings['thanksgiving_turkey'] ) ? $weather_effect_settings['thanksgiving_turkey'] : ''; |
| 263 |
?> |
| 264 |
<script> |
| 265 |
jQuery(document).ready(function(){ |
| 266 |
<?php if ( $turkey == 'turkey' ) { ?> |
| 267 |
snowFall.snow(document.body, { image: "<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/thanksgiving/' . $thanksgiving_turkey . '.png' ); ?>", minSize: <?php echo esc_js( (int) $thanksgiving_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $thanksgiving_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $thanksgiving_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $thanksgiving_speed ); ?> }); |
| 268 |
<?php } ?> |
| 269 |
}); |
| 270 |
</script> |
| 271 |
<?php endif; ?> |
| 272 |
|
| 273 |
<?php if ( $weather_occasion == 'valentine_check' ) : ?> |
| 274 |
<?php |
| 275 |
$rose = isset( $weather_effect_settings['rose'] ) ? $weather_effect_settings['rose'] : ''; |
| 276 |
$valentine_rose = isset( $weather_effect_settings['valentine_rose'] ) ? $weather_effect_settings['valentine_rose'] : ''; |
| 277 |
$balloon = isset( $weather_effect_settings['balloon'] ) ? $weather_effect_settings['balloon'] : ''; |
| 278 |
$valentine_balloon = isset( $weather_effect_settings['valentine_balloon'] ) ? $weather_effect_settings['valentine_balloon'] : ''; |
| 279 |
$heart = isset( $weather_effect_settings['heart'] ) ? $weather_effect_settings['heart'] : ''; |
| 280 |
$valentine_heart = isset( $weather_effect_settings['valentine_heart'] ) ? $weather_effect_settings['valentine_heart'] : ''; |
| 281 |
$v_img_base = plugin_dir_url( __FILE__ ) . 'assets/images/valentine/'; |
| 282 |
?> |
| 283 |
<script> |
| 284 |
jQuery(document).ready(function(){ |
| 285 |
<?php if ( $rose == 'rose' ) { ?> |
| 286 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $v_img_base . $valentine_rose . '.png' ); ?>", minSize: <?php echo esc_js( (int) $valentine_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $valentine_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $valentine_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $valentine_speed ); ?> }); |
| 287 |
<?php } ?> |
| 288 |
<?php if ( $balloon == 'balloon' ) { ?> |
| 289 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $v_img_base . $valentine_balloon . '.png' ); ?>", minSize: <?php echo esc_js( (int) $valentine_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $valentine_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $valentine_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $valentine_speed ); ?> }); |
| 290 |
<?php } ?> |
| 291 |
<?php if ( $heart == 'heart' ) { ?> |
| 292 |
snowFall.snow(document.body, { image: "<?php echo esc_url( $v_img_base . $valentine_heart . '.png' ); ?>", minSize: <?php echo esc_js( (int) $valentine_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $valentine_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $valentine_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $valentine_speed ); ?> }); |
| 293 |
<?php } ?> |
| 294 |
}); |
| 295 |
</script> |
| 296 |
<?php endif; ?> |
| 297 |
|
| 298 |
<?php if ( $weather_occasion == 'new_year_check' ) : ?> |
| 299 |
<?php |
| 300 |
$balloon_new = isset( $weather_effect_settings['balloon_new'] ) ? $weather_effect_settings['balloon_new'] : ''; |
| 301 |
$newyear_balloon = isset( $weather_effect_settings['newyear_balloon'] ) ? $weather_effect_settings['newyear_balloon'] : ''; |
| 302 |
$sticker = isset( $weather_effect_settings['sticker'] ) ? $weather_effect_settings['sticker'] : ''; |
| 303 |
$new_year_sticker = isset( $weather_effect_settings['new_year_sticker'] ) ? $weather_effect_settings['new_year_sticker'] : ''; |
| 304 |
?> |
| 305 |
<script> |
| 306 |
jQuery(document).ready(function(){ |
| 307 |
<?php if ( $balloon_new == 'balloon_new' ) { ?> |
| 308 |
snowFall.snow(document.body, { image: "<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/newyear/' . $newyear_balloon . '.png' ); ?>", minSize: <?php echo esc_js( (int) $newyear_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $newyear_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $newyear_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $newyear_speed ); ?> }); |
| 309 |
<?php } ?> |
| 310 |
<?php if ( $sticker == 'sticker' ) { ?> |
| 311 |
snowFall.snow(document.body, { image: "<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'assets/images/newyear/' . $new_year_sticker . '.png' ); ?>", minSize: <?php echo esc_js( (int) $newyear_min_size_leaf ); ?>, maxSize: <?php echo esc_js( (int) $newyear_max_size_leaf ); ?>, flakeCount: <?php echo esc_js( (int) $newyear_flakes_leaf ); ?>, maxSpeed: <?php echo esc_js( (int) $newyear_speed ); ?> }); |
| 312 |
<?php } ?> |
| 313 |
}); |
| 314 |
</script> |
| 315 |
<?php endif; ?> |
| 316 |
|