PluginProbe
Weather Effect / trunk
Weather Effect vtrunk
1.6.1 1.1.9 1.2.0 1.2.10 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 All 90 releases
weather-effect / settings / winter-settings.php

winter-settings.php in Weather Effect trunk, at settings/winter-settings.php

231 lines 8.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2 <div id="winter_weather_effect" class="tab-content">
3 <p class="wep-section-heading"><?php esc_html_e( 'Winter Falls Types', 'weather-effect' ); ?></p>
4 <?php
5 if ( isset( $weather_effect_settings['snow_types'] ) ) {
6 $snow_types = $weather_effect_settings['snow_types'];
7 } else {
8 $snow_types = 'winter_snow';
9 }
10 ?>
11 <p class="switch-field padding_settings">
12 <input class="widefat" id="snow_types1" name="snow_types" type="radio" value="winter_snow"
13 <?php
14 if ( $snow_types == 'winter_snow' ) {
15 echo 'checked=checked';}
16 ?>
17 >
18 <label for="snow_types1"><?php esc_html_e( 'Snows', 'weather-effect' ); ?></label>
19 <input class="widefat" id="snow_types2" name="snow_types" type="radio" value="falling_snow"
20 <?php
21 if ( $snow_types == 'falling_snow' ) {
22 echo 'checked=checked';}
23 ?>
24 >
25 <label for="snow_types2"><?php esc_html_e( 'Snow Flakes', 'weather-effect' ); ?></label>
26 </p>
27
28 <!-- Christmas Snow Falls Settings -->
29 <div id="snow_winter">
30 <p class="bg-title"><?php esc_html_e( '1. Snow Falls Settings', 'weather-effect' ); ?></p>
31 <div class="row">
32 <label class="bg_lower_label"><?php esc_html_e( 'A. Ice Cube Settings', 'weather-effect' ); ?></label>
33 <?php
34 if ( isset( $weather_effect_settings['ice_cube'] ) ) {
35 $ice_cube = $weather_effect_settings['ice_cube'];
36 } else {
37 $ice_cube = 'true';
38 }
39 ?>
40 <p class="switch-field padding_settings">
41 <input class="widefat" id="ice_cube1" name="ice_cube" type="radio" value="true"
42 <?php
43 if ( $ice_cube == 'true' ) {
44 echo 'checked=checked';}
45 ?>
46 >
47 <label for="ice_cube1"><?php esc_html_e( 'Round', 'weather-effect' ); ?></label>
48 <input class="widefat" id="ice_cube2" name="ice_cube" type="radio" value="false"
49 <?php
50 if ( $ice_cube == 'false' ) {
51 echo 'checked=checked';}
52 ?>
53 >
54 <label for="ice_cube2"><?php esc_html_e( 'Square', 'weather-effect' ); ?></label>
55 </p>
56 </div>
57 <div class="row">
58 <div class="col-md-6">
59 <div class="row">
60 <label class="bg_lower_label"><?php esc_html_e( 'B. Minimum Snow Size On page', 'weather-effect' ); ?></label>
61 <?php
62 if ( isset( $weather_effect_settings['min_size_christmas'] ) ) {
63 $min_size_christmas = $weather_effect_settings['min_size_christmas'];
64 } else {
65 $min_size_christmas = 1;
66 }
67 ?>
68 <p class="range-slider padding_settings">
69 <input id="min_size_christmas" name="min_size_christmas" class="range-slider__range" type="range" value="<?php echo esc_attr( $min_size_christmas ); ?>" min="1" step="1" max="5">
70 <span class="range-slider__value">0</span>
71 </p>
72 </div>
73 <div class="row">
74 <label class="bg_lower_label"><?php esc_html_e( 'C. Maximum Snow Size On page', 'weather-effect' ); ?></label>
75 <?php
76 if ( isset( $weather_effect_settings['max_size_christmas'] ) ) {
77 $max_size_christmas = $weather_effect_settings['max_size_christmas'];
78 } else {
79 $max_size_christmas = 5;
80 }
81 ?>
82 <p class="range-slider padding_settings">
83 <input id="max_size_christmas" name="max_size_christmas" class="range-slider__range" type="range" value="<?php echo esc_attr( $max_size_christmas ); ?>" min="10" step="1" max="100">
84 <span class="range-slider__value">0</span>
85 </p>
86 </div>
87 </div>
88 <div class="col-md-6">
89 <div class="row">
90 <label class="bg_lower_label"><?php esc_html_e( 'D. Snow Flakes Count', 'weather-effect' ); ?></label>
91 <?php
92 if ( isset( $weather_effect_settings['flake_christmas'] ) ) {
93 $flake_christmas = $weather_effect_settings['flake_christmas'];
94 } else {
95 $flake_christmas = 5;
96 }
97 ?>
98 <p class="range-slider padding_settings">
99 <input id="flake_christmas" name="flake_christmas" class="range-slider__range" type="range" value="<?php echo esc_attr( $flake_christmas ); ?>" min="1" step="1" max="100">
100 <span class="range-slider__value">0</span>
101 </p>
102 </div>
103 </div>
104 </div>
105 </div>
106
107 <!--Winter Falling Settings -->
108 <div id="snow_falling">
109 <p class="bg-title"><?php esc_html_e( '2. Falling Snows Flakes Settings', 'weather-effect' ); ?></p>
110 <div class="row">
111 <div class="col-md-6">
112 <div class="row">
113 <label class="bg_lower_label"><?php esc_html_e( 'A. Minimum Snows Flakes Size On page', 'weather-effect' ); ?></label>
114 <?php
115 if ( isset( $weather_effect_settings['min_size_falling'] ) ) {
116 $min_size_falling = $weather_effect_settings['min_size_falling'];
117 } else {
118 $min_size_falling = 3;
119 }
120 ?>
121 <p class="range-slider padding_settings">
122 <input id="min_size_falling" name="min_size_falling" class="range-slider__range" type="range" value="<?php echo esc_attr( $min_size_falling ); ?>" min="1" step="1" max="5">
123 <span class="range-slider__value">0</span>
124 </p>
125 </div>
126 <div class="row">
127 <label class="bg_lower_label"><?php esc_html_e( 'B. Maximum Snows Flakes Size On page', 'weather-effect' ); ?></label>
128 <?php
129 if ( isset( $weather_effect_settings['max_size_falling'] ) ) {
130 $max_size_falling = $weather_effect_settings['max_size_falling'];
131 } else {
132 $max_size_falling = 30;
133 }
134 ?>
135 <p class="range-slider padding_settings">
136 <input id="max_size_falling" name="max_size_falling" class="range-slider__range" type="range" value="<?php echo esc_attr( $max_size_falling ); ?>" min="10" step="1" max="50">
137 <span class="range-slider__value">0</span>
138 </p>
139 </div>
140 </div>
141 <div class="col-md-6">
142 <div class="row">
143 <label class="bg_lower_label"><?php esc_html_e( 'C. Snows Flakes Falls Time Duration', 'weather-effect' ); ?></label>
144 <?php
145 if ( isset( $weather_effect_settings['snow_falling_time'] ) ) {
146 $snow_falling_time = $weather_effect_settings['snow_falling_time'];
147 } else {
148 $snow_falling_time = 500;
149 }
150 ?>
151 <p class="range-slider padding_settings">
152 <input id="snow_falling_time" name="snow_falling_time" class="range-slider__range" type="range" value="<?php echo esc_attr( $snow_falling_time ); ?>" min="300" step="10" max="1000">
153 <span class="range-slider__value">0</span>
154 </p>
155 </div>
156 <div class="row">
157 <label class="bg_lower_label"><?php esc_html_e( 'D. Select Flakes Color', 'weather-effect' ); ?></label>
158 <?php
159 if ( isset( $weather_effect_settings['snow_falling_color'] ) ) {
160 $snow_falling_color = $weather_effect_settings['snow_falling_color'];
161 } else {
162 $snow_falling_color = 'FFFFFF';
163 }
164 ?>
165 <input type="text" class="form-control" id="snow_falling_color" name="snow_falling_color" placeholder="choose form color" value="<?php echo esc_html( $snow_falling_color ); ?>">
166 </div>
167 </div>
168 </div>
169 </div>
170 </div>
171 <style>
172 .we-flake {
173 color: <?php echo esc_html( $snow_falling_color ); ?> !important;
174 }
175 </style>
176 <script>
177 <?php if ( $weather_occasion == 'winter_check' ) { ?>
178 <?php if ( $snow_types == 'winter_snow' ) { ?>
179 jQuery(document).ready(function(){
180 jQuery(document).snowfall({deviceorientation : false,
181 round : <?php echo esc_js( $ice_cube ); ?>,
182 minSize: <?php echo esc_js( $min_size_christmas ); ?>,
183 maxSize: <?php echo esc_js( $max_size_christmas ); ?>,
184 flakeCount : <?php echo esc_js( $flake_christmas ); ?>
185 });
186 });
187 <?php } ?>
188
189 <?php if ( $snow_types == 'falling_snow' ) { ?>
190 jQuery(document).ready( function(){
191 jQuery.fn.snow({
192 minSize:<?php echo esc_js( $min_size_falling ); ?>,
193 maxSize:<?php echo esc_js( $max_size_falling ); ?>,
194 newOn:<?php echo esc_js( $snow_falling_time ); ?>,
195 flakeColor:<?php echo wp_json_encode( $snow_falling_color ); ?>
196 });
197 });
198 <?php } ?>
199 <?php } ?>
200
201 (function( jQuery ) {
202 jQuery(function() {
203 jQuery('#snow_falling_color').wpColorPicker();
204 });
205 })( jQuery );
206
207 var snow_types = jQuery('input[name="snow_types"]:checked').val();
208 if(snow_types == "winter_snow") {
209 jQuery('#snow_winter').show();
210 jQuery('#snow_falling').hide();
211 }
212 if(snow_types == "falling_snow") {
213 jQuery('#snow_winter').hide();
214 jQuery('#snow_falling').show();
215 }
216
217 jQuery(document).ready(function() {
218 jQuery('input[name="snow_types"]').change(function(){
219 var snow_types = jQuery('input[name="snow_types"]:checked').val();
220 if(snow_types == "winter_snow") {
221 jQuery('#snow_winter').show();
222 jQuery('#snow_falling').hide();
223 }
224 if(snow_types == "falling_snow") {
225 jQuery('#snow_winter').hide();
226 jQuery('#snow_falling').show();
227 }
228 })
229 });
230 </script>
231