Elementor Addon Elements - Version 1.1

Version Description

  • New Widget: After/Before Image Compare
  • New Feature: Particles Background on Sections (Requires Elementor 2.1 or higher)
  • Enhancement: Added dynamic content support for Text Separator & FlipBox
  • Bug Fix: Issue with flipbox on iPhones.
Download this release

Release Info

Developer webtechstreet
Plugin Icon 128x128 Elementor Addon Elements
Version 1.1
Comparing to
See all releases

Version 1.1

assets/aep.png ADDED
Binary file
assets/css/eae.css ADDED
@@ -0,0 +1,791 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-widget-wts-textseparator .elementor-widget-container{
2
+ overflow:hidden;
3
+ }
4
+ .wts-eae-textseparator{
5
+ align-items: center;
6
+ display: flex;
7
+ flex-flow: row nowrap; margin:auto;
8
+ }
9
+
10
+ .eae-separator-icon-inner i {
11
+ height: 1em;
12
+ width: 1em; text-align:center;
13
+ }
14
+
15
+ .wts-eae-textseparator .eae-sep-holder {
16
+ flex: 1 1 auto;
17
+ height: 1px;
18
+ min-width: 10%;
19
+ position: relative;
20
+ }
21
+
22
+ .wts-eae-textseparator .eae-sep-holder .eae-sep-lines{
23
+ border-top-width: 1px;
24
+ display: block;
25
+ height: 1px;
26
+ position: relative;
27
+ top: 1px;
28
+ width: 100%;
29
+ }
30
+
31
+ .eae-separator-title{
32
+ margin:0;
33
+ -moz-box-flex: 0;
34
+ flex: 0 1 auto;
35
+ line-height: 1em;
36
+ margin: 0;
37
+ overflow-wrap: break-word;
38
+ }
39
+
40
+ .sep-align-right .sep-right{
41
+ display: none;
42
+ }
43
+
44
+ .sep-align-left .sep-left{
45
+ display: none;
46
+ }
47
+
48
+ .eae-icon-view-stacked i{ color:#FFF; }
49
+ .eae-icon-view-framed .eae-separator-icon-inner{ border:1px solid; }
50
+ .eae-icon-shape-circle .eae-separator-icon-inner{ border-radius:50%; }
51
+ .eae-separator-icon-wrapper, .eae-separator-title{ margin:0 5px !important; }
52
+ .eae-separator-icon-inner{ line-height: 1; }
53
+
54
+
55
+ /**
56
+ Price Table Css
57
+ **/
58
+ .wts-price-box-wrapper .eae-pt-heading, .wts-price-box-wrapper .eae-pt-sub-heading{ margin:5px 0; text-align: center; }
59
+ .plan-price-shape {
60
+ display: table;
61
+ height: 6em;
62
+ margin: auto;
63
+ width: 6em;
64
+ }
65
+
66
+ .eae-pt-price-box-shape-circle .plan-price-shape, .eae-pt-price-box-shape-square .plan-price-shape{ border: 1px solid; }
67
+ .eae-pt-price-box-shape-circle .plan-price-shape{ border-radius:50%; }
68
+ .plan-price-block{ padding:10px 0; }
69
+ .plan-price-shape-inner {
70
+ display: table-cell;
71
+ vertical-align: middle; padding: 10px;
72
+ }
73
+ .plan-price-shape-inner > span {
74
+ display: block;
75
+ font-size: 1em; text-align:center;
76
+ }
77
+
78
+ .eae-pt-feature-list {
79
+ list-style: outside none none;
80
+ text-align: center; margin:10px 0;
81
+ }
82
+ .eae-pt-button-wrapper > a{ text-align:center; display:inline-block; }
83
+ .eae-pt-button-wrapper{ text-align: center;}
84
+
85
+ .wts-price-box-wrapper .heading-wrapper, .wts-price-box-wrapper .plan-features-wrapper{ padding:10px 5px;}
86
+ .eae-pt-button-wrapper{ padding:15px 0; }
87
+ .eae-pt-button-wrapper a{ padding:5px 15px; border-radius:3px; }
88
+ .eae-pt-align-icon-right{ float:right; }
89
+ .strike-feature{ text-decoration: line-through; }
90
+
91
+ /**
92
+ Flip Box CSS
93
+ **/
94
+ .eae-flip-box{
95
+ width: 100%;
96
+ text-align: center;
97
+ }
98
+ .eae-flip-box-wrapper{
99
+ display: inline-block;
100
+ width: 100%;
101
+ }
102
+ .eae-flip-box-inner{ width:100%; height:200px; position:relative;
103
+ -webkit-transform-style: preserve-3d;
104
+ -moz-transform-style: preserve-3d;
105
+ -ms-transform-style: preserve-3d;
106
+ transform-style: preserve-3d;
107
+ }
108
+
109
+ .eae-flip-box-inner .eae-flip-box-front, .eae-flip-box-inner .eae-flip-box-back{
110
+ width:100%; height:100%; position: absolute; top:0; left:0; text-align:center; padding: 10px;
111
+ -webkit-backface-visibility: hidden;
112
+ -moz-backface-visibility: hidden;
113
+ -ms-backface-visibility: hidden;
114
+ backface-visibility: hidden;
115
+
116
+ -webkit-transition: all 0.6s ease 0s;
117
+ -moz-transition: all 0.6s ease 0s;
118
+ -ms-transition: all 0.6s ease 0s;
119
+ -o-transition: all 0.6s ease 0s;
120
+ transition: all 0.6s ease 0s;
121
+ }
122
+ .eae-flip-box-front {
123
+ z-index: 2;
124
+ }
125
+ .eae-flip-box-back {
126
+ z-index: 1;
127
+ }
128
+
129
+ .eae-fb-animate-vertical .eae-flip-box-inner .eae-flip-box-front{ -webkit-transform:perspective(1000px) rotateX(0deg); -ms-transform:perspective(1000px) rotateX(0deg); transform:perspective(1000px) rotateX(0deg); }
130
+ .eae-fb-animate-vertical .eae-flip-box-inner .eae-flip-box-back{ -webkit-transform:perspective(1000px) rotateX(180deg); transform:perspective(1000px) rotateX(180deg); -ms-transform:perspective(1000px) rotateX(180deg); }
131
+ .eae-fb-animate-vertical .eae-flip-box-inner:hover .eae-flip-box-front{ -webkit-transform:perspective(1000px) rotateX(180deg); transform:perspective(1000px) rotateX(180deg); -ms-transform:perspective(1000px) rotateX(180deg); }
132
+ .eae-fb-animate-vertical .eae-flip-box-inner:hover .eae-flip-box-back{ -webkit-transform:perspective(1000px) rotateX(0deg); transform:perspective(1000px) rotateX(0deg); -ms-transform:perspective(1000px) rotateX(0deg); }
133
+
134
+
135
+ .eae-fb-animate-horizontal .eae-flip-box-inner .eae-flip-box-front{ -webkit-transform:perspective(1000px) rotateY(0deg); transform:perspective(1000px) rotateY(0deg); -ms-transform:perspective(1000px) rotateY(0deg); }
136
+ .eae-fb-animate-horizontal .eae-flip-box-inner .eae-flip-box-back{ -webkit-transform:perspective(1000px) rotateY(180deg); transform:perspective(1000px) rotateY(180deg); -ms-transform:perspective(1000px) rotateY(180deg); }
137
+ .eae-fb-animate-horizontal .eae-flip-box-inner:hover .eae-flip-box-front{ -webkit-transform:perspective(1000px) rotateY(180deg); transform:perspective(1000px) rotateY(180deg); -ms-transform:perspective(1000px) rotateY(180deg); }
138
+ .eae-fb-animate-horizontal .eae-flip-box-inner:hover .eae-flip-box-back{ -webkit-transform:perspective(1000px) rotateY(0deg); transform:perspective(1000px) rotateY(0deg); -ms-transform:perspective(1000px) rotateY(0deg); }
139
+
140
+ .eae-fb-animate-fade .eae-flip-box-inner .eae-flip-box-front{opacity:1;}
141
+ .eae-fb-animate-fade .eae-flip-box-inner .eae-flip-box-back{opacity:0;}
142
+ .eae-fb-animate-fade .eae-flip-box-inner:hover .eae-flip-box-front{opacity:0;}
143
+ .eae-fb-animate-fade .eae-flip-box-inner:hover .eae-flip-box-back{opacity:1;}
144
+
145
+
146
+ .eae-flip-box-wrapper:hover .eae-flip-box-back,
147
+ .eae-flip-box-wrapper:focus .eae-flip-box-back {
148
+ z-index: 2;
149
+ }
150
+ .eae-flip-box-wrapper:hover .eae-flip-box-front,
151
+ .eae-flip-box-wrapper:focus .eae-flip-box-front {
152
+ z-index: 1;
153
+ }
154
+ .fade .eae-flip-box-wrapper .eae-flip-box-front {
155
+ opacity: 1;
156
+ transition: 1s;
157
+ }
158
+ .fade .eae-flip-box-wrapper .eae-flip-box-back {
159
+ opacity: 0;
160
+ transition: 1s;
161
+ }
162
+ .fade .eae-flip-box-wrapper:hover .eae-flip-box-front,
163
+ .fade .eae-flip-box-wrapper:focus .eae-flip-box-front {
164
+ opacity: 0;
165
+ }
166
+ .fade .eae-flip-box-wrapper:hover .eae-flip-box-back,
167
+ .fade .eae-flip-box-wrapper:focus .eae-flip-box-back {
168
+ opacity: 1;
169
+ }
170
+
171
+ .eae-fb-animate-flip .eae-flip-box-wrapper {
172
+ perspective: 800px;
173
+ }
174
+ .eae-fb-animate-flip .eae-flip-box-inner{
175
+ transform-style: preserve-3d;
176
+ transform: rotateX(0) rotateY(0) rotateZ(0);
177
+ transition: 1s;
178
+ }
179
+ .eae-fb-animate-flip .eae-flip-box-front {
180
+ transform: translate3d(0,0,1px);
181
+ }
182
+ .eae-fb-animate-flip .eae-flip-box-back {
183
+ transform: rotateY(180deg) translate3d(0,0,0);
184
+ }
185
+ .eae-fb-animate-flip .eae-flip-box-wrapper:hover .eae-flip-box-inner,
186
+ .eae-fb-animate-flip .eae-flip-box-wrapper:focus .eae-flip-box-inner{
187
+ transform: rotateY(180deg);
188
+ }
189
+ .up .eae-flip-box-front {
190
+ transform: translate3d(0,0,1px);
191
+ }
192
+ .up .eae-flip-box-back {
193
+ transform: rotateX(180deg) translate3d(0,0,0);
194
+ }
195
+ .up .eae-flip-box-wrapper:hover .eae-flip-box-inner,
196
+ .up .eae-flip-box-wrapper:focus .eae-flip-box-inner{
197
+ transform: rotateX(180deg);
198
+ }
199
+
200
+ .box .eae-flip-box-front {
201
+ transform: translate3d(0,0,100px) scale(0.85,0.85);
202
+ }
203
+ .box .eae-flip-box-back {
204
+ transform: rotateY(180deg) translate3d(0,0,100px) scale(0.85,0.85);
205
+ }
206
+ .box.up .eae-flip-box-back {
207
+ transform: rotateX(180deg) translate3d(0,0,100px) scale(0.85,0.85);
208
+ }
209
+
210
+ .hideback .eae-flip-box-front, .hideback .eae-flip-box-back {
211
+ backface-visibility: hidden;
212
+ }
213
+ .eae-fb-animate-nananana .eae-flip-box-wrapper {
214
+
215
+
216
+ }
217
+ .eae-fb-animate-nananana .eae-flip-box-wrapper:hover .eae-flip-box-front,
218
+ .eae-fb-animate-nananana .eae-flip-box-wrapper:focus .eae-flip-box-front {
219
+ z-index: 10;
220
+ animation: batman 1s 2 alternate linear;
221
+ }
222
+
223
+
224
+ /* Cube Animation */
225
+
226
+ .eae-fb-animate-flipcard .eae-flip-box-front, .eae-fb-animate-flipcard .eae-flip-box-back{
227
+ transition: transform 0.4s ease;
228
+ transform-origin: center center -150px;
229
+ -webkit-transform-origin: center center -150px;
230
+ }
231
+
232
+ /* top to down */
233
+
234
+ .flipcard-rotate-top-down .eae-flip-box-front {
235
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
236
+ }
237
+ .flipcard-rotate-top-down .eae-flip-box-back {
238
+ transform: perspective(0px) rotateX(90deg) rotateY(0deg) rotateZ(0deg);
239
+ }
240
+ .eae-fb-animate-flipcard.flipcard-rotate-top-down .eae-flip-box-wrapper:hover .eae-flip-box-front {
241
+ transform: perspective(0px) rotateX(-90deg) rotateY(0) rotateZ(0deg);
242
+ }
243
+ .eae-fb-animate-flipcard.flipcard-rotate-top-down .eae-flip-box-wrapper:hover .eae-flip-box-back {
244
+ z-index: 99999;
245
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0);
246
+ }
247
+
248
+
249
+ /* down to top */
250
+ .flipcard-rotate-down-top .eae-flip-box-front {
251
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
252
+ }
253
+ .flipcard-rotate-down-top .eae-flip-box-back {
254
+ transform: perspective(0px) rotateX(-90deg) rotateY(0deg) rotateZ(0deg);
255
+ }
256
+ .eae-fb-animate-flipcard.flipcard-rotate-down-top .eae-flip-box-wrapper:hover .eae-flip-box-front {
257
+ transform: perspective(0px) rotateX(90deg) rotateY(0) rotateZ(0deg);
258
+ }
259
+ .eae-fb-animate-flipcard.flipcard-rotate-down-top .eae-flip-box-wrapper:hover .eae-flip-box-back {
260
+ z-index: 99999;
261
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
262
+ }
263
+
264
+ /* left to right */
265
+
266
+ .flipcard-rotate-left-right .eae-flip-box-front {
267
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
268
+ }
269
+ .flipcard-rotate-left-right .eae-flip-box-back {
270
+ transform: perspective(0px) rotateX(0deg) rotateY(-90deg) rotateZ(0deg);
271
+ }
272
+ .eae-fb-animate-flipcard.flipcard-rotate-left-right .eae-flip-box-wrapper:hover .eae-flip-box-front {
273
+ transform: perspective(0px) rotateX(0deg) rotateY(90deg) rotateZ(0deg);
274
+ }
275
+ .eae-fb-animate-flipcard.flipcard-rotate-left-right .eae-flip-box-wrapper:hover .eae-flip-box-back {
276
+ z-index: 99999;
277
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
278
+ }
279
+
280
+ /* right to left */
281
+
282
+ .flipcard-rotate-right-left .eae-flip-box-front {
283
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
284
+ }
285
+ .flipcard-rotate-right-left .eae-flip-box-back {
286
+ transform: perspective(0px) rotateX(0deg) rotateY(90deg) rotateZ(0deg);
287
+ }
288
+ .eae-fb-animate-flipcard.flipcard-rotate-right-left .eae-flip-box-wrapper:hover .eae-flip-box-front {
289
+ transform: perspective(0px) rotateX(0deg) rotateY(-90deg) rotateZ(0deg);
290
+ }
291
+ .eae-fb-animate-flipcard.flipcard-rotate-right-left .eae-flip-box-wrapper:hover .eae-flip-box-back {
292
+ z-index: 99999;
293
+ transform: perspective(0px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
294
+ }
295
+
296
+ @keyframes batman {
297
+ 0% { transform: scale(1,1) rotateZ(0); }
298
+ 100% {
299
+ transform: scale(0,0) rotateZ(720deg);
300
+ opacity: 0;
301
+ }
302
+ }
303
+
304
+
305
+ .eae-flip-box-front i, .eae-flip-box-back i{ font-size:32px; height:1em; width:1em; }
306
+ .eae-fb-icon-view-framed{ border:1px solid #92BE43; }
307
+ .eae-fb-icon-shape-circle{ border-radius:50%; }
308
+ .eae-flip-box-wrapper .icon-wrapper{ display:inline-block; padding:10px; line-height: 1; }
309
+
310
+ .eae-flip-box-wrapper .front-icon-title, .eae-flip-box-wrapper .back-icon-title{ margin:10px auto; color:#FFF; }
311
+
312
+ .eae-flip-box-wrapper .flipbox-content { display: block; position: relative; top: 50%; transform: translateY(-50%); -ms-transform: translateY(-50%) }
313
+ .flipbox-content p{ margin-bottom: 10px; }
314
+ .eae-fb-button{ display:inline-block; padding: 5px 10px; }
315
+
316
+ .eae-flip-box-front{ background:#A0CE4E; }
317
+ .eae-flip-box-back{ background:#73B9DC; }
318
+
319
+ @media only screen and (max-width: 768px) {
320
+
321
+ .flipbox-content, .eae-flip-box-front, .eae-flip-box-back{
322
+ cursor:pointer;
323
+ overflow: visible !important;
324
+ transform-style: preserve-3d;
325
+ -webkit-transform-style: preserve-3d;
326
+ }
327
+ }
328
+ /**
329
+ Shape Separator
330
+ **/
331
+ .elementor-widget-wts-shape-separator svg{ display: block; }
332
+
333
+ /**
334
+ Post List
335
+ **/
336
+ .wts-eae-pl-wrapper ul{
337
+ margin:0;
338
+ }
339
+ .wts-eae-pl-wrapper ul li{
340
+ list-style: none;
341
+ overflow: hidden; margin-bottom:10px;
342
+ }
343
+ .eae-pl-img-align-none .eae-pl-image-wrapper a{ text-align: center; }
344
+ .eae-pl-title{ margin:0; }
345
+ .eae-pl-title a{ display:block; }
346
+
347
+ .eae-pl-readmore a{ display:inline-block;
348
+ border-radius: 2px;
349
+ color: #fff;
350
+ padding: 4px 8px;
351
+ }
352
+
353
+ /**
354
+ Animated Text Styles
355
+ **/
356
+ /* --------------------------------
357
+ Primary style
358
+ -------------------------------- */
359
+
360
+ .eae-at-animation-text-wrapper {
361
+ display: inline-block;
362
+ position: relative;
363
+ text-align: left;
364
+ }
365
+ .eae-at-animation-text-wrapper .eae-at-animation-text {
366
+ display: inline-block;
367
+ position: absolute;
368
+ white-space: nowrap;
369
+ left: 0;
370
+ top: 0;
371
+ }
372
+ .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible {
373
+ position: relative;
374
+ }
375
+ .no-js .eae-at-animation-text-wrapper .eae-at-animation-text {
376
+ opacity: 0;
377
+ }
378
+ .no-js .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible {
379
+ opacity: 1;
380
+ }
381
+
382
+ .eae-animtext-wrapper{ font-size:40px; }
383
+
384
+
385
+ /**
386
+ Animated Text Styles
387
+ **/
388
+ .eae-st-rest-text {
389
+ display: inline-block;
390
+ }
391
+ .eae-st-split-text {
392
+ display: inline-block;
393
+ }
394
+
395
+ /* --------------------------------
396
+ xtype
397
+ -------------------------------- */
398
+ .eae-at-animation.type .eae-at-animation-text-wrapper {
399
+ vertical-align: bottom;
400
+ overflow: hidden;
401
+ }
402
+ .eae-at-animation.type .eae-at-animation-text-wrapper::after {
403
+ /* vertical bar */
404
+ content: '';
405
+ position: absolute;
406
+ right: 0;
407
+ top: 50%;
408
+ bottom: auto;
409
+ -webkit-transform: translateY(-50%);
410
+ -moz-transform: translateY(-50%);
411
+ -ms-transform: translateY(-50%);
412
+ -o-transform: translateY(-50%);
413
+ transform: translateY(-50%);
414
+ height: 90%;
415
+ width: 1px;
416
+ }
417
+ .eae-at-animation.type .eae-at-animation-text-wrapper.waiting::after {
418
+ -webkit-animation: cd-pulse 1s infinite;
419
+ -moz-animation: cd-pulse 1s infinite;
420
+ animation: cd-pulse 1s infinite;
421
+ }
422
+
423
+ .eae-at-animation.type .eae-at-animation-text-wrapper.selected::after {
424
+ visibility: hidden;
425
+ }
426
+
427
+ .eae-at-animation.type .eae-at-animation-text {
428
+ visibility: hidden;
429
+ }
430
+ .eae-at-animation.type .eae-at-animation-text.is-visible {
431
+ visibility: visible;
432
+ }
433
+ .eae-at-animation.type i {
434
+ position: absolute;
435
+ visibility: hidden;
436
+ }
437
+ .eae-at-animation.type i.in {
438
+ position: relative;
439
+ visibility: visible;
440
+ }
441
+
442
+ @-webkit-keyframes cd-pulse {
443
+ 0% {
444
+ -webkit-transform: translateY(-50%) scale(1);
445
+ opacity: 1;
446
+ }
447
+ 40% {
448
+ -webkit-transform: translateY(-50%) scale(0.9);
449
+ opacity: 0;
450
+ }
451
+ 100% {
452
+ -webkit-transform: translateY(-50%) scale(0);
453
+ opacity: 0;
454
+ }
455
+ }
456
+ @-moz-keyframes cd-pulse {
457
+ 0% {
458
+ -moz-transform: translateY(-50%) scale(1);
459
+ opacity: 1;
460
+ }
461
+ 40% {
462
+ -moz-transform: translateY(-50%) scale(0.9);
463
+ opacity: 0;
464
+ }
465
+ 100% {
466
+ -moz-transform: translateY(-50%) scale(0);
467
+ opacity: 0;
468
+ }
469
+ }
470
+ @keyframes cd-pulse {
471
+ 0% {
472
+ -webkit-transform: translateY(-50%) scale(1);
473
+ -moz-transform: translateY(-50%) scale(1);
474
+ -ms-transform: translateY(-50%) scale(1);
475
+ -o-transform: translateY(-50%) scale(1);
476
+ transform: translateY(-50%) scale(1);
477
+ opacity: 1;
478
+ }
479
+ 40% {
480
+ -webkit-transform: translateY(-50%) scale(0.9);
481
+ -moz-transform: translateY(-50%) scale(0.9);
482
+ -ms-transform: translateY(-50%) scale(0.9);
483
+ -o-transform: translateY(-50%) scale(0.9);
484
+ transform: translateY(-50%) scale(0.9);
485
+ opacity: 0;
486
+ }
487
+ 100% {
488
+ -webkit-transform: translateY(-50%) scale(0);
489
+ -moz-transform: translateY(-50%) scale(0);
490
+ -ms-transform: translateY(-50%) scale(0);
491
+ -o-transform: translateY(-50%) scale(0);
492
+ transform: translateY(-50%) scale(0);
493
+ opacity: 0;
494
+ }
495
+ }
496
+
497
+ /**
498
+ Advanced tabs
499
+ **/
500
+ /* --------------------------------
501
+ Primary style
502
+ -------------------------------- */
503
+ .eae-tabs {
504
+ position: relative;
505
+ width: 100%;
506
+ overflow: hidden;
507
+ margin: 1em 0 2em;
508
+ font-weight: 300;
509
+ }
510
+
511
+ /* Nav */
512
+ .eae-tabs nav {
513
+ text-align: center;
514
+ line-height: 0;
515
+ }
516
+
517
+ .eae-tabs nav ul {
518
+ padding: 0;
519
+ margin: 0;
520
+ list-style: none;
521
+ display: inline-block;
522
+ }
523
+
524
+ .eae-tabs nav ul li {
525
+ border: 1px solid #becbd2;
526
+ border-bottom: none;
527
+ display: block;
528
+ position: relative;
529
+ }
530
+
531
+ .eae-tabs nav li.tab-current {
532
+ border: 1px solid #47a3da;
533
+ border-bottom: none;
534
+ z-index: 100;
535
+ }
536
+
537
+ .eae-nav-pos-top nav li.tab-current:before,
538
+ .eae-nav-pos-top nav li.tab-current:after {
539
+ content: '';
540
+ position: absolute;
541
+ height: 2px;
542
+ right: 100%;
543
+ bottom: 0;
544
+ width: 1000px;
545
+ background: #47a3da;
546
+ }
547
+
548
+ .eae-nav-pos-top nav ul li{
549
+ margin: 0 0.25em;
550
+ float: left;
551
+ }
552
+ .eae-nav-pos-top nav li.tab-current:after {
553
+ right: auto;
554
+ left: 100%;
555
+ width: 4000px;
556
+ }
557
+
558
+ .eae-tabs nav a {
559
+ display: block;
560
+ line-height: 2.5;
561
+ padding: 0 1.25em;
562
+ white-space: nowrap;
563
+ }
564
+ .eae-tabs nav i {
565
+ line-height: 2.5;
566
+ padding: 1px;
567
+ }
568
+
569
+ .eae-tabs nav a:hover {
570
+ color: #768e9d;
571
+ }
572
+
573
+ .eae-tabs nav li.tab-current a {
574
+ color: #47a3da;
575
+ }
576
+
577
+ .eae-nav-pos-left nav {
578
+ float:left;
579
+ width: 20%;
580
+ }
581
+ .eae-nav-pos-left nav ul li{
582
+ margin:0 0 10px 0;
583
+ }
584
+ .eae-nav-pos-left .eae-content{
585
+ float:left;
586
+ width: 80%;
587
+ padding-left: 5px;
588
+ }
589
+ /* Icons */
590
+ .eae-tabs nav a:before {
591
+ display: inline-block;
592
+ vertical-align: middle;
593
+ text-transform: none;
594
+ font-weight: normal;
595
+ font-variant: normal;
596
+ font-family: 'icomoon';
597
+ line-height: 1;
598
+ speak: none;
599
+ -webkit-font-smoothing: antialiased;
600
+ margin: -0.25em 0.4em 0 0;
601
+ }
602
+
603
+ /* Content */
604
+ .eae-content section {
605
+ font-size: 1.25em;
606
+ padding: 20px 20px;
607
+ display: none;
608
+ max-width: 1230px;
609
+ margin: 0 auto;
610
+ border: 1px solid #47a3da;
611
+ }
612
+
613
+ .eae-content section:before,
614
+ .eae-content section:after {
615
+ content: '';
616
+ display: table;
617
+ }
618
+
619
+ .eae-content section:after {
620
+ clear: both;
621
+ }
622
+
623
+ /* Fallback example */
624
+ .eae-no-js .content section {
625
+ display: block;
626
+ padding-bottom: 2em;
627
+ border-bottom: 1px solid #47a3da;
628
+ }
629
+
630
+ .eae-content section.content-current {
631
+ display: block;
632
+ }
633
+
634
+
635
+ /* Example media queries */
636
+
637
+ @media screen and (max-width: 52.375em) {
638
+ .text-mobile-no.eae-tabs nav a span {
639
+ display : none;
640
+ }
641
+
642
+ .eae-tabs nav a:before {
643
+ margin-right: 0;
644
+ }
645
+ }
646
+
647
+ @media screen and (max-width: 32em) {
648
+ .eae-tabs nav ul,
649
+ .eae-tabs nav ul li a {
650
+ width: 100%;
651
+ padding: 0;
652
+ }
653
+
654
+ .eae-tabs nav ul li {
655
+ width: 25%;
656
+ margin: 0 0 0 0px;
657
+ }
658
+
659
+ .eae-nav-pos-left .eae-tabs nav ul li {
660
+ width: 100%;
661
+ margin-bottom: 10px;
662
+ }
663
+
664
+ }
665
+
666
+ /**
667
+ After Before Image
668
+ **/
669
+ /* --------------------------------
670
+ Primary style
671
+ -------------------------------- */
672
+ .eae-img-comp-container {
673
+ width: 100%;
674
+ position: relative;
675
+ text-align: center;
676
+ }
677
+ .eae-img-comp-container img {
678
+ vertical-align: middle ;
679
+ }
680
+ .eae-img-comp-img {
681
+ /*position: absolute;
682
+ width: 100%;
683
+ height: 100%;
684
+ overflow:hidden;*/
685
+
686
+ position: absolute;
687
+ top: 0px;
688
+ left: 0px;
689
+ height: 100%;
690
+ width: 100%;
691
+ overflow: hidden;
692
+ transform: translateZ(0px);
693
+ backface-visibility: hidden;
694
+ }
695
+ .eae-img-comp-img img{
696
+ display: block;
697
+ max-width: 100%;
698
+ width: 100%;
699
+ }
700
+ .eae-img-comp-slider {
701
+ position: absolute;
702
+ z-index:9;
703
+ /*set the appearance of the slider:*/
704
+ width: 40px;
705
+ height: 40px;
706
+ background-color: #2196F3;
707
+ opacity: 1.0;
708
+ border-radius: 50%;
709
+ }
710
+ .icon-horizontal{
711
+ cursor: ew-resize;
712
+ }
713
+ .icon-vertical{
714
+ cursor: n-resize;
715
+ }
716
+
717
+ .eae-img-comp-overlay{
718
+
719
+ }
720
+ .mode-horizontal .eae-img-comp-overlay img{
721
+ position: absolute;
722
+ left: 0;
723
+ top: 0;
724
+ display: block;
725
+ width: auto;
726
+ height: 100%!important;
727
+ max-width: none!important;
728
+ }
729
+
730
+ .mode-vertical .eae-img-comp-overlay img{
731
+ position: absolute;
732
+ left: 0;
733
+ top: 0;
734
+ display: block;
735
+ width: 100%;
736
+ height: auto !important;
737
+ max-width: none!important;
738
+ }
739
+
740
+
741
+ .eae-slider-icon{
742
+ top: 50%;
743
+ transform: translateY(-50%) translateX(-50%);
744
+ position: absolute;
745
+ left: 50%;
746
+ color:white;
747
+ }
748
+ .elementor-widget-wts-ab-image{
749
+ text-align: center;
750
+ }
751
+ .elementor-widget-wts-ab-image .elementor-widget-container{
752
+ display: inline-block;
753
+ margin: 0 auto !important;
754
+ overflow: hidden;
755
+ }
756
+
757
+ .eae-text-before{
758
+ position: absolute!important;
759
+ padding: 10px;
760
+ transition: transform .3s .7s,opacity .3s .7s;
761
+ color: #d36118;
762
+ z-index: 0;
763
+ background: rgba(255,255,255,0.5);
764
+ margin: 20px;
765
+ }
766
+
767
+ .eae-text-after{
768
+ position: absolute!important;
769
+ padding: 10px;
770
+ transition: transform .3s .7s,opacity .3s .7s;
771
+ color: #d36118;
772
+ z-index: 0;
773
+ background: rgba(255,255,255,0.5);
774
+ margin: 20px;
775
+ }
776
+
777
+ /* Test CSS */
778
+
779
+ .divTest{
780
+ display: inline-block;
781
+ background-color: #00a0d2;
782
+ padding: 20px;
783
+ }
784
+
785
+
786
+ .eae-particle-wrapper{
787
+ width:100%;
788
+ height:100%; position: absolute;
789
+ }
790
+
791
+ .particles-js-canvas-el{ height:100%; position:absolute; }
assets/js/animated-main.js ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //jQuery.noConflict();
2
+
3
+ jQuery(document).on('elementor/render/animation-text',function(e){
4
+ jQuery(".eae-at-animation-text-wrapper .eae-at-animation-text:first-child").addClass("is-visible");
5
+
6
+ //set animation timing
7
+ var animationDelay = 2500,
8
+ //loading bar effect
9
+ barAnimationDelay = 3800,
10
+ barWaiting = barAnimationDelay - 3000, //3000 is the duration of the transition on the loading bar - set in the scss/css file
11
+ //letters effect
12
+ lettersDelay = 50,
13
+ //type effect
14
+ typeLettersDelay = 150,
15
+ selectionDuration = 500,
16
+ typeAnimationDelay = selectionDuration + 800,
17
+ //clip effect
18
+ revealDuration = 600,
19
+ revealAnimationDelay = 1500;
20
+
21
+ initHeadline();
22
+
23
+
24
+ function initHeadline() {
25
+ //insert <i> element for each letter of a changing word
26
+ singleLetters(jQuery('.eae-at-animation.letters').find('.eae-at-animation-text'));
27
+ //initialise headline animation
28
+ animateHeadline(jQuery('.eae-at-animation-text-wrapper'));
29
+ }
30
+
31
+ function singleLetters($words) {
32
+ $words.each(function(){
33
+ var word = jQuery(this),
34
+ letters = word.text().split(''),
35
+ selected = word.hasClass('is-visible');
36
+ for (i in letters) {
37
+ letters[i] = (selected) ? '<i class="in">' + letters[i] + '</i>': '<i>' + letters[i] + '</i>';
38
+ }
39
+ var newLetters = letters.join('');
40
+ word.html(newLetters).css('opacity', 1);
41
+ });
42
+ }
43
+
44
+ function animateHeadline($headlines) {
45
+ var duration = animationDelay;
46
+
47
+ $headlines.each(function(){
48
+ var headline = jQuery(this);
49
+
50
+ if (!headline.hasClass('type') ) {
51
+ //assign to .eae-at-animation-text-wrapper the width of its longest word
52
+ var words = headline.find('.eae-at-animation-text-wrapper .eae-at-animation-text'),
53
+ width = 0;
54
+ words.each(function(){
55
+ var wordWidth = jQuery(this).width();
56
+ if (wordWidth > width) width = wordWidth;
57
+ });
58
+ headline.find('.eae-at-animation-text-wrapper').css('width', width);
59
+ };
60
+
61
+ //trigger animation
62
+ setTimeout(function(){ hideWord( headline.find('.is-visible').eq(0) ) }, duration);
63
+ });
64
+ }
65
+
66
+ function hideWord($word) {
67
+ console.log($word);
68
+ var nextWord = takeNext($word);
69
+
70
+ if($word.parents('.eae-at-animation').hasClass('type')) {
71
+ var parentSpan = $word.parent('.eae-at-animation-text-wrapper');
72
+ parentSpan.addClass('selected').removeClass('waiting');
73
+ setTimeout(function(){
74
+ parentSpan.removeClass('selected');
75
+ $word.removeClass('is-visible').addClass('is-hidden').children('i').removeClass('in').addClass('out');
76
+ }, selectionDuration);
77
+ setTimeout(function(){ showWord(nextWord, typeLettersDelay) }, typeAnimationDelay);
78
+ } else if($word.parents('.eae-at-animation').hasClass('letters')) {
79
+ var bool = ($word.children('i').length >= nextWord.children('i').length) ? true : false;
80
+ hideLetter($word.find('i').eq(0), $word, bool, lettersDelay);
81
+ showLetter(nextWord.find('i').eq(0), nextWord, bool, lettersDelay);
82
+
83
+ } else {
84
+ switchWord($word, nextWord);
85
+ setTimeout(function(){ hideWord(nextWord) }, animationDelay);
86
+ }
87
+ }
88
+
89
+ function showWord($word, $duration) {
90
+ if($word.parents('.eae-at-animation').hasClass('type')) {
91
+ showLetter($word.find('i').eq(0), $word, false, $duration);
92
+ $word.addClass('is-visible').removeClass('is-hidden');
93
+
94
+ }
95
+ }
96
+
97
+ function hideLetter($letter, $word, $bool, $duration) {
98
+ $letter.removeClass('in').addClass('out');
99
+
100
+ if(!$letter.is(':last-child')) {
101
+ setTimeout(function(){ hideLetter($letter.next(), $word, $bool, $duration); }, $duration);
102
+ } else if($bool) {
103
+ setTimeout(function(){ hideWord(takeNext($word)) }, animationDelay);
104
+ }
105
+
106
+ if($letter.is(':last-child') && jQuery('html').hasClass('no-csstransitions')) {
107
+ var nextWord = takeNext($word);
108
+ switchWord($word, nextWord);
109
+ }
110
+ }
111
+
112
+ function showLetter($letter, $word, $bool, $duration) {
113
+ $letter.addClass('in').removeClass('out');
114
+
115
+ if(!$letter.is(':last-child')) {
116
+ setTimeout(function(){ showLetter($letter.next(), $word, $bool, $duration); }, $duration);
117
+ } else {
118
+ if($word.parents('.eae-at-animation').hasClass('type')) { setTimeout(function(){ $word.parents('.eae-at-animation-text-wrapper').addClass('waiting'); }, 200);}
119
+ if(!$bool) { setTimeout(function(){ hideWord($word) }, animationDelay) }
120
+ }
121
+ }
122
+
123
+ function takeNext($word) {
124
+ return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0);
125
+ }
126
+
127
+ function takePrev($word) {
128
+ return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last();
129
+ }
130
+
131
+ function switchWord($oldWord, $newWord) {
132
+ $oldWord.removeClass('is-visible').addClass('is-hidden');
133
+ $newWord.removeClass('is-hidden').addClass('is-visible');
134
+ }
135
+ });
assets/js/eae.js ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( window ).on( 'elementor/frontend/init', function() {
2
+
3
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/wts-gmap.default', function( $scope ) {
4
+ map = new_map($scope.find('.eae-markers'));
5
+
6
+ function new_map( $el ) {
7
+ $wrapper = $scope.find('.eae-markers');
8
+ var zoom = $wrapper.data('zoom');
9
+ var $markers = $el.find('.marker');
10
+ var styles = $wrapper.data('style');
11
+ var prevent_scroll = $wrapper.data('scroll')
12
+ // vars
13
+ var args = {
14
+ zoom : zoom,
15
+ center : new google.maps.LatLng(0, 0),
16
+ mapTypeId : google.maps.MapTypeId.ROADMAP,
17
+ styles : styles
18
+ };
19
+
20
+ // create map
21
+ var map = new google.maps.Map( $el[0], args);
22
+
23
+ // add a markers reference
24
+ map.markers = [];
25
+
26
+ // add markers
27
+ $markers.each(function(){
28
+ add_marker( jQuery(this), map );
29
+ });
30
+
31
+ // center map
32
+ center_map( map, zoom );
33
+
34
+ // return
35
+ return map;
36
+ }
37
+
38
+ function add_marker( $marker, map ) {
39
+ // var
40
+ var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );
41
+
42
+ icon_img = $marker.attr('data-icon');
43
+ if(icon_img != ''){
44
+ var icon = {
45
+ url : $marker.attr('data-icon'),
46
+ scaledSize: new google.maps.Size($marker.attr('data-icon-size'), $marker.attr('data-icon-size'))
47
+ };
48
+
49
+ console.log(icon);
50
+ }
51
+
52
+
53
+ //var icon = $marker.attr('data-icon');
54
+
55
+ // create marker
56
+ var marker = new google.maps.Marker({
57
+ position : latlng,
58
+ map : map,
59
+ icon : icon
60
+ });
61
+
62
+ // add to array
63
+ map.markers.push( marker );
64
+
65
+ // if marker contains HTML, add it to an infoWindow
66
+
67
+ if( $marker.html() )
68
+ {
69
+ // create info window
70
+ var infowindow = new google.maps.InfoWindow({
71
+ content : $marker.html()
72
+ });
73
+
74
+ // show info window when marker is clicked
75
+ google.maps.event.addListener(marker, 'click', function() {
76
+ infowindow.open( map, marker );
77
+ });
78
+ }
79
+ }
80
+
81
+ function center_map( map, zoom ) {
82
+ console.log(zoom);
83
+ // vars
84
+ var bounds = new google.maps.LatLngBounds();
85
+ // loop through all markers and create bounds
86
+ jQuery.each( map.markers, function( i, marker ){
87
+ var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() );
88
+ bounds.extend( latlng );
89
+ });
90
+
91
+ // only 1 marker?
92
+ if( map.markers.length == 1 )
93
+ {
94
+ // set center of map
95
+ map.setCenter( bounds.getCenter() );
96
+ map.setZoom( zoom );
97
+ }
98
+ else
99
+ {
100
+ // fit to bounds
101
+ map.fitBounds( bounds );
102
+ }
103
+ }
104
+ });
105
+
106
+ });
107
+
108
+ (function( $ ){
109
+
110
+ $(window).on('elementor/frontend/init',function(){
111
+
112
+ var ab_image = function($scope, $){
113
+ ab_style = $scope.find('.eae-img-comp-container').data("ab-style");
114
+ slider_pos = $scope.find('.eae-img-comp-container').data("slider-pos");
115
+ if(ab_style == "horizontal"){
116
+ horizontal($scope);
117
+ }else{
118
+ vertical();
119
+ }
120
+
121
+ function horizontal($scope) {
122
+ var x, i, start_pos;
123
+ /*find all elements with an "overlay" class:*/
124
+ x = $scope.find(".eae-img-comp-overlay");
125
+ start_pos = x.width();
126
+ start_pos = start_pos * slider_pos /100;
127
+ compareImages(x[0]);
128
+
129
+ function compareImages(img) {
130
+ var slider, clicked = 0, w, h;
131
+ /*get the width and height of the img element*/
132
+ w = img.offsetWidth;
133
+ h = img.offsetHeight;
134
+ /*set the width of the img element to 50%:*/
135
+ img.style.width = start_pos + "px";
136
+ /*create slider:*/
137
+ slider = $scope.find(".eae-img-comp-slider");
138
+ slider = slider[0];
139
+ /*position the slider in the middle:*/
140
+ slider.style.top = (h / 2) - (slider.offsetHeight / 2) + "px";
141
+ slider.style.left = start_pos - (slider.offsetWidth / 2) + "px";
142
+ /*execute a function when the mouse button is pressed:*/
143
+ if(!$scope.hasClass('elementor-element-edit-mode')) {
144
+ slider.addEventListener("mousedown", slideReady);
145
+ //slider.addEventListener("mouseover", slideReady);
146
+ //img.addEventListener("mouseover", slideReady);
147
+
148
+ /*and another function when the mouse button is released:*/
149
+ window.addEventListener("mouseup", slideFinish);
150
+ //slider.addEventListener("mouseout", slideFinish);
151
+ //img.addEventListener("mouseout", slideFinish);
152
+ /*or touched (for touch screens:*/
153
+ slider.addEventListener("touchstart", slideReady);
154
+ /*and released (for touch screens:*/
155
+ window.addEventListener("touchstop", slideFinish);
156
+ }
157
+ function slideReady(e) {
158
+ /*prevent any other actions that may occur when moving over the image:*/
159
+ e.preventDefault();
160
+ /*the slider is now clicked and ready to move:*/
161
+ clicked = 1;
162
+ /*execute a function when the slider is moved:*/
163
+ window.addEventListener("mousemove", slideMove);
164
+ //window.addEventListener("mouseover", slideMove);
165
+ //window.addEventListener("touchmove", slideMove);
166
+ slider.addEventListener("touchmove", touchMoveaction);
167
+ }
168
+ function slideFinish() {
169
+ /*the slider is no longer clicked:*/
170
+ clicked = 0;
171
+ }
172
+ function slideMove(e) {
173
+ var pos;
174
+ /*if the slider is no longer clicked, exit this function:*/
175
+ if (clicked == 0) return false;
176
+ /*get the cursor's x position:*/
177
+ pos = getCursorPos(e);
178
+ /*prevent the slider from being positioned outside the image:*/
179
+ if (pos < 0) pos = 0;
180
+ if (pos > w) pos = w;
181
+ /*execute a function that will resize the overlay image according to the cursor:*/
182
+ slide(pos);
183
+ }
184
+
185
+ function touchMoveaction(e)
186
+ {
187
+ var pos;
188
+ /*if the slider is no longer clicked, exit this function:*/
189
+ if (clicked == 0) return false;
190
+ /*get the cursor's x position:*/
191
+ pos = getTouchPos(e);
192
+
193
+ /*prevent the slider from being positioned outside the image:*/
194
+ if (pos < 0) pos = 0;
195
+ if (pos > w) pos = w;
196
+ /*execute a function that will resize the overlay image according to the cursor:*/
197
+ slide(pos);
198
+ }
199
+
200
+ function getTouchPos(e) {
201
+ var a, x = 0;
202
+ a = img.getBoundingClientRect();
203
+
204
+ /*calculate the cursor's x coordinate, relative to the image:*/
205
+ x = e.changedTouches[0].clientX - a.left;
206
+ return x;
207
+ }
208
+
209
+ function getCursorPos(e) {
210
+ var a, x = 0;
211
+ e = e || window.event;
212
+ /*get the x positions of the image:*/
213
+ a = img.getBoundingClientRect();
214
+ /*calculate the cursor's x coordinate, relative to the image:*/
215
+ x = e.pageX - a.left;
216
+
217
+ /*consider any page scrolling:*/
218
+ //x = x - window.pageXOffset;
219
+ return x;
220
+ }
221
+ function slide(x) {
222
+ /*resize the image:*/
223
+ img.style.width = x + "px";
224
+ /*position the slider:*/
225
+ slider.style.left = img.offsetWidth - (slider.offsetWidth / 2) + "px";
226
+ }
227
+ }
228
+ }
229
+
230
+ function vertical() {
231
+ var x, i;
232
+ /*find all elements with an "overlay" class:*/
233
+ //x = document.getElementsByClassName("eae-img-comp-overlay");
234
+ x = $scope.find(".eae-img-comp-overlay");
235
+ start_pos = x.height();
236
+ start_pos = start_pos * slider_pos /100;
237
+ compareImages(x[0]);
238
+
239
+ function compareImages(img) {
240
+ var slider, img, clicked = 0, w, h;
241
+ /*get the width and height of the img element*/
242
+ w = img.offsetWidth;
243
+ h = img.offsetHeight;
244
+ /*set the width of the img element to 50%:*/
245
+ img.style.height = start_pos + "px";
246
+ /*create slider:*/
247
+ slider = $scope.find(".eae-img-comp-slider");
248
+ slider = slider[0];
249
+ /*position the slider in the middle:*/
250
+ slider.style.top = start_pos - (slider.offsetHeight / 2) + "px";
251
+ slider.style.left = (w / 2) - (slider.offsetWidth / 2) + "px";
252
+ /*execute a function when the mouse button is pressed:*/
253
+ if(!$scope.hasClass('elementor-element-edit-mode')) {
254
+ slider.addEventListener("mousedown", slideReady);
255
+ /*and another function when the mouse button is released:*/
256
+ window.addEventListener("mouseup", slideFinish);
257
+ /*or touched (for touch screens:*/
258
+ slider.addEventListener("touchstart", slideReady);
259
+ /*and released (for touch screens:*/
260
+ window.addEventListener("touchstop", slideFinish);
261
+ }
262
+ function slideReady(e) {
263
+ /*prevent any other actions that may occur when moving over the image:*/
264
+ e.preventDefault();
265
+ /*the slider is now clicked and ready to move:*/
266
+ clicked = 1;
267
+ /*execute a function when the slider is moved:*/
268
+ window.addEventListener("mousemove", slideMove);
269
+ slider.addEventListener("touchmove", touchMoveaction);
270
+ }
271
+ function slideFinish() {
272
+ /*the slider is no longer clicked:*/
273
+ clicked = 0;
274
+ }
275
+ function slideMove(e) {
276
+ var pos;
277
+ /*if the slider is no longer clicked, exit this function:*/
278
+ if (clicked == 0) return false;
279
+ /*get the cursor's x position:*/
280
+ pos = getCursorPos(e)
281
+ /*prevent the slider from being positioned outside the image:*/
282
+ if (pos < 0) pos = 0;
283
+ if (pos > h) pos = h;
284
+ /*execute a function that will resize the overlay image according to the cursor:*/
285
+ slide(pos);
286
+ }
287
+
288
+ function getCursorPos(e) {
289
+ var a, x = 0;
290
+ e = e || window.event;
291
+ /*get the x positions of the image:*/
292
+ a = img.getBoundingClientRect();
293
+ /*calculate the cursor's x coordinate, relative to the image:*/
294
+ x = e.pageY - a.top;
295
+ /*consider any page scrolling:*/
296
+ x = x - window.pageYOffset;
297
+
298
+ return x;
299
+ }
300
+
301
+ function touchMoveaction(e)
302
+ {
303
+ var pos;
304
+ /*if the slider is no longer clicked, exit this function:*/
305
+ if (clicked == 0) return false;
306
+ /*get the cursor's x position:*/
307
+ pos = getTouchPos(e);
308
+
309
+ /*prevent the slider from being positioned outside the image:*/
310
+ if (pos < 0) pos = 0;
311
+ if (pos > h) pos = h;
312
+ /*execute a function that will resize the overlay image according to the cursor:*/
313
+ slide(pos);
314
+ }
315
+
316
+ function getTouchPos(e) {
317
+ var a, x = 0;
318
+ a = img.getBoundingClientRect();
319
+
320
+ /*calculate the cursor's x coordinate, relative to the image:*/
321
+ x = e.changedTouches[0].clientY - a.top;
322
+
323
+ //x = x - slider.offsetHeight;
324
+
325
+ return x;
326
+ }
327
+
328
+ function slide(x) {
329
+ /*resize the image:*/
330
+ img.style.height = x + "px";
331
+ /*position the slider:*/
332
+ slider.style.top = img.offsetHeight - (slider.offsetHeight / 2) + "px";
333
+ }
334
+ }
335
+ }
336
+ }
337
+
338
+ var ParticlesBG = function($scope, $){
339
+
340
+ if($scope.hasClass('eae-particle-yes')){
341
+ id = $scope.data('id');
342
+ element_type = $scope.data('element_type');
343
+ pdata = $scope.data('eae-particle');
344
+ pdata_wrapper = $scope.find('.eae-particle-wrapper').data('eae-pdata');
345
+ if(typeof pdata != 'undefined' && pdata != ''){
346
+
347
+ $scope.prepend('<div class="eae-particle-wrapper" id="eae-particle-'+ id +'"></div>');
348
+ particlesJS('eae-particle-'+ id, pdata);
349
+
350
+ }else if(typeof pdata_wrapper != 'undefined' && pdata_wrapper != ''){
351
+
352
+ $scope.prepend('<div class="eae-particle-wrapper" id="eae-particle-'+ id +'"></div>');
353
+ console.log('calling particle js else', JSON.parse(pdata_wrapper));
354
+ particlesJS('eae-particle-'+ id, JSON.parse(pdata_wrapper));
355
+ }
356
+
357
+ }
358
+
359
+ }
360
+
361
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/wts-ab-image.default', ab_image);
362
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/global', ParticlesBG );
363
+
364
+ });
365
+
366
+ })(jQuery)
367
+
assets/js/particles.js ADDED
@@ -0,0 +1,1539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* -----------------------------------------------
2
+ /* Author : Vincent Garreau - vincentgarreau.com
3
+ /* MIT license: http://opensource.org/licenses/MIT
4
+ /* Demo / Generator : vincentgarreau.com/particles.js
5
+ /* GitHub : github.com/VincentGarreau/particles.js
6
+ /* How to use? : Check the GitHub README
7
+ /* v2.0.0
8
+ /* ----------------------------------------------- */
9
+
10
+ var pJS = function(tag_id, params){
11
+
12
+ var canvas_el = document.querySelector('#'+tag_id+' > .particles-js-canvas-el');
13
+
14
+ /* particles.js variables with default values */
15
+ this.pJS = {
16
+ canvas: {
17
+ el: canvas_el,
18
+ w: canvas_el.offsetWidth,
19
+ h: canvas_el.offsetHeight
20
+ },
21
+ particles: {
22
+ number: {
23
+ value: 400,
24
+ density: {
25
+ enable: true,
26
+ value_area: 800
27
+ }
28
+ },
29
+ color: {
30
+ value: '#fff'
31
+ },
32
+ shape: {
33
+ type: 'circle',
34
+ stroke: {
35
+ width: 0,
36
+ color: '#ff0000'
37
+ },
38
+ polygon: {
39
+ nb_sides: 5
40
+ },
41
+ image: {
42
+ src: '',
43
+ width: 100,
44
+ height: 100
45
+ }
46
+ },
47
+ opacity: {
48
+ value: 1,
49
+ random: false,
50
+ anim: {
51
+ enable: false,
52
+ speed: 2,
53
+ opacity_min: 0,
54
+ sync: false
55
+ }
56
+ },
57
+ size: {
58
+ value: 20,
59
+ random: false,
60
+ anim: {
61
+ enable: false,
62
+ speed: 20,
63
+ size_min: 0,
64
+ sync: false
65
+ }
66
+ },
67
+ line_linked: {
68
+ enable: true,
69
+ distance: 100,
70
+ color: '#fff',
71
+ opacity: 1,
72
+ width: 1
73
+ },
74
+ move: {
75
+ enable: true,
76
+ speed: 2,
77
+ direction: 'none',
78
+ random: false,
79
+ straight: false,
80
+ out_mode: 'out',
81
+ bounce: false,
82
+ attract: {
83
+ enable: false,
84
+ rotateX: 3000,
85
+ rotateY: 3000
86
+ }
87
+ },
88
+ array: []
89
+ },
90
+ interactivity: {
91
+ detect_on: 'canvas',
92
+ events: {
93
+ onhover: {
94
+ enable: true,
95
+ mode: 'grab'
96
+ },
97
+ onclick: {
98
+ enable: true,
99
+ mode: 'push'
100
+ },
101
+ resize: true
102
+ },
103
+ modes: {
104
+ grab:{
105
+ distance: 100,
106
+ line_linked:{
107
+ opacity: 1
108
+ }
109
+ },
110
+ bubble:{
111
+ distance: 200,
112
+ size: 80,
113
+ duration: 0.4
114
+ },
115
+ repulse:{
116
+ distance: 200,
117
+ duration: 0.4
118
+ },
119
+ push:{
120
+ particles_nb: 4
121
+ },
122
+ remove:{
123
+ particles_nb: 2
124
+ }
125
+ },
126
+ mouse:{}
127
+ },
128
+ retina_detect: false,
129
+ fn: {
130
+ interact: {},
131
+ modes: {},
132
+ vendors:{}
133
+ },
134
+ tmp: {}
135
+ };
136
+
137
+ var pJS = this.pJS;
138
+
139
+ /* params settings */
140
+ if(params){
141
+ Object.deepExtend(pJS, params);
142
+ }
143
+
144
+ pJS.tmp.obj = {
145
+ size_value: pJS.particles.size.value,
146
+ size_anim_speed: pJS.particles.size.anim.speed,
147
+ move_speed: pJS.particles.move.speed,
148
+ line_linked_distance: pJS.particles.line_linked.distance,
149
+ line_linked_width: pJS.particles.line_linked.width,
150
+ mode_grab_distance: pJS.interactivity.modes.grab.distance,
151
+ mode_bubble_distance: pJS.interactivity.modes.bubble.distance,
152
+ mode_bubble_size: pJS.interactivity.modes.bubble.size,
153
+ mode_repulse_distance: pJS.interactivity.modes.repulse.distance
154
+ };
155
+
156
+
157
+ pJS.fn.retinaInit = function(){
158
+
159
+ if(pJS.retina_detect && window.devicePixelRatio > 1){
160
+ pJS.canvas.pxratio = window.devicePixelRatio;
161
+ pJS.tmp.retina = true;
162
+ }
163
+ else{
164
+ pJS.canvas.pxratio = 1;
165
+ pJS.tmp.retina = false;
166
+ }
167
+
168
+ pJS.canvas.w = pJS.canvas.el.offsetWidth * pJS.canvas.pxratio;
169
+ pJS.canvas.h = pJS.canvas.el.offsetHeight * pJS.canvas.pxratio;
170
+
171
+ pJS.particles.size.value = pJS.tmp.obj.size_value * pJS.canvas.pxratio;
172
+ pJS.particles.size.anim.speed = pJS.tmp.obj.size_anim_speed * pJS.canvas.pxratio;
173
+ pJS.particles.move.speed = pJS.tmp.obj.move_speed * pJS.canvas.pxratio;
174
+ pJS.particles.line_linked.distance = pJS.tmp.obj.line_linked_distance * pJS.canvas.pxratio;
175
+ pJS.interactivity.modes.grab.distance = pJS.tmp.obj.mode_grab_distance * pJS.canvas.pxratio;
176
+ pJS.interactivity.modes.bubble.distance = pJS.tmp.obj.mode_bubble_distance * pJS.canvas.pxratio;
177
+ pJS.particles.line_linked.width = pJS.tmp.obj.line_linked_width * pJS.canvas.pxratio;
178
+ pJS.interactivity.modes.bubble.size = pJS.tmp.obj.mode_bubble_size * pJS.canvas.pxratio;
179
+ pJS.interactivity.modes.repulse.distance = pJS.tmp.obj.mode_repulse_distance * pJS.canvas.pxratio;
180
+
181
+ };
182
+
183
+
184
+
185
+ /* ---------- pJS functions - canvas ------------ */
186
+
187
+ pJS.fn.canvasInit = function(){
188
+ pJS.canvas.ctx = pJS.canvas.el.getContext('2d');
189
+ };
190
+
191
+ pJS.fn.canvasSize = function(){
192
+
193
+ pJS.canvas.el.width = pJS.canvas.w;
194
+ pJS.canvas.el.height = pJS.canvas.h;
195
+
196
+ if(pJS && pJS.interactivity.events.resize){
197
+
198
+ window.addEventListener('resize', function(){
199
+
200
+ pJS.canvas.w = pJS.canvas.el.offsetWidth;
201
+ pJS.canvas.h = pJS.canvas.el.offsetHeight;
202
+
203
+ /* resize canvas */
204
+ if(pJS.tmp.retina){
205
+ pJS.canvas.w *= pJS.canvas.pxratio;
206
+ pJS.canvas.h *= pJS.canvas.pxratio;
207
+ }
208
+
209
+ pJS.canvas.el.width = pJS.canvas.w;
210
+ pJS.canvas.el.height = pJS.canvas.h;
211
+
212
+ /* repaint canvas on anim disabled */
213
+ if(!pJS.particles.move.enable){
214
+ pJS.fn.particlesEmpty();
215
+ pJS.fn.particlesCreate();
216
+ pJS.fn.particlesDraw();
217
+ pJS.fn.vendors.densityAutoParticles();
218
+ }
219
+
220
+ /* density particles enabled */
221
+ pJS.fn.vendors.densityAutoParticles();
222
+
223
+ });
224
+
225
+ }
226
+
227
+ };
228
+
229
+
230
+ pJS.fn.canvasPaint = function(){
231
+ pJS.canvas.ctx.fillRect(0, 0, pJS.canvas.w, pJS.canvas.h);
232
+ };
233
+
234
+ pJS.fn.canvasClear = function(){
235
+ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);
236
+ };
237
+
238
+
239
+ /* --------- pJS functions - particles ----------- */
240
+
241
+ pJS.fn.particle = function(color, opacity, position){
242
+
243
+ /* size */
244
+ this.radius = (pJS.particles.size.random ? Math.random() : 1) * pJS.particles.size.value;
245
+ if(pJS.particles.size.anim.enable){
246
+ this.size_status = false;
247
+ this.vs = pJS.particles.size.anim.speed / 100;
248
+ if(!pJS.particles.size.anim.sync){
249
+ this.vs = this.vs * Math.random();
250
+ }
251
+ }
252
+
253
+ /* position */
254
+ this.x = position ? position.x : Math.random() * pJS.canvas.w;
255
+ this.y = position ? position.y : Math.random() * pJS.canvas.h;
256
+
257
+ /* check position - into the canvas */
258
+ if(this.x > pJS.canvas.w - this.radius*2) this.x = this.x - this.radius;
259
+ else if(this.x < this.radius*2) this.x = this.x + this.radius;
260
+ if(this.y > pJS.canvas.h - this.radius*2) this.y = this.y - this.radius;
261
+ else if(this.y < this.radius*2) this.y = this.y + this.radius;
262
+
263
+ /* check position - avoid overlap */
264
+ if(pJS.particles.move.bounce){
265
+ pJS.fn.vendors.checkOverlap(this, position);
266
+ }
267
+
268
+ /* color */
269
+ this.color = {};
270
+ if(typeof(color.value) == 'object'){
271
+
272
+ if(color.value instanceof Array){
273
+ var color_selected = color.value[Math.floor(Math.random() * pJS.particles.color.value.length)];
274
+ this.color.rgb = hexToRgb(color_selected);
275
+ }else{
276
+ if(color.value.r != undefined && color.value.g != undefined && color.value.b != undefined){
277
+ this.color.rgb = {
278
+ r: color.value.r,
279
+ g: color.value.g,
280
+ b: color.value.b
281
+ }
282
+ }
283
+ if(color.value.h != undefined && color.value.s != undefined && color.value.l != undefined){
284
+ this.color.hsl = {
285
+ h: color.value.h,
286
+ s: color.value.s,
287
+ l: color.value.l
288
+ }
289
+ }
290
+ }
291
+
292
+ }
293
+ else if(color.value == 'random'){
294
+ this.color.rgb = {
295
+ r: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),
296
+ g: (Math.floor(Math.random() * (255 - 0 + 1)) + 0),
297
+ b: (Math.floor(Math.random() * (255 - 0 + 1)) + 0)
298
+ }
299
+ }
300
+ else if(typeof(color.value) == 'string'){
301
+ this.color = color;
302
+ this.color.rgb = hexToRgb(this.color.value);
303
+ }
304
+
305
+ /* opacity */
306
+ this.opacity = (pJS.particles.opacity.random ? Math.random() : 1) * pJS.particles.opacity.value;
307
+ if(pJS.particles.opacity.anim.enable){
308
+ this.opacity_status = false;
309
+ this.vo = pJS.particles.opacity.anim.speed / 100;
310
+ if(!pJS.particles.opacity.anim.sync){
311
+ this.vo = this.vo * Math.random();
312
+ }
313
+ }
314
+
315
+ /* animation - velocity for speed */
316
+ var velbase = {}
317
+ switch(pJS.particles.move.direction){
318
+ case 'top':
319
+ velbase = { x:0, y:-1 };
320
+ break;
321
+ case 'top-right':
322
+ velbase = { x:0.5, y:-0.5 };
323
+ break;
324
+ case 'right':
325
+ velbase = { x:1, y:-0 };
326
+ break;
327
+ case 'bottom-right':
328
+ velbase = { x:0.5, y:0.5 };
329
+ break;
330
+ case 'bottom':
331
+ velbase = { x:0, y:1 };
332
+ break;
333
+ case 'bottom-left':
334
+ velbase = { x:-0.5, y:1 };
335
+ break;
336
+ case 'left':
337
+ velbase = { x:-1, y:0 };
338
+ break;
339
+ case 'top-left':
340
+ velbase = { x:-0.5, y:-0.5 };
341
+ break;
342
+ default:
343
+ velbase = { x:0, y:0 };
344
+ break;
345
+ }
346
+
347
+ if(pJS.particles.move.straight){
348
+ this.vx = velbase.x;
349
+ this.vy = velbase.y;
350
+ if(pJS.particles.move.random){
351
+ this.vx = this.vx * (Math.random());
352
+ this.vy = this.vy * (Math.random());
353
+ }
354
+ }else{
355
+ this.vx = velbase.x + Math.random()-0.5;
356
+ this.vy = velbase.y + Math.random()-0.5;
357
+ }
358
+
359
+ // var theta = 2.0 * Math.PI * Math.random();
360
+ // this.vx = Math.cos(theta);
361
+ // this.vy = Math.sin(theta);
362
+
363
+ this.vx_i = this.vx;
364
+ this.vy_i = this.vy;
365
+
366
+
367
+
368
+ /* if shape is image */
369
+
370
+ var shape_type = pJS.particles.shape.type;
371
+ if(typeof(shape_type) == 'object'){
372
+ if(shape_type instanceof Array){
373
+ var shape_selected = shape_type[Math.floor(Math.random() * shape_type.length)];
374
+ this.shape = shape_selected;
375
+ }
376
+ }else{
377
+ this.shape = shape_type;
378
+ }
379
+
380
+ if(this.shape == 'image'){
381
+ var sh = pJS.particles.shape;
382
+ this.img = {
383
+ src: sh.image.src,
384
+ ratio: sh.image.width / sh.image.height
385
+ }
386
+ if(!this.img.ratio) this.img.ratio = 1;
387
+ if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg != undefined){
388
+ pJS.fn.vendors.createSvgImg(this);
389
+ if(pJS.tmp.pushing){
390
+ this.img.loaded = false;
391
+ }
392
+ }
393
+ }
394
+
395
+
396
+
397
+ };
398
+
399
+
400
+ pJS.fn.particle.prototype.draw = function() {
401
+
402
+ var p = this;
403
+
404
+ if(p.radius_bubble != undefined){
405
+ var radius = p.radius_bubble;
406
+ }else{
407
+ var radius = p.radius;
408
+ }
409
+
410
+ if(p.opacity_bubble != undefined){
411
+ var opacity = p.opacity_bubble;
412
+ }else{
413
+ var opacity = p.opacity;
414
+ }
415
+
416
+ if(p.color.rgb){
417
+ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+opacity+')';
418
+ }else{
419
+ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+opacity+')';
420
+ }
421
+
422
+ pJS.canvas.ctx.fillStyle = color_value;
423
+ pJS.canvas.ctx.beginPath();
424
+
425
+ switch(p.shape){
426
+
427
+ case 'circle':
428
+ pJS.canvas.ctx.arc(p.x, p.y, radius, 0, Math.PI * 2, false);
429
+ break;
430
+
431
+ case 'edge':
432
+ pJS.canvas.ctx.rect(p.x-radius, p.y-radius, radius*2, radius*2);
433
+ break;
434
+
435
+ case 'triangle':
436
+ pJS.fn.vendors.drawShape(pJS.canvas.ctx, p.x-radius, p.y+radius / 1.66, radius*2, 3, 2);
437
+ break;
438
+
439
+ case 'polygon':
440
+ pJS.fn.vendors.drawShape(
441
+ pJS.canvas.ctx,
442
+ p.x - radius / (pJS.particles.shape.polygon.nb_sides/3.5), // startX
443
+ p.y - radius / (2.66/3.5), // startY
444
+ radius*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength
445
+ pJS.particles.shape.polygon.nb_sides, // sideCountNumerator
446
+ 1 // sideCountDenominator
447
+ );
448
+ break;
449
+
450
+ case 'star':
451
+ pJS.fn.vendors.drawShape(
452
+ pJS.canvas.ctx,
453
+ p.x - radius*2 / (pJS.particles.shape.polygon.nb_sides/4), // startX
454
+ p.y - radius / (2*2.66/3.5), // startY
455
+ radius*2*2.66 / (pJS.particles.shape.polygon.nb_sides/3), // sideLength
456
+ pJS.particles.shape.polygon.nb_sides, // sideCountNumerator
457
+ 2 // sideCountDenominator
458
+ );
459
+ break;
460
+
461
+ case 'image':
462
+
463
+ function draw(){
464
+ pJS.canvas.ctx.drawImage(
465
+ img_obj,
466
+ p.x-radius,
467
+ p.y-radius,
468
+ radius*2,
469
+ radius*2 / p.img.ratio
470
+ );
471
+ }
472
+
473
+ if(pJS.tmp.img_type == 'svg'){
474
+ var img_obj = p.img.obj;
475
+ }else{
476
+ var img_obj = pJS.tmp.img_obj;
477
+ }
478
+
479
+ if(img_obj){
480
+ draw();
481
+ }
482
+
483
+ break;
484
+
485
+ }
486
+
487
+ pJS.canvas.ctx.closePath();
488
+
489
+ if(pJS.particles.shape.stroke.width > 0){
490
+ pJS.canvas.ctx.strokeStyle = pJS.particles.shape.stroke.color;
491
+ pJS.canvas.ctx.lineWidth = pJS.particles.shape.stroke.width;
492
+ pJS.canvas.ctx.stroke();
493
+ }
494
+
495
+ pJS.canvas.ctx.fill();
496
+
497
+ };
498
+
499
+
500
+ pJS.fn.particlesCreate = function(){
501
+ for(var i = 0; i < pJS.particles.number.value; i++) {
502
+ pJS.particles.array.push(new pJS.fn.particle(pJS.particles.color, pJS.particles.opacity.value));
503
+ }
504
+ };
505
+
506
+ pJS.fn.particlesUpdate = function(){
507
+
508
+ for(var i = 0; i < pJS.particles.array.length; i++){
509
+
510
+ /* the particle */
511
+ var p = pJS.particles.array[i];
512
+
513
+ // var d = ( dx = pJS.interactivity.mouse.click_pos_x - p.x ) * dx + ( dy = pJS.interactivity.mouse.click_pos_y - p.y ) * dy;
514
+ // var f = -BANG_SIZE / d;
515
+ // if ( d < BANG_SIZE ) {
516
+ // var t = Math.atan2( dy, dx );
517
+ // p.vx = f * Math.cos(t);
518
+ // p.vy = f * Math.sin(t);
519
+ // }
520
+
521
+ /* move the particle */
522
+ if(pJS.particles.move.enable){
523
+ var ms = pJS.particles.move.speed/2;
524
+ p.x += p.vx * ms;
525
+ p.y += p.vy * ms;
526
+ }
527
+
528
+ /* change opacity status */
529
+ if(pJS.particles.opacity.anim.enable) {
530
+ if(p.opacity_status == true) {
531
+ if(p.opacity >= pJS.particles.opacity.value) p.opacity_status = false;
532
+ p.opacity += p.vo;
533
+ }else {
534
+ if(p.opacity <= pJS.particles.opacity.anim.opacity_min) p.opacity_status = true;
535
+ p.opacity -= p.vo;
536
+ }
537
+ if(p.opacity < 0) p.opacity = 0;
538
+ }
539
+
540
+ /* change size */
541
+ if(pJS.particles.size.anim.enable){
542
+ if(p.size_status == true){
543
+ if(p.radius >= pJS.particles.size.value) p.size_status = false;
544
+ p.radius += p.vs;
545
+ }else{
546
+ if(p.radius <= pJS.particles.size.anim.size_min) p.size_status = true;
547
+ p.radius -= p.vs;
548
+ }
549
+ if(p.radius < 0) p.radius = 0;
550
+ }
551
+
552
+ /* change particle position if it is out of canvas */
553
+ if(pJS.particles.move.out_mode == 'bounce'){
554
+ var new_pos = {
555
+ x_left: p.radius,
556
+ x_right: pJS.canvas.w,
557
+ y_top: p.radius,
558
+ y_bottom: pJS.canvas.h
559
+ }
560
+ }else{
561
+ var new_pos = {
562
+ x_left: -p.radius,
563
+ x_right: pJS.canvas.w + p.radius,
564
+ y_top: -p.radius,
565
+ y_bottom: pJS.canvas.h + p.radius
566
+ }
567
+ }
568
+
569
+ if(p.x - p.radius > pJS.canvas.w){
570
+ p.x = new_pos.x_left;
571
+ p.y = Math.random() * pJS.canvas.h;
572
+ }
573
+ else if(p.x + p.radius < 0){
574
+ p.x = new_pos.x_right;
575
+ p.y = Math.random() * pJS.canvas.h;
576
+ }
577
+ if(p.y - p.radius > pJS.canvas.h){
578
+ p.y = new_pos.y_top;
579
+ p.x = Math.random() * pJS.canvas.w;
580
+ }
581
+ else if(p.y + p.radius < 0){
582
+ p.y = new_pos.y_bottom;
583
+ p.x = Math.random() * pJS.canvas.w;
584
+ }
585
+
586
+ /* out of canvas modes */
587
+ switch(pJS.particles.move.out_mode){
588
+ case 'bounce':
589
+ if (p.x + p.radius > pJS.canvas.w) p.vx = -p.vx;
590
+ else if (p.x - p.radius < 0) p.vx = -p.vx;
591
+ if (p.y + p.radius > pJS.canvas.h) p.vy = -p.vy;
592
+ else if (p.y - p.radius < 0) p.vy = -p.vy;
593
+ break;
594
+ }
595
+
596
+ /* events */
597
+ if(isInArray('grab', pJS.interactivity.events.onhover.mode)){
598
+ pJS.fn.modes.grabParticle(p);
599
+ }
600
+
601
+ if(isInArray('bubble', pJS.interactivity.events.onhover.mode) || isInArray('bubble', pJS.interactivity.events.onclick.mode)){
602
+ pJS.fn.modes.bubbleParticle(p);
603
+ }
604
+
605
+ if(isInArray('repulse', pJS.interactivity.events.onhover.mode) || isInArray('repulse', pJS.interactivity.events.onclick.mode)){
606
+ pJS.fn.modes.repulseParticle(p);
607
+ }
608
+
609
+ /* interaction auto between particles */
610
+ if(pJS.particles.line_linked.enable || pJS.particles.move.attract.enable){
611
+ for(var j = i + 1; j < pJS.particles.array.length; j++){
612
+ var p2 = pJS.particles.array[j];
613
+
614
+ /* link particles */
615
+ if(pJS.particles.line_linked.enable){
616
+ pJS.fn.interact.linkParticles(p,p2);
617
+ }
618
+
619
+ /* attract particles */
620
+ if(pJS.particles.move.attract.enable){
621
+ pJS.fn.interact.attractParticles(p,p2);
622
+ }
623
+
624
+ /* bounce particles */
625
+ if(pJS.particles.move.bounce){
626
+ pJS.fn.interact.bounceParticles(p,p2);
627
+ }
628
+
629
+ }
630
+ }
631
+
632
+
633
+ }
634
+
635
+ };
636
+
637
+ pJS.fn.particlesDraw = function(){
638
+
639
+ /* clear canvas */
640
+ pJS.canvas.ctx.clearRect(0, 0, pJS.canvas.w, pJS.canvas.h);
641
+
642
+ /* update each particles param */
643
+ pJS.fn.particlesUpdate();
644
+
645
+ /* draw each particle */
646
+ for(var i = 0; i < pJS.particles.array.length; i++){
647
+ var p = pJS.particles.array[i];
648
+ p.draw();
649
+ }
650
+
651
+ };
652
+
653
+ pJS.fn.particlesEmpty = function(){
654
+ pJS.particles.array = [];
655
+ };
656
+
657
+ pJS.fn.particlesRefresh = function(){
658
+
659
+ /* init all */
660
+ cancelRequestAnimFrame(pJS.fn.checkAnimFrame);
661
+ cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
662
+ pJS.tmp.source_svg = undefined;
663
+ pJS.tmp.img_obj = undefined;
664
+ pJS.tmp.count_svg = 0;
665
+ pJS.fn.particlesEmpty();
666
+ pJS.fn.canvasClear();
667
+
668
+ /* restart */
669
+ pJS.fn.vendors.start();
670
+
671
+ };
672
+
673
+
674
+ /* ---------- pJS functions - particles interaction ------------ */
675
+
676
+ pJS.fn.interact.linkParticles = function(p1, p2){
677
+
678
+ var dx = p1.x - p2.x,
679
+ dy = p1.y - p2.y,
680
+ dist = Math.sqrt(dx*dx + dy*dy);
681
+
682
+ /* draw a line between p1 and p2 if the distance between them is under the config distance */
683
+ if(dist <= pJS.particles.line_linked.distance){
684
+
685
+ var opacity_line = pJS.particles.line_linked.opacity - (dist / (1/pJS.particles.line_linked.opacity)) / pJS.particles.line_linked.distance;
686
+
687
+ if(opacity_line > 0){
688
+
689
+ /* style */
690
+ var color_line = pJS.particles.line_linked.color_rgb_line;
691
+ pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')';
692
+ pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;
693
+ //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */
694
+
695
+ /* path */
696
+ pJS.canvas.ctx.beginPath();
697
+ pJS.canvas.ctx.moveTo(p1.x, p1.y);
698
+ pJS.canvas.ctx.lineTo(p2.x, p2.y);
699
+ pJS.canvas.ctx.stroke();
700
+ pJS.canvas.ctx.closePath();
701
+
702
+ }
703
+
704
+ }
705
+
706
+ };
707
+
708
+
709
+ pJS.fn.interact.attractParticles = function(p1, p2){
710
+
711
+ /* condensed particles */
712
+ var dx = p1.x - p2.x,
713
+ dy = p1.y - p2.y,
714
+ dist = Math.sqrt(dx*dx + dy*dy);
715
+
716
+ if(dist <= pJS.particles.line_linked.distance){
717
+
718
+ var ax = dx/(pJS.particles.move.attract.rotateX*1000),
719
+ ay = dy/(pJS.particles.move.attract.rotateY*1000);
720
+
721
+ p1.vx -= ax;
722
+ p1.vy -= ay;
723
+
724
+ p2.vx += ax;
725
+ p2.vy += ay;
726
+
727
+ }
728
+
729
+
730
+ }
731
+
732
+
733
+ pJS.fn.interact.bounceParticles = function(p1, p2){
734
+
735
+ var dx = p1.x - p2.x,
736
+ dy = p1.y - p2.y,
737
+ dist = Math.sqrt(dx*dx + dy*dy),
738
+ dist_p = p1.radius+p2.radius;
739
+
740
+ if(dist <= dist_p){
741
+ p1.vx = -p1.vx;
742
+ p1.vy = -p1.vy;
743
+
744
+ p2.vx = -p2.vx;
745
+ p2.vy = -p2.vy;
746
+ }
747
+
748
+ }
749
+
750
+
751
+ /* ---------- pJS functions - modes events ------------ */
752
+
753
+ pJS.fn.modes.pushParticles = function(nb, pos){
754
+
755
+ pJS.tmp.pushing = true;
756
+
757
+ for(var i = 0; i < nb; i++){
758
+ pJS.particles.array.push(
759
+ new pJS.fn.particle(
760
+ pJS.particles.color,
761
+ pJS.particles.opacity.value,
762
+ {
763
+ 'x': pos ? pos.pos_x : Math.random() * pJS.canvas.w,
764
+ 'y': pos ? pos.pos_y : Math.random() * pJS.canvas.h
765
+ }
766
+ )
767
+ )
768
+ if(i == nb-1){
769
+ if(!pJS.particles.move.enable){
770
+ pJS.fn.particlesDraw();
771
+ }
772
+ pJS.tmp.pushing = false;
773
+ }
774
+ }
775
+
776
+ };
777
+
778
+
779
+ pJS.fn.modes.removeParticles = function(nb){
780
+
781
+ pJS.particles.array.splice(0, nb);
782
+ if(!pJS.particles.move.enable){
783
+ pJS.fn.particlesDraw();
784
+ }
785
+
786
+ };
787
+
788
+
789
+ pJS.fn.modes.bubbleParticle = function(p){
790
+
791
+ /* on hover event */
792
+ if(pJS.interactivity.events.onhover.enable && isInArray('bubble', pJS.interactivity.events.onhover.mode)){
793
+
794
+ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,
795
+ dy_mouse = p.y - pJS.interactivity.mouse.pos_y,
796
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse),
797
+ ratio = 1 - dist_mouse / pJS.interactivity.modes.bubble.distance;
798
+
799
+ function init(){
800
+ p.opacity_bubble = p.opacity;
801
+ p.radius_bubble = p.radius;
802
+ }
803
+
804
+ /* mousemove - check ratio */
805
+ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){
806
+
807
+ if(ratio >= 0 && pJS.interactivity.status == 'mousemove'){
808
+
809
+ /* size */
810
+ if(pJS.interactivity.modes.bubble.size != pJS.particles.size.value){
811
+
812
+ if(pJS.interactivity.modes.bubble.size > pJS.particles.size.value){
813
+ var size = p.radius + (pJS.interactivity.modes.bubble.size*ratio);
814
+ if(size >= 0){
815
+ p.radius_bubble = size;
816
+ }
817
+ }else{
818
+ var dif = p.radius - pJS.interactivity.modes.bubble.size,
819
+ size = p.radius - (dif*ratio);
820
+ if(size > 0){
821
+ p.radius_bubble = size;
822
+ }else{
823
+ p.radius_bubble = 0;
824
+ }
825
+ }
826
+
827
+ }
828
+
829
+ /* opacity */
830
+ if(pJS.interactivity.modes.bubble.opacity != pJS.particles.opacity.value){
831
+
832
+ if(pJS.interactivity.modes.bubble.opacity > pJS.particles.opacity.value){
833
+ var opacity = pJS.interactivity.modes.bubble.opacity*ratio;
834
+ if(opacity > p.opacity && opacity <= pJS.interactivity.modes.bubble.opacity){
835
+ p.opacity_bubble = opacity;
836
+ }
837
+ }else{
838
+ var opacity = p.opacity - (pJS.particles.opacity.value-pJS.interactivity.modes.bubble.opacity)*ratio;
839
+ if(opacity < p.opacity && opacity >= pJS.interactivity.modes.bubble.opacity){
840
+ p.opacity_bubble = opacity;
841
+ }
842
+ }
843
+
844
+ }
845
+
846
+ }
847
+
848
+ }else{
849
+ init();
850
+ }
851
+
852
+
853
+ /* mouseleave */
854
+ if(pJS.interactivity.status == 'mouseleave'){
855
+ init();
856
+ }
857
+
858
+ }
859
+
860
+ /* on click event */
861
+ else if(pJS.interactivity.events.onclick.enable && isInArray('bubble', pJS.interactivity.events.onclick.mode)){
862
+
863
+
864
+ if(pJS.tmp.bubble_clicking){
865
+ var dx_mouse = p.x - pJS.interactivity.mouse.click_pos_x,
866
+ dy_mouse = p.y - pJS.interactivity.mouse.click_pos_y,
867
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse),
868
+ time_spent = (new Date().getTime() - pJS.interactivity.mouse.click_time)/1000;
869
+
870
+ if(time_spent > pJS.interactivity.modes.bubble.duration){
871
+ pJS.tmp.bubble_duration_end = true;
872
+ }
873
+
874
+ if(time_spent > pJS.interactivity.modes.bubble.duration*2){
875
+ pJS.tmp.bubble_clicking = false;
876
+ pJS.tmp.bubble_duration_end = false;
877
+ }
878
+ }
879
+
880
+
881
+ function process(bubble_param, particles_param, p_obj_bubble, p_obj, id){
882
+
883
+ if(bubble_param != particles_param){
884
+
885
+ if(!pJS.tmp.bubble_duration_end){
886
+ if(dist_mouse <= pJS.interactivity.modes.bubble.distance){
887
+ if(p_obj_bubble != undefined) var obj = p_obj_bubble;
888
+ else var obj = p_obj;
889
+ if(obj != bubble_param){
890
+ var value = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration);
891
+ if(id == 'size') p.radius_bubble = value;
892
+ if(id == 'opacity') p.opacity_bubble = value;
893
+ }
894
+ }else{
895
+ if(id == 'size') p.radius_bubble = undefined;
896
+ if(id == 'opacity') p.opacity_bubble = undefined;
897
+ }
898
+ }else{
899
+ if(p_obj_bubble != undefined){
900
+ var value_tmp = p_obj - (time_spent * (p_obj - bubble_param) / pJS.interactivity.modes.bubble.duration),
901
+ dif = bubble_param - value_tmp;
902
+ value = bubble_param + dif;
903
+ if(id == 'size') p.radius_bubble = value;
904
+ if(id == 'opacity') p.opacity_bubble = value;
905
+ }
906
+ }
907
+
908
+ }
909
+
910
+ }
911
+
912
+ if(pJS.tmp.bubble_clicking){
913
+ /* size */
914
+ process(pJS.interactivity.modes.bubble.size, pJS.particles.size.value, p.radius_bubble, p.radius, 'size');
915
+ /* opacity */
916
+ process(pJS.interactivity.modes.bubble.opacity, pJS.particles.opacity.value, p.opacity_bubble, p.opacity, 'opacity');
917
+ }
918
+
919
+ }
920
+
921
+ };
922
+
923
+
924
+ pJS.fn.modes.repulseParticle = function(p){
925
+
926
+ if(pJS.interactivity.events.onhover.enable && isInArray('repulse', pJS.interactivity.events.onhover.mode) && pJS.interactivity.status == 'mousemove') {
927
+
928
+ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,
929
+ dy_mouse = p.y - pJS.interactivity.mouse.pos_y,
930
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse);
931
+
932
+ var normVec = {x: dx_mouse/dist_mouse, y: dy_mouse/dist_mouse},
933
+ repulseRadius = pJS.interactivity.modes.repulse.distance,
934
+ velocity = 100,
935
+ repulseFactor = clamp((1/repulseRadius)*(-1*Math.pow(dist_mouse/repulseRadius,2)+1)*repulseRadius*velocity, 0, 50);
936
+
937
+ var pos = {
938
+ x: p.x + normVec.x * repulseFactor,
939
+ y: p.y + normVec.y * repulseFactor
940
+ }
941
+
942
+ if(pJS.particles.move.out_mode == 'bounce'){
943
+ if(pos.x - p.radius > 0 && pos.x + p.radius < pJS.canvas.w) p.x = pos.x;
944
+ if(pos.y - p.radius > 0 && pos.y + p.radius < pJS.canvas.h) p.y = pos.y;
945
+ }else{
946
+ p.x = pos.x;
947
+ p.y = pos.y;
948
+ }
949
+
950
+ }
951
+
952
+
953
+ else if(pJS.interactivity.events.onclick.enable && isInArray('repulse', pJS.interactivity.events.onclick.mode)) {
954
+
955
+ if(!pJS.tmp.repulse_finish){
956
+ pJS.tmp.repulse_count++;
957
+ if(pJS.tmp.repulse_count == pJS.particles.array.length){
958
+ pJS.tmp.repulse_finish = true;
959
+ }
960
+ }
961
+
962
+ if(pJS.tmp.repulse_clicking){
963
+
964
+ var repulseRadius = Math.pow(pJS.interactivity.modes.repulse.distance/6, 3);
965
+
966
+ var dx = pJS.interactivity.mouse.click_pos_x - p.x,
967
+ dy = pJS.interactivity.mouse.click_pos_y - p.y,
968
+ d = dx*dx + dy*dy;
969
+
970
+ var force = -repulseRadius / d * 1;
971
+
972
+ function process(){
973
+
974
+ var f = Math.atan2(dy,dx);
975
+ p.vx = force * Math.cos(f);
976
+ p.vy = force * Math.sin(f);
977
+
978
+ if(pJS.particles.move.out_mode == 'bounce'){
979
+ var pos = {
980
+ x: p.x + p.vx,
981
+ y: p.y + p.vy
982
+ }
983
+ if (pos.x + p.radius > pJS.canvas.w) p.vx = -p.vx;
984
+ else if (pos.x - p.radius < 0) p.vx = -p.vx;
985
+ if (pos.y + p.radius > pJS.canvas.h) p.vy = -p.vy;
986
+ else if (pos.y - p.radius < 0) p.vy = -p.vy;
987
+ }
988
+
989
+ }
990
+
991
+ // default
992
+ if(d <= repulseRadius){
993
+ process();
994
+ }
995
+
996
+ // bang - slow motion mode
997
+ // if(!pJS.tmp.repulse_finish){
998
+ // if(d <= repulseRadius){
999
+ // process();
1000
+ // }
1001
+ // }else{
1002
+ // process();
1003
+ // }
1004
+
1005
+
1006
+ }else{
1007
+
1008
+ if(pJS.tmp.repulse_clicking == false){
1009
+
1010
+ p.vx = p.vx_i;
1011
+ p.vy = p.vy_i;
1012
+
1013
+ }
1014
+
1015
+ }
1016
+
1017
+ }
1018
+
1019
+ }
1020
+
1021
+
1022
+ pJS.fn.modes.grabParticle = function(p){
1023
+
1024
+ if(pJS.interactivity.events.onhover.enable && pJS.interactivity.status == 'mousemove'){
1025
+
1026
+ var dx_mouse = p.x - pJS.interactivity.mouse.pos_x,
1027
+ dy_mouse = p.y - pJS.interactivity.mouse.pos_y,
1028
+ dist_mouse = Math.sqrt(dx_mouse*dx_mouse + dy_mouse*dy_mouse);
1029
+
1030
+ /* draw a line between the cursor and the particle if the distance between them is under the config distance */
1031
+ if(dist_mouse <= pJS.interactivity.modes.grab.distance){
1032
+
1033
+ var opacity_line = pJS.interactivity.modes.grab.line_linked.opacity - (dist_mouse / (1/pJS.interactivity.modes.grab.line_linked.opacity)) / pJS.interactivity.modes.grab.distance;
1034
+
1035
+ if(opacity_line > 0){
1036
+
1037
+ /* style */
1038
+ var color_line = pJS.particles.line_linked.color_rgb_line;
1039
+ pJS.canvas.ctx.strokeStyle = 'rgba('+color_line.r+','+color_line.g+','+color_line.b+','+opacity_line+')';
1040
+ pJS.canvas.ctx.lineWidth = pJS.particles.line_linked.width;
1041
+ //pJS.canvas.ctx.lineCap = 'round'; /* performance issue */
1042
+
1043
+ /* path */
1044
+ pJS.canvas.ctx.beginPath();
1045
+ pJS.canvas.ctx.moveTo(p.x, p.y);
1046
+ pJS.canvas.ctx.lineTo(pJS.interactivity.mouse.pos_x, pJS.interactivity.mouse.pos_y);
1047
+ pJS.canvas.ctx.stroke();
1048
+ pJS.canvas.ctx.closePath();
1049
+
1050
+ }
1051
+
1052
+ }
1053
+
1054
+ }
1055
+
1056
+ };
1057
+
1058
+
1059
+
1060
+ /* ---------- pJS functions - vendors ------------ */
1061
+
1062
+ pJS.fn.vendors.eventsListeners = function(){
1063
+
1064
+ /* events target element */
1065
+ if(pJS.interactivity.detect_on == 'window'){
1066
+ pJS.interactivity.el = window;
1067
+ }else{
1068
+ pJS.interactivity.el = pJS.canvas.el;
1069
+ }
1070
+
1071
+
1072
+ /* detect mouse pos - on hover / click event */
1073
+ if(pJS.interactivity.events.onhover.enable || pJS.interactivity.events.onclick.enable){
1074
+
1075
+ /* el on mousemove */
1076
+ pJS.interactivity.el.addEventListener('mousemove', function(e){
1077
+
1078
+ if(pJS.interactivity.el == window){
1079
+ var pos_x = e.clientX,
1080
+ pos_y = e.clientY;
1081
+ }
1082
+ else{
1083
+ var pos_x = e.offsetX || e.clientX,
1084
+ pos_y = e.offsetY || e.clientY;
1085
+ }
1086
+
1087
+ pJS.interactivity.mouse.pos_x = pos_x;
1088
+ pJS.interactivity.mouse.pos_y = pos_y;
1089
+
1090
+ if(pJS.tmp.retina){
1091
+ pJS.interactivity.mouse.pos_x *= pJS.canvas.pxratio;
1092
+ pJS.interactivity.mouse.pos_y *= pJS.canvas.pxratio;
1093
+ }
1094
+
1095
+ pJS.interactivity.status = 'mousemove';
1096
+
1097
+ });
1098
+
1099
+ /* el on onmouseleave */
1100
+ pJS.interactivity.el.addEventListener('mouseleave', function(e){
1101
+
1102
+ pJS.interactivity.mouse.pos_x = null;
1103
+ pJS.interactivity.mouse.pos_y = null;
1104
+ pJS.interactivity.status = 'mouseleave';
1105
+
1106
+ });
1107
+
1108
+ }
1109
+
1110
+ /* on click event */
1111
+ if(pJS.interactivity.events.onclick.enable){
1112
+
1113
+ pJS.interactivity.el.addEventListener('click', function(){
1114
+
1115
+ pJS.interactivity.mouse.click_pos_x = pJS.interactivity.mouse.pos_x;
1116
+ pJS.interactivity.mouse.click_pos_y = pJS.interactivity.mouse.pos_y;
1117
+ pJS.interactivity.mouse.click_time = new Date().getTime();
1118
+
1119
+ if(pJS.interactivity.events.onclick.enable){
1120
+
1121
+ switch(pJS.interactivity.events.onclick.mode){
1122
+
1123
+ case 'push':
1124
+ if(pJS.particles.move.enable){
1125
+ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);
1126
+ }else{
1127
+ if(pJS.interactivity.modes.push.particles_nb == 1){
1128
+ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb, pJS.interactivity.mouse);
1129
+ }
1130
+ else if(pJS.interactivity.modes.push.particles_nb > 1){
1131
+ pJS.fn.modes.pushParticles(pJS.interactivity.modes.push.particles_nb);
1132
+ }
1133
+ }
1134
+ break;
1135
+
1136
+ case 'remove':
1137
+ pJS.fn.modes.removeParticles(pJS.interactivity.modes.remove.particles_nb);
1138
+ break;
1139
+
1140
+ case 'bubble':
1141
+ pJS.tmp.bubble_clicking = true;
1142
+ break;
1143
+
1144
+ case 'repulse':
1145
+ pJS.tmp.repulse_clicking = true;
1146
+ pJS.tmp.repulse_count = 0;
1147
+ pJS.tmp.repulse_finish = false;
1148
+ setTimeout(function(){
1149
+ pJS.tmp.repulse_clicking = false;
1150
+ }, pJS.interactivity.modes.repulse.duration*1000)
1151
+ break;
1152
+
1153
+ }
1154
+
1155
+ }
1156
+
1157
+ });
1158
+
1159
+ }
1160
+
1161
+
1162
+ };
1163
+
1164
+ pJS.fn.vendors.densityAutoParticles = function(){
1165
+
1166
+ if(pJS.particles.number.density.enable){
1167
+
1168
+ /* calc area */
1169
+ var area = pJS.canvas.el.width * pJS.canvas.el.height / 1000;
1170
+ if(pJS.tmp.retina){
1171
+ area = area/(pJS.canvas.pxratio*2);
1172
+ }
1173
+
1174
+ /* calc number of particles based on density area */
1175
+ var nb_particles = area * pJS.particles.number.value / pJS.particles.number.density.value_area;
1176
+
1177
+ /* add or remove X particles */
1178
+ var missing_particles = pJS.particles.array.length - nb_particles;
1179
+ if(missing_particles < 0) pJS.fn.modes.pushParticles(Math.abs(missing_particles));
1180
+ else pJS.fn.modes.removeParticles(missing_particles);
1181
+
1182
+ }
1183
+
1184
+ };
1185
+
1186
+
1187
+ pJS.fn.vendors.checkOverlap = function(p1, position){
1188
+ for(var i = 0; i < pJS.particles.array.length; i++){
1189
+ var p2 = pJS.particles.array[i];
1190
+
1191
+ var dx = p1.x - p2.x,
1192
+ dy = p1.y - p2.y,
1193
+ dist = Math.sqrt(dx*dx + dy*dy);
1194
+
1195
+ if(dist <= p1.radius + p2.radius){
1196
+ p1.x = position ? position.x : Math.random() * pJS.canvas.w;
1197
+ p1.y = position ? position.y : Math.random() * pJS.canvas.h;
1198
+ pJS.fn.vendors.checkOverlap(p1);
1199
+ }
1200
+ }
1201
+ };
1202
+
1203
+
1204
+ pJS.fn.vendors.createSvgImg = function(p){
1205
+
1206
+ /* set color to svg element */
1207
+ var svgXml = pJS.tmp.source_svg,
1208
+ rgbHex = /#([0-9A-F]{3,6})/gi,
1209
+ coloredSvgXml = svgXml.replace(rgbHex, function (m, r, g, b) {
1210
+ if(p.color.rgb){
1211
+ var color_value = 'rgba('+p.color.rgb.r+','+p.color.rgb.g+','+p.color.rgb.b+','+p.opacity+')';
1212
+ }else{
1213
+ var color_value = 'hsla('+p.color.hsl.h+','+p.color.hsl.s+'%,'+p.color.hsl.l+'%,'+p.opacity+')';
1214
+ }
1215
+ return color_value;
1216
+ });
1217
+
1218
+ /* prepare to create img with colored svg */
1219
+ var svg = new Blob([coloredSvgXml], {type: 'image/svg+xml;charset=utf-8'}),
1220
+ DOMURL = window.URL || window.webkitURL || window,
1221
+ url = DOMURL.createObjectURL(svg);
1222
+
1223
+ /* create particle img obj */
1224
+ var img = new Image();
1225
+ img.addEventListener('load', function(){
1226
+ p.img.obj = img;
1227
+ p.img.loaded = true;
1228
+ DOMURL.revokeObjectURL(url);
1229
+ pJS.tmp.count_svg++;
1230
+ });
1231
+ img.src = url;
1232
+
1233
+ };
1234
+
1235
+
1236
+ pJS.fn.vendors.destroypJS = function(){
1237
+ cancelAnimationFrame(pJS.fn.drawAnimFrame);
1238
+ canvas_el.remove();
1239
+ pJSDom = null;
1240
+ };
1241
+
1242
+
1243
+ pJS.fn.vendors.drawShape = function(c, startX, startY, sideLength, sideCountNumerator, sideCountDenominator){
1244
+
1245
+ // By Programming Thomas - https://programmingthomas.wordpress.com/2013/04/03/n-sided-shapes/
1246
+ var sideCount = sideCountNumerator * sideCountDenominator;
1247
+ var decimalSides = sideCountNumerator / sideCountDenominator;
1248
+ var interiorAngleDegrees = (180 * (decimalSides - 2)) / decimalSides;
1249
+ var interiorAngle = Math.PI - Math.PI * interiorAngleDegrees / 180; // convert to radians
1250
+ c.save();
1251
+ c.beginPath();
1252
+ c.translate(startX, startY);
1253
+ c.moveTo(0,0);
1254
+ for (var i = 0; i < sideCount; i++) {
1255
+ c.lineTo(sideLength,0);
1256
+ c.translate(sideLength,0);
1257
+ c.rotate(interiorAngle);
1258
+ }
1259
+ //c.stroke();
1260
+ c.fill();
1261
+ c.restore();
1262
+
1263
+ };
1264
+
1265
+ pJS.fn.vendors.exportImg = function(){
1266
+ window.open(pJS.canvas.el.toDataURL('image/png'), '_blank');
1267
+ };
1268
+
1269
+
1270
+ pJS.fn.vendors.loadImg = function(type){
1271
+
1272
+ pJS.tmp.img_error = undefined;
1273
+
1274
+ if(pJS.particles.shape.image.src != ''){
1275
+
1276
+ if(type == 'svg'){
1277
+
1278
+ var xhr = new XMLHttpRequest();
1279
+ xhr.open('GET', pJS.particles.shape.image.src);
1280
+ xhr.onreadystatechange = function (data) {
1281
+ if(xhr.readyState == 4){
1282
+ if(xhr.status == 200){
1283
+ pJS.tmp.source_svg = data.currentTarget.response;
1284
+ pJS.fn.vendors.checkBeforeDraw();
1285
+ }else{
1286
+ console.log('Error pJS - Image not found');
1287
+ pJS.tmp.img_error = true;
1288
+ }
1289
+ }
1290
+ }
1291
+ xhr.send();
1292
+
1293
+ }else{
1294
+
1295
+ var img = new Image();
1296
+ img.addEventListener('load', function(){
1297
+ pJS.tmp.img_obj = img;
1298
+ pJS.fn.vendors.checkBeforeDraw();
1299
+ });
1300
+ img.src = pJS.particles.shape.image.src;
1301
+
1302
+ }
1303
+
1304
+ }else{
1305
+ console.log('Error pJS - No image.src');
1306
+ pJS.tmp.img_error = true;
1307
+ }
1308
+
1309
+ };
1310
+
1311
+
1312
+ pJS.fn.vendors.draw = function(){
1313
+
1314
+ if(pJS.particles.shape.type == 'image'){
1315
+
1316
+ if(pJS.tmp.img_type == 'svg'){
1317
+
1318
+ if(pJS.tmp.count_svg >= pJS.particles.number.value){
1319
+ pJS.fn.particlesDraw();
1320
+ if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
1321
+ else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1322
+ }else{
1323
+ //console.log('still loading...');
1324
+ if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1325
+ }
1326
+
1327
+ }else{
1328
+
1329
+ if(pJS.tmp.img_obj != undefined){
1330
+ pJS.fn.particlesDraw();
1331
+ if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
1332
+ else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1333
+ }else{
1334
+ if(!pJS.tmp.img_error) pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1335
+ }
1336
+
1337
+ }
1338
+
1339
+ }else{
1340
+ pJS.fn.particlesDraw();
1341
+ if(!pJS.particles.move.enable) cancelRequestAnimFrame(pJS.fn.drawAnimFrame);
1342
+ else pJS.fn.drawAnimFrame = requestAnimFrame(pJS.fn.vendors.draw);
1343
+ }
1344
+
1345
+ };
1346
+
1347
+
1348
+ pJS.fn.vendors.checkBeforeDraw = function(){
1349
+
1350
+ // if shape is image
1351
+ if(pJS.particles.shape.type == 'image'){
1352
+
1353
+ if(pJS.tmp.img_type == 'svg' && pJS.tmp.source_svg == undefined){
1354
+ pJS.tmp.checkAnimFrame = requestAnimFrame(check);
1355
+ }else{
1356
+ //console.log('images loaded! cancel check');
1357
+ cancelRequestAnimFrame(pJS.tmp.checkAnimFrame);
1358
+ if(!pJS.tmp.img_error){
1359
+ pJS.fn.vendors.init();
1360
+ pJS.fn.vendors.draw();
1361
+ }
1362
+
1363
+ }
1364
+
1365
+ }else{
1366
+ pJS.fn.vendors.init();
1367
+ pJS.fn.vendors.draw();
1368
+ }
1369
+
1370
+ };
1371
+
1372
+
1373
+ pJS.fn.vendors.init = function(){
1374
+
1375
+ /* init canvas + particles */
1376
+ pJS.fn.retinaInit();
1377
+ pJS.fn.canvasInit();
1378
+ pJS.fn.canvasSize();
1379
+ pJS.fn.canvasPaint();
1380
+ pJS.fn.particlesCreate();
1381
+ pJS.fn.vendors.densityAutoParticles();
1382
+
1383
+ /* particles.line_linked - convert hex colors to rgb */
1384
+ pJS.particles.line_linked.color_rgb_line = hexToRgb(pJS.particles.line_linked.color);
1385
+
1386
+ };
1387
+
1388
+
1389
+ pJS.fn.vendors.start = function(){
1390
+
1391
+ if(isInArray('image', pJS.particles.shape.type)){
1392
+ pJS.tmp.img_type = pJS.particles.shape.image.src.substr(pJS.particles.shape.image.src.length - 3);
1393
+ pJS.fn.vendors.loadImg(pJS.tmp.img_type);
1394
+ }else{
1395
+ pJS.fn.vendors.checkBeforeDraw();
1396
+ }
1397
+
1398
+ };
1399
+
1400
+
1401
+
1402
+
1403
+ /* ---------- pJS - start ------------ */
1404
+
1405
+
1406
+ pJS.fn.vendors.eventsListeners();
1407
+
1408
+ pJS.fn.vendors.start();
1409
+
1410
+
1411
+
1412
+ };
1413
+
1414
+ /* ---------- global functions - vendors ------------ */
1415
+
1416
+ Object.deepExtend = function(destination, source) {
1417
+ for (var property in source) {
1418
+ if (source[property] && source[property].constructor &&
1419
+ source[property].constructor === Object) {
1420
+ destination[property] = destination[property] || {};
1421
+ arguments.callee(destination[property], source[property]);
1422
+ } else {
1423
+ destination[property] = source[property];
1424
+ }
1425
+ }
1426
+ return destination;
1427
+ };
1428
+
1429
+ window.requestAnimFrame = (function(){
1430
+ return window.requestAnimationFrame ||
1431
+ window.webkitRequestAnimationFrame ||
1432
+ window.mozRequestAnimationFrame ||
1433
+ window.oRequestAnimationFrame ||
1434
+ window.msRequestAnimationFrame ||
1435
+ function(callback){
1436
+ window.setTimeout(callback, 1000 / 60);
1437
+ };
1438
+ })();
1439
+
1440
+ window.cancelRequestAnimFrame = ( function() {
1441
+ return window.cancelAnimationFrame ||
1442
+ window.webkitCancelRequestAnimationFrame ||
1443
+ window.mozCancelRequestAnimationFrame ||
1444
+ window.oCancelRequestAnimationFrame ||
1445
+ window.msCancelRequestAnimationFrame ||
1446
+ clearTimeout
1447
+ } )();
1448
+
1449
+ function hexToRgb(hex){
1450
+ // By Tim Down - http://stackoverflow.com/a/5624139/3493650
1451
+ // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
1452
+ var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
1453
+ hex = hex.replace(shorthandRegex, function(m, r, g, b) {
1454
+ return r + r + g + g + b + b;
1455
+ });
1456
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1457
+ return result ? {
1458
+ r: parseInt(result[1], 16),
1459
+ g: parseInt(result[2], 16),
1460
+ b: parseInt(result[3], 16)
1461
+ } : null;
1462
+ };
1463
+
1464
+ function clamp(number, min, max) {
1465
+ return Math.min(Math.max(number, min), max);
1466
+ };
1467
+
1468
+ function isInArray(value, array) {
1469
+ return array.indexOf(value) > -1;
1470
+ }
1471
+
1472
+
1473
+ /* ---------- particles.js functions - start ------------ */
1474
+
1475
+ window.pJSDom = [];
1476
+
1477
+ window.particlesJS = function(tag_id, params){
1478
+
1479
+ /* no string id? so it's object params, and set the id with default id */
1480
+ if(typeof(tag_id) != 'string'){
1481
+ params = tag_id;
1482
+ tag_id = 'particles-js';
1483
+ }
1484
+
1485
+ /* no id? set the id to default id */
1486
+ if(!tag_id){
1487
+ tag_id = 'particles-js';
1488
+ }
1489
+
1490
+ /* pJS elements */
1491
+ var pJS_tag = document.getElementById(tag_id),
1492
+ pJS_canvas_class = 'particles-js-canvas-el',
1493
+ exist_canvas = pJS_tag.getElementsByClassName(pJS_canvas_class);
1494
+
1495
+ /* remove canvas if exists into the pJS target tag */
1496
+ if(exist_canvas.length){
1497
+ while(exist_canvas.length > 0){
1498
+ pJS_tag.removeChild(exist_canvas[0]);
1499
+ }
1500
+ }
1501
+
1502
+ /* create canvas element */
1503
+ var canvas_el = document.createElement('canvas');
1504
+ canvas_el.className = pJS_canvas_class;
1505
+
1506
+ /* set size canvas */
1507
+ canvas_el.style.width = "100%";
1508
+ canvas_el.style.height = "100%";
1509
+
1510
+ /* append canvas */
1511
+ var canvas = document.getElementById(tag_id).appendChild(canvas_el);
1512
+
1513
+ /* launch particle.js */
1514
+ if(canvas != null){
1515
+ pJSDom.push(new pJS(tag_id, params));
1516
+ }
1517
+
1518
+ };
1519
+
1520
+ window.particlesJS.load = function(tag_id, path_config_json, callback){
1521
+
1522
+ /* load json config */
1523
+ var xhr = new XMLHttpRequest();
1524
+ xhr.open('GET', path_config_json);
1525
+ xhr.onreadystatechange = function (data) {
1526
+ if(xhr.readyState == 4){
1527
+ if(xhr.status == 200){
1528
+ var params = JSON.parse(data.currentTarget.response);
1529
+ window.particlesJS(tag_id, params);
1530
+ if(callback) callback();
1531
+ }else{
1532
+ console.log('Error pJS - XMLHttpRequest status: '+xhr.status);
1533
+ console.log('Error pJS - File config not found');
1534
+ }
1535
+ }
1536
+ };
1537
+ xhr.send();
1538
+
1539
+ };
assets/js/particles.min.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /* -----------------------------------------------
2
+ /* Author : Vincent Garreau - vincentgarreau.com
3
+ /* MIT license: http://opensource.org/licenses/MIT
4
+ /* Demo / Generator : vincentgarreau.com/particles.js
5
+ /* GitHub : github.com/VincentGarreau/particles.js
6
+ /* How to use? : Check the GitHub README
7
+ /* v2.0.0
8
+ /* ----------------------------------------------- */
9
+ function hexToRgb(e){var a=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function clamp(e,a,t){return Math.min(Math.max(e,a),t)}function isInArray(e,a){return a.indexOf(e)>-1}var pJS=function(e,a){var t=document.querySelector("#"+e+" > .particles-js-canvas-el");this.pJS={canvas:{el:t,w:t.offsetWidth,h:t.offsetHeight},particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}},array:[]},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}},mouse:{}},retina_detect:!1,fn:{interact:{},modes:{},vendors:{}},tmp:{}};var i=this.pJS;a&&Object.deepExtend(i,a),i.tmp.obj={size_value:i.particles.size.value,size_anim_speed:i.particles.size.anim.speed,move_speed:i.particles.move.speed,line_linked_distance:i.particles.line_linked.distance,line_linked_width:i.particles.line_linked.width,mode_grab_distance:i.interactivity.modes.grab.distance,mode_bubble_distance:i.interactivity.modes.bubble.distance,mode_bubble_size:i.interactivity.modes.bubble.size,mode_repulse_distance:i.interactivity.modes.repulse.distance},i.fn.retinaInit=function(){i.retina_detect&&window.devicePixelRatio>1?(i.canvas.pxratio=window.devicePixelRatio,i.tmp.retina=!0):(i.canvas.pxratio=1,i.tmp.retina=!1),i.canvas.w=i.canvas.el.offsetWidth*i.canvas.pxratio,i.canvas.h=i.canvas.el.offsetHeight*i.canvas.pxratio,i.particles.size.value=i.tmp.obj.size_value*i.canvas.pxratio,i.particles.size.anim.speed=i.tmp.obj.size_anim_speed*i.canvas.pxratio,i.particles.move.speed=i.tmp.obj.move_speed*i.canvas.pxratio,i.particles.line_linked.distance=i.tmp.obj.line_linked_distance*i.canvas.pxratio,i.interactivity.modes.grab.distance=i.tmp.obj.mode_grab_distance*i.canvas.pxratio,i.interactivity.modes.bubble.distance=i.tmp.obj.mode_bubble_distance*i.canvas.pxratio,i.particles.line_linked.width=i.tmp.obj.line_linked_width*i.canvas.pxratio,i.interactivity.modes.bubble.size=i.tmp.obj.mode_bubble_size*i.canvas.pxratio,i.interactivity.modes.repulse.distance=i.tmp.obj.mode_repulse_distance*i.canvas.pxratio},i.fn.canvasInit=function(){i.canvas.ctx=i.canvas.el.getContext("2d")},i.fn.canvasSize=function(){i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i&&i.interactivity.events.resize&&window.addEventListener("resize",function(){i.canvas.w=i.canvas.el.offsetWidth,i.canvas.h=i.canvas.el.offsetHeight,i.tmp.retina&&(i.canvas.w*=i.canvas.pxratio,i.canvas.h*=i.canvas.pxratio),i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i.particles.move.enable||(i.fn.particlesEmpty(),i.fn.particlesCreate(),i.fn.particlesDraw(),i.fn.vendors.densityAutoParticles()),i.fn.vendors.densityAutoParticles()})},i.fn.canvasPaint=function(){i.canvas.ctx.fillRect(0,0,i.canvas.w,i.canvas.h)},i.fn.canvasClear=function(){i.canvas.ctx.clearRect(0,0,i.canvas.w,i.canvas.h)},i.fn.particle=function(e,a,t){if(this.radius=(i.particles.size.random?Math.random():1)*i.particles.size.value,i.particles.size.anim.enable&&(this.size_status=!1,this.vs=i.particles.size.anim.speed/100,i.particles.size.anim.sync||(this.vs=this.vs*Math.random())),this.x=t?t.x:Math.random()*i.canvas.w,this.y=t?t.y:Math.random()*i.canvas.h,this.x>i.canvas.w-2*this.radius?this.x=this.x-this.radius:this.x<2*this.radius&&(this.x=this.x+this.radius),this.y>i.canvas.h-2*this.radius?this.y=this.y-this.radius:this.y<2*this.radius&&(this.y=this.y+this.radius),i.particles.move.bounce&&i.fn.vendors.checkOverlap(this,t),this.color={},"object"==typeof e.value)if(e.value instanceof Array){var s=e.value[Math.floor(Math.random()*i.particles.color.value.length)];this.color.rgb=hexToRgb(s)}else void 0!=e.value.r&&void 0!=e.value.g&&void 0!=e.value.b&&(this.color.rgb={r:e.value.r,g:e.value.g,b:e.value.b}),void 0!=e.value.h&&void 0!=e.value.s&&void 0!=e.value.l&&(this.color.hsl={h:e.value.h,s:e.value.s,l:e.value.l});else"random"==e.value?this.color.rgb={r:Math.floor(256*Math.random())+0,g:Math.floor(256*Math.random())+0,b:Math.floor(256*Math.random())+0}:"string"==typeof e.value&&(this.color=e,this.color.rgb=hexToRgb(this.color.value));this.opacity=(i.particles.opacity.random?Math.random():1)*i.particles.opacity.value,i.particles.opacity.anim.enable&&(this.opacity_status=!1,this.vo=i.particles.opacity.anim.speed/100,i.particles.opacity.anim.sync||(this.vo=this.vo*Math.random()));var n={};switch(i.particles.move.direction){case"top":n={x:0,y:-1};break;case"top-right":n={x:.5,y:-.5};break;case"right":n={x:1,y:-0};break;case"bottom-right":n={x:.5,y:.5};break;case"bottom":n={x:0,y:1};break;case"bottom-left":n={x:-.5,y:1};break;case"left":n={x:-1,y:0};break;case"top-left":n={x:-.5,y:-.5};break;default:n={x:0,y:0}}i.particles.move.straight?(this.vx=n.x,this.vy=n.y,i.particles.move.random&&(this.vx=this.vx*Math.random(),this.vy=this.vy*Math.random())):(this.vx=n.x+Math.random()-.5,this.vy=n.y+Math.random()-.5),this.vx_i=this.vx,this.vy_i=this.vy;var r=i.particles.shape.type;if("object"==typeof r){if(r instanceof Array){var c=r[Math.floor(Math.random()*r.length)];this.shape=c}}else this.shape=r;if("image"==this.shape){var o=i.particles.shape;this.img={src:o.image.src,ratio:o.image.width/o.image.height},this.img.ratio||(this.img.ratio=1),"svg"==i.tmp.img_type&&void 0!=i.tmp.source_svg&&(i.fn.vendors.createSvgImg(this),i.tmp.pushing&&(this.img.loaded=!1))}},i.fn.particle.prototype.draw=function(){function e(){i.canvas.ctx.drawImage(r,a.x-t,a.y-t,2*t,2*t/a.img.ratio)}var a=this;if(void 0!=a.radius_bubble)var t=a.radius_bubble;else var t=a.radius;if(void 0!=a.opacity_bubble)var s=a.opacity_bubble;else var s=a.opacity;if(a.color.rgb)var n="rgba("+a.color.rgb.r+","+a.color.rgb.g+","+a.color.rgb.b+","+s+")";else var n="hsla("+a.color.hsl.h+","+a.color.hsl.s+"%,"+a.color.hsl.l+"%,"+s+")";switch(i.canvas.ctx.fillStyle=n,i.canvas.ctx.beginPath(),a.shape){case"circle":i.canvas.ctx.arc(a.x,a.y,t,0,2*Math.PI,!1);break;case"edge":i.canvas.ctx.rect(a.x-t,a.y-t,2*t,2*t);break;case"triangle":i.fn.vendors.drawShape(i.canvas.ctx,a.x-t,a.y+t/1.66,2*t,3,2);break;case"polygon":i.fn.vendors.drawShape(i.canvas.ctx,a.x-t/(i.particles.shape.polygon.nb_sides/3.5),a.y-t/.76,2.66*t/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,1);break;case"star":i.fn.vendors.drawShape(i.canvas.ctx,a.x-2*t/(i.particles.shape.polygon.nb_sides/4),a.y-t/1.52,2*t*2.66/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,2);break;case"image":if("svg"==i.tmp.img_type)var r=a.img.obj;else var r=i.tmp.img_obj;r&&e()}i.canvas.ctx.closePath(),i.particles.shape.stroke.width>0&&(i.canvas.ctx.strokeStyle=i.particles.shape.stroke.color,i.canvas.ctx.lineWidth=i.particles.shape.stroke.width,i.canvas.ctx.stroke()),i.canvas.ctx.fill()},i.fn.particlesCreate=function(){for(var e=0;e<i.particles.number.value;e++)i.particles.array.push(new i.fn.particle(i.particles.color,i.particles.opacity.value))},i.fn.particlesUpdate=function(){for(var e=0;e<i.particles.array.length;e++){var a=i.particles.array[e];if(i.particles.move.enable){var t=i.particles.move.speed/2;a.x+=a.vx*t,a.y+=a.vy*t}if(i.particles.opacity.anim.enable&&(1==a.opacity_status?(a.opacity>=i.particles.opacity.value&&(a.opacity_status=!1),a.opacity+=a.vo):(a.opacity<=i.particles.opacity.anim.opacity_min&&(a.opacity_status=!0),a.opacity-=a.vo),a.opacity<0&&(a.opacity=0)),i.particles.size.anim.enable&&(1==a.size_status?(a.radius>=i.particles.size.value&&(a.size_status=!1),a.radius+=a.vs):(a.radius<=i.particles.size.anim.size_min&&(a.size_status=!0),a.radius-=a.vs),a.radius<0&&(a.radius=0)),"bounce"==i.particles.move.out_mode)var s={x_left:a.radius,x_right:i.canvas.w,y_top:a.radius,y_bottom:i.canvas.h};else var s={x_left:-a.radius,x_right:i.canvas.w+a.radius,y_top:-a.radius,y_bottom:i.canvas.h+a.radius};switch(a.x-a.radius>i.canvas.w?(a.x=s.x_left,a.y=Math.random()*i.canvas.h):a.x+a.radius<0&&(a.x=s.x_right,a.y=Math.random()*i.canvas.h),a.y-a.radius>i.canvas.h?(a.y=s.y_top,a.x=Math.random()*i.canvas.w):a.y+a.radius<0&&(a.y=s.y_bottom,a.x=Math.random()*i.canvas.w),i.particles.move.out_mode){case"bounce":a.x+a.radius>i.canvas.w?a.vx=-a.vx:a.x-a.radius<0&&(a.vx=-a.vx),a.y+a.radius>i.canvas.h?a.vy=-a.vy:a.y-a.radius<0&&(a.vy=-a.vy)}if(isInArray("grab",i.interactivity.events.onhover.mode)&&i.fn.modes.grabParticle(a),(isInArray("bubble",i.interactivity.events.onhover.mode)||isInArray("bubble",i.interactivity.events.onclick.mode))&&i.fn.modes.bubbleParticle(a),(isInArray("repulse",i.interactivity.events.onhover.mode)||isInArray("repulse",i.interactivity.events.onclick.mode))&&i.fn.modes.repulseParticle(a),i.particles.line_linked.enable||i.particles.move.attract.enable)for(var n=e+1;n<i.particles.array.length;n++){var r=i.particles.array[n];i.particles.line_linked.enable&&i.fn.interact.linkParticles(a,r),i.particles.move.attract.enable&&i.fn.interact.attractParticles(a,r),i.particles.move.bounce&&i.fn.interact.bounceParticles(a,r)}}},i.fn.particlesDraw=function(){i.canvas.ctx.clearRect(0,0,i.canvas.w,i.canvas.h),i.fn.particlesUpdate();for(var e=0;e<i.particles.array.length;e++){var a=i.particles.array[e];a.draw()}},i.fn.particlesEmpty=function(){i.particles.array=[]},i.fn.particlesRefresh=function(){cancelRequestAnimFrame(i.fn.checkAnimFrame),cancelRequestAnimFrame(i.fn.drawAnimFrame),i.tmp.source_svg=void 0,i.tmp.img_obj=void 0,i.tmp.count_svg=0,i.fn.particlesEmpty(),i.fn.canvasClear(),i.fn.vendors.start()},i.fn.interact.linkParticles=function(e,a){var t=e.x-a.x,s=e.y-a.y,n=Math.sqrt(t*t+s*s);if(n<=i.particles.line_linked.distance){var r=i.particles.line_linked.opacity-n/(1/i.particles.line_linked.opacity)/i.particles.line_linked.distance;if(r>0){var c=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+c.r+","+c.g+","+c.b+","+r+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(a.x,a.y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}},i.fn.interact.attractParticles=function(e,a){var t=e.x-a.x,s=e.y-a.y,n=Math.sqrt(t*t+s*s);if(n<=i.particles.line_linked.distance){var r=t/(1e3*i.particles.move.attract.rotateX),c=s/(1e3*i.particles.move.attract.rotateY);e.vx-=r,e.vy-=c,a.vx+=r,a.vy+=c}},i.fn.interact.bounceParticles=function(e,a){var t=e.x-a.x,i=e.y-a.y,s=Math.sqrt(t*t+i*i),n=e.radius+a.radius;n>=s&&(e.vx=-e.vx,e.vy=-e.vy,a.vx=-a.vx,a.vy=-a.vy)},i.fn.modes.pushParticles=function(e,a){i.tmp.pushing=!0;for(var t=0;e>t;t++)i.particles.array.push(new i.fn.particle(i.particles.color,i.particles.opacity.value,{x:a?a.pos_x:Math.random()*i.canvas.w,y:a?a.pos_y:Math.random()*i.canvas.h})),t==e-1&&(i.particles.move.enable||i.fn.particlesDraw(),i.tmp.pushing=!1)},i.fn.modes.removeParticles=function(e){i.particles.array.splice(0,e),i.particles.move.enable||i.fn.particlesDraw()},i.fn.modes.bubbleParticle=function(e){function a(){e.opacity_bubble=e.opacity,e.radius_bubble=e.radius}function t(a,t,s,n,c){if(a!=t)if(i.tmp.bubble_duration_end){if(void 0!=s){var o=n-p*(n-a)/i.interactivity.modes.bubble.duration,l=a-o;d=a+l,"size"==c&&(e.radius_bubble=d),"opacity"==c&&(e.opacity_bubble=d)}}else if(r<=i.interactivity.modes.bubble.distance){if(void 0!=s)var v=s;else var v=n;if(v!=a){var d=n-p*(n-a)/i.interactivity.modes.bubble.duration;"size"==c&&(e.radius_bubble=d),"opacity"==c&&(e.opacity_bubble=d)}}else"size"==c&&(e.radius_bubble=void 0),"opacity"==c&&(e.opacity_bubble=void 0)}if(i.interactivity.events.onhover.enable&&isInArray("bubble",i.interactivity.events.onhover.mode)){var s=e.x-i.interactivity.mouse.pos_x,n=e.y-i.interactivity.mouse.pos_y,r=Math.sqrt(s*s+n*n),c=1-r/i.interactivity.modes.bubble.distance;if(r<=i.interactivity.modes.bubble.distance){if(c>=0&&"mousemove"==i.interactivity.status){if(i.interactivity.modes.bubble.size!=i.particles.size.value)if(i.interactivity.modes.bubble.size>i.particles.size.value){var o=e.radius+i.interactivity.modes.bubble.size*c;o>=0&&(e.radius_bubble=o)}else{var l=e.radius-i.interactivity.modes.bubble.size,o=e.radius-l*c;o>0?e.radius_bubble=o:e.radius_bubble=0}if(i.interactivity.modes.bubble.opacity!=i.particles.opacity.value)if(i.interactivity.modes.bubble.opacity>i.particles.opacity.value){var v=i.interactivity.modes.bubble.opacity*c;v>e.opacity&&v<=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=v)}else{var v=e.opacity-(i.particles.opacity.value-i.interactivity.modes.bubble.opacity)*c;v<e.opacity&&v>=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=v)}}}else a();"mouseleave"==i.interactivity.status&&a()}else if(i.interactivity.events.onclick.enable&&isInArray("bubble",i.interactivity.events.onclick.mode)){if(i.tmp.bubble_clicking){var s=e.x-i.interactivity.mouse.click_pos_x,n=e.y-i.interactivity.mouse.click_pos_y,r=Math.sqrt(s*s+n*n),p=((new Date).getTime()-i.interactivity.mouse.click_time)/1e3;p>i.interactivity.modes.bubble.duration&&(i.tmp.bubble_duration_end=!0),p>2*i.interactivity.modes.bubble.duration&&(i.tmp.bubble_clicking=!1,i.tmp.bubble_duration_end=!1)}i.tmp.bubble_clicking&&(t(i.interactivity.modes.bubble.size,i.particles.size.value,e.radius_bubble,e.radius,"size"),t(i.interactivity.modes.bubble.opacity,i.particles.opacity.value,e.opacity_bubble,e.opacity,"opacity"))}},i.fn.modes.repulseParticle=function(e){function a(){var a=Math.atan2(d,p);if(e.vx=u*Math.cos(a),e.vy=u*Math.sin(a),"bounce"==i.particles.move.out_mode){var t={x:e.x+e.vx,y:e.y+e.vy};t.x+e.radius>i.canvas.w?e.vx=-e.vx:t.x-e.radius<0&&(e.vx=-e.vx),t.y+e.radius>i.canvas.h?e.vy=-e.vy:t.y-e.radius<0&&(e.vy=-e.vy)}}if(i.interactivity.events.onhover.enable&&isInArray("repulse",i.interactivity.events.onhover.mode)&&"mousemove"==i.interactivity.status){var t=e.x-i.interactivity.mouse.pos_x,s=e.y-i.interactivity.mouse.pos_y,n=Math.sqrt(t*t+s*s),r={x:t/n,y:s/n},c=i.interactivity.modes.repulse.distance,o=100,l=clamp(1/c*(-1*Math.pow(n/c,2)+1)*c*o,0,50),v={x:e.x+r.x*l,y:e.y+r.y*l};"bounce"==i.particles.move.out_mode?(v.x-e.radius>0&&v.x+e.radius<i.canvas.w&&(e.x=v.x),v.y-e.radius>0&&v.y+e.radius<i.canvas.h&&(e.y=v.y)):(e.x=v.x,e.y=v.y)}else if(i.interactivity.events.onclick.enable&&isInArray("repulse",i.interactivity.events.onclick.mode))if(i.tmp.repulse_finish||(i.tmp.repulse_count++,i.tmp.repulse_count==i.particles.array.length&&(i.tmp.repulse_finish=!0)),i.tmp.repulse_clicking){var c=Math.pow(i.interactivity.modes.repulse.distance/6,3),p=i.interactivity.mouse.click_pos_x-e.x,d=i.interactivity.mouse.click_pos_y-e.y,m=p*p+d*d,u=-c/m*1;c>=m&&a()}else 0==i.tmp.repulse_clicking&&(e.vx=e.vx_i,e.vy=e.vy_i)},i.fn.modes.grabParticle=function(e){if(i.interactivity.events.onhover.enable&&"mousemove"==i.interactivity.status){var a=e.x-i.interactivity.mouse.pos_x,t=e.y-i.interactivity.mouse.pos_y,s=Math.sqrt(a*a+t*t);if(s<=i.interactivity.modes.grab.distance){var n=i.interactivity.modes.grab.line_linked.opacity-s/(1/i.interactivity.modes.grab.line_linked.opacity)/i.interactivity.modes.grab.distance;if(n>0){var r=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+r.r+","+r.g+","+r.b+","+n+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(i.interactivity.mouse.pos_x,i.interactivity.mouse.pos_y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}}},i.fn.vendors.eventsListeners=function(){"window"==i.interactivity.detect_on?i.interactivity.el=window:i.interactivity.el=i.canvas.el,(i.interactivity.events.onhover.enable||i.interactivity.events.onclick.enable)&&(i.interactivity.el.addEventListener("mousemove",function(e){if(i.interactivity.el==window)var a=e.clientX,t=e.clientY;else var a=e.offsetX||e.clientX,t=e.offsetY||e.clientY;i.interactivity.mouse.pos_x=a,i.interactivity.mouse.pos_y=t,i.tmp.retina&&(i.interactivity.mouse.pos_x*=i.canvas.pxratio,i.interactivity.mouse.pos_y*=i.canvas.pxratio),i.interactivity.status="mousemove"}),i.interactivity.el.addEventListener("mouseleave",function(e){i.interactivity.mouse.pos_x=null,i.interactivity.mouse.pos_y=null,i.interactivity.status="mouseleave"})),i.interactivity.events.onclick.enable&&i.interactivity.el.addEventListener("click",function(){if(i.interactivity.mouse.click_pos_x=i.interactivity.mouse.pos_x,i.interactivity.mouse.click_pos_y=i.interactivity.mouse.pos_y,i.interactivity.mouse.click_time=(new Date).getTime(),i.interactivity.events.onclick.enable)switch(i.interactivity.events.onclick.mode){case"push":i.particles.move.enable?i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb,i.interactivity.mouse):1==i.interactivity.modes.push.particles_nb?i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb,i.interactivity.mouse):i.interactivity.modes.push.particles_nb>1&&i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb);break;case"remove":i.fn.modes.removeParticles(i.interactivity.modes.remove.particles_nb);break;case"bubble":i.tmp.bubble_clicking=!0;break;case"repulse":i.tmp.repulse_clicking=!0,i.tmp.repulse_count=0,i.tmp.repulse_finish=!1,setTimeout(function(){i.tmp.repulse_clicking=!1},1e3*i.interactivity.modes.repulse.duration)}})},i.fn.vendors.densityAutoParticles=function(){if(i.particles.number.density.enable){var e=i.canvas.el.width*i.canvas.el.height/1e3;i.tmp.retina&&(e/=2*i.canvas.pxratio);var a=e*i.particles.number.value/i.particles.number.density.value_area,t=i.particles.array.length-a;0>t?i.fn.modes.pushParticles(Math.abs(t)):i.fn.modes.removeParticles(t)}},i.fn.vendors.checkOverlap=function(e,a){for(var t=0;t<i.particles.array.length;t++){var s=i.particles.array[t],n=e.x-s.x,r=e.y-s.y,c=Math.sqrt(n*n+r*r);c<=e.radius+s.radius&&(e.x=a?a.x:Math.random()*i.canvas.w,e.y=a?a.y:Math.random()*i.canvas.h,i.fn.vendors.checkOverlap(e))}},i.fn.vendors.createSvgImg=function(e){var a=i.tmp.source_svg,t=/#([0-9A-F]{3,6})/gi,s=a.replace(t,function(a,t,i,s){if(e.color.rgb)var n="rgba("+e.color.rgb.r+","+e.color.rgb.g+","+e.color.rgb.b+","+e.opacity+")";else var n="hsla("+e.color.hsl.h+","+e.color.hsl.s+"%,"+e.color.hsl.l+"%,"+e.opacity+")";return n}),n=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),r=window.URL||window.webkitURL||window,c=r.createObjectURL(n),o=new Image;o.addEventListener("load",function(){e.img.obj=o,e.img.loaded=!0,r.revokeObjectURL(c),i.tmp.count_svg++}),o.src=c},i.fn.vendors.destroypJS=function(){cancelAnimationFrame(i.fn.drawAnimFrame),t.remove(),pJSDom=null},i.fn.vendors.drawShape=function(e,a,t,i,s,n){var r=s*n,c=s/n,o=180*(c-2)/c,l=Math.PI-Math.PI*o/180;e.save(),e.beginPath(),e.translate(a,t),e.moveTo(0,0);for(var v=0;r>v;v++)e.lineTo(i,0),e.translate(i,0),e.rotate(l);e.fill(),e.restore()},i.fn.vendors.exportImg=function(){window.open(i.canvas.el.toDataURL("image/png"),"_blank")},i.fn.vendors.loadImg=function(e){if(i.tmp.img_error=void 0,""!=i.particles.shape.image.src)if("svg"==e){var a=new XMLHttpRequest;a.open("GET",i.particles.shape.image.src),a.onreadystatechange=function(e){4==a.readyState&&(200==a.status?(i.tmp.source_svg=e.currentTarget.response,i.fn.vendors.checkBeforeDraw()):(console.log("Error pJS - Image not found"),i.tmp.img_error=!0))},a.send()}else{var t=new Image;t.addEventListener("load",function(){i.tmp.img_obj=t,i.fn.vendors.checkBeforeDraw()}),t.src=i.particles.shape.image.src}else console.log("Error pJS - No image.src"),i.tmp.img_error=!0},i.fn.vendors.draw=function(){"image"==i.particles.shape.type?"svg"==i.tmp.img_type?i.tmp.count_svg>=i.particles.number.value?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):void 0!=i.tmp.img_obj?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame))},i.fn.vendors.checkBeforeDraw=function(){"image"==i.particles.shape.type?"svg"==i.tmp.img_type&&void 0==i.tmp.source_svg?i.tmp.checkAnimFrame=requestAnimFrame(check):(cancelRequestAnimFrame(i.tmp.checkAnimFrame),i.tmp.img_error||(i.fn.vendors.init(),i.fn.vendors.draw())):(i.fn.vendors.init(),i.fn.vendors.draw())},i.fn.vendors.init=function(){i.fn.retinaInit(),i.fn.canvasInit(),i.fn.canvasSize(),i.fn.canvasPaint(),i.fn.particlesCreate(),i.fn.vendors.densityAutoParticles(),i.particles.line_linked.color_rgb_line=hexToRgb(i.particles.line_linked.color)},i.fn.vendors.start=function(){isInArray("image",i.particles.shape.type)?(i.tmp.img_type=i.particles.shape.image.src.substr(i.particles.shape.image.src.length-3),i.fn.vendors.loadImg(i.tmp.img_type)):i.fn.vendors.checkBeforeDraw()},i.fn.vendors.eventsListeners(),i.fn.vendors.start()};Object.deepExtend=function(e,a){for(var t in a)a[t]&&a[t].constructor&&a[t].constructor===Object?(e[t]=e[t]||{},arguments.callee(e[t],a[t])):e[t]=a[t];return e},window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),window.cancelRequestAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout}(),window.pJSDom=[],window.particlesJS=function(e,a){"string"!=typeof e&&(a=e,e="particles-js"),e||(e="particles-js");var t=document.getElementById(e),i="particles-js-canvas-el",s=t.getElementsByClassName(i);if(s.length)for(;s.length>0;)t.removeChild(s[0]);var n=document.createElement("canvas");n.className=i,n.style.width="100%",n.style.height="100%";var r=document.getElementById(e).appendChild(n);null!=r&&pJSDom.push(new pJS(e,a))},window.particlesJS.load=function(e,a,t){var i=new XMLHttpRequest;i.open("GET",a),i.onreadystatechange=function(a){if(4==i.readyState)if(200==i.status){var s=JSON.parse(a.currentTarget.response);window.particlesJS(e,s),t&&t()}else console.log("Error pJS - XMLHttpRequest status: "+i.status),console.log("Error pJS - File config not found")},i.send()};
assets/js/stickyanything.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net
3
+ */
4
+ (function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k));
5
+ if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q,
6
+ u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),
7
+ h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}),
8
+ a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize",
9
+ y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this);
assets/screenshot-1.png ADDED
Binary file
assets/screenshot-2.png ADDED
Binary file
assets/screenshot-3.png ADDED
Binary file
assets/screenshot-4.png ADDED
Binary file
elementor-addon-elements.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Elementor Addon Elements
4
+ * Description: Add new elements to Elementor page builder plugin.
5
+ * Plugin URI: http://www.elementoraddons.com/
6
+ * Author: WebTechStreet
7
+ * Version: 1.1
8
+ * Author URI: http://www.webtchstreet.com/
9
+ *
10
+ * Text Domain: wts-eae
11
+ */
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
+
15
+ define( 'ELEMENTOR_ADDON_URL', plugins_url( '/', __FILE__ ) );
16
+ define( 'ELEMENTOR_ADDON_PATH', plugin_dir_path( __FILE__ ) );
17
+
18
+
19
+ require_once ELEMENTOR_ADDON_PATH.'inc/elementor-helper.php';
20
+
21
+ if(is_admin()){
22
+ require_once ELEMENTOR_ADDON_PATH. 'inc/admin/settings-page.php';
23
+ require_once ELEMENTOR_ADDON_PATH. 'inc/admin/controls.php';
24
+ require_once ELEMENTOR_ADDON_PATH. 'inc/admin/Settings.php';
25
+ }
26
+
27
+
28
+ function add_new_elements(){
29
+
30
+
31
+ require_once ELEMENTOR_ADDON_PATH.'inc/helper.php';
32
+
33
+ // load elements
34
+ require_once ELEMENTOR_ADDON_PATH.'elements/textseparator.php';
35
+ require_once ELEMENTOR_ADDON_PATH.'elements/pricetable.php';
36
+ require_once ELEMENTOR_ADDON_PATH.'elements/flipbox.php';
37
+ require_once ELEMENTOR_ADDON_PATH.'elements/shape-separator.php';
38
+ require_once ELEMENTOR_ADDON_PATH.'elements/post-list.php';
39
+ require_once ELEMENTOR_ADDON_PATH.'elements/animated-text.php';
40
+ require_once ELEMENTOR_ADDON_PATH.'elements/splittext.php';
41
+
42
+ require_once ELEMENTOR_ADDON_PATH.'elements/twitter.php';
43
+
44
+ require_once ELEMENTOR_ADDON_PATH.'elements/gmap.php';
45
+
46
+ require_once ELEMENTOR_ADDON_PATH.'elements/image-compare.php';
47
+
48
+
49
+ }
50
+ add_action('elementor/widgets/widgets_registered','add_new_elements');
51
+
52
+
53
+
54
+
55
+
56
+ function eae_scripts(){
57
+ wp_enqueue_style('eae-css',ELEMENTOR_ADDON_URL.'assets/css/eae.css');
58
+
59
+ /* animated text css and js file*/
60
+ wp_enqueue_script('animated-main',ELEMENTOR_ADDON_URL.'assets/js/animated-main.js', array('jquery'),'1.0', true);
61
+
62
+ wp_enqueue_script('eae-main',ELEMENTOR_ADDON_URL.'assets/js/eae.js', array('jquery'),'1.0', true);
63
+
64
+ wp_enqueue_script('eae-partices',ELEMENTOR_ADDON_URL.'assets/js/particles.js', array('jquery'),'1.0', true);
65
+
66
+
67
+
68
+ $map_key = get_option('wts_eae_gmap_key');
69
+ if(isset($map_key) && $map_key != ''){
70
+ wp_register_script('eae-gmap', 'https://maps.googleapis.com/maps/api/js?key='.$map_key);
71
+ }
72
+
73
+ wp_register_script('pinit', '//assets.pinterest.com/js/pinit.js', '', '', false);
74
+
75
+
76
+ wp_register_script('eae-stickyanything',ELEMENTOR_ADDON_URL.'assets/js/stickyanything.js',array('jquery'),'1.1.2',true);
77
+
78
+ }
79
+ add_action( 'wp_enqueue_scripts', 'eae_scripts' );
80
+
81
+
82
+
83
+ function eae_editor_enqueue_scripts(){
84
+ wp_enqueue_script('eae-partices',ELEMENTOR_ADDON_URL.'assets/js/particles.js', array('jquery'),'1.0', true);
85
+ }
86
+ add_action('elementor/editor/wp_head', 'eae_editor_enqueue_scripts');
87
+
88
+
89
+
90
+
91
+
92
+ function _editor_enqueue_scripts(){
93
+ $map_key = get_option('wts_eae_gmap_key');
94
+ if(isset($map_key) && $map_key != ''){
95
+ wp_enqueue_script('eae-gmap', 'https://maps.googleapis.com/maps/api/js?key='.$map_key);
96
+ }
97
+
98
+ wp_enqueue_script('pinit', '//assets.pinterest.com/js/pinit.js');
99
+ }
100
+ add_action('elementor/editor/wp_head', '_editor_enqueue_scripts');
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
elements/advance-tabs.php ADDED
@@ -0,0 +1,743 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_Advance_Tabs extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-advance-tabs';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Advance Tabs', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-divider wts-eae-pe';
18
+ }
19
+
20
+
21
+ public function get_categories() {
22
+ return [ 'wts-eae' ];
23
+ }
24
+
25
+ public function get_script_depends() {
26
+ return [ 'eae-stickyanything' ];
27
+ }
28
+
29
+ protected function _register_controls() {
30
+
31
+ $this->start_controls_section(
32
+ 'section_tabs',
33
+ [
34
+ 'label' => __( 'Tabs', 'elementor' )
35
+ ]
36
+ );
37
+ $this->add_control(
38
+ 'tab_position',
39
+ [
40
+ 'label' => __( 'Tab Position', 'elementor' ),
41
+ 'type' => Controls_Manager::SELECT,
42
+ 'options' => [
43
+ 'top' => __( 'Top', 'elementor' ),
44
+ 'left' => __( 'Left', 'elementor' ),
45
+ ],
46
+ 'default' => 'top',
47
+ 'prefix_class' => 'eae-nav-pos-',
48
+ ]
49
+ );
50
+
51
+ $this->add_control(
52
+ 'tab_Sticky',
53
+ [
54
+ 'label' => __( 'Sticky Tab', 'elementor' ),
55
+ 'type' => Controls_Manager::SWITCHER,
56
+ 'options' => [
57
+ 'yes' => __( 'Yes', 'elementor' ),
58
+ 'no' => __( 'No', 'elementor' ),
59
+ ],
60
+ 'default' => 'no',
61
+ //'prefix_class' => 'eae-nav-sticky-',
62
+
63
+ ]
64
+ );
65
+
66
+ $this->add_control(
67
+ 'scroll_offset',
68
+ [
69
+ 'label' => __( 'Scroll Offset', 'elementor' ),
70
+ 'type' => Controls_Manager::TEXT,
71
+ 'default' => 20,
72
+ 'condition' => [
73
+ 'tab_Sticky' => 'yes',
74
+ ],
75
+ ]
76
+ );
77
+
78
+ $repeater = new Repeater();
79
+
80
+ $repeater->add_control('tab_title',
81
+ [
82
+ 'label' => __( 'Tab Title', 'elementor' ),
83
+ 'type' => Controls_Manager::TEXT,
84
+ 'default' => __( 'Tab Title', 'elementor' ),
85
+ 'placeholder' => __( 'Tab Title', 'elementor' ),
86
+ 'label_block' => true,
87
+ ]
88
+ );
89
+
90
+ $repeater->add_control(
91
+ 'tab_element',
92
+ [
93
+ 'label' => __( 'Tab Element', 'elementor' ),
94
+ 'type' => Controls_Manager::CHOOSE,
95
+ 'options' => [
96
+ 'none' => [
97
+ 'title' => __( 'None', 'elementor' ),
98
+ 'icon' => 'fa fa-ban',
99
+ ],
100
+ 'image' => [
101
+ 'title' => __( 'Image', 'elementor' ),
102
+ 'icon' => 'fa fa-picture-o',
103
+ ],
104
+ 'icon' => [
105
+ 'title' => __( 'Icon', 'elementor' ),
106
+ 'icon' => 'fa fa-star',
107
+
108
+ ],
109
+ ],
110
+ 'default' => 'icon',
111
+ ]
112
+ );
113
+
114
+ $repeater->add_control('tab_image',
115
+ [
116
+ 'label' => __( 'Choose Image', 'elementor' ),
117
+ 'type' => Controls_Manager::MEDIA,
118
+ 'default' => [
119
+ 'url' => Utils::get_placeholder_image_src(),
120
+ ],
121
+ 'condition' => [
122
+ 'tab_element' => 'image',
123
+ ],
124
+ 'show_label' => true,
125
+ ]
126
+ );
127
+
128
+ $repeater->add_group_control(
129
+ Group_Control_Image_Size::get_type(),
130
+ [
131
+ 'name' => 'tab_image_size', // Actually its `image_size`
132
+ 'default' => 'thumbnail',
133
+ 'condition' => [
134
+ 'tab_element' => 'image',
135
+ 'tab_image[id]!' => '',
136
+ ],
137
+ ]
138
+ );
139
+
140
+ $repeater->add_control(
141
+ 'tab_icon',
142
+ [
143
+ 'label' => __( 'Icon', 'elementor' ),
144
+ 'type' => Controls_Manager::ICON,
145
+ 'default' => 'fa fa-star',
146
+ 'condition' => [
147
+ 'tab_element' => 'icon',
148
+ ],
149
+ ]
150
+ );
151
+
152
+ $repeater->add_control('tab_content',
153
+ [
154
+ 'label' => __( 'Content', 'elementor' ),
155
+ 'default' => __( 'Tab Content', 'elementor' ),
156
+ 'placeholder' => __( 'Tab Content', 'elementor' ),
157
+ 'type' => Controls_Manager::WYSIWYG,
158
+ 'show_label' => true,
159
+ ]
160
+ );
161
+
162
+ $this->add_control(
163
+ 'eae_tabs',
164
+ [
165
+ 'label' => __( 'Tabs Items', 'elementor' ),
166
+ 'type' => Controls_Manager::REPEATER,
167
+ 'default' => [
168
+ [
169
+ 'tab_title' => __( 'Adv Tab 1', 'elementor' ),
170
+ 'tab_content' => __( 'Advance responsive tab', 'elementor' ),
171
+ ],
172
+ [
173
+ 'tab_title' => __( 'Adv Tab 2', 'elementor' ),
174
+ 'tab_content' => __( 'Advance responsive tab', 'elementor' ),
175
+ ],
176
+ ],
177
+ 'show_label' => true,
178
+ 'fields' => array_values($repeater->get_controls()),
179
+ 'title_field' => '{{{ tab_title }}}',
180
+ ]
181
+ );
182
+
183
+ $this->end_controls_section();
184
+
185
+ $this->start_controls_section(
186
+ 'tab_style',
187
+ [
188
+ 'label' => __('General', 'elementor'),
189
+ 'tab' => Controls_Manager::TAB_STYLE
190
+ ]
191
+ );
192
+
193
+
194
+ $this->add_group_control(
195
+ Group_Control_Border::get_type(),
196
+ [
197
+ 'name' => 'tab_title_border',
198
+ 'selector' => '{{WRAPPER}} .eae-tab-nav li',
199
+ ]
200
+ );
201
+
202
+ $this->add_control(
203
+ 'bord_separator',
204
+ [
205
+ 'label' => __('', 'elementor'),
206
+ 'type' => Controls_Manager::HEADING,
207
+ 'separator' => 'before',
208
+ ]
209
+ );
210
+
211
+ $this->start_controls_tabs( 'advance_tabs_menu_style' );
212
+
213
+
214
+ $this->start_controls_tab(
215
+ 'tab_menu_item_normal',
216
+ [
217
+ 'label' => __( 'Normal', 'elementor' ),
218
+ ]
219
+ );
220
+
221
+
222
+ $this->add_control(
223
+ 'tab_color',
224
+ [
225
+ 'label' => __('Color', 'elementor'),
226
+ 'type' => Controls_Manager::COLOR,
227
+ 'scheme' => [
228
+ 'type' => Scheme_Color::get_type(),
229
+ 'value' => Scheme_Color::COLOR_1
230
+ ],
231
+ 'selectors' => [
232
+ '{{WRAPPER}} .eae-tab-nav li span' => 'color: {{VALUE}}'
233
+ ]
234
+ ]
235
+ );
236
+
237
+ $this->add_control(
238
+ 'icon_color',
239
+ [
240
+ 'label' => __('Icon Color', 'elementor'),
241
+ 'type' => Controls_Manager::COLOR,
242
+ 'scheme' => [
243
+ 'type' => Scheme_Color::get_type(),
244
+ 'value' => Scheme_Color::COLOR_1
245
+ ],
246
+ 'selectors' => [
247
+ '{{WRAPPER}} .eae-tab-nav li i' => 'color: {{VALUE}}'
248
+ ]
249
+ ]
250
+ );
251
+
252
+ $this->add_control(
253
+ 'tab_background_color',
254
+ [
255
+ 'label' => __('Background Color', 'elementor'),
256
+ 'type' => Controls_Manager::COLOR,
257
+ 'selectors' => [
258
+ '{{WRAPPER}} .eae-tab-nav li' => 'background-color: {{VALUE}}'
259
+ ]
260
+ ]
261
+ );
262
+ $this->add_control(
263
+ 'tab_border_color',
264
+ [
265
+ 'label' => __('Border Color', 'elementor'),
266
+ 'type' => Controls_Manager::COLOR,
267
+ 'selectors' => [
268
+ '{{WRAPPER}} .eae-tab-nav li' => 'border-color: {{VALUE}}'
269
+ ]
270
+ ]
271
+ );
272
+
273
+ $this->add_responsive_control(
274
+ 'tab_title_border_radius',
275
+ [
276
+ 'label' => __( 'Border Radius', 'elementor' ),
277
+ 'type' => Controls_Manager::DIMENSIONS,
278
+ 'size_units' => [ 'px', '%' ],
279
+ 'selectors' => [
280
+ '{{WRAPPER}} .eae-tab-nav li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
281
+ ],
282
+ ]
283
+ );
284
+
285
+ $this -> end_controls_tab();
286
+
287
+ $this->start_controls_tab(
288
+ 'tab_menu_item_hover',
289
+ [
290
+ 'label' => __( 'hover/active', 'elementor' ),
291
+ ]
292
+ );
293
+
294
+
295
+ $this->add_control(
296
+ 'tab_color_hover',
297
+ [
298
+ 'label' => __('Color', 'elementor'),
299
+ 'type' => Controls_Manager::COLOR,
300
+ 'scheme' => [
301
+ 'type' => Scheme_Color::get_type(),
302
+ 'value' => Scheme_Color::COLOR_1
303
+ ],
304
+ 'selectors' => [
305
+ '{{WRAPPER}} .eae-tab-nav li:hover span, {{WRAPPER}} .eae-tabs nav li.tab-current span' => 'color: {{VALUE}}'
306
+ ]
307
+ ]
308
+ );
309
+
310
+ $this->add_control(
311
+ 'icon_color_hover',
312
+ [
313
+ 'label' => __('Icon Color', 'elementor'),
314
+ 'type' => Controls_Manager::COLOR,
315
+ 'scheme' => [
316
+ 'type' => Scheme_Color::get_type(),
317
+ 'value' => Scheme_Color::COLOR_2
318
+ ],
319
+ 'selectors' => [
320
+ '{{WRAPPER}} .eae-tab-nav li:hover i, {{WRAPPER}} .eae-tabs nav li.tab-current i' => 'color: {{VALUE}}'
321
+ ]
322
+ ]
323
+ );
324
+
325
+ $this->add_control(
326
+ 'tab_background_color_hover',
327
+ [
328
+ 'label' => __('Background Color', 'elementor'),
329
+ 'type' => Controls_Manager::COLOR,
330
+ 'selectors' => [
331
+ '{{WRAPPER}} .eae-tab-nav li:hover, {{WRAPPER}} .eae-tabs nav li.tab-current' => 'background-color: {{VALUE}}'
332
+ ]
333
+ ]
334
+ );
335
+ $this->add_control(
336
+ 'tab_border_color_hover',
337
+ [
338
+ 'label' => __('Border Color', 'elementor'),
339
+ 'type' => Controls_Manager::COLOR,
340
+ 'selectors' => [
341
+ '{{WRAPPER}} .eae-tab-nav li:hover' => 'border-color: {{VALUE}}'
342
+ ]
343
+ ]
344
+ );
345
+
346
+
347
+ $this->add_responsive_control(
348
+ 'tab_title_border_radius_hover',
349
+ [
350
+ 'label' => __( 'Border Radius', 'elementor' ),
351
+ 'type' => Controls_Manager::DIMENSIONS,
352
+ 'size_units' => [ 'px', '%' ],
353
+ 'selectors' => [
354
+ '{{WRAPPER}} .eae-tab-nav li:hover, {{WRAPPER}} .eae-tabs nav li.tab-current ' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
355
+ ],
356
+ ]
357
+ );
358
+
359
+ $this -> end_controls_tab();
360
+
361
+ $this -> end_controls_tabs();
362
+
363
+ $this->add_control(
364
+ 'tab_head',
365
+ [
366
+ 'label' => __('', 'elementor'),
367
+ 'type' => Controls_Manager::HEADING,
368
+ 'separator' => 'before',
369
+ ]
370
+ );
371
+
372
+ $this->add_control(
373
+ 'separator_color',
374
+ [
375
+ 'label' => __('Separator Color', 'elementor'),
376
+ 'type' => Controls_Manager::COLOR,
377
+ 'scheme' => [
378
+ 'type' => Scheme_Color::get_type(),
379
+ 'value' => Scheme_Color::COLOR_1
380
+ ],
381
+ 'selectors' => [
382
+ '{{WRAPPER}}.eae-nav-pos-top nav li.tab-current::before' => 'background: {{VALUE}}',
383
+ '{{WRAPPER}}.eae-nav-pos-top nav li.tab-current::after' => 'background: {{VALUE}}',
384
+ ]
385
+ ]
386
+ );
387
+
388
+ $this->add_control(
389
+ 'separator_height',
390
+ [
391
+ 'label' => __( 'Separator Height', 'elementor' ),
392
+ 'type' => Controls_Manager::SLIDER,
393
+ 'default' => [
394
+ 'size' => 1,
395
+ ],
396
+ 'range' => [
397
+ 'px' => [
398
+ 'min' => 0,
399
+ 'max' => 5,
400
+ ],
401
+ ],
402
+ 'selectors' => [
403
+ '{{WRAPPER}}.eae-nav-pos-top nav li.tab-current::before' => 'height: {{SIZE}}px',
404
+ '{{WRAPPER}}.eae-nav-pos-top nav li.tab-current::after' => 'height: {{SIZE}}px',
405
+ ],
406
+ ]
407
+ );
408
+
409
+ $this->add_responsive_control(
410
+ 'nav_width',
411
+ [
412
+ 'label' => __( 'Tab Width', 'elementor' ),
413
+ 'type' => Controls_Manager::SLIDER,
414
+ 'default' => [
415
+ 'size' => 20,
416
+ ],
417
+ 'range' => [
418
+ '%' => [
419
+ 'min' => 20,
420
+ 'max' => 100,
421
+ ],
422
+ ],
423
+ 'selectors' => [
424
+ '{{WRAPPER}}.eae-nav-pos-left .eae-tabs nav' => 'width: calc({{SIZE}}% - 1%);',
425
+ '{{WRAPPER}}.eae-nav-pos-left .eae-content' => 'width: calc(100% - {{SIZE}}% - 1%);',
426
+ //'{{WRAPPER}}.eae-nav-pos-top .eae-tabs nav li' => 'width: {{SIZE}}%;',
427
+ ],
428
+ ]
429
+ );
430
+
431
+ $this->add_control(
432
+ 'show_text_mobile',
433
+ [
434
+ 'label' => __( 'Title on Mobile', 'elementor' ),
435
+ 'type' => Controls_Manager::SELECT,
436
+ 'options' => [
437
+ 'yes' => __( 'Yes', 'elementor' ),
438
+ 'no' => __( 'No', 'elementor' ),
439
+ ],
440
+ 'default' => 'no',
441
+ ]
442
+ );
443
+
444
+ $this->add_group_control(
445
+ Group_Control_Typography::get_type(),
446
+ [
447
+ 'name' => 'typography',
448
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
449
+ 'selector' => '{{WRAPPER}} .eae-tab-nav li span',
450
+ ]
451
+
452
+ );
453
+
454
+
455
+ $this->add_responsive_control(
456
+ 'tab_title_align',
457
+ [
458
+ 'label' => __( 'Alignment', 'elementor' ),
459
+ 'type' => Controls_Manager::CHOOSE,
460
+ 'options' => [
461
+ 'left' => [
462
+ 'title' => __( 'Left', 'elementor' ),
463
+ 'icon' => 'fa fa-align-left',
464
+ ],
465
+ 'center' => [
466
+ 'title' => __( 'Center', 'elementor' ),
467
+ 'icon' => 'fa fa-align-center',
468
+ ],
469
+ 'right' => [
470
+ 'title' => __( 'Right', 'elementor' ),
471
+ 'icon' => 'fa fa-align-right',
472
+ ],
473
+ ],
474
+ 'selectors' => [
475
+ '{{WRAPPER}} .eae-tabs nav' => 'text-align: {{VALUE}};',
476
+ ],
477
+ ]
478
+ );
479
+
480
+ $this->add_responsive_control(
481
+ 'icon_size',
482
+ [
483
+ 'label' => __( 'Icon Size', 'elementor' ),
484
+ 'type' => Controls_Manager::SLIDER,
485
+ 'default' => [
486
+ 'size' => 20,
487
+ ],
488
+ 'range' => [
489
+ 'px' => [
490
+ 'min' => 6,
491
+ 'max' => 30,
492
+ ],
493
+ ],
494
+ 'selectors' => [
495
+ '{{WRAPPER}} .eae-tab-nav li a>:first-child' => 'width: {{SIZE}}{{UNIT}};',
496
+ '{{WRAPPER}} .eae-tab-nav li a>:first-child ' => 'font-size: {{SIZE}}{{UNIT}};',
497
+ ],
498
+ ]
499
+ );
500
+
501
+
502
+ $this->end_controls_section();
503
+
504
+ $this->start_controls_section(
505
+ 'tab_content_style',
506
+ [
507
+ 'label' => __('Content', 'elementor'),
508
+ 'tab' => Controls_Manager::TAB_STYLE
509
+ ]
510
+ );
511
+
512
+ $this->add_responsive_control(
513
+ 'tab_text_align',
514
+ [
515
+ 'label' => __( 'Alignment', 'elementor' ),
516
+ 'type' => Controls_Manager::CHOOSE,
517
+ 'options' => [
518
+ 'left' => [
519
+ 'title' => __( 'Left', 'elementor' ),
520
+ 'icon' => 'fa fa-align-left',
521
+ ],
522
+ 'center' => [
523
+ 'title' => __( 'Center', 'elementor' ),
524
+ 'icon' => 'fa fa-align-center',
525
+ ],
526
+ 'right' => [
527
+ 'title' => __( 'Right', 'elementor' ),
528
+ 'icon' => 'fa fa-align-right',
529
+ ],
530
+ 'justify' => [
531
+ 'title' => __( 'Justified', 'elementor' ),
532
+ 'icon' => 'fa fa-align-justify',
533
+ ],
534
+ ],
535
+ 'selectors' => [
536
+ '{{WRAPPER}} .eae-content section' => 'text-align: {{VALUE}};',
537
+ ],
538
+ ]
539
+ );
540
+
541
+ $this->add_control(
542
+ 'text_color',
543
+ [
544
+ 'label' => __( 'Text Color', 'elementor' ),
545
+ 'type' => Controls_Manager::COLOR,
546
+ 'default' => '',
547
+ 'selectors' => [
548
+ '{{WRAPPER}} .eae-content section' => 'color: {{VALUE}};',
549
+ ],
550
+ 'scheme' => [
551
+ 'type' => Scheme_Color::get_type(),
552
+ 'value' => Scheme_Color::COLOR_3,
553
+ ],
554
+ ]
555
+ );
556
+
557
+ $this->add_group_control(
558
+ Group_Control_Typography::get_type(),
559
+ [
560
+ 'name' => 'content_typography',
561
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
562
+ 'selector' => '{{WRAPPER}} .eae-content section'
563
+ ]
564
+ );
565
+
566
+ $this->add_group_control(
567
+ Group_Control_Border::get_type(),
568
+ [
569
+ 'name' => 'tab_content_border',
570
+ 'selector' => '{{WRAPPER}} .eae-content section',
571
+ 'separator' => 'before',
572
+ ]
573
+ );
574
+
575
+ $this->add_responsive_control(
576
+ 'tab_content_border_radius',
577
+ [
578
+ 'label' => __( 'Border Radius', 'elementor' ),
579
+ 'type' => Controls_Manager::DIMENSIONS,
580
+ 'size_units' => [ 'px', '%' ],
581
+ 'selectors' => [
582
+ '{{WRAPPER}} .eae-content section' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
583
+ ],
584
+ ]
585
+ );
586
+
587
+ $this->end_controls_section();
588
+ }
589
+
590
+
591
+ protected function render() {
592
+ $settings = $this->get_settings();
593
+ //print_r($this->get_id());
594
+ //echo "<pre>";print_r($settings['eae_tabs']);echo "</pre>";
595
+
596
+ ?>
597
+
598
+ <?php if(count($settings['eae_tabs'])){
599
+ ?>
600
+ <div id="advance_tabs" class="eae-tabs text-mobile-<?php echo $settings['show_text_mobile'] ?>" data-sticky-menu="<?php echo "eae-nav-sticky-".$settings['tab_Sticky'] ?>" data-scroll-offset="<?php echo $settings['scroll_offset'] ?>" >
601
+ <nav class="eae-tab-nav">
602
+ <ul>
603
+ <?php
604
+ $a_style="";
605
+ $var1 = 1;
606
+ foreach ($settings['eae_tabs'] as $tab){
607
+ if($var1 == 1)
608
+ {
609
+ $cont ="class='tab-current'";
610
+ }
611
+ else{
612
+ $cont ="";
613
+ }
614
+ $var1 ++;
615
+ ?>
616
+ <li <?php echo $cont; ?> ><a href="<?php echo '#'.$tab['_id']; ?> " >
617
+ <?php
618
+ if($tab['tab_element']== "none")
619
+ $a_style="";
620
+ if($tab['tab_element']== "icon")
621
+ $a_style = '<i class="'.$tab['tab_icon'].'"></i>';
622
+ if($tab['tab_element']== "image")
623
+ $a_style = '<img src="'.$tab['tab_image']['url'].'"></img>';
624
+
625
+ echo $a_style;
626
+ ?>
627
+ <span><?php echo $tab['tab_title']; ?></span></a></li>
628
+ <?php
629
+ }
630
+
631
+ ?>
632
+ </ul>
633
+ </nav>
634
+ <div class="eae-content">
635
+ <?php
636
+ $var = 1;
637
+ foreach ($settings['eae_tabs'] as $index => $tab){
638
+ $eae_tab_content_key = $this->get_repeater_setting_key( 'tab_content', 'eae_tabs', $index );
639
+ if($var == 1)
640
+ {
641
+ $this->add_render_attribute( $eae_tab_content_key, [
642
+ 'class' => [ 'content-current'],
643
+ ] );
644
+ }
645
+ $var++;
646
+
647
+ $this->add_inline_editing_attributes( $eae_tab_content_key, 'advanced' );
648
+
649
+ ?>
650
+
651
+ <section id="<?php echo "#".$tab['_id']; ?>" <?php echo $this->get_render_attribute_string( $eae_tab_content_key); ?> >
652
+ <?php
653
+ echo $tab['tab_content'];
654
+ ?>
655
+ </section>
656
+
657
+ <?php
658
+ }
659
+ ?>
660
+
661
+ </div>
662
+ </div>
663
+ <?php
664
+ }
665
+ }
666
+
667
+ protected function _content_template() {
668
+ ?>
669
+ <# if(settings.eae_tabs){ #>
670
+ <div id="advance_tabs" class="eae-tabs text-mobile-{{{settings.show_text_mobile }}}" data-sticky-menu="eae-nav-sticky-{{{settings.tab_Sticky}}}" data-scroll-offset="{{{settings.scroll_offset}}}" >
671
+ <nav class="eae-tab-nav">
672
+ <ul>
673
+ <#
674
+
675
+ var var1 = 1;
676
+ var cont ="";
677
+ _.each( settings.eae_tabs, function( tab, index ) {
678
+ var a_style="";
679
+ if(var1 == 1)
680
+ {
681
+ cont ="class='tab-current'";
682
+ }
683
+ else{
684
+ cont ="";
685
+ }
686
+ var1 ++;
687
+ #>
688
+ <li {{{cont}}} ><a href="{{{'#'+settings.eae_tabs._id }}} " >
689
+ <#
690
+ view.addRenderAttribute('iconclass','class',tab.tab_icon);
691
+ if(tab.tab_element == "none")
692
+ a_style="";
693
+ if(tab.tab_element == "icon")
694
+ a_style = '<i class="'+ tab.tab_icon + '"></i>';
695
+ if(tab.tab_element== "image")
696
+ a_style = '<img src="+ tab.tab_image.url +"/>';
697
+ #>
698
+
699
+ {{{a_style}}}
700
+ <span>{{{ tab.tab_title}}}</span></a></li>
701
+ <# } ); #>
702
+
703
+ </ul>
704
+ </nav>
705
+
706
+ <div class="eae-content">
707
+ <#
708
+ var var2 = 1;
709
+ var cont ="";
710
+ _.each( settings.eae_tabs, function( tab, index ) {
711
+ var eae_tab_content_key = view.getRepeaterSettingKey( 'tab_content', 'eae_tabs', index );
712
+
713
+ if(var2 == 1)
714
+ {
715
+ view.addRenderAttribute( eae_tab_content_key, {
716
+ 'class': 'content-current',
717
+ });
718
+ }
719
+ else{
720
+ cont ="";
721
+ }
722
+ var2++;
723
+ view.addInlineEditingAttributes( eae_tab_content_key, 'advanced' );
724
+
725
+ #>
726
+ <section id="#{{{tab._id}}}" {{{ view.getRenderAttributeString(eae_tab_content_key)}}}>
727
+ {{{tab.tab_content}}}
728
+ </section>
729
+
730
+ <#
731
+ });
732
+ #>
733
+
734
+ </div>
735
+ </div>
736
+ <# } #>
737
+ <?php
738
+ }
739
+
740
+
741
+ }
742
+
743
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_Advance_Tabs() );
elements/animated-text.php ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_AnimatedText extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-AnimatedText';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Animated Text', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-animation-text wts-eae-pe';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'wts-eae' ];
22
+ }
23
+
24
+ protected function _register_controls() {
25
+ $this->start_controls_section(
26
+ 'section_general',
27
+ [
28
+ 'label' => __( 'General', 'elementor' )
29
+ ]
30
+ );
31
+
32
+
33
+ $this->add_responsive_control(
34
+ 'text-align',
35
+ [
36
+ 'label' => __( 'Alignment', 'elementor' ),
37
+ 'type' => Controls_Manager::CHOOSE,
38
+ 'options' => [
39
+ 'left' => [
40
+ 'title' => __( 'Left', 'elementor' ),
41
+ 'icon' => 'fa fa-align-left',
42
+ ],
43
+ 'center' => [
44
+ 'title' => __( 'Center', 'elementor' ),
45
+ 'icon' => 'fa fa-align-center',
46
+ ],
47
+ 'right' => [
48
+ 'title' => __( 'Right', 'elementor' ),
49
+ 'icon' => 'fa fa-align-right',
50
+ ]
51
+ ],
52
+ 'default' => '',
53
+ 'selectors' => [
54
+ '{{WRAPPER}} .eae-at-animation' => 'text-align: {{VALUE}};',
55
+ ]
56
+ ]
57
+ );
58
+
59
+ $this->add_control(
60
+ 'pre-text',
61
+ [
62
+ 'label' => __( 'Pre Text', 'elementor' ),
63
+ 'type' => Controls_Manager::TEXTAREA,
64
+ 'placeholder' => __( 'Enter text', 'elementor' ),
65
+ 'default' => __( 'I Love', 'elementor' ),
66
+ ]
67
+ );
68
+
69
+
70
+ $this->add_control(
71
+ 'animation-text-list',
72
+ [
73
+ 'label' => __( 'Animated Text List', 'elementor' ),
74
+ 'type' => Controls_Manager::REPEATER,
75
+ 'default' => [
76
+ [
77
+ 'text' => __( 'Football', 'elementor' ),
78
+ ],
79
+ [
80
+ 'text' => __( 'Cricket', 'elementor' ),
81
+ ],
82
+ [
83
+ 'text' => __( 'Basketball', 'elementor' ),
84
+ ],
85
+ ],
86
+ 'fields' => [
87
+ [
88
+ 'name' => 'text',
89
+ 'label' => __( 'Text', 'elementor' ),
90
+ 'type' => Controls_Manager::TEXT,
91
+ 'label_block' => true,
92
+ 'placeholder' => __( 'Text to animate', 'elementor' ),
93
+ 'default' => __( '', 'elementor' ),
94
+ ],
95
+ ],
96
+ 'title_field' => '{{{ text }}}'
97
+ ]
98
+ );
99
+
100
+ $this->add_control(
101
+ 'post-text',
102
+ [
103
+ 'label' => __( 'Post Text', 'elementor' ),
104
+ 'type' => Controls_Manager::TEXTAREA,
105
+ 'placeholder' => __( 'Enter text', 'elementor' ),
106
+ 'default' => __( 'Very Much', 'elementor' ),
107
+ ]
108
+ );
109
+
110
+ $this->end_controls_section();
111
+
112
+ $this->start_controls_section(
113
+ 'section_pre_text_style',
114
+ [
115
+ 'label' => __( 'Pre Text', 'elementor' ),
116
+ 'tab' => Controls_Manager::TAB_STYLE,
117
+ ]
118
+ );
119
+
120
+
121
+ $this->add_control(
122
+ 'pre_text_color',
123
+ [
124
+ 'label' => __( 'Pre Text Color', 'elementor' ),
125
+ 'type' => Controls_Manager::COLOR,
126
+ 'scheme' => [
127
+ 'type' => Scheme_Color::get_type(),
128
+ 'value' => Scheme_Color::COLOR_1,
129
+ ],
130
+ 'selectors' => [
131
+ '{{WRAPPER}} .eae-at-pre-text' => 'color: {{VALUE}};',
132
+ ],
133
+ ]
134
+ );
135
+
136
+ $this->add_group_control(
137
+ Group_Control_Typography::get_type(),
138
+ [
139
+ 'name' => 'pre_text_typography',
140
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
141
+ 'selector' => '{{WRAPPER}} .eae-at-pre-text',
142
+ ]
143
+ );
144
+
145
+
146
+ $this->end_controls_section();
147
+
148
+
149
+ $this->start_controls_section(
150
+ 'section_animation_text_style',
151
+ [
152
+ 'label' => __( 'Animated Text', 'elementor' ),
153
+ 'tab' => Controls_Manager::TAB_STYLE,
154
+ ]
155
+ );
156
+
157
+
158
+ $this->add_group_control(
159
+ Group_Control_Typography::get_type(),
160
+ [
161
+ 'name' => 'animation_color_typography',
162
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
163
+ 'selector' => '{{WRAPPER}} .eae-at-animation-text, {{WRAPPER}} .eae-at-animation-text i',
164
+ ]
165
+ );
166
+
167
+
168
+ $this->add_control(
169
+ 'animation_color',
170
+ [
171
+ 'label' => __( 'Animation Text Color', 'elementor' ),
172
+ 'type' => Controls_Manager::COLOR,
173
+ 'scheme' => [
174
+ 'type' => Scheme_Color::get_type(),
175
+ 'value' => Scheme_Color::COLOR_4,
176
+ ],
177
+ 'selectors' => [
178
+ '{{WRAPPER}} .eae-at-animation-text' => 'color: {{VALUE}};',
179
+ ],
180
+ ]
181
+ );
182
+
183
+ $this->add_group_control(
184
+ Group_Control_Border::get_type(),
185
+ [
186
+ 'name' => 'animated_text_border',
187
+ 'label' => __( 'Box Border', 'elementor' ),
188
+ 'selector' => '{{WRAPPER}} .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible',
189
+ ]
190
+ );
191
+
192
+
193
+
194
+ $this->add_control(
195
+ 'box_border_radius',
196
+ [
197
+ 'label' => __( 'Border Radius', 'elementor' ),
198
+ 'type' => Controls_Manager::DIMENSIONS,
199
+ 'size_units' => [ 'px', '%' ],
200
+ 'selectors' => [
201
+ '{{WRAPPER}} .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
202
+ ],
203
+ ]
204
+ );
205
+
206
+ $this->add_control(
207
+ 'box_padding',
208
+ [
209
+ 'label' => __( 'Padding', 'elementor' ),
210
+ 'type' => Controls_Manager::DIMENSIONS,
211
+ 'size_units' => [ 'px', '%' ],
212
+ 'selectors' => [
213
+ '{{WRAPPER}} .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
214
+ ],
215
+ ]
216
+ );
217
+ $this->add_control(
218
+ 'box_margin',
219
+ [
220
+ 'label' => __( 'Margin', 'elementor' ),
221
+ 'type' => Controls_Manager::DIMENSIONS,
222
+ 'size_units' => [ 'px', '%' ],
223
+ 'selectors' => [
224
+ '{{WRAPPER}} .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
225
+ ],
226
+ ]
227
+ );
228
+
229
+
230
+
231
+ $this->add_group_control(
232
+ Group_Control_Background::get_type(),
233
+ [
234
+ 'name' => 'animation_section_bg',
235
+ 'label' => __( 'Section Background', 'elementor' ),
236
+ 'types' => [ 'classic','gradient' ],
237
+ 'selector' => '{{WRAPPER}} .eae-at-animation-text-wrapper .eae-at-animation-text.is-visible',
238
+ ]
239
+ );
240
+
241
+
242
+
243
+ $this->end_controls_section();
244
+
245
+ $this->start_controls_section(
246
+ 'section_cursor_style',
247
+ [
248
+ 'label' => __( 'Cursor Control', 'elementor' ),
249
+ 'tab' => Controls_Manager::TAB_STYLE,
250
+ ]
251
+ );
252
+
253
+
254
+ $this->add_control(
255
+ 'cursor_color',
256
+ [
257
+ 'label' => __( 'Color', 'elementor' ),
258
+ 'type' => Controls_Manager::COLOR,
259
+ 'scheme' => [
260
+ 'type' => Scheme_Color::get_type(),
261
+ 'value' => Scheme_Color::COLOR_1,
262
+ ],
263
+ 'default' => '#54595f',
264
+ 'selectors' => [
265
+ '{{WRAPPER}} .eae-at-animation-text-wrapper::after' => 'background-color: {{VALUE}};',
266
+ ],
267
+ ]
268
+ );
269
+
270
+ $this->add_responsive_control(
271
+ 'cursor_width',
272
+ [
273
+ 'label' => __( 'Width', 'elementor' ),
274
+ 'type' => Controls_Manager::SLIDER,
275
+ 'size_units' => [ 'px' ],
276
+ 'default' => [
277
+ 'size' => 1,
278
+ 'unit' => 'px',
279
+ ],
280
+ 'range' => [
281
+ 'px' => [
282
+ 'min' => 1,
283
+ 'max' => 5,
284
+ ],
285
+ ],
286
+ 'selectors' => [
287
+ '{{WRAPPER}} .eae-at-animation.type .eae-at-animation-text-wrapper::after' => 'width: {{SIZE}}{{UNIT}};',
288
+ ],
289
+ ]
290
+ );
291
+
292
+ $this->end_controls_section();
293
+
294
+ $this->start_controls_section(
295
+ 'section_post_text_style',
296
+ [
297
+ 'label' => __( 'Post Text', 'elementor' ),
298
+ 'tab' => Controls_Manager::TAB_STYLE,
299
+ ]
300
+ );
301
+
302
+
303
+ $this->add_control(
304
+ 'post_text_color',
305
+ [
306
+ 'label' => __( 'Post Text Color', 'elementor' ),
307
+ 'type' => Controls_Manager::COLOR,
308
+ 'scheme' => [
309
+ 'type' => Scheme_Color::get_type(),
310
+ 'value' => Scheme_Color::COLOR_1,
311
+ ],
312
+ 'selectors' => [
313
+ '{{WRAPPER}} .eae-at-post-text' => 'color: {{VALUE}};',
314
+ ],
315
+ ]
316
+ );
317
+
318
+ $this->add_group_control(
319
+ Group_Control_Typography::get_type(),
320
+ [
321
+ 'name' => 'post_text_typography',
322
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
323
+ 'selector' => '{{WRAPPER}} .eae-at-post-text',
324
+ ]
325
+ );
326
+
327
+ $this->end_controls_section();
328
+ }
329
+
330
+ protected function render(){
331
+ $settings = $this->get_settings();
332
+
333
+ $this->add_render_attribute('eae-at-animated-text-wrapper','class','eae-at-animation-text-wrapper');
334
+
335
+ $this->add_render_attribute('eae-at-animated-text-wrapper','class','waiting');
336
+
337
+ $this->add_render_attribute('eae-at-animated-text','class','eae-at-animation-text');
338
+
339
+ $this->add_render_attribute('eae-at-pre-txt','class','eae-at-pre-text');
340
+
341
+ $this->add_render_attribute('eae-at-animated','class','eae-at-animation');
342
+
343
+ $this->add_render_attribute('eae-at-animated','class','type');
344
+
345
+ $this->add_render_attribute('eae-at-animated','class','letters');
346
+
347
+ $this->add_render_attribute('eae-at-post-txt','class','eae-at-post-text');
348
+
349
+ ?>
350
+ <div id="eae-at-<?php echo $this->get_id(); ?>" class="eae-animtext-wrapper">
351
+ <div <?php echo $this->get_render_attribute_string( 'eae-at-animated' ); ?>>
352
+ <span <?php echo $this->get_render_attribute_string( 'eae-at-pre-txt' ); ?>><?php echo $settings['pre-text']; ?></span>
353
+ <?php if(count($settings['animation-text-list'])){
354
+ ?>
355
+ <span <?php echo $this->get_render_attribute_string( 'eae-at-animated-text-wrapper' ); ?>>
356
+ <?php
357
+ foreach($settings['animation-text-list'] as $animation_text){
358
+ ?>
359
+
360
+ <span <?php echo $this->get_render_attribute_string( 'eae-at-animated-text' ); ?>><?php echo $animation_text['text']; ?></span>
361
+
362
+ <?php
363
+ }
364
+ ?>
365
+ </span>
366
+ <?php
367
+ }?>
368
+ <span <?php echo $this->get_render_attribute_string( 'eae-at-post-txt' ); ?>><?php echo $settings['post-text']; ?></span>
369
+ </div>
370
+ </div>
371
+ <script>
372
+ console.log('before-trigger');
373
+ jQuery(document).trigger('elementor/render/animation-text','#eae-at-<?php echo $this->get_id(); ?>');
374
+
375
+ jQuery(document).ready(function(){
376
+ jQuery(document).trigger('elementor/render/animation-text','#eae-at-<?php echo $this->get_id(); ?>');
377
+ });
378
+ </script>
379
+ <?php
380
+ }
381
+
382
+ protected function content_template() {
383
+ ?>
384
+ <#
385
+
386
+ box_html = '';
387
+
388
+ print( separator_html );
389
+ #>
390
+ <?php
391
+ }
392
+ }
393
+
394
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_AnimatedText() );
395
+ ?>
elements/control-test.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_Test_Control extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-testcontrol';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Test Control', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-flip-box wts-eae-pe';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'wts-eae' ];
22
+ }
23
+
24
+ protected function _register_controls() {
25
+ $this->start_controls_section(
26
+ 'section_general',
27
+ [
28
+ 'label' => __( 'General', 'elementor' )
29
+ ]
30
+ );
31
+
32
+ $this->add_group_control(
33
+ Group_Control_Background::get_type(),
34
+ [
35
+ 'name' => 'front_box_background_out',
36
+ 'types' => [ 'classic', 'gradient'],
37
+ //'selector' => '{{WRAPPER}} .divTest',
38
+ ]
39
+ );
40
+
41
+ $this->add_control(
42
+ 'front_box__color',
43
+ [
44
+ 'label' => __( 'Title', 'elementor' ),
45
+ 'type' => Controls_Manager::COLOR,
46
+ 'selectors' => [
47
+ '{{WRAPPER}} {{CURRENT_ITEM}}.divTest' => 'color: {{VALUE}};',
48
+ ],
49
+ ]
50
+ );
51
+
52
+ $repeater = new Repeater();
53
+
54
+ $repeater->add_group_control(
55
+ Group_Control_Background::get_type(),
56
+ [
57
+ 'name' => 'front_box_background_ind',
58
+ 'types' => [ 'classic', 'gradient'],
59
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.divTest',
60
+ ]
61
+ );
62
+ $repeater->add_group_control(
63
+ Group_Control_Typography::get_type(),
64
+ [
65
+ 'name' => 'front_box_title_typography',
66
+ 'label' => __( 'Title Typography', 'elementor' ),
67
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
68
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.divTest',
69
+
70
+ ]
71
+ );
72
+
73
+ $repeater->add_control(
74
+ 'front_box_title_color',
75
+ [
76
+ 'label' => __( 'Title', 'elementor' ),
77
+ 'type' => Controls_Manager::COLOR,
78
+ 'selectors' => [
79
+ '{{WRAPPER}} {{CURRENT_ITEM}} i' => 'color: {{VALUE}};',
80
+ ],
81
+ ]
82
+ );
83
+
84
+ $this->add_control(
85
+ 'eae_flip_box_set',
86
+ [
87
+ 'label' => __( 'Flip Box', 'elementor' ),
88
+ 'type' => Controls_Manager::REPEATER,
89
+ 'show_label' => true,
90
+ 'fields' => array_values($repeater->get_controls()),
91
+ ]
92
+ );
93
+
94
+ }
95
+
96
+ protected function render( ) {
97
+ $settings = $this->get_settings_for_display();
98
+ //print_r($settings['eae_flip_box_set']);
99
+ foreach ($settings['eae_flip_box_set'] as $flipbox) {
100
+ ?>
101
+ <div class="elementor-repeater-item-<?php echo $flipbox['_id']; ?> divTest">
102
+ Satish
103
+ <i>Kumar</i>
104
+ </div>
105
+
106
+ <?php
107
+ }
108
+ }
109
+ }
110
+
111
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_Test_Control() );
elements/flip-box-set.php ADDED
@@ -0,0 +1,1800 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_FlipBoxSet extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-flipboxset';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Flip Box Set', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-flip-box wts-eae-pe';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'wts-eae' ];
22
+ }
23
+
24
+ protected function _register_controls() {
25
+
26
+ $this->start_controls_section(
27
+ 'section_general',
28
+ [
29
+ 'label' => __( 'General', 'elementor' )
30
+ ]
31
+ );
32
+
33
+ $this->add_responsive_control(
34
+ 'flip_box_count_row',
35
+ [
36
+ 'label' => __( 'Column', 'elementor' ),
37
+ 'type' => Controls_Manager::NUMBER,
38
+ 'desktop_default' => '3',
39
+ 'tablet_default' => '2',
40
+ 'mobile_default' => '1',
41
+ 'min' => 1,
42
+ 'max' => 6,
43
+ 'selectors' => [
44
+ '{{WRAPPER}} .eae-flip-box-wrapper' => 'width: calc(100%/{{ value }} - 1%) ',
45
+ ]
46
+ ]
47
+ );
48
+ $repeater = new Repeater();
49
+
50
+ $repeater->add_control(
51
+ 'front_box_heading',
52
+ [
53
+ 'label' => __('Front Box', 'elementor'),
54
+ 'type' => Controls_Manager::HEADING,
55
+ ]
56
+ );
57
+
58
+ $repeater -> start_controls_tabs( 'front_box' );
59
+
60
+ $repeater -> start_controls_tab(
61
+ 'front_box_content',
62
+ [
63
+ 'label' => __( 'Content', 'elementor' ),
64
+ ]
65
+ );
66
+
67
+ $repeater->add_control(
68
+ 'front_box_element',
69
+ [
70
+ 'label' => __( 'Box Element', 'elementor' ),
71
+ 'type' => Controls_Manager::CHOOSE,
72
+ 'options' => [
73
+ 'none' => [
74
+ 'title' => __( 'None', 'elementor' ),
75
+ 'icon' => 'fa fa-ban',
76
+ ],
77
+ 'image' => [
78
+ 'title' => __( 'Image', 'elementor' ),
79
+ 'icon' => 'fa fa-picture-o',
80
+ ],
81
+ 'icon' => [
82
+ 'title' => __( 'Icon', 'elementor' ),
83
+ 'icon' => 'fa fa-star',
84
+
85
+ ],
86
+ ],
87
+ 'default' => 'icon',
88
+ ]
89
+ );
90
+
91
+ $repeater->add_control('front_box_image',
92
+ [
93
+ 'label' => __( 'Choose Image', 'elementor' ),
94
+ 'type' => Controls_Manager::MEDIA,
95
+ 'default' => [
96
+ 'url' => Utils::get_placeholder_image_src(),
97
+ ],
98
+ 'condition' => [
99
+ 'front_box_element' => 'image',
100
+ ],
101
+ 'show_label'=> true,
102
+ ]
103
+ );
104
+
105
+ $repeater->add_group_control(
106
+ Group_Control_Image_Size::get_type(),
107
+ [
108
+ 'name' => 'front_image_size', // Actually its `image_size`
109
+ 'default' => 'thumbnail',
110
+ 'condition' => [
111
+ 'front_box_element' => 'image',
112
+ 'front_box_image[id]!' => '',
113
+ ],
114
+ ]
115
+ );
116
+ $repeater->add_control(
117
+ 'front_image_width',
118
+ [
119
+ 'label' => __( 'Image Width', 'elementor' ),
120
+ 'type' => Controls_Manager::SLIDER,
121
+ 'range' => [
122
+ 'px' => [
123
+ 'min' => 6,
124
+ 'max' => 300,
125
+ ],
126
+ ],
127
+ 'default' => [
128
+ 'size' => 100,
129
+ ],
130
+ 'selectors' => [
131
+ '{{WRAPPER}} {{CURRENT_ITEM}} .eae-flip-box-front img' => 'max-width: {{SIZE}}{{UNIT}};',
132
+ ],
133
+ 'condition' => [
134
+ 'front_box_element' => 'image',
135
+ 'front_box_image[id]!' => '',
136
+ ],
137
+ ]
138
+ );
139
+
140
+ $repeater->add_control(
141
+ 'front_icon',
142
+ [
143
+ 'label' => __( 'Icon', 'elementor' ),
144
+ 'type' => Controls_Manager::ICON,
145
+ 'label_block' => true,
146
+ 'default' => 'fa fa-star',
147
+ 'condition' => [
148
+ 'front_box_element' => 'icon',
149
+ ],
150
+ ]
151
+ );
152
+
153
+ $repeater->add_control(
154
+ 'front_title',
155
+ [
156
+ 'label' => __( 'Title', 'elementor' ),
157
+ 'type' => Controls_Manager::TEXT,
158
+ 'placeholder' => __( 'Enter text', 'elementor' ),
159
+ 'default' => __( 'Text Title', 'elementor' ),
160
+ ]
161
+ );
162
+
163
+ $repeater->add_control(
164
+ 'front_title_html_tag',
165
+ [
166
+ 'label' => __( 'HTML Tag', 'elementor' ),
167
+ 'type' => Controls_Manager::SELECT,
168
+ 'options' => [
169
+ 'h1' => __( 'H1', 'elementor' ),
170
+ 'h2' => __( 'H2', 'elementor' ),
171
+ 'h3' => __( 'H3', 'elementor' ),
172
+ 'h4' => __( 'H4', 'elementor' ),
173
+ 'h5' => __( 'H5', 'elementor' ),
174
+ 'h6' => __( 'H6', 'elementor' )
175
+ ],
176
+ 'default' => 'h3',
177
+ ]
178
+ );
179
+
180
+ $repeater->add_control(
181
+ 'front_text',
182
+ [
183
+ 'label' => __( 'Text', 'elementor' ),
184
+ 'type' => Controls_Manager::TEXTAREA,
185
+ 'placeholder' => __( 'Enter text', 'elementor' ),
186
+ 'default' => __( 'Add some nice text here.', 'elementor' ),
187
+ ]
188
+ );
189
+ $repeater -> end_controls_tab();
190
+
191
+ $repeater -> start_controls_tab(
192
+ 'front_box_background_ind_head',
193
+ [
194
+ 'label' => __( 'Style', 'elementor' ),
195
+ ]
196
+ );
197
+
198
+ $repeater->add_control(
199
+ 'style_indv',
200
+ [
201
+ 'label' => __( 'Overwrite Global Style', 'elementor' ),
202
+ 'type' => Controls_Manager::SWITCHER,
203
+ 'options' => [
204
+ 'yes' => __( 'Yes', 'elementor' ),
205
+ 'no' => __( 'No', 'elementor' ),
206
+ ],
207
+ 'default' => 'no',
208
+
209
+ ]
210
+ );
211
+
212
+ $repeater->add_control(
213
+ 'front_icon_view',
214
+ [
215
+ 'label' => __( 'View', 'elementor' ),
216
+ 'type' => Controls_Manager::SELECT,
217
+ 'options' => [
218
+ 'default' => __( 'Default', 'elementor' ),
219
+ 'stacked' => __( 'Stacked', 'elementor' ),
220
+ 'framed' => __( 'Framed', 'elementor' ),
221
+ ],
222
+ 'default' => 'default',
223
+ 'condition' => [
224
+ 'front_box_element' => 'icon',
225
+ 'style_indv' => 'yes',
226
+ ],
227
+
228
+ ]
229
+ );
230
+
231
+ $repeater->add_control(
232
+ 'front_icon_shape',
233
+ [
234
+ 'label' => __( 'Shape', 'elementor' ),
235
+ 'type' => Controls_Manager::SELECT,
236
+ 'options' => [
237
+ 'circle' => __( 'Circle', 'elementor' ),
238
+ 'square' => __( 'Square', 'elementor' ),
239
+ ],
240
+ 'default' => 'circle',
241
+ 'condition' => [
242
+ 'front_box_element' => 'icon',
243
+ 'front_icon_view!' => 'default',
244
+ 'style_indv' => 'yes',
245
+ ],
246
+ ]
247
+ );
248
+
249
+
250
+ $repeater->add_group_control(
251
+ Group_Control_Background::get_type(),
252
+ [
253
+ 'name' => 'front_box_background_ind',
254
+ 'types' => [ 'classic', 'gradient'],
255
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front',
256
+ 'condition' => [
257
+ 'style_indv' => 'yes',
258
+ ],
259
+ ]
260
+ );
261
+ $repeater->add_control(
262
+ 'front_box_background_overlay_ind',
263
+ [
264
+ 'label' => __( 'Background Overlay', 'elementor-pro' ),
265
+ 'type' => Controls_Manager::COLOR,
266
+ 'default' => '',
267
+ 'separator' => 'before',
268
+ 'condition' => [
269
+ 'front_box_background_ind_image[id]!' => '',
270
+ 'style_indv' => 'yes',
271
+ ],
272
+ ]
273
+ );
274
+ $repeater->add_control(
275
+ 'front_box_title_color_indv',
276
+ [
277
+ 'label' => __( 'Title', 'elementor' ),
278
+ 'type' => Controls_Manager::COLOR,
279
+ 'scheme' => [
280
+ 'type' => Scheme_Color::get_type(),
281
+ 'value' => Scheme_Color::COLOR_1,
282
+ ],
283
+ 'default' => '#FFF',
284
+ 'selectors' => [
285
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .front-icon-title ' => 'color: {{VALUE}};',
286
+ ],
287
+ 'condition' => [
288
+ 'style_indv' => 'yes',
289
+ ],
290
+ ]
291
+ );
292
+
293
+ $repeater->add_group_control(
294
+ Group_Control_Typography::get_type(),
295
+ [
296
+ 'name' => 'front_box_title_typography_indv',
297
+ 'label' => __( 'Title Typography', 'elementor' ),
298
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
299
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .front-icon-title',
300
+ 'condition' => [
301
+ 'style_indv' => 'yes',
302
+ ],
303
+ ]
304
+ );
305
+
306
+ $repeater->add_control(
307
+ 'front_box_text_color_indv',
308
+ [
309
+ 'label' => __( 'Description Color', 'elementor' ),
310
+ 'type' => Controls_Manager::COLOR,
311
+ 'scheme' => [
312
+ 'type' => Scheme_Color::get_type(),
313
+ 'value' => Scheme_Color::COLOR_1,
314
+ ],
315
+ 'default' => '#FFF',
316
+ 'selectors' => [
317
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front p' => 'color: {{VALUE}};',
318
+ ],
319
+ 'condition' => [
320
+ 'style_indv' => 'yes',
321
+ ],
322
+
323
+ ]
324
+ );
325
+
326
+ $repeater->add_group_control(
327
+ Group_Control_Typography::get_type(),
328
+ [
329
+ 'name' => 'front_box_text_typography_indv',
330
+ 'label' => __( 'Description Typography', 'elementor' ),
331
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
332
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front p',
333
+ 'condition' => [
334
+ 'style_indv' => 'yes',
335
+ ],
336
+ ]
337
+ );
338
+
339
+
340
+ /**
341
+ * Front Box icons styles
342
+ **/
343
+ $repeater->add_control(
344
+ 'front_box_icon_color_indv',
345
+ [
346
+ 'label' => __( 'Icon Color', 'elementor' ),
347
+ 'type' => Controls_Manager::COLOR,
348
+ 'scheme' => [
349
+ 'type' => Scheme_Color::get_type(),
350
+ 'value' => Scheme_Color::COLOR_1,
351
+ ],
352
+ 'default' => '#FFF',
353
+ 'selectors' => [
354
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front .icon-wrapper i' => 'color: {{VALUE}};',
355
+ ],
356
+ 'condition' => [
357
+ 'style_indv' => 'yes',
358
+ ],
359
+ ]
360
+ );
361
+
362
+ $repeater->add_control(
363
+ 'front_box_icon_fill_color_indv',
364
+ [
365
+ 'label' => __( 'Icon Fill Color', 'elementor' ),
366
+ 'type' => Controls_Manager::COLOR,
367
+ 'scheme' => [
368
+ 'type' => Scheme_Color::get_type(),
369
+ 'value' => Scheme_Color::COLOR_1,
370
+ ],
371
+ 'selectors' => [
372
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-fb-icon-view-stacked' => 'background-color: {{VALUE}};',
373
+ ],
374
+ 'condition' => [
375
+ 'front_icon_view' => 'stacked',
376
+ 'style_indv' => 'yes',
377
+ ],
378
+ ]
379
+ );
380
+
381
+ $repeater->add_group_control(
382
+ Group_Control_Border::get_type(),
383
+ [
384
+ 'name' => 'front_box_icon_border_indv',
385
+ 'label' => __( 'Box Border', 'elementor' ),
386
+ 'placeholder' => '1px',
387
+ 'default' => '1px',
388
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front .eae-fb-icon-view-framed, {{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front .eae-fb-icon-view-stacked',
389
+ 'label_block' => true,
390
+ 'condition' => [
391
+ 'front_icon_view!' => 'default',
392
+ 'style_indv' => 'yes',
393
+ ],
394
+ ]
395
+ );
396
+
397
+ $repeater->add_control(
398
+ 'front_icon_size_indv',
399
+ [
400
+ 'label' => __( 'Icon Size', 'elementor' ),
401
+ 'type' => Controls_Manager::SLIDER,
402
+ 'range' => [
403
+ 'px' => [
404
+ 'min' => 6,
405
+ 'max' => 300,
406
+ ],
407
+ ],
408
+ 'selectors' => [
409
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front .icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
410
+ ],
411
+ 'condition' => [
412
+ 'style_indv' => 'yes',
413
+ ],
414
+ ]
415
+ );
416
+
417
+ $repeater->add_control(
418
+ 'front_icon_padding_indv',
419
+ [
420
+ 'label' => __( 'Icon Padding', 'elementor' ),
421
+ 'type' => Controls_Manager::SLIDER,
422
+ 'selectors' => [
423
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-front .icon-wrapper' => 'padding: {{SIZE}}{{UNIT}};',
424
+ ],
425
+ 'default' => [
426
+ 'size' => 1.5,
427
+ 'unit' => 'em',
428
+ ],
429
+ 'range' => [
430
+ 'em' => [
431
+ 'min' => 0,
432
+ ],
433
+ ],
434
+ 'condition' => [
435
+ 'front_icon_view!' => 'default',
436
+ 'style_indv' => 'yes',
437
+ ],
438
+ ]
439
+ );
440
+
441
+ $repeater->end_controls_tab();
442
+
443
+ $repeater->end_controls_tabs();
444
+
445
+ $repeater->add_control(
446
+ 'back_box_heading',
447
+ [
448
+ 'label' => __('Back Box', 'elementor'),
449
+ 'type' => Controls_Manager::HEADING,
450
+ ]
451
+ );
452
+
453
+ $repeater->start_controls_tabs( 'back_box_a' );
454
+
455
+ $repeater->start_controls_tab(
456
+ 'back_box_content',
457
+ [
458
+ 'label' => __( 'Content', 'elementor' ),
459
+ ]
460
+ );
461
+
462
+
463
+
464
+ $repeater->add_control(
465
+ 'back_box_element',
466
+ [
467
+ 'label' => __( 'Box Element', 'elementor' ),
468
+ 'type' => Controls_Manager::CHOOSE,
469
+ 'options' => [
470
+ 'none' => [
471
+ 'title' => __( 'None', 'elementor' ),
472
+ 'icon' => 'fa fa-ban',
473
+ ],
474
+ 'image'=> [
475
+ 'title' => __( 'Image', 'elementor' ),
476
+ 'icon' => 'fa fa-picture-o',
477
+ ],
478
+ 'icon' => [
479
+ 'title' => __( 'Icon', 'elementor' ),
480
+ 'icon' => 'fa fa-star',
481
+
482
+ ],
483
+ ],
484
+ 'default' => 'icon',
485
+ ]
486
+ );
487
+
488
+ $repeater->add_control('back_box_image',
489
+ [
490
+ 'label' => __( 'Choose Image', 'elementor' ),
491
+ 'type' => Controls_Manager::MEDIA,
492
+ 'default' => [
493
+ 'url' => Utils::get_placeholder_image_src(),
494
+ ],
495
+ 'condition' => [
496
+ 'back_box_element' => 'image',
497
+ ],
498
+ 'show_label' => true,
499
+ ]
500
+ );
501
+
502
+ $repeater->add_group_control(
503
+ Group_Control_Image_Size::get_type(),
504
+ [
505
+ 'name' => 'back_image_size', // Actually its `image_size`
506
+ 'default' => 'thumbnail',
507
+ 'condition' => [
508
+ 'back_box_element' => 'image',
509
+ 'back_box_image[id]!' => '',
510
+ ],
511
+ ]
512
+ );
513
+ $repeater->add_control(
514
+ 'back_image_width',
515
+ [
516
+ 'label' => __( 'Image Width', 'elementor' ),
517
+ 'type' => Controls_Manager::SLIDER,
518
+ 'range' => [
519
+ 'px' => [
520
+ 'min' => 6,
521
+ 'max' => 300,
522
+ ],
523
+ ],
524
+ 'default' => [
525
+ 'size' => 100,
526
+ ],
527
+ 'selectors' => [
528
+ '{{WRAPPER}} {{CURRENT_ITEM}} .eae-flip-box-back img' => 'max-width: {{SIZE}}{{UNIT}};',
529
+ ],
530
+ 'condition' => [
531
+ 'back_box_element' => 'image',
532
+ 'back_box_image[id]!' => '',
533
+ ],
534
+ ]
535
+ );
536
+
537
+ $repeater->add_control(
538
+ 'back_icon',
539
+ [
540
+ 'label' => __( 'Icon', 'elementor' ),
541
+ 'type' => Controls_Manager::ICON,
542
+ 'label_block' => true,
543
+ 'default' => 'fa fa-star',
544
+ 'condition' => [
545
+ 'back_box_element' => 'icon',
546
+ ],
547
+ ]
548
+ );
549
+
550
+
551
+ $repeater->add_control(
552
+ 'back_title',
553
+ [
554
+ 'label' => __( 'Title', 'elementor' ),
555
+ 'type' => Controls_Manager::TEXT,
556
+ 'placeholder' => __( 'Enter text', 'elementor' ),
557
+ 'default' => __( 'Text Title', 'elementor' ),
558
+ ]
559
+ );
560
+
561
+ $repeater->add_control(
562
+ 'back_title_html_tag',
563
+ [
564
+ 'label' => __( 'HTML Tag', 'elementor' ),
565
+ 'type' => Controls_Manager::SELECT,
566
+ 'options' => [
567
+ 'h1' => __( 'H1', 'elementor' ),
568
+ 'h2' => __( 'H2', 'elementor' ),
569
+ 'h3' => __( 'H3', 'elementor' ),
570
+ 'h4' => __( 'H4', 'elementor' ),
571
+ 'h5' => __( 'H5', 'elementor' ),
572
+ 'h6' => __( 'H6', 'elementor' )
573
+ ],
574
+ 'default' => 'h3',
575
+ ]
576
+ );
577
+
578
+ $repeater->add_control(
579
+ 'back_text',
580
+ [
581
+ 'label' => __( 'Text', 'elementor' ),
582
+ 'type' => Controls_Manager::TEXTAREA,
583
+ 'placeholder' => __( 'Enter text', 'elementor' ),
584
+ 'default' => __( 'Add some nice text here.', 'elementor' ),
585
+ ]
586
+ );
587
+ $repeater -> end_controls_tab();
588
+
589
+ $repeater -> start_controls_tab(
590
+ 'back_box_background_head',
591
+ [
592
+ 'label' => __( 'Style', 'elementor' ),
593
+ ]
594
+ );
595
+
596
+ $repeater->add_control(
597
+ 'back_icon_view',
598
+ [
599
+ 'label' => __( 'View', 'elementor' ),
600
+ 'type' => Controls_Manager::SELECT,
601
+ 'options' => [
602
+ 'default' => __( 'Default', 'elementor' ),
603
+ 'stacked' => __( 'Stacked', 'elementor' ),
604
+ 'framed' => __( 'Framed', 'elementor' ),
605
+ ],
606
+ 'default' => 'default',
607
+ 'condition' => [
608
+ 'back_box_element' => 'icon',
609
+ ],
610
+
611
+ ]
612
+ );
613
+
614
+ $repeater->add_control(
615
+ 'back_icon_shape',
616
+ [
617
+ 'label' => __( 'Shape', 'elementor' ),
618
+ 'type' => Controls_Manager::SELECT,
619
+ 'options' => [
620
+ 'circle' => __( 'Circle', 'elementor' ),
621
+ 'square' => __( 'Square', 'elementor' ),
622
+ ],
623
+ 'default' => 'circle',
624
+ 'condition' => [
625
+ 'back_box_element' => 'icon',
626
+ 'back_icon_view!' => 'default',
627
+ ],
628
+ ]
629
+ );
630
+
631
+ $repeater->add_group_control(
632
+ Group_Control_Background::get_type(),
633
+ [
634
+ 'name' => 'back_box_background_ind',
635
+ 'types' => [ 'classic', 'gradient' ],
636
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back',
637
+ 'condition' => [
638
+ 'style_indv' => 'yes',
639
+ ],
640
+ ]
641
+ );
642
+
643
+ $repeater->add_control(
644
+ 'back_box_background_overlay_ind',
645
+ [
646
+ 'label' => __( 'Background Overlay', 'elementor' ),
647
+ 'type' => Controls_Manager::COLOR,
648
+ 'default' => '',
649
+ 'separator' => 'before',
650
+ 'condition' => [
651
+ 'back_box_background_ind_image[id]!' => '',
652
+ 'style_indv' => 'yes',
653
+
654
+ ],
655
+ ]
656
+ );
657
+ $repeater->add_control(
658
+ 'back_box_title_color_indv',
659
+ [
660
+ 'label' => __( 'Title', 'elementor' ),
661
+ 'type' => Controls_Manager::COLOR,
662
+ 'scheme' => [
663
+ 'type' => Scheme_Color::get_type(),
664
+ 'value' => Scheme_Color::COLOR_1,
665
+ ],
666
+ 'default' => '#FFF',
667
+ 'selectors' => [
668
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .back-icon-title' => 'color: {{VALUE}};',
669
+ ],
670
+ 'condition' => [
671
+ 'style_indv' => 'yes',
672
+ ],
673
+
674
+ ]
675
+ );
676
+
677
+ $repeater->add_group_control(
678
+ Group_Control_Typography::get_type(),
679
+ [
680
+ 'name' => 'back_box_title_typography_indv',
681
+ 'label' => __( 'Title Typography', 'elementor' ),
682
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
683
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .back-icon-title',
684
+ 'condition' => [
685
+ 'style_indv' => 'yes',
686
+ ],
687
+ ]
688
+ );
689
+
690
+ $repeater->add_control(
691
+ 'back_box_text_color_indv',
692
+ [
693
+ 'label' => __( 'Description Color', 'elementor' ),
694
+ 'type' => Controls_Manager::COLOR,
695
+ 'scheme' => [
696
+ 'type' => Scheme_Color::get_type(),
697
+ 'value' => Scheme_Color::COLOR_1,
698
+ ],
699
+ 'default' => '#FFF',
700
+ 'selectors' => [
701
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back p' => 'color: {{VALUE}};',
702
+ ],
703
+ 'condition' => [
704
+ 'style_indv' => 'yes',
705
+ ],
706
+
707
+ ]
708
+ );
709
+
710
+ $repeater->add_group_control(
711
+ Group_Control_Typography::get_type(),
712
+ [
713
+ 'name' => 'back_box_text_typography_indv',
714
+ 'label' => __( 'Description Typography', 'elementor' ),
715
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
716
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back p',
717
+ 'condition' => [
718
+ 'style_indv' => 'yes',
719
+ ],
720
+ ]
721
+ );
722
+
723
+
724
+ /**
725
+ * Back Box icons styles
726
+ **/
727
+ $repeater->add_control(
728
+ 'back_box_icon_color_indv',
729
+ [
730
+ 'label' => __( 'Icon Color', 'elementor' ),
731
+ 'type' => Controls_Manager::COLOR,
732
+ 'scheme' => [
733
+ 'type' => Scheme_Color::get_type(),
734
+ 'value' => Scheme_Color::COLOR_1,
735
+ ],
736
+ 'default' => '#FFF',
737
+ 'selectors' => [
738
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back .icon-wrapper i' => 'color: {{VALUE}};',
739
+ ],
740
+ 'condition' => [
741
+ 'back_icon!' => '',
742
+ 'style_indv' => 'yes',
743
+ ],
744
+ ]
745
+ );
746
+
747
+ $repeater->add_control(
748
+ 'back_box_icon_fill_color_indv',
749
+ [
750
+ 'label' => __( 'Icon Fill Color', 'elementor' ),
751
+ 'type' => Controls_Manager::COLOR,
752
+ 'scheme' => [
753
+ 'type' => Scheme_Color::get_type(),
754
+ 'value' => Scheme_Color::COLOR_1,
755
+ ],
756
+ 'selectors' => [
757
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back .eae-fb-icon-view-stacked' => 'background-color: {{VALUE}};',
758
+ ],
759
+ 'condition' => [
760
+ 'front_icon_view' => 'stacked',
761
+ 'style_indv' => 'yes',
762
+ ],
763
+ ]
764
+ );
765
+
766
+ $repeater->add_group_control(
767
+ Group_Control_Border::get_type(),
768
+ [
769
+ 'name' => 'back_box_icon_border_indv',
770
+ 'label' => __( 'Box Border', 'elementor' ),
771
+ 'placeholder' => '1px',
772
+ 'default' => '1px',
773
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back .eae-fb-icon-view-framed, {{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back .eae-fb-icon-view-stacked',
774
+ 'label_block' => true,
775
+ 'condition' => [
776
+ 'back_icon_view!' => 'default',
777
+ 'style_indv' => 'yes',
778
+ ],
779
+ ]
780
+ );
781
+
782
+ $repeater->add_control(
783
+ 'back_icon_size_indv',
784
+ [
785
+ 'label' => __( 'Icon Size', 'elementor' ),
786
+ 'type' => Controls_Manager::SLIDER,
787
+ 'range' => [
788
+ 'px' => [
789
+ 'min' => 6,
790
+ 'max' => 300,
791
+ ],
792
+ ],
793
+ 'selectors' => [
794
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back .icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
795
+ ],
796
+ 'condition' => [
797
+ 'style_indv' => 'yes',
798
+ ],
799
+ ]
800
+ );
801
+
802
+ $repeater->add_control(
803
+ 'back_icon_padding_indv',
804
+ [
805
+ 'label' => __( 'Icon Padding', 'elementor' ),
806
+ 'type' => Controls_Manager::SLIDER,
807
+ 'selectors' => [
808
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-flip-box-back .icon-wrapper' => 'padding: {{SIZE}}{{UNIT}};',
809
+ ],
810
+ 'default' => [
811
+ 'size' => 1.5,
812
+ 'unit' => 'em',
813
+ ],
814
+ 'range' => [
815
+ 'em' => [
816
+ 'min' => 0,
817
+ ],
818
+ ],
819
+ 'condition' => [
820
+ 'back_icon_view!' => 'default',
821
+ 'style_indv' => 'yes',
822
+ ],
823
+ ]
824
+ );
825
+
826
+ $repeater->end_controls_tab();
827
+
828
+ $repeater->end_controls_tabs();
829
+
830
+ $repeater->add_control(
831
+ 'action_button',
832
+ [
833
+ 'label' => __('Action Button', 'elementor'),
834
+ 'type' => Controls_Manager::HEADING,
835
+ ]
836
+ );
837
+ $repeater->start_controls_tabs( 'back_box_button_style' );
838
+
839
+ $repeater->start_controls_tab(
840
+ 'action_button_content',
841
+ [
842
+ 'label' => __( 'Content', 'elementor' ),
843
+ ]
844
+ );
845
+
846
+
847
+ $repeater->add_control(
848
+ 'action_text',
849
+ [
850
+ 'label' => __( 'Button Text', 'elementor' ),
851
+ 'type' => Controls_Manager::TEXT,
852
+ 'placeholder' => __( 'Buy', 'elementor' ),
853
+ 'default' => __( 'Buy Now', 'elementor' ),
854
+ ]
855
+ );
856
+
857
+ $repeater->add_control(
858
+ 'link',
859
+ [
860
+ 'label' => __( 'Link to', 'elementor' ),
861
+ 'type' => Controls_Manager::URL,
862
+ 'placeholder' => __( 'http://your-link.com', 'elementor' ),
863
+ 'separator' => 'before',
864
+ ]
865
+ );
866
+ $repeater->end_controls_tab();
867
+
868
+ $repeater->start_controls_tab(
869
+ 'action_button_Style_indv',
870
+ [
871
+ 'label' => __( 'Style', 'elementor' ),
872
+ ]
873
+ );
874
+
875
+ $repeater->add_control(
876
+ 'button_text_color_indv',
877
+ [
878
+ 'label' => __( 'Text Color', 'elementor' ),
879
+ 'type' => Controls_Manager::COLOR,
880
+ 'default' => '#fff',
881
+ 'selectors' => [
882
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-fb-button' => 'color: {{VALUE}};',
883
+ ],
884
+ 'condition' => [
885
+ 'style_indv' => 'yes',
886
+ ],
887
+ ]
888
+ );
889
+
890
+ $repeater->add_group_control(
891
+ Group_Control_Typography::get_type(),
892
+ [
893
+ 'name' => 'typography_indv',
894
+ 'label' => __( 'Typography', 'elementor' ),
895
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
896
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-fb-button',
897
+ 'condition' => [
898
+ 'style_indv' => 'yes',
899
+ ],
900
+ ]
901
+ );
902
+
903
+ $repeater->add_control(
904
+ 'background_color_indv',
905
+ [
906
+ 'label' => __( 'Background Color', 'elementor' ),
907
+ 'type' => Controls_Manager::COLOR,
908
+ 'scheme' => [
909
+ 'type' => Scheme_Color::get_type(),
910
+ 'value' => Scheme_Color::COLOR_4,
911
+ ],
912
+ 'default' => '#93C64F',
913
+ 'selectors' => [
914
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-fb-button' => 'background-color: {{VALUE}};',
915
+ ],
916
+ 'condition' => [
917
+ 'style_indv'=> 'yes',
918
+ ],
919
+ ]
920
+ );
921
+
922
+ $repeater->add_group_control(
923
+ Group_Control_Border::get_type(),
924
+ [
925
+ 'name' => 'border_indv',
926
+ 'label' => __( 'Border', 'elementor' ),
927
+ 'placeholder' => '1px',
928
+ 'default' => '1px',
929
+ 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-fb-button',
930
+ 'condition' => [
931
+ 'style_indv' => 'yes',
932
+ ],
933
+ ]
934
+ );
935
+
936
+ $repeater->add_control(
937
+ 'border_radius_indv',
938
+ [
939
+ 'label' => __( 'Border Radius', 'elementor' ),
940
+ 'type' => Controls_Manager::DIMENSIONS,
941
+ 'size_units' => [ 'px', '%' ],
942
+ 'selectors' => [
943
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-fb-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
944
+ ],
945
+ 'condition' => [
946
+ 'style_indv' => 'yes',
947
+ ],
948
+ ]
949
+ );
950
+
951
+ $repeater->add_control(
952
+ 'text_padding_indv',
953
+ [
954
+ 'label' => __( 'Text Padding', 'elementor' ),
955
+ 'type' => Controls_Manager::DIMENSIONS,
956
+ 'size_units' => [ 'px', 'em', '%' ],
957
+ 'selectors' => [
958
+ '{{WRAPPER}} {{CURRENT_ITEM}}.overwrite-style-yes .eae-fb-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
959
+ ],
960
+ 'condition' => [
961
+ 'style_indv' => 'yes',
962
+ ],
963
+ ]
964
+ );
965
+
966
+ $repeater->end_controls_tab();
967
+
968
+ $repeater->end_controls_tabs();
969
+
970
+ $this->add_control(
971
+ 'eae_flip_box_set',
972
+ [
973
+ 'label' => __( 'Flip Box', 'elementor' ),
974
+ 'type' => Controls_Manager::REPEATER,
975
+ 'show_label' => true,
976
+ 'fields' => array_values($repeater->get_controls()),
977
+ ]
978
+ );
979
+
980
+ $this->end_controls_section();
981
+
982
+ $this->start_controls_section(
983
+ 'section_general_style',
984
+ [
985
+ 'label' => __( 'General', 'elementor' ),
986
+ 'tab' => Controls_Manager::TAB_STYLE
987
+ ]
988
+ );
989
+
990
+ $this->add_control(
991
+ 'animation_style',
992
+ [
993
+ 'label' => __( 'Animation Style', 'elementor' ),
994
+ 'type' => Controls_Manager::SELECT,
995
+ 'options' => [
996
+ 'horizontal' => __( 'Horizontal', 'elementor' ),
997
+ 'vertical' => __( 'Vertical', 'elementor' ),
998
+ 'flipcard flipcard-rotate-top-down' => __( 'Cube - Top Down', 'elementor' ),
999
+ 'flipcard flipcard-rotate-down-top' => __( 'Cube - Down Top', 'elementor' ),
1000
+ 'flipcard flipcard-rotate-left-right' => __( 'Cube - Left Right', 'elementor' ),
1001
+ 'flipcard flipcard-rotate-right-left' => __( 'Cube - Right Left', 'elementor' ),
1002
+ 'fade' =>__('Fade','elementor'),
1003
+ '' =>__('Rollover','elementor'),
1004
+ 'flip box' =>__('Flip Box','elementor'),
1005
+ 'flip box fade' =>__('Flip Box Fade','elementor'),
1006
+ 'flip box fade up' =>__('Fade Up','elementor'),
1007
+ 'flip box fade hideback' =>__('Fade Hideback','elementor'),
1008
+ 'flip box fade up hideback' =>__('Fade Up Hideback','elementor'),
1009
+ 'nananana' =>__('Nananana','elementor'),
1010
+ 'zommin' => __( 'Zoom In', 'elementor' ),
1011
+ 'zoomout' => __( 'Zoom Out', 'elementor' ),
1012
+ ],
1013
+ 'default' => 'vertical',
1014
+ 'prefix_class' => 'eae-fb-animate-'
1015
+ ]
1016
+ );
1017
+
1018
+
1019
+ $this->add_group_control(
1020
+ Group_Control_Border::get_type(),
1021
+ [
1022
+ 'name' => 'flip_box_border',
1023
+ 'label' => __( 'Box Border', 'elementor' ),
1024
+ 'selector' => '{{WRAPPER}} .eae-flip-box-inner > div',
1025
+ ]
1026
+ );
1027
+
1028
+
1029
+
1030
+ $this->add_control(
1031
+ 'box_border_radius',
1032
+ [
1033
+ 'label' => __( 'Border Radius', 'elementor' ),
1034
+ 'type' => Controls_Manager::DIMENSIONS,
1035
+ 'size_units' => [ 'px', '%' ],
1036
+ 'selectors' => [
1037
+ '{{WRAPPER}} .eae-flip-box-front' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1038
+ '{{WRAPPER}} .eae-flip-box-back' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1039
+ ],
1040
+ ]
1041
+ );
1042
+
1043
+ $this->add_control(
1044
+ 'box_height',
1045
+ [
1046
+ 'type' => Controls_Manager::TEXT,
1047
+ 'label' => __( 'Box Height', 'elementor' ),
1048
+ 'placeholder' => __( '250', 'elementor' ),
1049
+ 'default' => __( '250', 'elementor' ),
1050
+ 'selectors' => [
1051
+ '{{WRAPPER}} .eae-flip-box-inner' => 'height: {{VALUE}}px;',
1052
+ '{{WRAPPER}}.eae-fb-animate-flipcard .eae-flip-box-front' => 'transform-origin: center center calc(-{{VALUE}}px/2);-webkit-transform-origin:center center calc(-{{VALUE}}px/2);',
1053
+ '{{WRAPPER}}.eae-fb-animate-flipcard .eae-flip-box-back' => 'transform-origin: center center calc(-{{VALUE }}px/2);-webkit-transform-origin:center center calc(-{{VALUE}}px/2);'
1054
+ ],
1055
+ ]
1056
+ );
1057
+
1058
+ $this->end_controls_section();
1059
+
1060
+ $this->start_controls_section(
1061
+ 'section-front-box-style',
1062
+ [
1063
+ 'label' => __( 'Front Box', 'elementor' ),
1064
+ 'tab' => Controls_Manager::TAB_STYLE
1065
+ ]
1066
+ );
1067
+ $this->add_control(
1068
+ 'front_icon_view_global',
1069
+ [
1070
+ 'label' => __( 'View', 'elementor' ),
1071
+ 'type' => Controls_Manager::SELECT,
1072
+ 'options' => [
1073
+ 'default' => __( 'Default', 'elementor' ),
1074
+ 'stacked' => __( 'Stacked', 'elementor' ),
1075
+ 'framed' => __( 'Framed', 'elementor' ),
1076
+ ],
1077
+ 'default' => 'default',
1078
+
1079
+ ]
1080
+ );
1081
+
1082
+ $this->add_control(
1083
+ 'front_icon_shape_global',
1084
+ [
1085
+ 'label' => __( 'Shape', 'elementor' ),
1086
+ 'type' => Controls_Manager::SELECT,
1087
+ 'options' => [
1088
+ 'circle' => __( 'Circle', 'elementor' ),
1089
+ 'square' => __( 'Square', 'elementor' ),
1090
+ ],
1091
+ 'default' => 'circle',
1092
+ 'condition' => [
1093
+ 'front_icon_view_global!' => 'default',
1094
+ ],
1095
+ ]
1096
+ );
1097
+
1098
+ $this->add_group_control(
1099
+ Group_Control_Background::get_type(),
1100
+ [
1101
+ 'name' => 'front_box_background',
1102
+ 'label' => __( 'Front Box Background', 'elementor' ),
1103
+ 'types' => [ 'classic','gradient' ],
1104
+ 'selector' => '{{WRAPPER}} .overwrite-style-no .eae-flip-box-front',
1105
+ ]
1106
+
1107
+ );
1108
+
1109
+
1110
+ $this->add_control(
1111
+ 'front_box_title_color',
1112
+ [
1113
+ 'label' => __( 'Title', 'elementor' ),
1114
+ 'type' => Controls_Manager::COLOR,
1115
+ 'scheme' => [
1116
+ 'type' => Scheme_Color::get_type(),
1117
+ 'value' => Scheme_Color::COLOR_1,
1118
+ ],
1119
+ 'default' => '#FFF',
1120
+ 'selectors' => [
1121
+ '{{WRAPPER}} .front-icon-title ' => 'color: {{VALUE}};',
1122
+ ],
1123
+ ]
1124
+ );
1125
+
1126
+ $this->add_group_control(
1127
+ Group_Control_Typography::get_type(),
1128
+ [
1129
+ 'name' => 'front_box_title_typography',
1130
+ 'label' => __( 'Title Typography', 'elementor' ),
1131
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
1132
+ 'selector' => '{{WRAPPER}} .front-icon-title',
1133
+ ]
1134
+ );
1135
+
1136
+ $this->add_control(
1137
+ 'front_box_text_color',
1138
+ [
1139
+ 'label' => __( 'Description Color', 'elementor' ),
1140
+ 'type' => Controls_Manager::COLOR,
1141
+ 'scheme' => [
1142
+ 'type' => Scheme_Color::get_type(),
1143
+ 'value' => Scheme_Color::COLOR_1,
1144
+ ],
1145
+ 'default' => '#FFF',
1146
+ 'selectors' => [
1147
+ '{{WRAPPER}} .eae-flip-box-front p' => 'color: {{VALUE}};',
1148
+ ],
1149
+
1150
+ ]
1151
+ );
1152
+
1153
+ $this->add_group_control(
1154
+ Group_Control_Typography::get_type(),
1155
+ [
1156
+ 'name' => 'front_box_text_typography',
1157
+ 'label' => __( 'Description Typography', 'elementor' ),
1158
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
1159
+ 'selector' => '{{WRAPPER}} .eae-flip-box-front p',
1160
+ ]
1161
+ );
1162
+
1163
+
1164
+ /**
1165
+ * Front Box icons styles
1166
+ **/
1167
+ $this->add_control(
1168
+ 'front_box_icon_color',
1169
+ [
1170
+ 'label' => __( 'Icon Color', 'elementor' ),
1171
+ 'type' => Controls_Manager::COLOR,
1172
+ 'scheme' => [
1173
+ 'type' => Scheme_Color::get_type(),
1174
+ 'value' => Scheme_Color::COLOR_1,
1175
+ ],
1176
+ 'default' => '#FFF',
1177
+ 'selectors' => [
1178
+ '{{WRAPPER}} .eae-flip-box-front .icon-wrapper i' => 'color: {{VALUE}};',
1179
+ ],
1180
+ ]
1181
+ );
1182
+
1183
+ $this->add_control(
1184
+ 'front_box_icon_fill_color',
1185
+ [
1186
+ 'label' => __( 'Icon Fill Color', 'elementor' ),
1187
+ 'type' => Controls_Manager::COLOR,
1188
+ 'scheme' => [
1189
+ 'type' => Scheme_Color::get_type(),
1190
+ 'value' => Scheme_Color::COLOR_1,
1191
+ ],
1192
+ 'selectors' => [
1193
+ '{{WRAPPER}} .eae-fb-icon-view-stacked' => 'background-color: {{VALUE}};',
1194
+ ],
1195
+ 'condition' => [
1196
+ 'front_icon_view_global' => 'stacked'
1197
+ ],
1198
+ ]
1199
+ );
1200
+
1201
+ $this->add_group_control(
1202
+ Group_Control_Border::get_type(),
1203
+ [
1204
+ 'name' => 'front_box_icon_border',
1205
+ 'label' => __( 'Box Border', 'elementor' ),
1206
+ 'placeholder' => '1px',
1207
+ 'default' => '1px',
1208
+ 'selector' => '{{WRAPPER}} .eae-flip-box-front .eae-fb-icon-view-framed, {{WRAPPER}} .eae-flip-box-front .eae-fb-icon-view-stacked',
1209
+ 'label_block' => true,
1210
+ 'condition' => [
1211
+ 'front_icon_view_global!' => 'default'
1212
+ ],
1213
+ ]
1214
+ );
1215
+
1216
+ $this->add_control(
1217
+ 'front_icon_size',
1218
+ [
1219
+ 'label' => __( 'Icon Size', 'elementor' ),
1220
+ 'type' => Controls_Manager::SLIDER,
1221
+ 'range' => [
1222
+ 'px' => [
1223
+ 'min' => 6,
1224
+ 'max' => 300,
1225
+ ],
1226
+ ],
1227
+ 'selectors' => [
1228
+ '{{WRAPPER}} .eae-flip-box-front .icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
1229
+ ],
1230
+ ]
1231
+ );
1232
+
1233
+ $this->add_control(
1234
+ 'front_icon_padding',
1235
+ [
1236
+ 'label' => __( 'Icon Padding', 'elementor' ),
1237
+ 'type' => Controls_Manager::SLIDER,
1238
+ 'selectors' => [
1239
+ '{{WRAPPER}} .eae-flip-box-front .icon-wrapper' => 'padding: {{SIZE}}{{UNIT}};',
1240
+ ],
1241
+ 'default' => [
1242
+ 'size' => 1.5,
1243
+ 'unit' => 'em',
1244
+ ],
1245
+ 'range' => [
1246
+ 'em' => [
1247
+ 'min' => 0,
1248
+ ],
1249
+ ],
1250
+ ]
1251
+ );
1252
+
1253
+ $this->end_controls_section();
1254
+
1255
+
1256
+
1257
+ $this->start_controls_section(
1258
+ 'section-back-box-style',
1259
+ [
1260
+ 'label' => __( 'Back Box', 'elementor' ),
1261
+ 'tab' => Controls_Manager::TAB_STYLE
1262
+ ]
1263
+ );
1264
+
1265
+ $this->add_control(
1266
+ 'back_icon_view_global',
1267
+ [
1268
+ 'label' => __( 'View', 'elementor' ),
1269
+ 'type' => Controls_Manager::SELECT,
1270
+ 'options' => [
1271
+ 'default' => __( 'Default', 'elementor' ),
1272
+ 'stacked' => __( 'Stacked', 'elementor' ),
1273
+ 'framed' => __( 'Framed', 'elementor' ),
1274
+ ],
1275
+ 'default' => 'default',
1276
+ ]
1277
+ );
1278
+
1279
+ $this->add_control(
1280
+ 'back_icon_shape_global',
1281
+ [
1282
+ 'label' => __( 'Shape', 'elementor' ),
1283
+ 'type' => Controls_Manager::SELECT,
1284
+ 'options' => [
1285
+ 'circle' => __( 'Circle', 'elementor' ),
1286
+ 'square' => __( 'Square', 'elementor' ),
1287
+ ],
1288
+ 'default' => 'circle',
1289
+
1290
+ ]
1291
+ );
1292
+ $this->add_group_control(
1293
+ Group_Control_Background::get_type(),
1294
+ [
1295
+ 'name' => 'back_box_background',
1296
+ 'label' => __( 'Back Box Background', 'elementor' ),
1297
+ 'types' => [ 'classic','gradient' ],
1298
+ 'selector' => '{{WRAPPER}} .eae-flip-box-back',
1299
+ ]
1300
+ );
1301
+
1302
+ $this->add_control(
1303
+ 'back_box_title_color',
1304
+ [
1305
+ 'label' => __( 'Title', 'elementor' ),
1306
+ 'type' => Controls_Manager::COLOR,
1307
+ 'scheme' => [
1308
+ 'type' => Scheme_Color::get_type(),
1309
+ 'value' => Scheme_Color::COLOR_1,
1310
+ ],
1311
+ 'default' => '#FFF',
1312
+ 'selectors' => [
1313
+ '{{WRAPPER}} .back-icon-title' => 'color: {{VALUE}};',
1314
+ ],
1315
+
1316
+ ]
1317
+ );
1318
+
1319
+ $this->add_group_control(
1320
+ Group_Control_Typography::get_type(),
1321
+ [
1322
+ 'name' => 'back_box_title_typography',
1323
+ 'label' => __( 'Title Typography', 'elementor' ),
1324
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
1325
+ 'selector' => '{{WRAPPER}} .back-icon-title',
1326
+ ]
1327
+ );
1328
+
1329
+ $this->add_control(
1330
+ 'back_box_text_color',
1331
+ [
1332
+ 'label' => __( 'Description Color', 'elementor' ),
1333
+ 'type' => Controls_Manager::COLOR,
1334
+ 'scheme' => [
1335
+ 'type' => Scheme_Color::get_type(),
1336
+ 'value' => Scheme_Color::COLOR_1,
1337
+ ],
1338
+ 'default' => '#FFF',
1339
+ 'selectors' => [
1340
+ '{{WRAPPER}} .eae-flip-box-back p' => 'color: {{VALUE}};',
1341
+ ],
1342
+
1343
+ ]
1344
+ );
1345
+
1346
+ $this->add_group_control(
1347
+ Group_Control_Typography::get_type(),
1348
+ [
1349
+ 'name' => 'back_box_text_typography',
1350
+ 'label' => __( 'Description Typography', 'elementor' ),
1351
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
1352
+ 'selector' => '{{WRAPPER}} .eae-flip-box-back p',
1353
+ ]
1354
+ );
1355
+
1356
+
1357
+ /**
1358
+ * Back Box icons styles
1359
+ **/
1360
+ $this->add_control(
1361
+ 'back_box_icon_color',
1362
+ [
1363
+ 'label' => __( 'Icon Color', 'elementor' ),
1364
+ 'type' => Controls_Manager::COLOR,
1365
+ 'scheme' => [
1366
+ 'type' => Scheme_Color::get_type(),
1367
+ 'value' => Scheme_Color::COLOR_1,
1368
+ ],
1369
+ 'default' => '#FFF',
1370
+ 'selectors' => [
1371
+ '{{WRAPPER}} .eae-flip-box-back .icon-wrapper i' => 'color: {{VALUE}};',
1372
+ ],
1373
+ ]
1374
+ );
1375
+
1376
+ $this->add_control(
1377
+ 'back_box_icon_fill_color',
1378
+ [
1379
+ 'label' => __( 'Icon Fill Color', 'elementor' ),
1380
+ 'type' => Controls_Manager::COLOR,
1381
+ 'scheme' => [
1382
+ 'type' => Scheme_Color::get_type(),
1383
+ 'value' => Scheme_Color::COLOR_1,
1384
+ ],
1385
+ 'selectors' => [
1386
+ '{{WRAPPER}} .eae-flip-box-back .eae-fb-icon-view-stacked' => 'background-color: {{VALUE}};',
1387
+ ],
1388
+ 'condition' => [
1389
+ 'back_icon_view_global' => 'stacked'
1390
+ ],
1391
+ ]
1392
+ );
1393
+
1394
+ $this->add_group_control(
1395
+ Group_Control_Border::get_type(),
1396
+ [
1397
+ 'name' => 'back_box_icon_border',
1398
+ 'label' => __( 'Box Border', 'elementor' ),
1399
+ 'placeholder' => '1px',
1400
+ 'default' => '1px',
1401
+ 'selector' => '{{WRAPPER}} .eae-flip-box-back .eae-fb-icon-view-framed, {{WRAPPER}} .eae-flip-box-back .eae-fb-icon-view-stacked',
1402
+ 'label_block' => true,
1403
+ 'condition' => [
1404
+ 'back_icon_view!' => 'default'
1405
+ ],
1406
+ ]
1407
+ );
1408
+
1409
+ $this->add_control(
1410
+ 'back_icon_size',
1411
+ [
1412
+ 'label' => __( 'Icon Size', 'elementor' ),
1413
+ 'type' => Controls_Manager::SLIDER,
1414
+ 'range' => [
1415
+ 'px' => [
1416
+ 'min' => 6,
1417
+ 'max' => 300,
1418
+ ],
1419
+ ],
1420
+ 'selectors' => [
1421
+ '{{WRAPPER}} .eae-flip-box-back .icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
1422
+ ],
1423
+ ]
1424
+ );
1425
+
1426
+ $this->add_control(
1427
+ 'back_icon_padding',
1428
+ [
1429
+ 'label' => __( 'Icon Padding', 'elementor' ),
1430
+ 'type' => Controls_Manager::SLIDER,
1431
+ 'selectors' => [
1432
+ '{{WRAPPER}} .eae-flip-box-back .icon-wrapper' => 'padding: {{SIZE}}{{UNIT}};',
1433
+ ],
1434
+ 'default' => [
1435
+ 'size' => 1.5,
1436
+ 'unit' => 'em',
1437
+ ],
1438
+ 'range' => [
1439
+ 'em' => [
1440
+ 'min' => 0,
1441
+ ],
1442
+ ],
1443
+ 'condition' => [
1444
+ 'back_icon_view!' => 'default',
1445
+ ],
1446
+ ]
1447
+ );
1448
+
1449
+
1450
+
1451
+ $this->end_controls_section();
1452
+
1453
+ $this->start_controls_section(
1454
+ 'section-action-button-style',
1455
+ [
1456
+ 'label' => __( 'Action Button', 'elementor' ),
1457
+ 'tab' => Controls_Manager::TAB_STYLE,
1458
+ ]
1459
+ );
1460
+
1461
+ $this->add_control(
1462
+ 'button_text_color',
1463
+ [
1464
+ 'label' => __( 'Text Color', 'elementor' ),
1465
+ 'type' => Controls_Manager::COLOR,
1466
+ 'default' => '#fff',
1467
+ 'selectors' => [
1468
+ '{{WRAPPER}} .eae-fb-button' => 'color: {{VALUE}};',
1469
+ ],
1470
+ ]
1471
+ );
1472
+
1473
+ $this->add_group_control(
1474
+ Group_Control_Typography::get_type(),
1475
+ [
1476
+ 'name' => 'typography',
1477
+ 'label' => __( 'Typography', 'elementor' ),
1478
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
1479
+ 'selector' => '{{WRAPPER}} .eae-fb-button',
1480
+ ]
1481
+ );
1482
+
1483
+ $this->add_control(
1484
+ 'background_color',
1485
+ [
1486
+ 'label' => __( 'Background Color', 'elementor' ),
1487
+ 'type' => Controls_Manager::COLOR,
1488
+ 'scheme' => [
1489
+ 'type' => Scheme_Color::get_type(),
1490
+ 'value' => Scheme_Color::COLOR_4,
1491
+ ],
1492
+ 'default' => '#93C64F',
1493
+ 'selectors' => [
1494
+ '{{WRAPPER}} .eae-fb-button' => 'background-color: {{VALUE}};',
1495
+ ],
1496
+ ]
1497
+ );
1498
+
1499
+ $this->add_group_control(
1500
+ Group_Control_Border::get_type(),
1501
+ [
1502
+ 'name' => 'border',
1503
+ 'label' => __( 'Border', 'elementor' ),
1504
+ 'placeholder' => '1px',
1505
+ 'default' => '1px',
1506
+ 'selector' => '{{WRAPPER}} .eae-fb-button',
1507
+ ]
1508
+ );
1509
+
1510
+ $this->add_control(
1511
+ 'border_radius',
1512
+ [
1513
+ 'label' => __( 'Border Radius', 'elementor' ),
1514
+ 'type' => Controls_Manager::DIMENSIONS,
1515
+ 'size_units' => [ 'px', '%' ],
1516
+ 'selectors' => [
1517
+ '{{WRAPPER}} .eae-fb-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1518
+ ],
1519
+ ]
1520
+ );
1521
+
1522
+ $this->add_control(
1523
+ 'text_padding',
1524
+ [
1525
+ 'label' => __( 'Text Padding', 'elementor' ),
1526
+ 'type' => Controls_Manager::DIMENSIONS,
1527
+ 'size_units' => [ 'px', 'em', '%' ],
1528
+ 'selectors' => [
1529
+ '{{WRAPPER}} .eae-fb-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1530
+ ],
1531
+ ]
1532
+ );
1533
+
1534
+ $this->end_controls_section();
1535
+
1536
+ }
1537
+ protected function render( ) {
1538
+ $settings = $this->get_settings_for_display();
1539
+
1540
+ if(count($settings['eae_flip_box_set'])){
1541
+ //echo "<pre>";print_r($settings);echo "</pre>";
1542
+ ?>
1543
+ <div class="eae-flip-box">
1544
+ <?php
1545
+ foreach ($settings['eae_flip_box_set'] as $flipbox){
1546
+ //echo "<pre>";print_r($flipbox);echo "</pre>";
1547
+ if($flipbox['front_box_element'] == "icon") {
1548
+ if($flipbox['style_indv'] == "yes") {
1549
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon-wrapper', 'class', 'icon-wrapper' );
1550
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon-wrapper', 'class', 'eae-fb-icon-view-' . $flipbox['front_icon_view'] );
1551
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon-wrapper', 'class', 'eae-fb-icon-shape-' . $flipbox['front_icon_shape'] );
1552
+ }
1553
+ else
1554
+ {
1555
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon-wrapper', 'class', 'icon-wrapper' );
1556
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon-wrapper', 'class', 'eae-fb-icon-view-' . $settings['front_icon_view_global'] );
1557
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon-wrapper', 'class', 'eae-fb-icon-shape-' . $settings['front_icon_shape_global'] );
1558
+ }
1559
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon-title', 'class', 'front-icon-title' );
1560
+ $this->add_render_attribute( $flipbox['_id'].'-front-icon', 'class', $flipbox['front_icon'] );
1561
+ }
1562
+ if($flipbox['back_box_element'] == "icon") {
1563
+ if($flipbox['style_indv'] == "yes") {
1564
+ $this->add_render_attribute($flipbox['_id'] . '-back-icon-wrapper', 'class', 'icon-wrapper');
1565
+ $this->add_render_attribute($flipbox['_id'] . '-back-icon-wrapper', 'class', 'eae-fb-icon-view-' . $flipbox['back_icon_view']);
1566
+ $this->add_render_attribute($flipbox['_id'] . '-back-icon-wrapper', 'class', 'eae-fb-icon-shape-' . $flipbox['back_icon_shape']);
1567
+ }
1568
+ else
1569
+ {
1570
+ $this->add_render_attribute( $flipbox['_id'].'-back-icon-wrapper', 'class', 'icon-wrapper' );
1571
+ $this->add_render_attribute( $flipbox['_id'].'-back-icon-wrapper', 'class', 'eae-fb-icon-view-' . $settings['back_icon_view_global'] );
1572
+ $this->add_render_attribute( $flipbox['_id'].'-back-icon-wrapper', 'class', 'eae-fb-icon-shape-' . $settings['back_icon_shape_global'] );
1573
+ }
1574
+ $this->add_render_attribute( $flipbox['_id'].'-back-icon-title', 'class', 'back-icon-title' );
1575
+ $this->add_render_attribute( $flipbox['_id'].'-back-icon', 'class', $flipbox['back_icon'] );
1576
+ }
1577
+ $this->add_render_attribute( $flipbox['_id'].'-button', 'class', 'eae-fb-button' );
1578
+ if ( ! empty( $flipbox['link']['url'] ) ) {
1579
+ $this->add_render_attribute( $flipbox['_id'].'-button', 'href', $flipbox['link']['url'] );
1580
+
1581
+ if ( ! empty( $flipbox['link']['is_external'] ) ) {
1582
+ $this->add_render_attribute( $flipbox['_id'].'-button', 'target', '_blank' );
1583
+ }
1584
+ }
1585
+ ?>
1586
+
1587
+ <div class="elementor-repeater-item-<?php echo $flipbox['_id']; ?> overwrite-style-<?php echo $flipbox['style_indv']; ?> eae-flip-box-wrapper ">
1588
+ <div class="eae-flip-box-inner" >
1589
+
1590
+ <div class="eae-flip-box-front">
1591
+ <div class="flipbox-content">
1592
+ <?php if($flipbox['front_box_element'] == "icon") {?>
1593
+ <?php if(!empty($flipbox['front_icon'])){ ?>
1594
+ <div <?php echo $this->get_render_attribute_string( $flipbox['_id'].'-front-icon-wrapper' ); ?>>
1595
+ <i <?php echo $this->get_render_attribute_string( $flipbox['_id'].'-front-icon' ); ?>></i>
1596
+ </div>
1597
+ <?php } } ?>
1598
+ <?php if($flipbox['front_box_element'] == "image"){
1599
+ if($flipbox['front_box_image']['url'] !="")
1600
+ {
1601
+ $pix = wp_get_attachment_image_src($flipbox['front_box_image']['id'],$flipbox['front_image_size_size']);
1602
+ echo "<img src='".$pix[0]."'>";
1603
+
1604
+ }
1605
+ }?>
1606
+
1607
+ <?php if(!empty($flipbox['front_title'])){ ?>
1608
+ <<?php echo $flipbox['front_title_html_tag']; ?> <?php echo $this->get_render_attribute_string( $flipbox['_id'].'-front-icon-title' ); ?> >
1609
+ <?php echo $flipbox['front_title']; ?>
1610
+ </<?php echo $flipbox['front_title_html_tag']; ?>>
1611
+ <?php } ?>
1612
+
1613
+ <?php if(!empty($flipbox['front_text'])){ ?>
1614
+ <p>
1615
+ <?php echo $flipbox['front_text']; ?>
1616
+ </p>
1617
+ <?php } ?>
1618
+ </div>
1619
+ </div>
1620
+
1621
+ <div class="eae-flip-box-back">
1622
+ <div class="flipbox-content">
1623
+ <?php if($flipbox['back_box_element'] == "icon") {?>
1624
+ <?php if(!empty($flipbox['back_icon'])){ ?>
1625
+ <div <?php echo $this->get_render_attribute_string( $flipbox['_id'].'-back-icon-wrapper' ); ?>>
1626
+ <i <?php echo $this->get_render_attribute_string( $flipbox['_id'].'-back-icon' ); ?>></i>
1627
+ </div>
1628
+ <?php } }?>
1629
+ <?php if($flipbox['back_box_element'] == "image"){
1630
+ if($flipbox['back_box_image']['url'] !="")
1631
+ {
1632
+ //echo "<img src='".$flipbox['back_box_image']['url']."'>";
1633
+ $back_pix = wp_get_attachment_image_src($flipbox['back_box_image']['id'],$flipbox['back_image_size_size']);
1634
+ echo "<img src='".$back_pix[0]."'>";
1635
+ }
1636
+ }?>
1637
+ <?php if(!empty($flipbox['back_title'])){ ?>
1638
+ <<?php echo $flipbox['back_title_html_tag']; ?> <?php echo $this->get_render_attribute_string( 'back-icon-title' ); ?> >
1639
+ <?php echo $flipbox['back_title']; ?>
1640
+ </<?php echo $flipbox['back_title_html_tag']; ?>>
1641
+ <?php } ?>
1642
+
1643
+ <?php if(!empty($flipbox['back_text'])){ ?>
1644
+ <p>
1645
+ <?php echo $flipbox['back_text']; ?>
1646
+ </p>
1647
+ <?php } ?>
1648
+
1649
+ <?php if(!empty($flipbox['action_text'])){ ?>
1650
+ <div class="eae-fb-button-wrapper">
1651
+ <a <?php echo $this->get_render_attribute_string( $flipbox['_id'].'-button' ); ?>>
1652
+ <span class="elementor-button-text"><?php echo $flipbox['action_text']; ?></span>
1653
+ </a>
1654
+ </div>
1655
+ <?php } ?>
1656
+ </div>
1657
+ </div>
1658
+
1659
+ </div>
1660
+ </div>
1661
+
1662
+ <?php
1663
+ }
1664
+ ?>
1665
+ </div>
1666
+ <?php }
1667
+
1668
+ }
1669
+
1670
+ protected function _content_template() {
1671
+ ?>
1672
+ <div class="eae-flip-box">
1673
+ <#
1674
+
1675
+ if(settings.eae_flip_box_set.length){
1676
+ settings.eae_flip_box_set.forEach(flipbox);
1677
+
1678
+ function flipbox(item, index){
1679
+ if(item.front_box_element == "icon") {
1680
+ if(item.style_indv == "yes") {
1681
+ view.addRenderAttribute( item._id + '-front-icon-wrapper', 'class', 'icon-wrapper' );
1682
+ view.addRenderAttribute( item._id + '-front-icon-wrapper', 'class', 'eae-fb-icon-view-' + item.front_icon_view );
1683
+ view.addRenderAttribute( item._id + '-front-icon-wrapper', 'class', 'eae-fb-icon-shape-' + item.front_icon_shape );
1684
+ }
1685
+ else
1686
+ {
1687
+ view.addRenderAttribute( item._id + '-front-icon-wrapper', 'class', 'icon-wrapper' );
1688
+ view.addRenderAttribute( item._id + '-front-icon-wrapper', 'class', 'eae-fb-icon-view-' + item.front_icon_view_global );
1689
+ view.addRenderAttribute( item._id + '-front-icon-wrapper', 'class', 'eae-fb-icon-shape-' + item.front_icon_shape_global );
1690
+ }
1691
+ view.addRenderAttribute( item._id + '-front-icon-title', 'class', 'front-icon-title' );
1692
+ view.addRenderAttribute( item._id + '-front-icon', 'class', item.front_icon );
1693
+ }
1694
+ if(item.back_box_element == "icon") {
1695
+ if(item.style_indv == "yes") {
1696
+ view.addRenderAttribute(item._id + '-back-icon-wrapper', 'class', 'icon-wrapper');
1697
+ view.addRenderAttribute(item._id + '-back-icon-wrapper', 'class', 'eae-fb-icon-view-' + item.back_icon_view);
1698
+ view.addRenderAttribute(item._id + '-back-icon-wrapper', 'class', 'eae-fb-icon-shape-' + item.back_icon_shape);
1699
+ }
1700
+ else
1701
+ {
1702
+ view.addRenderAttribute( item._id + '-back-icon-wrapper', 'class', 'icon-wrapper' );
1703
+ view.addRenderAttribute( item._id + '-back-icon-wrapper', 'class', 'eae-fb-icon-view-' + item.back_icon_view_global );
1704
+ view.addRenderAttribute( item._id + '-back-icon-wrapper', 'class', 'eae-fb-icon-shape-' + item.back_icon_shape_global );
1705
+ }
1706
+ view.addRenderAttribute( item._id + '-back-icon-title', 'class', 'back-icon-title' );
1707
+ view.addRenderAttribute( item._id + '-back-icon', 'class', item.back_icon );
1708
+ }
1709
+
1710
+ view.addRenderAttribute( item._id + '-button', 'class', 'eae-fb-button' );
1711
+ if ( item.link.url !== "" ) {
1712
+ view.addRenderAttribute( item._id + '-button', 'href', item.link.url);
1713
+
1714
+ if ( item.link.is_external !== "" ) {
1715
+ view.addRenderAttribute( item._id + '-button', 'target', '_blank' );
1716
+ }
1717
+ }
1718
+
1719
+ #>
1720
+
1721
+ <div class="elementor-repeater-item-{{{ item._id }}} overwrite-style-{{{ item.style_indv }}} eae-flip-box-wrapper ">
1722
+ <div class="eae-flip-box-inner" >
1723
+
1724
+ <div class="eae-flip-box-front">
1725
+ <div class="flipbox-content">
1726
+
1727
+ <# if(item.front_box_element == "icon") {
1728
+ if(item.front_icon !== ""){ #>
1729
+ <div {{{ view.getRenderAttributeString( item._id + '-front-icon-wrapper' ) }}}>
1730
+ <i {{{ view.getRenderAttributeString( item._id + '-front-icon' ) }}}></i>
1731
+ </div>
1732
+ <# } } #>
1733
+ <# if(item.front_box_element == "image"){
1734
+ if(item.front_box_image.url !="")
1735
+ { #>
1736
+ <img src='{{{ item.front_box_image.url }}}'>
1737
+ <# }
1738
+ }#>
1739
+
1740
+ <# if(item.front_title !== "" ){ #>
1741
+ <{{{ item.front_title_html_tag }}} {{{ view.getRenderAttributeString( item._id + '-front-icon-title' ) }}} >
1742
+ {{{ item.front_title }}}
1743
+ </{{{ item.front_title_html_tag }}}>
1744
+ <# } #>
1745
+
1746
+ <# if(item.front_text !== ""){ #>
1747
+ <p>
1748
+ {{{ item.front_text }}}
1749
+ </p>
1750
+ <# } #>
1751
+
1752
+
1753
+ </div>
1754
+ </div>
1755
+
1756
+ <div class="eae-flip-box-back">
1757
+ <div class="flipbox-content">
1758
+ <# if(item.back_box_element == "icon") { #>
1759
+ <# if(item.back_icon !== "" ){ #>
1760
+ <div {{{ view.getRenderAttributeString( item._id + '-back-icon-wrapper' ) }}}>
1761
+ <i {{{ view.getRenderAttributeString( item._id + '-back-icon' ) }}}></i>
1762
+ </div>
1763
+ <# } } #>
1764
+ <# if(item.back_box_element == "image"){
1765
+ if(item.back_box_image.url !="")
1766
+ { #>
1767
+ <img src='{{{ item.back_box_image.url }}}'>
1768
+ <# }
1769
+ } #>
1770
+ <# if(item.back_title !== "" ){ #>
1771
+ <{{{ item.back_title_html_tag }}} {{{ view.getRenderAttributeString( 'back-icon-title' ) }}} >
1772
+ {{{ item.back_title }}}
1773
+ </{{{ item.back_title_html_tag }}}>
1774
+ <# } #>
1775
+
1776
+ <# if(item.back_text !== ""){ #>
1777
+ <p>
1778
+ {{{ item.back_text }}}
1779
+ </p>
1780
+ <# } #>
1781
+
1782
+ <# if(item.action_text !== ""){ #>
1783
+ <div class="eae-fb-button-wrapper">
1784
+ <a {{{ view.getRenderAttributeString( item._id + '-button' ) }}}>
1785
+ <span class="elementor-button-text">{{{ item.action_text }}}</span>
1786
+ </a>
1787
+ </div>
1788
+ <# } #>
1789
+ </div>
1790
+ </div>
1791
+ </div>
1792
+ </div>
1793
+
1794
+
1795
+ <# } } #>
1796
+ </div>
1797
+ <?php
1798
+ }
1799
+ }
1800
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_FlipBoxSet() );
elements/flipbox.php ADDED
@@ -0,0 +1,841 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_FlipBox extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-flipbox';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Flip Box', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-flip-box wts-eae-pe';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'wts-eae' ];
22
+ }
23
+
24
+ protected function _register_controls() {
25
+
26
+ $this->start_controls_section(
27
+ 'section_front_box',
28
+ [
29
+ 'label' => __( 'Front Box', 'elementor' )
30
+ ]
31
+ );
32
+
33
+ $this->add_control(
34
+ 'front_icon',
35
+ [
36
+ 'label' => __( 'Icon', 'elementor' ),
37
+ 'type' => Controls_Manager::ICON,
38
+ 'label_block' => true,
39
+ 'default' => 'fa fa-star',
40
+ ]
41
+ );
42
+
43
+ $this->add_control(
44
+ 'front_icon_view',
45
+ [
46
+ 'label' => __( 'View', 'elementor' ),
47
+ 'type' => Controls_Manager::SELECT,
48
+ 'options' => [
49
+ 'default' => __( 'Default', 'elementor' ),
50
+ 'stacked' => __( 'Stacked', 'elementor' ),
51
+ 'framed' => __( 'Framed', 'elementor' ),
52
+ ],
53
+ 'default' => 'default',
54
+
55
+ ]
56
+ );
57
+
58
+ $this->add_control(
59
+ 'front_icon_shape',
60
+ [
61
+ 'label' => __( 'Shape', 'elementor' ),
62
+ 'type' => Controls_Manager::SELECT,
63
+ 'options' => [
64
+ 'circle' => __( 'Circle', 'elementor' ),
65
+ 'square' => __( 'Square', 'elementor' ),
66
+ ],
67
+ 'default' => 'circle',
68
+ 'condition' => [
69
+ 'front_icon_view!' => 'default',
70
+ ],
71
+
72
+ ]
73
+ );
74
+
75
+ $this->add_control(
76
+ 'front_title',
77
+ [
78
+ 'label' => __( 'Title', 'elementor' ),
79
+ 'type' => Controls_Manager::TEXT,
80
+ 'dynamic' => [
81
+ 'active' => true,
82
+ ],
83
+ 'placeholder' => __( 'Enter text', 'elementor' ),
84
+ 'default' => __( 'Text Title', 'elementor' ),
85
+ ]
86
+ );
87
+
88
+ $this->add_control(
89
+ 'front_title_html_tag',
90
+ [
91
+ 'label' => __( 'HTML Tag', 'elementor' ),
92
+ 'type' => Controls_Manager::SELECT,
93
+ 'options' => [
94
+ 'h1' => __( 'H1', 'elementor' ),
95
+ 'h2' => __( 'H2', 'elementor' ),
96
+ 'h3' => __( 'H3', 'elementor' ),
97
+ 'h4' => __( 'H4', 'elementor' ),
98
+ 'h5' => __( 'H5', 'elementor' ),
99
+ 'h6' => __( 'H6', 'elementor' )
100
+ ],
101
+ 'default' => 'h3',
102
+ ]
103
+ );
104
+
105
+ $this->add_control(
106
+ 'front-text',
107
+ [
108
+ 'label' => __( 'Text', 'elementor' ),
109
+ 'type' => Controls_Manager::TEXTAREA,
110
+ 'dynamic' => [
111
+ 'active' => true,
112
+ ],
113
+ 'placeholder' => __( 'Enter text', 'elementor' ),
114
+ 'default' => __( 'Add some nice text here.', 'elementor' ),
115
+ ]
116
+ );
117
+
118
+ $this->end_controls_section();
119
+
120
+ $this->start_controls_section(
121
+ 'section_back_box',
122
+ [
123
+ 'label' => __( 'Back Box', 'elementor' )
124
+ ]
125
+ );
126
+
127
+ $this->add_control(
128
+ 'back_icon',
129
+ [
130
+ 'label' => __( 'Icon', 'elementor' ),
131
+ 'type' => Controls_Manager::ICON,
132
+ 'label_block' => true,
133
+ 'default' => 'fa fa-star',
134
+ ]
135
+ );
136
+
137
+ $this->add_control(
138
+ 'back_icon_view',
139
+ [
140
+ 'label' => __( 'View', 'elementor' ),
141
+ 'type' => Controls_Manager::SELECT,
142
+ 'options' => [
143
+ 'default' => __( 'Default', 'elementor' ),
144
+ 'stacked' => __( 'Stacked', 'elementor' ),
145
+ 'framed' => __( 'Framed', 'elementor' ),
146
+ ],
147
+ 'default' => 'default',
148
+
149
+ ]
150
+ );
151
+
152
+ $this->add_control(
153
+ 'back_icon_shape',
154
+ [
155
+ 'label' => __( 'Shape', 'elementor' ),
156
+ 'type' => Controls_Manager::SELECT,
157
+ 'options' => [
158
+ 'circle' => __( 'Circle', 'elementor' ),
159
+ 'square' => __( 'Square', 'elementor' ),
160
+ ],
161
+ 'default' => 'circle',
162
+ 'condition' => [
163
+ 'back_icon_view!' => 'default',
164
+ ],
165
+
166
+ ]
167
+ );
168
+
169
+ $this->add_control(
170
+ 'back_title',
171
+ [
172
+ 'label' => __( 'Title', 'elementor' ),
173
+ 'type' => Controls_Manager::TEXT,
174
+ 'dynamic' => [
175
+ 'active' => true,
176
+ ],
177
+ 'placeholder' => __( 'Enter text', 'elementor' ),
178
+ 'default' => __( 'Text Title', 'elementor' ),
179
+ ]
180
+ );
181
+
182
+ $this->add_control(
183
+ 'back_title_html_tag',
184
+ [
185
+ 'label' => __( 'HTML Tag', 'elementor' ),
186
+ 'type' => Controls_Manager::SELECT,
187
+ 'options' => [
188
+ 'h1' => __( 'H1', 'elementor' ),
189
+ 'h2' => __( 'H2', 'elementor' ),
190
+ 'h3' => __( 'H3', 'elementor' ),
191
+ 'h4' => __( 'H4', 'elementor' ),
192
+ 'h5' => __( 'H5', 'elementor' ),
193
+ 'h6' => __( 'H6', 'elementor' )
194
+ ],
195
+ 'default' => 'h3',
196
+ ]
197
+ );
198
+
199
+ $this->add_control(
200
+ 'back_text',
201
+ [
202
+ 'label' => __( 'Text', 'elementor' ),
203
+ 'type' => Controls_Manager::TEXTAREA,
204
+ 'dynamic' => [
205
+ 'active' => true,
206
+ ],
207
+ 'placeholder' => __( 'Enter text', 'elementor' ),
208
+ 'default' => __( 'Add some nice text here.', 'elementor' ),
209
+ ]
210
+ );
211
+
212
+ $this->end_controls_section();
213
+
214
+
215
+ $this->start_controls_section(
216
+ 'section-action-button',
217
+ [
218
+ 'label' => __( 'Action Button', 'elementor' ),
219
+ ]
220
+ );
221
+
222
+ $this->add_control(
223
+ 'action_text',
224
+ [
225
+ 'label' => __( 'Button Text', 'elementor' ),
226
+ 'type' => Controls_Manager::TEXT,
227
+ 'placeholder' => __( 'Buy', 'elementor' ),
228
+ 'default' => __( 'Buy Now', 'elementor' ),
229
+ ]
230
+ );
231
+
232
+ $this->add_control(
233
+ 'link',
234
+ [
235
+ 'label' => __( 'Link to', 'elementor' ),
236
+ 'type' => Controls_Manager::URL,
237
+ 'dynamic' => [
238
+ 'active' => true,
239
+ ],
240
+ 'placeholder' => __( 'http://your-link.com', 'elementor' ),
241
+ 'separator' => 'before',
242
+ ]
243
+ );
244
+
245
+ $this->end_controls_section();
246
+
247
+ $this->start_controls_section(
248
+ 'section-general-style',
249
+ [
250
+ 'label' => __( 'General', 'elementor' ),
251
+ 'tab' => Controls_Manager::TAB_STYLE
252
+ ]
253
+ );
254
+
255
+ $this->add_control(
256
+ 'animation_style',
257
+ [
258
+ 'label' => __( 'Animation Style', 'elementor' ),
259
+ 'type' => Controls_Manager::SELECT,
260
+ 'options' => [
261
+ 'horizontal' => __( 'Flip Horizontal', 'elementor' ),
262
+ 'vertical' => __( 'Flip Vertical', 'elementor' ),
263
+ 'fade' =>__('Fade','elementor'),
264
+ ],
265
+ 'default' => 'vertical',
266
+ 'prefix_class' => 'eae-fb-animate-'
267
+ ]
268
+ );
269
+
270
+
271
+ $this->add_group_control(
272
+ Group_Control_Border::get_type(),
273
+ [
274
+ 'name' => 'flip_box_border',
275
+ 'label' => __( 'Box Border', 'elementor' ),
276
+ 'selector' => '{{WRAPPER}} .eae-flip-box-inner > div',
277
+ ]
278
+ );
279
+
280
+
281
+
282
+ $this->add_control(
283
+ 'box_border_radius',
284
+ [
285
+ 'label' => __( 'Border Radius', 'elementor' ),
286
+ 'type' => Controls_Manager::DIMENSIONS,
287
+ 'size_units' => [ 'px', '%' ],
288
+ 'selectors' => [
289
+ '{{WRAPPER}} .eae-flip-box-front' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
290
+ '{{WRAPPER}} .eae-flip-box-back' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
291
+ ],
292
+ ]
293
+ );
294
+
295
+ $this->add_control(
296
+ 'box_height',
297
+ [
298
+ 'type' => Controls_Manager::TEXT,
299
+ 'label' => __( 'Box Height', 'elementor' ),
300
+ 'placeholder' => __( '250', 'elementor' ),
301
+ 'default' => __( '250', 'elementor' ),
302
+ 'selectors' => [
303
+ '{{WRAPPER}} .eae-flip-box-inner' => 'height: {{VALUE}}px;',
304
+ '{{WRAPPER}} .eae-flip-box-inner' => 'height: {{VALUE}}px;'
305
+ ],
306
+ ]
307
+ );
308
+
309
+ $this->end_controls_section();
310
+
311
+ $this->start_controls_section(
312
+ 'section-front-box-style',
313
+ [
314
+ 'label' => __( 'Front Box', 'elementor' ),
315
+ 'tab' => Controls_Manager::TAB_STYLE
316
+ ]
317
+ );
318
+
319
+ $this->add_group_control(
320
+ Group_Control_Background::get_type(),
321
+ [
322
+ 'name' => 'front_box_background',
323
+ 'label' => __( 'Front Box Background', 'elementor' ),
324
+ 'types' => [ 'classic','gradient' ],
325
+ 'selector' => '{{WRAPPER}} .eae-flip-box-front',
326
+ ]
327
+ );
328
+
329
+
330
+ $this->add_control(
331
+ 'front_box_title_color',
332
+ [
333
+ 'label' => __( 'Title', 'elementor' ),
334
+ 'type' => Controls_Manager::COLOR,
335
+ 'scheme' => [
336
+ 'type' => Scheme_Color::get_type(),
337
+ 'value' => Scheme_Color::COLOR_1,
338
+ ],
339
+ 'default' => '#FFF',
340
+ 'selectors' => [
341
+ '{{WRAPPER}} .front-icon-title' => 'color: {{VALUE}};',
342
+ ],
343
+ 'condition' => [
344
+ 'front_title!' => ''
345
+ ],
346
+ ]
347
+ );
348
+
349
+ $this->add_group_control(
350
+ Group_Control_Typography::get_type(),
351
+ [
352
+ 'name' => 'front_box_title_typography',
353
+ 'label' => __( 'Title Typography', 'elementor' ),
354
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
355
+ 'selector' => '{{WRAPPER}} .front-icon-title',
356
+ ]
357
+ );
358
+
359
+ $this->add_control(
360
+ 'front_box_text_color',
361
+ [
362
+ 'label' => __( 'Description Color', 'elementor' ),
363
+ 'type' => Controls_Manager::COLOR,
364
+ 'scheme' => [
365
+ 'type' => Scheme_Color::get_type(),
366
+ 'value' => Scheme_Color::COLOR_1,
367
+ ],
368
+ 'default' => '#FFF',
369
+ 'selectors' => [
370
+ '{{WRAPPER}} .eae-flip-box-front p' => 'color: {{VALUE}};',
371
+ ],
372
+
373
+ ]
374
+ );
375
+
376
+ $this->add_group_control(
377
+ Group_Control_Typography::get_type(),
378
+ [
379
+ 'name' => 'front_box_text_typography',
380
+ 'label' => __( 'Description Typography', 'elementor' ),
381
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
382
+ 'selector' => '{{WRAPPER}} .eae-flip-box-front p',
383
+ ]
384
+ );
385
+
386
+
387
+ /**
388
+ * Front Box icons styles
389
+ **/
390
+ $this->add_control(
391
+ 'front_box_icon_color',
392
+ [
393
+ 'label' => __( 'Icon Color', 'elementor' ),
394
+ 'type' => Controls_Manager::COLOR,
395
+ 'scheme' => [
396
+ 'type' => Scheme_Color::get_type(),
397
+ 'value' => Scheme_Color::COLOR_1,
398
+ ],
399
+ 'default' => '#FFF',
400
+ 'selectors' => [
401
+ '{{WRAPPER}} .eae-flip-box-front .icon-wrapper i' => 'color: {{VALUE}};',
402
+ ],
403
+ 'condition' => [
404
+ 'front_icon!' => ''
405
+ ],
406
+ ]
407
+ );
408
+
409
+ $this->add_control(
410
+ 'front_box_icon_fill_color',
411
+ [
412
+ 'label' => __( 'Icon Fill Color', 'elementor' ),
413
+ 'type' => Controls_Manager::COLOR,
414
+ 'scheme' => [
415
+ 'type' => Scheme_Color::get_type(),
416
+ 'value' => Scheme_Color::COLOR_1,
417
+ ],
418
+ 'default' => '#92BE43',
419
+ 'selectors' => [
420
+ '{{WRAPPER}} .eae-fb-icon-view-stacked' => 'background-color: {{VALUE}};',
421
+ ],
422
+ 'condition' => [
423
+ 'front_icon_view' => 'stacked'
424
+ ],
425
+ ]
426
+ );
427
+
428
+ $this->add_group_control(
429
+ Group_Control_Border::get_type(),
430
+ [
431
+ 'name' => 'front_box_icon_border',
432
+ 'label' => __( 'Box Border', 'elementor' ),
433
+ 'placeholder' => '1px',
434
+ 'default' => '1px',
435
+ 'selector' => '{{WRAPPER}} .eae-flip-box-front .eae-fb-icon-view-framed, {{WRAPPER}} .eae-flip-box-front .eae-fb-icon-view-stacked',
436
+ 'label_block' => true,
437
+ 'condition' => [
438
+ 'front_icon_view!' => 'default'
439
+ ],
440
+ ]
441
+ );
442
+
443
+ $this->add_control(
444
+ 'front_icon_size',
445
+ [
446
+ 'label' => __( 'Icon Size', 'elementor' ),
447
+ 'type' => Controls_Manager::SLIDER,
448
+ 'range' => [
449
+ 'px' => [
450
+ 'min' => 6,
451
+ 'max' => 300,
452
+ ],
453
+ ],
454
+ 'selectors' => [
455
+ '{{WRAPPER}} .eae-flip-box-front .icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
456
+ ],
457
+ ]
458
+ );
459
+
460
+ $this->add_control(
461
+ 'front_icon_padding',
462
+ [
463
+ 'label' => __( 'Icon Padding', 'elementor' ),
464
+ 'type' => Controls_Manager::SLIDER,
465
+ 'selectors' => [
466
+ '{{WRAPPER}} .eae-flip-box-front .icon-wrapper' => 'padding: {{SIZE}}{{UNIT}};',
467
+ ],
468
+ 'default' => [
469
+ 'size' => 1.5,
470
+ 'unit' => 'em',
471
+ ],
472
+ 'range' => [
473
+ 'em' => [
474
+ 'min' => 0,
475
+ ],
476
+ ],
477
+ 'condition' => [
478
+ 'front_icon_view!' => 'default',
479
+ ],
480
+ ]
481
+ );
482
+
483
+
484
+
485
+
486
+
487
+ $this->end_controls_section();
488
+
489
+
490
+
491
+ $this->start_controls_section(
492
+ 'section-back-box-style',
493
+ [
494
+ 'label' => __( 'Back Box', 'elementor' ),
495
+ 'tab' => Controls_Manager::TAB_STYLE
496
+ ]
497
+ );
498
+
499
+
500
+ $this->add_group_control(
501
+ Group_Control_Background::get_type(),
502
+ [
503
+ 'name' => 'back_box_background',
504
+ 'label' => __( 'Back Box Background', 'elementor' ),
505
+ 'types' => [ 'classic','gradient' ],
506
+ 'selector' => '{{WRAPPER}} .eae-flip-box-back',
507
+ ]
508
+ );
509
+
510
+ $this->add_control(
511
+ 'back_box_title_color',
512
+ [
513
+ 'label' => __( 'Title', 'elementor' ),
514
+ 'type' => Controls_Manager::COLOR,
515
+ 'scheme' => [
516
+ 'type' => Scheme_Color::get_type(),
517
+ 'value' => Scheme_Color::COLOR_1,
518
+ ],
519
+ 'default' => '#FFF',
520
+ 'selectors' => [
521
+ '{{WRAPPER}} .back-icon-title' => 'color: {{VALUE}};',
522
+ ],
523
+
524
+ ]
525
+ );
526
+
527
+ $this->add_group_control(
528
+ Group_Control_Typography::get_type(),
529
+ [
530
+ 'name' => 'back_box_title_typography',
531
+ 'label' => __( 'Title Typography', 'elementor' ),
532
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
533
+ 'selector' => '{{WRAPPER}} .back-icon-title',
534
+ ]
535
+ );
536
+
537
+ $this->add_control(
538
+ 'back_box_text_color',
539
+ [
540
+ 'label' => __( 'Description Color', 'elementor' ),
541
+ 'type' => Controls_Manager::COLOR,
542
+ 'scheme' => [
543
+ 'type' => Scheme_Color::get_type(),
544
+ 'value' => Scheme_Color::COLOR_1,
545
+ ],
546
+ 'default' => '#FFF',
547
+ 'selectors' => [
548
+ '{{WRAPPER}} .eae-flip-box-back p' => 'color: {{VALUE}};',
549
+ ],
550
+
551
+ ]
552
+ );
553
+
554
+ $this->add_group_control(
555
+ Group_Control_Typography::get_type(),
556
+ [
557
+ 'name' => 'back_box_text_typography',
558
+ 'label' => __( 'Description Typography', 'elementor' ),
559
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
560
+ 'selector' => '{{WRAPPER}} .eae-flip-box-back p',
561
+ ]
562
+ );
563
+
564
+
565
+ /**
566
+ * Back Box icons styles
567
+ **/
568
+ $this->add_control(
569
+ 'back_box_icon_color',
570
+ [
571
+ 'label' => __( 'Icon Color', 'elementor' ),
572
+ 'type' => Controls_Manager::COLOR,
573
+ 'scheme' => [
574
+ 'type' => Scheme_Color::get_type(),
575
+ 'value' => Scheme_Color::COLOR_1,
576
+ ],
577
+ 'default' => '#FFF',
578
+ 'selectors' => [
579
+ '{{WRAPPER}} .eae-flip-box-back .icon-wrapper i' => 'color: {{VALUE}};',
580
+ ],
581
+ 'condition' => [
582
+ 'back_icon!' => ''
583
+ ],
584
+ ]
585
+ );
586
+
587
+ $this->add_control(
588
+ 'back_box_icon_fill_color',
589
+ [
590
+ 'label' => __( 'Icon Fill Color', 'elementor' ),
591
+ 'type' => Controls_Manager::COLOR,
592
+ 'scheme' => [
593
+ 'type' => Scheme_Color::get_type(),
594
+ 'value' => Scheme_Color::COLOR_1,
595
+ ],
596
+ 'default' => '#92BE43',
597
+ 'selectors' => [
598
+ '{{WRAPPER}} .eae-flip-box-back .eae-fb-icon-view-stacked' => 'background-color: {{VALUE}};',
599
+ ],
600
+ 'condition' => [
601
+ 'front_icon_view' => 'stacked'
602
+ ],
603
+ ]
604
+ );
605
+
606
+ $this->add_group_control(
607
+ Group_Control_Border::get_type(),
608
+ [
609
+ 'name' => 'back_box_icon_border',
610
+ 'label' => __( 'Box Border', 'elementor' ),
611
+ 'placeholder' => '1px',
612
+ 'default' => '1px',
613
+ 'selector' => '{{WRAPPER}} .eae-flip-box-back .eae-fb-icon-view-framed, {{WRAPPER}} .eae-flip-box-back .eae-fb-icon-view-stacked',
614
+ 'label_block' => true,
615
+ 'condition' => [
616
+ 'back_icon_view!' => 'default'
617
+ ],
618
+ ]
619
+ );
620
+
621
+ $this->add_control(
622
+ 'back_icon_size',
623
+ [
624
+ 'label' => __( 'Icon Size', 'elementor' ),
625
+ 'type' => Controls_Manager::SLIDER,
626
+ 'range' => [
627
+ 'px' => [
628
+ 'min' => 6,
629
+ 'max' => 300,
630
+ ],
631
+ ],
632
+ 'selectors' => [
633
+ '{{WRAPPER}} .eae-flip-box-back .icon-wrapper i' => 'font-size: {{SIZE}}{{UNIT}};',
634
+ ],
635
+ ]
636
+ );
637
+
638
+ $this->add_control(
639
+ 'back_icon_padding',
640
+ [
641
+ 'label' => __( 'Icon Padding', 'elementor' ),
642
+ 'type' => Controls_Manager::SLIDER,
643
+ 'selectors' => [
644
+ '{{WRAPPER}} .eae-flip-box-back .icon-wrapper' => 'padding: {{SIZE}}{{UNIT}};',
645
+ ],
646
+ 'default' => [
647
+ 'size' => 1.5,
648
+ 'unit' => 'em',
649
+ ],
650
+ 'range' => [
651
+ 'em' => [
652
+ 'min' => 0,
653
+ ],
654
+ ],
655
+ 'condition' => [
656
+ 'back_icon_view!' => 'default',
657
+ ],
658
+ ]
659
+ );
660
+
661
+
662
+
663
+ $this->end_controls_section();
664
+
665
+ $this->start_controls_section(
666
+ 'section-action-button-style',
667
+ [
668
+ 'label' => __( 'Action Button', 'elementor' ),
669
+ 'tab' => Controls_Manager::TAB_STYLE,
670
+ ]
671
+ );
672
+
673
+ $this->add_control(
674
+ 'button_text_color',
675
+ [
676
+ 'label' => __( 'Text Color', 'elementor' ),
677
+ 'type' => Controls_Manager::COLOR,
678
+ 'default' => '#fff',
679
+ 'selectors' => [
680
+ '{{WRAPPER}} .eae-fb-button' => 'color: {{VALUE}};',
681
+ ],
682
+ ]
683
+ );
684
+
685
+ $this->add_group_control(
686
+ Group_Control_Typography::get_type(),
687
+ [
688
+ 'name' => 'typography',
689
+ 'label' => __( 'Typography', 'elementor' ),
690
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
691
+ 'selector' => '{{WRAPPER}} .eae-fb-button',
692
+ ]
693
+ );
694
+
695
+ $this->add_control(
696
+ 'background_color',
697
+ [
698
+ 'label' => __( 'Background Color', 'elementor' ),
699
+ 'type' => Controls_Manager::COLOR,
700
+ 'scheme' => [
701
+ 'type' => Scheme_Color::get_type(),
702
+ 'value' => Scheme_Color::COLOR_4,
703
+ ],
704
+ 'default' => '#93C64F',
705
+ 'selectors' => [
706
+ '{{WRAPPER}} .eae-fb-button' => 'background-color: {{VALUE}};',
707
+ ],
708
+ ]
709
+ );
710
+
711
+ $this->add_group_control(
712
+ Group_Control_Border::get_type(),
713
+ [
714
+ 'name' => 'border',
715
+ 'label' => __( 'Border', 'elementor' ),
716
+ 'placeholder' => '1px',
717
+ 'default' => '1px',
718
+ 'selector' => '{{WRAPPER}} .eae-fb-button',
719
+ ]
720
+ );
721
+
722
+ $this->add_control(
723
+ 'border_radius',
724
+ [
725
+ 'label' => __( 'Border Radius', 'elementor' ),
726
+ 'type' => Controls_Manager::DIMENSIONS,
727
+ 'size_units' => [ 'px', '%' ],
728
+ 'selectors' => [
729
+ '{{WRAPPER}} .eae-fb-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
730
+ ],
731
+ ]
732
+ );
733
+
734
+ $this->add_control(
735
+ 'text_padding',
736
+ [
737
+ 'label' => __( 'Text Padding', 'elementor' ),
738
+ 'type' => Controls_Manager::DIMENSIONS,
739
+ 'size_units' => [ 'px', 'em', '%' ],
740
+ 'selectors' => [
741
+ '{{WRAPPER}} .eae-fb-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
742
+ ],
743
+ ]
744
+ );
745
+
746
+
747
+ $this->end_controls_section();
748
+
749
+
750
+
751
+
752
+
753
+ }
754
+
755
+ protected function render( ) {
756
+ $settings = $this->get_settings_for_display();
757
+
758
+ $this->add_render_attribute('front-icon-wrapper','class','icon-wrapper');
759
+ $this->add_render_attribute('front-icon-wrapper','class','eae-fb-icon-view-'.$settings['front_icon_view']);
760
+ $this->add_render_attribute('front-icon-wrapper','class','eae-fb-icon-shape-'.$settings['front_icon_shape']);
761
+ $this->add_render_attribute('front-icon-title','class','front-icon-title');
762
+ $this->add_render_attribute('front-icon','class',$settings['front_icon']);
763
+
764
+
765
+ $this->add_render_attribute('back-icon-wrapper','class','icon-wrapper');
766
+ $this->add_render_attribute('back-icon-wrapper','class','eae-fb-icon-view-'.$settings['back_icon_view']);
767
+ $this->add_render_attribute('back-icon-wrapper','class','eae-fb-icon-shape-'.$settings['back_icon_shape']);
768
+ $this->add_render_attribute('back-icon-title','class','back-icon-title');
769
+ $this->add_render_attribute('back-icon','class',$settings['back_icon']);
770
+
771
+ $this->add_render_attribute( 'button', 'class', 'eae-fb-button' );
772
+ if ( ! empty( $settings['link']['url'] ) ) {
773
+ $this->add_render_attribute( 'button', 'href', $settings['link']['url'] );
774
+
775
+ if ( ! empty( $settings['link']['is_external'] ) ) {
776
+ $this->add_render_attribute( 'button', 'target', '_blank' );
777
+ }
778
+ }
779
+
780
+ ?>
781
+ <div class="eae-flip-box-wrapper">
782
+ <div class="eae-flip-box-inner">
783
+
784
+ <div class="eae-flip-box-front">
785
+ <div class="flipbox-content">
786
+ <?php if(!empty($settings['front_icon'])){ ?>
787
+ <div <?php echo $this->get_render_attribute_string( 'front-icon-wrapper' ); ?>>
788
+ <i <?php echo $this->get_render_attribute_string( 'front-icon' ); ?>></i>
789
+ </div>
790
+ <?php } ?>
791
+
792
+ <?php if(!empty($settings['front_title'])){ ?>
793
+ <<?php echo $settings['front_title_html_tag']; ?> <?php echo $this->get_render_attribute_string( 'front-icon-title' ); ?> >
794
+ <?php echo $settings['front_title']; ?>
795
+ </<?php echo $settings['front_title_html_tag']; ?>>
796
+ <?php } ?>
797
+
798
+ <?php if(!empty($settings['front-text'])){ ?>
799
+ <p>
800
+ <?php echo $settings['front-text']; ?>
801
+ </p>
802
+ <?php } ?>
803
+ </div>
804
+ </div>
805
+
806
+ <div class="eae-flip-box-back">
807
+ <div class="flipbox-content">
808
+ <?php if(!empty($settings['back_icon'])){ ?>
809
+ <div <?php echo $this->get_render_attribute_string( 'back-icon-wrapper' ); ?>>
810
+ <i <?php echo $this->get_render_attribute_string( 'back-icon' ); ?>></i>
811
+ </div>
812
+ <?php } ?>
813
+
814
+ <?php if(!empty($settings['back_title'])){ ?>
815
+ <<?php echo $settings['back_title_html_tag']; ?> <?php echo $this->get_render_attribute_string( 'back-icon-title' ); ?> >
816
+ <?php echo $settings['back_title']; ?>
817
+ </<?php echo $settings['back_title_html_tag']; ?>>
818
+ <?php } ?>
819
+
820
+ <?php if(!empty($settings['back_text'])){ ?>
821
+ <p>
822
+ <?php echo $settings['back_text']; ?>
823
+ </p>
824
+ <?php } ?>
825
+
826
+ <?php if(!empty($settings['action_text'])){ ?>
827
+ <div class="eae-fb-button-wrapper">
828
+ <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>
829
+ <span class="elementor-button-text"><?php echo $settings['action_text']; ?></span>
830
+ </a>
831
+ </div>
832
+ <?php } ?>
833
+ </div>
834
+ </div>
835
+
836
+ </div>
837
+ </div>
838
+ <?php
839
+ }
840
+ }
841
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_FlipBox() );
elements/gmap.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace EAE;
3
+
4
+ use Elementor\Repeater;
5
+ use Elementor\Widget_Base;
6
+ use Elementor\Controls_Manager;
7
+ use Elementor\Plugin;
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
10
+
11
+ class Widget_TextSeparator extends Widget_Base {
12
+
13
+ public function get_name() {
14
+ return 'wts-gmap';
15
+ }
16
+
17
+ public function get_title() {
18
+ return __( 'EAE - Google Map', 'wts-eae' );
19
+ }
20
+
21
+ public function get_icon() {
22
+ return 'eicon-google-maps wts-eae-map';
23
+ }
24
+
25
+
26
+ public function get_categories() {
27
+ return [ 'wts-eae' ];
28
+ }
29
+
30
+ public function get_script_depends() {
31
+ return ['eae-gmap'];
32
+ }
33
+
34
+
35
+ protected function _register_controls() {
36
+
37
+ $this->start_controls_section(
38
+ 'general',
39
+ [
40
+ 'label' => __('General', 'wts-eae')
41
+ ]
42
+ );
43
+
44
+
45
+ $map_key = get_option('wts_eae_gmap_key');
46
+ if(!isset($map_key) || $map_key == ''){
47
+ $this->add_control(
48
+ 'notice',
49
+ [
50
+ 'type' => Controls_Manager::RAW_HTML,
51
+ 'raw' => '<div class="eae-notice">
52
+ <a target="_blank" href="'.admin_url('admin.php?page=eae').'">Click Here</a> to add google map api key.
53
+ </div>'
54
+ ]
55
+ );
56
+ }
57
+
58
+
59
+ $repeater = new Repeater();
60
+
61
+ $repeater->add_control(
62
+ 'lat',
63
+ [
64
+ 'label' => __('Latitude', 'wts-eae'),
65
+ 'type' => Controls_Manager::TEXT,
66
+ 'placeholder' => __('Enter latitude value here', 'wts-eae')
67
+ ]
68
+ );
69
+
70
+ $repeater->add_control(
71
+ 'long',
72
+ [
73
+ 'label' => __('Longitude', 'wts-eae'),
74
+ 'type' => Controls_Manager::TEXT,
75
+ 'placeholder' => __('Enter latitude value here', 'wts-eae')
76
+ ]
77
+ );
78
+
79
+ $repeater->add_control(
80
+ 'address',
81
+ [
82
+ 'label' => __('Address', 'wts-eae'),
83
+ 'type' => Controls_Manager::WYSIWYG,
84
+ 'placeholder' => __('Enter address', 'wts-eae')
85
+ ]
86
+ );
87
+
88
+ $repeater->add_control(
89
+ 'icon',
90
+ [
91
+ 'label' => __('Icon', 'wts-eae'),
92
+ 'type' => Controls_Manager::MEDIA
93
+ ]
94
+ );
95
+
96
+ $repeater->add_control(
97
+ 'icon_size',
98
+ [
99
+ 'label' => __('Icon Size', 'wts-eae'),
100
+ 'type' => Controls_Manager::SLIDER,
101
+ 'range' => [
102
+ 'px' => [
103
+ 'min' => 20,
104
+ 'max' => 200,
105
+ ],
106
+ ],
107
+ 'default' => [
108
+ 'size' => 50,
109
+ 'unit' => 'px',
110
+ ]
111
+ ]
112
+ );
113
+
114
+ $this->add_control('markers',
115
+ [
116
+ 'label' => __('Markers', 'wts-eae'),
117
+ 'type' => Controls_Manager::REPEATER,
118
+ 'fields' => array_values($repeater->get_controls()),
119
+ 'default' => [
120
+ [
121
+ 'lat' => '28.612912',
122
+ 'long' => '77.229510',
123
+ 'address' => __('Put Address Here', 'wts-eae')
124
+ ]
125
+ ]
126
+ ]
127
+ );
128
+
129
+ $this->add_responsive_control(
130
+ 'height',
131
+ [
132
+ 'label' => __('Height','wts-eae'),
133
+ 'type' => Controls_Manager::NUMBER,
134
+ 'default' => 200,
135
+ 'selectors' => [
136
+ '{{WRAPPER}} .eae-markers' => 'height:{{VALUE}}px'
137
+ ]
138
+ ]
139
+ );
140
+ $this->add_control(
141
+ 'zoom',
142
+ [
143
+ 'label' => __('Zoom','wts-eae'),
144
+ 'type' => Controls_Manager::SLIDER,
145
+ 'range' => [
146
+ 'px' => [
147
+ 'min' => 6,
148
+ 'max' => 20,
149
+ ]
150
+ ],
151
+ 'default' => [
152
+ 'unit' => 'px',
153
+ 'size' => 10,
154
+ ],
155
+ ]
156
+ );
157
+
158
+
159
+
160
+ $this->add_control(
161
+ 'snazzy_style',
162
+ [
163
+ 'label' => __( 'Snazzy Style', 'wts-eae' ),
164
+ 'type' => Controls_Manager::TEXTAREA,
165
+ 'description' => __('Add style from Snazzy Maps. Copy and Paste style array from here -> <a href="https://snazzymaps.com/explore" target="_blank">Snazzy Maps</a>')
166
+ ]
167
+ );
168
+
169
+ $this->end_controls_section();
170
+
171
+ }
172
+
173
+ protected function render( ) {
174
+ $settings = $this->get_settings();
175
+
176
+ $markers = $settings['markers'];
177
+
178
+ $this->add_render_attribute('wrapper', 'data-zoom', $settings['zoom']['size']);
179
+
180
+ $this->add_render_attribute('wrapper', 'data-style', $settings['snazzy_style']);
181
+
182
+ if(count($markers)){
183
+ ?>
184
+ <div class="eae-markers" <?php echo $this->get_render_attribute_string('wrapper'); ?>>
185
+ <?php
186
+ foreach($markers as $marker){
187
+ ?>
188
+ <div class="marker" data-lng="<?php echo $marker['long']; ?>" data-lat="<?php echo $marker['lat']; ?>" data-icon="<?php echo $marker['icon']['url']; ?>" data-icon-size="<?php echo $marker['icon_size']['size']; ?>">
189
+ <?php echo $marker['address']; ?>
190
+ </div>
191
+ <?php
192
+ }
193
+ ?>
194
+ </div>
195
+ <?php
196
+ }
197
+
198
+
199
+ }
200
+ }
201
+
202
+
203
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_TextSeparator() );
elements/image-compare.php ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_Compare_Image extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-ab-image';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - After/Before Image', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-divider wts-eae-pe';
18
+ }
19
+
20
+
21
+ public function get_categories() {
22
+ return [ 'wts-eae' ];
23
+ }
24
+
25
+ protected function _register_controls() {
26
+
27
+ $this->start_controls_section(
28
+ 'image',
29
+ [
30
+ 'label' => __( 'Image', 'elementor' )
31
+ ]
32
+ );
33
+
34
+ $this->add_control(
35
+ 'compare_style',
36
+ [
37
+ 'label' => __( 'Compare Style', 'elementor' ),
38
+ 'type' => Controls_Manager::SELECT,
39
+ 'options' => [
40
+ 'horizontal' => __( 'Horizontal', 'elementor' ),
41
+ 'vertical' => __( 'Vertical', 'elementor' ),
42
+ ],
43
+ 'default' => 'horizontal',
44
+ ]
45
+ );
46
+
47
+ $this->add_control(
48
+ 'slider_position',
49
+ [
50
+ 'label' => __( 'Slider Position', 'elementor' ),
51
+ 'type' => Controls_Manager::SLIDER,
52
+ 'default' => [
53
+ 'size' => 50,
54
+ ],
55
+
56
+ 'range' => [
57
+ '%' => [
58
+ 'min' => 0,
59
+ 'max' => 90,
60
+ ],
61
+ ],
62
+ ]
63
+ );
64
+
65
+ $this->add_control(
66
+ 'slider_icon',
67
+ [
68
+ 'label' => __( 'Icon', 'elementor' ),
69
+ 'type' => Controls_Manager::ICON,
70
+ 'default' => 'fa fa-star',
71
+ ]
72
+ );
73
+
74
+ /*$this->add_responsive_control(
75
+ 'img_height',
76
+ [
77
+ 'label' => __( 'Image Height', 'elementor' ),
78
+ 'type' => Controls_Manager::SLIDER,
79
+ 'default' => [
80
+ 'size' => 300,
81
+ ],
82
+ 'range' => [
83
+ 'px' => [
84
+ 'min' => 200,
85
+ 'max' => 800,
86
+ ],
87
+ ],
88
+ 'selectors' => [
89
+ '{{WRAPPER}} .eae-img-comp-container11' => 'height: {{SIZE}}px;',
90
+ ],
91
+ ]
92
+ );*/
93
+
94
+ $this->add_control('before_image',
95
+ [
96
+ 'label' => __( 'Before Image', 'elementor' ),
97
+ 'type' => Controls_Manager::MEDIA,
98
+ 'default' => [
99
+ 'url' => Utils::get_placeholder_image_src(),
100
+ ],
101
+ 'show_label' => true,
102
+ ]
103
+ );
104
+
105
+ $this->add_group_control(
106
+ Group_Control_Image_Size::get_type(),
107
+ [
108
+ 'name' => 'before_image_size', // Actually its `image_size`
109
+ 'default' => 'medium_large',
110
+ ]
111
+ );
112
+
113
+ $this->add_control(
114
+ 'image_head',
115
+ [
116
+ 'label' => __('', 'elementor'),
117
+ 'type' => Controls_Manager::HEADING,
118
+ 'separator' => 'before',
119
+ ]
120
+ );
121
+
122
+ $this->add_control('after_image',
123
+ [
124
+ 'label' => __( 'After Image', 'elementor' ),
125
+ 'type' => Controls_Manager::MEDIA,
126
+ 'default' => [
127
+ 'url' => Utils::get_placeholder_image_src(),
128
+ ],
129
+ 'selectors'=> [
130
+ //'{{WRAPPER}} .eae-img-comp-overlay' => 'background-image:url({{URL}})'
131
+ ],
132
+ 'show_label' => true,
133
+ ]
134
+ );
135
+
136
+ $this->add_group_control(
137
+ Group_Control_Image_Size::get_type(),
138
+ [
139
+ 'name' => 'after_image_size', // Actually its `image_size`
140
+ 'default' => 'medium_large',
141
+ ]
142
+ );
143
+
144
+ $this->add_control(
145
+ 'separator_text',
146
+ [
147
+ 'label' => __('', 'elementor'),
148
+ 'type' => Controls_Manager::HEADING,
149
+ 'separator' => 'before',
150
+ ]
151
+ );
152
+ $this->add_control(
153
+ 'text_before',
154
+ [
155
+ 'label' => __( 'Before Text', 'elementor' ),
156
+ 'type' => Controls_Manager::TEXT,
157
+ 'placeholder' => __( 'Enter text', 'elementor' ),
158
+ 'default' => __( 'BEFORE', 'elementor' ),
159
+ ]
160
+ );
161
+
162
+ $this->add_control(
163
+ 'text_after',
164
+ [
165
+ 'label' => __( 'After Text', 'elementor' ),
166
+ 'type' => Controls_Manager::TEXT,
167
+ 'placeholder' => __( 'Enter text', 'elementor' ),
168
+ 'default' => __( 'AFTER', 'elementor' ),
169
+ ]
170
+ );
171
+
172
+
173
+ $this->end_controls_section();
174
+
175
+ $this->start_controls_section(
176
+ 'image_style',
177
+ [
178
+ 'label' => __( 'General', 'elementor' ),
179
+ 'tab' => Controls_Manager::TAB_STYLE
180
+ ]
181
+ );
182
+
183
+ $this->add_control(
184
+ 'slider_icon_color',
185
+ [
186
+ 'label' => __('Icon Color', 'elementor'),
187
+ 'type' => Controls_Manager::COLOR,
188
+ 'type' => Scheme_Color::get_type(),
189
+ 'selectors' => [
190
+ '{{WRAPPER}} .eae-slider-icon' => 'color: {{VALUE}}'
191
+ ]
192
+ ]
193
+ );
194
+
195
+ $this->add_control(
196
+ 'slider_bg_color',
197
+ [
198
+ 'label' => __('Slider Color', 'elementor'),
199
+ 'type' => Controls_Manager::COLOR,
200
+ 'type' => Scheme_Color::get_type(),
201
+ 'selectors' => [
202
+ '{{WRAPPER}} .eae-img-comp-slider' => 'background-color: {{VALUE}} !important'
203
+ ]
204
+ ]
205
+ );
206
+
207
+
208
+ $this->add_control(
209
+ 'separator_alignment',
210
+ [
211
+ 'label' => __( 'Separator Alignment', 'elementor' ),
212
+ 'type' => Controls_Manager::SLIDER,
213
+ 'default' => [
214
+ 'size' => 50,
215
+ ],
216
+
217
+ 'range' => [
218
+ '%' => [
219
+ 'min' => 0,
220
+ 'max' => 90,
221
+ ],
222
+ ],
223
+ 'selectors' => [
224
+ '{{WRAPPER}} .mode-horizontal .eae-img-comp-slider' => 'top: {{SIZE}}% !important;',
225
+ '{{WRAPPER}} .mode-vertical .eae-img-comp-slider' => 'left: {{SIZE}}% !important;',
226
+ ],
227
+ ]
228
+ );
229
+
230
+ $this->add_control(
231
+ 'slider_separator_width',
232
+ [
233
+ 'label' => __( 'Separator Width', 'elementor' ),
234
+ 'type' => Controls_Manager::NUMBER,
235
+ 'default' => 1,
236
+ 'min' => 0,
237
+ 'max' => 10,
238
+ 'step' => 1,
239
+ 'selectors' => [
240
+ '{{WRAPPER}} .mode-horizontal .eae-img-comp-overlay' => ' border-right-style:solid; border-right-width: {{SIZE}}px;',
241
+ '{{WRAPPER}} .mode-vertical .eae-img-comp-overlay' => ' border-bottom-style:solid; border-bottom-width: {{SIZE}}px;',
242
+ ],
243
+ ]
244
+ );
245
+
246
+ $this->end_controls_section();
247
+
248
+ $this->start_controls_section(
249
+ 'label_style',
250
+ [
251
+ 'label' => __('Label', 'elementor'),
252
+ 'tab' => Controls_Manager::TAB_STYLE
253
+ ]
254
+ );
255
+
256
+ $this->add_control(
257
+ 'label_position_horizontal',
258
+ [
259
+ 'label' => __( 'Position', 'elementor' ),
260
+ 'type' => Controls_Manager::SELECT,
261
+ 'options' => [
262
+ 'top' => __( 'Top', 'elementor' ),
263
+ 'bottom' => __( 'Bottom', 'elementor' ),
264
+ ],
265
+ 'condition' => [
266
+ 'compare_style' => 'horizontal',
267
+ ],
268
+ 'default' => 'top',
269
+ 'prefix_class' => 'eae-label-pos-',
270
+ 'selectors' => [
271
+ '{{WRAPPER}}.eae-label-pos-top .eae-text-after' => 'top: 0px;left:0px',
272
+ '{{WRAPPER}}.eae-label-pos-top .eae-text-before' => 'top: 0px;right:0px',
273
+ '{{WRAPPER}}.eae-label-pos-bottom .eae-text-after' => 'bottom: 10px;left:0px',
274
+ '{{WRAPPER}}.eae-label-pos-bottom .eae-text-before' => 'bottom: 10px;right:0px',
275
+ ],
276
+ ]
277
+ );
278
+
279
+ $this->add_control(
280
+ 'label_position_vertical',
281
+ [
282
+ 'label' => __( 'Position', 'elementor' ),
283
+ 'type' => Controls_Manager::SELECT,
284
+ 'options' => [
285
+ 'left' => __( 'Left', 'elementor' ),
286
+ 'right' => __( 'Right', 'elementor' ),
287
+ ],
288
+ 'condition' => [
289
+ 'compare_style' => 'vertical',
290
+ ],
291
+ 'default' => 'left',
292
+ 'prefix_class' => 'eae-label-pos-',
293
+ 'selectors' => [
294
+ '{{WRAPPER}}.eae-label-pos-left .eae-text-after' => 'top: 0px;left:0px;',
295
+ '{{WRAPPER}}.eae-label-pos-left .eae-text-before' => 'bottom: 0px;right:0px;',
296
+ '{{WRAPPER}}.eae-label-pos-right .eae-text-after' => 'top: 0px;right:0px;',
297
+ '{{WRAPPER}}.eae-label-pos-right .eae-text-before' => 'bottom: 0px; left:0px;',
298
+ ],
299
+ ]
300
+ );
301
+
302
+ $this->add_group_control(
303
+ Group_Control_Typography::get_type(),
304
+ [
305
+ 'name' => 'label_text_typography',
306
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
307
+ 'selector' => '{{WRAPPER}} .eae-text-after, {{WRAPPER}} .eae-text-before',
308
+ ]
309
+ );
310
+
311
+ $this->add_control(
312
+ 'label_color',
313
+ [
314
+ 'label' => __('Color', 'elementor'),
315
+ 'type' => Controls_Manager::COLOR,
316
+ 'scheme' => [
317
+ 'type' => Scheme_Color::get_type(),
318
+ 'value' => Scheme_Color::COLOR_1
319
+ ],
320
+ 'selectors' => [
321
+ '{{WRAPPER}} .eae-text-after' => 'color: {{VALUE}}',
322
+ '{{WRAPPER}} .eae-text-before' => 'color: {{VALUE}}',
323
+ ]
324
+ ]
325
+ );
326
+ $this->add_control(
327
+ 'label_background_color',
328
+ [
329
+ 'label' => __('BackgroundColor', 'elementor'),
330
+ 'type' => Controls_Manager::COLOR,
331
+ 'type' => Scheme_Color::get_type(),
332
+ 'selectors' => [
333
+ '{{WRAPPER}} .eae-text-after' => 'background-color: {{VALUE}}',
334
+ '{{WRAPPER}} .eae-text-before' => 'background-color: {{VALUE}}'
335
+ ]
336
+ ]
337
+ );
338
+
339
+ $this->add_group_control(
340
+ Group_Control_Border::get_type(),
341
+ [
342
+ 'name' => 'label_border',
343
+ 'label' => __( 'Box Border', 'elementor' ),
344
+ 'selector' =>
345
+ '{{WRAPPER}} .eae-text-after, {{WRAPPER}} .eae-text-before',
346
+ ]
347
+ );
348
+
349
+
350
+
351
+ $this->add_control(
352
+ 'label_border_radius',
353
+ [
354
+ 'label' => __( 'Border Radius', 'elementor' ),
355
+ 'type' => Controls_Manager::DIMENSIONS,
356
+ 'size_units' => [ 'px','%' ],
357
+ 'selectors' => [
358
+ '{{WRAPPER}} .eae-text-after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
359
+ '{{WRAPPER}} .eae-text-before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
360
+ ],
361
+ ]
362
+ );
363
+
364
+ $this->add_control(
365
+ 'label_padding',
366
+ [
367
+ 'label' => __( 'Padding', 'elementor' ),
368
+ 'type' => Controls_Manager::DIMENSIONS,
369
+ 'size_units' => [ 'px'],
370
+ 'selectors' => [
371
+ '{{WRAPPER}} .eae-text-after' => 'padding: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
372
+ '{{WRAPPER}} .eae-text-before' => 'padding: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
373
+ ],
374
+ ]
375
+ );
376
+ $this->add_control(
377
+ 'label_margin',
378
+ [
379
+ 'label' => __( 'Margin', 'elementor' ),
380
+ 'type' => Controls_Manager::DIMENSIONS,
381
+ 'selectors' => [
382
+ '{{WRAPPER}} .eae-text-after' => 'margin: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
383
+ '{{WRAPPER}} .eae-text-before' => 'margin: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
384
+ ],
385
+ ]
386
+ );
387
+
388
+ $this->end_controls_section();
389
+
390
+ }
391
+
392
+
393
+ protected function render() {
394
+ $settings = $this->get_settings();
395
+ //print_r($settings);
396
+ $this->add_render_attribute('wrapper', 'class', 'eae-img-comp-container');
397
+ $this->add_render_attribute('wrapper', 'class', 'mode-'.$settings['compare_style']);
398
+ $this->add_render_attribute('wrapper', 'data-ab-style', $settings['compare_style']);
399
+ $this->add_render_attribute('wrapper', 'data-slider-pos', $settings['slider_position']['size']);
400
+
401
+ $this->add_render_attribute('icon', 'class', 'icon-'.$settings['compare_style']);
402
+ $this->add_render_attribute('icon', 'class', 'eae-img-comp-slider');
403
+ ?>
404
+ <figure <?php echo $this->get_render_attribute_string('wrapper'); ?> >
405
+ <?php echo wp_get_attachment_image($settings['before_image']['id'], $settings['before_image_size_size']); ?>
406
+
407
+ <?php if($settings['text_before'] !== "") { ?>
408
+ <span class="eae-text-before"><?php echo $settings['text_before']; ?></span>
409
+ <?php } ?>
410
+
411
+ <div <?php echo $this->get_render_attribute_string('icon'); ?> >
412
+ <i class="<?php echo $settings['slider_icon']; ?> eae-slider-icon" ></i>
413
+ </div>
414
+
415
+ <div class="eae-img-comp-img eae-img-comp-overlay">
416
+ <?php echo wp_get_attachment_image($settings['after_image']['id'], $settings['after_image_size_size']); ?>
417
+
418
+ <?php if($settings['text_after'] !== "") { ?>
419
+ <span class="eae-text-after"><?php echo $settings['text_after']; ?></span>
420
+ <?php } ?>
421
+ </div>
422
+
423
+ </figure>
424
+ <?php
425
+ }
426
+
427
+ protected function _content_template() {
428
+ ?>
429
+ <#
430
+ view.addRenderAttribute('wrapper','class','eae-img-comp-container');
431
+ view.addRenderAttribute('wrapper','class','mode-'+settings.compare_style);
432
+ view.addRenderAttribute('wrapper','data-ab-style',settings.compare_style);
433
+ view.addRenderAttribute('wrapper','data-slider-pos', settings.slider_position.size);
434
+
435
+ view.addRenderAttribute('icon','class',settings.slider_icon);
436
+ view.addRenderAttribute('icon','class','eae-slider-icon');
437
+ #>
438
+
439
+ <div {{{ view.getRenderAttributeString( 'wrapper') }}} >
440
+ <img src="{{{ settings.before_image.url }}}" />
441
+ <# if(settings.text_before) {#>
442
+ <span class="eae-text-before">{{{settings.text_before}}}</span>
443
+ <# } #>
444
+ <div class="eae-img-comp-slider"">
445
+ <i {{{ view.getRenderAttributeString( 'icon') }}} ></i>
446
+ </div>
447
+
448
+ <div class="eae-img-comp-img eae-img-comp-overlay">
449
+ <img src="{{{ settings.after_image.url }}}" >
450
+ <# if(settings.text_after) { #>
451
+ <span class="eae-text-after">{{{settings.text_after}}}</span>
452
+ <# } #>
453
+ </div>
454
+
455
+ </div>
456
+ <?php
457
+ }
458
+ }
459
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_Compare_Image() );
elements/particles.php ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace EAE;
4
+
5
+ use Elementor\Controls_Manager;
6
+
7
+ class Particles{
8
+
9
+ private static $_instance = null;
10
+
11
+ public function __construct()
12
+ {
13
+ add_action( 'elementor/element/after_section_end', [ $this, 'register_controls' ], 10, 3 );
14
+
15
+ // Add print template for editor preview
16
+ add_action( 'elementor/section/print_template', [ $this, '_print_template'],10,2);
17
+ //add_action( 'elementor/column/print_template', [ $this, '_print_template'],10,2);
18
+
19
+ //add_action( 'elementor/frontend/column/before_render', [ $this, '_before_render'],10,1);
20
+ add_action( 'elementor/frontend/section/before_render', [ $this, '_before_render'],10,1);
21
+
22
+ }
23
+
24
+ public function register_controls($element, $section_id, $args){
25
+
26
+ if ( ('section' === $element->get_name() && 'section_background' === $section_id) || ('column' === $element->get_name() && 'section_style' === $section_id)) {
27
+
28
+ $element->start_controls_section(
29
+ 'eae_particles',
30
+ [
31
+ 'tab' => Controls_Manager::TAB_STYLE,
32
+ 'label' => __( 'Particles', 'eae' )
33
+ ]
34
+ );
35
+
36
+ $element->add_control(
37
+ 'eae_enable_particles',
38
+ [
39
+ 'type' => Controls_Manager::SWITCHER,
40
+ 'label' => __('Enable Particle Background', 'eae'),
41
+ 'default' => '',
42
+ 'label_on' => __( 'Yes', 'ae-pro' ),
43
+ 'label_off' => __( 'No', 'ae-pro' ),
44
+ 'return_value' => 'yes',
45
+ 'prefix_class' => 'eae-particle-',
46
+ 'render_type' => 'template',
47
+ ]
48
+ );
49
+
50
+ $element->add_control(
51
+ 'eae_enable_particles_alert',
52
+ [
53
+ 'type' => Controls_Manager::RAW_HTML,
54
+ 'content_classes' => 'eae_enable_particles_alert elementor-control-field-description',
55
+ 'raw' => __( '<a href="https://vincentgarreau.com/particles.js/" target="_blank">Click here</a> to generate JSON for the below field. </br><a href="https://goo.gl/pHziXj" target="_blank">Know more</a> about using this feature.', 'ae-pro' ),
56
+ 'separator' => 'none',
57
+ 'condition' => [
58
+ 'eae_enable_particles' => 'yes',
59
+ ],
60
+ ]
61
+ );
62
+
63
+ $element->add_control(
64
+ 'eae_particle_json',
65
+ [
66
+ 'type' => Controls_Manager::CODE,
67
+ 'label' => __('Add Particle Json'),
68
+ 'default' => '{
69
+ "particles": {
70
+ "number": {
71
+ "value": 80,
72
+ "density": {
73
+ "enable": true,
74
+ "value_area": 800
75
+ }
76
+ },
77
+ "color": {
78
+ "value": "#ffffff"
79
+ },
80
+ "shape": {
81
+ "type": "circle",
82
+ "stroke": {
83
+ "width": 0,
84
+ "color": "#000000"
85
+ },
86
+ "polygon": {
87
+ "nb_sides": 5
88
+ },
89
+ "image": {
90
+ "src": "img/github.svg",
91
+ "width": 100,
92
+ "height": 100
93
+ }
94
+ },
95
+ "opacity": {
96
+ "value": 0.5,
97
+ "random": false,
98
+ "anim": {
99
+ "enable": false,
100
+ "speed": 1,
101
+ "opacity_min": 0.1,
102
+ "sync": false
103
+ }
104
+ },
105
+ "size": {
106
+ "value": 3,
107
+ "random": true,
108
+ "anim": {
109
+ "enable": false,
110
+ "speed": 40,
111
+ "size_min": 0.1,
112
+ "sync": false
113
+ }
114
+ },
115
+ "line_linked": {
116
+ "enable": true,
117
+ "distance": 150,
118
+ "color": "#ffffff",
119
+ "opacity": 0.4,
120
+ "width": 1
121
+ },
122
+ "move": {
123
+ "enable": true,
124
+ "speed": 6,
125
+ "direction": "none",
126
+ "random": false,
127
+ "straight": false,
128
+ "out_mode": "out",
129
+ "bounce": false,
130
+ "attract": {
131
+ "enable": false,
132
+ "rotateX": 600,
133
+ "rotateY": 1200
134
+ }
135
+ }
136
+ },
137
+ "interactivity": {
138
+ "detect_on": "canvas",
139
+ "events": {
140
+ "onhover": {
141
+ "enable": true,
142
+ "mode": "repulse"
143
+ },
144
+ "onclick": {
145
+ "enable": true,
146
+ "mode": "push"
147
+ },
148
+ "resize": true
149
+ },
150
+ "modes": {
151
+ "grab": {
152
+ "distance": 400,
153
+ "line_linked": {
154
+ "opacity": 1
155
+ }
156
+ },
157
+ "bubble": {
158
+ "distance": 400,
159
+ "size": 40,
160
+ "duration": 2,
161
+ "opacity": 8,
162
+ "speed": 3
163
+ },
164
+ "repulse": {
165
+ "distance": 200,
166
+ "duration": 0.4
167
+ },
168
+ "push": {
169
+ "particles_nb": 4
170
+ },
171
+ "remove": {
172
+ "particles_nb": 2
173
+ }
174
+ }
175
+ },
176
+ "retina_detect": true
177
+ }',
178
+ 'render_type' => 'template',
179
+ 'condition' => [
180
+ 'eae_enable_particles' => 'yes'
181
+ ]
182
+ ]
183
+ );
184
+
185
+ $element->end_controls_section();
186
+
187
+ }
188
+ }
189
+
190
+ public function _before_render($element){
191
+
192
+ if($element->get_name() != 'section' && $element->get_name() != 'column'){
193
+ return;
194
+ }
195
+
196
+ $settings = $element->get_settings();
197
+ if($settings['eae_enable_particles'] == 'yes'){
198
+ $element->add_render_attribute('_wrapper', 'data-eae-particle', $settings['eae_particle_json']);
199
+ }
200
+
201
+ }
202
+
203
+ function _print_template($template,$widget){
204
+ if($widget->get_name() != 'section' && $widget->get_name() != 'column'){
205
+ return $template;
206
+ }
207
+
208
+ $old_template = $template;
209
+ ob_start();
210
+ ?>
211
+
212
+ <div class="eae-particle-wrapper" id="eae-particle-{{ view.getID() }}" data-eae-pdata=" {{ settings.eae_particle_json }}"></div>
213
+ <?php
214
+ $slider_content = ob_get_contents();
215
+ ob_end_clean();
216
+ $template = $slider_content.$old_template;
217
+ return $template;
218
+ }
219
+
220
+ public static function instance() {
221
+ if ( is_null( self::$_instance ) ) {
222
+ self::$_instance = new self();
223
+ }
224
+ return self::$_instance;
225
+ }
226
+ }
227
+
228
+ Particles::instance();
elements/pinterest.php ADDED
@@ -0,0 +1,550 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace EAE;
4
+
5
+ use Elementor\Controls_Manager;
6
+ use Elementor\Widget_Base;
7
+ use Elementor\Plugin;
8
+
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } //Exit if accessed directly
13
+
14
+ class EAE_Pinterest extends Widget_Base {
15
+
16
+
17
+ public function get_name() {
18
+ return 'wts-pinterest';
19
+ }
20
+
21
+ public function get_title() {
22
+ return __( 'EAE - Pinterest', 'wts-eae' );
23
+ }
24
+
25
+ public function get_icon() {
26
+ return 'fa fa-pinterest';
27
+ }
28
+
29
+ public function get_categories() {
30
+ return [ ' wts-eae' ];
31
+ }
32
+
33
+ protected function _register_controls() {
34
+ $this->start_controls_section(
35
+ 'section_general',
36
+ [
37
+ 'label' => __( 'General', 'wts-eae' )
38
+ ]
39
+ );
40
+
41
+ $this->add_control(
42
+ 'embed_type',
43
+ [
44
+ 'label' => __( 'Embed Type', 'wts-eae' ),
45
+ 'type' => Controls_Manager::SELECT,
46
+ 'default' => 'follow_button',
47
+ 'options' => [
48
+ 'save_button' => __( 'Save Button', 'wts-eae' ),
49
+ 'follow_button' => __( 'Follow', 'wts-eae' ),
50
+ 'pin' => __( 'Pin', 'wts-eae' ),
51
+ 'board' => __( 'Board', 'wts-eae' ),
52
+ 'profile' => __( 'Profile', 'wts-eae' )
53
+ ]
54
+ ]
55
+ );
56
+
57
+ $this->add_control(
58
+ 'button_type',
59
+ [
60
+ 'label' => __( 'Button Type', 'wts-eae' ),
61
+ 'type' => Controls_Manager::SELECT,
62
+ 'default' => 'one_image',
63
+ 'options' => [
64
+ 'one_image' => __( 'One Image', 'wts-eae' ),
65
+ 'any_image' => __( 'Any Image', 'wts-eae' ),
66
+ //'hover' => __('Hover' , 'wts-eae')
67
+ ],
68
+ 'condition' => [
69
+ 'embed_type' => 'save_button',
70
+ ]
71
+ ]
72
+
73
+ );
74
+
75
+ $this->add_control(
76
+ 'custom_pinterest_icon',
77
+ [
78
+ 'label' => __( 'Custom Pinterest Icon', 'wts-eae' ),
79
+ 'type' => Controls_Manager::MEDIA,
80
+ 'condition' => [
81
+ 'embed_type' => 'save_button'
82
+ ]
83
+
84
+ ]
85
+ );
86
+
87
+ $this->add_control(
88
+ 'user_url',
89
+ [
90
+ 'label' => __( "User URL", 'wts-eae' ),
91
+ 'type' => Controls_Manager::TEXT,
92
+ 'default' => 'https://www.pinterest.com/pinterest',
93
+ 'condition' => [
94
+ 'embed_type' => 'follow_button'
95
+ ]
96
+
97
+ ]
98
+
99
+ );
100
+
101
+ $this->add_control(
102
+ 'user_name',
103
+ [
104
+ 'label' => __( 'User Name', 'wts-name' ),
105
+ 'type' => Controls_Manager::TEXT,
106
+ 'placeholder' => 'Pinterest',
107
+ 'default' => 'Pinterest',
108
+ 'condition' => [
109
+ 'embed_type' => 'follow_button'
110
+ ]
111
+ ]
112
+ );
113
+
114
+ $this->add_control(
115
+ 'round_button',
116
+ [
117
+ 'label' => __( 'Round Button', 'wts-eae' ),
118
+ 'type' => Controls_Manager::SWITCHER,
119
+ 'default' => '',
120
+ 'label_on' => __( 'Yes', 'wts-eae' ),
121
+ 'label_off' => __( 'No', 'wts-eae' ),
122
+ 'return_value' => 'yes',
123
+ 'condition' => [
124
+ 'embed_type' => 'save_button',
125
+ ]
126
+ ]
127
+ );
128
+
129
+ $this->add_control(
130
+ 'large_button',
131
+ [
132
+ 'label' => __( 'Large Button', 'wts-eae' ),
133
+ 'type' => Controls_Manager::SWITCHER,
134
+ 'default' => '',
135
+ 'label_on' => __( 'Yes', 'wts-eae' ),
136
+ 'label_off' => __( 'No', 'wts-eae' ),
137
+ 'return_value' => 'yes',
138
+ 'condition' => [
139
+ 'embed_type' => [ 'save_button', 'follow_button' ]
140
+ ]
141
+ ]
142
+ );
143
+
144
+ $this->add_control(
145
+ 'save_label',
146
+ [
147
+ 'label' => __( 'Show Save Label', 'wts-eae' ),
148
+ 'type' => Controls_Manager::SWITCHER,
149
+ 'label_on' => __( 'Yes', 'wts-eae' ),
150
+ 'label_off' => __( 'No', 'wts-eae' ),
151
+ 'return_value' => 'yes',
152
+ 'condition' => [
153
+ 'embed_type' => 'save_button',
154
+ 'round_button!' => 'yes'
155
+ ]
156
+
157
+ ]
158
+ );
159
+
160
+ $this->add_control(
161
+ 'show_pin_count',
162
+ [
163
+ 'label' => __( 'Show Pin Count', 'wts-eae' ),
164
+ 'type' => Controls_Manager::SELECT,
165
+ 'options' => [
166
+ '' => __( 'Not Shown', 'wts-eae' ),
167
+ 'above' => __( 'Above the Button', 'wts-eae' ),
168
+ 'beside' => __( 'Beside the Button', 'wts-eae' )
169
+ ],
170
+ 'condition' => [
171
+ 'embed_type' => 'save_button',
172
+ 'button_type' => 'one_image',
173
+ 'round_button!' => 'yes'
174
+ ]
175
+ ]
176
+ );
177
+
178
+
179
+ $this->add_control(
180
+ 'source_url',
181
+ [
182
+ 'label' => __( 'URL', 'wts-eae' ),
183
+ 'type' => Controls_Manager::TEXT,
184
+ 'default' => 'https://www.flickr.com/photos/kentbrew/6851755809',
185
+ 'condition' => [
186
+ 'embed_type' => 'save_button',
187
+ 'button_type' => 'one_image'
188
+ ]
189
+ ]
190
+
191
+ );
192
+ $this->add_control(
193
+ 'image_url',
194
+ [
195
+ 'label' => __( 'Image URL', 'wts-eae' ),
196
+ 'type' => Controls_Manager::TEXT,
197
+ 'default' => 'https://farm8.staticflickr.com/7027/6851755809_df5b2051c9_z.jpg',
198
+ 'condition' => [
199
+ 'embed_type' => 'save_button',
200
+ 'button_type' => 'one_image'
201
+ ]
202
+ ]
203
+
204
+ );
205
+
206
+ $this->add_control(
207
+ 'description',
208
+ [
209
+ 'label' => __( 'Description', 'wts-eae' ),
210
+ 'type' => Controls_Manager::TEXTAREA,
211
+ 'condition' => [
212
+ 'embed_type' => 'save_button',
213
+ 'button_type' => 'one_image'
214
+ ]
215
+ ]
216
+
217
+ );
218
+
219
+
220
+ $this->add_control(
221
+ 'pin_url',
222
+ [
223
+ 'label' => __( 'Pin Url', 'wts-eae' ),
224
+ 'type' => Controls_Manager::TEXT,
225
+ 'default' => 'https://www.pinterest.com/pin/99360735500167749',
226
+ 'condition' => [
227
+ 'embed_type' => 'pin'
228
+ ]
229
+
230
+ ]
231
+ );
232
+
233
+ $this->add_control(
234
+ 'board_url',
235
+ [
236
+ 'label' => __( 'Pinterest Board URL', 'wts-eae' ),
237
+ 'type' => Controls_Manager::TEXT,
238
+ 'default' => 'https://www.pinterest.com/pinterest/official-news',
239
+ 'condition' => [
240
+ 'embed_type' => 'board'
241
+ ]
242
+ ]
243
+ );
244
+
245
+ $this->add_control(
246
+ 'profile_url',
247
+ [
248
+ 'label' => __( 'Pinterest User URL', 'wts-eae' ),
249
+ 'type' => Controls_Manager::TEXT,
250
+ 'default' => 'https://www.pinterest.com/pinterest/',
251
+ 'condition' => [
252
+ 'embed_type' => 'profile'
253
+ ]
254
+ ]
255
+ );
256
+
257
+ $this->add_control(
258
+ 'image_width',
259
+ [
260
+ 'label' => __( 'Image Width', 'wts-eae' ),
261
+ 'type' => Controls_Manager::SLIDER,
262
+ 'default' => [
263
+ 'size' => 80
264
+ ],
265
+ 'range' => [
266
+ 'px' => [
267
+ 'min' => 50,
268
+ 'max' => 500,
269
+ 'step' => 5
270
+ ]
271
+ ],
272
+ 'condition' => [
273
+ 'embed_type' => [ 'board', 'profile' ]
274
+ ]
275
+ ]
276
+ );
277
+
278
+
279
+ $this->add_control(
280
+ 'board_width',
281
+ [
282
+ 'label' => __( 'Board Width', 'wts-eae' ),
283
+ 'type' => Controls_Manager::SLIDER,
284
+ 'default' => [
285
+ 'size' => 400
286
+ ],
287
+ 'range' => [
288
+ 'px' => [
289
+ 'min' => 60,
290
+ 'max' => 1300,
291
+ 'step' => 10
292
+ ]
293
+ ],
294
+ 'condition' => [
295
+ 'embed_type' => [ 'board', 'profile' ]
296
+ ]
297
+ ]
298
+ );
299
+
300
+ $this->add_control(
301
+ 'image_height',
302
+ [
303
+ 'label' => __( 'Image Height', 'wts-eae' ),
304
+ 'type' => Controls_Manager::SLIDER,
305
+ 'default' => [
306
+ 'size' => 240
307
+ ],
308
+ 'range' => [
309
+ 'px' => [
310
+ 'min' => 60,
311
+ 'max' => 1300,
312
+ 'step' => 10
313
+ ]
314
+ ],
315
+ 'condition' => [
316
+ 'embed_type' => [ 'board', 'profile' ]
317
+ ]
318
+ ]
319
+ );
320
+
321
+
322
+ $this->add_control(
323
+ 'pin_size',
324
+ [
325
+ 'label' => __( 'Pin Size', 'wts-eae' ),
326
+ 'type' => Controls_Manager::SELECT,
327
+ 'default' => 'small',
328
+ 'options' => [
329
+ 'small' => __( 'Small', 'wts-eae' ),
330
+ 'medium' => __( 'Medium', 'wts-eae' ),
331
+ 'large' => __( 'Large', 'wts-eae' ),
332
+ ],
333
+ 'condition' => [
334
+ 'embed_type' => 'pin',
335
+ ]
336
+ ]
337
+ );
338
+
339
+
340
+ $this->add_control(
341
+ 'hide_description',
342
+ [
343
+ 'label' => __( 'Hide Description', 'wts-eae' ),
344
+ 'type' => Controls_Manager::SWITCHER,
345
+ 'default' => '',
346
+ 'label_on' => __( 'Yes', 'wts-eae' ),
347
+ 'label_off' => __( 'No', 'wts-eae' ),
348
+ 'return_value' => 'yes',
349
+ 'condition' => [
350
+ 'embed_type' => 'pin'
351
+ ]
352
+ ]
353
+ );
354
+
355
+
356
+ $this->add_control(
357
+ 'language',
358
+ [
359
+ 'label' => __( 'Language', 'wts-eae' ),
360
+ 'type' => Controls_Manager::SELECT,
361
+ 'options' => $this->languages(),
362
+ 'default' => '',
363
+ 'condition' => [
364
+ 'round_button!' => 'yes',
365
+ 'embed_type' => 'save_button'
366
+ ]
367
+ ]
368
+ );
369
+ }
370
+
371
+ public function languages() {
372
+ $languages = [
373
+ '' => __( 'Automatic', 'wts-eae' ),
374
+ 'en' => __( 'English', 'wts-eae' ),
375
+ 'ar' => __( 'Arabic', 'wta-eae' ),
376
+ 'bn' => __( 'Bengali', 'wts-eae' ),
377
+ 'cs' => __( 'Czech', 'wts-eae' ),
378
+ 'da' => __( 'Danish', 'wts-eae' ),
379
+ 'de' => __( 'German', 'wts-eae' ),
380
+ 'el' => __( 'Greek', 'wts-eae' ),
381
+ 'es' => __( 'Spanish', 'wts-eae' ),
382
+ 'fa' => __( 'Persian', 'wts-eae' ),
383
+ 'fi' => __( 'Finnish', 'wts-eae' ),
384
+ 'fil' => __( 'Filipino', 'wts-eae' ),
385
+ 'fr' => __( 'French', 'wts-eae' ),
386
+ 'he' => __( 'Hebrew', 'wts-eae' ),
387
+ 'hi' => __( 'Hindi', 'wts-eae' ),
388
+ 'hu' => __( 'Hungarian', 'wts-eae' ),
389
+ 'id' => __( 'Indonesian', 'wts-eae' ),
390
+ 'it' => __( 'Italian', 'wts-eae' ),
391
+ 'ja' => __( 'Japanese', 'wts-eae' ),
392
+ 'ko' => __( 'Korean', 'wts-eae' ),
393
+ 'msa' => __( 'Malay', 'wts-eae' ),
394
+ 'nl' => __( 'Dutch', 'wts-eae' ),
395
+ 'no' => __( 'Norwegian', 'wts-eae' ),
396
+ 'pl' => __( 'Polish', 'wts-eae' ),
397
+ 'pt' => __( 'Portuguese', 'wts-eae' ),
398
+ 'pt-br' => __( 'Portuguese (Brazil)', 'wts-eae' ),
399
+ 'ro' => __( 'Romania', 'wts-eae' ),
400
+ 'ru' => __( 'Rus', 'wts-eae' ),
401
+ 'sv' => __( 'Swedish', 'wts-eae' ),
402
+ 'th' => __( 'Thai', 'wts-eae' ),
403
+ 'tr' => __( 'Turkish', 'wts-eae' ),
404
+ 'uk' => __( 'Ukrainian', 'wts-eae' ),
405
+ 'ur' => __( 'Urdu', 'wts-eae' ),
406
+ 'vi' => __( 'Vietnamese', 'wts-eae' ),
407
+ 'zh-cn' => __( 'Chinese (Simplified)', 'wts-eae' ),
408
+ 'zh-tw' => __( 'Chinese (Traditional)', 'wts-eae' ),
409
+ ];
410
+
411
+ return $languages;
412
+
413
+ }
414
+
415
+ public function render() {
416
+ $settings = $this->get_settings();
417
+ //echo '<pre>'; print_r($settings); echo '</pre>';
418
+
419
+ switch ( $settings['embed_type'] ) {
420
+
421
+ case "save_button" :
422
+ $this->get_save_button_html( $settings );
423
+ break;
424
+
425
+ case "follow_button" :
426
+ $this->get_follow_button_html( $settings );
427
+ break;
428
+
429
+ case "pin" :
430
+ $this->get_pin_html( $settings );
431
+ break;
432
+
433
+ case "board" :
434
+ $this->get_board_html( $settings );
435
+ break;
436
+
437
+ case "profile" :
438
+ $this->get_profile_html( $settings );
439
+ break;
440
+
441
+ }
442
+ ?>
443
+ <?php
444
+
445
+ }
446
+
447
+ public function get_save_button_html( $settings ) {
448
+ if ( $settings['button_type'] == 'one_image' ) {
449
+ $this->add_render_attribute( 'save_button', 'data-pin-do', 'buttonPin' );
450
+ if ( $settings['round_button'] != 'yes' ) {
451
+ $this->add_render_attribute( 'save_button', 'data-pin-count', $settings['show_pin_count'] );
452
+ }
453
+ $this->add_render_attribute( 'save_button', 'href', 'https://in.pinterest.com/pin/create/button/?url=' . $settings['source_url'] . '&media=' . $settings['image_url'] . '&description=' . $settings['description'] );
454
+ }
455
+ if ( $settings['button_type'] == 'any_image' ) {
456
+ $this->add_render_attribute( 'save_button', 'data-pin-do', 'buttonBookmark' );
457
+ $this->add_render_attribute( 'save_button', 'href', 'https://in.pinterest.com/pin/create/button/' );
458
+ }
459
+ if ( $settings['large_button'] == 'yes' ) {
460
+ $this->add_render_attribute( 'save_button', 'data-pin-tall', 'true' );
461
+ }
462
+ if ( $settings['round_button'] == 'yes' ) {
463
+ $this->add_render_attribute( 'save_button', 'data-pin-round', 'true' );
464
+ }
465
+ if ( $settings['save_label'] == 'yes' && $settings['round_button'] != 'yes' ) {
466
+ $this->add_render_attribute( 'save_button', 'data-pin-save', 'true' );
467
+ }
468
+ if ( $settings['custom_pinterest_icon']['url'] != "" ) {
469
+ $this->add_render_attribute( 'save_button', 'data-pin-custom', 'true' );
470
+ }
471
+
472
+ $this->add_render_attribute( 'save_button', 'data-pin-lang', $settings['language'] );
473
+
474
+ ?>
475
+ <a <?php echo $this->get_render_attribute_string( 'save_button' ); ?> >
476
+ <?php
477
+ if ( $settings['custom_pinterest_icon']['url'] != "" ) {
478
+ ?>
479
+ <img src="<?php echo $settings['custom_pinterest_icon']['url']; ?>" height="25"/>
480
+ <?php
481
+ }
482
+ ?>
483
+ </a>
484
+ <?php
485
+
486
+ }
487
+
488
+ public function get_follow_button_html( $settings ) {
489
+ if ( $settings['embed_type'] == 'follow_button' ) {
490
+ $this->add_render_attribute( 'follow-button', 'data-pin-do', 'buttonFollow' );
491
+ }
492
+ $this->add_render_attribute( 'follow-button', 'href', $settings['user_url'] );
493
+ if ( $settings['large_button'] == 'yes' ) {
494
+ $this->add_render_attribute( 'follow-button', 'data-pin-tall', 'true' );
495
+ }
496
+
497
+ ?>
498
+ <a <?php echo $this->get_render_attribute_string( 'follow-button' ) ?> ><?php echo $settings['user_name'] ?> </a>
499
+
500
+ <?php
501
+ }
502
+
503
+ public function get_pin_html( $settings ) {
504
+ if ( $settings['embed_type'] == 'pin' ) {
505
+ $this->add_render_attribute( 'pin', 'data-pin-do', 'embedPin' );
506
+ }
507
+ $this->add_render_attribute( 'pin', 'href', $settings['pin_url'] );
508
+ $this->add_render_attribute( 'pin', 'data-pin-width', $settings['pin_size'] );
509
+ if ( $settings['hide_description'] == 'yes' ) {
510
+ $this->add_render_attribute( 'pin', 'data-pin-terse', 'true' );
511
+ }
512
+ ?>
513
+ <a <?php echo $this->get_render_attribute_string( 'pin' ); ?> ></a>
514
+ <?php
515
+
516
+
517
+ }
518
+
519
+ public function get_board_html( $settings ) {
520
+ if ( $settings['embed_type'] == 'board' ) {
521
+ $this->add_render_attribute( 'board', 'data-pin-do', 'embedBoard' );
522
+ }
523
+
524
+ $this->add_render_attribute( 'board', 'href', $settings['board_url'] );
525
+ $this->add_render_attribute( 'board', 'data-pin-scale-width', $settings['image_width']['size'] );
526
+ $this->add_render_attribute( 'board', 'data-pin-board-width', $settings['board_width']['size'] );
527
+ $this->add_render_attribute( 'board', 'data-pin-scale-height', $settings['image_height']['size'] );
528
+ ?>
529
+ <a <?php echo $this->get_render_attribute_string( 'board' ); ?> ></a>
530
+ <?php
531
+ }
532
+
533
+ public function get_profile_html( $settings ) {
534
+ if ( $settings['embed_type'] == 'profile' ) {
535
+ $this->add_render_attribute( 'profile', 'data-pin-do', 'embedUser' );
536
+ }
537
+
538
+ $this->add_render_attribute( 'profile', 'href', $settings['profile_url'] );
539
+ $this->add_render_attribute( 'profile', 'data-pin-scale-width', $settings['image_width']['size'] );
540
+ $this->add_render_attribute( 'profile', 'data-pin-board-width', $settings['board_width']['size'] );
541
+ $this->add_render_attribute( 'profile', 'data-pin-scale-height', $settings['image_height']['size'] );
542
+ ?>
543
+ <a <?php echo $this->get_render_attribute_string( 'profile' ); ?> ></a>
544
+ <?php
545
+ }
546
+
547
+
548
+ }
549
+
550
+ Plugin::instance()->widgets_manager->register_widget_type( new EAE_Pinterest() );
elements/post-list.php ADDED
@@ -0,0 +1,761 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_PostList extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-postlist';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Post List', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-post-list wts-eae-pe';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'wts-eae' ];
22
+ }
23
+
24
+ protected function _register_controls() {
25
+ $this->start_controls_section(
26
+ 'section_post_filters',
27
+ [
28
+ 'label' => __( 'Post Filters', 'elementor' )
29
+ ]
30
+ );
31
+
32
+ $this->add_control(
33
+ 'refer_wp_org',
34
+ [
35
+ 'raw' => __( 'For more detail about following filters please refer <a href="https://codex.wordpress.org/Template_Tags/get_posts" target="_blank">here</a>', 'elementor' ),
36
+ 'type' => Controls_Manager::RAW_HTML,
37
+ 'classes' => 'elementor-descriptor',
38
+ ]
39
+ );
40
+
41
+ $this->add_control(
42
+ 'post_type',
43
+ [
44
+ 'label' => __( 'Post Type', 'elementor' ),
45
+ 'type' => Controls_Manager::SELECT,
46
+ 'options' => eae_get_post_types(),
47
+ 'default' => 'post',
48
+
49
+ ]
50
+ );
51
+
52
+ $this->add_control(
53
+ 'category',
54
+ [
55
+ 'label' => __( 'Category ID', 'elementor' ),
56
+ 'description' => __('Comma separated list of category ids','elementor'),
57
+ 'type' => Controls_Manager::TEXT,
58
+ 'default' => '',
59
+ 'condition' => [
60
+ 'post_type' => 'post'
61
+ ]
62
+ ]
63
+ );
64
+
65
+ $this->add_control(
66
+ 'num_posts',
67
+ [
68
+ 'label' => __( 'Number of Posts', 'elementor' ),
69
+ 'type' => Controls_Manager::NUMBER,
70
+ 'default' => '5'
71
+ ]
72
+ );
73
+
74
+ $this->add_control(
75
+ 'post_offset',
76
+ [
77
+ 'label' => __( 'Post Offset', 'elementor' ),
78
+ 'type' => Controls_Manager::NUMBER,
79
+ 'default' => '0'
80
+ ]
81
+ );
82
+
83
+ $this->add_control(
84
+ 'orderby',
85
+ [
86
+ 'label' => __( 'Order By', 'elementor' ),
87
+ 'type' => Controls_Manager::SELECT,
88
+ 'options' => eae_get_post_orderby_options(),
89
+ 'default' => 'date',
90
+
91
+ ]
92
+ );
93
+
94
+ $this->add_control(
95
+ 'order',
96
+ [
97
+ 'label' => __( 'Order', 'elementor' ),
98
+ 'type' => Controls_Manager::SELECT,
99
+ 'options' => [
100
+ 'asc' => 'Ascending',
101
+ 'desc' => 'Descending'
102
+ ],
103
+ 'default' => 'desc',
104
+
105
+ ]
106
+ );
107
+
108
+ $this->end_controls_section();
109
+
110
+ $this->start_controls_section(
111
+ 'section_layout_settings',
112
+ [
113
+ 'label' => __( 'Layout Settings', 'elementor' )
114
+ ]
115
+ );
116
+
117
+
118
+ $this->add_control(
119
+ 'show_image',
120
+ [
121
+ 'label' => __( 'Show Image', 'elementor' ),
122
+ 'type' => Controls_Manager::CHOOSE,
123
+ 'options' => [
124
+ '1' => [
125
+ 'title' => __( 'Yes', 'elementor' ),
126
+ 'icon' => 'fa fa-check',
127
+ ],
128
+ '0' => [
129
+ 'title' => __( 'No', 'elementor' ),
130
+ 'icon' => 'fa fa-ban',
131
+ ]
132
+ ],
133
+ 'default' => '1'
134
+ ]
135
+ );
136
+ $this->add_group_control(
137
+ Group_Control_Image_Size::get_type(),
138
+ [
139
+ 'name' => 'image',
140
+ 'exclude' => [ 'custom' ],
141
+ 'condition' => [
142
+ 'show_image' => '1',
143
+ ]
144
+ ]
145
+ );
146
+
147
+ $this->add_responsive_control(
148
+ 'image_align',
149
+ [
150
+ 'label' => __( 'Image Alignment', 'elementor' ),
151
+ 'type' => Controls_Manager::CHOOSE,
152
+ 'options' => [
153
+ 'left' => [
154
+ 'title' => __( 'Left', 'elementor' ),
155
+ 'icon' => 'fa fa-align-left',
156
+ ],
157
+ 'none' => [
158
+ 'title' => __( 'Center', 'elementor' ),
159
+ 'icon' => 'fa fa-align-center',
160
+ ],
161
+ 'right' => [
162
+ 'title' => __( 'Right', 'elementor' ),
163
+ 'icon' => 'fa fa-align-right',
164
+ ]
165
+ ],
166
+ 'default' => 'left',
167
+ 'condition' => [
168
+ 'show_image' => '1',
169
+ ],
170
+ 'selectors' => [
171
+ '{{WRAPPER}} .eae-pl-image-wrapper' => 'float: {{VALUE}};',
172
+ ],
173
+ 'prefix_class' => 'eae-pl-img-align-'
174
+ ]
175
+ );
176
+
177
+ $this->add_responsive_control(
178
+ 'image_indent',
179
+ [
180
+ 'label' => __( 'Image Indent', 'elementor' ),
181
+ 'type' => Controls_Manager::SLIDER,
182
+ 'range' => [
183
+ 'px' => [
184
+ 'min' => 5,
185
+ 'max' => 100,
186
+ ],
187
+ ],
188
+ 'default' => [
189
+ 'size' => 10,
190
+ 'unit' => 'px',
191
+ ],
192
+ 'condition' => [
193
+ 'show_image' => '1',
194
+ ],
195
+ 'selectors' => [
196
+ '{{WRAPPER}}.eae-pl-img-align-left .eae-pl-image-wrapper' => 'margin-right: {{SIZE}}{{UNIT}};',
197
+ '{{WRAPPER}}.eae-pl-img-align-right .eae-pl-image-wrapper' => 'margin-left: {{SIZE}}{{UNIT}};',
198
+ ],
199
+ ]
200
+ );
201
+
202
+ $this->add_control(
203
+ 'show_title',
204
+ [
205
+ 'label' => __( 'Show Title', 'elementor' ),
206
+ 'type' => Controls_Manager::CHOOSE,
207
+ 'options' => [
208
+ '1' => [
209
+ 'title' => __( 'Yes', 'elementor' ),
210
+ 'icon' => 'fa fa-check',
211
+ ],
212
+ '0' => [
213
+ 'title' => __( 'No', 'elementor' ),
214
+ 'icon' => 'fa fa-ban',
215
+ ]
216
+ ],
217
+ 'default' => '1'
218
+ ]
219
+ );
220
+
221
+ $this->add_control(
222
+ 'title_on_top',
223
+ [
224
+ 'label' => __( 'Title on top', 'elementor' ),
225
+ 'type' => Controls_Manager::CHOOSE,
226
+ 'options' => [
227
+ 'top' => [
228
+ 'title' => __( 'Yes', 'elementor' ),
229
+ 'icon' => 'fa fa-check',
230
+ ],
231
+ '0' => [
232
+ 'title' => __( 'No', 'elementor' ),
233
+ 'icon' => 'fa fa-ban',
234
+ ]
235
+ ],
236
+ 'default' => '0',
237
+ 'condition' => [
238
+ 'show_title' => '1'
239
+ ]
240
+ ]
241
+ );
242
+
243
+ $this->add_control(
244
+ 'show_excrept',
245
+ [
246
+ 'label' => __( 'Show Excrept', 'elementor' ),
247
+ 'type' => Controls_Manager::CHOOSE,
248
+ 'options' => [
249
+ '1' => [
250
+ 'title' => __( 'Yes', 'elementor' ),
251
+ 'icon' => 'fa fa-check',
252
+ ],
253
+ '0' => [
254
+ 'title' => __( 'No', 'elementor' ),
255
+ 'icon' => 'fa fa-ban',
256
+ ]
257
+ ],
258
+ 'default' => '1'
259
+ ]
260
+ );
261
+
262
+ $this->add_control(
263
+ 'excrept_size',
264
+ [
265
+ 'label' => __( 'Excrept Size', 'elementor' ),
266
+ 'type' => Controls_Manager::NUMBER,
267
+ 'default' => '10',
268
+ 'condition' => [
269
+ 'show_excrept' => '1',
270
+ ]
271
+
272
+ ]
273
+ );
274
+
275
+ $this->add_control(
276
+ 'show_read_more',
277
+ [
278
+ 'label' => __( 'Show Read More', 'elementor' ),
279
+ 'type' => Controls_Manager::CHOOSE,
280
+ 'options' => [
281
+ '1' => [
282
+ 'title' => __( 'Yes', 'elementor' ),
283
+ 'icon' => 'fa fa-check',
284
+ ],
285
+ '0' => [
286
+ 'title' => __( 'No', 'elementor' ),
287
+ 'icon' => 'fa fa-ban',
288
+ ]
289
+ ],
290
+ 'default' => '1'
291
+ ]
292
+ );
293
+
294
+ $this->add_control(
295
+ 'read_more_text',
296
+ [
297
+ 'label' => __( 'Read More Text', 'elementor' ),
298
+ 'type' => Controls_Manager::TEXT,
299
+ 'placeholder' => __( 'Read More', 'elementor' ),
300
+ 'default' => __( 'Read More', 'elementor' ),
301
+ 'condition' => [
302
+ 'show_read_more' => '1',
303
+ ]
304
+ ]
305
+ );
306
+
307
+
308
+ $this->end_controls_section();
309
+
310
+ $this->start_controls_section(
311
+ 'section-general-style',
312
+ [
313
+ 'label' => __( 'General', 'elementor' ),
314
+ 'tab' => Controls_Manager::TAB_STYLE
315
+ ]
316
+ );
317
+
318
+ $this->add_control(
319
+ 'heading_image_border',
320
+ [
321
+ 'label' => __( 'Image Border', 'elementor' ),
322
+ 'type' => Controls_Manager::HEADING,
323
+ 'separator' => 'before',
324
+ ]
325
+ );
326
+
327
+ $this->add_group_control(
328
+ Group_Control_Border::get_type(),
329
+ [
330
+ 'name' => 'image_border',
331
+ 'label' => __( 'Image Border', 'elementor' ),
332
+ 'selector' => '{{WRAPPER}} .eae-pl-image-wrapper a img',
333
+ ]
334
+ );
335
+
336
+ $this->add_control(
337
+ 'image_border_radius',
338
+ [
339
+ 'label' => __( 'Border Radius', 'elementor' ),
340
+ 'type' => Controls_Manager::DIMENSIONS,
341
+ 'size_units' => [ 'px', '%' ],
342
+ 'selectors' => [
343
+ '{{WRAPPER}} .eae-pl-image-wrapper a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
344
+ '{{WRAPPER}} .eae-pl-image-wrapper a img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
345
+ ],
346
+ ]
347
+ );
348
+
349
+ $this->end_controls_section();
350
+
351
+ $this->start_controls_section(
352
+ 'section-item-typography',
353
+ [
354
+ 'label' => __( 'Typography', 'elementor' ),
355
+ 'tab' => Controls_Manager::TAB_STYLE
356
+ ]
357
+ );
358
+
359
+ $this->add_control(
360
+ 'heading_title_typography',
361
+ [
362
+ 'label' => __( 'Title Typography', 'elementor' ),
363
+ 'type' => Controls_Manager::HEADING,
364
+ 'separator' => 'before',
365
+ ]
366
+ );
367
+
368
+ $this->add_control(
369
+ 'title_color',
370
+ [
371
+ 'label' => __( 'Title Color', 'elementor' ),
372
+ 'type' => Controls_Manager::COLOR,
373
+ 'scheme' => [
374
+ 'type' => Scheme_Color::get_type(),
375
+ 'value' => Scheme_Color::COLOR_1,
376
+ ],
377
+ 'selectors' => [
378
+ '{{WRAPPER}} .eae-pl-title a' => 'color: {{VALUE}};',
379
+ ]
380
+
381
+ ]
382
+ );
383
+
384
+ $this->add_responsive_control(
385
+ 'title_align',
386
+ [
387
+ 'label' => __( 'Title Align', 'elementor' ),
388
+ 'type' => Controls_Manager::CHOOSE,
389
+ 'options' => [
390
+ 'left' => [
391
+ 'title' => __( 'Left', 'elementor' ),
392
+ 'icon' => 'fa fa-align-left',
393
+ ],
394
+ 'center' => [
395
+ 'title' => __( 'Center', 'elementor' ),
396
+ 'icon' => 'fa fa-align-center',
397
+ ],
398
+ 'right' => [
399
+ 'title' => __( 'Right', 'elementor' ),
400
+ 'icon' => 'fa fa-align-right',
401
+ ]
402
+ ],
403
+ 'selectors' => [
404
+ '{{WRAPPER}} .eae-pl-title a' => 'text-align: {{VALUE}};',
405
+ ]
406
+ ]
407
+ );
408
+
409
+ $this->add_group_control(
410
+ Group_Control_Typography::get_type(),
411
+ [
412
+ 'name' => 'title_typography',
413
+ 'label' => __( 'Title Typography', 'elementor' ),
414
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
415
+ 'selector' => '{{WRAPPER}} .eae-pl-title a',
416
+ ]
417
+ );
418
+
419
+ $this->add_control(
420
+ 'heading_excrept_typography',
421
+ [
422
+ 'label' => __( 'Excrept Typography', 'elementor' ),
423
+ 'type' => Controls_Manager::HEADING,
424
+ 'separator' => 'before',
425
+ ]
426
+ );
427
+
428
+ $this->add_control(
429
+ 'excrept_color',
430
+ [
431
+ 'label' => __( 'Excrept Color', 'elementor' ),
432
+ 'type' => Controls_Manager::COLOR,
433
+ 'scheme' => [
434
+ 'type' => Scheme_Color::get_type(),
435
+ 'value' => Scheme_Color::COLOR_3,
436
+ ],
437
+ 'selectors' => [
438
+ '{{WRAPPER}} .eae-pl-content-box' => 'color: {{VALUE}};',
439
+ ]
440
+ ]
441
+ );
442
+
443
+ $this->add_responsive_control(
444
+ 'excrept_align',
445
+ [
446
+ 'label' => __( 'Excrept Align', 'elementor' ),
447
+ 'type' => Controls_Manager::CHOOSE,
448
+ 'options' => [
449
+ 'left' => [
450
+ 'title' => __( 'Left', 'elementor' ),
451
+ 'icon' => 'fa fa-align-left',
452
+ ],
453
+ 'center' => [
454
+ 'title' => __( 'Center', 'elementor' ),
455
+ 'icon' => 'fa fa-align-center',
456
+ ],
457
+ 'right' => [
458
+ 'title' => __( 'Right', 'elementor' ),
459
+ 'icon' => 'fa fa-align-right',
460
+ ],
461
+ 'justify' => [
462
+ 'title' => __( 'Justified', 'elementor' ),
463
+ 'icon' => 'fa fa-align-justify',
464
+ ],
465
+ ],
466
+ 'selectors' => [
467
+ '{{WRAPPER}} .eae-pl-content-box' => 'text-align: {{VALUE}};',
468
+ ],
469
+ ]
470
+ );
471
+
472
+ $this->add_group_control(
473
+ Group_Control_Typography::get_type(),
474
+ [
475
+ 'name' => 'excrept_typography',
476
+ 'label' => __( 'Excrept Typography', 'elementor' ),
477
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
478
+ 'selector' => '{{WRAPPER}} .eae-pl-content-box',
479
+ ]
480
+ );
481
+
482
+ $this->add_control(
483
+ 'heading_readmore_typography',
484
+ [
485
+ 'label' => __( 'Readmore Typography', 'elementor' ),
486
+ 'type' => Controls_Manager::HEADING,
487
+ 'separator' => 'before',
488
+ ]
489
+ );
490
+
491
+ $this->add_control(
492
+ 'readmore_color',
493
+ [
494
+ 'label' => __( 'Readmore Color', 'elementor' ),
495
+ 'type' => Controls_Manager::COLOR,
496
+ 'scheme' => [
497
+ 'type' => Scheme_Color::get_type(),
498
+ 'value' => Scheme_Color::COLOR_3,
499
+ ],
500
+ 'selectors' => [
501
+ '{{WRAPPER}} .eae-pl-readmore a' => 'color: {{VALUE}};',
502
+ ]
503
+ ]
504
+ );
505
+
506
+ $this->add_responsive_control(
507
+ 'readmore_align',
508
+ [
509
+ 'label' => __( 'Readmore Align', 'elementor' ),
510
+ 'type' => Controls_Manager::CHOOSE,
511
+ 'options' => [
512
+ 'left' => [
513
+ 'title' => __( 'Left', 'elementor' ),
514
+ 'icon' => 'fa fa-align-left',
515
+ ],
516
+ 'center' => [
517
+ 'title' => __( 'Center', 'elementor' ),
518
+ 'icon' => 'fa fa-align-center',
519
+ ],
520
+ 'right' => [
521
+ 'title' => __( 'Right', 'elementor' ),
522
+ 'icon' => 'fa fa-align-right',
523
+ ]
524
+ ],
525
+ 'default' => 'right',
526
+ 'selectors' => [
527
+ '{{WRAPPER}} .eae-pl-readmore' => 'text-align: {{VALUE}};',
528
+ ],
529
+ ]
530
+ );
531
+
532
+ $this->add_group_control(
533
+ Group_Control_Typography::get_type(),
534
+ [
535
+ 'name' => 'readmore_typography',
536
+ 'label' => __( 'Readmore Typography', 'elementor' ),
537
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_3,
538
+ 'selector' => '{{WRAPPER}} .eae-pl-readmore a',
539
+ ]
540
+ );
541
+
542
+
543
+
544
+ $this->end_controls_section();
545
+
546
+ $this->start_controls_section(
547
+ 'section-list-item-style',
548
+ [
549
+ 'label' => __( 'List Item Style', 'elementor' ),
550
+ 'tab' => Controls_Manager::TAB_STYLE
551
+ ]
552
+ );
553
+
554
+ $this->add_responsive_control(
555
+ 'list_item_padding',
556
+ [
557
+ 'label' => __( 'List Item Padding', 'elementor' ),
558
+ 'type' => Controls_Manager::DIMENSIONS,
559
+ 'size_units' => [ 'px', 'em', '%' ],
560
+ 'selectors' => [
561
+ '{{WRAPPER}} .wts-eae-pl-wrapper > ul > li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
562
+ ],
563
+ ]
564
+ );
565
+
566
+ $this->add_responsive_control(
567
+ 'list_item_margin',
568
+ [
569
+ 'label' => __( 'List Item Margin', 'elementor' ),
570
+ 'type' => Controls_Manager::DIMENSIONS,
571
+ 'size_units' => [ 'px', 'em', '%' ],
572
+ 'selectors' => [
573
+ '{{WRAPPER}} .wts-eae-pl-wrapper > ul > li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
574
+ ],
575
+ ]
576
+ );
577
+
578
+ $this->add_group_control(
579
+ Group_Control_Border::get_type(),
580
+ [
581
+ 'name' => 'list_item_border',
582
+ 'label' => __( 'Image Border', 'elementor' ),
583
+ 'selector' => '{{WRAPPER}} .wts-eae-pl-wrapper > ul > li',
584
+ ]
585
+ );
586
+
587
+ $this->add_control(
588
+ 'list_item_border_radius',
589
+ [
590
+ 'label' => __( 'Border Radius', 'elementor' ),
591
+ 'type' => Controls_Manager::DIMENSIONS,
592
+ 'size_units' => [ 'px', '%' ],
593
+ 'selectors' => [
594
+ '{{WRAPPER}} .wts-eae-pl-wrapper > ul > li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
595
+ ],
596
+ ]
597
+ );
598
+
599
+ $this->end_controls_section();
600
+
601
+ $this->start_controls_section(
602
+ 'section-readmore_button',
603
+ [
604
+ 'label' => __( 'Read More Button', 'elementor' ),
605
+ 'tab' => Controls_Manager::TAB_STYLE
606
+ ]
607
+ );
608
+
609
+ $this->add_control(
610
+ 'readmore_bg',
611
+ [
612
+ 'label' => __( 'Background Color', 'elementor' ),
613
+ 'type' => Controls_Manager::COLOR,
614
+ 'scheme' => [
615
+ 'type' => Scheme_Color::get_type(),
616
+ 'value' => Scheme_Color::COLOR_1,
617
+ ],
618
+ 'selectors' => [
619
+ '{{WRAPPER}} .eae-pl-readmore a' => 'background-color: {{VALUE}};',
620
+ ],
621
+ ]
622
+ );
623
+
624
+ $this->add_group_control(
625
+ Group_Control_Border::get_type(),
626
+ [
627
+ 'name' => 'readmore_border',
628
+ 'label' => __( 'Border', 'elementor' ),
629
+ 'default' => '1px',
630
+ 'selector' => '{{WRAPPER}} .eae-pl-readmore a',
631
+ ]
632
+ );
633
+
634
+ $this->add_control(
635
+ 'readmore_border_radius',
636
+ [
637
+ 'label' => __( 'Border Radius', 'elementor' ),
638
+ 'type' => Controls_Manager::DIMENSIONS,
639
+ 'size_units' => [ 'px', '%' ],
640
+ 'selectors' => [
641
+ '{{WRAPPER}} .eae-pl-readmore a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
642
+ ],
643
+ ]
644
+ );
645
+
646
+ $this->add_control(
647
+ 'readmore_text_padding',
648
+ [
649
+ 'label' => __( 'Text Padding', 'elementor' ),
650
+ 'type' => Controls_Manager::DIMENSIONS,
651
+ 'size_units' => [ 'px', 'em', '%' ],
652
+ 'selectors' => [
653
+ '{{WRAPPER}} .eae-pl-readmore a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
654
+ ],
655
+ ]
656
+ );
657
+
658
+ $this->add_control(
659
+ 'readmore_text_margin',
660
+ [
661
+ 'label' => __( 'Read More Margin', 'elementor' ),
662
+ 'type' => Controls_Manager::DIMENSIONS,
663
+ 'size_units' => [ 'px', 'em', '%' ],
664
+ 'selectors' => [
665
+ '{{WRAPPER}} .eae-pl-readmore a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
666
+ ],
667
+ ]
668
+ );
669
+
670
+ $this->end_controls_section();
671
+ }
672
+
673
+ protected function render( ) {
674
+ $settings = $this->get_settings();
675
+ //echo '<pre>'; print_r($settings); echo '</pre>';
676
+ $post_args = eae_get_post_settings($settings);
677
+
678
+ $posts = eae_get_post_data($post_args);
679
+ // $this->add_render_attribute('separator_wrapper','class','wts-eae-textseparator');
680
+ ?>
681
+ <div class="wts-eae-pl-wrapper">
682
+ <?php
683
+ if(count($posts)){
684
+ global $post;
685
+ ?>
686
+ <ul>
687
+ <?php
688
+ foreach($posts as $post){
689
+ setup_postdata($post);
690
+ ?>
691
+ <li>
692
+ <?php if($settings['show_title'] && ($settings['title_on_top'] == 'top')){ ?>
693
+ <h3 class="eae-pl-title"><a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
694
+ <?php } ?>
695
+ <?php if($settings['show_image'] == 1){ ?>
696
+ <div class="eae-pl-image-wrapper">
697
+ <a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?>">
698
+ <?php the_post_thumbnail($settings['image_size']); ?>
699
+ </a>
700
+ </div>
701
+ <?php } ?>
702
+ <div class="eae-pl-content-box-wrapper">
703
+
704
+ <?php if($settings['show_title'] && ($settings['title_on_top'] != 'top')){ ?>
705
+ <h3 class="eae-pl-title"><a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
706
+ <?php } ?>
707
+
708
+ <?php if($settings['show_excrept']){ ?>
709
+ <div class="eae-pl-content-box">
710
+ <?php echo eae_get_excerpt_by_id(get_the_ID(),$settings['excrept_size']);?>
711
+ </div>
712
+ <?php } ?>
713
+
714
+ <?php if($settings['show_read_more']){ ?>
715
+ <div class="eae-pl-readmore">
716
+ <a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?>"><?php echo $settings['read_more_text']; ?></a>
717
+ </div>
718
+ <?php } ?>
719
+ </div>
720
+ </li>
721
+ <?php
722
+ }
723
+ wp_reset_postdata();
724
+ ?>
725
+ </ul>
726
+ <?php
727
+ }
728
+ ?>
729
+ </div>
730
+ <?php
731
+ }
732
+
733
+ protected function content_template() {
734
+ ?>
735
+ <#
736
+
737
+ icon_class = settings.icon != ''? 'icon-yes':'';
738
+ title_class = settings.title != ''? 'title-yes':'';
739
+ var separator_html = '<div class="wts-eae-textseparator sep-align-' + settings.align + ' icon-' + settings.icon_position + ' ' + icon_class + ' ' + title_class +'"><div class="eae-sep-holder sep-left"><div class="eae-sep-lines"></div></div>';
740
+
741
+ if(settings.icon != '' && settings.icon_position == 'before'){
742
+ separator_html += '<div class="eae-separator-icon-wrapper"><div class="eae-separator-icon-inner"><i class="'+ settings.icon +'"></i></div></div>'
743
+ }
744
+
745
+ if(settings.title != ''){
746
+ separator_html += '<' + settings.html_tag + ' class="eae-separator-title">' + settings.title + '</' + settings.html_tag + '>';
747
+ }
748
+
749
+
750
+ if(settings.icon != '' && settings.icon_position == 'after'){
751
+ separator_html += '<div class="eae-separator-icon-wrapper"><div class="eae-separator-icon-inner"><i class="'+ settings.icon +'"></i></div></div>'
752
+ }
753
+
754
+ separator_html += '<div class="eae-sep-holder sep-right"><div class="eae-sep-lines"></div></div></div>';
755
+
756
+ print( separator_html );
757
+ #>
758
+ <?php
759
+ }
760
+ }
761
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_PostList() );
elements/pricetable.php ADDED
@@ -0,0 +1,870 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_PriceTable extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-pricetable';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Price Table', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-price-table wts-eae-pe';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'wts-eae' ];
22
+ }
23
+
24
+
25
+ protected function _register_controls() {
26
+ $this->start_controls_section(
27
+ 'section_title',
28
+ [
29
+ 'label' => __( 'Plan Heading', 'elementor' )
30
+ ]
31
+ );
32
+
33
+ $this->add_control(
34
+ 'heading',
35
+ [
36
+ 'label' => __( 'Heading', 'elementor' ),
37
+ 'type' => Controls_Manager::TEXT,
38
+ 'placeholder' => __( 'Enter plan name', 'elementor' ),
39
+ 'default' => __( 'Plan 1', 'elementor' ),
40
+ ]
41
+ );
42
+
43
+ $this->add_control(
44
+ 'heading_tag',
45
+ [
46
+ 'label' => __( 'Heading HTML Tag', 'elementor' ),
47
+ 'type' => Controls_Manager::SELECT,
48
+ 'options' => [
49
+ 'h1' => __( 'H1', 'elementor' ),
50
+ 'h2' => __( 'H2', 'elementor' ),
51
+ 'h3' => __( 'H3', 'elementor' ),
52
+ 'h4' => __( 'H4', 'elementor' ),
53
+ 'h5' => __( 'H5', 'elementor' ),
54
+ 'h6' => __( 'H6', 'elementor' )
55
+ ],
56
+ 'default' => 'h2',
57
+ ]
58
+ );
59
+
60
+
61
+ $this->add_control(
62
+ 'sub-heading',
63
+ [
64
+ 'label' => __( 'Sub Heading', 'elementor' ),
65
+ 'type' => Controls_Manager::TEXT,
66
+ 'placeholder' => __( 'Enter plan name', 'elementor' ),
67
+ 'default' => __( 'Plan 1', 'elementor' ),
68
+ ]
69
+ );
70
+
71
+ $this->add_control(
72
+ 'sub_heading_tag',
73
+ [
74
+ 'label' => __( 'Sub Heading HTML Tag', 'elementor' ),
75
+ 'type' => Controls_Manager::SELECT,
76
+ 'options' => [
77
+ 'h1' => __( 'H1', 'elementor' ),
78
+ 'h2' => __( 'H2', 'elementor' ),
79
+ 'h3' => __( 'H3', 'elementor' ),
80
+ 'h4' => __( 'H4', 'elementor' ),
81
+ 'h5' => __( 'H5', 'elementor' ),
82
+ 'h6' => __( 'H6', 'elementor' ),
83
+ 'p' => __( 'P', 'elementor' )
84
+ ],
85
+ 'default' => 'h3',
86
+ ]
87
+ );
88
+
89
+ $this->end_controls_section();
90
+
91
+ $this->start_controls_section(
92
+ 'section_price_box',
93
+ [
94
+ 'label' => __( 'Price Box', 'elementor' )
95
+ ]
96
+ );
97
+
98
+
99
+ $this->add_control(
100
+ 'price-box-text',
101
+ [
102
+ 'label' => __( 'Price Box Text', 'elementor' ),
103
+ 'type' => Controls_Manager::TEXT,
104
+ 'placeholder' => __( '$100', 'elementor' ),
105
+ 'default' => __( '$100', 'elementor' ),
106
+ ]
107
+ );
108
+
109
+
110
+ $this->add_control(
111
+ 'price-box-subtext',
112
+ [
113
+ 'label' => __( 'Price Box Sub Text', 'elementor' ),
114
+ 'type' => Controls_Manager::TEXT,
115
+ 'placeholder' => __( 'per month', 'elementor' ),
116
+ 'default' => __( 'per month', 'elementor' ),
117
+ ]
118
+ );
119
+
120
+ $this->add_control(
121
+ 'shape',
122
+ [
123
+ 'label' => __( 'Shape', 'elementor' ),
124
+ 'type' => Controls_Manager::SELECT,
125
+ 'options' => [
126
+ 'none' => __( 'None', 'elementor' ),
127
+ 'circle' => __( 'Circle', 'elementor' ),
128
+ 'square' => __( 'Square', 'elementor' ),
129
+ ],
130
+ 'default' => 'circle',
131
+ 'prefix_class' => 'eae-pt-price-box-shape-',
132
+ ]
133
+ );
134
+
135
+ $this->end_controls_section();
136
+
137
+ $this->start_controls_section(
138
+ 'section_features',
139
+ [
140
+ 'label' => __( 'Features', 'elementor' )
141
+ ]
142
+ );
143
+
144
+ $this->add_control(
145
+ 'feature-list',
146
+ [
147
+ 'label' => __( 'Plan Features', 'elementor' ),
148
+ 'type' => Controls_Manager::REPEATER,
149
+ 'default' => [
150
+ [
151
+ 'text' => __( 'List Item #1', 'elementor' ),
152
+ 'available' => 'yes'
153
+ ],
154
+ [
155
+ 'text' => __( 'List Item #2', 'elementor' ),
156
+ 'available' => 'yes'
157
+ ],
158
+ [
159
+ 'text' => __( 'List Item #3', 'elementor' ),
160
+ 'available' => 'yes'
161
+ ],
162
+ ],
163
+ 'fields' => [
164
+ [
165
+ 'name' => 'text',
166
+ 'label' => __( 'Text', 'elementor' ),
167
+ 'type' => Controls_Manager::TEXT,
168
+ 'label_block' => true,
169
+ 'placeholder' => __( 'Plan Features', 'elementor' ),
170
+ 'default' => __( 'Feature 1', 'elementor' ),
171
+ ],
172
+ [
173
+ 'name' => 'available',
174
+ 'label' => __( 'Included', 'elementor' ),
175
+ 'type' => Controls_Manager::SWITCHER,
176
+ 'label_block' => true,
177
+ 'default' => 'yes'
178
+ ]
179
+ ],
180
+ 'title_field' => '{{{ text }}}'
181
+ ]
182
+ );
183
+
184
+ $this->end_controls_section();
185
+
186
+ $this->start_controls_section(
187
+ 'section_action_button',
188
+ [
189
+ 'label' => __( 'Action Button', 'elementor' )
190
+ ]
191
+ );
192
+
193
+ $this->add_control(
194
+ 'action_text',
195
+ [
196
+ 'label' => __( 'Button Text', 'elementor' ),
197
+ 'type' => Controls_Manager::TEXT,
198
+ 'placeholder' => __( 'Buy', 'elementor' ),
199
+ 'default' => __( 'Buy Now', 'elementor' ),
200
+ ]
201
+ );
202
+
203
+ $this->add_control(
204
+ 'link',
205
+ [
206
+ 'label' => __( 'Link to', 'elementor' ),
207
+ 'type' => Controls_Manager::URL,
208
+ 'placeholder' => __( 'http://your-link.com', 'elementor' ),
209
+ 'separator' => 'before',
210
+ ]
211
+ );
212
+
213
+ $this->add_control(
214
+ 'icon',
215
+ [
216
+ 'label' => __( 'Icon', 'elementor' ),
217
+ 'type' => Controls_Manager::ICON,
218
+ 'label_block' => true,
219
+ 'default' => 'fa fa-shopping-cart',
220
+ ]
221
+ );
222
+
223
+ $this->add_control(
224
+ 'icon_align',
225
+ [
226
+ 'label' => __( 'Icon Position', 'elementor' ),
227
+ 'type' => Controls_Manager::SELECT,
228
+ 'default' => 'left',
229
+ 'options' => [
230
+ 'left' => __( 'Before', 'elementor' ),
231
+ 'right' => __( 'After', 'elementor' ),
232
+ ],
233
+ 'condition' => [
234
+ 'icon!' => '',
235
+ ]
236
+ ]
237
+ );
238
+
239
+ $this->add_control(
240
+ 'icon_indent',
241
+ [
242
+ 'label' => __( 'Icon Spacing', 'elementor' ),
243
+ 'type' => Controls_Manager::SLIDER,
244
+ 'range' => [
245
+ 'px' => [
246
+ 'max' => 50,
247
+ ],
248
+ ],
249
+ 'condition' => [
250
+ 'icon!' => '',
251
+ ],
252
+ 'selectors' => [
253
+ '{{WRAPPER}} .eae-pt-action-button .eae-pt-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',
254
+ '{{WRAPPER}} .eae-pt-action-button .eae-pt-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',
255
+ ],
256
+ ]
257
+ );
258
+
259
+
260
+
261
+
262
+
263
+ $this->end_controls_section();
264
+
265
+
266
+ $this->start_controls_section(
267
+ 'section-box-style',
268
+ [
269
+ 'label' => __( 'Box Style', 'elementor' ),
270
+ 'tab' => Controls_Manager::TAB_STYLE,
271
+ ]
272
+ );
273
+
274
+ $this->add_control(
275
+ 'box-color',
276
+ [
277
+ 'label' => __( 'Box Color', 'elementor' ),
278
+ 'type' => Controls_Manager::COLOR,
279
+ 'scheme' => [
280
+ 'type' => Scheme_Color::get_type(),
281
+ 'value' => Scheme_Color::COLOR_1,
282
+ ],
283
+ 'default' => '#93C64F',
284
+ 'selectors' => [
285
+ '{{WRAPPER}} .wts-price-box-wrapper' => 'background-color: {{VALUE}};',
286
+ ],
287
+ ]
288
+ );
289
+
290
+ $this->add_group_control(
291
+ Group_Control_Border::get_type(),
292
+ [
293
+ 'name' => 'box_border',
294
+ 'label' => __( 'Box Border', 'elementor' ),
295
+ 'placeholder' => '1px',
296
+ 'default' => '1px',
297
+ 'selector' => '{{WRAPPER}} .wts-price-box-wrapper',
298
+ ]
299
+ );
300
+
301
+
302
+ $this->add_control(
303
+ 'box-border-radius',
304
+ [
305
+ 'label' => __( 'Border Radius', 'elementor' ),
306
+ 'type' => Controls_Manager::DIMENSIONS,
307
+ 'size_units' => [ 'px', '%' ],
308
+ 'selectors' => [
309
+ '{{WRAPPER}} .wts-price-box-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
310
+ '{{WRAPPER}} .wts-price-box-wrapper > div:first-child' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} 0 0;',
311
+ '{{WRAPPER}} .wts-price-box-wrapper > div:last-child' => 'border-radius: 0 0 {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
312
+ ]
313
+ ]
314
+ );
315
+
316
+ $this->add_group_control(
317
+ Group_Control_Box_Shadow::get_type(),
318
+ [
319
+ 'name' => 'box_box_shadow',
320
+ 'selector' => '{{WRAPPER}} .wts-price-box-wrapper',
321
+ ]
322
+ );
323
+
324
+
325
+
326
+ $this->end_controls_section();
327
+
328
+ $this->start_controls_section(
329
+ 'section-plan-heading-style',
330
+ [
331
+ 'label' => __( 'Plan Heading', 'elementor' ),
332
+ 'tab' => Controls_Manager::TAB_STYLE,
333
+ ]
334
+ );
335
+
336
+ $this->add_control(
337
+ 'plan_heading_color',
338
+ [
339
+ 'label' => __( 'Heading Color', 'elementor' ),
340
+ 'type' => Controls_Manager::COLOR,
341
+ 'scheme' => [
342
+ 'type' => Scheme_Color::get_type(),
343
+ 'value' => Scheme_Color::COLOR_1,
344
+ ],
345
+ 'default' => '#FFF',
346
+ 'selectors' => [
347
+ '{{WRAPPER}} .eae-pt-heading' => 'color: {{VALUE}};',
348
+ ],
349
+ ]
350
+ );
351
+
352
+ $this->add_group_control(
353
+ Group_Control_Typography::get_type(),
354
+ [
355
+ 'name' => 'plan_heading_typography',
356
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
357
+ 'selector' => '{{WRAPPER}} .eae-pt-heading',
358
+ ]
359
+ );
360
+
361
+ $this->add_control(
362
+ 'plan_sub_heading_color',
363
+ [
364
+ 'label' => __( 'Sub Heading Color', 'elementor' ),
365
+ 'type' => Controls_Manager::COLOR,
366
+ 'scheme' => [
367
+ 'type' => Scheme_Color::get_type(),
368
+ 'value' => Scheme_Color::COLOR_1,
369
+ ],
370
+ 'default' => '#FFF',
371
+ 'selectors' => [
372
+ '{{WRAPPER}} .eae-pt-sub-heading' => 'color: {{VALUE}};',
373
+ ],
374
+ ]
375
+ );
376
+
377
+ $this->add_group_control(
378
+ Group_Control_Typography::get_type(),
379
+ [
380
+ 'name' => 'plan_sub_heading_typography',
381
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
382
+ 'selector' => '{{WRAPPER}} .eae-pt-sub-heading',
383
+ ]
384
+ );
385
+
386
+
387
+ $this->add_group_control(
388
+ Group_Control_Background::get_type(),
389
+ [
390
+ 'name' => 'heading_section_bg',
391
+ 'label' => __( 'Section Background', 'elementor' ),
392
+ 'types' => [ 'classic','gradient' ],
393
+ 'selector' => '{{WRAPPER}} .heading-wrapper',
394
+ ]
395
+ );
396
+
397
+ $this->end_controls_section();
398
+
399
+ $this->start_controls_section(
400
+ 'section-price-box',
401
+ [
402
+ 'label' => __( 'Price Box', 'elementor' ),
403
+ 'tab' => Controls_Manager::TAB_STYLE,
404
+ ]
405
+ );
406
+
407
+ $this->add_control(
408
+ 'pb_content_settings',
409
+ [
410
+ 'label' => __( 'Content Settings', 'elementor' ),
411
+ 'type' => Controls_Manager::HEADING,
412
+ 'separator' => 'before',
413
+ ]
414
+ );
415
+
416
+ $this->add_control(
417
+ 'price_text_color',
418
+ [
419
+ 'label' => __( 'Price Text Color', 'elementor' ),
420
+ 'type' => Controls_Manager::COLOR,
421
+ 'scheme' => [
422
+ 'type' => Scheme_Color::get_type(),
423
+ 'value' => Scheme_Color::COLOR_1,
424
+ ],
425
+ 'default' => '#FFF',
426
+ 'selectors' => [
427
+ '{{WRAPPER}} .plan-price-shape-inner .price-text' => 'color: {{VALUE}};',
428
+ ],
429
+ ]
430
+ );
431
+
432
+ $this->add_group_control(
433
+ Group_Control_Typography::get_type(),
434
+ [
435
+ 'name' => 'price_text_typography',
436
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
437
+ 'selector' => '{{WRAPPER}} .plan-price-shape-inner .price-text',
438
+ ]
439
+ );
440
+
441
+
442
+ $this->add_control(
443
+ 'price_sub_text_color',
444
+ [
445
+ 'label' => __( 'Sub Text Color', 'elementor' ),
446
+ 'type' => Controls_Manager::COLOR,
447
+ 'scheme' => [
448
+ 'type' => Scheme_Color::get_type(),
449
+ 'value' => Scheme_Color::COLOR_1,
450
+ ],
451
+ 'default' => '#FFF',
452
+ 'selectors' => [
453
+ '{{WRAPPER}} .plan-price-shape-inner .price-subtext' => 'color: {{VALUE}};',
454
+ ],
455
+ ]
456
+ );
457
+
458
+ $this->add_group_control(
459
+ Group_Control_Typography::get_type(),
460
+ [
461
+ 'name' => 'price_sub_text_typography',
462
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
463
+ 'selector' => '{{WRAPPER}} .plan-price-shape-inner .price-subtext',
464
+ ]
465
+ );
466
+
467
+ $this->add_control(
468
+ 'pb_box_settings',
469
+ [
470
+ 'label' => __( 'Box Settings', 'elementor' ),
471
+ 'type' => Controls_Manager::HEADING,
472
+ 'separator' => 'before',
473
+ ]
474
+ );
475
+
476
+ $this->add_group_control(
477
+ Group_Control_Border::get_type(),
478
+ [
479
+ 'name' => 'price_box_border',
480
+ 'label' => __( 'Price Box Border', 'elementor' ),
481
+ 'selector' => '{{WRAPPER}} .plan-price-shape',
482
+ ]
483
+ );
484
+
485
+ $this->add_control(
486
+ 'price_box_border_radius',
487
+ [
488
+ 'label' => __( 'Border Radius', 'elementor' ),
489
+ 'type' => Controls_Manager::DIMENSIONS,
490
+ 'size_units' => [ 'px', '%' ],
491
+ 'selectors' => [
492
+ '{{WRAPPER}} .plan-price-shape' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
493
+ ],
494
+ ]
495
+ );
496
+
497
+ $this->add_responsive_control(
498
+ 'price_box_padding',
499
+ [
500
+ 'label' => __( 'Price Box Padding', 'elementor' ),
501
+ 'type' => Controls_Manager::DIMENSIONS,
502
+ 'size_units' => [ 'px', 'em', '%' ],
503
+ 'selectors' => [
504
+ '{{WRAPPER}} .plan-price-shape-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
505
+ ],
506
+ ]
507
+ );
508
+
509
+
510
+ $this->add_group_control(
511
+ Group_Control_Background::get_type(),
512
+ [
513
+ 'name' => 'price_box_section_bg',
514
+ 'label' => __( 'Section Background', 'elementor' ),
515
+ 'types' => [ 'classic' ,'gradient'],
516
+ 'selector' => '{{WRAPPER}} .plan-price-block',
517
+ ]
518
+ );
519
+
520
+
521
+ $this->end_controls_section();
522
+
523
+ $this->start_controls_section(
524
+ 'section-features-style',
525
+ [
526
+ 'label' => __( 'Feature List', 'elementor' ),
527
+ 'tab' => Controls_Manager::TAB_STYLE,
528
+ ]
529
+ );
530
+
531
+ $this->add_control(
532
+ 'features_text_color',
533
+ [
534
+ 'label' => __( 'Features Color', 'elementor' ),
535
+ 'type' => Controls_Manager::COLOR,
536
+ 'scheme' => [
537
+ 'type' => Scheme_Color::get_type(),
538
+ 'value' => Scheme_Color::COLOR_1,
539
+ ],
540
+ 'default' => '#FFF',
541
+ 'selectors' => [
542
+ '{{WRAPPER}} .eae-pt-feature-list li' => 'color: {{VALUE}};',
543
+ ],
544
+ ]
545
+ );
546
+
547
+ $this->add_group_control(
548
+ Group_Control_Typography::get_type(),
549
+ [
550
+ 'name' => 'features_typography',
551
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
552
+ 'selector' => '{{WRAPPER}} .eae-pt-feature-list li',
553
+ ]
554
+ );
555
+
556
+
557
+ $this->add_group_control(
558
+ Group_Control_Background::get_type(),
559
+ [
560
+ 'name' => 'feature_section_bg',
561
+ 'label' => __( 'Section Background', 'elementor' ),
562
+ 'types' => [ 'classic','gradient' ],
563
+ 'selector' => '{{WRAPPER}} .plan-features-wrapper',
564
+ ]
565
+ );
566
+
567
+ $this->add_responsive_control(
568
+ 'feature_align',
569
+ [
570
+ 'label' => __( 'Alignment', 'elementor' ),
571
+ 'type' => Controls_Manager::CHOOSE,
572
+ 'options' => [
573
+ 'left' => [
574
+ 'title' => __( 'Left', 'elementor' ),
575
+ 'icon' => 'fa fa-align-left',
576
+ ],
577
+ 'center' => [
578
+ 'title' => __( 'Center', 'elementor' ),
579
+ 'icon' => 'fa fa-align-center',
580
+ ],
581
+ 'right' => [
582
+ 'title' => __( 'Right', 'elementor' ),
583
+ 'icon' => 'fa fa-align-right',
584
+ ]
585
+ ],
586
+ 'default' => 'center',
587
+ 'selectors' => [
588
+ '{{WRAPPER}} .plan-features-wrapper .eae-pt-feature-list' => 'text-align: {{VALUE}};',
589
+ ]
590
+ ]
591
+ );
592
+
593
+ $this->end_controls_section();
594
+
595
+ $this->start_controls_section(
596
+ 'section-action-button',
597
+ [
598
+ 'label' => __( 'Action Button', 'elementor' ),
599
+ 'tab' => Controls_Manager::TAB_STYLE,
600
+ ]
601
+ );
602
+
603
+ $this->add_control(
604
+ 'button-section-bg',
605
+ [
606
+ 'label' => __( 'Section Background', 'elementor' ),
607
+ 'type' => Controls_Manager::COLOR,
608
+ 'scheme' => [
609
+ 'type' => Scheme_Color::get_type(),
610
+ 'value' => Scheme_Color::COLOR_1,
611
+ ],
612
+ 'default' => '#333333',
613
+ 'selectors' => [
614
+ '{{WRAPPER}} .eae-pt-button-wrapper' => 'background-color: {{VALUE}};',
615
+ ],
616
+ ]
617
+ );
618
+
619
+ $this->add_control(
620
+ 'button_text_color',
621
+ [
622
+ 'label' => __( 'Text Color', 'elementor' ),
623
+ 'type' => Controls_Manager::COLOR,
624
+ 'default' => '#fff',
625
+ 'selectors' => [
626
+ '{{WRAPPER}} .eae-pt-action-button' => 'color: {{VALUE}};',
627
+ ],
628
+ ]
629
+ );
630
+
631
+ $this->add_group_control(
632
+ Group_Control_Typography::get_type(),
633
+ [
634
+ 'name' => 'typography',
635
+ 'label' => __( 'Typography', 'elementor' ),
636
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
637
+ 'selector' => '{{WRAPPER}} .eae-pt-action-button',
638
+ ]
639
+ );
640
+
641
+ $this->add_control(
642
+ 'background_color',
643
+ [
644
+ 'label' => __( 'Background Color', 'elementor' ),
645
+ 'type' => Controls_Manager::COLOR,
646
+ 'scheme' => [
647
+ 'type' => Scheme_Color::get_type(),
648
+ 'value' => Scheme_Color::COLOR_4,
649
+ ],
650
+ 'default' => '#93C64F',
651
+ 'selectors' => [
652
+ '{{WRAPPER}} .eae-pt-action-button' => 'background-color: {{VALUE}};',
653
+ ],
654
+ ]
655
+ );
656
+
657
+ $this->add_group_control(
658
+ Group_Control_Background::get_type(),
659
+ [
660
+ 'name' => 'action_section_bg',
661
+ 'label' => __( 'Section Background', 'elementor' ),
662
+ 'types' => [ 'classic','gradient' ],
663
+ 'selector' => '{{WRAPPER}} .eae-pt-button-wrapper',
664
+ 'default' => [
665
+ 'background' => 'classic',
666
+ 'color' => '#555'
667
+ ]
668
+ ]
669
+ );
670
+
671
+ $this->add_group_control(
672
+ Group_Control_Border::get_type(),
673
+ [
674
+ 'name' => 'border',
675
+ 'label' => __( 'Border', 'elementor' ),
676
+ 'placeholder' => '1px',
677
+ 'default' => '1px',
678
+ 'selector' => '{{WRAPPER}} .eae-pt-action-button',
679
+ ]
680
+ );
681
+
682
+ $this->add_control(
683
+ 'border_radius',
684
+ [
685
+ 'label' => __( 'Border Radius', 'elementor' ),
686
+ 'type' => Controls_Manager::DIMENSIONS,
687
+ 'size_units' => [ 'px', '%' ],
688
+ 'selectors' => [
689
+ '{{WRAPPER}} .eae-pt-action-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
690
+ ],
691
+ ]
692
+ );
693
+
694
+ $this->add_control(
695
+ 'text_padding',
696
+ [
697
+ 'label' => __( 'Text Padding', 'elementor' ),
698
+ 'type' => Controls_Manager::DIMENSIONS,
699
+ 'size_units' => [ 'px', 'em', '%' ],
700
+ 'selectors' => [
701
+ '{{WRAPPER}} .eae-pt-action-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
702
+ ],
703
+ ]
704
+ );
705
+
706
+ $this->end_controls_section();
707
+
708
+ $this->start_controls_section(
709
+ 'section_hover',
710
+ [
711
+ 'label' => __( 'Button Hover', 'elementor' ),
712
+ 'type' => Controls_Manager::SECTION,
713
+ 'tab' => Controls_Manager::TAB_STYLE,
714
+ ]
715
+ );
716
+
717
+ $this->add_control(
718
+ 'hover_color',
719
+ [
720
+ 'label' => __( 'Text Color', 'elementor' ),
721
+ 'type' => Controls_Manager::COLOR,
722
+ 'selectors' => [
723
+ '{{WRAPPER}} .eae-pt-action-button:hover' => 'color: {{VALUE}};',
724
+ ],
725
+ ]
726
+ );
727
+
728
+ $this->add_control(
729
+ 'button_background_hover_color',
730
+ [
731
+ 'label' => __( 'Background Color', 'elementor' ),
732
+ 'type' => Controls_Manager::COLOR,
733
+ 'selectors' => [
734
+ '{{WRAPPER}} .eae-pt-action-button:hover' => 'background-color: {{VALUE}};',
735
+ ],
736
+ ]
737
+ );
738
+
739
+ $this->add_control(
740
+ 'button_hover_border_color',
741
+ [
742
+ 'label' => __( 'Border Color', 'elementor' ),
743
+ 'type' => Controls_Manager::COLOR,
744
+ 'condition' => [
745
+ 'border_border!' => '',
746
+ ],
747
+ 'selectors' => [
748
+ '{{WRAPPER}} .eae-pt-action-button:hover' => 'border-color: {{VALUE}};',
749
+ ],
750
+ ]
751
+ );
752
+
753
+ $this->end_controls_section();
754
+
755
+
756
+
757
+
758
+
759
+ }
760
+
761
+ protected function render( ) {
762
+ $settings = $this->get_settings();
763
+
764
+ $this->add_render_attribute('heading','class','eae-pt-heading');
765
+ $this->add_render_attribute('sub_heading','class','eae-pt-sub-heading');
766
+ $this->add_render_attribute('button','class','eae-pt-action-button');
767
+ $this->add_render_attribute( 'icon-align', 'class', 'eae-pt-align-icon-' . $settings['icon_align'] );
768
+
769
+ if ( ! empty( $settings['link']['url'] ) ) {
770
+ $this->add_render_attribute( 'button', 'href', $settings['link']['url'] );
771
+
772
+ if ( ! empty( $settings['link']['is_external'] ) ) {
773
+ $this->add_render_attribute( 'button', 'target', '_blank' );
774
+ }
775
+ }
776
+
777
+
778
+ ?>
779
+ <div class="wts-price-box-wrapper">
780
+ <?php
781
+ if(!empty($settings['heading']) || !empty($settings['heading'])) {
782
+ ?>
783
+ <div class="heading-wrapper">
784
+ <?php if(!empty($settings['heading'])){
785
+ ?>
786
+ <<?php echo $settings['heading_tag']; ?> <?php echo $this->get_render_attribute_string('heading'); ?>>
787
+ <?php echo $settings['heading']; ?>
788
+ </<?php echo $settings['heading_tag'] ?>>
789
+ <?php
790
+ } ?>
791
+
792
+ <?php if(!empty($settings['sub-heading'])){
793
+ ?>
794
+ <<?php echo $settings['sub_heading_tag']; ?> <?php echo $this->get_render_attribute_string('sub_heading'); ?>>
795
+ <?php echo $settings['sub-heading']; ?>
796
+ </<?php echo $settings['sub_heading_tag'] ?>>
797
+ <?php
798
+ } ?>
799
+ </div>
800
+ <?php
801
+ }
802
+
803
+ if(!empty($settings['price-box-text']) || !empty($settings['price-box-subtext'])){
804
+ ?>
805
+ <div class="plan-price-block">
806
+ <div class="plan-price-shape">
807
+ <div class="plan-price-shape-inner">
808
+ <?php if(!empty($settings['price-box-text'])){ ?>
809
+ <span class="price-text"><?php echo $settings['price-box-text']; ?></span>
810
+ <?php } ?>
811
+
812
+ <?php if(!empty($settings['price-box-subtext'])){ ?>
813
+ <span class="price-subtext"><?php echo $settings['price-box-subtext']; ?></span>
814
+ <?php } ?>
815
+ </div>
816
+ </div>
817
+ </div>
818
+
819
+ <?php
820
+ }
821
+
822
+ if(count($settings['feature-list'])){
823
+ ?>
824
+ <div class="plan-features-wrapper">
825
+ <ul class="eae-pt-feature-list">
826
+ <?php
827
+ foreach($settings['feature-list'] as $feature){
828
+ ?>
829
+ <li class="<?php echo ($feature['available'] == 'yes')? '':'strike-feature'; ?>"><?php echo $feature['text']; ?></li>
830
+ <?php
831
+ }
832
+ ?>
833
+ </ul>
834
+ </div>
835
+ <?php
836
+ }
837
+
838
+ if(!empty($settings['action_text'])){
839
+ ?>
840
+ <div class="eae-pt-button-wrapper">
841
+ <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>
842
+ <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>>
843
+ <?php if ( ! empty( $settings['icon'] ) ) : ?>
844
+ <span <?php echo $this->get_render_attribute_string( 'icon-align' ); ?>>
845
+ <i class="<?php echo esc_attr( $settings['icon'] ); ?>"></i>
846
+ </span>
847
+ <?php endif; ?>
848
+ <span class="elementor-button-text"><?php echo $settings['action_text']; ?></span>
849
+ </span>
850
+ </a>
851
+ </div>
852
+ <?php
853
+ }
854
+ ?>
855
+ </div> <!-- close .wts-price-box-wrapper -->
856
+ <?php
857
+ }
858
+
859
+ protected function content_template() {
860
+ ?>
861
+ <#
862
+
863
+ box_html = '';
864
+
865
+ print( separator_html );
866
+ #>
867
+ <?php
868
+ }
869
+ }
870
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_PriceTable() );
elements/shape-separator.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_ShapeSeparator extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-shape-separator';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Shape Separator', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-divider-shape wts-eae-pe';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'wts-eae' ];
22
+ }
23
+
24
+ protected function _register_controls() {
25
+
26
+ $this->start_controls_section(
27
+ 'section_shape',
28
+ [
29
+ 'label' => __( 'Shape', 'elementor' )
30
+ ]
31
+ );
32
+
33
+ $this->add_control(
34
+ 'separator_shape',
35
+ [
36
+ 'label' => __( 'Shape', 'elementor' ),
37
+ 'type' => Controls_Manager::SELECT,
38
+ 'options' => [
39
+ 'triangle-upper-left' => __( 'Triangle Upper Left', 'elementor' ),
40
+ 'triangle-upper-right' => __( 'Triangle Upper Right', 'elementor' ),
41
+ 'triangle-bottom-left' => __( 'Triangle Bottom Left', 'elementor' ),
42
+ 'triangle-bottom-right' => __( 'Triangle Bottom Right', 'elementor' ),
43
+ ],
44
+ 'default' => 'triangle-upper-right',
45
+
46
+ ]
47
+ );
48
+
49
+ $this->add_control(
50
+ 'shape_color',
51
+ [
52
+ 'label' => __( 'Shape Color', 'elementor' ),
53
+ 'type' => Controls_Manager::COLOR,
54
+ 'scheme' => [
55
+ 'type' => Scheme_Color::get_type(),
56
+ 'value' => Scheme_Color::COLOR_1,
57
+ ],
58
+ 'selectors' => [
59
+ '{{WRAPPER}} svg' => 'fill:{{VALUE}}',
60
+ ],
61
+ ]
62
+ );
63
+
64
+ $this->add_control(
65
+ 'shape_height',
66
+ [
67
+ 'type' => Controls_Manager::NUMBER,
68
+ 'label' => __( 'Shape Height (in px)', 'elementor' ),
69
+ 'placeholder' => __( '75', 'elementor' ),
70
+ 'default' => __( '75', 'elementor' ),
71
+ ]
72
+ );
73
+
74
+ $this->end_controls_section();
75
+ }
76
+
77
+ protected function render( ) {
78
+ $settings = $this->get_settings();
79
+ include ELEMENTOR_ADDON_PATH.'elements/shape-separator/'.$settings['separator_shape'].'.php';
80
+ }
81
+
82
+
83
+ }
84
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_ShapeSeparator() );
elements/shape-separator/triangle-bottom-left.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" fill="<?php echo $settings['shape_color']; ?>" width="100%" height="90" viewBox="0 0 50 50" stroke="<?php echo $settings['shape_color']; ?>" stroke-width="1" preserveAspectRatio="none" style="height: <?php echo $settings['shape_height']; ?>px;">
2
+ <polygon points="0,0 0,50 50,50"></polygon>
3
+ </svg>
elements/shape-separator/triangle-bottom-right.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" fill="<?php echo $settings['shape_color']; ?>" width="100%" height="90" viewBox="0 0 50 50" preserveAspectRatio="none" style="height: <?php echo $settings['shape_height']; ?>px;">
2
+ <polygon class="fil0" points="0,50 50,50 50,0"></polygon>
3
+ </svg>
elements/shape-separator/triangle-upper-left.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" fill="<?php echo $settings['shape_color']; ?>" width="100%" height="90" viewBox="0 0 50 50" preserveAspectRatio="none" style="height: <?php echo $settings['shape_height']; ?>px;">
2
+ <polygon class="fil0" points="0,0 50,0 0,50"></polygon>
3
+ </svg>
elements/shape-separator/triangle-upper-right.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" fill="<?php echo $settings['shape_color']; ?>" width="100%" height="90" viewBox="0 0 50 50" preserveAspectRatio="none" style="height: <?php echo $settings['shape_height']; ?>px;">
2
+ <polygon class="fil0" points="0,0 50,0 50,50"></polygon>
3
+ </svg>
elements/splittext.php ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_SplitText extends Widget_Base {
7
+ public function get_name() {
8
+ return 'wts-splittext';
9
+ }
10
+
11
+ public function get_title() {
12
+ return __( 'EAE - Split Text', 'elementor' );
13
+ }
14
+
15
+ public function get_icon() {
16
+ return 'eicon-dual-button wts-eae-pe';
17
+ }
18
+
19
+ public function get_categories() {
20
+ return [ 'wts-eae' ];
21
+ }
22
+
23
+ protected function _register_controls() {
24
+ $this->start_controls_section(
25
+ 'section_general',
26
+ [
27
+ 'label' => __( 'General', 'elementor' )
28
+ ]
29
+ );
30
+
31
+
32
+ $this->add_responsive_control(
33
+ 'text-align',
34
+ [
35
+ 'label' => __( 'Alignment', 'elementor' ),
36
+ 'type' => Controls_Manager::CHOOSE,
37
+ 'options' => [
38
+ 'left' => [
39
+ 'title' => __( 'Left', 'elementor' ),
40
+ 'icon' => 'fa fa-align-left',
41
+ ],
42
+ 'center' => [
43
+ 'title' => __( 'Center', 'elementor' ),
44
+ 'icon' => 'fa fa-align-center',
45
+ ],
46
+ 'right' => [
47
+ 'title' => __( 'Right', 'elementor' ),
48
+ 'icon' => 'fa fa-align-right',
49
+ ]
50
+ ],
51
+ 'default' => '',
52
+ 'selectors' => [
53
+ '{{WRAPPER}} .eae-st-transform-text' => 'text-align: {{VALUE}};',
54
+ ]
55
+ ]
56
+ );
57
+
58
+ $this->add_control(
59
+ 'split_mode',
60
+ [
61
+ 'label' => __( 'Split Mode', 'elementor' ),
62
+ 'type' => Controls_Manager::SELECT,
63
+ 'options' => [
64
+ 'text' => __( 'Letter', 'elementor' ),
65
+ 'word' => __( 'Word', 'elementor' )
66
+ ],
67
+ 'default' => 'word',
68
+ ]
69
+ );
70
+
71
+ $this->add_control(
72
+ 'split_count',
73
+ [
74
+ 'label' => __( 'Split Count', 'elementor' ),
75
+ 'type' => Controls_Manager::TEXT,
76
+ 'default' => '2',
77
+ 'placeholder' => __( 'Count', 'elementor' ),
78
+ ]
79
+ );
80
+
81
+ $this->add_control(
82
+ 'title_size',
83
+ [
84
+ 'label' => __( 'HTML Tag', 'elementor' ),
85
+ 'type' => Controls_Manager::SELECT,
86
+ 'options' => [
87
+ 'h1' => __( 'H1', 'elementor' ),
88
+ 'h2' => __( 'H2', 'elementor' ),
89
+ 'h3' => __( 'H3', 'elementor' ),
90
+ 'h4' => __( 'H4', 'elementor' ),
91
+ 'h5' => __( 'H5', 'elementor' ),
92
+ 'h6' => __( 'H6', 'elementor' ),
93
+ 'div' => __( 'div', 'elementor' ),
94
+ 'span' => __( 'span', 'elementor' ),
95
+ 'p' => __( 'p', 'elementor' ),
96
+ ],
97
+ 'default' => 'h3',
98
+ ]
99
+ );
100
+
101
+ $this->add_control(
102
+ 'text',
103
+ [
104
+ 'label' => __( 'Text', 'elementor' ),
105
+ 'type' => Controls_Manager::TEXTAREA,
106
+ 'placeholder' => __( 'Enter text', 'elementor' ),
107
+ 'default' => __( 'I Love Elementor', 'elementor' ),
108
+ ]
109
+ );
110
+
111
+
112
+
113
+
114
+ $this->end_controls_section();
115
+
116
+ $this->start_controls_section(
117
+ 'section_split_text_style',
118
+ [
119
+ 'label' => __( 'Part 1', 'elementor' ),
120
+ 'tab' => Controls_Manager::TAB_STYLE,
121
+ ]
122
+ );
123
+
124
+
125
+ $this->add_control(
126
+ 'split_text_color',
127
+ [
128
+ 'label' => __( 'Text Color', 'elementor' ),
129
+ 'type' => Controls_Manager::COLOR,
130
+ 'scheme' => [
131
+ 'type' => Scheme_Color::get_type(),
132
+ 'value' => Scheme_Color::COLOR_1,
133
+ ],
134
+ 'selectors' => [
135
+ '{{WRAPPER}} .eae-st-split-text' => 'color: {{VALUE}};',
136
+ ],
137
+ ]
138
+ );
139
+
140
+
141
+ $this->add_group_control(
142
+ Group_Control_Typography::get_type(),
143
+ [
144
+ 'name' => 'split_text_typography',
145
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
146
+ 'selector' => '{{WRAPPER}} .eae-st-split-text',
147
+ ]
148
+ );
149
+
150
+ $this->add_group_control(
151
+ Group_Control_Border::get_type(),
152
+ [
153
+ 'name' => 'split_text_border',
154
+ 'label' => __( 'Box Border', 'elementor' ),
155
+ 'selector' => '{{WRAPPER}} .eae-st-split-text',
156
+ ]
157
+ );
158
+
159
+
160
+
161
+ $this->add_control(
162
+ 'split_text_box_border_radius',
163
+ [
164
+ 'label' => __( 'Border Radius', 'elementor' ),
165
+ 'type' => Controls_Manager::DIMENSIONS,
166
+ 'size_units' => [ 'px', '%' ],
167
+ 'selectors' => [
168
+ '{{WRAPPER}} .eae-st-split-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
169
+ ],
170
+ ]
171
+ );
172
+
173
+ $this->add_control(
174
+ 'split_text_box_padding',
175
+ [
176
+ 'label' => __( 'Padding', 'elementor' ),
177
+ 'type' => Controls_Manager::DIMENSIONS,
178
+ 'size_units' => [ 'px', '%' ],
179
+ 'selectors' => [
180
+ '{{WRAPPER}} .eae-st-split-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
181
+ ],
182
+ ]
183
+ );
184
+ $this->add_control(
185
+ 'split_text_box_margin',
186
+ [
187
+ 'label' => __( 'Margin', 'elementor' ),
188
+ 'type' => Controls_Manager::DIMENSIONS,
189
+ 'size_units' => [ 'px', '%' ],
190
+ 'selectors' => [
191
+ '{{WRAPPER}} .eae-st-split-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
192
+ ],
193
+ ]
194
+ );
195
+
196
+ $this->add_group_control(
197
+ Group_Control_Background::get_type(),
198
+ [
199
+ 'name' => 'split_text_section_bg',
200
+ 'label' => __( 'Text Background', 'elementor' ),
201
+ 'types' => [ 'none','classic','gradient' ],
202
+ 'selector' => '{{WRAPPER}} .eae-st-split-text',
203
+ ]
204
+ );
205
+
206
+
207
+ $this->end_controls_section();
208
+
209
+ $this->start_controls_section(
210
+ 'section_rest_text_style',
211
+ [
212
+ 'label' => __( 'Part 2', 'elementor' ),
213
+ 'tab' => Controls_Manager::TAB_STYLE,
214
+ ]
215
+ );
216
+
217
+ $this->add_control(
218
+ 'rest_text_color',
219
+ [
220
+ 'label' => __( 'Text Color', 'elementor' ),
221
+ 'type' => Controls_Manager::COLOR,
222
+ 'scheme' => [
223
+ 'type' => Scheme_Color::get_type(),
224
+ 'value' => Scheme_Color::COLOR_2,
225
+ ],
226
+ 'selectors' => [
227
+ '{{WRAPPER}} .eae-st-rest-text' => 'color: {{VALUE}};',
228
+ ],
229
+ ]
230
+ );
231
+
232
+ $this->add_group_control(
233
+ Group_Control_Typography::get_type(),
234
+ [
235
+ 'name' => 'rest_text_typography',
236
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
237
+ 'selector' => '{{WRAPPER}} .eae-st-rest-text',
238
+ ]
239
+ );
240
+ $this->add_group_control(
241
+ Group_Control_Border::get_type(),
242
+ [
243
+ 'name' => 'rest_text_border',
244
+ 'label' => __( 'Box Border', 'elementor' ),
245
+ 'selector' => '{{WRAPPER}} .eae-st-rest-text',
246
+ ]
247
+ );
248
+
249
+
250
+
251
+ $this->add_control(
252
+ 'rest_text_box_border_radius',
253
+ [
254
+ 'label' => __( 'Border Radius', 'elementor' ),
255
+ 'type' => Controls_Manager::DIMENSIONS,
256
+ 'size_units' => [ 'px', '%' ],
257
+ 'selectors' => [
258
+ '{{WRAPPER}} .eae-st-rest-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
259
+ ],
260
+ ]
261
+ );
262
+
263
+ $this->add_control(
264
+ 'rest_text_box_padding',
265
+ [
266
+ 'label' => __( 'Padding', 'elementor' ),
267
+ 'type' => Controls_Manager::DIMENSIONS,
268
+ 'size_units' => [ 'px', '%' ],
269
+ 'selectors' => [
270
+ '{{WRAPPER}} .eae-st-rest-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
271
+ ],
272
+ ]
273
+ );
274
+ $this->add_control(
275
+ 'rest_text_box_margin',
276
+ [
277
+ 'label' => __( 'Margin', 'elementor' ),
278
+ 'type' => Controls_Manager::DIMENSIONS,
279
+ 'size_units' => [ 'px', '%' ],
280
+ 'selectors' => [
281
+ '{{WRAPPER}} .eae-st-rest-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
282
+ ],
283
+ ]
284
+ );
285
+
286
+ $this->add_group_control(
287
+ Group_Control_Background::get_type(),
288
+ [
289
+ 'name' => 'rest_text_section_bg',
290
+ 'label' => __( 'Text Background', 'elementor' ),
291
+ 'types' => [ 'none','classic','gradient' ],
292
+ 'selector' => '{{WRAPPER}} .eae-st-rest-text',
293
+ ]
294
+ );
295
+
296
+ $this->end_controls_section();
297
+
298
+ }
299
+ protected function render(){
300
+ $settings = $this->get_settings();
301
+
302
+ $this->add_render_attribute('eae-st-transform-text-wrapper','class','eae-st-transform-text-wrapper');
303
+
304
+ $this->add_render_attribute('eae-st-transform-text-wrapper','class','waiting');
305
+
306
+ $this->add_render_attribute('eae-st-transform-text','class','eae-st-transform-text');
307
+
308
+ $this->add_render_attribute('eae-st-split-text','class','eae-st-split-text');
309
+
310
+ $this->add_render_attribute('eae-st-split-full-text','class','eae-st-split-text eae-st-full-text');
311
+
312
+ $this->add_render_attribute('eae-st-rest-text','class','eae-st-rest-text');
313
+
314
+ ?>
315
+ <div id="eae-at-<?php echo $this->get_id(); ?>" class="eae-st-transform-text-wrapper">
316
+ <div <?php echo $this->get_render_attribute_string( 'eae-st-transform-text' ); ?>>
317
+ <?php if($settings['split_mode'] == 'text'){ ?>
318
+ <?php echo sprintf('<%1$s class="eae-st-transform-text-title">%2$s</%1$s>', $settings['title_size'], "<div ".$this->get_render_attribute_string( 'eae-st-split-text' ).">".substr($settings['text'], 0, $settings['split_count'])."</div><div ".$this->get_render_attribute_string( 'eae-st-rest-text' ).">".substr($settings['text'], $settings['split_count'], strlen($settings['text']) - $settings['split_count'])."</div>"); ?>
319
+ <?php } else { ?>
320
+ <?php
321
+ $arr = explode(" ", $settings['text']);
322
+ if(count($arr) <= $settings['split_count']){
323
+ $split_text = "<div " . $this->get_render_attribute_string( 'eae-st-split-full-text' ) . ">".$settings['text']."</div>";
324
+ echo sprintf('<%1$s class="eae-st-transform-text-title">%2$s</%1$s>', $settings['title_size'], $split_text) ;
325
+ }else{
326
+ $split_text = "<div " . $this->get_render_attribute_string( 'eae-st-split-text' ) . ">" . implode(" ", array_slice($arr, 0, $settings['split_count'])) . "&nbsp;</div>";
327
+ $rest_text = "<div " . $this->get_render_attribute_string( 'eae-st-rest-text' ) . ">" . implode(" ", array_slice($arr, $settings['split_count'], count($arr))) . "</div>";
328
+ echo sprintf('<%1$s class="eae-st-transform-text-title">%2$s</%1$s>', $settings['title_size'], $split_text.$rest_text);
329
+ }
330
+ ?>
331
+ <?php } ?>
332
+ </div>
333
+ </div>
334
+ <?php
335
+ }
336
+
337
+ }
338
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_SplitText() );
339
+ ?>
elements/textseparator.php ADDED
@@ -0,0 +1,531 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Widget_TextSeparator extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'wts-textseparator';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'EAE - Text Separator', 'elementor' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'eicon-divider wts-eae-pe';
18
+ }
19
+
20
+
21
+ public function get_categories() {
22
+ return [ 'wts-eae' ];
23
+ }
24
+
25
+
26
+
27
+
28
+ protected function _register_controls() {
29
+ $this->start_controls_section(
30
+ 'section_title',
31
+ [
32
+ 'label' => __( 'Title', 'elementor' )
33
+ ]
34
+ );
35
+
36
+ $this->add_control(
37
+ 'title',
38
+ [
39
+ 'label' => __( 'Title', 'elementor' ),
40
+ 'type' => Controls_Manager::TEXTAREA,
41
+ 'dynamic' => [
42
+ 'active' => true,
43
+ ],
44
+ 'label_block' => true,
45
+ 'placeholder' => __( 'Enter text', 'elementor' ),
46
+ 'default' => __( 'This is text separator', 'elementor' )
47
+ ]
48
+ );
49
+
50
+ $this->add_control(
51
+ 'html_tag',
52
+ [
53
+ 'label' => __( 'HTML Tag', 'elementor' ),
54
+ 'type' => Controls_Manager::SELECT,
55
+ 'options' => [
56
+ 'h1' => __( 'H1', 'elementor' ),
57
+ 'h2' => __( 'H2', 'elementor' ),
58
+ 'h3' => __( 'H3', 'elementor' ),
59
+ 'h4' => __( 'H4', 'elementor' ),
60
+ 'h5' => __( 'H5', 'elementor' ),
61
+ 'h6' => __( 'H6', 'elementor' ),
62
+ 'div' => __( 'div', 'elementor' ),
63
+ 'span' => __( 'span', 'elementor' ),
64
+ 'p' => __( 'p', 'elementor' ),
65
+ ],
66
+ 'default' => 'h2',
67
+ ]
68
+ );
69
+
70
+ $this->add_responsive_control(
71
+ 'align',
72
+ [
73
+ 'label' => __( 'Alignment', 'elementor' ),
74
+ 'type' => Controls_Manager::CHOOSE,
75
+ 'options' => [
76
+ 'left' => [
77
+ 'title' => __( 'Left', 'elementor' ),
78
+ 'icon' => 'fa fa-align-left',
79
+ ],
80
+ 'center' => [
81
+ 'title' => __( 'Center', 'elementor' ),
82
+ 'icon' => 'fa fa-align-center',
83
+ ],
84
+ 'right' => [
85
+ 'title' => __( 'Right', 'elementor' ),
86
+ 'icon' => 'fa fa-align-right',
87
+ ]
88
+ ],
89
+ 'default' => 'center'
90
+ ]
91
+ );
92
+
93
+ $this->end_controls_section();
94
+
95
+ $this->start_controls_section(
96
+ 'section_icon',
97
+ [
98
+ 'label' => __( 'Icon', 'elementor' ),
99
+ 'type' => Controls_Manager::SECTION,
100
+ ]
101
+ );
102
+
103
+
104
+ $this->add_control(
105
+ 'icon',
106
+ [
107
+ 'label' => __( 'Icon', 'elementor' ),
108
+ 'type' => Controls_Manager::ICON,
109
+ 'label_block' => true,
110
+ 'default' => 'fa fa-star'
111
+ ]
112
+ );
113
+
114
+ $this->add_control(
115
+ 'view',
116
+ [
117
+ 'label' => __( 'View', 'elementor' ),
118
+ 'type' => Controls_Manager::SELECT,
119
+ 'options' => [
120
+ 'default' => __( 'Default', 'elementor' ),
121
+ 'stacked' => __( 'Stacked', 'elementor' ),
122
+ 'framed' => __( 'Framed', 'elementor' ),
123
+ ],
124
+ 'default' => 'default',
125
+ 'prefix_class' => 'eae-icon-view-',
126
+ ]
127
+ );
128
+
129
+ $this->add_control(
130
+ 'shape',
131
+ [
132
+ 'label' => __( 'Shape', 'elementor' ),
133
+ 'type' => Controls_Manager::SELECT,
134
+ 'options' => [
135
+ 'circle' => __( 'Circle', 'elementor' ),
136
+ 'square' => __( 'Square', 'elementor' ),
137
+ ],
138
+ 'default' => 'circle',
139
+ 'condition' => [
140
+ 'view!' => 'default',
141
+ ],
142
+ 'prefix_class' => 'eae-icon-shape-',
143
+ ]
144
+ );
145
+
146
+ $this->add_control(
147
+ 'icon_position',
148
+ [
149
+ 'label' => __('Icon Position','wts_eae'),
150
+ 'type' => Controls_Manager::SELECT,
151
+ 'options' => [
152
+ 'before' => __( 'Before Text', 'elementor' ),
153
+ 'after' => __( 'After Text', 'elementor' )
154
+ ],
155
+ 'default' => 'before',
156
+ ]
157
+ );
158
+
159
+ $this->end_controls_section();
160
+
161
+ $this->start_controls_section(
162
+ 'section_divider',
163
+ [
164
+ 'label' => __( 'Divider', 'elementor' ),
165
+ 'type' => Controls_Manager::SECTION,
166
+ ]
167
+ );
168
+
169
+ $this->add_control(
170
+ 'style',
171
+ [
172
+ 'label' => __( 'Style', 'elementor' ),
173
+ 'type' => Controls_Manager::SELECT,
174
+ 'options' => [
175
+ 'solid' => __( 'Solid', 'elementor' ),
176
+ 'double' => __( 'Double', 'elementor' ),
177
+ 'dotted' => __( 'Dotted', 'elementor' ),
178
+ 'dashed' => __( 'Dashed', 'elementor' ),
179
+ ],
180
+ 'default' => 'solid',
181
+ 'selectors' => [
182
+ '{{WRAPPER}} .wts-eae-textseparator .eae-sep-holder .eae-sep-lines' => 'border-top-style: {{VALUE}};',
183
+ ],
184
+ ]
185
+ );
186
+
187
+ $this->add_control(
188
+ 'weight',
189
+ [
190
+ 'label' => __( 'Weight', 'elementor' ),
191
+ 'type' => Controls_Manager::SLIDER,
192
+ 'default' => [
193
+ 'size' => 1,
194
+ ],
195
+ 'range' => [
196
+ 'px' => [
197
+ 'min' => 1,
198
+ 'max' => 10,
199
+ ],
200
+ ],
201
+ 'selectors' => [
202
+ '{{WRAPPER}} .wts-eae-textseparator .eae-sep-holder .eae-sep-lines' => 'border-top-width: {{SIZE}}{{UNIT}};',
203
+ ],
204
+ ]
205
+ );
206
+
207
+
208
+
209
+
210
+ $this->end_controls_section();
211
+
212
+ $this->start_controls_section(
213
+ 'section_title_style',
214
+ [
215
+ 'label' => __( 'Title', 'elementor' ),
216
+ 'tab' => Controls_Manager::TAB_STYLE
217
+ ]
218
+ );
219
+
220
+ $this->add_control(
221
+ 'title_color',
222
+ [
223
+ 'label' => __( 'Text Color', 'elementor' ),
224
+ 'type' => Controls_Manager::COLOR,
225
+ 'scheme' => [
226
+ 'type' => Scheme_Color::get_type(),
227
+ 'value' => Scheme_Color::COLOR_1,
228
+ ],
229
+ 'selectors' => [
230
+ '{{WRAPPER}} .eae-separator-title' => 'color: {{VALUE}};',
231
+ ],
232
+ ]
233
+ );
234
+
235
+ $this->add_group_control(
236
+ Group_Control_Typography::get_type(),
237
+ [
238
+ 'name' => 'typography',
239
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
240
+ 'selector' => '{{WRAPPER}} .eae-separator-title',
241
+ ]
242
+ );
243
+
244
+ $this->end_controls_section();
245
+ $this->start_controls_section(
246
+ 'section_divider_style',
247
+ [
248
+ 'label' => __( 'Divider', 'elementor' ),
249
+ 'tab' => Controls_Manager::TAB_STYLE,
250
+ ]
251
+ );
252
+
253
+ $this->add_control(
254
+ 'divider_color',
255
+ [
256
+ 'label' => __( 'Divider Color', 'elementor' ),
257
+ 'type' => Controls_Manager::COLOR,
258
+ 'scheme' => [
259
+ 'type' => Scheme_Color::get_type(),
260
+ 'value' => Scheme_Color::COLOR_1,
261
+ ],
262
+ 'selectors' => [
263
+ '{{WRAPPER}} .eae-sep-lines' => 'border-top-color: {{VALUE}};',
264
+ ],
265
+ ]
266
+ );
267
+
268
+ $this->add_responsive_control(
269
+ 'divider_width',
270
+ [
271
+ 'label' => __( 'Width', 'elementor' ),
272
+ 'type' => Controls_Manager::SLIDER,
273
+ 'size_units' => [ '%' ],
274
+ 'default' => [
275
+ 'size' => 100,
276
+ 'unit' => '%',
277
+ ],
278
+ 'range' => [
279
+ '%' => [
280
+ 'min' => 1,
281
+ 'max' => 100,
282
+ ],
283
+ ],
284
+ 'selectors' => [
285
+ '{{WRAPPER}} .wts-eae-textseparator' => 'width: {{SIZE}}{{UNIT}};',
286
+ ],
287
+ ]
288
+ );
289
+
290
+ $this->add_responsive_control(
291
+ 'divider_align',
292
+ [
293
+ 'label' => __( 'Alignment', 'elementor' ),
294
+ 'type' => Controls_Manager::CHOOSE,
295
+ 'options' => [
296
+ 'left' => [
297
+ 'title' => __( 'Left', 'elementor' ),
298
+ 'icon' => 'fa fa-align-left',
299
+ ],
300
+ '' => [
301
+ 'title' => __( 'Center', 'elementor' ),
302
+ 'icon' => 'fa fa-align-center',
303
+ ],
304
+ 'right' => [
305
+ 'title' => __( 'Right', 'elementor' ),
306
+ 'icon' => 'fa fa-align-right',
307
+ ]
308
+ ],
309
+ 'default' => '',
310
+ 'selectors' => [
311
+ '{{WRAPPER}} .wts-eae-textseparator' => 'float: {{VALUE}};',
312
+ ]
313
+ ]
314
+ );
315
+
316
+ $this->end_controls_section();
317
+ $this->start_controls_section(
318
+ 'section_icon_style',
319
+ [
320
+ 'label' => __( 'Icon', 'elementor' ),
321
+ 'tab' => Controls_Manager::TAB_STYLE,
322
+ ]
323
+ );
324
+
325
+ $this->add_control(
326
+ 'icon_primary_color',
327
+ [
328
+ 'label' => __( 'Primary Color', 'elementor' ),
329
+ 'type' => Controls_Manager::COLOR,
330
+ 'scheme' => [
331
+ 'type' => Scheme_Color::get_type(),
332
+ 'value' => Scheme_Color::COLOR_1,
333
+ ],
334
+ 'selectors' => [
335
+ '{{WRAPPER}} .eae-separator-icon-inner i' => 'color: {{VALUE}};',
336
+ ],
337
+ ]
338
+ );
339
+
340
+ $this->add_control(
341
+ 'icon_secondary_color',
342
+ [
343
+ 'label' => __( 'Secondary Color', 'elementor' ),
344
+ 'type' => Controls_Manager::COLOR,
345
+ 'scheme' => [
346
+ 'type' => Scheme_Color::get_type(),
347
+ 'value' => Scheme_Color::COLOR_1,
348
+ ],
349
+ 'selectors' => [
350
+ '{{WRAPPER}}.eae-icon-view-stacked .eae-separator-icon-inner' => 'background-color: {{VALUE}};',
351
+ '{{WRAPPER}}.eae-icon-view-framed .eae-separator-icon-inner, {{WRAPPER}}.eae-icon-view-default .eae-separator-icon-inner' => 'color: {{VALUE}}; border-color: {{VALUE}};',
352
+ ],
353
+ ]
354
+ );
355
+
356
+
357
+ $this->add_control(
358
+ 'size',
359
+ [
360
+ 'label' => __( 'Icon Size', 'elementor' ),
361
+ 'type' => Controls_Manager::SLIDER,
362
+ 'range' => [
363
+ 'px' => [
364
+ 'min' => 6,
365
+ 'max' => 300,
366
+ ],
367
+ ],
368
+ 'selectors' => [
369
+ '{{WRAPPER}} .eae-separator-icon-inner i' => 'font-size: {{SIZE}}{{UNIT}};',
370
+ ],
371
+ ]
372
+ );
373
+
374
+ $this->add_control(
375
+ 'icon_padding',
376
+ [
377
+ 'label' => __( 'Icon Padding', 'elementor' ),
378
+ 'type' => Controls_Manager::SLIDER,
379
+
380
+ 'selectors' => [
381
+ '{{WRAPPER}} .eae-separator-icon-inner' => 'padding: {{SIZE}}{{UNIT}};',
382
+ ],
383
+ 'default' => [
384
+ 'size' => 1.5,
385
+ 'unit' => 'em',
386
+ ],
387
+ 'range' => [
388
+ 'em' => [
389
+ 'min' => 0,
390
+ ],
391
+ ],
392
+ 'condition' => [
393
+ 'view!' => 'default',
394
+ ],
395
+ ]
396
+ );
397
+
398
+ $this->add_control(
399
+ 'rotate',
400
+ [
401
+ 'label' => __( 'Icon Rotate', 'elementor' ),
402
+ 'type' => Controls_Manager::SLIDER,
403
+ 'default' => [
404
+ 'size' => 0,
405
+ 'unit' => 'deg',
406
+ ],
407
+
408
+ 'selectors' => [
409
+ '{{WRAPPER}} .eae-separator-icon-inner i' => 'transform: rotate({{SIZE}}{{UNIT}});',
410
+ ],
411
+ ]
412
+ );
413
+
414
+ $this->add_control(
415
+ 'border_width',
416
+ [
417
+ 'label' => __( 'Border Width', 'elementor' ),
418
+ 'type' => Controls_Manager::DIMENSIONS,
419
+ 'selectors' => [
420
+ '{{WRAPPER}} .eae-separator-icon-inner' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
421
+ ],
422
+ 'condition' => [
423
+ 'view' => 'framed',
424
+ ],
425
+ ]
426
+ );
427
+
428
+ $this->add_control(
429
+ 'border_radius',
430
+ [
431
+ 'label' => __( 'Border Radius', 'elementor' ),
432
+ 'type' => Controls_Manager::DIMENSIONS,
433
+ 'size_units' => [ 'px', '%' ],
434
+ 'selectors' => [
435
+ '{{WRAPPER}} .eae-separator-icon-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
436
+ ],
437
+ 'condition' => [
438
+ 'view!' => 'default',
439
+ ],
440
+ ]
441
+ );
442
+ }
443
+
444
+ protected function render( ) {
445
+ $settings = $this->get_settings_for_display();
446
+
447
+ $this->add_render_attribute('separator_wrapper','class','wts-eae-textseparator');
448
+ $this->add_render_attribute('separator_wrapper','class','sep-align-'.$settings['align']);
449
+ if(!empty($settings['icon'])){
450
+ $this->add_render_attribute('separator_wrapper','class','icon-yes');
451
+ $this->add_render_attribute('separator_wrapper','class','icon-'.$settings['icon_position']);
452
+ }
453
+
454
+ if(!empty($settings['title'])){
455
+ $this->add_render_attribute('separator_wrapper','class','title-yes');
456
+ }
457
+
458
+ $this->add_render_attribute( 'title', 'class', 'eae-separator-title' );
459
+
460
+ $this->add_inline_editing_attributes( 'title' );
461
+
462
+ $separator_html = '<div '.$this->get_render_attribute_string('separator_wrapper').'>
463
+
464
+ <div class="eae-sep-holder sep-left">
465
+ <div class="eae-sep-lines"></div>
466
+ </div>';
467
+
468
+
469
+
470
+
471
+ if(!empty($settings['icon']) && $settings['icon_position'] == 'before'){
472
+ $separator_html .= '<div class="eae-separator-icon-wrapper"><div class="eae-separator-icon-inner">
473
+ <i class="'.$settings['icon'].'"></i>
474
+ </div></div>';
475
+ }
476
+
477
+ if($settings['title'] != ''){
478
+ $separator_html .= sprintf( '<%1$s %2$s>%3$s</%1$s>', $settings['html_tag'], $this->get_render_attribute_string( 'title' ), $settings['title'] );
479
+ }
480
+
481
+ if(!empty($settings['icon']) && $settings['icon_position'] == 'after'){
482
+ $separator_html .= '<div class="eae-separator-icon-wrapper"><div class="eae-separator-icon-inner">
483
+ <i class="'.$settings['icon'].'"></i>
484
+ </div></div>';
485
+ }
486
+
487
+
488
+ $separator_html .= '<div class="eae-sep-holder sep-right">
489
+ <div class="eae-sep-lines"></div>
490
+ </div>
491
+ </div>';
492
+
493
+
494
+
495
+
496
+
497
+
498
+ echo $separator_html;
499
+ }
500
+
501
+ protected function _content_template() {
502
+ ?>
503
+ <#
504
+
505
+ icon_class = settings.icon != ''? 'icon-yes':'';
506
+ title_class = settings.title != ''? 'title-yes':'';
507
+ var separator_html = '<div class="wts-eae-textseparator sep-align-' + settings.align + ' icon-' + settings.icon_position + ' ' + icon_class + ' ' + title_class +'"><div class="eae-sep-holder sep-left"><div class="eae-sep-lines"></div></div>';
508
+
509
+ if(settings.icon != '' && settings.icon_position == 'before'){
510
+ separator_html += '<div class="eae-separator-icon-wrapper"><div class="eae-separator-icon-inner"><i class="'+ settings.icon +'"></i></div></div>'
511
+ }
512
+
513
+ if(settings.title != ''){
514
+ separator_html += '<' + settings.html_tag + ' class="eae-separator-title elementor-inline-editing" data-elementor-setting-key="title">' + settings.title + '</' + settings.html_tag + '>';
515
+ }
516
+
517
+
518
+ if(settings.icon != '' && settings.icon_position == 'after'){
519
+ separator_html += '<div class="eae-separator-icon-wrapper"><div class="eae-separator-icon-inner"><i class="'+ settings.icon +'"></i></div></div>'
520
+ }
521
+
522
+ separator_html += '<div class="eae-sep-holder sep-right"><div class="eae-sep-lines"></div></div></div>';
523
+
524
+ print( separator_html );
525
+ #>
526
+ <?php
527
+ }
528
+ }
529
+
530
+
531
+ Plugin::instance()->widgets_manager->register_widget_type( new Widget_TextSeparator() );
elements/twitter.php ADDED
@@ -0,0 +1,964 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace EAE;
4
+
5
+ use Elementor\Controls_Manager;
6
+ use Elementor\Widget_Base;
7
+ use Elementor\Plugin;
8
+ use Elementor\Scheme_Color;
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit;
12
+ } //Exit if accessed directly
13
+
14
+ class EAE_Twitter extends Widget_Base {
15
+
16
+ public function get_name() {
17
+ return 'wts-twitter';
18
+ }
19
+
20
+ public function get_title() {
21
+ return __( 'EAE - Twitter', 'wts-eae' );
22
+ }
23
+
24
+ public function get_icon() {
25
+ return 'fa fa-twitter';
26
+ }
27
+
28
+ public function get_categories() {
29
+ return [ 'wts-eae' ];
30
+ }
31
+ protected function _register_controls() {
32
+
33
+ $this->start_controls_section(
34
+ 'section_general',
35
+ [
36
+ 'label' => __( 'General', 'wts-eae' )
37
+ ]
38
+ );
39
+
40
+ $this->add_control(
41
+ 'embed_type',
42
+ [
43
+ 'label' => __( 'Type', 'wts-eae' ),
44
+ 'type' => Controls_Manager::SELECT,
45
+ 'default' => 'handle',
46
+ 'options' => [
47
+ //'collection' => 'Collection',
48
+ //'tweet' => 'Tweet',
49
+ //'profile' => 'Profile',
50
+ //'list' => 'List',
51
+ //'moments' => 'Moments',
52
+ //'likes' => 'Likes ',
53
+ 'handle' => __( 'Handle', 'wts-eae' ),
54
+ 'hashtag' => __( 'Hashtag', 'wts-eae' ),
55
+ ]
56
+ ]
57
+ );
58
+
59
+ $this->add_control(
60
+ 'url_collection',
61
+ [
62
+ 'label' => __( 'Enter URL', 'wts-eae' ),
63
+ 'type' => Controls_Manager::TEXT,
64
+ 'placeholder' => __( 'https://twitter.com/webtechhardik', 'wts-eae' ),
65
+ 'default' => 'https://twitter.com/TwitterDev/timelines/539487832448843776',
66
+ 'condition' => [
67
+ 'embed_type' => 'collection'
68
+ ]
69
+
70
+ ]
71
+ );
72
+
73
+ $this->add_control(
74
+ 'url_profile',
75
+ [
76
+ 'label' => __( 'Enter URL', 'wts-eae' ),
77
+ 'type' => Controls_Manager::TEXT,
78
+ 'placeholder' => __( 'https://twitter.com/TwitterDev', 'wts-eae' ),
79
+ 'default' => 'https://twitter.com/TwitterDev',
80
+ 'condition' => [
81
+ 'embed_type' => 'profile'
82
+ ]
83
+
84
+ ]
85
+ );
86
+
87
+ $this->add_control(
88
+ 'url_list',
89
+ [
90
+ 'label' => __( 'Enter URL', 'wts-eae' ),
91
+ 'type' => Controls_Manager::TEXT,
92
+ 'placeholder' => __( 'https://twitter.com/webtechhardik', 'wts-eae' ),
93
+ 'default' => 'https://twitter.com/TwitterDev/lists/national-parks',
94
+ 'condition' => [
95
+ 'embed_type' => 'list'
96
+ ]
97
+
98
+ ]
99
+ );
100
+
101
+ $this->add_control(
102
+ 'url_moments',
103
+ [
104
+ 'label' => __( 'Enter URL', 'wts-eae' ),
105
+ 'type' => Controls_Manager::TEXT,
106
+ 'placeholder' => __( 'https://twitter.com/webtechhardik', 'wts-eae' ),
107
+ 'default' => 'https://twitter.com/i/moments/625792726546558977',
108
+ 'condition' => [
109
+ 'embed_type' => 'moments'
110
+ ]
111
+
112
+ ]
113
+ );
114
+
115
+ $this->add_control(
116
+ 'url_likes',
117
+ [
118
+ 'label' => __( 'Enter URL', 'wts-eae' ),
119
+ 'type' => Controls_Manager::TEXT,
120
+ 'placeholder' => __( 'https://twitter.com/webtechhardik', 'wts-eae' ),
121
+ 'default' => 'https://twitter.com/TwitterDev/likes',
122
+ 'condition' => [
123
+ 'embed_type' => 'likes'
124
+ ]
125
+
126
+ ]
127
+ );
128
+
129
+ $this->add_control(
130
+ 'username',
131
+ [
132
+ 'label' => __( 'Enter UserName', 'wts-eae' ),
133
+ 'type' => Controls_Manager::TEXT,
134
+ 'placeholder' => __( '@username', 'wts-eae' ),
135
+ 'default' => '@TwitterDev',
136
+ 'condition' => [
137
+ 'embed_type' => 'handle',
138
+ ]
139
+ ]
140
+
141
+ );
142
+
143
+
144
+ $this->add_control(
145
+ 'hashtag',
146
+ [
147
+ 'label' => __( 'Enter Hashtag', 'wts-eae' ),
148
+ 'type' => Controls_Manager::TEXT,
149
+ 'placeholder' => __( '#hashtag', 'wts-eae' ),
150
+ 'condition' => [
151
+ 'embed_type' => 'hashtag',
152
+ ]
153
+ ]
154
+
155
+ );
156
+
157
+ $this->add_control(
158
+ 'display_mode_collection',
159
+ [
160
+ 'label' => __( 'Display Mode', 'wts-eae' ),
161
+ 'type' => Controls_Manager::SELECT,
162
+ 'default' => 'timeline',
163
+ 'options' => [
164
+ 'timeline' => __( 'Timeline', 'wts-eae' ),
165
+ 'grid' => __( 'Grid', 'wts-eae' ),
166
+ ],
167
+ 'condition' => [
168
+ 'embed_type' => 'collection'
169
+ ]
170
+
171
+ ]
172
+ );
173
+
174
+ $this->add_control(
175
+ 'no_of_tweets',
176
+ [
177
+ 'label' => __( 'Display No of Tweets', 'wts-eae' ),
178
+ 'type' => Controls_Manager::NUMBER,
179
+ 'default' => 20,
180
+ 'min' => '2',
181
+ 'max' => '50',
182
+ 'step' => '1',
183
+ 'condition' => [
184
+
185
+ 'display_mode_collection' => 'grid',
186
+ 'embed_type' => 'collection',
187
+ ]
188
+ ]
189
+ );
190
+
191
+ /* $this->add_control(
192
+ 'height',
193
+ [
194
+ 'label' =>__('Height' , 'wts-eae'),
195
+ 'type' =>Controls_Manager::SLIDER,
196
+ 'default' =>[
197
+ 'size' => 500,
198
+
199
+ ],
200
+ 'range'=>[
201
+ 'px' =>[
202
+ 'min' =>250,
203
+ 'max' =>1300,
204
+ 'step' =>10
205
+ ]
206
+ ],
207
+ 'condition' =>[
208
+ 'embed_type!'=>'moments',
209
+ 'display_mode_collection' => 'timeline',
210
+ 'display_mode_profile' =>'timeline'
211
+ ]
212
+ ]
213
+ );
214
+
215
+
216
+
217
+ $this->add_control(
218
+ 'theme',
219
+ [
220
+ 'label' =>__('Theme' , 'wts-eae'),
221
+ 'type' =>Controls_Manager::SELECT,
222
+ 'default' => 'light',
223
+ 'options' => [
224
+ 'light' => 'Light',
225
+ 'dark' => 'Dark'
226
+ ],
227
+ 'conditions' => [
228
+ 'relation' => 'or',
229
+ 'terms' => [
230
+ [
231
+ 'name' => 'display_mode_collection',
232
+ 'operator' => 'in',
233
+ 'value' => 'timeline'
234
+ ],
235
+ [
236
+ 'name' => 'display_mode_profile',
237
+ 'operator' => 'in',
238
+ 'value' => 'timeline'
239
+ ]
240
+ ]
241
+ ]
242
+ ]
243
+ );
244
+
245
+ $this->add_control(
246
+ 'link_color',
247
+ [
248
+ 'label' =>__('Display Link Color' , 'wts-eae'),
249
+ 'type' =>Controls_Manager::COLOR,
250
+ 'scheme' => [
251
+ 'type' => Scheme_Color::get_type(),
252
+ 'value' => Scheme_Color::COLOR_1,
253
+ ],
254
+ 'conditions' => [
255
+ 'terms' => [
256
+ [
257
+ 'terms' => [
258
+
259
+ [
260
+ 'name' => 'embed_type',
261
+ 'operator' => '==',
262
+ 'value' => 'collection'
263
+ ],
264
+ [
265
+ 'name' => 'display_mode_collection',
266
+ 'operator' => '==',
267
+ 'value' => 'timeline'
268
+ ]
269
+ ]
270
+ ],
271
+ [
272
+ 'terms' => [
273
+ [
274
+ 'name' => 'embed_type',
275
+ 'operator' => '==',
276
+ 'value' => 'profile'
277
+ ],
278
+ [
279
+ 'name' => 'display_mode_profile',
280
+ 'operator' => '==',
281
+ 'value' => 'timeline'
282
+ ]
283
+ ]
284
+ ]
285
+ ]
286
+ ]
287
+ ]
288
+ );
289
+ */
290
+ $this->add_control(
291
+ 'height_collection_timeline',
292
+ [
293
+ 'label' => __( 'Height', 'wts-eae' ),
294
+ 'type' => Controls_Manager::SLIDER,
295
+ 'default' => [
296
+ 'size' => 500,
297
+
298
+ ],
299
+ 'range' => [
300
+ 'px' => [
301
+ 'min' => 250,
302
+ 'max' => 1300,
303
+ 'step' => 10
304
+ ]
305
+ ],
306
+ 'condition' => [
307
+
308
+ 'display_mode_collection' => 'timeline',
309
+ 'embed_type' => 'collection',
310
+ // 'display_mode_profile' =>'timeline'
311
+ ]
312
+ ]
313
+ );
314
+
315
+ $this->add_control(
316
+ 'theme_collection_timeline',
317
+ [
318
+ 'label' => __( 'Theme', 'wts-eae' ),
319
+ 'type' => Controls_Manager::SELECT,
320
+ 'default' => 'light',
321
+ 'options' => [
322
+ 'light' => __( 'Light', 'wts-eae' ),
323
+ 'dark' => __( 'Dark', 'wts-eae' ),
324
+ ],
325
+ 'condition' => [
326
+ 'display_mode_collection' => 'timeline',
327
+ 'embed_type' => 'collection',
328
+ //'display_mode_profile' =>'timeline'
329
+ ]
330
+ ]
331
+ );
332
+
333
+ $this->add_control(
334
+ 'link_color_collection',
335
+ [
336
+ 'label' => __( 'Display Link Color', 'wts-eae' ),
337
+ 'type' => Controls_Manager::COLOR,
338
+ 'scheme' => [
339
+ 'type' => Scheme_Color::get_type(),
340
+ 'value' => Scheme_Color::COLOR_1,
341
+ ],
342
+ 'condition' => [
343
+
344
+ 'display_mode_collection' => 'timeline',
345
+ 'embed_type' => 'collection',
346
+ //'display_mode_profile' =>'timeline'
347
+
348
+ ]
349
+ ]
350
+ );
351
+
352
+ $this->add_control(
353
+ 'display_mode_profile',
354
+ [
355
+ 'label' => __( 'Display Mode', 'wts-eae' ),
356
+ 'type' => Controls_Manager::SELECT,
357
+ 'default' => 'timeline',
358
+ 'options' => [
359
+ 'timeline' => __( 'Timeline', 'wts-eae' ),
360
+ 'button' => __( 'Button', 'wts-eae' ),
361
+ ],
362
+ 'condition' => [
363
+ 'embed_type' => [ 'profile', 'handle' ]
364
+ ]
365
+
366
+ ]
367
+ );
368
+
369
+ $this->add_control(
370
+ 'height_profile_timeline',
371
+ [
372
+ 'label' => __( 'Height', 'wts-eae' ),
373
+ 'type' => Controls_Manager::SLIDER,
374
+ 'default' => [
375
+ 'size' => 500,
376
+
377
+ ],
378
+ 'range' => [
379
+ 'px' => [
380
+ 'min' => 250,
381
+ 'max' => 1300,
382
+ 'step' => 10
383
+ ]
384
+ ],
385
+ 'condition' => [
386
+
387
+ 'display_mode_profile' => 'timeline',
388
+ 'embed_type' => [ 'profile', 'handle' ]
389
+ //'display_mode_collection' => 'timeline',
390
+
391
+ ]
392
+ ]
393
+ );
394
+
395
+ $this->add_control(
396
+ 'theme_profile_timeline',
397
+ [
398
+ 'label' => __( 'Theme', 'wts-eae' ),
399
+ 'type' => Controls_Manager::SELECT,
400
+ 'default' => 'light',
401
+ 'options' => [
402
+ 'light' => __( 'Light', 'wts-eae' ),
403
+ 'dark' => __( 'Dark', 'wts-eae' ),
404
+ ],
405
+ 'condition' => [
406
+ 'display_mode_profile' => 'timeline',
407
+ 'embed_type' => [ 'profile', 'handle' ]
408
+ //'display_mode_profile' =>'timeline'
409
+ ]
410
+ ]
411
+ );
412
+
413
+ $this->add_control(
414
+ 'link_color_profile',
415
+ [
416
+ 'label' => __( 'Display Link Color', 'wts-eae' ),
417
+ 'type' => Controls_Manager::COLOR,
418
+ 'scheme' => [
419
+ 'type' => Scheme_Color::get_type(),
420
+ 'value' => Scheme_Color::COLOR_1,
421
+ ],
422
+ 'condition' => [
423
+
424
+ 'display_mode_profile' => 'timeline',
425
+ 'embed_type' => [ 'profile', 'handle' ]
426
+ //'display_mode_collection' => 'timeline',
427
+
428
+
429
+ ]
430
+ ]
431
+ );
432
+
433
+
434
+ $this->add_control(
435
+ 'button_type',
436
+ [
437
+ 'label' => __( 'Button Type', 'wts-eae' ),
438
+ 'type' => Controls_Manager::SELECT,
439
+ 'default' => 'follow-button',
440
+ 'options' => [
441
+ 'follow-button' => __( 'Follow', 'wts-aea' ),
442
+ 'mention-button' => __( 'Mention', 'wts-eae' ),
443
+ ],
444
+ 'condition' => [
445
+ 'display_mode_profile' => 'button',
446
+ 'embed_type' => [ 'profile', 'handle' ]
447
+ ]
448
+ ]
449
+ );
450
+
451
+ $this->add_control(
452
+ 'hide_name',
453
+ [
454
+ 'label' => __( 'Hide Name', 'wts-eae' ),
455
+ 'type' => Controls_Manager::SWITCHER,
456
+ 'default' => '',
457
+ 'label_on' => __( 'Show', 'wts-eae' ),
458
+ 'label_off' => __( 'Hide', 'wts-eae' ),
459
+ 'return_value' => 'yes',
460
+ 'condition' => [
461
+
462
+ 'display_mode_profile' => 'button',
463
+ 'button_type' => 'follow-button',
464
+ 'embed_type' => [ 'profile', 'handle' ]
465
+
466
+ ]
467
+ ]
468
+
469
+ );
470
+
471
+ $this->add_control(
472
+ 'show_count',
473
+ [
474
+ 'label' => __( 'Show Count', 'wts-eae' ),
475
+ 'type' => Controls_Manager::SWITCHER,
476
+ 'default' => 'yes',
477
+ 'label_on' => __( 'Show', 'wts-eae' ),
478
+ 'label_off' => __( 'Hide', 'wts-eae' ),
479
+ 'return_value' => 'yes',
480
+ 'condition' => [
481
+ 'embed_type' => [ 'profile', 'handle' ],
482
+ 'display_mode_profile' => 'button',
483
+ 'button_type' => 'follow-button'
484
+
485
+ ]
486
+ ]
487
+
488
+ );
489
+
490
+ $this->add_control(
491
+ 'prefill_text',
492
+ [
493
+ 'label' => __( 'Tweet Text', 'wts-eae' ),
494
+ 'type' => Controls_Manager::TEXTAREA,
495
+ 'default' => '',
496
+ 'description' => __( 'Do you want to prefill the Tweet text?', 'wts-eae' ),
497
+ 'condition' => [
498
+ 'embed_type' => [ 'profile', 'handle' ],
499
+ 'display_mode_profile' => 'button',
500
+ 'button_type' => 'mention-button',
501
+ ],
502
+
503
+ ]
504
+ );
505
+
506
+ $this->add_control(
507
+ 'screen_name',
508
+ [
509
+ 'label' => __( 'Screen Name', 'wts-eae' ),
510
+ 'type' => Controls_Manager::TEXT,
511
+ 'condition' => [
512
+ 'embed_type' => [ 'profile', 'handle' ],
513
+ 'display_mode_profile' => 'button',
514
+ 'button_type' => 'mention-button'
515
+ ]
516
+ ]
517
+ );
518
+
519
+ $this->add_control(
520
+ 'large_button',
521
+ [
522
+ 'label' => __( 'Large Button', 'wts-eae' ),
523
+ 'type' => Controls_Manager::SWITCHER,
524
+ 'default' => '',
525
+ 'label_on' => __( 'Yes', 'wts-eae' ),
526
+ 'label_off' => __( 'No', 'wts-eae' ),
527
+ 'return_value' => 'yes',
528
+ 'condition' => [
529
+ 'embed_type' => [ 'profile', 'handle' ],
530
+ 'display_mode_profile' => 'button'
531
+
532
+
533
+ ]
534
+ ]
535
+
536
+ );
537
+ $this->add_control(
538
+ 'height_list',
539
+ [
540
+ 'label' => __( 'Height', 'wts-eae' ),
541
+ 'type' => Controls_Manager::SLIDER,
542
+ 'default' => [
543
+ 'size' => 500,
544
+
545
+ ],
546
+ 'range' => [
547
+ 'px' => [
548
+ 'min' => 250,
549
+ 'max' => 1300,
550
+ 'step' => 10
551
+ ]
552
+ ],
553
+ 'condition' => [
554
+
555
+ //'display_mode_profile' =>'timeline',
556
+ 'embed_type' => [ 'list', 'likes' ],
557
+ //'display_mode_collection' => 'timeline',
558
+
559
+ ]
560
+ ]
561
+ );
562
+
563
+ $this->add_control(
564
+ 'theme_list',
565
+ [
566
+ 'label' => __( 'Theme', 'wts-eae' ),
567
+ 'type' => Controls_Manager::SELECT,
568
+ 'default' => 'light',
569
+ 'options' => [
570
+ 'light' => __( 'Light', 'wts-eae' ),
571
+ 'dark' => __( 'Dark', 'wts-eae' ),
572
+ ],
573
+ 'condition' => [
574
+ //'display_mode_profile' => 'timeline',
575
+ 'embed_type' => [ 'list', 'likes' ]
576
+ //'display_mode_profile' =>'timeline'
577
+ ]
578
+ ]
579
+ );
580
+
581
+ $this->add_control(
582
+ 'link_color_list',
583
+ [
584
+ 'label' => __( 'Display Link Color', 'wts-eae' ),
585
+ 'type' => Controls_Manager::COLOR,
586
+ 'scheme' => [
587
+ 'type' => Scheme_Color::get_type(),
588
+ 'value' => Scheme_Color::COLOR_1,
589
+ ],
590
+ 'condition' => [
591
+
592
+ //'display_mode_profile' =>'timeline',
593
+ 'embed_type' => [ 'list', 'likes' ]
594
+ //'display_mode_collection' => 'timeline',
595
+
596
+
597
+ ]
598
+ ]
599
+ );
600
+
601
+ $prefill_options = [];
602
+ if ( is_single() ) {
603
+ $prefill_options = [
604
+ 'post_title' => __( 'Post Title', 'wts-eae' ),
605
+ 'excerpt' => __( 'Post Excerpt', 'wts-eae' ),
606
+ ];
607
+ }
608
+
609
+ $prefill_options['custom'] = 'Custom';
610
+ $this->add_control(
611
+ 'prefill_text_hashtag',
612
+ [
613
+ 'label' => __( 'Pre Fill Text', 'wts-eae' ),
614
+ 'type' => Controls_Manager::SELECT,
615
+ 'default' => 'post_title',
616
+ 'options' => $prefill_options,
617
+ 'condition' => [
618
+ 'embed_type' => 'hashtag',
619
+ ],
620
+ 'description' => __( 'Do you want to prefill the Tweet text?', 'wts-eae' ),
621
+ ]
622
+ );
623
+ $this->add_control(
624
+ 'prefill_custom',
625
+ [
626
+ 'label' => __( 'Custom Prefill Text', 'wts-eae' ),
627
+ 'type' => Controls_Manager::TEXTAREA,
628
+ 'condition' => [
629
+ 'prefill_text_hashtag' => 'custom',
630
+ 'embed_type' => 'hashtag'
631
+ ]
632
+
633
+ ]
634
+ );
635
+
636
+ $this->add_control(
637
+ 'hashtag_url',
638
+ [
639
+ 'label' => __( 'Fix Url in Tweet' ),
640
+ 'type' => Controls_Manager::TEXT,
641
+ 'default' => '',
642
+ 'description' => __( 'Do you want to set a specific URL in the Tweet?', 'wts-eae' ),
643
+ 'condition' => [
644
+ 'embed_type' => 'hashtag'
645
+ ]
646
+ ]
647
+ );
648
+
649
+
650
+ $this->add_control(
651
+ 'language',
652
+ [
653
+ 'label' => __( 'Language', 'wts-eae' ),
654
+ 'type' => Controls_Manager::SELECT,
655
+ 'options' => $this->languages(),
656
+ 'default' => ''
657
+ ]
658
+ );
659
+
660
+ $this->add_control(
661
+ 'hashtag_large_button',
662
+ [
663
+ 'label' => __( 'Large Button', 'wts-eae' ),
664
+ 'type' => Controls_Manager::SWITCHER,
665
+ 'default' => '',
666
+ 'label_on' => __( 'Yes', 'wts-eae' ),
667
+ 'label_off' => __( 'No', 'wts-eae' ),
668
+ 'return_value' => 'yes',
669
+ 'condition' => [
670
+ 'embed_type' => 'hashtag',
671
+ ]
672
+ ]
673
+
674
+ );
675
+
676
+
677
+ }
678
+
679
+ public function languages() {
680
+ $languages = [
681
+ '' => __( 'Automatic', 'wts-eae' ),
682
+ 'en' => __( 'English', 'wts-eae' ),
683
+ 'ar' => __( 'Arabic', 'wta-eae' ),
684
+ 'bn' => __( 'Bengali', 'wts-eae' ),
685
+ 'cs' => __( 'Czech', 'wts-eae' ),
686
+ 'da' => __( 'Danish', 'wts-eae' ),
687
+ 'de' => __( 'German', 'wts-eae' ),
688
+ 'el' => __( 'Greek', 'wts-eae' ),
689
+ 'es' => __( 'Spanish', 'wts-eae' ),
690
+ 'fa' => __( 'Persian', 'wts-eae' ),
691
+ 'fi' => __( 'Finnish', 'wts-eae' ),
692
+ 'fil' => __( 'Filipino', 'wts-eae' ),
693
+ 'fr' => __( 'French', 'wts-eae' ),
694
+ 'he' => __( 'Hebrew', 'wts-eae' ),
695
+ 'hi' => __( 'Hindi', 'wts-eae' ),
696
+ 'hu' => __( 'Hungarian', 'wts-eae' ),
697
+ 'id' => __( 'Indonesian', 'wts-eae' ),
698
+ 'it' => __( 'Italian', 'wts-eae' ),
699
+ 'ja' => __( 'Japanese', 'wts-eae' ),
700
+ 'ko' => __( 'Korean', 'wts-eae' ),
701
+ 'msa' => __( 'Malay', 'wts-eae' ),
702
+ 'nl' => __( 'Dutch', 'wts-eae' ),
703
+ 'no' => __( 'Norwegian', 'wts-eae' ),
704
+ 'pl' => __( 'Polish', 'wts-eae' ),
705
+ 'pt' => __( 'Portuguese', 'wts-eae' ),
706
+ 'ro' => __( 'Romania', 'wts-eae' ),
707
+ 'ru' => __( 'Rus', 'wts-eae' ),
708
+ 'sv' => __( 'Swedish', 'wts-eae' ),
709
+ 'th' => __( 'Thai', 'wts-eae' ),
710
+ 'tr' => __( 'Turkish', 'wts-eae' ),
711
+ 'uk' => __( 'Ukrainian', 'wts-eae' ),
712
+ 'ur' => __( 'Urdu', 'wts-eae' ),
713
+ 'vi' => __( 'Vietnamese', 'wts-eae' ),
714
+ 'zh-cn' => __( 'Chinese (Simplified)', 'wts-eae' ),
715
+ 'zh-tw' => __( 'Chinese (Traditional)', 'wts-eae' ),
716
+ ];
717
+
718
+ return $languages;
719
+
720
+ }
721
+
722
+ public function render() {
723
+ // TODO: Implement render() method.
724
+ $settings = $this->get_settings();
725
+ //echo'<pre>'; print_r($settings);
726
+
727
+ switch ( $settings['embed_type'] ) {
728
+
729
+ case "collection":
730
+ $this->get_collection_html( $settings );
731
+ break;
732
+
733
+ case "profile":
734
+ $this->get_profile_html( $settings );
735
+ break;
736
+
737
+ case "list":
738
+ $this->get_list_html( $settings );
739
+ break;
740
+
741
+ case "moments":
742
+ $this->get_moments_html( $settings );
743
+ break;
744
+
745
+ case "likes" :
746
+ $this->get_likes_html( $settings );
747
+ break;
748
+
749
+ case "handle" :
750
+ $this->get_handle_html( $settings );
751
+ break;
752
+ case "hashtag":
753
+ $this->get_hashtag_html( $settings );
754
+ break;
755
+
756
+ }
757
+ ?>
758
+ <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
759
+ <?php
760
+
761
+ }
762
+
763
+ public function get_collection_html( $settings ) {
764
+ $this->add_render_attribute( 'collection', 'class', 'twitter-' . $settings['display_mode_collection'] );
765
+ $this->add_render_attribute( 'collection', 'data-lang', $settings['language'] );
766
+ $this->add_render_attribute( 'collection', 'data-partner', 'twitter-deck' );
767
+ $this->add_render_attribute( 'collection', 'href', $settings['url_collection'] );
768
+
769
+ if ( $settings['display_mode_collection'] == 'grid' ) {
770
+ $this->add_render_attribute( 'collection', 'data-limit', $settings['no_of_tweets'] );
771
+ }
772
+ if ( $settings['display_mode_collection'] == 'timeline' ) {
773
+ $this->add_render_attribute( 'collection', 'data-height', $settings['height_collection_timeline']['size'] );
774
+ //$this->add_render_attribute('collection','data-width',$settings['width']['size']);
775
+ $this->add_render_attribute( 'collection', 'data-theme', $settings['theme_collection_timeline'] );
776
+ $this->add_render_attribute( 'collection', 'data-link-color', $settings['link_color_collection'] );
777
+
778
+ }
779
+
780
+ ?>
781
+ <a <?php echo $this->get_render_attribute_string( 'collection' ); ?>></a>
782
+ <?php
783
+ }
784
+
785
+ public function get_profile_html( $settings ) {
786
+ $this->add_render_attribute( 'profile', 'href', $settings['url_profile'] );
787
+ $this->add_render_attribute( 'profile', 'data-lang', $settings['language'] );
788
+ if ( $settings['large_button'] == 'yes' ) {
789
+ $this->add_render_attribute( 'profile', 'data-size', 'large' );
790
+ }
791
+
792
+
793
+ if ( $settings['display_mode_profile'] == 'timeline' ) {
794
+ $this->add_render_attribute( 'profile', 'class', 'twitter-' . $settings['display_mode_profile'] );
795
+ $this->add_render_attribute( 'profile', 'data-partner', 'twitter-deck' );
796
+ $this->add_render_attribute( 'profile', 'data-height', $settings['height_profile_timeline']['size'] );
797
+ $this->add_render_attribute( 'profile', 'data-theme', $settings['theme_profile_timeline'] );
798
+ $this->add_render_attribute( 'profile', 'data-link-color', $settings['link_color_profile'] );
799
+
800
+ }
801
+
802
+ if ( $settings['display_mode_profile'] == 'button' && $settings['button_type'] == 'follow-button' ) {
803
+ $this->add_render_attribute( 'profile', 'class', 'twitter-' . $settings['button_type'] );
804
+ if ( $settings['hide_name'] == 'yes' ) {
805
+ $this->add_render_attribute( 'profile', 'data-show-screen-name', 'false' );
806
+ }
807
+ if ( $settings['show_count'] == '' ) {
808
+ $this->add_render_attribute( 'profile', 'data-show-count', 'false' );
809
+ }
810
+ }
811
+
812
+ if ( $settings['display_mode_profile'] == 'button' && $settings['button_type'] == 'mention-button' ) {
813
+ $this->add_render_attribute( 'profile', 'class', 'twitter-' . $settings['button_type'] );
814
+ $this->add_render_attribute( 'profile', 'data-text', $settings['prefill_text'] );
815
+ $this->add_render_attribute( 'profile', 'href', $settings['url_profile'] . '?screen_name=' . $settings['screen_name'] );
816
+
817
+ }
818
+
819
+ ?>
820
+ <a <?php echo $this->get_render_attribute_string( 'profile' ); ?> ></a><?php
821
+ }
822
+
823
+ public function get_list_html( $settings ) {
824
+ if ( $settings['embed_type'] == 'list' ) {
825
+ $this->add_render_attribute( 'list', 'class', 'twitter-timeline' );
826
+ }
827
+ $this->add_render_attribute( 'list', 'href', $settings['url_list'] );
828
+ $this->add_render_attribute( 'list', 'data-height', $settings['height_list']['size'] );
829
+ //$this->add_render_attribute('collection','data-width',$settings['width']['size']);
830
+ $this->add_render_attribute( 'list', 'data-theme', $settings['theme_list'] );
831
+ $this->add_render_attribute( 'list', 'data-link-color', $settings['link_color_list'] );
832
+ $this->add_render_attribute( 'list', 'data-lang', $settings['language'] );
833
+ $this->add_render_attribute( 'list', 'data-partner', 'twitter-deck' );
834
+ ?>
835
+ <a <?php echo $this->get_render_attribute_string( 'list' ); ?>> </a><?php
836
+
837
+ }
838
+
839
+ public function get_moments_html( $settings ) {
840
+ if ( $settings['embed_type'] == 'moments' ) {
841
+ $this->add_render_attribute( 'moments', 'class', 'twitter-moment' );
842
+ }
843
+ $this->add_render_attribute( 'moments', 'href', $settings['url_moments'] );
844
+ $this->add_render_attribute( 'moments', 'data-lang', $settings['language'] );
845
+ $this->add_render_attribute( 'moments', 'data-partner', 'twitter-deck' );
846
+ ?>
847
+ <a <?php echo $this->get_render_attribute_string( 'moments' ); ?> > </a>
848
+ <?php
849
+
850
+ }
851
+
852
+ public function get_likes_html( $settings ) {
853
+ if ( $settings['embed_type'] == 'likes' ) {
854
+ $this->add_render_attribute( 'likes', 'class', 'twitter-timeline' );
855
+ }
856
+ $this->add_render_attribute( 'likes', 'href', $settings['url_likes'] );
857
+ $this->add_render_attribute( 'likes', 'data-height', $settings['height_list']['size'] );
858
+ $this->add_render_attribute( 'likes', 'data-theme', $settings['theme_list'] );
859
+ $this->add_render_attribute( 'likes', 'data-link-color', $settings['link_color_list'] );
860
+ $this->add_render_attribute( 'likes', 'data-lang', $settings['language'] );
861
+ $this->add_render_attribute( 'likes', 'data-partner', 'twitter-deck' );
862
+ ?>
863
+ <a <?php echo $this->get_render_attribute_string( 'likes' ) ?> >Likes</php> </a>
864
+ <?php
865
+ }
866
+
867
+ public function get_handle_html( $settings ) {
868
+
869
+ $this->add_render_attribute( 'handle', 'data-lang', $settings['language'] );
870
+ if ( $settings['large_button'] == 'yes' ) {
871
+ $this->add_render_attribute( 'handle', 'data-size', 'large' );
872
+ }
873
+
874
+
875
+ if ( $settings['display_mode_profile'] == 'timeline' ) {
876
+ $this->add_render_attribute( 'handle', 'href', 'https://www.twitter.com/' . $settings['username'] );
877
+ $this->add_render_attribute( 'handle', 'class', 'twitter-' . $settings['display_mode_profile'] );
878
+ $this->add_render_attribute( 'handle', 'data-partner', 'twitter-deck' );
879
+ $this->add_render_attribute( 'handle', 'data-height', $settings['height_profile_timeline']['size'] );
880
+ $this->add_render_attribute( 'handle', 'data-theme', $settings['theme_profile_timeline'] );
881
+ $this->add_render_attribute( 'handle', 'data-link-color', $settings['link_color_profile'] );
882
+
883
+ }
884
+
885
+ if ( $settings['display_mode_profile'] == 'button' && $settings['button_type'] == 'follow-button' ) {
886
+ $this->add_render_attribute( 'handle', 'class', 'twitter-' . $settings['button_type'] );
887
+ $this->add_render_attribute( 'handle', 'href', 'https://www.twitter.com/' . $settings['username'] );
888
+ if ( $settings['hide_name'] == 'yes' ) {
889
+ $this->add_render_attribute( 'handle', 'data-show-screen-name', 'false' );
890
+ }
891
+ if ( $settings['show_count'] == '' ) {
892
+ $this->add_render_attribute( 'handle', 'data-show-count', 'false' );
893
+ }
894
+ }
895
+
896
+ if ( $settings['display_mode_profile'] == 'button' && $settings['button_type'] == 'mention-button' ) {
897
+ $this->add_render_attribute( 'handle', 'class', 'twitter-' . $settings['button_type'] );
898
+ $this->add_render_attribute( 'handle', 'data-text', $settings['prefill_text'] );
899
+ $this->add_render_attribute( 'handle', 'href','https://www.twitter.com/intent/tweet' . '?screen_name=' . $settings['screen_name'] );
900
+
901
+
902
+ }
903
+
904
+ ?>
905
+ <a <?php echo $this->get_render_attribute_string( 'handle' ); ?> > Handle <?php echo $settings['username']; ?></a><?php
906
+ }
907
+
908
+ public function get_hashtag_html( $settings ) {
909
+
910
+ $this->add_render_attribute( 'hashtag', 'class', 'twitter-hashtag-button' );
911
+ $this->add_render_attribute( 'hashtag', 'href', 'https://twitter.com/intent/tweet?button_hashtag=' . $settings['hashtag'] );
912
+ $this->add_render_attribute( 'hashtag', 'data-lang', $settings['language'] );
913
+
914
+ if ( $settings['prefill_text_hashtag'] == 'post_title' ) {
915
+
916
+ $this->add_render_attribute( 'hashtag', 'data-text', $this->current_post_title() );
917
+ }
918
+ if ( $settings['prefill_text_hashtag'] == 'excerpt' ) {
919
+
920
+ $this->add_render_attribute( 'hashtag', 'data-text', $this->current_post_excerpt() );
921
+ }
922
+ if ( $settings['prefill_text_hashtag'] == 'custom' ) {
923
+ $this->add_render_attribute( 'hashtag', 'data-text', $settings['prefill_custom'] );
924
+ }
925
+ if ( $settings['hashtag_large_button'] == 'yes' ) {
926
+ $this->add_render_attribute( 'hashtag', 'data-size', 'large' );
927
+ }
928
+ $this->add_render_attribute( 'hashtag', 'data-url', $settings['hashtag_url'] );
929
+
930
+ ?>
931
+ <a <?php echo $this->get_render_attribute_string( 'hashtag' ); ?> >Tweet<?php echo $settings['hashtag']; ?> </a>
932
+ <?php
933
+
934
+
935
+ }
936
+
937
+ public function current_post_title() {
938
+
939
+ global $post;
940
+ //echo'<pre>'; print_r($post); echo'<pre>';
941
+ $title = $post->post_title;
942
+
943
+ //echo $title;
944
+ return $title;
945
+
946
+ }
947
+
948
+ public function current_post_excerpt() {
949
+ global $post;
950
+
951
+
952
+ if ( has_excerpt( $post->ID ) ) {
953
+ return get_the_excerpt( $post->ID );
954
+ } else {
955
+
956
+ }
957
+ }
958
+
959
+
960
+
961
+
962
+ }
963
+
964
+ Plugin::instance()->widgets_manager->register_widget_type( new EAE_Twitter() );
inc/admin/Settings.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: anand
5
+ * Date: 10/01/18
6
+ * Time: 12:18 PM
7
+ */
8
+
9
+ namespace EAE;
10
+
11
+
12
+ class Settings extends Settings_Page {
13
+
14
+ const PAGE_ID = 'eae';
15
+
16
+ public function __construct() {
17
+ parent::__construct();
18
+
19
+ add_action( 'admin_menu', [ $this, 'register_admin_menu' ], 20 );
20
+ }
21
+
22
+ public function register_admin_menu() {
23
+ add_menu_page(
24
+ __( 'Elementor Addon Elements', 'eae' ),
25
+ __( 'Elementor Addon Elements', 'eae' ),
26
+ 'manage_options',
27
+ self::PAGE_ID,
28
+ [ $this, 'display_settings_page' ],
29
+ '',
30
+ 99
31
+ );
32
+ }
33
+
34
+ protected function get_page_title() {
35
+ return __( 'Elementor Addons Elements', 'EAE' );
36
+ }
37
+
38
+ public function create_tabs() {
39
+
40
+ return [
41
+ 'general' => [
42
+ 'label' => __( 'General', 'elementor' ),
43
+ 'sections' => [
44
+ 'general' => [
45
+ 'fields' => [
46
+ 'gmap_key' => [
47
+ 'label' => __( 'Google Map Key', 'wts-eae' ),
48
+ 'field_args' => [
49
+ 'type' => 'text',
50
+ 'desc' => '<a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">'
51
+ . __('Click Here', 'eae') .
52
+ '</a> to generate API KEY'
53
+ ],
54
+ ]
55
+ ]
56
+ ]
57
+ ]
58
+ ],
59
+ 'other_products' => [
60
+ 'label' => __('Other Products', 'eae'),
61
+ 'sections' => [
62
+ 'other_products' => [
63
+ 'fields' => [
64
+ 'aepro' => [
65
+ 'field_args' => [
66
+ 'type' => 'raw_html',
67
+ 'html' => $this->get_aepro_promo()
68
+ ]
69
+ ]
70
+ ]
71
+ ]
72
+ ]
73
+ ]
74
+ ];
75
+ }
76
+
77
+ function get_aepro_promo(){
78
+
79
+ $promo_html = '<h2>AnyWhere Elementor Pro</h2>';
80
+
81
+ $promo_html .= '<style type="text/css">
82
+ .elementor_aepro th{ display:none; }
83
+ .desc-box{ width:50%; float:left; }
84
+ .logo-box{ width:50%; float:left; text-align: center; }
85
+ .logo-box img{ width:200px; }
86
+ .elementor_aepro h2{ font-size:30px; }
87
+ .eae-ae-actions a{ display:inline-block; margin-right:10px; text-decoration: none; padding: 10px 15px; background:#5cc4b6; color:#FFF; border-radius:3px; }
88
+ .eae-ae-actions a.demo{ background:#667eea; }
89
+ </style>
90
+ <div class="eae-ae-actions">
91
+ <a href="https://shop.webtechstreet.com/downloads/anywhere-elementor-pro/?ref=eae" target="_blank" class="learmore">Learn More</a>
92
+ <a href="https://aedemo.elementoraddons.com/?ref=eae" target="_blank" class="demo">See Demo</a>
93
+ </div>
94
+ <div class="desc-box">
95
+ <p>Supercharge your Elementor with the ability to design global layouts
96
+
97
+ <ul>
98
+ <li>Design global single post layouts</li>
99
+ <li>Design layout for Blog Page</li>
100
+ <li>Design layouts for Post Type Archives, Category/Custom Taxonomy Archives</li>
101
+ <li>Get the ability to design layouts for Author Archives, Search Page and 404 Pages</li>
102
+ <li>Use data from custom fields in your Elementor Layouts</li>
103
+ <li>Support many field types of ACF & Pods</li>
104
+ <li>Design WooCommerce Product, Shop and Category page layouts.</li>
105
+ </ul>
106
+ </p></div>
107
+
108
+ <div class="logo-box">
109
+ <img src="'.ELEMENTOR_ADDON_URL.'assets/aep.png" title="AnyWhere Elementor Pro" />
110
+ </div> ';
111
+
112
+ return $promo_html;
113
+ }
114
+ }
115
+
116
+ new Settings();
inc/admin/controls.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace EAE;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ class Settings_Controls {
9
+
10
+ /**
11
+ * @static
12
+ * @since 1.0.0
13
+ * @access public
14
+ */
15
+ public static function render( $field = [] ) {
16
+ if ( empty( $field ) || empty( $field['id'] ) ) {
17
+ return;
18
+ }
19
+
20
+ $defaults = [
21
+ 'type' => '',
22
+ 'placeholder' => '',
23
+ 'classes' => [],
24
+ 'std' => '',
25
+ 'desc' => '',
26
+ ];
27
+
28
+ $field = array_merge( $defaults, $field );
29
+
30
+ $method_name = '_' . $field['type'];
31
+
32
+ if ( ! method_exists( __CLASS__, $method_name ) ) {
33
+ $method_name = '_text';
34
+ }
35
+
36
+ self::$method_name( $field );
37
+ }
38
+
39
+ /**
40
+ * @static
41
+ * @since 1.0.0
42
+ * @access private
43
+ */
44
+ private static function _text( array $field ) {
45
+ if ( empty( $field['classes'] ) ) {
46
+ $field['classes'] = [ 'regular-text' ];
47
+ }
48
+ ?>
49
+ <input type="<?php echo esc_attr( $field['type'] ); ?>" class="<?php echo esc_attr( implode( ' ', $field['classes'] ) ); ?>" id="<?php echo esc_attr( $field['id'] ); ?>" name="<?php echo esc_attr( $field['id'] ); ?>" value="<?php echo esc_attr( get_option( $field['id'], $field['std'] ) ); ?>"<?php echo ! empty( $field['placeholder'] ) ? ' placeholder="' . $field['placeholder'] . '"' : ''; ?> />
50
+ <?php
51
+ if ( ! empty( $field['sub_desc'] ) ) :
52
+ echo $field['sub_desc'];
53
+ endif;
54
+ ?>
55
+ <?php if ( ! empty( $field['desc'] ) ) : ?>
56
+ <p class="description"><?php echo $field['desc']; ?></p>
57
+ <?php
58
+ endif;
59
+ }
60
+
61
+ /**
62
+ * @static
63
+ * @since 1.0.0
64
+ * @access private
65
+ */
66
+ private static function _checkbox( array $field ) {
67
+ ?>
68
+ <label>
69
+ <input type="<?php echo esc_attr( $field['type'] ); ?>" id="<?php echo esc_attr( $field['id'] ); ?>" name="<?php echo esc_attr( $field['id'] ); ?>" value="<?php echo $field['value']; ?>"<?php checked( $field['value'], get_option( $field['id'], $field['std'] ) ); ?> />
70
+ <?php
71
+ if ( ! empty( $field['sub_desc'] ) ) :
72
+ echo $field['sub_desc'];
73
+ endif;
74
+ ?>
75
+ </label>
76
+ <?php if ( ! empty( $field['desc'] ) ) : ?>
77
+ <p class="description"><?php echo $field['desc']; ?></p>
78
+ <?php
79
+ endif;
80
+ }
81
+
82
+ /**
83
+ * @static
84
+ * @since 1.0.0
85
+ * @access private
86
+ */
87
+ private static function _checkbox_list( array $field ) {
88
+ $old_value = get_option( $field['id'], $field['std'] );
89
+ if ( ! is_array( $old_value ) ) {
90
+ $old_value = [];
91
+ }
92
+
93
+ foreach ( $field['options'] as $option_key => $option_value ) :
94
+ ?>
95
+ <label>
96
+ <input type="checkbox" name="<?php echo $field['id']; ?>[]" value="<?php echo $option_key; ?>"<?php checked( in_array( $option_key, $old_value ), true ); ?> />
97
+ <?php echo $option_value; ?>
98
+ </label><br />
99
+ <?php endforeach; ?>
100
+ <?php if ( ! empty( $field['desc'] ) ) : ?>
101
+ <p class="description"><?php echo $field['desc']; ?></p>
102
+ <?php
103
+ endif;
104
+ }
105
+
106
+ /**
107
+ * @static
108
+ * @since 1.4.0
109
+ * @access private
110
+ */
111
+ private static function _select( array $field ) {
112
+ $old_value = get_option( $field['id'], $field['std'] );
113
+ ?>
114
+ <select name="<?php echo esc_attr( $field['id'] ); ?>">
115
+ <?php if ( ! empty( $field['show_select'] ) ) : ?>
116
+ <option value="">— <?php _e( 'Select', 'elementor' ); ?> —</option>
117
+ <?php endif; ?>
118
+
119
+ <?php foreach ( $field['options'] as $value => $label ) : ?>
120
+ <option value="<?php echo esc_attr( $value ); ?>"<?php selected( $value, $old_value ); ?>><?php echo $label; ?></option>
121
+ <?php endforeach; ?>
122
+ </select>
123
+
124
+ <?php if ( ! empty( $field['desc'] ) ) : ?>
125
+ <p class="description"><?php echo $field['desc']; ?></p>
126
+ <?php
127
+ endif;
128
+ }
129
+
130
+ /**
131
+ * @static
132
+ * @since 1.0.0
133
+ * @access private
134
+ */
135
+ private static function _checkbox_list_cpt( array $field ) {
136
+ $defaults = [
137
+ 'exclude' => [],
138
+ ];
139
+ $field = array_merge( $defaults, $field );
140
+
141
+ $post_types_objects = get_post_types(
142
+ [
143
+ 'public' => true,
144
+ ], 'objects'
145
+ );
146
+ $field['options'] = [];
147
+ foreach ( $post_types_objects as $cpt_slug => $post_type ) {
148
+ if ( in_array( $cpt_slug, $field['exclude'] ) ) {
149
+ continue;
150
+ }
151
+
152
+ $field['options'][ $cpt_slug ] = $post_type->labels->name;
153
+ }
154
+
155
+ self::_checkbox_list( $field );
156
+ }
157
+
158
+ /**
159
+ * @static
160
+ * @since 1.0.0
161
+ * @access private
162
+ */
163
+ private static function _checkbox_list_roles( array $field ) {
164
+ $defaults = [
165
+ 'exclude' => [],
166
+ ];
167
+ $field = array_merge( $defaults, $field );
168
+
169
+ $field['options'] = [];
170
+ foreach ( get_editable_roles() as $role_slug => $role_data ) {
171
+ if ( in_array( $role_slug, $field['exclude'] ) ) {
172
+ continue;
173
+ }
174
+
175
+ $field['options'][ $role_slug ] = $role_data['name'];
176
+ }
177
+
178
+ self::_checkbox_list( $field );
179
+ }
180
+
181
+ /**
182
+ * @static
183
+ * @since 1.0.0
184
+ * @access private
185
+ */
186
+ private static function _raw_html( array $field ) {
187
+ if ( empty( $field['html'] ) ) {
188
+ return;
189
+ }
190
+ ?>
191
+ <div id="<?php echo $field['id']; ?>">
192
+
193
+ <div><?php echo $field['html']; ?></div>
194
+ <?php
195
+ if ( ! empty( $field['sub_desc'] ) ) :
196
+ echo $field['sub_desc'];
197
+ endif;
198
+ ?>
199
+ <?php if ( ! empty( $field['desc'] ) ) : ?>
200
+ <p class="description"><?php echo $field['desc']; ?></p>
201
+ <?php endif; ?>
202
+ </div>
203
+ <?php
204
+ }
205
+ }
inc/admin/settings-page.php ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace EAE;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ abstract class Settings_Page {
9
+ private $tabs;
10
+
11
+ const PAGE_ID = '';
12
+
13
+ /**
14
+ * @abstract
15
+ * @since 1.5.0
16
+ * @access protected
17
+ */
18
+ abstract protected function create_tabs();
19
+
20
+ /**
21
+ * @abstract
22
+ * @since 1.5.0
23
+ * @access protected
24
+ */
25
+ abstract protected function get_page_title();
26
+
27
+ /**
28
+ * @static
29
+ * @since 1.5.0
30
+ * @access public
31
+ */
32
+ public final static function get_url() {
33
+ return admin_url( 'admin.php?page=' . static::PAGE_ID );
34
+ }
35
+
36
+ /**
37
+ * @since 1.5.0
38
+ * @access public
39
+ */
40
+ public function __construct() {
41
+ add_action( 'admin_init', [ $this, 'register_settings_fields' ] );
42
+ }
43
+
44
+ /**
45
+ * @since 1.5.0
46
+ * @access public
47
+ */
48
+ public final function get_tabs() {
49
+ $this->ensure_tabs();
50
+
51
+ return $this->tabs;
52
+ }
53
+
54
+ /**
55
+ * @since 1.5.0
56
+ * @access public
57
+ */
58
+ public final function add_tab( $tab_id, array $tab_args = [] ) {
59
+ $this->ensure_tabs();
60
+
61
+ if ( isset( $this->tabs[ $tab_id ] ) ) {
62
+ // Don't override an existing tab
63
+ return;
64
+ }
65
+
66
+ if ( ! isset( $tab_args['sections'] ) ) {
67
+ $tab_args['sections'] = [];
68
+ }
69
+
70
+ $this->tabs[ $tab_id ] = $tab_args;
71
+ }
72
+
73
+ /**
74
+ * @since 1.5.0
75
+ * @access public
76
+ */
77
+ public final function add_section( $tab_id, $section_id, array $section_args = [] ) {
78
+ $this->ensure_tabs();
79
+
80
+ if ( ! isset( $this->tabs[ $tab_id ] ) ) {
81
+ // If the requested tab doesn't exists, use the first tab
82
+ $tab_id = key( $this->tabs );
83
+ }
84
+
85
+ if ( isset( $this->tabs[ $tab_id ]['sections'][ $section_id ] ) ) {
86
+ // Don't override an existing section
87
+ return;
88
+ }
89
+
90
+ if ( ! isset( $section_args['fields'] ) ) {
91
+ $section_args['fields'] = [];
92
+ }
93
+
94
+ $this->tabs[ $tab_id ]['sections'][ $section_id ] = $section_args;
95
+ }
96
+
97
+ /**
98
+ * @since 1.5.0
99
+ * @access public
100
+ */
101
+ public final function add_field( $tab_id, $section_id, $field_id, array $field_args ) {
102
+ $this->ensure_tabs();
103
+
104
+ if ( ! isset( $this->tabs[ $tab_id ] ) ) {
105
+ // If the requested tab doesn't exists, use the first tab
106
+ $tab_id = key( $this->tabs );
107
+ }
108
+
109
+ if ( ! isset( $this->tabs[ $tab_id ]['sections'][ $section_id ] ) ) {
110
+ // If the requested section doesn't exists, use the first section
111
+ $section_id = key( $this->tabs[ $tab_id ]['sections'] );
112
+ }
113
+
114
+ if ( isset( $this->tabs[ $tab_id ]['sections'][ $section_id ]['fields'][ $field_id ] ) ) {
115
+ // Don't override an existing field
116
+ return;
117
+ }
118
+
119
+ $this->tabs[ $tab_id ]['sections'][ $section_id ]['fields'][ $field_id ] = $field_args;
120
+ }
121
+
122
+ /**
123
+ * @since 1.5.0
124
+ * @access public
125
+ */
126
+ public final function add_fields( $tab_id, $section_id, array $fields ) {
127
+ foreach ( $fields as $field_id => $field ) {
128
+ $this->add_field( $tab_id, $section_id, $field_id, $field );
129
+ }
130
+ }
131
+
132
+ /**
133
+ * @since 1.5.0
134
+ * @access public
135
+ */
136
+ public final function register_settings_fields() {
137
+ $controls_class_name = __NAMESPACE__ . '\Settings_Controls';
138
+
139
+ $tabs = $this->get_tabs();
140
+
141
+ foreach ( $tabs as $tab_id => $tab ) {
142
+
143
+ foreach ( $tab['sections'] as $section_id => $section ) {
144
+ $full_section_id = 'elementor_' . $section_id . '_section';
145
+
146
+ $label = isset( $section['label'] ) ? $section['label'] : '';
147
+
148
+ $section_callback = isset( $section['callback'] ) ? $section['callback'] : '__return_empty_string';
149
+
150
+ add_settings_section( $full_section_id, $label, $section_callback, static::PAGE_ID );
151
+
152
+ foreach ( $section['fields'] as $field_id => $field ) {
153
+ $full_field_id = ! empty( $field['full_field_id'] ) ? $field['full_field_id'] : 'wts_eae_' . $field_id;
154
+
155
+ $field['field_args']['id'] = $full_field_id;
156
+
157
+ $field_classes = [ $full_field_id ];
158
+
159
+ if ( ! empty( $field['class'] ) ) {
160
+ $field_classes[] = $field['field_args']['class'];
161
+ }
162
+
163
+ $field['field_args']['class'] = implode( ' ', $field_classes );
164
+
165
+ add_settings_field(
166
+ $full_field_id,
167
+ isset( $field['label'] ) ? $field['label'] : '',
168
+ [ $controls_class_name, 'render' ],
169
+ static::PAGE_ID,
170
+ $full_section_id,
171
+ $field['field_args']
172
+ );
173
+
174
+ $setting_args = [];
175
+
176
+ if ( ! empty( $field['setting_args'] ) ) {
177
+ $setting_args = $field['setting_args'];
178
+ }
179
+
180
+ register_setting( static::PAGE_ID, $full_field_id, $setting_args );
181
+ }
182
+ }
183
+ }
184
+ }
185
+
186
+ /**
187
+ * @since 1.5.0
188
+ * @access public
189
+ */
190
+ public function display_settings_page() {
191
+ $tabs = $this->get_tabs();
192
+ ?>
193
+ <div class="wrap">
194
+ <h1><?php echo $this->get_page_title(); ?></h1>
195
+ <div id="elementor-settings-tabs-wrapper" class="nav-tab-wrapper">
196
+ <?php
197
+ foreach ( $tabs as $tab_id => $tab ) {
198
+ if ( empty( $tab['sections'] ) ) {
199
+ continue;
200
+ }
201
+
202
+ $active_class = '';
203
+
204
+ if ( 'general' === $tab_id ) {
205
+ $active_class = ' nav-tab-active';
206
+ }
207
+
208
+ echo "<a id='elementor-settings-tab-$tab_id' class='nav-tab$active_class' href='#tab-$tab_id'>$tab[label]</a>";
209
+ }
210
+ ?>
211
+ </div>
212
+ <form id="elementor-settings-form" method="post" action="options.php">
213
+ <?php
214
+ settings_fields( static::PAGE_ID );
215
+
216
+ foreach ( $tabs as $tab_id => $tab ) {
217
+ if ( empty( $tab['sections'] ) ) {
218
+ continue;
219
+ }
220
+
221
+ $active_class = '';
222
+
223
+ if ( 'general' === $tab_id ) {
224
+ $active_class = ' elementor-active';
225
+ }
226
+
227
+ echo "<div id='tab-$tab_id' class='elementor-settings-form-page$active_class'>";
228
+
229
+ foreach ( $tab['sections'] as $section_id => $section ) {
230
+ $full_section_id = 'elementor_' . $section_id . '_section';
231
+
232
+ if ( ! empty( $section['label'] ) ) {
233
+ echo "<h2>$section[label]</h2>";
234
+ }
235
+
236
+ if ( ! empty( $section['callback'] ) ) {
237
+ $section['callback']();
238
+ }
239
+
240
+ echo '<table class="form-table">';
241
+
242
+ do_settings_fields( static::PAGE_ID, $full_section_id );
243
+
244
+ echo '</table>';
245
+ }
246
+
247
+ echo '</div>';
248
+ }
249
+
250
+ submit_button();
251
+ ?>
252
+ </form>
253
+ </div><!-- /.wrap -->
254
+ <?php
255
+ }
256
+
257
+ /**
258
+ * @since 1.5.0
259
+ * @access private
260
+ */
261
+ private function ensure_tabs() {
262
+ if ( null === $this->tabs ) {
263
+ $this->tabs = $this->create_tabs();
264
+
265
+ do_action( 'elementor/admin/after_create_settings/' . static::PAGE_ID, $this );
266
+ }
267
+ }
268
+ }
inc/elementor-helper.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ function eae_elementor_init(){
5
+ Plugin::instance()->elements_manager->add_category(
6
+ 'wts-eae',
7
+ [
8
+ 'title' => 'Elementor Addon Elements',
9
+ 'icon' => 'font'
10
+ ],
11
+ 1
12
+ );
13
+
14
+ require_once ELEMENTOR_ADDON_PATH.'elements/particles.php';
15
+ }
16
+ add_action('elementor/init','Elementor\eae_elementor_init');
17
+
18
+
19
+
inc/helper.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ function eae_get_post_data($args){
5
+ $defaults = array(
6
+ 'posts_per_page' => 5,
7
+ 'offset' => 0,
8
+ 'category' => '',
9
+ 'category_name' => '',
10
+ 'orderby' => 'date',
11
+ 'order' => 'DESC',
12
+ 'include' => '',
13
+ 'exclude' => '',
14
+ 'meta_key' => '',
15
+ 'meta_value' => '',
16
+ 'post_type' => 'post',
17
+ 'post_mime_type' => '',
18
+ 'post_parent' => '',
19
+ 'author' => '',
20
+ 'author_name' => '',
21
+ 'post_status' => 'publish',
22
+ 'suppress_filters' => true
23
+ );
24
+
25
+ $atts = wp_parse_args($args,$defaults);
26
+
27
+ $posts = get_posts($atts);
28
+
29
+ return $posts;
30
+ }
31
+
32
+ function eae_get_post_types(){
33
+ $args = array(
34
+ 'public' => true
35
+ );
36
+
37
+ $skip_post_types = ['attachment'];
38
+
39
+ $post_types = get_post_types($args);
40
+ return $post_types;
41
+ }
42
+
43
+ function eae_get_post_settings($settings){
44
+ $post_args['post_type'] = $settings['post_type'];
45
+
46
+ if($settings['post_type'] == 'post'){
47
+ $post_args['category'] = $settings['category'];
48
+ }
49
+
50
+ $post_args['posts_per_page'] = $settings['num_posts'];
51
+ $post_args['offset'] = $settings['post_offset'];
52
+ $post_args['orderby'] = $settings['orderby'];
53
+ $post_args['order'] = $settings['order'];
54
+
55
+ return $post_args;
56
+ }
57
+
58
+ function eae_get_excerpt_by_id($post_id,$excerpt_length){
59
+ $the_post = get_post($post_id); //Gets post ID
60
+
61
+ $the_excerpt = null;
62
+ if ($the_post)
63
+ {
64
+ $the_excerpt = $the_post->post_excerpt ? $the_post->post_excerpt : $the_post->post_content;
65
+ }
66
+
67
+ // $the_excerpt = ($the_post ? $the_post->post_content : null);//Gets post_content to be used as a basis for the excerpt
68
+ //echo $the_excerpt;
69
+ $the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); //Strips tags and images
70
+ $words = explode(' ', $the_excerpt, $excerpt_length + 1);
71
+
72
+ if(count($words) > $excerpt_length) :
73
+ array_pop($words);
74
+ //array_push($words, '…');
75
+ $the_excerpt = implode(' ', $words);
76
+ $the_excerpt .= '...'; // Don't put a space before
77
+ endif;
78
+
79
+ return $the_excerpt;
80
+ }
81
+
82
+ function eae_get_thumbnail_sizes(){
83
+ $sizes = get_intermediate_image_sizes();
84
+ foreach($sizes as $s){
85
+ $ret[$s] = $s;
86
+ }
87
+
88
+ return $ret;
89
+ }
90
+
91
+ function eae_get_post_orderby_options(){
92
+ $orderby = array(
93
+ 'ID' => 'Post Id',
94
+ 'author' => 'Post Author',
95
+ 'title' => 'Title',
96
+ 'date' => 'Date',
97
+ 'modified' => 'Last Modified Date',
98
+ 'parent' => 'Parent Id',
99
+ 'rand' => 'Random',
100
+ 'comment_count' => 'Comment Count',
101
+ 'menu_order' => 'Menu Order',
102
+ );
103
+
104
+ return $orderby;
105
+ }
readme.txt ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Elementor Addon Elements ===
2
+ Contributors: webtechstreet, hardiksharma
3
+ Tags: page-builder, elementor
4
+ Requires at least: 4.4
5
+ Tested up to: 4.9.7
6
+ Stable tag: 4.9.7
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Add new elements to Elementor page builder.
11
+
12
+ == Description ==
13
+
14
+ This plugin adds new elements/widgets to Elementor Page Builder.
15
+
16
+ For more details and demo check our official site http://www.elementoraddons.com/
17
+
18
+ Current Addon Elements:
19
+
20
+ * Flip Box
21
+ * Text Separator
22
+ * Price Table
23
+ * Post List
24
+ * Animated Text
25
+ * After/Before Image Compare
26
+ * Split Text
27
+ * Particle Background for Sections
28
+ * Google Map (with ability to add styles from Snazzy Maps)
29
+ * Twitter (Show profile timeline, hashtag feed, tweet, follow and hashtag button)
30
+ * Shape Separator (Deprecated.. use shape separator available with Elementor)
31
+
32
+ Many more elements coming soon...
33
+
34
+ Also try our premium plugin "AnyWhere Elementor Pro" to create Global Post Layouts with Elementor
35
+ http://www.elementoraddons.com/anywhere-elementor-pro/
36
+
37
+ Note: This plugin is an addon of Elementor Page Builder (https://wordpress.org/plugins/elementor/) and will only work with Elementor Page Builder installed.
38
+
39
+ == Installation ==
40
+
41
+ 1. Upload the plugin files to the `/wp-content/plugins/plugin-name` directory, or install the plugin through the WordPress plugins screen directly.
42
+ 2. Activate the plugin through the 'Plugins' screen in WordPress
43
+
44
+
45
+ == Frequently Asked Questions ==
46
+
47
+ = Where can i find the new element added =
48
+
49
+ New elements are added at the end of default elementor elements.
50
+
51
+ = How to set shape separator as full width. =
52
+ Setting up separator can be little tricky for you initially.
53
+ Under section settings set
54
+ Stretch Section => yes
55
+ Content width => full width
56
+ Column gap => No gap
57
+
58
+ == Screenshots ==
59
+
60
+ 1. /assets/screenshot-1.png
61
+ 2. /assets/screenshot-2.png
62
+ 3. /assets/screenshot-3.png
63
+ 3. /assets/screenshot-4.png
64
+
65
+ == Changelog ==
66
+
67
+ = 1.1 =
68
+ * New Widget: After/Before Image Compare
69
+ * New Feature: Particles Background on Sections (Requires Elementor 2.1 or higher)
70
+ * Enhancement: Added dynamic content support for Text Separator & FlipBox
71
+ * Bug Fix: Issue with flipbox on iPhones.
72
+
73
+ = 1.0 =
74
+ * New Widget: Google Map (With support for Snazzy Maps)
75
+ * New Widget: Twitter (Add timeline, tweet button, hashtag etc)
76
+ * Enhancement: Added Fade effect in FlipBox widget.
77
+ * Enhancement: Inline editing in Text Separator widget. Coming soon for other widgets.
78
+ * Bug Fix: Typography issue in Animated Text widget.
79
+
80
+ = 0.5 =
81
+ * Added new widget "Split Text"
82
+
83
+ = 0.4 =
84
+ * Added gradient background option in Flipbox, Pricetable & Animated Text
85
+ * Fix: css issue in Post List on mobile view.
86
+
87
+ = 0.3 =
88
+ * New Element - Animated Text
89
+ * Fixed issue: icons missing after elementor 1.0 release.
90
+ * Fixed issue: now uses except in post list element if available.
91
+
92
+
93
+ = 0.2.3 =
94
+ * Added more controls for price box section of Price Table
95
+ * Fixed IE11 animation issue in flipbox.
96
+
97
+
98
+ = 0.2.2 =
99
+ * Added responsive controls to Post List
100
+ * Corrected typo in Post List controls
101
+
102
+
103
+
104
+ = 0.2.1 =
105
+ * Fixed bug found in previous release. It broke text separator.
106
+
107
+ = 0.2.0 =
108
+ * Fixed issue with icon css in various elements.
109
+ * Fixed issue - text separator overlapping content below when aligned left or right.
110
+ * Added new element Post List
111
+ * Added new element Shape Separator
112
+
113
+ = 0.1.1 =
114
+ * Fixed php notices issue while using with WP_DEBUG true.
115
+ * Added width and align parameters to Text Separator. Now control the width and alignment of Text Separator.
116
+
117
+ = 0.1 =
118
+ * Introducing new element - FLIP BOX
119
+ * Fixed issue with price table border radius and background.
120
+
121
+ = 0.0.1 =
122
+ * Initial Launch with Text Separator element and Price Table