first commit
This commit is contained in:
commit
aee061ddba
7322 files changed
+2918816
No files matched your search
@@ -0,0 +1 @@
|
||||
.stratum-wrap .stratum-logo{float:left;width:100px;margin:0 2em 2em 0}.about-wrap .stratum-heading{margin-right:0}.about-wrap .stratum-heading .button{vertical-align:middle;margin-left:2em}.stratum-about-list ul{list-style:disc;margin-left:2em}.stratum-about-list p{font-weight:600}.toggle-btn input[type=checkbox]:checked:before{display:none !important}.toggle-btn{width:40px;height:20px;border-radius:50px;display:block;position:relative;background:#e74c3c;cursor:pointer;-webkit-transition:background-color 0.4s ease-in-out;-o-transition:background-color 0.4s ease-in-out;transition:background-color 0.4s ease-in-out;cursor:pointer}.form-table td fieldset label.toggle-btn{margin:0 !important}.toggle-btn.active{background:#2ecc71}.toggle-btn.active .round-btn{left:22px}.toggle-btn .round-btn{width:15px;height:15px;background-color:#fff;border-radius:50%;display:inline-block;position:absolute;left:3px;top:50%;margin-top:-8px;-webkit-transition:all 0.3s ease-in-out;-o-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}.toggle-btn .cb-value{position:absolute;left:0;right:0;width:100%;height:100%;opacity:0;z-index:9;cursor:pointer;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"}span.field-desc{display:block;margin-top:8px}.stratum-settings-wrap .group>form>h2{display:none}.about-wrap.stratum-settings-wrap{max-width:unset;margin:25px 15px 0;position:relative}.form-addons-container{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px;width:auto}.form-addons-container .form-addon{-webkit-box-flex:0;-ms-flex:0 100%;flex:0 100%;-webkit-box-sizing:border-box;box-sizing:border-box;margin-bottom:30px;padding:0 15px}.form-addons-container .form-addon .form-addon-inner{padding:20px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:5px;background:#fff;-webkit-box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);position:relative;height:100%}.form-addons-container .form-addon .addon-switch{position:absolute;right:10px;top:10px}.form-addons-container .addon-name i{font-size:30px;margin-bottom:20px;display:inline-block}.form-addons-container .addon-title{margin-top:0;margin-bottom:5px;font-size:17px}.form-addons-container .addon-desc{font-size:14px}.form-addons-container .form-addon.form-addons-section-title{-webkit-box-flex:inherit;-ms-flex:inherit;flex:inherit;width:100%;max-width:100%;-ms-flex-preferred-size:auto;flex-basis:auto;background:transparent;-webkit-box-shadow:none;box-shadow:none;margin-bottom:40px}.form-addons-container .form-addon.form-addons-section-title .form-addon-inner{border-left:4px solid #3498db}.form-addons-container>.form-addon.form-addons-section-title:not(:first-child){margin-top:50px}.form-addons-container .form-addon.form-addons-section-title .addon-switch{display:none}.form-addons-container .form-addon.form-addons-section-title .addon-title{font-size:24px;font-weight:500;text-align:unset;margin-bottom:0}.stratum-settings-submit.stratum-settings-submit-top{position:absolute;top:0;left:0;width:100%;z-index:1}.stratum-settings-submit .stratum-settings-submit-top-inner{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;background:#fff;padding:20px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);border-radius:5px}.stratum-settings-submit.stratum-settings-submit-top h3{margin:0;line-height:normal}.stratum-settings-submit.stratum-settings-submit-top p{margin:0;padding:0}.stratum-settings-submit .button{padding:5px 10px 5px 10px;border-radius:5px;height:unset;line-height:normal;font-weight:600;font-size:14px;background:#3498db;border:0;-webkit-box-shadow:none;box-shadow:none;text-shadow:none;-webkit-transition:all .5s;-o-transition:all .5s;transition:all .5s}.stratum-settings-wrap .description_button{text-align:center}.stratum-settings-wrap .description_button.large{width:100%}.stratum-settings-submit .button:hover,.stratum-settings-submit .button:focus{background:#2980b9}.stratum-settings-wrap .form-table{background:#fff;-webkit-box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);border-radius:5px}.stratum-settings-wrap .form-table th{padding:20px 10px 20px 20px}.stratum-settings-wrap .form-table td{padding:20px 10px}.wrap.stratum-wrap.about-wrap{background:#fff;-webkit-box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);box-shadow:0px 5px 18px 0px rgba(0,4,32,0.08);padding:2.5em;margin-left:0}.wrap.stratum-wrap.about-wrap .wp-badge{margin:0;right:20px;top:20px}.about-wrap.stratum-settings-wrap .nav-tab-wrapper{margin-bottom:25px;border-bottom:1px solid #e2e1e1}.about-wrap.stratum-settings-wrap.stratum-settings-sections-yes .nav-tab-wrapper{padding-top:130px}.about-wrap.stratum-settings-wrap.stratum-settings-sections-no .form-aLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
.api-key-description{margin-top:10px}.elementor-control-manage_templates.elementor-control-type-button .elementor-button{padding:5px 10px 5px 10px;text-transform:capitalize}.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-fields{position:relative !important;left:0 !important;top:0 !important;height:auto !important}.stratum-disable-control.elementor-control-type-repeater .elementor-button-wrapper>button,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-duplicate,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-remove{position:relative}.stratum-disable-control.elementor-control-type-repeater .elementor-button-wrapper>button,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-duplicate,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-remove{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stratum-disable-control.elementor-control-type-repeater .elementor-button-wrapper>button::-moz-selection, .stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-duplicate::-moz-selection, .stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-remove::-moz-selection{color:currentColor;background:none}.stratum-disable-control.elementor-control-type-repeater .elementor-button-wrapper>button::selection,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-duplicate::selection,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-remove::selection{color:currentColor;background:none}.stratum-disable-control.elementor-control-type-repeater .elementor-button-wrapper>button::-moz-selection,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-duplicate::-moz-selection,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-remove::-moz-selection{color:currentColor;background:none}.stratum-disable-control.elementor-control-type-repeater .elementor-button-wrapper>button:before,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-duplicate:before,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-remove:before{content:'';display:block;background-color:rgba(255,255,255,0.6);position:absolute;top:-3px;right:-3px;bottom:-3px;left:-3px;z-index:1}.stratum-disable-control.elementor-control-type-repeater .elementor-button-wrapper>button:after,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-duplicate:after,.stratum-disable-control.elementor-control-type-repeater .elementor-repeater-tool-remove:after{content:'pro';position:absolute;display:block;right:-18px;top:-6px;background-color:#404040;color:#fff;padding:4px 5px 4px 5px;border-radius:2px;font-size:11px;z-index:2}.stratum-disable-control:not(.elementor-control-type-repeater),.stratum-disable-control:not(.elementor-control-type-repeater) input,.stratum-disable-control:not(.elementor-control-type-repeater) select,.stratum-disable-control:not(.elementor-control-type-repeater) button{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.stratum-disable-control:not(.elementor-control-type-repeater)::-moz-selection, .stratum-disable-control:not(.elementor-control-type-repeater) input::-moz-selection, .stratum-disable-control:not(.elementor-control-type-repeater) select::-moz-selection, .stratum-disable-control:not(.elementor-control-type-repeater) button::-moz-selection{color:currentColor;background:none}.stratum-disable-control:not(.elementor-control-type-repeater)::selection,.stratum-disable-control:not(.elementor-control-type-repeater) input::selection,.stratum-disable-control:not(.elementor-control-type-repeater) select::selection,.stratum-disable-control:not(.elementor-control-type-repeater) button::selection{color:currentColor;background:none}.stratum-disable-control:not(.elementor-control-type-repeater)::-moz-selection,.stratum-disable-control:not(.elementor-control-type-repeater) input::-moz-selection,.stratum-disable-control:not(.elementor-control-type-repeater) select::-moz-selection,.stratum-disable-control:not(.elementor-control-type-repeater) button::-moz-selection{color:currentColor;background:none}.stratum-disable-control:not(.elementor-control-type-repeater) .elementor-control-content{position:relative}.stratum-disable-control:not(.elementor-control-type-repeater) .elementor-control-content:before{content:'';display:block;background-color:rgba(255,255,255,0.6);position:absolute;top:-3px;right:-3px;bottom:-3px;left:-3px;z-index:1}.stratum-disable-control:not(.elementor-control-type-repeater) .elementor-control-content:after{content:'pro';position:absolute;display:block;right:-3px;top:-3px;background-color:#404040;color:#fff;padding:4px 5px 4px 5px;border-radius:2px;fontLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
@font-face{font-family:"stratum";src:url("../fonts/stratum.eot");src:url("../fonts/stratum.eot?#iefix") format("eot"),url("../fonts/stratum.woff") format("woff"),url("../fonts/stratum.ttf") format("truetype"),url("../fonts/stratum.svg#stratum") format("svg")}[class^="stratum-icon-"],[class*=" stratum-icon-"]{font-family:"stratum";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:normal;font-size:inherit;line-height:1;text-decoration:none;text-transform:none}[class^="stratum-icon-"]:before,[class*=" stratum-icon-"]:before{display:block}.stratum-icon-advanced-accordion:before{content:"\E001"}.stratum-icon-advanced-google-map:before{content:"\E002"}.stratum-icon-advanced-posts:before{content:"\E003"}.stratum-icon-advanced-slider:before{content:"\E004"}.stratum-icon-advanced-tabs:before{content:"\E005"}.stratum-icon-banner:before{content:"\E006"}.stratum-icon-circle-progress-bar:before{content:"\E007"}.stratum-icon-countdown:before{content:"\E008"}.stratum-icon-counter:before{content:"\E009"}.stratum-icon-flip-box:before{content:"\E00A"}.stratum-icon-horizontal-timeline:before{content:"\E00B"}.stratum-icon-image-accordion:before{content:"\E00C"}.stratum-icon-image-hotspot:before{content:"\E00D"}.stratum-icon-instagram:before{content:"\E00E"}.stratum-icon-lottie-animations:before{content:"\E00F"}.stratum-icon-masonry-gallery:before{content:"\E010"}.stratum-icon-price-list:before{content:"\E011"}.stratum-icon-price-menu:before{content:"\E012"}.stratum-icon-price-table:before{content:"\E013"}.stratum-icon-testimonial-carousel:before{content:"\E014"}.stratum-icon-vertical-timeline:before{content:"\E015"}
|
||||
@@ -0,0 +1 @@
|
||||
.stratum-icon{font-style:normal}.stratum-icon-like{font-family:'Font Awesome 5 Free';font-weight:900}.stratum-icon-like:before{content:'\f004'}.stratum-icon-comment{font-family:'Font Awesome 5 Free';font-weight:900}.stratum-icon-comment:before{content:'\f075'}.masonry-grid .masonry-item{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;float:left;overflow:hidden}.masonry-grid .masonry-col-2{width:50%}.masonry-grid .masonry-col-3{width:33.33333333333333%}.masonry-grid .masonry-col-4{width:25%}.masonry-grid .masonry-col-5{width:20%}.masonry-grid .masonry-col-6{width:16.66666666666667%}.masonry-grid .masonry-col-7{width:14.28571428571429%}.masonry-grid .masonry-col-8{width:12.5%}.masonry-grid .masonry-col-9{width:11.11111111111111%}.masonry-grid .masonry-col-10{width:10%}.masonry-grid.animate_on_scroll .masonry-item{opacity:0}body.elementor-editor-active .elementor.elementor-edit-mode .elementor-element.elementor-section.stratum-coverflow-full-width,.elementor-section.elementor-section-stretched.stratum-coverflow-full-width{overflow:hidden}.elementor-section.elementor-section-stretched.stratum-coverflow-full-width .stratum-coverflow-visible .swiper-container.swiper-container-coverflow.swiper-container-horizontal,.elementor-section.elementor-section-stretched.stratum-coverflow-full-width .stratum-coverflow-visible .swiper.swiper-coverflow.swiper-horizontal{overflow:visible}.stratum-swiper-button-prev,.stratum-swiper-button-next{text-align:center;font-family:'Font Awesome 5 Free';font-weight:900;position:absolute;top:50%;z-index:10;cursor:pointer;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);outline:none;color:#fff;height:100%;font-size:16px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swiper-vertical ~ .stratum-swiper-button-prev,.swiper-vertical ~ .stratum-swiper-button-next,.swiper-container-vertical ~ .stratum-swiper-button-prev,.swiper-container-vertical ~ .stratum-swiper-button-next{top:0;width:100%;height:auto;text-align:center;-webkit-transform:translateY(0%);-ms-transform:translateY(0%);transform:translateY(0%);overflow:hidden}.swiper-vertical ~ .stratum-swiper-button-next,.swiper-container-vertical ~ .stratum-swiper-button-next{top:initial;bottom:0}.stratum-swiper-button-prev{left:0px;right:auto}.stratum-swiper-button-next{right:0px;left:auto}.stratum-swiper-button-prev:before{content:"\f053"}.swiper-vertical ~ .stratum-swiper-button-prev:before,.swiper-container-vertical ~ .stratum-swiper-button-prev:before{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.stratum-swiper-button-next:after{content:"\f054"}.swiper-vertical ~ .stratum-swiper-button-next:after,.swiper-container-vertical ~ .stratum-swiper-button-next:after{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.stratum-navigation-bullets-squared .swiper-pagination.swiper-pagination-bullets .swiper-pagination-bullet{border-radius:0}.stratum-navigation-scrollbar-squared .swiper-scrollbar .swiper-scrollbar-drag{border-radius:0}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{-webkit-transform:scale(0.66);-ms-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{-webkit-transform:scale(0.66);-ms-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33)}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:10px}.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;-webkit-transition:.2s transform,.2s top;-o-transition:.2s transform,.2s top;transition:.2s transLine truncated
|
||||
Binary file not shown.
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<font id="stratum" horiz-adv-x="1024">
|
||||
<font-face font-family="stratum"
|
||||
units-per-em="1024" ascent="960"
|
||||
descent="-64" />
|
||||
<missing-glyph horiz-adv-x="0" />
|
||||
<glyph glyph-name="advanced-accordion"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M841.1428571428571 758.8571428571429C861.2571428571429 758.8571428571429 877.7142857142857 742.4000000000001 877.7142857142857 722.2857142857143V429.7142857142858C877.7142857142857 409.6 861.2571428571429 393.1428571428572 841.1428571428571 393.1428571428572H182.8571428571428C162.7428571428571 393.1428571428572 146.2857142857143 409.6 146.2857142857143 429.7142857142858V722.2857142857143C146.2857142857143 742.4000000000001 162.7428571428571 758.8571428571429 182.8571428571428 758.8571428571429H841.1428571428571M841.1428571428571 795.4285714285714H182.8571428571428C142.6285714285714 795.4285714285714 109.7142857142857 762.5142857142857 109.7142857142857 722.2857142857143V429.7142857142858C109.7142857142857 389.4857142857143 142.6285714285714 356.5714285714287 182.8571428571428 356.5714285714287H841.1428571428571C881.3714285714286 356.5714285714287 914.2857142857142 389.4857142857143 914.2857142857142 429.7142857142858V722.2857142857143C914.2857142857142 762.5142857142857 881.3714285714286 795.4285714285714 841.1428571428571 795.4285714285714L841.1428571428571 795.4285714285714zM292.5714285714286 941.7142857142858H841.1428571428571V905.1428571428572H292.5714285714286V941.7142857142858zM219.4285714285714 649.1428571428571H804.5714285714286V612.5714285714287H219.4285714285714V649.1428571428571zM219.4285714285714 539.4285714285714H585.1428571428571V502.8571428571429H219.4285714285714V539.4285714285714zM292.5714285714286 246.8571428571429H841.1428571428571V210.2857142857143H292.5714285714286V246.8571428571429zM109.7142857142857 941.7142857142858L219.4285714285714 941.7142857142858L164.5714285714286 886.8571428571429zM109.7142857142857 246.8571428571429L219.4285714285714 246.8571428571429L164.5714285714286 192z" />
|
||||
<glyph glyph-name="advanced-google-map"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M877.7142857142857 850.2857142857143C877.7142857142857 900.7908571428572 836.7908571428571 941.7142857142858 786.2857142857142 941.7142857142858S694.8571428571428 900.7908571428572 694.8571428571428 850.2857142857143S735.7805714285714 758.8571428571429 786.2857142857142 758.8571428571429S877.7142857142857 799.7805714285714 877.7142857142857 850.2857142857143zM731.4285714285713 850.2857142857143C731.4285714285713 880.5302857142857 756.0411428571427 905.1428571428572 786.2857142857142 905.1428571428572S841.1428571428571 880.5302857142857 841.1428571428571 850.2857142857143S816.5302857142857 795.4285714285714 786.2857142857142 795.4285714285714S731.4285714285713 820.0411428571429 731.4285714285713 850.2857142857143zM1024 850.2857142857143C1024 981.577142857143 917.5771428571428 1088 786.2857142857142 1088C687.3965714285714 1088 602.6971428571428 1027.6205714285713 566.8571428571428 941.7142857142858H73.1428571428571C32.7314285714286 941.7142857142858 0 908.9828571428573 0 868.5714285714286V137.1428571428572C0 96.7314285714286 32.7314285714286 64 73.1428571428571 64H877.7142857142857C918.1257142857143 64 950.8571428571428 96.7314285714286 950.8571428571428 137.1428571428572V663.1497142857143C991.6342857142856 732.0502857142858 1024 801.9017142857142 1024 850.2857142857143zM786.2857142857142 1051.4285714285713C897.2068571428572 1051.4285714285713 987.4285714285714 961.2068571428572 987.4285714285714 850.2857142857143C987.4285714285714 765.5497142857143 860.7451428571428 584.4845714285714 786.2857142857142 488.4480000000001C711.8262857142856 584.4845714285714 585.1428571428571 765.5497142857143 585.1428571428571 850.2857142857143C585.1428571428571 961.2068571428572 675.3645714285714 1051.4285714285713 786.2857142857142 1051.4285714285713zM36.5714285714286 868.5714285714286C36.5714285714286 888.7222857142857 52.992 905.1428571428572 73.1428571428571 905.1428571428572H555.1908571428571C555.1908571428571 905.1428571428572 555.1908571428571 905.1428571428572 555.1908571428571 905.1428571428572C551.0217142857142 887.5154285714286 548.5714285714286 869.1931428571429 548.5714285714286 850.2857142857143C548.5714285714286 808.4114285714286 572.8548571428571 750.4457142857143 605.8057142857143 690.9074285714286L603.4285714285714 693.2845714285716L38.3634285714286 128.2194285714286C37.632 131.1451428571429 36.5714285714286 133.9977142857144 36.5714285714286 137.1428571428572V868.5714285714286zM73.1428571428571 100.5714285714287C69.9977142857143 100.5714285714287 67.1451428571429 101.6320000000001 64.2194285714286 102.3634285714286L475.4285714285714 513.5725714285715L886.6377142857142 102.3634285714286C883.712 101.6320000000001 880.8594285714285 100.5714285714287 877.7142857142857 100.5714285714287H73.1428571428571zM914.2857142857142 137.1428571428572C914.2857142857142 133.9977142857144 913.2251428571428 131.1451428571429 912.4937142857144 128.2194285714286L501.2845714285714 539.4285714285714L622.9211428571429 661.065142857143C692.6628571428572 543.7074285714286 786.2857142857142 429.7142857142858 786.2857142857142 429.7142857142858S851.968 509.8422857142857 914.2857142857142 604.7451428571428V137.1428571428572zM133.1931428571429 536.2834285714285C141.1291428571429 530.7977142857143 151.04 526.4091428571429 162.9622857142857 523.1177142857143C174.8114285714285 519.7897142857144 188.8548571428571 518.1805714285715 204.9828571428571 518.1805714285715C223.3417142857143 518.1805714285715 239.5062857142857 520.4114285714286 253.5497142857143 524.8365714285715C267.5565714285715 529.2617142857143 279.3325714285714 535.1862857142858 288.8045714285714 542.5737142857143C298.3131428571429 549.9611428571429 305.4445714285714 558.2994285714286 310.272 567.5885714285714C315.0994285714285 576.8411428571428 317.4765714285714 586.4228571428572 317.4765714285714 596.2605714285714C317.4765714285714 603.3188571428572 316.6354285714285 609.5360000000001 314.88 614.9485714285714C313.1245714285714 620.3611428571428 310.6377142857143 625.2982857142857 307.5291428571428 629.8331428571429C304.384 634.3314285714285 300.8 638.5005714285714 296.8502857142857 642.3771428571429C292.864 646.2537142857143 288.7314285714285 650.0937142857143 284.3062857142857 653.8971428571429L268.288 665.4902857142857C265.6182857142857 667.1725714285715 262.656 669.3302857142858 259.3645714285714 672.1097142857143C256.1097142857143 674.816 254.5005714285714 678.5097142857143 254.5005714285714 683.1177142857143C254.5005714285714 687.7988571428571 255.8902857142857 691.6754285714285 258.6697142857143 694.7108571428571C261.4857142857143 697.7828571428571 264.2651428571428 700.7085714285714 267.1177142857143 703.5245714285713L281.0148571428571 714.1668571428571C285.5131428571429 717.7874285714286 289.536 721.92 292.9737142857143 726.528C296.3748571428571 731.0262857142857 299.1908571428571 736.1828571428572 301.3485714285714 741.9245714285714C303.5794285714286 747.6297142857143 304.64 754.2125714285714 304.64 761.5634285714286C304.64 769.24342857142Line truncated
|
||||
<glyph glyph-name="advanced-posts"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M329.1428571428571 1014.8571428571428C349.2571428571429 1014.8571428571428 365.7142857142857 998.4 365.7142857142857 978.2857142857144V722.2857142857143C365.7142857142857 702.1714285714286 349.2571428571429 685.7142857142858 329.1428571428571 685.7142857142858H73.1428571428571C53.0285714285714 685.7142857142858 36.5714285714286 702.1714285714286 36.5714285714286 722.2857142857143V978.2857142857144C36.5714285714286 998.4 53.0285714285714 1014.8571428571428 73.1428571428571 1014.8571428571428H329.1428571428571M329.1428571428571 1051.4285714285713H73.1428571428571C32.9142857142857 1051.4285714285713 0 1018.5142857142858 0 978.2857142857144V722.2857142857143C0 682.0571428571429 32.9142857142857 649.1428571428571 73.1428571428571 649.1428571428571H329.1428571428571C369.3714285714285 649.1428571428571 402.2857142857143 682.0571428571429 402.2857142857143 722.2857142857143V978.2857142857144C402.2857142857143 1018.5142857142858 369.3714285714285 1051.4285714285713 329.1428571428571 1051.4285714285713L329.1428571428571 1051.4285714285713zM475.4285714285714 978.2857142857144H1024V941.7142857142858H475.4285714285714V978.2857142857144zM475.4285714285714 868.5714285714286H1024V832H475.4285714285714V868.5714285714286zM475.4285714285714 758.8571428571429H841.1428571428571V722.2857142857143H475.4285714285714V758.8571428571429zM329.1428571428571 466.2857142857143C349.2571428571429 466.2857142857143 365.7142857142857 449.8285714285716 365.7142857142857 429.7142857142858V173.7142857142858C365.7142857142857 153.6 349.2571428571429 137.1428571428572 329.1428571428571 137.1428571428572H73.1428571428571C53.0285714285714 137.1428571428572 36.5714285714286 153.6 36.5714285714286 173.7142857142858V429.7142857142858C36.5714285714286 449.8285714285716 53.0285714285714 466.2857142857143 73.1428571428571 466.2857142857143H329.1428571428571M329.1428571428571 502.8571428571429H73.1428571428571C32.9142857142857 502.8571428571429 0 469.9428571428572 0 429.7142857142858V173.7142857142858C0 133.4857142857143 32.9142857142857 100.5714285714287 73.1428571428571 100.5714285714287H329.1428571428571C369.3714285714285 100.5714285714287 402.2857142857143 133.4857142857143 402.2857142857143 173.7142857142858V429.7142857142858C402.2857142857143 469.9428571428572 369.3714285714285 502.8571428571429 329.1428571428571 502.8571428571429L329.1428571428571 502.8571428571429zM475.4285714285714 429.7142857142858H1024V393.1428571428572H475.4285714285714V429.7142857142858zM475.4285714285714 320H1024V283.4285714285715H475.4285714285714V320zM475.4285714285714 210.2857142857143H841.1428571428571V173.7142857142858H475.4285714285714V210.2857142857143z" />
|
||||
<glyph glyph-name="advanced-slider"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M950.8571428571428 941.7142857142858H877.7142857142857V905.1428571428572H950.8571428571428C969.1428571428572 905.1428571428572 987.4285714285714 890.5142857142857 987.4285714285714 868.5714285714286V502.8571428571429C987.4285714285714 484.5714285714286 969.1428571428572 466.2857142857143 950.8571428571428 466.2857142857143H877.7142857142857V429.7142857142858H950.8571428571428C991.0857142857142 429.7142857142858 1024 462.6285714285714 1024 502.8571428571429V868.5714285714286C1024 908.8 991.0857142857142 941.7142857142858 950.8571428571428 941.7142857142858zM146.2857142857143 466.2857142857143H73.1428571428571C54.8571428571429 466.2857142857143 36.5714285714286 484.5714285714286 36.5714285714286 502.8571428571429V868.5714285714286C36.5714285714286 890.5142857142857 54.8571428571429 905.1428571428572 73.1428571428571 905.1428571428572H146.2857142857143V941.7142857142858H73.1428571428571C32.9142857142857 941.7142857142858 0 908.8 0 868.5714285714286V502.8571428571429C0 462.6285714285714 32.9142857142857 429.7142857142858 73.1428571428571 429.7142857142858H146.2857142857143V466.2857142857143zM438.8571428571429 210.2857142857143A73.1428571428571 73.1428571428571 0 0 1 585.1428571428571 210.2857142857143A73.1428571428571 73.1428571428571 0 0 1 438.8571428571429 210.2857142857143M292.5714285714286 210.2857142857143A36.5714285714286 36.5714285714286 0 0 1 365.7142857142857 210.2857142857143A36.5714285714286 36.5714285714286 0 0 1 292.5714285714286 210.2857142857143M548.5714285714286 758.8571428571429A36.5714285714286 36.5714285714286 0 0 1 621.7142857142857 758.8571428571429A36.5714285714286 36.5714285714286 0 0 1 548.5714285714286 758.8571428571429M658.2857142857142 210.2857142857143A36.5714285714286 36.5714285714286 0 0 1 731.4285714285713 210.2857142857143A36.5714285714286 36.5714285714286 0 0 1 658.2857142857142 210.2857142857143M768 1014.8571428571428H256C215.7714285714286 1014.8571428571428 182.8571428571428 981.9428571428572 182.8571428571428 941.7142857142858V565.3942857142857V539.4285714285714V429.7142857142858C182.8571428571428 389.4857142857143 215.7714285714286 356.5714285714287 256 356.5714285714287H768C808.2285714285714 356.5714285714287 841.1428571428571 389.4857142857143 841.1428571428571 429.7142857142858V539.4285714285714V565.3942857142857V941.7142857142858C841.1428571428571 981.9428571428572 808.2285714285714 1014.8571428571428 768 1014.8571428571428zM768 393.1428571428572H256C237.7142857142857 393.1428571428572 219.4285714285714 411.4285714285715 219.4285714285714 429.7142857142858V550.0342857142857L402.2857142857143 732.8914285714286L585.1428571428571 550.0342857142857L694.8571428571428 659.7485714285715L804.5714285714286 550.0342857142857V429.7142857142858C804.5714285714286 411.4285714285715 786.2857142857142 393.1428571428572 768 393.1428571428572zM694.8571428571428 711.6800000000001L585.1428571428571 601.9657142857143L402.2857142857143 784.8228571428572L219.4285714285714 601.9657142857143V941.7142857142858C219.4285714285714 963.6571428571428 237.7142857142857 978.2857142857144 256 978.2857142857144H768C786.2857142857142 978.2857142857144 804.5714285714286 963.6571428571428 804.5714285714286 941.7142857142858V601.9657142857143L694.8571428571428 711.6800000000001z" />
|
||||
<glyph glyph-name="advanced-tabs"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M950.8571428571428 868.5714285714286H914.2857142857142V905.1428571428572C914.2857142857142 945.3714285714286 881.3714285714286 978.2857142857144 841.1428571428571 978.2857142857144H731.4285714285713H694.8571428571428H548.5714285714286H512H355.4742857142857C343.04 1000.2285714285714 319.6342857142857 1014.8571428571428 292.5714285714286 1014.8571428571428H73.1428571428571C32.9142857142857 1014.8571428571428 0 981.9428571428572 0 941.7142857142858V795.4285714285714V502.8571428571429V210.2857142857143C0 170.0571428571428 32.9142857142857 137.1428571428572 73.1428571428571 137.1428571428572H950.8571428571428C991.0857142857142 137.1428571428572 1024 170.0571428571428 1024 210.2857142857143V795.4285714285714C1024 835.6571428571428 991.0857142857142 868.5714285714286 950.8571428571428 868.5714285714286zM731.4285714285713 941.7142857142858H841.1428571428571C861.2571428571429 941.7142857142858 877.7142857142857 925.2571428571428 877.7142857142857 905.1428571428572V868.5714285714286H731.4285714285713V941.7142857142858zM548.5714285714286 941.7142857142858H694.8571428571428V868.5714285714286H548.5714285714286V941.7142857142858zM512 941.7142857142858V868.5714285714286H365.7142857142857V941.7142857142858H512zM987.4285714285714 210.2857142857143C987.4285714285714 190.1714285714286 970.9714285714286 173.7142857142858 950.8571428571428 173.7142857142858H73.1428571428571C53.0285714285714 173.7142857142858 36.5714285714286 190.1714285714286 36.5714285714286 210.2857142857143V502.8571428571429V795.4285714285714V941.7142857142858C36.5714285714286 961.8285714285714 53.0285714285714 978.2857142857144 73.1428571428571 978.2857142857144H292.5714285714286C312.6857142857143 978.2857142857144 329.1428571428571 961.8285714285714 329.1428571428571 941.7142857142858V868.5714285714286V832H365.7142857142857H512H548.5714285714286H694.8571428571428H731.4285714285713H912.8228571428572H950.8571428571428C970.9714285714286 832 987.4285714285714 815.5428571428572 987.4285714285714 795.4285714285714V210.2857142857143z" />
|
||||
<glyph glyph-name="banner"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M950.8571428571428 905.1428571428572C970.9714285714286 905.1428571428572 987.4285714285714 888.6857142857143 987.4285714285714 868.5714285714286V283.4285714285715C987.4285714285714 263.3142857142857 970.9714285714286 246.8571428571429 950.8571428571428 246.8571428571429H73.1428571428571C53.0285714285714 246.8571428571429 36.5714285714286 263.3142857142857 36.5714285714286 283.4285714285715V868.5714285714286C36.5714285714286 888.6857142857143 53.0285714285714 905.1428571428572 73.1428571428571 905.1428571428572H950.8571428571428M950.8571428571428 941.7142857142858H73.1428571428571C32.9142857142857 941.7142857142858 0 908.8 0 868.5714285714286V283.4285714285715C0 243.2000000000001 32.9142857142857 210.2857142857143 73.1428571428571 210.2857142857143H950.8571428571428C991.0857142857142 210.2857142857143 1024 243.2000000000001 1024 283.4285714285715V868.5714285714286C1024 908.8 991.0857142857142 941.7142857142858 950.8571428571428 941.7142857142858L950.8571428571428 941.7142857142858zM182.8571428571428 758.8571428571429H841.1428571428571V722.2857142857143H182.8571428571428V758.8571428571429zM182.8571428571428 649.1428571428571H841.1428571428571V612.5714285714287H182.8571428571428V649.1428571428571zM694.8571428571428 466.2857142857143V429.7142857142858H329.1428571428571V466.2857142857143H694.8571428571428M731.4285714285713 502.8571428571429H292.5714285714286V393.1428571428572H731.4285714285713V502.8571428571429L731.4285714285713 502.8571428571429z" />
|
||||
<glyph glyph-name="circle-progress-bar"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M512 1088V1051.4285714285713C774.2171428571429 1051.4285714285713 987.4285714285714 838.2171428571429 987.4285714285714 576S774.2171428571429 100.5714285714287 512 100.5714285714287C262.2171428571429 100.5714285714287 57.0514285714286 294.4000000000001 38.4 539.4285714285714H1.8285714285714C1.8285714285714 539.4285714285714 1.8285714285714 539.4285714285714 1.8285714285714 539.4285714285714C2.9257142857143 522.9714285714286 5.12 506.88 7.68 491.1542857142857C7.68 490.7885714285713 7.68 490.4228571428572 7.68 490.0571428571428C10.24 474.6971428571428 13.5314285714286 459.3371428571428 17.5542857142857 444.3428571428572C17.92 443.6114285714285 17.92 442.88 18.2857142857143 442.1485714285715C22.3085714285714 427.5200000000001 26.6971428571429 413.2571428571429 31.8171428571429 399.3600000000002C32.1828571428571 398.2628571428573 32.5485714285714 396.8000000000001 33.28 395.7028571428572C38.4 382.1714285714286 43.8857142857143 369.0057142857144 50.1028571428571 356.2057142857144C50.8342857142857 354.377142857143 51.5657142857143 352.9142857142858 52.6628571428572 351.0857142857144C58.88 338.6514285714287 65.0971428571429 326.5828571428572 72.0457142857143 314.8800000000001C73.5085714285714 312.6857142857146 74.6057142857143 310.4914285714288 76.0685714285714 308.2971428571431C83.0171428571429 297.3257142857144 89.9657142857143 286.3542857142859 97.6457142857143 276.1142857142859C99.4742857142857 273.5542857142859 101.6685714285714 270.9942857142859 103.4971428571429 268.0685714285717C110.8114285714286 258.194285714286 118.4914285714286 248.6857142857146 126.5371428571429 239.5428571428573C129.0971428571429 236.6171428571431 132.0228571428571 233.6914285714288 134.5828571428571 230.4000000000002C142.2628571428572 221.9885714285716 150.3085714285715 213.577142857143 158.72 205.5314285714288C162.3771428571429 202.2400000000002 165.6685714285714 198.9485714285717 169.3257142857143 195.6571428571431C177.3714285714286 188.3428571428574 185.4171428571429 181.394285714286 193.8285714285714 174.4457142857145C198.2171428571429 170.7885714285717 202.9714285714286 167.4971428571431 207.36 164.2057142857145C215.4057142857143 158.354285714286 223.4514285714286 152.1371428571432 231.8628571428572 146.6514285714288C237.3485714285715 142.9942857142859 242.8342857142857 139.7028571428573 248.32 136.4114285714288C256.3657142857143 131.6571428571431 264.4114285714286 126.9028571428573 272.8228571428571 122.1485714285716C279.4057142857143 118.857142857143 285.9885714285715 115.9314285714287 292.5714285714286 112.6400000000001C300.6171428571429 108.9828571428573 308.2971428571429 104.96 316.3428571428572 101.6685714285716C324.0228571428572 98.7428571428573 331.7028571428571 95.8171428571429 339.3828571428572 93.257142857143C347.0628571428572 90.6971428571429 354.3771428571429 87.7714285714287 362.0571428571429 85.2114285714287C370.8342857142858 82.6514285714287 379.9771428571429 80.457142857143 388.7542857142858 78.2628571428572C395.7028571428571 76.4342857142858 402.6514285714286 74.6057142857143 409.9657142857143 73.1428571428572C420.5714285714286 70.9485714285715 431.1771428571429 69.8514285714286 442.1485714285715 68.3885714285715C448.0000000000001 67.657142857143 453.8514285714286 66.5600000000001 459.7028571428572 65.8285714285715C477.6228571428571 64.7314285714286 494.8114285714285 64 512 64C794.6971428571428 64 1024 293.3028571428572 1024 576S794.6971428571428 1088 512 1088zM159.4514285714286 460.4342857142857L272.8228571428572 706.5600000000001H123.6114285714286V747.1542857142857H322.1942857142857V714.9714285714285L209.1885714285714 460.4342857142857H159.4514285714286zM453.8514285714285 639.6342857142857C482.7428571428571 639.6342857142857 505.7828571428571 631.9542857142858 522.6057142857143 616.5942857142857S547.8399999999999 580.3885714285714 547.8399999999999 554.0571428571428C547.8399999999999 523.3371428571428 538.3314285714285 499.5657142857143 518.9485714285713 482.3771428571428C499.9314285714285 465.1885714285714 472.5028571428571 456.4114285714285 437.0285714285713 456.4114285714285C404.8457142857142 456.4114285714285 379.6114285714285 461.5314285714285 361.3257142857142 471.7714285714286V513.8285714285715C371.9314285714284 507.9771428571429 383.9999999999999 503.2228571428573 397.8971428571428 499.9314285714287C411.7942857142856 496.6400000000001 424.5942857142856 495.1771428571429 436.2971428571428 495.1771428571429C457.1428571428571 495.1771428571429 472.8685714285713 499.9314285714287 483.8399999999999 509.0742857142859C494.8114285714285 518.217142857143 500.2971428571428 532.1142857142859 500.2971428571428 550.0342857142858C500.2971428571428 584.4114285714287 478.3542857142857 601.6000000000001 434.8342857142856 601.6000000000001C428.6171428571427 601.6000000000001 420.9371428571427 600.8685714285716 412.1599999999999 599.7714285714287C403.0171428571428 598.6742857142858 395.3371428571428 597.2114285714287 388.3885714285713 595.3828571428573L367.9085714285713 607.4514285714288L378Line truncated
|
||||
<glyph glyph-name="countdown"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M966.3098591549297 1059.1549295774648H850.9295774647887V1073.5774647887324C850.9295774647887 1081.5098591549295 844.4394366197183 1088 836.5070422535211 1088S822.0845070422536 1081.5098591549295 822.0845070422536 1073.5774647887324V1059.1549295774648H201.9154929577465V1073.5774647887324C201.9154929577465 1081.5098591549295 195.4253521126761 1088 187.4929577464789 1088S173.0704225352113 1081.5098591549295 173.0704225352113 1073.5774647887324V1059.1549295774648H57.6901408450704C25.816338028169 1059.1549295774648 0 1033.3385915492959 0 1001.4647887323944V121.6901408450704C0 89.8163380281691 25.816338028169 64 57.6901408450704 64H966.3098591549297C998.183661971831 64 1024 89.8163380281691 1024 121.6901408450704V1001.4647887323944C1024 1033.3385915492959 998.183661971831 1059.1549295774648 966.3098591549297 1059.1549295774648zM995.1549295774648 121.6901408450704C995.1549295774648 105.8253521126761 982.1746478873238 92.8450704225352 966.3098591549297 92.8450704225352H57.6901408450704C41.8253521126761 92.8450704225352 28.8450704225352 105.8253521126761 28.8450704225352 121.6901408450704V813.9718309859154H995.1549295774648V121.6901408450704zM995.1549295774648 842.8169014084507H28.8450704225352V1001.4647887323944C28.8450704225352 1017.3295774647888 41.8253521126761 1030.3098591549297 57.6901408450704 1030.3098591549297H173.0704225352113V1015.887323943662C173.0704225352113 1007.9549295774648 179.5605633802817 1001.4647887323944 187.4929577464789 1001.4647887323944S201.9154929577465 1007.9549295774648 201.9154929577465 1015.887323943662V1030.3098591549297H822.0845070422536V1015.887323943662C822.0845070422536 1007.9549295774648 828.574647887324 1001.4647887323944 836.5070422535211 1001.4647887323944S850.9295774647887 1007.9549295774648 850.9295774647887 1015.887323943662V1030.3098591549297H966.3098591549297C982.1746478873238 1030.3098591549297 995.1549295774648 1017.3295774647888 995.1549295774648 1001.4647887323944V842.8169014084507zM504.7887323943662 626.4788732394366V597.6338028169014H662.7154929577465C647.4276056338028 576.7211267605633 633.7261971830986 554.5104225352112 621.7554929577465 531.4343661971831C611.0828169014085 510.521690140845 591.0354929577464 466.8214084507041 577.3340845070422 407.689014084507C567.6709859154929 366.1521126760563 562.9115492957746 323.3171830985915 562.6230985915493 280.338028169014H591.4681690140845C591.7566197183099 321.1538028169014 596.2276056338028 361.6811267605634 605.3138028169014 401.1988732394367C618.2940845070423 457.3025352112676 637.1876056338028 498.550985915493 647.4276056338028 518.3098591549295C663.0039436619718 548.5971830985916 681.7532394366198 577.0095774647887 703.3870422535211 602.9701408450703L723.0016901408451 626.4788732394366H504.7887323943662zM418.2535211267606 309.1830985915493L418.2535211267606 612.056338028169L395.7543661971831 624.0270422535211L309.2191549295775 565.76L325.3723943661972 541.8185915492958L389.4084507042254 584.941971830986L389.4084507042254 309.1830985915493L317.2957746478874 309.1830985915493L317.2957746478874 280.338028169014L389.4084507042254 280.338028169014L418.2535211267606 280.338028169014L490.3661971830986 280.338028169014L490.3661971830986 309.1830985915493z" />
|
||||
<glyph glyph-name="counter"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M914.2857142857142 1088H512H475.4285714285714H73.1428571428571C32.9142857142857 1088 0 1055.0857142857144 0 1014.8571428571428V173.7142857142858C0 133.4857142857143 32.9142857142857 100.5714285714287 73.1428571428571 100.5714285714287H475.4285714285714H512H914.2857142857142C954.5142857142858 100.5714285714287 987.4285714285714 133.4857142857143 987.4285714285714 173.7142857142858V1014.8571428571428C987.4285714285714 1055.0857142857144 954.5142857142858 1088 914.2857142857142 1088zM73.1428571428571 137.1428571428572C54.8571428571429 137.1428571428572 36.5714285714286 155.4285714285715 36.5714285714286 173.7142857142858V1014.8571428571428C36.5714285714286 1033.142857142857 54.8571428571429 1051.4285714285713 73.1428571428571 1051.4285714285713H475.4285714285714V137.1428571428572H73.1428571428571zM950.8571428571428 173.7142857142858C950.8571428571428 155.4285714285715 932.5714285714286 137.1428571428572 914.2857142857142 137.1428571428572H512V1051.4285714285713H914.2857142857142C932.5714285714286 1051.4285714285713 950.8571428571428 1033.142857142857 950.8571428571428 1014.8571428571428V173.7142857142858zM292.5714285714286 429.7142857142858L292.5714285714286 795.4285714285714L256 795.4285714285714L256 795.4285714285714L256 795.4285714285714L160.9142857142857 700.3428571428572L186.5142857142857 674.7428571428571L256 744.2285714285715L256 429.7142857142858L146.2857142857143 429.7142857142858L146.2857142857143 393.1428571428572L402.2857142857143 393.1428571428572L402.2857142857143 429.7142857142858zM768 685.7142857142858L768 941.7142857142858L731.4285714285713 941.7142857142858L731.4285714285713 941.7142857142858L731.4285714285713 941.7142857142858L636.342857142857 846.6285714285715L661.9428571428572 821.0285714285715L731.4285714285713 890.5142857142857L731.4285714285713 685.7142857142858L658.2857142857142 685.7142857142858L658.2857142857142 649.1428571428571L841.1428571428571 649.1428571428571L841.1428571428571 685.7142857142858zM830.1714285714285 415.0857142857144C833.8285714285714 422.4000000000001 837.4857142857142 429.7142857142858 841.1428571428571 440.6857142857143C844.8 477.2571428571429 826.5142857142857 517.4857142857144 789.9428571428572 532.1142857142858C727.7714285714286 557.7142857142858 669.2571428571429 521.1428571428572 658.2857142857142 466.2857142857143H694.8571428571428C702.1714285714285 488.2285714285715 724.1142857142858 502.8571428571429 746.0571428571427 502.8571428571429C778.9714285714284 502.8571428571429 800.9142857142856 477.2571428571429 800.9142857142856 444.3428571428572C800.9142857142856 440.6857142857142 797.2571428571428 437.0285714285715 797.2571428571428 433.3714285714285C797.2571428571428 429.7142857142857 654.6285714285714 279.7714285714286 654.6285714285714 279.7714285714286L654.6285714285714 279.7714285714286V243.2000000000001H837.4857142857142V279.7714285714286H705.8285714285713L830.1714285714285 415.0857142857144z" />
|
||||
<glyph glyph-name="flip-box"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M292.5714285714286 868.5714285714286H731.4285714285713V832H292.5714285714286V868.5714285714286zM292.5714285714286 758.8571428571429H731.4285714285713V722.2857142857143H292.5714285714286V758.8571428571429zM292.5714285714286 649.1428571428571H731.4285714285713V612.5714285714287H292.5714285714286V649.1428571428571zM292.5714285714286 539.4285714285714H585.1428571428571V502.8571428571429H292.5714285714286V539.4285714285714zM841.1428571428571 560.64V941.7142857142858C841.1428571428571 981.9428571428572 808.2285714285714 1014.8571428571428 768 1014.8571428571428H256C215.7714285714286 1014.8571428571428 182.8571428571428 981.9428571428572 182.8571428571428 941.7142857142858V560.64C71.3142857142857 520.4114285714286 0 460.4342857142857 0 393.1428571428572C0 280.8685714285715 197.4857142857143 188.7085714285715 451.6571428571428 175.5428571428572L389.4857142857143 113.3714285714286L415.4514285714286 87.4057142857143L519.68 191.6342857142859L415.4514285714286 295.8628571428574L389.4857142857142 269.897142857143L447.6342857142856 211.7485714285716C202.6057142857143 226.0114285714286 36.5714285714286 313.417142857143 36.5714285714286 393.1428571428572C36.5714285714286 438.4914285714285 91.0628571428571 486.4000000000001 182.8571428571428 521.8742857142857V429.7142857142858C182.8571428571428 389.4857142857143 215.7714285714286 356.5714285714287 256 356.5714285714287H768C808.2285714285714 356.5714285714287 841.1428571428571 389.4857142857143 841.1428571428571 429.7142857142858V521.8742857142857C932.9371428571428 486.4000000000001 987.4285714285714 438.4914285714285 987.4285714285714 393.1428571428572C987.4285714285714 318.537142857143 841.8742857142856 236.6171428571429 621.7142857142857 215.4057142857144V178.8342857142858C851.7485714285714 200.4114285714286 1024 288.1828571428573 1024 393.1428571428572C1024 460.4342857142857 952.6857142857144 520.4114285714286 841.1428571428571 560.64zM804.5714285714286 429.7142857142858C804.5714285714286 409.6 788.1142857142856 393.1428571428572 768 393.1428571428572H256C235.8857142857143 393.1428571428572 219.4285714285714 409.6 219.4285714285714 429.7142857142858V941.7142857142858C219.4285714285714 961.8285714285714 235.8857142857143 978.2857142857144 256 978.2857142857144H768C788.1142857142856 978.2857142857144 804.5714285714286 961.8285714285714 804.5714285714286 941.7142857142858V429.7142857142858z" />
|
||||
<glyph glyph-name="horizontal-timeline"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M475.4285714285714 576.7314285714285V831.2685714285715C475.4285714285714 871.8628571428571 442.1485714285714 905.1428571428572 401.5542857142857 905.1428571428572H72.4114285714286C31.4514285714286 905.1428571428572 -1.4628571428571 871.8628571428571 -1.4628571428571 831.2685714285715V576.7314285714285C-1.4628571428571 536.1371428571429 31.8171428571429 502.8571428571429 72.4114285714286 502.8571428571429H401.5542857142857C442.1485714285714 502.8571428571429 475.4285714285714 536.1371428571429 475.4285714285714 576.7314285714285zM35.1085714285714 576.7314285714285V831.2685714285715C35.1085714285714 851.7485714285715 51.9314285714286 868.5714285714286 72.4114285714286 868.5714285714286H401.5542857142857C422.0342857142857 868.5714285714286 438.8571428571429 851.7485714285715 438.8571428571429 831.2685714285715V576.7314285714285C438.8571428571429 556.2514285714286 422.0342857142857 539.4285714285714 401.5542857142857 539.4285714285714H72.4114285714286C51.9314285714286 539.4285714285714 35.1085714285714 556.2514285714286 35.1085714285714 576.7314285714285zM950.1257142857143 905.1428571428572H620.9828571428571C580.3885714285715 905.1428571428572 547.1085714285714 871.8628571428571 547.1085714285714 831.2685714285715V576.7314285714285C547.1085714285714 536.1371428571429 580.3885714285715 502.8571428571429 620.9828571428571 502.8571428571429H950.1257142857143C990.72 502.8571428571429 1024 536.1371428571429 1024 576.7314285714285V831.2685714285715C1024 871.8628571428571 990.72 905.1428571428572 950.1257142857143 905.1428571428572zM987.4285714285714 576.7314285714285C987.4285714285714 556.2514285714286 970.6057142857142 539.4285714285714 950.1257142857143 539.4285714285714H620.9828571428571C600.5028571428571 539.4285714285714 583.68 556.2514285714286 583.68 576.7314285714285V831.2685714285715C583.68 851.7485714285715 600.5028571428571 868.5714285714286 620.9828571428571 868.5714285714286H950.1257142857143C970.6057142857142 868.5714285714286 987.4285714285714 851.7485714285715 987.4285714285714 831.2685714285715V576.7314285714285zM786.2857142857142 393.1428571428572C762.5142857142857 393.1428571428572 742.4 377.7828571428571 734.7199999999999 356.5714285714287H289.28C281.6 377.7828571428571 261.4857142857143 393.1428571428572 237.7142857142857 393.1428571428572C207.36 393.1428571428572 182.8571428571428 368.64 182.8571428571428 338.2857142857144S207.36 283.4285714285715 237.7142857142857 283.4285714285715C261.4857142857143 283.4285714285715 281.6 298.7885714285716 289.28 320H734.7199999999999C742.4 298.7885714285716 762.5142857142857 283.4285714285715 786.2857142857142 283.4285714285715S830.1714285714285 298.7885714285716 837.8514285714285 320H1024V356.5714285714287H837.8514285714285C830.1714285714285 377.7828571428571 810.0571428571427 393.1428571428572 786.2857142857142 393.1428571428572zM237.7142857142857 320C227.4742857142857 320 219.4285714285714 328.0457142857144 219.4285714285714 338.2857142857144S227.4742857142857 356.5714285714287 237.7142857142857 356.5714285714287S256 348.5257142857144 256 338.2857142857144S247.9542857142857 320 237.7142857142857 320zM786.2857142857142 320C776.0457142857142 320 768 328.0457142857144 768 338.2857142857144S776.0457142857142 356.5714285714287 786.2857142857142 356.5714285714287S804.5714285714286 348.5257142857144 804.5714285714286 338.2857142857144S796.5257142857142 320 786.2857142857142 320z" />
|
||||
<glyph glyph-name="image-accordion"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M841.1428571428571 941.7142857142858H182.8571428571428C142.6285714285714 941.7142857142858 109.7142857142857 908.8 109.7142857142857 868.5714285714286V283.4285714285715C109.7142857142857 243.2000000000001 142.6285714285714 210.2857142857143 182.8571428571428 210.2857142857143H841.1428571428571C881.3714285714286 210.2857142857143 914.2857142857142 243.2000000000001 914.2857142857142 283.4285714285715V868.5714285714286C914.2857142857142 908.8 881.3714285714286 941.7142857142858 841.1428571428571 941.7142857142858zM182.8571428571428 905.1428571428572H841.1428571428571C861.2571428571429 905.1428571428572 877.7142857142857 888.6857142857143 877.7142857142857 868.5714285714286V434.8342857142858L777.8742857142856 498.1028571428573L679.1314285714285 435.5657142857143L412.16 635.6114285714286L146.2857142857143 435.9314285714287V868.5714285714286C146.2857142857143 888.6857142857143 162.7428571428571 905.1428571428572 182.8571428571428 905.1428571428572zM841.1428571428571 246.8571428571429H182.8571428571428C162.7428571428571 246.8571428571429 146.2857142857143 263.3142857142857 146.2857142857143 283.4285714285715V390.2171428571429L412.16 589.5314285714287L677.3028571428571 390.5828571428572L777.8742857142856 454.2171428571428L877.7142857142857 391.3142857142857V283.4285714285715C877.7142857142857 263.3142857142857 861.2571428571429 246.8571428571429 841.1428571428571 246.8571428571429zM987.4285714285714 868.5714285714286H1024V283.4285714285715H987.4285714285714V868.5714285714286zM0 868.5714285714286H36.5714285714286V283.4285714285715H0V868.5714285714286zM640 576A36.5714285714286 36.5714285714286 0 0 1 713.1428571428571 576A36.5714285714286 36.5714285714286 0 0 1 640 576" />
|
||||
<glyph glyph-name="image-hotspot"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M1034.6057142857142 225.2800000000001L1024 232.9600000000001V1014.8571428571428C1024 1055.4514285714286 991.0857142857142 1088 950.8571428571428 1088H73.1428571428571C32.9142857142857 1088 0 1055.0857142857144 0 1014.8571428571428V137.1428571428572C0 96.5485714285715 32.9142857142857 64 73.1428571428571 64H950.8571428571428C991.4514285714286 64 1024 96.9142857142857 1024 137.1428571428572V210.2857142857143L1034.6057142857142 225.2800000000001zM73.1428571428571 1051.4285714285713H950.8571428571428C970.9714285714286 1051.4285714285713 987.4285714285714 1034.9714285714285 987.4285714285714 1014.8571428571428V258.9257142857143L896.3657142857141 324.0228571428572L786.6514285714285 250.88L402.2857142857143 525.1657142857143L36.5714285714286 264.0457142857144V1014.8571428571428C36.5714285714286 1034.9714285714285 53.0285714285714 1051.4285714285713 73.1428571428571 1051.4285714285713zM950.8571428571428 100.5714285714287H73.1428571428571C53.0285714285714 100.5714285714287 36.5714285714286 117.0285714285715 36.5714285714286 137.1428571428572V219.0628571428573L402.2857142857143 480.1828571428573L785.9200000000001 206.2628571428572L895.6342857142857 279.4057142857144L987.4285714285714 213.9428571428573V137.1428571428572C987.4285714285714 117.0285714285715 970.9714285714286 100.5714285714287 950.8571428571428 100.5714285714287zM475.4285714285714 576A36.5714285714286 36.5714285714286 0 0 1 548.5714285714286 576A36.5714285714286 36.5714285714286 0 0 1 475.4285714285714 576M109.7142857142857 466.2857142857143A36.5714285714286 36.5714285714286 0 0 1 182.8571428571428 466.2857142857143A36.5714285714286 36.5714285714286 0 0 1 109.7142857142857 466.2857142857143M768 393.1428571428572A36.5714285714286 36.5714285714286 0 0 1 841.1428571428571 393.1428571428572A36.5714285714286 36.5714285714286 0 0 1 768 393.1428571428572M292.5714285714286 722.2857142857143H406.3085714285714L512 649.1428571428571L617.6914285714286 722.2857142857143H731.4285714285713C772.0228571428571 722.2857142857143 804.5714285714286 755.2 804.5714285714286 795.4285714285714V905.1428571428572C804.5714285714286 945.7371428571428 771.6571428571428 978.2857142857144 731.4285714285713 978.2857142857144H292.5714285714286C252.3428571428572 978.2857142857144 219.4285714285714 945.3714285714286 219.4285714285714 905.1428571428572V795.4285714285714C219.4285714285714 755.2 252.3428571428572 722.2857142857143 292.5714285714286 722.2857142857143zM256 905.1428571428572C256 925.2571428571428 272.4571428571429 941.7142857142858 292.5714285714286 941.7142857142858H731.4285714285713C751.5428571428571 941.7142857142858 768 925.2571428571428 768 905.1428571428572V795.4285714285714C768 775.3142857142857 751.5428571428571 758.8571428571429 731.4285714285713 758.8571428571429H617.6914285714286H606.3542857142858L596.8457142857143 752.2742857142857L512 693.76L427.1542857142857 752.6400000000001L418.0114285714286 758.8571428571429H406.6742857142857H292.5714285714286C272.4571428571429 758.8571428571429 256 775.3142857142857 256 795.4285714285714V905.1428571428572z" />
|
||||
<glyph glyph-name="instagram"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M804.5714285714286 1051.4285714285713C905.5085714285711 1051.4285714285713 987.4285714285714 969.5085714285714 987.4285714285714 868.5714285714286V283.4285714285715C987.4285714285714 182.4914285714288 905.5085714285711 100.5714285714287 804.5714285714286 100.5714285714287H219.4285714285714C118.4914285714286 100.5714285714287 36.5714285714286 182.4914285714288 36.5714285714286 283.4285714285715V868.5714285714286C36.5714285714286 969.5085714285714 118.4914285714286 1051.4285714285713 219.4285714285714 1051.4285714285713H804.5714285714286M804.5714285714286 1088H219.4285714285714C98.3771428571428 1088 0 989.6228571428572 0 868.5714285714286V283.4285714285715C0 162.377142857143 98.3771428571428 64 219.4285714285714 64H804.5714285714286C925.622857142857 64 1024 162.377142857143 1024 283.4285714285715V868.5714285714286C1024 989.6228571428572 925.622857142857 1088 804.5714285714286 1088L804.5714285714286 1088zM512 758.8571428571429C612.9371428571427 758.8571428571429 694.8571428571428 676.9371428571428 694.8571428571428 576S612.9371428571427 393.1428571428572 512 393.1428571428572S329.1428571428571 475.0628571428573 329.1428571428571 576S411.0628571428572 758.8571428571429 512 758.8571428571429M512 795.4285714285714L512 795.4285714285714C390.9485714285714 795.4285714285714 292.5714285714286 697.0514285714287 292.5714285714286 576L292.5714285714286 576C292.5714285714286 454.9485714285715 390.9485714285714 356.5714285714287 512 356.5714285714287L512 356.5714285714287C633.0514285714285 356.5714285714287 731.4285714285713 454.9485714285715 731.4285714285713 576L731.4285714285713 576C731.4285714285713 697.0514285714287 633.0514285714285 795.4285714285714 512 795.4285714285714L512 795.4285714285714zM731.4285714285713 850.2857142857143A54.8571428571429 54.8571428571429 0 0 1 841.1428571428571 850.2857142857143A54.8571428571429 54.8571428571429 0 0 1 731.4285714285713 850.2857142857143" />
|
||||
<glyph glyph-name="lottie-animations"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M123.6011267605634 92.8450704225352C177.8298591549296 107.9887323943661 226.2895774647888 129.1898591549295 268.8360563380282 155.8715492957747C275.0377464788733 152.5543661971831 281.9605633802817 150.5352112676056 289.6045070422536 150.5352112676056H345.1312676056339C369.6495774647888 150.5352112676056 389.5526760563381 170.438309859155 389.5526760563381 194.9566197183099V250.4833802816901C389.5526760563381 255.8197183098592 388.3988732394368 260.8676056338028 386.6681690140846 265.4828169014085C409.0230985915494 298.9430985915493 427.3397183098593 340.1915492957746 457.1943661971832 408.1216901408451C457.7712676056339 407.9774647887324 458.2039436619719 407.689014084507 458.7808450704226 407.5447887323944C463.1076056338029 406.390985915493 467.4343661971832 405.8140845070423 471.7611267605635 405.8140845070423C480.4146478873241 405.8140845070423 488.7797183098593 408.1216901408451 496.4236619718311 412.4484507042254L585.4107042253523 463.7926760563381C596.9487323943663 470.4270422535212 605.0253521126762 481.0997183098592 608.4867605633805 493.9357746478873C611.9481690140847 506.7718309859155 610.2174647887325 520.0405633802817 603.5830985915494 531.5785915492958L552.9600000000002 619.1233802816902C577.4783098591552 671.1887323943662 597.0929577464791 712.2929577464789 613.3904225352114 745.0321126760564L678.2918309859157 707.5335211267605C686.5126760563381 702.7740845070423 695.5988732394368 700.3222535211268 704.829295774648 700.3222535211268C709.4445070422537 700.3222535211268 714.0597183098594 700.8991549295774 718.674929577465 702.1971830985915C732.3763380281692 705.8028169014085 743.9143661971833 714.7447887323945 750.9814084507044 727.0039436619718L827.5650704225354 859.5470422535211C842.2760563380285 884.9307042253521 833.4783098591552 917.6698591549296 808.0946478873242 932.3808450704227L774.3459154929579 951.8512676056338C833.6225352112677 993.9650704225352 903.7160563380284 1025.2619718309859 984.1938028169016 1045.165070422535C991.9819718309863 1047.04 996.5971830985916 1054.8281690140846 994.722253521127 1062.616338028169C992.8473239436622 1070.4045070422535 985.0591549295776 1075.0197183098592 977.2709859154932 1073.1447887323943C888.2839436619721 1051.2225352112675 811.5560563380284 1015.5988732394366 747.2315492957749 967.5718309859154L675.4073239436622 1008.9645070422534C663.003943661972 1016.1757746478872 648.7256338028171 1017.9064788732394 635.0242253521129 1014.3008450704224C621.3228169014086 1010.550985915493 609.7847887323946 1001.7532394366197 602.7177464788734 989.4940845070422L526.1340845070424 856.9509859154929C519.0670422535213 844.6918309859154 517.1921126760566 830.2692957746478 520.7977464788735 816.5678873239435C524.4033802816904 802.8664788732394 533.3453521126762 791.3284507042254 545.6045070422537 784.2614084507043L588.2952112676059 759.5988732394366C572.5746478873241 728.0135211267605 553.8253521126762 688.9284507042253 530.8935211267608 640.3245070422535C528.0090140845073 641.7667605633803 525.1245070422538 642.9205633802817 521.951549295775 643.641690140845C509.2597183098594 647.1030985915493 495.8467605633805 645.3723943661971 484.3087323943665 638.7380281690141L395.3216901408454 587.3938028169014C383.7836619718313 580.7594366197183 375.7070422535214 570.0867605633803 372.2456338028172 557.2507042253521C368.784225352113 544.414647887324 370.514929577465 531.1459154929578 377.1492957746481 519.6078873239437L428.4935211267608 430.6208450704226C429.7915492957749 428.4574647887324 431.2338028169017 426.5825352112676 432.8202816901411 424.707605633803C432.8202816901409 424.4191549295776 432.6760563380282 424.2749295774647 432.6760563380282 423.9864788732395C403.9752112676057 358.6523943661972 386.5239436619719 319.2788732394366 367.1977464788733 288.5588732394366C360.7076056338029 292.4529577464789 353.2078873239436 294.7605633802817 344.9870422535212 294.7605633802817H289.4602816901409C264.941971830986 294.7605633802817 245.0388732394367 274.8574647887324 245.0388732394367 250.3391549295775V194.8123943661972C245.0388732394367 188.6107042253522 246.3369014084508 182.5532394366197 248.7887323943663 177.2169014084507C188.0698591549296 140.1509859154929 114.5149295774648 114.7673239436618 28.8450704225352 102.0754929577465V1088H0V92.8450704225352V64H28.8450704225352H1024V92.8450704225352H123.6011267605634zM548.6332394366198 823.9233802816901C546.9025352112676 830.2692957746478 547.7678873239437 836.7594366197184 551.0850704225352 842.5284507042254L627.6687323943662 975.0715492957746C630.9859154929578 980.696338028169 636.1780281690142 984.734647887324 642.5239436619719 986.4653521126762C644.687323943662 987.0422535211268 646.7064788732395 987.330704225352 648.8698591549296 987.330704225352C653.0523943661972 987.330704225352 657.2349295774648 986.1769014084508 660.9847887323945 984.0135211267606L793.5278873239437 907.4298591549295C805.2101408450706 900.6512676056338 809.2484507042254 885.6518309859155 802.4698591549296 874.1138028169014L725.88619Line truncated
|
||||
<glyph glyph-name="masonry-gallery"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M402.2857142857143 1051.4285714285713C420.5714285714286 1051.4285714285713 438.8571428571429 1036.8 438.8571428571429 1014.8571428571428V758.8571428571429C438.8571428571429 740.5714285714287 420.5714285714286 722.2857142857143 402.2857142857143 722.2857142857143H73.1428571428571C54.8571428571429 722.2857142857143 36.5714285714286 740.5714285714287 36.5714285714286 758.8571428571429V1014.8571428571428C36.5714285714286 1036.8 54.8571428571429 1051.4285714285713 73.1428571428571 1051.4285714285713H402.2857142857143M402.2857142857143 1088H73.1428571428571C32.9142857142857 1088 0 1055.0857142857144 0 1014.8571428571428V758.8571428571429C0 718.6285714285715 32.9142857142857 685.7142857142858 73.1428571428571 685.7142857142858H402.2857142857143C442.5142857142857 685.7142857142858 475.4285714285714 718.6285714285715 475.4285714285714 758.8571428571429V1014.8571428571428C475.4285714285714 1055.0857142857144 442.5142857142857 1088 402.2857142857143 1088L402.2857142857143 1088zM950.8571428571428 1051.4285714285713C969.1428571428572 1051.4285714285713 987.4285714285714 1036.8 987.4285714285714 1014.8571428571428V612.5714285714287C987.4285714285714 594.2857142857143 969.1428571428572 576 950.8571428571428 576H621.7142857142857C603.4285714285714 576 585.1428571428571 594.2857142857143 585.1428571428571 612.5714285714287V1014.8571428571428C585.1428571428571 1036.8 603.4285714285714 1051.4285714285713 621.7142857142857 1051.4285714285713H950.8571428571428M950.8571428571428 1088H621.7142857142857C581.4857142857143 1088 548.5714285714286 1055.0857142857144 548.5714285714286 1014.8571428571428V612.5714285714287C548.5714285714286 572.3428571428572 581.4857142857143 539.4285714285714 621.7142857142857 539.4285714285714H950.8571428571428C991.0857142857142 539.4285714285714 1024 572.3428571428572 1024 612.5714285714287V1014.8571428571428C1024 1055.0857142857144 991.0857142857142 1088 950.8571428571428 1088L950.8571428571428 1088zM950.8571428571428 429.7142857142858C969.1428571428572 429.7142857142858 987.4285714285714 415.0857142857144 987.4285714285714 393.1428571428572V137.1428571428572C987.4285714285714 118.8571428571429 969.1428571428572 100.5714285714287 950.8571428571428 100.5714285714287H621.7142857142857C603.4285714285714 100.5714285714287 585.1428571428571 118.8571428571429 585.1428571428571 137.1428571428572V393.1428571428572C585.1428571428571 415.0857142857144 603.4285714285714 429.7142857142858 621.7142857142857 429.7142857142858H950.8571428571428M950.8571428571428 466.2857142857143H621.7142857142857C581.4857142857143 466.2857142857143 548.5714285714286 433.3714285714286 548.5714285714286 393.1428571428572V137.1428571428572C548.5714285714286 96.9142857142857 581.4857142857143 64 621.7142857142857 64H950.8571428571428C991.0857142857142 64 1024 96.9142857142857 1024 137.1428571428572V393.1428571428572C1024 433.3714285714286 991.0857142857142 466.2857142857143 950.8571428571428 466.2857142857143L950.8571428571428 466.2857142857143zM402.2857142857143 576C420.5714285714286 576 438.8571428571429 561.3714285714286 438.8571428571429 539.4285714285714V137.1428571428572C438.8571428571429 118.8571428571429 420.5714285714286 100.5714285714287 402.2857142857143 100.5714285714287H73.1428571428571C54.8571428571429 100.5714285714287 36.5714285714286 118.8571428571429 36.5714285714286 137.1428571428572V539.4285714285714C36.5714285714286 561.3714285714286 54.8571428571429 576 73.1428571428571 576H402.2857142857143M402.2857142857143 612.5714285714287H73.1428571428571C32.9142857142857 612.5714285714287 0 579.6571428571428 0 539.4285714285714V137.1428571428572C0 96.9142857142857 32.9142857142857 64 73.1428571428571 64H402.2857142857143C442.5142857142857 64 475.4285714285714 96.9142857142857 475.4285714285714 137.1428571428572V539.4285714285714C475.4285714285714 579.6571428571428 442.5142857142857 612.5714285714287 402.2857142857143 612.5714285714287L402.2857142857143 612.5714285714287z" />
|
||||
<glyph glyph-name="price-list"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M0 649.1428571428571H292.5714285714286V612.5714285714287H0V649.1428571428571zM0 539.4285714285714H182.8571428571428V502.8571428571429H0V539.4285714285714zM475.4285714285714 612.5714285714287V649.1428571428571H438.8571428571429V685.7142857142858H402.2857142857143V649.1428571428571C382.1714285714285 649.1428571428571 365.7142857142857 632.6857142857143 365.7142857142857 612.5714285714287V576C365.7142857142857 555.8857142857142 382.1714285714285 539.4285714285714 402.2857142857143 539.4285714285714H438.8571428571429V502.8571428571429H365.7142857142857V466.2857142857143H402.2857142857143V429.7142857142858H438.8571428571429V466.2857142857143C458.9714285714286 466.2857142857143 475.4285714285714 482.7428571428571 475.4285714285714 502.8571428571429V539.4285714285714C475.4285714285714 559.5428571428572 458.9714285714286 576 438.8571428571429 576H402.2857142857143V612.5714285714287H475.4285714285714zM0 283.4285714285715H292.5714285714286V246.8571428571429H0V283.4285714285715zM0 173.7142857142858H182.8571428571428V137.1428571428572H0V173.7142857142858zM475.4285714285714 246.8571428571429V283.4285714285715H438.8571428571429V320H402.2857142857143V283.4285714285715C382.1714285714285 283.4285714285715 365.7142857142857 266.9714285714287 365.7142857142857 246.8571428571429V210.2857142857143C365.7142857142857 190.1714285714286 382.1714285714285 173.7142857142858 402.2857142857143 173.7142857142858H438.8571428571429V137.1428571428572H365.7142857142857V100.5714285714287H402.2857142857143V64H438.8571428571429V100.5714285714287C458.9714285714286 100.5714285714287 475.4285714285714 117.0285714285715 475.4285714285714 137.1428571428572V173.7142857142858C475.4285714285714 193.8285714285715 458.9714285714286 210.2857142857143 438.8571428571429 210.2857142857143H402.2857142857143V246.8571428571429H475.4285714285714zM548.5714285714286 649.1428571428571H841.1428571428571V612.5714285714287H548.5714285714286V649.1428571428571zM548.5714285714286 539.4285714285714H731.4285714285713V502.8571428571429H548.5714285714286V539.4285714285714zM1024 612.5714285714287V649.1428571428571H987.4285714285714V685.7142857142858H950.8571428571428V649.1428571428571C930.742857142857 649.1428571428571 914.2857142857142 632.6857142857143 914.2857142857142 612.5714285714287V576C914.2857142857142 555.8857142857142 930.742857142857 539.4285714285714 950.8571428571428 539.4285714285714H987.4285714285714V502.8571428571429H914.2857142857142V466.2857142857143H950.8571428571428V429.7142857142858H987.4285714285714V466.2857142857143C1007.542857142857 466.2857142857143 1024 482.7428571428571 1024 502.8571428571429V539.4285714285714C1024 559.5428571428572 1007.542857142857 576 987.4285714285714 576H950.8571428571428V612.5714285714287H1024zM548.5714285714286 283.4285714285715H841.1428571428571V246.8571428571429H548.5714285714286V283.4285714285715zM548.5714285714286 173.7142857142858H731.4285714285713V137.1428571428572H548.5714285714286V173.7142857142858zM1024 246.8571428571429V283.4285714285715H987.4285714285714V320H950.8571428571428V283.4285714285715C930.742857142857 283.4285714285715 914.2857142857142 266.9714285714287 914.2857142857142 246.8571428571429V210.2857142857143C914.2857142857142 190.1714285714286 930.742857142857 173.7142857142858 950.8571428571428 173.7142857142858H987.4285714285714V137.1428571428572H914.2857142857142V100.5714285714287H950.8571428571428V64H987.4285714285714V100.5714285714287C1007.542857142857 100.5714285714287 1024 117.0285714285715 1024 137.1428571428572V173.7142857142858C1024 193.8285714285715 1007.542857142857 210.2857142857143 987.4285714285714 210.2857142857143H950.8571428571428V246.8571428571429H1024zM987.4285714285714 1051.4285714285713V795.4285714285714H36.5714285714286V1051.4285714285713H987.4285714285714M1024 1088H0V758.8571428571429H36.5714285714286H1024V1088L1024 1088z" />
|
||||
<glyph glyph-name="price-menu"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M329.1428571428571 1088H804.5714285714286V1051.4285714285713H329.1428571428571V1088zM329.1428571428571 978.2857142857144H804.5714285714286V941.7142857142858H329.1428571428571V978.2857142857144zM329.1428571428571 868.5714285714286H585.1428571428571V832H329.1428571428571V868.5714285714286zM1024 1014.8571428571428V1051.4285714285713H987.4285714285714V1088H950.8571428571428V1051.4285714285713C930.742857142857 1051.4285714285713 914.2857142857142 1034.9714285714285 914.2857142857142 1014.8571428571428V978.2857142857144C914.2857142857142 958.1714285714286 930.742857142857 941.7142857142858 950.8571428571428 941.7142857142858H987.4285714285714V905.1428571428572H914.2857142857142V868.5714285714286H950.8571428571428V832H987.4285714285714V868.5714285714286C1007.542857142857 868.5714285714286 1024 885.0285714285715 1024 905.1428571428572V941.7142857142858C1024 961.8285714285714 1007.542857142857 978.2857142857144 987.4285714285714 978.2857142857144H950.8571428571428V1014.8571428571428H1024zM219.4285714285714 1051.4285714285713V868.5714285714286H36.5714285714286V1051.4285714285713H219.4285714285714M256 1088H0V832H256V1088L256 1088zM329.1428571428571 722.2857142857143H804.5714285714286V685.7142857142858H329.1428571428571V722.2857142857143zM329.1428571428571 612.5714285714287H804.5714285714286V576H329.1428571428571V612.5714285714287zM329.1428571428571 502.8571428571429H585.1428571428571V466.2857142857143H329.1428571428571V502.8571428571429zM1024 649.1428571428571V685.7142857142858H987.4285714285714V722.2857142857143H950.8571428571428V685.7142857142858C930.742857142857 685.7142857142858 914.2857142857142 669.257142857143 914.2857142857142 649.1428571428571V612.5714285714287C914.2857142857142 592.4571428571428 930.742857142857 576 950.8571428571428 576H987.4285714285714V539.4285714285714H914.2857142857142V502.8571428571429H950.8571428571428V466.2857142857143H987.4285714285714V502.8571428571429C1007.542857142857 502.8571428571429 1024 519.3142857142857 1024 539.4285714285714V576C1024 596.1142857142858 1007.542857142857 612.5714285714287 987.4285714285714 612.5714285714287H950.8571428571428V649.1428571428571H1024zM219.4285714285714 685.7142857142858V502.8571428571429H36.5714285714286V685.7142857142858H219.4285714285714M256 722.2857142857143H0V466.2857142857143H256V722.2857142857143L256 722.2857142857143zM329.1428571428571 356.5714285714287H804.5714285714286V320H329.1428571428571V356.5714285714287zM329.1428571428571 246.8571428571429H804.5714285714286V210.2857142857143H329.1428571428571V246.8571428571429zM329.1428571428571 137.1428571428572H585.1428571428571V100.5714285714287H329.1428571428571V137.1428571428572zM1024 283.4285714285715V320H987.4285714285714V356.5714285714287H950.8571428571428V320C930.742857142857 320 914.2857142857142 303.5428571428572 914.2857142857142 283.4285714285715V246.8571428571429C914.2857142857142 226.7428571428572 930.742857142857 210.2857142857143 950.8571428571428 210.2857142857143H987.4285714285714V173.7142857142858H914.2857142857142V137.1428571428572H950.8571428571428V100.5714285714287H987.4285714285714V137.1428571428572C1007.542857142857 137.1428571428572 1024 153.6 1024 173.7142857142858V210.2857142857143C1024 230.4000000000001 1007.542857142857 246.8571428571429 987.4285714285714 246.8571428571429H950.8571428571428V283.4285714285715H1024zM219.4285714285714 320V137.1428571428572H36.5714285714286V320H219.4285714285714M256 356.5714285714287H0V100.5714285714287H256V356.5714285714287L256 356.5714285714287z" />
|
||||
<glyph glyph-name="price-table"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M914.2857142857142 905.1428571428572H804.5714285714286V1014.8571428571428C804.5714285714286 1055.0857142857144 771.6571428571428 1088 731.4285714285713 1088H256C215.7714285714286 1088 182.8571428571428 1055.0857142857144 182.8571428571428 1014.8571428571428V905.1428571428572H73.1428571428571C32.9142857142857 905.1428571428572 0 872.2285714285714 0 832V320C0 279.7714285714286 32.9142857142857 246.8571428571429 73.1428571428571 246.8571428571429H182.8571428571428V137.1428571428572C182.8571428571428 96.9142857142857 215.7714285714286 64 256 64H731.4285714285713C771.6571428571428 64 804.5714285714286 96.9142857142857 804.5714285714286 137.1428571428572V246.8571428571429H914.2857142857142C954.5142857142858 246.8571428571429 987.4285714285714 279.7714285714286 987.4285714285714 320V832C987.4285714285714 872.2285714285714 954.5142857142858 905.1428571428572 914.2857142857142 905.1428571428572zM182.8571428571428 283.4285714285715H73.1428571428571C53.0285714285714 283.4285714285715 36.5714285714286 299.8857142857144 36.5714285714286 320V832C36.5714285714286 852.1142857142858 53.0285714285714 868.5714285714286 73.1428571428571 868.5714285714286H182.8571428571428V283.4285714285715zM768 137.1428571428572C768 117.0285714285715 751.5428571428571 100.5714285714287 731.4285714285713 100.5714285714287H256C235.8857142857143 100.5714285714287 219.4285714285714 117.0285714285715 219.4285714285714 137.1428571428572V1014.8571428571428C219.4285714285714 1034.9714285714285 235.8857142857143 1051.4285714285713 256 1051.4285714285713H731.4285714285713C751.5428571428571 1051.4285714285713 768 1034.9714285714285 768 1014.8571428571428V137.1428571428572zM950.8571428571428 320C950.8571428571428 299.8857142857144 934.4 283.4285714285715 914.2857142857142 283.4285714285715H804.5714285714286V868.5714285714286H914.2857142857142C934.4 868.5714285714286 950.8571428571428 852.1142857142858 950.8571428571428 832V320zM365.7142857142857 393.1428571428572H621.7142857142857V356.5714285714287H365.7142857142857V393.1428571428572zM365.7142857142857 283.4285714285715H548.5714285714286V246.8571428571429H365.7142857142857V283.4285714285715zM365.7142857142857 905.1428571428572H621.7142857142857V868.5714285714286H365.7142857142857V905.1428571428572zM585.1428571428571 722.2857142857143V758.8571428571429H512V795.4285714285714H475.4285714285714V758.8571428571429H438.8571428571429C418.7428571428571 758.8571428571429 402.2857142857143 742.4000000000001 402.2857142857143 722.2857142857143V649.1428571428571C402.2857142857143 629.0285714285715 418.7428571428571 612.5714285714287 438.8571428571429 612.5714285714287H548.5714285714286V539.4285714285714H402.2857142857143V502.8571428571429H475.4285714285714V466.2857142857143H512V502.8571428571429H548.5714285714286C568.6857142857143 502.8571428571429 585.1428571428571 519.3142857142857 585.1428571428571 539.4285714285714V612.5714285714287C585.1428571428571 632.6857142857143 568.6857142857143 649.1428571428571 548.5714285714286 649.1428571428571H438.8571428571429V722.2857142857143H585.1428571428571z" />
|
||||
<glyph glyph-name="testimonial-carousel"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M768 832H256C215.7714285714286 832 182.8571428571428 799.0857142857143 182.8571428571428 758.8571428571429V393.1428571428572C182.8571428571428 352.9142857142857 215.7714285714286 320 256 320H402.2857142857143V173.7142857142858L548.5714285714286 320H768C808.2285714285714 320 841.1428571428571 352.9142857142857 841.1428571428571 393.1428571428572V758.8571428571429C841.1428571428571 799.0857142857143 808.2285714285714 832 768 832zM804.5714285714286 393.1428571428572C804.5714285714286 374.8571428571429 786.2857142857142 356.5714285714287 768 356.5714285714287H585.1428571428571H533.5771428571428L438.8571428571429 261.8514285714287V356.5714285714287H402.2857142857143H256C237.7142857142857 356.5714285714287 219.4285714285714 374.8571428571429 219.4285714285714 393.1428571428572V758.8571428571429C219.4285714285714 780.8 237.7142857142857 795.4285714285714 256 795.4285714285714H768C786.2857142857142 795.4285714285714 804.5714285714286 780.8 804.5714285714286 758.8571428571429V393.1428571428572zM132.7542857142857 453.8514285714286L10.6057142857143 576L133.4857142857143 698.5142857142857L159.0857142857143 672.9142857142858L62.5371428571429 576L158.72 479.8171428571429zM891.2457142857143 453.8514285714286L865.28 479.8171428571429L961.462857142857 576L864.9142857142856 672.9142857142858L890.5142857142857 698.5142857142857L1013.3942857142858 576z" />
|
||||
<glyph glyph-name="vertical-timeline"
|
||||
unicode=""
|
||||
horiz-adv-x="1024" d="M950.8571428571428 576.7314285714285H293.3028571428572C252.7085714285714 576.7314285714285 219.4285714285714 543.4514285714286 219.4285714285714 502.8571428571429V320.7314285714287C219.4285714285714 280.1371428571429 252.7085714285714 246.8571428571429 293.3028571428572 246.8571428571429H950.8571428571428C991.4514285714286 246.8571428571429 1024.7314285714285 280.1371428571429 1024.7314285714285 320.7314285714287V502.8571428571429C1024.7314285714285 543.4514285714286 991.4514285714286 576.7314285714285 950.8571428571428 576.7314285714285zM988.16 320.7314285714287C988.16 300.2514285714286 971.3371428571428 283.4285714285715 950.8571428571428 283.4285714285715H293.3028571428572C272.8228571428571 283.4285714285715 256 300.2514285714286 256 320.7314285714287V502.8571428571429C256 523.3371428571429 272.8228571428571 540.16 293.3028571428572 540.16H950.8571428571428C971.3371428571428 540.16 988.16 523.3371428571428 988.16 502.8571428571429V320.7314285714287zM950.8571428571428 1052.16H293.3028571428572C252.7085714285714 1052.16 219.4285714285714 1018.88 219.4285714285714 978.2857142857144V796.1600000000001C219.4285714285714 755.5657142857143 252.7085714285714 722.2857142857143 293.3028571428572 722.2857142857143H950.8571428571428C991.4514285714286 722.2857142857143 1024.7314285714285 755.5657142857143 1024.7314285714285 796.1600000000001V978.2857142857144C1024.7314285714285 1018.88 991.4514285714286 1052.16 950.8571428571428 1052.16zM988.16 796.1600000000001C988.16 775.6800000000001 971.3371428571428 758.8571428571429 950.8571428571428 758.8571428571429H293.3028571428572C272.8228571428571 758.8571428571429 256 775.6800000000001 256 796.1600000000001V978.2857142857144C256 998.7657142857142 272.8228571428571 1015.5885714285714 293.3028571428572 1015.5885714285714H950.8571428571428C971.3371428571428 1015.5885714285714 988.16 998.7657142857142 988.16 978.2857142857144V796.1600000000001zM109.7142857142857 886.8571428571429C109.7142857142857 917.2114285714287 85.2114285714286 941.7142857142858 54.8571428571429 941.7142857142858S0 917.2114285714287 0 886.8571428571429C0 863.0857142857143 15.36 842.9714285714285 36.5714285714286 835.2914285714286V462.9942857142858C15.36 455.3142857142857 0 435.2 0 411.4285714285715S15.36 367.5428571428572 36.5714285714286 359.8628571428572V100.5714285714287H73.1428571428571V359.8628571428572C94.3542857142857 367.5428571428572 109.7142857142857 387.657142857143 109.7142857142857 411.4285714285715S94.3542857142857 455.3142857142857 73.1428571428571 462.9942857142858V835.2914285714286C94.3542857142857 842.9714285714285 109.7142857142857 863.0857142857143 109.7142857142857 886.8571428571429zM54.8571428571429 905.1428571428572C65.0971428571429 905.1428571428572 73.1428571428571 897.0971428571429 73.1428571428571 886.8571428571429S65.0971428571429 868.5714285714286 54.8571428571429 868.5714285714286S36.5714285714286 876.6171428571429 36.5714285714286 886.8571428571429S44.6171428571429 905.1428571428572 54.8571428571429 905.1428571428572zM54.8571428571429 393.1428571428572C44.6171428571429 393.1428571428572 36.5714285714286 401.1885714285715 36.5714285714286 411.4285714285715S44.6171428571429 429.7142857142858 54.8571428571429 429.7142857142858S73.1428571428571 421.6685714285715 73.1428571428571 411.4285714285715S65.0971428571429 393.1428571428572 54.8571428571429 393.1428571428572z" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 75 KiB |
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1_copy" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
||||
y="0px" viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
|
||||
<g>
|
||||
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="3.5147" y1="124.4853" x2="124.4853" y2="3.5147">
|
||||
<stop offset="0" style="stop-color:#F50000"/>
|
||||
<stop offset="1" style="stop-color:#FAC212"/>
|
||||
</linearGradient>
|
||||
<path style="fill:url(#SVGID_1_);" d="M116,128H12c-6.63,0-12-5.37-12-12V12C0,5.37,5.37,0,12,0h104c6.63,0,12,5.37,12,12v104
|
||||
C128,122.63,122.63,128,116,128z"/>
|
||||
</g>
|
||||
<g style="opacity:0.2;">
|
||||
<g>
|
||||
<path d="M83.28,60.38L83.28,60.38L48.75,40.44l0,0c3.59-6.22,11.54-8.35,17.76-4.76l12.01,6.94
|
||||
C84.74,46.21,86.87,54.16,83.28,60.38z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path d="M83.28,84.63L83.28,84.63l-33.78-19.5c-6.22-3.59-8.35-11.54-4.76-17.76l0,0l33.77,19.5
|
||||
C84.74,70.46,86.87,78.41,83.28,84.63z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path d="M79.29,91.56L79.29,91.56c-3.59,6.22-11.54,8.35-17.76,4.76l-12.05-6.96c-6.22-3.59-8.35-11.54-4.76-17.76l0,0
|
||||
L79.29,91.56z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path style="fill:#FFFFFF;" d="M83.28,58.38L83.28,58.38L48.75,38.44l0,0c3.59-6.22,11.54-8.35,17.76-4.76l12.01,6.94
|
||||
C84.74,44.21,86.87,52.16,83.28,58.38z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path style="fill:#FFFFFF;" d="M83.28,82.63L83.28,82.63l-33.78-19.5c-6.22-3.59-8.35-11.54-4.76-17.76l0,0l33.77,19.5
|
||||
C84.74,68.46,86.87,76.41,83.28,82.63z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path style="fill:#FFFFFF;" d="M79.29,89.56L79.29,89.56c-3.59,6.22-11.54,8.35-17.76,4.76l-12.05-6.96
|
||||
c-6.22-3.59-8.35-11.54-4.76-17.76l0,0L79.29,89.56z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1 @@
|
||||
!function(){"use strict";function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var e=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(e.push(i.value),!r||e.length!==r);n=!0);}catch(t){o=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return e}(t,r)||c(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,r){if(t){if("string"==typeof t)return o(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,r):void 0}}function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function w(t,r){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=c(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==e.return||e.return()}finally{if(u)throw a}}}}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t,r){return t(r={exports:{}},r.exports),r.exports}var e="%[a-f0-9]{2}",a=new RegExp(e,"gi"),u=new RegExp("("+e+")+","gi");function i(t,r){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;r=r||1;var e=t.slice(0,r),n=t.slice(r);return Array.prototype.concat.call([],i(e),i(n))}function l(r){try{return decodeURIComponent(r)}catch(t){for(var e=r.match(a),n=1;n<e.length;n++)e=(r=i(e,n).join("")).match(a);return r}}function y(r){if("string"!=typeof r)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+m(r)+"`");try{return r=r.replace(/\+/g," "),decodeURIComponent(r)}catch(t){return function(t){for(var r={"%FE%FF":"��","%FF%FE":"��"},e=u.exec(t);e;){try{r[e[0]]=decodeURIComponent(e[0])}catch(t){var n=l(e[0]);n!==e[0]&&(r[e[0]]=n)}e=u.exec(t)}r["%C2"]="�";for(var o=Object.keys(r),a=0;a<o.length;a++){var i=o[a];t=t.replace(new RegExp(i,"g"),r[i])}return t}(r)}}function O(t,r){if("string"!=typeof t||"string"!=typeof r)throw new TypeError("Expected the arguments to be of type `string`");if(""===r)return[t];var e=t.indexOf(r);return-1===e?[t]:[t.slice(0,e),t.slice(e+r.length)]}var h=r(function(t,s){function b(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function p(t,r){return r.encode?r.strict?encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%".concat(t.charCodeAt(0).toString(16).toUpperCase())}):encodeURIComponent(t):t}function g(t,r){return r.decode?y(t):t}function v(t){var r=t.indexOf("#");return-1!==r&&(t=t.slice(0,r)),t}function a(t){var r=(t=v(t)).indexOf("?");return-1===r?"":t.slice(r+1)}function _(t,r){return r.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!r.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function i(t,r){b((r=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},r)).arrayFormatSeparator);var e=function(o){var n;switch(o.arrayFormat){case"index":return function(t,r,e){n=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),n?(void 0===e[t]&&(e[t]={}),e[t][n[1]]=r):e[t]=r};case"bracket":return function(t,r,e){n=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),n?void 0!==e[t]?e[t]=[].concat(e[t],r):e[t]=[r]:e[t]=r};case"comma":case"separator":return function(t,r,e){var n="string"==typeof r&&-1<r.split("").indexOf(o.arrayFormatSeparator)?r.split(Line truncated
|
||||
@@ -0,0 +1,2 @@
|
||||
var data = 'ewogICJhZHZhbmNlZC1nb29nbGUtbWFwIiA6IFsKICAgICJpc19vcGVuX3BvcHVwIiwKICAgICJ1c2VfY3VzdG9tX2ljb24iLAogICAgIm1hcF9jdXN0b21fc3R5bGUiCiAgXSwKICAiYWR2YW5jZWQtcG9zdHMiIDogWwogICAgInBhZ2luYXRpb24iLAogICAgInRheG9ub21pZXMiLAogICAgInRlcm1zX3JlbGF0aW9uIiwKICAgICJhbmltYXRlX29uX3Njcm9sbCIsCiAgICAibGlzdF9jaGVja2VyYm9hcmQiLAogICAgImdyaWRfY2hlY2tlcmJvYXJkIiwKCiAgICAicGFnaW5hdGlvbl9zdHlsZSIsCiAgICAiYXV0b3BsYXkiLAogICAgImxvb3AiCiAgXSwKICAiYWR2YW5jZWQtc2xpZGVyIiA6IFsKICAgICJibG9ja19ob3Jpem9udGFsX2FsaWdubWVudCIsCiAgICAiYmxvY2tfdmVydGljYWxfYWxpZ25tZW50IiwKICAgICJjdXN0b21fYWxpZ25tZW50IiwKCiAgICAicGFnaW5hdGlvbl9zdHlsZSIsCiAgICAiYXV0b3BsYXkiLAogICAgImxvb3AiCiAgXSwKICAidGVzdGltb25pYWwtY2Fyb3VzZWwiIDogWwogICAgInBhZ2luYXRpb25fc3R5bGUiLAogICAgImF1dG9wbGF5IiwKICAgICJsb29wIgogIF0sCiAgImZsaXAtYm94IiA6IFsKICAgICJzaG93X2J1dHRvbiIKICBdLAogICJhZHZhbmNlZC1hY2NvcmRpb24iIDogWwogICAgImNvbnRlbnRfdHlwZSIKICBdLAogICJhZHZhbmNlZC10YWJzIiA6IFsKICAgICJjb250ZW50X3R5cGUiCiAgXSwKICAiaW1hZ2UtYWNjb3JkaW9uIiA6IFsKICAgICJzaG93X2J1dHRvbiIsCiAgICAiYnV0dG9uX3N0eWxlX3NlY3Rpb24iCiAgXSwKICAiaW1hZ2UtaG90c3BvdCIgOiBbCiAgICAib3Blbl9ieV9kZWZhdWx0IgogIF0sCiAgImxvdHRpZS1hbmltYXRpb25zIiA6IFsKICAgICJhbmltYXRlX29uX3Njcm9sbCIsCiAgICAibG90dGllX2xvb3AiCiAgXSwKICAiY291bnRkb3duIiA6IFsKICAgICJzdHJhdHVtX2V4cGlyZV9hY3Rpb25zIgogIF0sCiAgImhvcml6b250YWwtdGltZWxpbmUiIDogWwogICAgImNvbHVtbnMiLAogICAgIml0ZW1fbGluayIKICBdLAogICJ2ZXJ0aWNhbC10aW1lbGluZSIgOiBbCiAgICAicG9pbnRfbm9ybWFsX2JhY2tncm91bmRfY29sb3IiLAogICAgInBvaW50X2hvdmVyX2JhY2tncm91bmRfY29sb3IiLAogICAgInBvaW50X2FjdGl2ZV9iYWNrZ3JvdW5kX2NvbG9yIiwKCSJwcm9ncmVzc19iYWNrZ3JvdW5kX2NvbG9yIiwKCSJpdGVtX2xpbmsiCiAgXSwKICAidGFibGUiIDogWwoJInRhYmxlX2NvbF9jb250ZW50X3R5cGUiCiAgXSwKICAiY29udGVudC1zd2l0Y2hlciIgOiBbCiAgICAiY29udGVudF9pdGVtcyIKICBdCn0=';
|
||||
!function(){"use strict";var n=Object.prototype.hasOwnProperty;function r(t,e){return null!=t&&n.call(t,e)}var c=Array.isArray;function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var a="object"==o(t)&&t&&t.Object===Object&&t,i="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,u=a||i||Function("return this")(),l=u.Symbol,s=Object.prototype,f=s.hasOwnProperty,p=s.toString,d=l?l.toStringTag:void 0;var h=function(t){var e=f.call(t,d),n=t[d];try{var r=!(t[d]=void 0)}catch(t){}var o=p.call(t);return r&&(e?t[d]=n:delete t[d]),o},y=Object.prototype.toString;var v=function(t){return y.call(t)},b=l?l.toStringTag:void 0;var _=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(b&&b in Object(t)?h:v)(t)};var m=function(t){return null!=t&&"object"==o(t)};var j=function(t){return"symbol"==o(t)||m(t)&&"[object Symbol]"==_(t)},g=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/;var w=function(t,e){if(c(t))return!1;var n=o(t);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!j(t))||(O.test(t)||!g.test(t)||null!=e&&t in Object(e))};var S=function(t){var e=o(t);return null!=t&&("object"==e||"function"==e)};var A,x=function(t){if(!S(t))return!1;var e=_(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},C=u["__core-js_shared__"],T=(A=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var P=function(t){return!!T&&T in t},k=Function.prototype.toString;var z=function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""},R=/^\[object .+?Constructor\]$/,D=Function.prototype,F=Object.prototype,E=D.toString,M=F.hasOwnProperty,B=RegExp("^"+E.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var I=function(t){return!(!S(t)||P(t))&&(x(t)?B:R).test(z(t))};var U=function(t,e){return null==t?void 0:t[e]};var V=function(t,e){var n=U(t,e);return I(n)?n:void 0},q=V(Object,"create");function N(){this.__data__=q?q(null):{},this.size=0}function W(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var L=Object.prototype.hasOwnProperty;function Q(t){var e=this.__data__;if(q){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return L.call(e,t)?e[t]:void 0}var G=Object.prototype.hasOwnProperty;function J(t){var e=this.__data__;return q?void 0!==e[t]:G.call(e,t)}function H(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=q&&void 0===e?"__lodash_hash_undefined__":e,this}function K(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}K.prototype.clear=N,K.prototype.delete=W,K.prototype.get=Q,K.prototype.has=J,K.prototype.set=H;var X=K;function Y(){this.__data__=[],this.size=0}var Z=function(t,e){return t===e||t!=t&&e!=e};var tt=function(t,e){for(var n=t.length;n--;)if(Z(t[n][0],e))return n;return-1},et=Array.prototype.splice;function nt(t){var e=this.__data__,n=tt(e,t);return!(n<0)&&(n==e.length-1?e.pop():et.call(e,n,1),--this.size,!0)}function rt(t){var e=this.__data__,n=tt(e,t);return n<0?void 0:e[n][1]}function ot(t){return-1<tt(this.__data__,t)}function it(t,e){var n=this.__data__,r=tt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function at(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}at.prototype.clear=Y,at.prototype.delete=nt,at.prototype.get=rt,at.prototype.has=ot,at.prototype.set=it;var ct=at,ut=V(u,"Map");var lt=function(t){var e=o(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var st=function(t,e){var n=t.__data__;return lt(e)?n["string"==typeof e?"string":"hash"]:n.map};function ft(t){var e=st(this,t).delete(t);return this.size-=e?1:0,e}function pt(t){return st(this,t).get(t)}function dt(t){return st(this,t).has(t)}function ht(t,e){var n=st(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function yt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}yt.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(ut||ct),string:new X}},yt.prototype.delete=ft,yt.prototype.get=pt,yt.prototype.has=dt,yt.prototype.set=ht;var vt=yt,bt="Expected a function";function _t(o,i){if("function"!=typeof o||null!=i&&"function"!=typeof i)throw new TypeError(bt);function a(){var t=arguments,e=i?i.apply(this,t):t[0],n=a.cache;if(n.has(e))return n.get(e);var r=o.apply(this,t);return a.cache=n.set(e,r)||n,r}return a.cache=new(_t.Cache||vt),a}_t.Cache=vt;var mt=_t;var jt=/[Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
!function(){"use strict";function t(n){var r="stratum-instagram";$(document).ready(function(){var t=n.find(".".concat(r)),e=t.find(".".concat(r,"__wrapper"));e.hasClass("animate_on_scroll")&&t.imagesLoaded().progress(function(){new AnimOnScroll(e.get(0),{minDuration:.4,maxDuration:.7,viewportFactor:.2})})})}function e(h){var v="stratum-counter";$(document).ready(function(){function t(){return{startVal:r,decimalPlaces:o,duration:i,useEasing:s,useGrouping:c,separator:l,decimal:u,easingFn:function(t,e){if(!t)return null;switch(e){case"outExpo":return function(t,e,n,r){return n*(1-Math.pow(2,-10*t/r))*1024/1023+e};case"outQuintic":return function(t,e,n,r){var a=(t/=r)*t,o=a*t;return e+n*(o*a+-5*a*a+10*o+-10*a+5*t)};case"outCubic":return function(t,e,n,r){var a=(t/=r)*t;return e+n*(a*t+-3*a+3*t)}}}(s,d),numerals:function(t){switch(t){case"eastern_arabic":return["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"];case"farsi":return["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"];default:return null}}(f)}}var e=h.find(".".concat(v)),n=e.find(".".concat(v,"__wrapper")).data("options"),r=n.start,a=n.end,o=n.decimalPlaces,i=n.duration,s=n.useEasing,c=n.useGrouping,l=n.separator,u=n.decimal,d=n.easingFn,f=n.numerals,p=e.find(".".concat(v,"__number")),m=new Waypoint({element:p.get(0),handler:function(){new CountUp(p[0],a,t()).start(),m.destroy()},offset:"100%"})})}function n(v){var g="stratum-countdown";$(document).ready(function(){var t=v.find(".".concat(g)),e=t.find(".".concat(g,"__content")),n=e.data("datetime"),r=e.data("years"),a=e.data("months"),o=e.data("weeks"),i=e.data("days"),s=e.data("hours"),c=e.data("minutes"),l=e.data("seconds"),u=e.data("labels"),d=e.data("expire-actions"),f=e.data("expire-url"),p=e.data("expire-text"),m="";r&&(m+="Y"),a&&(m+="O"),o&&(m+="W"),i&&(m+="D"),s&&(m+="H"),c&&(m+="M"),l&&(m+="S");var h={until:"negative"==n?"":n,format:m};d&&(h.alwaysExpire=!0,d.includes("redirect")&&""!=f&&(h.expiryUrl=f),d.includes("message")&&""!=p&&(h.expiryText=p),d.includes("hide")&&(h.onExpiry=function(){t.hide()})),u&&(h.labels=u),e.countdown("destroy"),e.countdown(h)})}function r(g){var y="stratum-circle-progress-bar";$(document).ready(function(){var t=g.find(".".concat(y)),e=t.find(".".concat(y,"__wrapper")),n=e.data("options"),r=n.min,a=n.max,o=n.value,i=n.round,s=n.circle,c=n.padding,l=n.radius,u=n.thickness,d=n.bg,f=n.color,p=n.text,m={min:r,max:a,value:o,round:i,circle:s,padding:c,radius:l,thickness:u,bg:d,color:f};if(!s)var h=setInterval(function(){var t=g.find(".donut");t.length&&(t.css({transform:"rotate(315deg)",transformOrigin:"center"}),clearInterval(h))},1);p&&(m.text=function(t){return Math.floor(t.value/(t.max-t.min)*100)+"%"});var v=new Waypoint({element:t.get(0),handler:function(){e.donutty(m),v.destroy()},offset:"100%"})})}function o(l){var u="stratum-masonry-gallery";$(document).ready(function(){var t=l.find(".".concat(u)),e=t.data("options"),n=e.columns,r=e.gutter,a=void 0===r?0:r,o=e.animate,i=l.closest(".elementor-widget-".concat(u)).data("id");$(".".concat(u,"__item"),t).css("width","calc(100% / ".concat(n,")")),$(".".concat(u,"__item"),t).find(".stratum-masonry-gallery__image, .stratum-masonry-gallery__overlay").css({margin:a});var s={itemSelector:".elementor-element-".concat(i," .").concat(u,"__item"),horizontalOrder:!0,layoutMode:"masonry"};if(t[0])if(o)new AnimOnScroll(t.get(0),{minDuration:.4,maxDuration:.7,viewportFactor:.2},s);else{var c=t.masonry(s);imagesLoaded(c).on("progress",function(){c.masonry("layout")})}})}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C(a){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?c(Object(o),!0).forEach(function(t){var e,n,r;e=a,r=o[n=t],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(o,t))})}return a}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(){if("undefined"==typeof Reflect||Line truncated
|
||||
@@ -0,0 +1,642 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Admin_Page {
|
||||
private $version;
|
||||
private $prefix;
|
||||
private $we_devs_settings_api;
|
||||
|
||||
public function __construct() {
|
||||
$this->we_devs_settings_api = new \WeDevs_Settings_API;
|
||||
$settings = Settings::get_instance();
|
||||
|
||||
$this->version = $settings->getVersion();
|
||||
$this->prefix = $settings->getPrefix();
|
||||
|
||||
add_action( 'admin_init', array($this, 'admin_init') );
|
||||
add_action( 'admin_init', array($this, 'checkInstagramQueryURL') );
|
||||
add_action( 'admin_menu', array($this, 'admin_menu') );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueueAdminAssets' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue Admin Page js and css
|
||||
*/
|
||||
public function enqueueAdminAssets() {
|
||||
|
||||
//CSS
|
||||
wp_enqueue_style(
|
||||
"{$this->prefix}-admin-page",
|
||||
stratum_get_plugin_url( 'assets/css/admin-page.min.css' ),
|
||||
[],
|
||||
$this->version
|
||||
);
|
||||
|
||||
wp_enqueue_style(
|
||||
"{$this->prefix}-icons-style",
|
||||
stratum_get_plugin_url( './assets/css/stratum.min.css' ),
|
||||
apply_filters(
|
||||
'stratum/editor_css/dependencies',
|
||||
[]
|
||||
),
|
||||
$this->version
|
||||
);
|
||||
}
|
||||
|
||||
public function admin_init() {
|
||||
//Fill settings
|
||||
$this->we_devs_settings_api->set_sections( $this->get_settings_sections() );
|
||||
$this->we_devs_settings_api->set_fields( $this->get_settings_fields() );
|
||||
|
||||
//Init settings
|
||||
$this->we_devs_settings_api->admin_init();
|
||||
}
|
||||
|
||||
public function stratum_instagram_notice_success() {
|
||||
?>
|
||||
<div class="notice notice-success">
|
||||
<p><?php esc_html_e( 'Instagram: access token updated.', 'stratum' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function stratum_instagram_notice_error() {
|
||||
?>
|
||||
<div class="notice notice-error">
|
||||
<p><?php esc_html_e('Instagram: access denied.', 'stratum'); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function checkInstagramQueryURL()
|
||||
{
|
||||
global $pagenow;
|
||||
|
||||
if ($pagenow == 'admin.php' && isset($_GET['instagram-token'])) {
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$stratum_api['instagram_access_token'] = sanitize_text_field($_GET['instagram-token']);
|
||||
update_option('stratum_api', $stratum_api);
|
||||
delete_transient( 'stratum_instagram_response_data' ); //Delete cache data
|
||||
|
||||
wp_redirect(add_query_arg(
|
||||
array(
|
||||
'stratum-instagram-success' => true,
|
||||
),
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
)
|
||||
); //Redirect
|
||||
}
|
||||
|
||||
if (isset($_GET['stratum-instagram-success'])) {
|
||||
add_action( 'admin_notices', [$this, 'stratum_instagram_notice_success'] );
|
||||
}
|
||||
|
||||
if (isset($_GET['stratum-instagram-error'])) {
|
||||
add_action( 'admin_notices', [$this, 'stratum_instagram_notice_error'] );
|
||||
}
|
||||
}
|
||||
|
||||
public function admin_menu() {
|
||||
|
||||
add_menu_page(
|
||||
esc_html__( 'Stratum', 'stratum' ),
|
||||
esc_html__( 'Stratum', 'stratum' ),
|
||||
'manage_options',
|
||||
'stratum',
|
||||
array($this, 'about_page'),
|
||||
'data:image/svg+xml;base64,' . base64_encode(
|
||||
'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 112 112">
|
||||
<g>
|
||||
<path fill="gray" d="M83.28,58.38L83.28,58.38L48.75,38.44l0,0c3.59-6.22,11.54-8.35,17.76-4.76l12.01,6.94
|
||||
C84.74,44.21,86.87,52.16,83.28,58.38z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="gray" d="M83.28,82.63L83.28,82.63l-33.78-19.5c-6.22-3.59-8.35-11.54-4.76-17.76l0,0l33.77,19.5
|
||||
C84.74,68.46,86.87,76.41,83.28,82.63z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="gray" d="M79.29,89.56L79.29,89.56c-3.59,6.22-11.54,8.35-17.76,4.76l-12.05-6.96
|
||||
c-6.22-3.59-8.35-11.54-4.76-17.76l0,0L79.29,89.56z"/>
|
||||
</g>
|
||||
</svg>'
|
||||
),
|
||||
90
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'stratum',
|
||||
esc_html__( 'Stratum Settings', 'stratum' ),
|
||||
esc_html__( 'Settings', 'stratum' ),
|
||||
'manage_options',
|
||||
'stratum-settings',
|
||||
array( $this, 'plugin_page' )
|
||||
);
|
||||
}
|
||||
|
||||
public function about_page(){
|
||||
|
||||
$settings = \Stratum\Settings::get_instance();
|
||||
$pluginData = $settings->getPluginData();
|
||||
$storeUrl = isset( $pluginData['PluginURI'] ) ? $pluginData['PluginURI'] : 'https://motopress.com/';
|
||||
|
||||
?>
|
||||
<div class="wrap stratum-wrap about-wrap">
|
||||
<img class="stratum-logo" src="<?php echo esc_url(stratum_get_plugin_url( 'assets/img/logo.svg' )); ?>">
|
||||
<h1 class="stratum-heading">
|
||||
<?php echo esc_html__( 'Stratum', 'stratum' ); ?> <?php echo esc_html($this->version); ?>
|
||||
<a class="button button-primary" target="_blank" href="<?php echo esc_url( $storeUrl ); ?>"><?php echo esc_html__( 'Home Page', 'stratum' ); ?></a>
|
||||
</h1>
|
||||
<p><?php echo esc_html__( 'Advanced Elementor addon to extend the page builder capabilities and add more widgets.', 'stratum' ); ?></p>
|
||||
<hr>
|
||||
<h3><?php echo esc_html__( 'Changelog', 'stratum' ); ?></h3>
|
||||
<div class="stratum-about-list">
|
||||
|
||||
<!-- start markdowntohtml.com -->
|
||||
|
||||
<p>= 1.4.0, Mar 25 2024 =</p>
|
||||
<ul>
|
||||
<li>Added Instagram Access Token encryption.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.16, Feb 13 2024 =</p>
|
||||
<ul>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.15, May 24 2023 =</p>
|
||||
<ul>
|
||||
<li>Improved compatibility with latest Elementor versions.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.14, Mar 10 2023 =</p>
|
||||
<ul>
|
||||
<li>Fixed miscellaneous Elementor deprecations.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.13, Mar 23 2022 =</p>
|
||||
<ul>
|
||||
<li>Fixed an issue with missing descriptions in the Vertical Timeline widget.</li>
|
||||
<li>Fixed an issue with multiple markers in the Advanced Google Maps widget.</li>
|
||||
<li>Fixed an issue when the Swiper slider may not have been initialized with the "Improved Asset Loading" Elementor option enabled.</li>
|
||||
<li>Fixed an issue with the currency alignment in the Price Table widget.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.12, Nov 30 2021 =</p>
|
||||
<ul>
|
||||
<li>Fixed an issue with Advanced Slider on mobile devices.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.11, Oct 27 2021 =</p>
|
||||
<ul>
|
||||
<li>Security - sanitization and escaping.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.10, Aug 17 2021 =</p>
|
||||
<ul>
|
||||
<li>Fixed an issue with links in Horizontal Timeline and Accordion widgets.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.9, Jul 21 2021 =</p>
|
||||
<ul>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.8, May 5 2021 =</p>
|
||||
<ul>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.7, Apr 1 2021 =</p>
|
||||
<ul>
|
||||
<li>Added Table widget.</li>
|
||||
<li>Added Content Switcher widget.</li>
|
||||
<li>Added the ability to automatically refresh Instagram access token.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.6, Feb 17 2021 =</p>
|
||||
<ul>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.5, Dec 23 2020 =</p>
|
||||
<ul>
|
||||
<li>Improved compatibility with WordPress 5.6 and Elementor Pro.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.4, Sep 8 2020 =</p>
|
||||
<ul>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
|
||||
<p>= 1.3.3, Aug 28 2020 =</p>
|
||||
<ul>
|
||||
<li>Added Vertical Timeline widget.</li>
|
||||
<li>Added Horizontal Timeline widget.</li>
|
||||
<li>Added Lottie Animations widget.</li>
|
||||
<li>Added Countdown widget.</li>
|
||||
</ul>
|
||||
<p>= 1.3.2, Aug 12 2020 =</p>
|
||||
<ul>
|
||||
<li>Improved compatibility with WordPress 5.5.</li>
|
||||
</ul>
|
||||
<p>= 1.3.1, Jul 31 2020 =</p>
|
||||
<ul>
|
||||
<li>Fixed an issue with Instagram widget.</li>
|
||||
</ul>
|
||||
<p>= 1.3.0, Jun 10 2020 =</p>
|
||||
<ul>
|
||||
<li>Added Advanced Accordion widget.</li>
|
||||
<li>Added Advanced Tabs widget.</li>
|
||||
<li>Added Image Accordion widget.</li>
|
||||
<li>Improved the plugin color palette.</li>
|
||||
<li>Added the Templates Library control.</li>
|
||||
<li>Fixed an issue with "Instagram getToken" in the Instagram widget.</li>
|
||||
<li>Fixed an issue with controls in the Advanced Google Maps widget.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
<p>= 1.2.0, Apr 29 2020 =</p>
|
||||
<ul>
|
||||
<li>Added Advanced Google Map widget.</li>
|
||||
<li>Added Advanced Posts widget.</li>
|
||||
<li>Added Advanced Slider widget.</li>
|
||||
<li>Added Testimonial Carousel widget.</li>
|
||||
<li>Added Flip Box widget.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
<p>= 1.1.0, Mar 30 2020 =</p>
|
||||
<ul>
|
||||
<li>Added Image Hotspot widget.</li>
|
||||
<li>Added Masonry Gallery widget.</li>
|
||||
<li>Added Circular Progress Bar widget.</li>
|
||||
<li>Minor bugfixes and improvements.</li>
|
||||
</ul>
|
||||
<p>= 1.0.0, Mar 6 2020 =</p>
|
||||
<ul>
|
||||
<li>Initial commit.</li>
|
||||
</ul>
|
||||
|
||||
<!-- end -->
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function get_settings_sections() {
|
||||
|
||||
$sections = apply_filters( 'stratum_settings_sections', array(
|
||||
array(
|
||||
'id' => 'stratum_widgets',
|
||||
'title' => esc_html__( 'Elements', 'stratum' ),
|
||||
'addons' => true,
|
||||
'icon' => 'dashicons dashicons-admin-tools',
|
||||
),
|
||||
array(
|
||||
'id' => 'stratum_style',
|
||||
'title' => esc_html__( 'Style', 'stratum' ),
|
||||
'icon' => 'dashicons dashicons-admin-site-alt3',
|
||||
),
|
||||
array(
|
||||
'id' => 'stratum_api',
|
||||
'title' => esc_html__( 'API', 'stratum' ),
|
||||
'icon' => 'dashicons dashicons-admin-network',
|
||||
),
|
||||
) );
|
||||
|
||||
return $sections;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the settings fields
|
||||
*
|
||||
* @return array settings fields
|
||||
*/
|
||||
public function get_settings_fields() {
|
||||
|
||||
$encryption = new String_Encryption();
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$instagram_access_token = isset( $stratum_api['instagram_access_token'] ) ? $encryption->decrypt( $stratum_api['instagram_access_token'] ) : '';
|
||||
|
||||
$settings_fields = apply_filters( 'stratum_settings_fields', array(
|
||||
'stratum_widgets' => apply_filters( 'stratum_required_widgets', array(
|
||||
array(
|
||||
'name' => 'instagram',
|
||||
'label' => esc_html__( 'Instagram', 'stratum' ),
|
||||
'desc' => esc_html__( 'Real-life Instagram feed in your WordPress.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-instagram',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'banner',
|
||||
'label' => esc_html__( 'Banner', 'stratum' ),
|
||||
'desc' => esc_html__( 'Creative animated banners for promos and announcements.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-banner',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'counter',
|
||||
'label' => esc_html__( 'Counter', 'stratum' ),
|
||||
'desc' => esc_html__( 'Animated counters to visualize data.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-counter',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'price-menu',
|
||||
'label' => esc_html__( 'Price Menu', 'stratum' ),
|
||||
'desc' => esc_html__( 'Food menus or other listings with prices.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-price-menu',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'price-list',
|
||||
'label' => esc_html__( 'Price List', 'stratum' ),
|
||||
'desc' => esc_html__( 'Price variables or categorized lists of individual menu items.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-price-list',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'price-table',
|
||||
'label' => esc_html__( 'Price Table', 'stratum' ),
|
||||
'desc' => esc_html__( 'Pricing and comparison tables.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-price-table',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'table',
|
||||
'label' => esc_html__( 'Table', 'stratum' ),
|
||||
'desc' => esc_html__( 'Build responsive tables and customize their content and styling.', 'stratum' ),
|
||||
'icon' => 'eicon-table',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'content-switcher',
|
||||
'label' => esc_html__( 'Content Switcher', 'stratum' ),
|
||||
'desc' => esc_html__( 'Add a toggle or structure your content into switchable tabs - perfect for pricing plans and data organization.', 'stratum' ),
|
||||
'icon' => 'eicon-dual-button',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'image-hotspot',
|
||||
'label' => esc_html__( 'Image Hotspot', 'stratum' ),
|
||||
'desc' => esc_html__( 'Animated pointers with tooltips to place over images.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-image-hotspot',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'circle-progress-bar',
|
||||
'label' => esc_html__( 'Circle Progress Bar', 'stratum' ),
|
||||
'desc' => esc_html__( 'A circle-shaped bar with an animated activity progress indicator.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-circle-progress-bar',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'masonry-gallery',
|
||||
'label' => esc_html__( 'Masonry Gallery', 'stratum' ),
|
||||
'desc' => esc_html__( 'A masonry-styled responsive image gallery.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-masonry-gallery',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'advanced-slider',
|
||||
'label' => esc_html__( 'Advanced Slider', 'stratum' ),
|
||||
'desc' => esc_html__( 'A fully customizable slider, including the number of columns, horizontal and vertical scrolling, navigation, etc.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-advanced-slider',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'advanced-posts',
|
||||
'label' => esc_html__( 'Advanced Posts', 'stratum' ),
|
||||
'desc' => esc_html__( 'Showcase your automatically sourced posts and pages in different grid or list layouts.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-advanced-posts',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'advanced-accordion',
|
||||
'label' => esc_html__( 'Advanced Accordion', 'stratum' ),
|
||||
'desc' => esc_html__( 'Horizontal accordion tabs with support for custom Library templates.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-advanced-accordion',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'advanced-tabs',
|
||||
'label' => esc_html__( 'Advanced Tabs', 'stratum' ),
|
||||
'desc' => esc_html__( 'Fully customizable horizontal or vertical-oriented tabs with support for custom Library templates.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-advanced-tabs',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
array(
|
||||
'name' => 'countdown',
|
||||
'label' => esc_html__( 'Countdown', 'stratum' ),
|
||||
'desc' => esc_html__( 'Dynamic countdown timer with deeply customizable numeric values and time labels.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-countdown',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
),
|
||||
[
|
||||
'name' => 'testimonial-carousel',
|
||||
'label' => esc_html__( 'Testimonial Carousel', 'stratum' ),
|
||||
'desc' => esc_html__( 'A ready-made template for admin-added testimonials.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-testimonial-carousel',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
],
|
||||
[
|
||||
'name' => 'advanced-google-map',
|
||||
'label' => esc_html__( 'Advanced Google Map', 'stratum' ),
|
||||
'desc' => esc_html__( 'Google Maps with customizable location markets and map styles.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-advanced-google-map',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
],
|
||||
[
|
||||
'name' => 'flip-box',
|
||||
'label' => esc_html__( 'Flip Box', 'stratum' ),
|
||||
'desc' => esc_html__( 'Flip Box with animation that is triggered on hover and fully customizable front & back sections.', 'stratum' ),
|
||||
'icon' => 'stratum-icon-flip-box',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
],
|
||||
[
|
||||
'name' => 'image-accordion',
|
||||
'label' => esc_html__( 'Image Accordion', 'stratum' ),
|
||||
'desc' => esc_html__( 'Highlight your images with amazing hover and click effects using Image Accordion', 'stratum' ),
|
||||
'icon' => 'stratum-icon-image-accordion',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
],
|
||||
[
|
||||
'name' => 'vertical-timeline',
|
||||
'label' => esc_html__( 'Vertical Timeline', 'stratum' ),
|
||||
'desc' => esc_html__( 'Display events on your pages using Vertical Timeline widget, that allows adding content, including icons, imagery, and descriptions', 'stratum' ),
|
||||
'icon' => 'stratum-icon-vertical-timeline',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
],
|
||||
[
|
||||
'name' => 'horizontal-timeline',
|
||||
'label' => esc_html__( 'Horizontal Timeline', 'stratum' ),
|
||||
'desc' => esc_html__( 'Let the visitors know about the events and projects on your website using the Horizontal Timeline widget', 'stratum' ),
|
||||
'icon' => 'stratum-icon-horizontal-timeline',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
],
|
||||
[
|
||||
'name' => 'lottie-animations',
|
||||
'label' => esc_html__( 'Lottie Animations', 'stratum' ),
|
||||
'desc' => esc_html__( 'Lottie Animations widget give you the ability to easily add Lottie Animations to your Elementor pages with no need to add custom code', 'stratum' ),
|
||||
'icon' => 'stratum-icon-lottie-animations',
|
||||
'type' => 'toggle',
|
||||
'default' => 'on'
|
||||
]
|
||||
) ),
|
||||
'stratum_style' => array(
|
||||
array(
|
||||
'name' => 'primary_color',
|
||||
'label' => esc_html__( 'Primary color', 'stratum' ),
|
||||
'desc' => esc_html__( 'Select your primary color. Default: #3878ff', 'stratum' ),
|
||||
'type' => 'color',
|
||||
'default' => '#3878ff'
|
||||
),
|
||||
array(
|
||||
'name' => 'secondary_color',
|
||||
'label' => esc_html__( 'Secondary color (Hover)', 'stratum' ),
|
||||
'desc' => esc_html__( 'Select your secondary color. Default: #565656', 'stratum' ),
|
||||
'type' => 'color',
|
||||
'default' => '#565656'
|
||||
),
|
||||
array(
|
||||
'name' => 'background_color',
|
||||
'label' => esc_html__( 'Background color', 'stratum' ),
|
||||
'desc' => esc_html__( 'Select your secondary color. Default: #71d7f7', 'stratum' ),
|
||||
'type' => 'color',
|
||||
'default' => '#71d7f7'
|
||||
),
|
||||
array(
|
||||
'name' => 'background_color_active',
|
||||
'label' => esc_html__( 'Background color (Active)', 'stratum' ),
|
||||
'desc' => esc_html__( 'Select your secondary color. Default: #0097c6', 'stratum' ),
|
||||
'type' => 'color',
|
||||
'default' => '#0097c6'
|
||||
),
|
||||
array(
|
||||
'name' => 'background_color_hover',
|
||||
'label' => esc_html__( 'Background color (Hover)', 'stratum' ),
|
||||
'desc' => esc_html__( 'Select your secondary color. Default: #008fbc', 'stratum' ),
|
||||
'type' => 'color',
|
||||
'default' => '#008fbc'
|
||||
),
|
||||
),
|
||||
|
||||
'stratum_api' => [
|
||||
'instagram_access_token' => [
|
||||
'name' => 'instagram_access_token',
|
||||
'label' => esc_html__( 'Instagram Access Token', 'stratum' ),
|
||||
'desc_btn' => esc_html__( 'Connect Instagram Account', 'stratum' ),
|
||||
'desc_class' => 'large',
|
||||
'desc_link' => esc_url(
|
||||
'https://api.instagram.com/oauth/authorize?client_id=910186402812397&redirect_uri=' .
|
||||
'https://api.getmotopress.com/get_instagram_token.php&scope=user_profile,user_media&response_type=code&state=' .
|
||||
admin_url( 'admin.php' )
|
||||
),
|
||||
'type' => 'text',
|
||||
'is_encrypted' => true,
|
||||
],
|
||||
'google_api_key' => [
|
||||
'name' => 'google_api_key',
|
||||
'label' => esc_html__( 'Google Maps API Key', 'stratum' ),
|
||||
'desc' => sprintf( '<a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">%s</a>', esc_html__( 'Get the API key', 'stratum' ) ),
|
||||
'type' => 'text'
|
||||
]
|
||||
]
|
||||
) );
|
||||
|
||||
if ( ! empty( $instagram_access_token ) ) {
|
||||
$settings_fields['stratum_api']['instagram_access_token']['desc_extra_btn'] = esc_html__( 'Refresh Access Token', 'stratum' );
|
||||
$settings_fields['stratum_api']['instagram_access_token']['desc_extra_class'] = 'large';
|
||||
$settings_fields['stratum_api']['instagram_access_token']['desc_extra_link'] = esc_url(
|
||||
'https://api.getmotopress.com/refresh_instagram_token.php?access_token='.$instagram_access_token.'&state=' .
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
);
|
||||
|
||||
try {
|
||||
|
||||
$profile_data_json = wp_remote_get(
|
||||
'https://graph.instagram.com/me?fields=username&access_token=' . $instagram_access_token
|
||||
);
|
||||
|
||||
if ( ( ! is_wp_error( $profile_data_json ) ) && ( 200 === wp_remote_retrieve_response_code( $profile_data_json ) ) ) {
|
||||
|
||||
$profile_data = json_decode( $profile_data_json['body'] );
|
||||
|
||||
if ( json_last_error() === JSON_ERROR_NONE ) {
|
||||
$profile_display_val = '';
|
||||
|
||||
if ( isset( $profile_data->username ) ) {
|
||||
$profile_display_val = $profile_data->username;
|
||||
} elseif ( isset( $profile_data->id ) ) {
|
||||
$profile_display_val = $profile_data->id;
|
||||
}
|
||||
|
||||
$settings_fields['stratum_api']['instagram_access_token']['desc'] =
|
||||
! empty( $profile_display_val )
|
||||
? sprintf(
|
||||
//translators: %s is username or user id
|
||||
esc_html__('Account: %s', 'stratum'),
|
||||
esc_html( $profile_data->username )
|
||||
)
|
||||
: '';
|
||||
}
|
||||
}
|
||||
} catch ( \Exception $profile_data_exception ) {
|
||||
|
||||
$settings_fields['stratum_api']['instagram_access_token']['desc'] = esc_html( $profile_data_exception->getMessage() );
|
||||
}
|
||||
|
||||
stratum()->get_token_manager()->schedule_token_refresh_event();
|
||||
}
|
||||
|
||||
return $settings_fields;
|
||||
}
|
||||
|
||||
public function plugin_page() {
|
||||
if ( isset( $_GET['settings-updated'] ) ) {
|
||||
printf( '<div class="updated"><p>%s</p></div>', esc_html__( 'Plugin settings updated successfully', 'stratum' ) );
|
||||
}
|
||||
|
||||
$count = count( $this->get_settings_sections() );
|
||||
if ( $count <= 1 ) {
|
||||
$class = 'stratum-settings-sections-no';
|
||||
} else {
|
||||
$class = 'stratum-settings-sections-yes';
|
||||
}
|
||||
|
||||
echo '<div class="stratum-wrap about-wrap stratum-settings-wrap '. esc_attr( $class ) .'">';
|
||||
|
||||
$this->we_devs_settings_api->show_navigation();
|
||||
$this->we_devs_settings_api->show_forms();
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum\Managers;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Class Ajax_Manager
|
||||
* @package Stratum
|
||||
*/
|
||||
class Ajax_Manager {
|
||||
|
||||
/**
|
||||
* Ajax_Manager constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
//Ajax (Admin)
|
||||
add_action( 'elementor/ajax/register_actions', [ $this, 'register_admin_ajax_actions' ] );
|
||||
}
|
||||
|
||||
public function register_admin_ajax_actions($ajax_manager) {
|
||||
$ajax_manager->register_ajax_action( 'stratum_get_elementor_templates', [ $this, 'stratum_get_elementor_templates' ] );
|
||||
}
|
||||
|
||||
public static function stratum_get_elementor_templates($data = []){
|
||||
$args = [
|
||||
'post_type' => 'elementor_library',
|
||||
'posts_per_page' => -1,
|
||||
];
|
||||
|
||||
//Call from AJAX
|
||||
if (!empty($data)){
|
||||
//Check nonce
|
||||
$nonce = $data['nonce'];
|
||||
if ( ! wp_verify_nonce( $nonce, 'stratum_nonce_get_elementor_templates' ) ) {
|
||||
wp_send_json_error();
|
||||
}
|
||||
}
|
||||
|
||||
$page_templates = get_posts($args);
|
||||
$options = array();
|
||||
|
||||
if (!empty($page_templates) && !is_wp_error($page_templates)) {
|
||||
foreach ($page_templates as $post) {
|
||||
$options[$post->ID] = $post->post_title;
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
public function register_ajax_action($action, $func){
|
||||
add_action( "wp_ajax_{$action}", [ $this, $func ] );
|
||||
add_action( "wp_ajax_nopriv_{$action}", [ $this, $func ] );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum\Ajax;
|
||||
|
||||
use Stratum\Managers\Ajax_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Advanced_Posts_Ajax extends Ajax_Manager {
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
public function __construct() {
|
||||
$this->register_ajax_action( 'stratum_ajax_get_articles', 'get_articles' );
|
||||
}
|
||||
|
||||
public static function get_instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public function get_articles($settings, $type = 'ajax') {
|
||||
|
||||
if ( $type == 'ajax' ) {
|
||||
|
||||
//Check nonce
|
||||
$nonce = sanitize_text_field( $_POST['nonce'] );
|
||||
if ( ! wp_verify_nonce( $nonce, 'stratum_nonce_get_articles' ) ) {
|
||||
wp_send_json_error();
|
||||
}
|
||||
|
||||
$settings = isset( $_POST['settings'] ) ? (array) $_POST['settings'] : array();
|
||||
$settings = stratum_recursive_sanitize_array( $settings );
|
||||
|
||||
}
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'slide_animation_effect' => '',
|
||||
'slide_text_animation_effect' => '',
|
||||
'title_typography_html_tag' => 'h3',
|
||||
'show_image' => '',
|
||||
'show_title' => '',
|
||||
'title_over_image' => '',
|
||||
'show_content' => '',
|
||||
'show_excerpt' => '',
|
||||
'show_read_more' => '',
|
||||
'read_more_text' => '',
|
||||
'open_new_tab' => '',
|
||||
'excerpt_length' => apply_filters( 'excerpt_length', 25 ),
|
||||
'show_meta' => array(),
|
||||
'meta_fields_divider' => '',
|
||||
'image_size' => '',
|
||||
'posts_layout' => '',
|
||||
'pagination' => '',
|
||||
'load_more_pagination' => '',
|
||||
'load_more_text' => '',
|
||||
'column_gap' => '',
|
||||
'row_gap' => '',
|
||||
'masonry' => '',
|
||||
'columns' => '',
|
||||
'columns_tablet' => '',
|
||||
'columns_mobile' => '',
|
||||
'animate_on_scroll' => '',
|
||||
|
||||
//Swiper
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
//--Swiper
|
||||
), $settings ) );
|
||||
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
|
||||
$widget_class = 'stratum-advanced-posts';
|
||||
|
||||
$out = "";
|
||||
|
||||
//Query builder
|
||||
$query_args = [];
|
||||
stratum_build_custom_query( $query_args, $settings );
|
||||
|
||||
$q = new \WP_Query( $query_args );
|
||||
|
||||
if ( $q->have_posts() ){
|
||||
|
||||
while( $q->have_posts() ):
|
||||
$q->the_post();
|
||||
|
||||
$item_class = stratum_css_class([
|
||||
$widget_class . '__post',
|
||||
(($show_title == 'yes' && $title_over_image == 'yes') ? 'title_over_image' : ''),
|
||||
((($posts_layout == 'grid' || $posts_layout == 'list') && ($animate_on_scroll == 'yes' || ($masonry == 'yes' && intval($columns) > 1))) ? "masonry-item" : ''),
|
||||
]);
|
||||
|
||||
$out .= "<article id='post-".esc_attr(get_the_ID())."' class='".esc_attr( $item_class )."'>";
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__post-wrapper' )."'>";
|
||||
if ( $show_image == 'yes' ) {
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__post-thumbnail' )."'>";
|
||||
$out .= "<a href='".esc_url(get_permalink())."' class='".esc_attr( $widget_class . '__post-link' )."'>";
|
||||
ob_start();
|
||||
the_post_thumbnail( $image_size,
|
||||
array(
|
||||
'alt' => the_title_attribute( 'echo=0' ),
|
||||
'class' => esc_attr( $widget_class . '__post-thumbnail-image' ),
|
||||
)
|
||||
);
|
||||
$out .= ob_get_clean();
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__post-thumbnail-overlay' )."'></div>";
|
||||
if ( $show_title == 'yes' && $title_over_image == 'yes' ) {
|
||||
$out .= "<{$title_typography_html_tag} class='".esc_attr( $widget_class . '__post-title' )."'>";
|
||||
$out .= esc_html( get_the_title() );
|
||||
$out .= "</{$title_typography_html_tag}>";
|
||||
}
|
||||
$out .= "</a>";
|
||||
$out .= "</div>";
|
||||
}
|
||||
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__content-wrapper' )."'>";
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__entry-header' )."'>";
|
||||
|
||||
if ( $show_title == 'yes' && $title_over_image == '' ) {
|
||||
ob_start();
|
||||
the_title( '<'.esc_attr($title_typography_html_tag).' class="'.esc_attr( $widget_class . '__post-title' ).'"><a href="'.esc_url(get_permalink()).'">', '</a></'.esc_attr($title_typography_html_tag).'>' );
|
||||
$out .= ob_get_clean();
|
||||
}
|
||||
|
||||
if (!empty($show_meta)){
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__entry-meta' )."'>";
|
||||
|
||||
if (in_array("date", $show_meta)){
|
||||
$archive_year = get_the_time('Y');
|
||||
$archive_month = get_the_time('m');
|
||||
$archive_day = get_the_time('d');
|
||||
|
||||
$out .= "<span class='".esc_attr( $widget_class . '__post-date' )."'>";
|
||||
|
||||
$out .= "<time datetime='".esc_attr( get_the_date( 'c' ) )."'>";
|
||||
$out .= "<a href='".get_day_link( $archive_year, $archive_month, $archive_day)."'>";
|
||||
$out .= esc_html( get_the_date( '' ) );
|
||||
$out .= "</a>";
|
||||
$out .= "</time>";
|
||||
|
||||
$out .= "</span>";
|
||||
}
|
||||
|
||||
if (in_array("author", $show_meta)){
|
||||
$out .= in_array("date", $show_meta) ? "<span class='".esc_attr( $widget_class . '__meta-fields-divider' )."'>".esc_html($meta_fields_divider)."</span>" : '';
|
||||
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__post-author' )."'>";
|
||||
$out .= "<a href='".esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )."'>";
|
||||
$out .= esc_html( get_the_author() );
|
||||
$out .= "</a>";
|
||||
$out .= "</div>";
|
||||
}
|
||||
|
||||
if (in_array("categories", $show_meta)){
|
||||
$out .= (in_array("date", $show_meta) || in_array("author", $show_meta)) ? "<span class='".esc_attr( $widget_class . '__meta-fields-divider' )."'>".esc_html($meta_fields_divider)."</span>" : '';
|
||||
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__post-categories' )."'>";
|
||||
$out .= get_the_category_list(', ');
|
||||
$out .= "</div>";
|
||||
}
|
||||
|
||||
if (in_array("comments", $show_meta)){
|
||||
$out .= (in_array("date", $show_meta) || in_array("author", $show_meta) || in_array("categories", $show_meta)) ? "<span class='".esc_attr( $widget_class . '__meta-fields-divider' )."'>".esc_html($meta_fields_divider)."</span>" : '';
|
||||
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__post-comments' )."'>";
|
||||
$out .= "<a href='".esc_url( get_comments_link() )."'>";
|
||||
if ( get_comments_number() ) {
|
||||
$out .= esc_html(
|
||||
sprintf(
|
||||
_n( '%d Comment', '%d Comments', get_comments_number(), 'stratum' ),
|
||||
get_comments_number()
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$out .= esc_html__( 'No comments', 'stratum' );
|
||||
}
|
||||
$out .= "</a>";
|
||||
$out .= "</div>";
|
||||
}
|
||||
|
||||
$out .= "</div>";
|
||||
}
|
||||
|
||||
|
||||
$out .= "</div>";
|
||||
|
||||
if ( $show_content == 'yes' ) {
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__post-content' )."'>";
|
||||
if ( $show_excerpt == 'yes' ) {
|
||||
|
||||
if ( $excerpt_length ) {
|
||||
\Stratum\Excerpt_Helper::get_instance()->setExcerptLength( $excerpt_length );
|
||||
add_filter( 'excerpt_length', array( 'Stratum\Excerpt_Helper', 'excerpt_length' ), 999 );
|
||||
}
|
||||
|
||||
$out .= get_the_excerpt();
|
||||
|
||||
remove_filter( 'excerpt_length', array( 'Stratum\Excerpt_Helper', 'excerpt_length' ), 999 );
|
||||
|
||||
} else {
|
||||
ob_start();
|
||||
the_content();
|
||||
$out .= ob_get_clean();
|
||||
}
|
||||
$out .= "</div>";
|
||||
}
|
||||
|
||||
if ( $show_read_more == 'yes' ) {
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__entry-footer' )."'>";
|
||||
|
||||
$out .= "<div class='".esc_attr( $widget_class . '__read-more' )."'>";
|
||||
$out .= "<a href='".esc_url( get_permalink() )."'".($open_new_tab == 'yes' ? " target='_blank'" : '').">";
|
||||
$out .= esc_html($read_more_text);
|
||||
$out .= "</a>";
|
||||
$out .= "</div>";
|
||||
|
||||
$out .= "</div>";
|
||||
}
|
||||
$out .= "</div>";
|
||||
$out .= "</div>";
|
||||
$out .= "</article>";
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
|
||||
} else {
|
||||
$out .= '<p>' . esc_html__( 'Nothing found.', 'stratum' ) . '</p>';
|
||||
}
|
||||
|
||||
if ($type == 'render'){
|
||||
return $out;
|
||||
} elseif ($type == 'ajax'){
|
||||
echo $out; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
wp_die();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new Advanced_Posts_Ajax();
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum\Managers;
|
||||
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Class Controls_Manager
|
||||
* @package Stratum
|
||||
*/
|
||||
class Controls_Manager {
|
||||
|
||||
private $prefix;
|
||||
|
||||
/**
|
||||
* Controls_Manager constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$settings = \Stratum\Settings::get_instance();
|
||||
|
||||
$this->prefix = $settings->getPrefix();
|
||||
|
||||
add_action( 'elementor/controls/register', [ $this, 'register_controls' ] );
|
||||
}
|
||||
|
||||
public function register_controls() {
|
||||
if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Element_Base' ) ) {
|
||||
if ( class_exists( 'Elementor\Plugin' ) ) {
|
||||
if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
|
||||
$elementor = Plugin::instance();
|
||||
if ( isset( $elementor->controls_manager ) ) {
|
||||
|
||||
//Files controls list
|
||||
$controls = array(
|
||||
'group_control_typography',
|
||||
'ajax_control',
|
||||
);
|
||||
|
||||
foreach ($controls as $key => $control_name) {
|
||||
$path = stratum_get_plugin_path( '/includes/controls/' . $control_name . '.php' );
|
||||
|
||||
if ( file_exists( $path ) ) {
|
||||
require_once( $path );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Control_Select2;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Stratum_AJAX_Control extends Control_Select2 {
|
||||
const QUERY = 'stratum_ajax_control';
|
||||
|
||||
public function get_type() {
|
||||
return static::QUERY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 'query' can be used for passing query args in the structure and format used by WP_Query.
|
||||
* @return array
|
||||
*/
|
||||
protected function get_default_settings() {
|
||||
return array_merge(
|
||||
parent::get_default_settings(), [
|
||||
'query' => '',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Plugin::instance()->controls_manager->register( new Stratum_AJAX_Control() );
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Group_Control_Base;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Stratum_Group_Control_Typography extends Group_Control_Base {
|
||||
protected static $fields;
|
||||
|
||||
public static function get_type() {
|
||||
return 'stratum_typography';
|
||||
}
|
||||
|
||||
protected function init_fields() {
|
||||
$default_fields = new Group_Control_Typography();
|
||||
$fields = $default_fields->init_fields();
|
||||
|
||||
//Extend control (Add field)
|
||||
$fields['html_tag'] = [
|
||||
'label' => esc_html__( 'HTML Tag', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1', 'stratum' ),
|
||||
'h2' => esc_html__( 'H2', 'stratum' ),
|
||||
'h3' => esc_html__( 'H3', 'stratum' ),
|
||||
'h4' => esc_html__( 'H4', 'stratum' ),
|
||||
'h5' => esc_html__( 'H5', 'stratum' ),
|
||||
'h6' => esc_html__( 'H6', 'stratum' ),
|
||||
'div' => esc_html__( 'div', 'stratum' ),
|
||||
'p' => esc_html__( 'p', 'stratum' ),
|
||||
'span' => esc_html__( 'span', 'stratum' ),
|
||||
],
|
||||
];
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
protected function prepare_fields( $fields ) {
|
||||
array_walk(
|
||||
$fields, function( &$field, $field_name ) {
|
||||
if ( in_array( $field_name, [ 'typography', 'popover_toggle' ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$selector_value = ! empty( $field['selector_value'] ) ? $field['selector_value'] : str_replace( '_', '-', $field_name ) . ': {{VALUE}};';
|
||||
|
||||
$typography_field = $this->get_args();
|
||||
if(isset($typography_field['defaults'])){
|
||||
$defaults_arr = $typography_field['defaults'];
|
||||
}
|
||||
|
||||
if(isset($typography_field['mobile_defaults'])){
|
||||
$mobile_defaults_arr = $typography_field['mobile_defaults'];
|
||||
}
|
||||
if(isset($typography_field['tablet_defaults'])){
|
||||
$tablet_defaults_arr = $typography_field['tablet_defaults'];
|
||||
}
|
||||
|
||||
//Set defaults values to all fields
|
||||
if (isset($typography_field['defaults'])){
|
||||
if (isset($defaults_arr)){
|
||||
if ( isset($defaults_arr[$field_name])){
|
||||
$field['default'] = $defaults_arr[$field_name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($typography_field['mobile_defaults'])){
|
||||
if (isset($mobile_defaults_arr[$field_name])){
|
||||
$field['mobile_default'] = $mobile_defaults_arr[$field_name];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($typography_field['tablet_defaults'])){
|
||||
if (isset($tablet_defaults_arr[$field_name])){
|
||||
$field['tablet_default'] = $tablet_defaults_arr[$field_name];
|
||||
}
|
||||
}
|
||||
//--Set defaults values to all fields
|
||||
|
||||
if($field_name != 'html_tag'){ //Not render styles if
|
||||
$field['selectors'] = [
|
||||
'{{SELECTOR}}' => $selector_value,
|
||||
];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return parent::prepare_fields( $fields );
|
||||
}
|
||||
|
||||
protected function get_default_options() {
|
||||
return [
|
||||
'popover' => [
|
||||
'starter_name' => 'typography',
|
||||
'starter_title' => esc_html_x( 'Typography', 'Typography Control', 'stratum' ),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->controls_manager->add_group_control( 'stratum_typography', new Stratum_Group_Control_Typography() );
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
class Excerpt_Helper {
|
||||
/**
|
||||
* @var Excerpt_Helper
|
||||
*/
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private static $excerpt_length;
|
||||
|
||||
/**
|
||||
* @return Stratum
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public function setExcerptLength( $excerpt_length ) {
|
||||
self::$excerpt_length = $excerpt_length;
|
||||
}
|
||||
|
||||
public static function excerpt_length() {
|
||||
return self::$excerpt_length;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,333 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Gets plugin's absolute directory path.
|
||||
*
|
||||
* @param string $path Relative path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function stratum_get_plugin_path( $path = '' ) {
|
||||
return STRATUM_PLUGIN_DIR . trim( $path, '/' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets plugin's URL.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function stratum_get_plugin_url( $path = '' ) {
|
||||
return plugins_url( $path, STRATUM_PLUGIN_FILE );
|
||||
}
|
||||
|
||||
//Check if this Elementor page
|
||||
function stratum_is_elementor($id = '') {
|
||||
global $post;
|
||||
|
||||
if (!empty($id)) {
|
||||
return \Elementor\Plugin::$instance->documents->get($id)->is_built_with_elementor();
|
||||
} else {
|
||||
return \Elementor\Plugin::$instance->documents->get($post->ID)->is_built_with_elementor();
|
||||
}
|
||||
}
|
||||
|
||||
function stratum_generate_swiper_options($settings = []){
|
||||
|
||||
if (empty($settings)) return;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
//Swiper
|
||||
'columns_count' => '1',
|
||||
'slides_in_columns' => '1',
|
||||
'slides_to_scroll' => '1',
|
||||
'slider_direction' => 'horizontal',
|
||||
'auto_height' => '',
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
'dynamic_bullets' => '',
|
||||
'keyboard_control' => '',
|
||||
'mousewheel_control' => '',
|
||||
'item_center' => '',
|
||||
'spacing_slides' => '',
|
||||
'free_mode' => '',
|
||||
'slide_effects' => 'slide',
|
||||
'autoplay' => '',
|
||||
'autoplay_speed' => '',
|
||||
'pause_on_hover' => 'yes',
|
||||
'loop' => '',
|
||||
'animation_speed' => '',
|
||||
'simulate_touch' => '',
|
||||
//--Swiper
|
||||
|
||||
//Extra options
|
||||
'slide_text_animation_delay' => 500,
|
||||
'coverflow_visible' => '',
|
||||
|
||||
//Responsive
|
||||
'columns_count_tablet' => '',
|
||||
'columns_count_mobile' => '',
|
||||
|
||||
'slides_in_columns_tablet' => '',
|
||||
'slides_in_columns_mobile' => '',
|
||||
|
||||
'slides_to_scroll_tablet' => '',
|
||||
'slides_to_scroll_mobile' => '',
|
||||
|
||||
'spacing_slides_tablet' => '',
|
||||
'spacing_slides_mobile' => ''
|
||||
), $settings ) );
|
||||
|
||||
$spaceBetween = ( is_array( $spacing_slides ) && array_key_exists( 'size', $spacing_slides ) ) ?
|
||||
absint( $spacing_slides['size'] ) : 0;
|
||||
|
||||
$spaceBetween_tablet = ( is_array( $spacing_slides_tablet ) && array_key_exists( 'size', $spacing_slides_tablet ) ) ?
|
||||
absint( $spacing_slides_tablet['size'] ) : $spaceBetween;
|
||||
|
||||
$spaceBetween_mobile = ( is_array( $spacing_slides_mobile ) && array_key_exists( 'size', $spacing_slides_mobile ) ) ?
|
||||
absint( $spacing_slides_mobile['size'] ) : $spaceBetween;
|
||||
|
||||
$options = array(
|
||||
'slidesPerView' => ($columns_count != 'auto') ? ( ($slide_effects == 'cube') ? 1 : (int)$columns_count ) : $columns_count,
|
||||
'slidesPerColumn' => (int)$slides_in_columns,
|
||||
'slidesPerColumnFill' => 'row', //column
|
||||
'slidesPerGroup' => (int)$slides_to_scroll,
|
||||
'direction' => $slider_direction,
|
||||
'autoHeight' => (($free_mode == 'yes' || (int)$slides_in_columns != 1) ? false : ($auto_height == 'yes')),
|
||||
'keyboard' => $keyboard_control == 'yes',
|
||||
'mousewheel' => $mousewheel_control == 'yes',
|
||||
'centeredSlides' => $item_center == 'yes',
|
||||
'spaceBetween' => $spaceBetween,
|
||||
'freeMode' => $free_mode == 'yes',
|
||||
'effect' => (($slider_direction == 'vertical' && $slide_effects == 'cube') ? 'slide' : $slide_effects),
|
||||
'autoplay' => ($autoplay == 'yes') ? array('delay' => $autoplay_speed) : false,
|
||||
'autoplayPause' => ($autoplay == 'yes' && $pause_on_hover == 'yes'),
|
||||
'loop' => $loop == 'yes',
|
||||
'speed' => $animation_speed,
|
||||
'allowTouchMove' => $simulate_touch == 'yes',
|
||||
|
||||
'textAnimationDelay' => (int) $slide_text_animation_delay,
|
||||
'coverflow_visible' => ($coverflow_visible == 'visible'),
|
||||
|
||||
//Responsive
|
||||
'responsive' => array(
|
||||
'slidesPerView_tablet' => ( $columns_count_tablet != 'auto') ? (int)$columns_count_tablet : $columns_count_tablet,
|
||||
'slidesPerView_mobile' => ( $columns_count_mobile != 'auto') ? (int)$columns_count_mobile : $columns_count_mobile,
|
||||
|
||||
'slidesPerColumn_tablet' => (int)$slides_in_columns_tablet,
|
||||
'slidesPerColumn_mobile' => (int)$slides_in_columns_mobile,
|
||||
|
||||
'slidesPerGroup_tablet' => (int)$slides_to_scroll_tablet,
|
||||
'slidesPerGroup_mobile' => (int)$slides_to_scroll_mobile,
|
||||
|
||||
'spaceBetween_tablet' => $spaceBetween_tablet,
|
||||
'spaceBetween_mobile' => $spaceBetween_mobile,
|
||||
)
|
||||
);
|
||||
|
||||
if ($navigation != 'none'){
|
||||
//Arrows
|
||||
$navigation_arrows = true;
|
||||
|
||||
//Bullets
|
||||
$navigation_pagination = array(
|
||||
'el' => '.swiper-pagination',
|
||||
'type' => $pagination_style,
|
||||
'clickable' => true,
|
||||
'dynamicBullets' => ($dynamic_bullets == 'yes'),
|
||||
);
|
||||
|
||||
//Scrollbar
|
||||
$navigation_scrollbar = array(
|
||||
'el' => '.swiper-scrollbar',
|
||||
'draggable' => true
|
||||
);
|
||||
|
||||
if ($navigation == 'both'){
|
||||
$options['navigation'] = $navigation_arrows;
|
||||
if ($pagination_style == 'scrollbar'){
|
||||
$options['scrollbar'] = $navigation_scrollbar;
|
||||
} else {
|
||||
$options['pagination'] = $navigation_pagination;
|
||||
}
|
||||
} else if ($navigation == 'arrows') {
|
||||
$options['navigation'] = $navigation_arrows;
|
||||
} else if ($navigation == 'pagination') {
|
||||
if ($pagination_style == 'scrollbar'){
|
||||
$options['scrollbar'] = $navigation_scrollbar;
|
||||
} else {
|
||||
$options['pagination'] = $navigation_pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
function stratum_get_taxonomies($post_type){
|
||||
$taxonomies = get_object_taxonomies( $post_type, 'objects' );
|
||||
|
||||
$return = [];
|
||||
if (!empty($taxonomies)){
|
||||
foreach ($taxonomies as $key => $taxonomy_name) {
|
||||
$return[$key] = $taxonomy_name->labels->name;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function stratum_get_terms($taxonomy){
|
||||
$return = [];
|
||||
$terms = get_terms(array(
|
||||
'taxonomy' => $taxonomy,
|
||||
'hide_empty' => true,
|
||||
));
|
||||
|
||||
if (!empty($terms)){
|
||||
foreach ($terms as $key => $term_name) {
|
||||
$taxonomy_obj = get_taxonomy( $term_name->taxonomy );
|
||||
$return[$term_name->slug] = $term_name->name;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function stratum_build_custom_query(&$query_args = [], $settings = []){
|
||||
|
||||
if ((isset($settings['include_ids']) && $settings['include_ids'] != '') || isset($settings['post_type'])){
|
||||
$query_args = array(
|
||||
'posts_per_page' => $settings['posts_per_page'],
|
||||
'ignore_sticky_posts' => 1,
|
||||
'post_status' => 'publish',
|
||||
'order' => $settings['order'],
|
||||
'orderby' => $settings['orderby'],
|
||||
);
|
||||
|
||||
if ( isset($settings['ignore_sticky_posts']) ){
|
||||
$query_args['ignore_sticky_posts'] = $settings['ignore_sticky_posts'];
|
||||
}
|
||||
|
||||
if (isset($settings['page'])){
|
||||
$paged = $settings['page'];
|
||||
} else {
|
||||
$paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;
|
||||
}
|
||||
|
||||
if ( isset($settings['pagination']) && $settings['pagination'] == 'yes' ){
|
||||
$query_args['paged'] = $paged;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Exclude by IDs && Current Post ID
|
||||
if ((isset($settings['exclude_ids']) && $settings['exclude_ids'] != '') || $settings['exclude_current']){
|
||||
|
||||
$ids_arr = [];
|
||||
if ((isset($settings['exclude_ids']) && $settings['exclude_ids'] != '')){
|
||||
$ids_arr = array_map( 'intval', explode(',', $settings['exclude_ids']) );
|
||||
}
|
||||
|
||||
if ($settings['exclude_current']){
|
||||
$ids_arr[] = get_the_ID();
|
||||
}
|
||||
|
||||
$query_args['post__not_in'] = $ids_arr;
|
||||
}
|
||||
|
||||
//Filter by IDs
|
||||
if (isset($settings['include_ids']) && $settings['include_ids'] != ''){
|
||||
|
||||
$ids_arr = array_map( 'intval', explode(',', $settings['include_ids']) );
|
||||
$query_args['post__in'] = $ids_arr;
|
||||
|
||||
}
|
||||
|
||||
//Set post_type
|
||||
if ( isset($settings['post_type'])){
|
||||
|
||||
$query_args['post_type'] = $settings['post_type'];
|
||||
|
||||
if ( !empty($settings['taxonomies'])){
|
||||
|
||||
$query_args['tax_query'] = array(
|
||||
'relation' => $settings['terms_relation'],
|
||||
);
|
||||
|
||||
$taxonomy_arr = [];
|
||||
|
||||
//Get terms from taxonomy (Make arr)
|
||||
foreach ($settings['taxonomies'] as $taxonomy_key => $taxonomy_name) {
|
||||
if (isset($settings[$taxonomy_name.'_terms'])){
|
||||
foreach ($settings[$taxonomy_name.'_terms'] as $term_key => $term_value) {
|
||||
$taxonomy_arr[$taxonomy_name][] = $term_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Add array to query
|
||||
if (!empty($taxonomy_arr)){
|
||||
foreach ($taxonomy_arr as $taxonomy_name => $terms_arr) {
|
||||
foreach ($terms_arr as $term_index => $term_name) {
|
||||
$query_args['tax_query'][] = array(
|
||||
'taxonomy' => $taxonomy_name,
|
||||
'field' => 'slug',
|
||||
'terms' => $term_name
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function stratum_css_class($class_array){
|
||||
return implode(' ', array_filter($class_array));
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive sanitation for an array
|
||||
*
|
||||
* @param $array
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function stratum_recursive_sanitize_array( $array ) {
|
||||
|
||||
foreach ( $array as $key => &$value ) {
|
||||
if ( is_array( $value ) ) {
|
||||
$value = stratum_recursive_sanitize_array($value);
|
||||
}
|
||||
else {
|
||||
$value = sanitize_text_field( $value );
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate an HTML tag against a safe allowed list.
|
||||
*
|
||||
* @param string $tag
|
||||
*
|
||||
* @return string Valid HTML tag allowed for headings
|
||||
*/
|
||||
function stratum_validate_heading_html_tag( $tag ) {
|
||||
|
||||
$allowed_tags = array(
|
||||
'h1',
|
||||
'h2',
|
||||
'h3',
|
||||
'h4',
|
||||
'h5',
|
||||
'h6',
|
||||
'div',
|
||||
'span',
|
||||
'p',
|
||||
);
|
||||
|
||||
return in_array( strtolower( $tag ), $allowed_tags ) ? $tag : 'div';
|
||||
}
|
||||
@@ -0,0 +1,867 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* weDevs Settings API wrapper class modified for Stratum
|
||||
*
|
||||
* @version 1.3 (27-Sep-2016)
|
||||
*
|
||||
* @author Tareq Hasan <[email protected]>
|
||||
* @link https://tareq.co Tareq Hasan
|
||||
* @example example/oop-example.php How to use the class
|
||||
*/
|
||||
|
||||
use Stratum\String_Encryption;
|
||||
|
||||
if ( !class_exists( 'WeDevs_Settings_API' ) ):
|
||||
class WeDevs_Settings_API {
|
||||
|
||||
/**
|
||||
* settings sections array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $settings_sections = array();
|
||||
|
||||
/**
|
||||
* Settings fields array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $settings_fields = array();
|
||||
|
||||
public function __construct() {
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles
|
||||
*/
|
||||
function admin_enqueue_scripts() {
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'jquery' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set settings sections
|
||||
*
|
||||
* @param array $sections setting sections array
|
||||
*/
|
||||
function set_sections( $sections ) {
|
||||
$this->settings_sections = $sections;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a single section
|
||||
*
|
||||
* @param array $section
|
||||
*/
|
||||
function add_section( $section ) {
|
||||
$this->settings_sections[] = $section;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set settings fields
|
||||
*
|
||||
* @param array $fields settings fields array
|
||||
*/
|
||||
function set_fields( $fields ) {
|
||||
$this->settings_fields = $fields;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
function add_field( $section, $field ) {
|
||||
$defaults = array(
|
||||
'name' => '',
|
||||
'label' => '',
|
||||
'desc' => '',
|
||||
'type' => 'text'
|
||||
);
|
||||
|
||||
$arg = wp_parse_args( $field, $defaults );
|
||||
$this->settings_fields[$section][] = $arg;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize and registers the settings sections and fileds to WordPress
|
||||
*
|
||||
* Usually this should be called at `admin_init` hook.
|
||||
*
|
||||
* This function gets the initiated settings sections and fields. Then
|
||||
* registers them to WordPress and ready for use.
|
||||
*/
|
||||
function admin_init() {
|
||||
//register settings sections
|
||||
foreach ( $this->settings_sections as $section ) {
|
||||
|
||||
if ( isset($section['desc']) && !empty($section['desc']) ) {
|
||||
$section['desc'] = '<div class="inside">' . $section['desc'] . '</div>';
|
||||
$callback = create_function('', 'echo "' . str_replace( '"', '\"', $section['desc'] ) . '";');
|
||||
} else if ( isset( $section['callback'] ) ) {
|
||||
$callback = $section['callback'];
|
||||
} else {
|
||||
$callback = null;
|
||||
}
|
||||
|
||||
add_settings_section( $section['id'], $section['title'], $callback, $section['id'] );
|
||||
}
|
||||
|
||||
//register settings fields
|
||||
foreach ( $this->settings_fields as $section => $field ) {
|
||||
foreach ( $field as $option ) {
|
||||
|
||||
$name = $option['name'];
|
||||
$type = isset( $option['type'] ) ? $option['type'] : 'text';
|
||||
$label = isset( $option['label'] ) ? $option['label'] : '';
|
||||
$callback = isset( $option['callback'] ) ? $option['callback'] : array( $this, 'callback_' . $type );
|
||||
|
||||
$args = array(
|
||||
'id' => $name,
|
||||
'class' => isset( $option['class'] ) ? $option['class'] : $name,
|
||||
'label_for' => "{$section}[{$name}]",
|
||||
'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
|
||||
'desc_btn' => isset( $option['desc_btn'] ) ? $option['desc_btn'] : '',
|
||||
'desc_link' => isset( $option['desc_link'] ) ? $option['desc_link'] : '',
|
||||
'desc_class' => isset( $option['desc_class'] ) ? $option['desc_class'] : '',
|
||||
|
||||
'desc_extra_btn' => isset( $option['desc_extra_btn'] ) ? $option['desc_extra_btn'] : '',
|
||||
'desc_extra_link' => isset( $option['desc_extra_link'] ) ? $option['desc_extra_link'] : '',
|
||||
'desc_extra_class' => isset( $option['desc_extra_class'] ) ? $option['desc_extra_class'] : '',
|
||||
|
||||
'name' => $label,
|
||||
'section' => $section,
|
||||
'size' => isset( $option['size'] ) ? $option['size'] : null,
|
||||
'options' => isset( $option['options'] ) ? $option['options'] : '',
|
||||
'std' => isset( $option['default'] ) ? $option['default'] : '',
|
||||
'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '',
|
||||
'type' => $type,
|
||||
'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '',
|
||||
'min' => isset( $option['min'] ) ? $option['min'] : '',
|
||||
'max' => isset( $option['max'] ) ? $option['max'] : '',
|
||||
'step' => isset( $option['step'] ) ? $option['step'] : '',
|
||||
'icon' => isset( $option['icon'] ) ? $option['icon'] : '',
|
||||
);
|
||||
|
||||
add_settings_field( "{$section}[{$name}]", $label, $callback, $section, $section, $args );
|
||||
}
|
||||
}
|
||||
|
||||
// creates our settings in the options table
|
||||
foreach ( $this->settings_sections as $section ) {
|
||||
register_setting( $section['id'], $section['id'], array( $this, 'sanitize_options' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get field description for display
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
public function get_field_description( $args ) {
|
||||
$desc = '';
|
||||
|
||||
if ( ! empty( $args['desc'] ) ) {
|
||||
$desc = sprintf( '<p class="description">%s</p>', $args['desc'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $args['desc_btn'] ) ) {
|
||||
$desc .= sprintf( '<p class="regular-text"><a href="%s" class="button button-primary description_button %s">%s</a></p>', (!empty($args['desc_link']) ? $args['desc_link'] : '#'), $args['desc_class'], $args['desc_btn'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $args['desc_extra_btn'] ) ) {
|
||||
$desc .= sprintf( '<p class="regular-text"><a href="%s" class="button button-primary description_button %s">%s</a></p>', (!empty($args['desc_extra_link']) ? $args['desc_extra_link'] : '#'), $args['desc_extra_class'], $args['desc_extra_btn'] );
|
||||
}
|
||||
|
||||
return $desc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a text field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_text( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$type = isset( $args['type'] ) ? $args['type'] : 'text';
|
||||
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
|
||||
|
||||
$html = sprintf( '<input type="%1$s" class="%2$s-text" id="%3$s[%4$s]" name="%3$s[%4$s]" value="%5$s"%6$s/>', $type, $size, $args['section'], $args['id'], $value, $placeholder );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a url field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_url( $args ) {
|
||||
$this->callback_text( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a number field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_number( $args ) {
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$type = isset( $args['type'] ) ? $args['type'] : 'number';
|
||||
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
|
||||
$min = ( $args['min'] == '' ) ? '' : ' min="' . $args['min'] . '"';
|
||||
$max = ( $args['max'] == '' ) ? '' : ' max="' . $args['max'] . '"';
|
||||
$step = ( $args['step'] == '' ) ? '' : ' step="' . $args['step'] . '"';
|
||||
|
||||
$html = sprintf( '<input type="%1$s" class="%2$s-number" id="%3$s[%4$s]" name="%3$s[%4$s]" value="%5$s"%6$s%7$s%8$s%9$s/>', $type, $size, $args['section'], $args['id'], $value, $placeholder, $min, $max, $step );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a checkbox for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_checkbox( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
|
||||
$html = '<fieldset>';
|
||||
$html .= sprintf( '<label for="wpuf-%1$s[%2$s]">', $args['section'], $args['id'] );
|
||||
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id'] );
|
||||
$html .= sprintf( '<input type="checkbox" class="checkbox" id="wpuf-%1$s[%2$s]" name="%1$s[%2$s]" value="on" %3$s />', $args['section'], $args['id'], checked( $value, 'on', false ) );
|
||||
$html .= sprintf( '%1$s</label>', $args['desc'] );
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a toggle for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_toggle( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
|
||||
$html = '<fieldset>';
|
||||
$html .= sprintf( '<label class="toggle-btn'.esc_attr( $value == 'on' ? ' active': '' ).'" for="wpuf-%1$s[%2$s]">', $args['section'], $args['id'] );
|
||||
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="off" />', $args['section'], $args['id'] );
|
||||
$html .= sprintf( '<input type="checkbox" class="checkbox cb-value" id="wpuf-%1$s[%2$s]" name="%1$s[%2$s]" value="on" %3$s />', $args['section'], $args['id'], checked( $value, 'on', false ) );
|
||||
$html .= '<span class="round-btn"></span>';
|
||||
$html .= '</label>';
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a toggle for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_section_title( $args ) {
|
||||
|
||||
$html = '<fieldset class="stratum-section-title-area">';
|
||||
$html .= '<h2 class="stratum-section-title">';
|
||||
$html .= esc_html( $args['name'] );
|
||||
$html .= '</h2>';
|
||||
|
||||
if( array_key_exists('desc', $args) ){
|
||||
if( $args['desc'] ){
|
||||
$html .= sprintf( '<p class="about-text">%1$s</p>', $args['desc'] );
|
||||
}
|
||||
}
|
||||
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a multicheckbox for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_multicheck( $args ) {
|
||||
|
||||
$value = $this->get_option( $args['id'], $args['section'], $args['std'] );
|
||||
$html = '<fieldset>';
|
||||
$html .= sprintf( '<input type="hidden" name="%1$s[%2$s]" value="" />', $args['section'], $args['id'] );
|
||||
foreach ( $args['options'] as $key => $label ) {
|
||||
$checked = isset( $value[$key] ) ? $value[$key] : '0';
|
||||
$html .= sprintf( '<label for="wpuf-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
|
||||
$html .= sprintf( '<input type="checkbox" class="checkbox" id="wpuf-%1$s[%2$s][%3$s]" name="%1$s[%2$s][%3$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $checked, $key, false ) );
|
||||
$html .= sprintf( '%1$s</label><br>', $label );
|
||||
}
|
||||
|
||||
$html .= $this->get_field_description( $args );
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a radio button for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_radio( $args ) {
|
||||
|
||||
$value = $this->get_option( $args['id'], $args['section'], $args['std'] );
|
||||
$html = '<fieldset>';
|
||||
|
||||
foreach ( $args['options'] as $key => $label ) {
|
||||
$html .= sprintf( '<label for="wpuf-%1$s[%2$s][%3$s]">', $args['section'], $args['id'], $key );
|
||||
$html .= sprintf( '<input type="radio" class="radio" id="wpuf-%1$s[%2$s][%3$s]" name="%1$s[%2$s]" value="%3$s" %4$s />', $args['section'], $args['id'], $key, checked( $value, $key, false ) );
|
||||
$html .= sprintf( '%1$s</label><br>', $label );
|
||||
}
|
||||
|
||||
$html .= $this->get_field_description( $args );
|
||||
$html .= '</fieldset>';
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a selectbox for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_select( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$html = sprintf( '<select class="%1$s" name="%2$s[%3$s]" id="%2$s[%3$s]">', $size, $args['section'], $args['id'] );
|
||||
|
||||
foreach ( $args['options'] as $key => $label ) {
|
||||
$html .= sprintf( '<option value="%s"%s>%s</option>', $key, selected( $value, $key, false ), $label );
|
||||
}
|
||||
|
||||
$html .= sprintf( '</select>' );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a textarea for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_textarea( $args ) {
|
||||
|
||||
$value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="'.$args['placeholder'].'"';
|
||||
|
||||
$html = sprintf( '<textarea rows="5" cols="55" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]"%4$s>%5$s</textarea>', $size, $args['section'], $args['id'], $placeholder, $value );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the html for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
* @return string
|
||||
*/
|
||||
function callback_html( $args ) {
|
||||
echo $this->get_field_description( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a rich text textarea for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_wysiwyg( $args ) {
|
||||
|
||||
$value = $this->get_option( $args['id'], $args['section'], $args['std'] );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : '500px';
|
||||
|
||||
echo '<div style="max-width: ' . esc_attr( $size ) . ';">';
|
||||
|
||||
$editor_settings = array(
|
||||
'teeny' => true,
|
||||
'textarea_name' => $args['section'] . '[' . $args['id'] . ']',
|
||||
'textarea_rows' => 10
|
||||
);
|
||||
|
||||
if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
|
||||
$editor_settings = array_merge( $editor_settings, $args['options'] );
|
||||
}
|
||||
|
||||
wp_editor( $value, $args['section'] . '-' . $args['id'], $editor_settings );
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo $this->get_field_description( $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a file upload field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_file( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
$id = $args['section'] . '[' . $args['id'] . ']';
|
||||
$label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : esc_html__( 'Choose File' );
|
||||
|
||||
$html = sprintf( '<input type="text" class="%1$s-text wpsa-url" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
|
||||
$html .= '<input type="button" class="button wpsa-browse" value="' . $label . '" />';
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a password field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_password( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
|
||||
$html = sprintf( '<input type="password" class="%1$s-text" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s"/>', $size, $args['section'], $args['id'], $value );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a color picker field for a settings field
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_color( $args ) {
|
||||
|
||||
$value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
|
||||
$size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';
|
||||
|
||||
$html = sprintf( '<input type="text" class="%1$s-text wp-color-picker-field" id="%2$s[%3$s]" name="%2$s[%3$s]" value="%4$s" data-default-color="%5$s" />', $size, $args['section'], $args['id'], $value, $args['std'] );
|
||||
$html .= $this->get_field_description( $args );
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Displays a select box for creating the pages select box
|
||||
*
|
||||
* @param array $args settings field args
|
||||
*/
|
||||
function callback_pages( $args ) {
|
||||
|
||||
$dropdown_args = array(
|
||||
'selected' => esc_attr($this->get_option($args['id'], $args['section'], $args['std'] ) ),
|
||||
'name' => $args['section'] . '[' . $args['id'] . ']',
|
||||
'id' => $args['section'] . '[' . $args['id'] . ']',
|
||||
'echo' => 0
|
||||
);
|
||||
$html = wp_dropdown_pages( $dropdown_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize callback for Settings API
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function sanitize_options( $options ) {
|
||||
|
||||
if ( !$options ) {
|
||||
return $options;
|
||||
}
|
||||
|
||||
foreach( $options as $option_slug => $option_value ) {
|
||||
$sanitize_callback = $this->get_sanitize_callback( $option_slug );
|
||||
|
||||
// If callback is set, call it
|
||||
if ( $sanitize_callback ) {
|
||||
$options[ $option_slug ] = call_user_func( $sanitize_callback, $option_value );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sanitization callback for given option slug
|
||||
*
|
||||
* @param string $slug option slug
|
||||
*
|
||||
* @return mixed string or bool false
|
||||
*/
|
||||
function get_sanitize_callback( $slug = '' ) {
|
||||
if ( empty( $slug ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Iterate over registered fields and see if we can find proper callback
|
||||
foreach( $this->settings_fields as $section => $options ) {
|
||||
foreach ( $options as $option ) {
|
||||
if ( $option['name'] != $slug ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Return the callback name
|
||||
$callback = isset( $option['sanitize_callback'] ) && is_callable( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : false;
|
||||
|
||||
if ( ! $callback && $this->is_option_encrypted( $option['name'], $section ) ) {
|
||||
$callback = array( $this, 'encrypt_option' );
|
||||
}
|
||||
|
||||
return $callback;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of a settings field
|
||||
*
|
||||
* @param string $option settings field name
|
||||
* @param string $section the section name this field belongs to
|
||||
* @param string $default default text if it's not found
|
||||
* @return string
|
||||
*/
|
||||
function get_option( $option, $section, $default = '' ) {
|
||||
|
||||
$options = get_option( $section );
|
||||
|
||||
if ( isset( $options[$option] ) ) {
|
||||
return $this->maybe_decrypt_option( $option, $section, $options[ $option ] );
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
function maybe_decrypt_option( $option, $section, $option_value ) {
|
||||
|
||||
if ( $this->is_option_encrypted( $option, $section ) ) {
|
||||
$encryption = new String_Encryption();
|
||||
return $encryption->decrypt( $option_value );
|
||||
}
|
||||
|
||||
return $option_value;
|
||||
}
|
||||
|
||||
function is_option_encrypted( $option, $section ) {
|
||||
return isset( $this->settings_fields[ $section ][ $option ][ 'is_encrypted' ] )
|
||||
&& filter_var( $this->settings_fields[ $section ][ $option ][ 'is_encrypted' ], FILTER_VALIDATE_BOOLEAN );
|
||||
}
|
||||
|
||||
function encrypt_option( $option_value ) {
|
||||
$encryption = new String_Encryption();
|
||||
return $encryption->encrypt( $option_value );
|
||||
}
|
||||
|
||||
/**
|
||||
* Show navigations as tab
|
||||
*
|
||||
* Shows all the settings section labels as tab
|
||||
*/
|
||||
function show_navigation() {
|
||||
$html = '<div class="nav-tab-wrapper">';
|
||||
|
||||
$count = count( $this->settings_sections );
|
||||
|
||||
// don't show the navigation if only one section exists
|
||||
if ( $count === 1 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $this->settings_sections as $tab ) {
|
||||
|
||||
if( array_key_exists('icon', $tab) ){
|
||||
$html .= sprintf( '<a href="#%1$s" class="nav-tab" id="%1$s-tab"><i class="%3$s"></i>%2$s</a>', $tab['id'], $tab['title'], $tab['icon'] );
|
||||
}else{
|
||||
$html .= sprintf( '<a href="#%1$s" class="nav-tab" id="%1$s-tab">%2$s</a>', $tab['id'], $tab['title'] );
|
||||
}
|
||||
}
|
||||
|
||||
$html .= '</div>';
|
||||
|
||||
echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints out all settings sections added to a particular settings page
|
||||
*/
|
||||
function do_settings_sections( $page ) {
|
||||
global $wp_settings_sections, $wp_settings_fields;
|
||||
|
||||
if ( ! isset( $wp_settings_sections[ $page ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
|
||||
|
||||
if ( $section['title'] ) {
|
||||
echo '<h2>' . esc_html( $section['title'] ) . '</h2>';
|
||||
}
|
||||
|
||||
if ( $section['callback'] ) {
|
||||
call_user_func( $section['callback'], $section );
|
||||
}
|
||||
|
||||
if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
|
||||
continue;
|
||||
}
|
||||
echo '<div class="form-addons-container">';
|
||||
$this->do_settings_fields( $page, $section['id'] );
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print out the settings fields for a particular settings section.
|
||||
*
|
||||
* Part of the Settings API. Use this in a settings page to output
|
||||
* a specific section. Should normally be called by do_settings_sections()
|
||||
* rather than directly.
|
||||
*
|
||||
* @global $wp_settings_fields Storage array of settings fields and their pages/sections.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param string $page Slug title of the admin page whose settings fields you want to show.
|
||||
* @param string $section Slug title of the settings section whose fields you want to show.
|
||||
*/
|
||||
function do_settings_fields( $page, $section ) {
|
||||
global $wp_settings_fields;
|
||||
|
||||
if ( ! isset( $wp_settings_fields[ $page ][ $section ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( (array) $wp_settings_fields[ $page ][ $section ] as $field ) {
|
||||
|
||||
$class = '';
|
||||
|
||||
if ( $field['args']['type'] == 'section_title' ) {
|
||||
$class = 'form-addons-section-title';
|
||||
}else{
|
||||
if ( ! empty( $field['args']['class'] ) ) {
|
||||
$class = $field['args']['class'];
|
||||
}
|
||||
}
|
||||
|
||||
echo '<div class="form-addon ' . esc_attr( $class ) . '">';
|
||||
echo '<div class="form-addon-inner">';
|
||||
echo '<div class="addon-name">';
|
||||
if( array_key_exists('icon', $field['args']) ){
|
||||
if($field['args']['icon']){
|
||||
echo '<i class="' . esc_attr( $field['args']['icon'] ) . '"></i>';
|
||||
}
|
||||
}
|
||||
echo '<h3 class="addon-title">' . esc_html( $field['title'] ) . '</h3>';
|
||||
if( $field['args']['desc'] ){
|
||||
echo '<span class="addon-desc">' . esc_html( $field['args']['desc'] ) . '</span>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="addon-switch">';
|
||||
call_user_func( $field['callback'], $field['args'] );
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the section settings forms
|
||||
*
|
||||
* This function displays every sections in a different form
|
||||
*/
|
||||
function show_forms() {
|
||||
?>
|
||||
<div class="metabox-holder">
|
||||
<?php foreach ( $this->settings_sections as $form ) { ?>
|
||||
<div id="<?php echo esc_attr( $form['id'] ); ?>" class="group" style="display: none;">
|
||||
<form method="post" action="options.php">
|
||||
<div class="stratum-settings-submit stratum-settings-submit-top">
|
||||
<div class="stratum-settings-submit-top-inner">
|
||||
<h3>Stratum Settings</h3>
|
||||
<?php submit_button(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
do_action( 'wsa_form_top_' . $form['id'], $form );
|
||||
settings_fields( $form['id'] );
|
||||
|
||||
if( array_key_exists('addons', $form) ){
|
||||
$this->do_settings_sections( $form['id'] );
|
||||
}else{
|
||||
do_settings_sections( $form['id'] );
|
||||
}
|
||||
|
||||
do_action( 'wsa_form_bottom_' . $form['id'], $form );
|
||||
if ( isset( $this->settings_fields[ $form['id'] ] ) ):
|
||||
?>
|
||||
<div class="stratum-settings-submit">
|
||||
<?php submit_button(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
$this->script();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tabbable JavaScript codes & Initiate Color Picker
|
||||
*
|
||||
* This code uses localstorage for displaying active tabs
|
||||
*/
|
||||
function script() {
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
// toggle
|
||||
$('.cb-value').click(function() {
|
||||
var mainParent = $(this).parent('.toggle-btn');
|
||||
if($(mainParent).find('input.cb-value').is(':checked')) {
|
||||
$(mainParent).addClass('active');
|
||||
} else {
|
||||
$(mainParent).removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
// Settings sticky top
|
||||
$(document).ready(function() {
|
||||
var stickyTop = $('.stratum-settings-submit-top').offset().top;
|
||||
|
||||
$(window).scroll(function() {
|
||||
var windowTop = $(window).scrollTop();
|
||||
if (stickyTop < windowTop && $(".stratum-settings-wrap").height() + $(".stratum-settings-wrap").offset().top - $(".stratum-settings-submit-top").height() > windowTop) {
|
||||
$('.stratum-settings-submit-top').addClass('stratum-settings-submit-top-fixed');
|
||||
} else {
|
||||
$('.stratum-settings-submit-top').removeClass('stratum-settings-submit-top-fixed');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//Initiate Color Picker
|
||||
$('.wp-color-picker-field').wpColorPicker();
|
||||
|
||||
// Switches option sections
|
||||
$('.group').hide();
|
||||
var activetab = '';
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
activetab = localStorage.getItem("activetab");
|
||||
}
|
||||
|
||||
//if url has section id as hash then set it as active or override the current local storage value
|
||||
if(window.location.hash){
|
||||
activetab = window.location.hash;
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
localStorage.setItem("activetab", activetab);
|
||||
}
|
||||
}
|
||||
|
||||
if (activetab != '' && $(activetab).length ) {
|
||||
$(activetab).fadeIn();
|
||||
} else {
|
||||
$('.group:first').fadeIn();
|
||||
}
|
||||
$('.group .collapsed').each(function(){
|
||||
$(this).find('input:checked').parent().parent().parent().nextAll().each(
|
||||
function(){
|
||||
if ($(this).hasClass('last')) {
|
||||
$(this).removeClass('hidden');
|
||||
return false;
|
||||
}
|
||||
$(this).filter('.hidden').removeClass('hidden');
|
||||
});
|
||||
});
|
||||
|
||||
if (activetab != '' && $(activetab + '-tab').length ) {
|
||||
$(activetab + '-tab').addClass('nav-tab-active');
|
||||
}
|
||||
else {
|
||||
$('.nav-tab-wrapper a:first').addClass('nav-tab-active');
|
||||
}
|
||||
$('.nav-tab-wrapper a').click(function(evt) {
|
||||
$('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
||||
$(this).addClass('nav-tab-active').blur();
|
||||
var clicked_group = $(this).attr('href');
|
||||
if (typeof(localStorage) != 'undefined' ) {
|
||||
localStorage.setItem("activetab", $(this).attr('href'));
|
||||
}
|
||||
$('.group').hide();
|
||||
$(clicked_group).fadeIn();
|
||||
evt.preventDefault();
|
||||
});
|
||||
|
||||
$('.wpsa-browse').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var self = $(this);
|
||||
|
||||
// Create the media frame.
|
||||
var file_frame = wp.media.frames.file_frame = wp.media({
|
||||
title: self.data('uploader_title'),
|
||||
button: {
|
||||
text: self.data('uploader_button_text'),
|
||||
},
|
||||
multiple: false
|
||||
});
|
||||
|
||||
file_frame.on('select', function () {
|
||||
attachment = file_frame.state().get('selection').first().toJSON();
|
||||
self.prev('.wpsa-url').val(attachment.url).change();
|
||||
});
|
||||
|
||||
// Finally, open the modal
|
||||
file_frame.open();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
$this->add_style();
|
||||
}
|
||||
|
||||
function add_style() {
|
||||
global $wp_version;
|
||||
if (version_compare($wp_version, '3.8', '<=')):
|
||||
?>
|
||||
<style type="text/css">
|
||||
.form-table th { padding: 20px 10px; }
|
||||
</style>
|
||||
<?php
|
||||
endif;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
|
||||
require_once dirname( __FILE__ ) . '/functions.php';
|
||||
require_once dirname( __FILE__ ) . '/string-encryption.php';
|
||||
require_once dirname( __FILE__ ) . '/excerpt-helper.php';
|
||||
require_once dirname( __FILE__ ) . '/main.php';
|
||||
require_once dirname( __FILE__ ) . '/translation.php';
|
||||
require_once dirname( __FILE__ ) . '/settings.php';
|
||||
require_once dirname( __FILE__ ) . '/scripts-manager.php';
|
||||
require_once dirname( __FILE__ ) . '/widgets-manager.php';
|
||||
require_once dirname( __FILE__ ) . '/ajax-manager.php';
|
||||
require_once dirname( __FILE__ ) . '/controls-manager.php';
|
||||
require_once dirname( __FILE__ ) . '/token-manager.php';
|
||||
require_once dirname( __FILE__ ) . '/rest-api.php';
|
||||
require_once dirname( __FILE__ ) . '/version-control.php';
|
||||
require_once dirname( __FILE__ ) . '/admin-page.php';
|
||||
require_once dirname( __FILE__ ) . '/stratum-sections.php';
|
||||
require_once dirname( __FILE__ ) . '/libraries/class.settings-api.php';
|
||||
|
||||
//premium
|
||||
require_once dirname( __FILE__ ) . '/premium.php';
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
final class Stratum {
|
||||
/**
|
||||
* @var Stratum
|
||||
*/
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* @var Settings
|
||||
*/
|
||||
private $settings;
|
||||
|
||||
/**
|
||||
* @var Scripts_Manager
|
||||
*/
|
||||
private $scripts_manager;
|
||||
|
||||
/**
|
||||
* @var Widgets_Manager
|
||||
*/
|
||||
private $widgets_manager;
|
||||
|
||||
/**
|
||||
* @var Controls_Manager
|
||||
*/
|
||||
private $controls_manager;
|
||||
|
||||
/**
|
||||
* @var Token_Manager
|
||||
*/
|
||||
private $token_manager;
|
||||
|
||||
/**
|
||||
* @var Ajax_Manager
|
||||
*/
|
||||
private $ajax_manager;
|
||||
|
||||
/**
|
||||
* @var VersionControl
|
||||
*/
|
||||
private $version_control;
|
||||
|
||||
/**
|
||||
* @var Rest_API
|
||||
*/
|
||||
private $rest_api;
|
||||
|
||||
/**
|
||||
* @var admin-page
|
||||
*/
|
||||
private $admin_page;
|
||||
|
||||
private function __construct() {
|
||||
|
||||
$this->scripts_manager = new \Stratum\Managers\Scripts_Manager();
|
||||
$this->widgets_manager = new \Stratum\Managers\Widgets_Manager();
|
||||
$this->controls_manager = new \Stratum\Managers\Controls_Manager();
|
||||
$this->token_manager = new \Stratum\Managers\Token_Manager();
|
||||
$this->ajax_manager = new \Stratum\Managers\Ajax_Manager();
|
||||
$this->version_control = new Version_Control();
|
||||
$this->rest_api = new Rest_API();
|
||||
$this->admin_page = new Admin_page();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Scripts_Manager
|
||||
*/
|
||||
public function get_scripts_manager() {
|
||||
return $this->scripts_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Widgets_Manager
|
||||
*/
|
||||
public function get_widgets_manager() {
|
||||
return $this->widgets_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Controls_Manager
|
||||
*/
|
||||
public function get_controls_manager() {
|
||||
return $this->controls_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Token_Manager
|
||||
*/
|
||||
public function get_token_manager() {
|
||||
return $this->token_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Ajax_Manager
|
||||
*/
|
||||
public function get_ajax_manager() {
|
||||
return $this->ajax_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Stratum
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( is_null( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
class Premium {
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* Premium constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
add_action( 'admin_menu', array($this, 'admin_menu'), 99 );
|
||||
}
|
||||
|
||||
public static function get_instance()
|
||||
{
|
||||
if (self::$instance == null)
|
||||
{
|
||||
self::$instance = new Premium();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
public function admin_menu() {
|
||||
|
||||
add_submenu_page(
|
||||
'stratum',
|
||||
esc_html__( 'Go Premium', 'stratum' ),
|
||||
'<span class="dashicons dashicons-superhero-alt" style="font-size:17px;vertical-align:middle;"></span> ' .
|
||||
esc_html__( 'Go Premium', 'stratum' ),
|
||||
'manage_options',
|
||||
'stratum-premium',
|
||||
array( $this, 'premium_page' )
|
||||
);
|
||||
}
|
||||
|
||||
public function premium_page() {
|
||||
|
||||
$settings = \Stratum\Settings::get_instance();
|
||||
$pluginData = $settings->getPluginData();
|
||||
|
||||
$storeUrl = isset( $pluginData['PluginURI'] ) ? $pluginData['PluginURI'] : '#';
|
||||
|
||||
$storeUrl = add_query_arg(
|
||||
array(
|
||||
'utm_source' => 'dashboard',
|
||||
'utm_medium' => 'go-premium-button',
|
||||
'utm_campaign' => 'stratum-premium',
|
||||
),
|
||||
$storeUrl
|
||||
);
|
||||
|
||||
$compareUrl = add_query_arg(
|
||||
array(
|
||||
'utm_source' => 'dashboard',
|
||||
'utm_medium' => 'compare-button',
|
||||
'utm_campaign' => 'stratum-premium',
|
||||
),
|
||||
'https://motopress.com/stratum-elementor-widgets-pro-vs-lite/'
|
||||
);
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php esc_html_e('Go Premium', 'stratum'); ?></h1>
|
||||
<div class="card">
|
||||
<p><?php esc_html_e('Stratum Pro unlocks access to numerous customization settings in many widgets. Work faster by employing your custom templates, achieve fancier motion effects and shapes, design better.', 'stratum'); ?></p>
|
||||
<a href="<?php echo esc_url($storeUrl); ?>" class="button button-primary" target="_blank">
|
||||
<?php esc_html_e('Go Premium', 'stratum'); ?></a>
|
||||
<a href="<?php echo esc_url($compareUrl); ?>" class="button" target="_blank">
|
||||
<?php esc_html_e('Lite vs Pro', 'stratum'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new Premium();
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Class REST API
|
||||
* @package Stratum
|
||||
*/
|
||||
class Rest_API {
|
||||
|
||||
protected $_namespace = 'Stratum/v1';
|
||||
|
||||
/**
|
||||
* RestAPI constructor.
|
||||
*/
|
||||
public function __construct( ) {
|
||||
add_action( 'rest_api_init', [ $this, 'register_rest_route' ] );
|
||||
}
|
||||
|
||||
public function register_rest_route(){
|
||||
|
||||
register_rest_route( $this->_namespace, '/templates', array(
|
||||
array(
|
||||
'methods' => 'GET',
|
||||
'callback' => [ $this, 'get_templates' ],
|
||||
'permission_callback' => [ $this, 'permissions_check' ],
|
||||
),
|
||||
'schema' => array( $this, 'templates_schema' )
|
||||
) );
|
||||
}
|
||||
|
||||
public function permissions_check( $request ) {
|
||||
if ( ! current_user_can( 'read' ) ) {
|
||||
return new \WP_Error(
|
||||
'rest_forbidden',
|
||||
esc_html__( 'Forbidden.' ),
|
||||
array( 'status' => $this->authorization_status_code() )
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Sets up the proper HTTP status code for authorization.
|
||||
public function authorization_status_code() {
|
||||
|
||||
$status = 401;
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
$status = 403;
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Schema for a templates.
|
||||
*
|
||||
* @param WP_REST_Request $request Current request.
|
||||
*/
|
||||
public function templates_schema() {
|
||||
}
|
||||
|
||||
public function get_templates($object) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum\Managers;
|
||||
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Class ScriptsManager
|
||||
* @package Stratum
|
||||
*/
|
||||
class Scripts_Manager {
|
||||
|
||||
private $version;
|
||||
private $prefix;
|
||||
private $google_api_key;
|
||||
|
||||
/**
|
||||
* ScriptsManager constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$settings = \Stratum\Settings::get_instance();
|
||||
|
||||
$this->version = $settings->getVersion();
|
||||
$this->prefix = $settings->getPrefix();
|
||||
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$this->google_api_key = isset( $stratum_api['google_api_key'] ) ? $stratum_api['google_api_key'] : '';
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function init() {
|
||||
//==============Actions==============
|
||||
add_action( 'elementor/init', [ $this, 'elementor_loaded' ] );
|
||||
|
||||
//Editor
|
||||
add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'enqueue_editor_document_scripts' ] );
|
||||
add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'enqueue_editor_panel_styles' ] );
|
||||
add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'enqueue_icons_font_styles' ] );
|
||||
add_action( 'elementor/editor/after_enqueue_styles', [ $this, 'register_fontawesome_dependencies' ] );
|
||||
|
||||
//Frontend
|
||||
add_action( 'elementor/frontend/before_register_scripts', [ $this, 'register_scripts_dependencies' ] );
|
||||
add_action( 'elementor/frontend/before_register_styles' , [ $this, 'register_styles_dependencies' ] );
|
||||
add_action( 'elementor/frontend/after_enqueue_styles' , [ $this, 'register_fontawesome_dependencies' ] );
|
||||
|
||||
add_action( 'elementor/frontend/after_enqueue_styles' , [ $this, 'enqueue_frontend_styles' ] );
|
||||
add_action( 'elementor/frontend/after_enqueue_scripts', [ $this, 'enqueue_frontend_scripts' ] );
|
||||
|
||||
//Preview
|
||||
add_action( 'elementor/editor/after_save', [ $this, 'on_save_options' ], 10, 2 );
|
||||
}
|
||||
|
||||
public function elementor_loaded() {
|
||||
wp_enqueue_script(
|
||||
"{$this->prefix}-editor-panel-js",
|
||||
stratum_get_plugin_url( 'assets/js/editor-panel.min.js' ),
|
||||
apply_filters(
|
||||
'stratum/editor_blocks_js/dependencies',
|
||||
[
|
||||
'jquery',
|
||||
]
|
||||
),
|
||||
$this->version,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
//JS load
|
||||
public function enqueue_frontend_scripts() {
|
||||
$this->load_locale_data();
|
||||
|
||||
wp_enqueue_script(
|
||||
"{$this->prefix}-frontend-js",
|
||||
stratum_get_plugin_url( 'assets/js/frontend.min.js' ),
|
||||
apply_filters(
|
||||
'stratum/editor_blocks_js/dependencies',
|
||||
[
|
||||
'imagesloaded'
|
||||
]
|
||||
),
|
||||
$this->version,
|
||||
true
|
||||
);
|
||||
|
||||
wp_localize_script(
|
||||
"{$this->prefix}-frontend-js",
|
||||
'stratum',
|
||||
apply_filters(
|
||||
'stratum/editor_blocks_js/localize_data',
|
||||
[
|
||||
'localeData' => $this->get_locale_data( 'stratum' ),
|
||||
'settings' => [
|
||||
'wide_support' => get_theme_support( 'align-wide' ),
|
||||
],
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'nonces' => array(
|
||||
'get_articles' => wp_create_nonce( 'stratum_nonce_get_articles' ),
|
||||
'get_elementor_templates' => wp_create_nonce( 'stratum_nonce_get_elementor_templates' ),
|
||||
)
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function register_scripts_dependencies() {
|
||||
|
||||
//Countdown
|
||||
wp_register_script(
|
||||
'jquery-plugin',
|
||||
stratum_get_plugin_url( 'vendors/jquery.countdown/jquery.plugin.min.js' ),
|
||||
[ 'jquery' ],
|
||||
'1.0',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'jquery-countdown',
|
||||
stratum_get_plugin_url( 'vendors/jquery.countdown/jquery.countdown.min.js' ),
|
||||
[ 'jquery', 'jquery-plugin' ],
|
||||
'2.1.0',
|
||||
true
|
||||
);
|
||||
|
||||
preg_match( '/^(.*)_/', get_locale(), $current_locale );
|
||||
$locale_prefix = isset( $current_locale[ 1 ] ) && $current_locale[ 1 ] !='en' ? $current_locale[ 1 ] : '';
|
||||
|
||||
if ( $locale_prefix != '' ) {
|
||||
$locale_path = 'vendors/jquery.countdown/localization/jquery.countdown-' . $locale_prefix . '.js';
|
||||
|
||||
if ( file_exists( stratum_get_plugin_url( $locale_path ) ) ) {
|
||||
wp_register_script(
|
||||
'jquery-countdown-' . $locale_prefix,
|
||||
stratum_get_plugin_url( $locale_path ),
|
||||
[ 'jquery-countdown' ],
|
||||
'2.1.0',
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//Image hotspots dependencies
|
||||
wp_register_script(
|
||||
'draggabilly',
|
||||
stratum_get_plugin_url( 'vendors/draggabilly/draggabilly.pkgd.min.js' ),
|
||||
[ 'jquery' ],
|
||||
'2.2.0',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'popper',
|
||||
stratum_get_plugin_url( 'vendors/tippy/popper.min.js' ),
|
||||
[ 'jquery' ],
|
||||
'2.4.0',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'tippy',
|
||||
stratum_get_plugin_url( 'vendors/tippy/tippy-bundle.umd.min.js' ),
|
||||
[ 'jquery', 'popper' ],
|
||||
'6.2.3',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'jquery-masonry',
|
||||
stratum_get_plugin_url( 'vendors/masonry/masonry.pkgd.min.js' ),
|
||||
[],
|
||||
'4.2.2',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'anim-on-scroll',
|
||||
stratum_get_plugin_url( 'vendors/AnimOnScroll/AnimOnScroll.js' ),
|
||||
[ 'modernizr-custom' ],
|
||||
'1.0.0',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'modernizr-custom',
|
||||
stratum_get_plugin_url( 'vendors/modernizr/modernizr.custom.js' ),
|
||||
[],
|
||||
'2.6.2',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'donutty',
|
||||
stratum_get_plugin_url( 'vendors/donutty/donutty-jquery.min.js' ),
|
||||
[],
|
||||
'2.0.0',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'waypoints',
|
||||
stratum_get_plugin_url( 'vendors/waypoints/jquery.waypoints.min.js' ),
|
||||
[ 'jquery' ],
|
||||
'4.0.1',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'countup',
|
||||
stratum_get_plugin_url( 'vendors/countup/countUp.min.js' ),
|
||||
[],
|
||||
'2.0.4',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'google-map-styles',
|
||||
stratum_get_plugin_url( 'vendors/stratum/google-map-styles.min.js' ),
|
||||
[],
|
||||
$this->version,
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'google-map-api',
|
||||
'https://maps.googleapis.com/maps/api/js?key='.$this->google_api_key,
|
||||
[],
|
||||
'3.40',
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'lottie-animations-api',
|
||||
stratum_get_plugin_url( 'vendors/lottie/lottie.min.js' ),
|
||||
[],
|
||||
'5.7.1',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
//JS Elementor Document Scripts
|
||||
public function enqueue_editor_document_scripts() {
|
||||
wp_enqueue_script(
|
||||
"{$this->prefix}-editor-document-js",
|
||||
stratum_get_plugin_url( 'assets/js/editor-document.min.js' ),
|
||||
[
|
||||
'jquery',
|
||||
],
|
||||
$this->version,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
//CSS load (Panel)
|
||||
public function enqueue_editor_panel_styles() {
|
||||
wp_enqueue_style(
|
||||
"{$this->prefix}-editor-panel",
|
||||
stratum_get_plugin_url( 'assets/css/editor-panel.min.css' ),
|
||||
apply_filters(
|
||||
'stratum/editor_css/dependencies',
|
||||
[]
|
||||
),
|
||||
$this->version
|
||||
);
|
||||
}
|
||||
|
||||
//CSS load (in iframe)
|
||||
public function enqueue_frontend_styles() {
|
||||
wp_enqueue_style(
|
||||
"{$this->prefix}-widgets-style",
|
||||
stratum_get_plugin_url( 'assets/css/style.min.css' ),
|
||||
apply_filters(
|
||||
'stratum/frontend_css/dependencies',
|
||||
[]
|
||||
),
|
||||
$this->version
|
||||
);
|
||||
}
|
||||
|
||||
public function register_styles_dependencies() {
|
||||
wp_register_style(
|
||||
'tippy-themes',
|
||||
stratum_get_plugin_url( 'vendors/tippy/themes.css' ),
|
||||
[],
|
||||
'6.2.3'
|
||||
);
|
||||
|
||||
wp_register_style(
|
||||
'tippy-animation',
|
||||
stratum_get_plugin_url( 'vendors/tippy/animations.css' ),
|
||||
[],
|
||||
'6.2.3'
|
||||
);
|
||||
|
||||
wp_register_style(
|
||||
'scroll-anim-effects',
|
||||
stratum_get_plugin_url( 'vendors/AnimOnScroll/scrollAnimEffects.css' )
|
||||
);
|
||||
}
|
||||
|
||||
//CSS load (icons)
|
||||
public function enqueue_icons_font_styles() {
|
||||
wp_enqueue_style(
|
||||
"{$this->prefix}-icons-style",
|
||||
stratum_get_plugin_url( '/assets/css/stratum.min.css' ),
|
||||
apply_filters(
|
||||
'stratum/editor_css/dependencies',
|
||||
[]
|
||||
),
|
||||
$this->version
|
||||
);
|
||||
}
|
||||
|
||||
//Register fontawesome
|
||||
public function register_fontawesome_dependencies() {
|
||||
wp_register_script(
|
||||
'font-awesome-4-shim',
|
||||
ELEMENTOR_ASSETS_URL . 'lib/font-awesome/js/v4-shims.min.js',
|
||||
[],
|
||||
ELEMENTOR_VERSION
|
||||
);
|
||||
|
||||
wp_register_style(
|
||||
'font-awesome-5-all',
|
||||
ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.min.css',
|
||||
false,
|
||||
ELEMENTOR_VERSION
|
||||
);
|
||||
|
||||
wp_register_style(
|
||||
'font-awesome-4-shim',
|
||||
ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/v4-shims.min.css',
|
||||
[],
|
||||
ELEMENTOR_VERSION
|
||||
);
|
||||
}
|
||||
|
||||
public function on_save_options($post_id, $editor_data) {
|
||||
|
||||
$settings = Plugin::$instance->documents->get( $post_id )->get_settings();
|
||||
}
|
||||
|
||||
public function load_locale_data() {
|
||||
$locale_data = $this->get_locale_data( 'stratum' );
|
||||
wp_add_inline_script(
|
||||
'wp-i18n',
|
||||
'wp.i18n.setLocaleData( ' . json_encode( $locale_data ) . ', "'. $this->prefix .'" );'
|
||||
);
|
||||
}
|
||||
|
||||
public function get_locale_data($domain) {
|
||||
$translations = get_translations_for_domain( $domain );
|
||||
|
||||
$locale = array(
|
||||
'' => array(
|
||||
'domain' => $domain,
|
||||
'lang' => is_admin() ? get_user_locale() : get_locale()
|
||||
)
|
||||
);
|
||||
|
||||
if ( ! empty( $translations->headers[ 'Plural-Forms' ] ) ) {
|
||||
$locale[ '' ][ 'plural_forms' ] = $translations->headers[ 'Plural-Forms' ];
|
||||
}
|
||||
|
||||
foreach ( $translations->entries as $msgid => $entry ) {
|
||||
$locale[ $msgid ] = $entry->translations;
|
||||
}
|
||||
|
||||
return $locale;
|
||||
}
|
||||
|
||||
public function get_image_sizes() {
|
||||
|
||||
global $_wp_additional_image_sizes;
|
||||
|
||||
$sizes = get_intermediate_image_sizes();
|
||||
$result = array();
|
||||
|
||||
foreach ( $sizes as $size ) {
|
||||
if ( in_array( $size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
|
||||
$result[ $size ] = ucwords( trim( str_replace( array( '-', '_' ), array( ' ', ' ' ), $size ) ) );
|
||||
} else {
|
||||
$result[ $size ] = sprintf(
|
||||
'%1$s (%2$sx%3$s)',
|
||||
ucwords( trim( str_replace( array( '-', '_' ), array( ' ', ' ' ), $size ) ) ),
|
||||
$_wp_additional_image_sizes[ $size ][ 'width' ],
|
||||
$_wp_additional_image_sizes[ $size ][ 'height' ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array_merge( array( 'full' => esc_html__( 'Full', 'stratum' ), ), $result );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Settings {
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
private $version;
|
||||
private $prefix;
|
||||
private $pluginName;
|
||||
private $pluginData;
|
||||
|
||||
/**
|
||||
* Settings constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
if( !function_exists('get_plugin_data') ){
|
||||
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
}
|
||||
|
||||
$this->pluginData = get_plugin_data(STRATUM_PLUGIN_FILE);
|
||||
$this->version = $this->pluginData['Version'];
|
||||
$this->prefix = $this->pluginData['TextDomain'];
|
||||
$this->pluginName = $this->pluginData['Name'];
|
||||
}
|
||||
|
||||
public static function get_instance()
|
||||
{
|
||||
if (self::$instance == null)
|
||||
{
|
||||
self::$instance = new Settings();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion() {
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPrefix() {
|
||||
return $this->prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPluginName() {
|
||||
return $this->pluginName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPluginData() {
|
||||
return $this->pluginData;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Stratum_Widget_Base
|
||||
*/
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Widget_Base;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
abstract class Stratum_Widget_Base extends Widget_Base {
|
||||
public function __construct( $data = [], $args = null ) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_name() {
|
||||
return 'stratum-'.$this->widget_name;
|
||||
}
|
||||
|
||||
public function render_widget( $type = 'php', $extra_params = array() ) {
|
||||
if ( $type == 'php' ) {
|
||||
//Get all settings
|
||||
$settings = $this->get_settings();
|
||||
}
|
||||
|
||||
$file_name = stratum_get_plugin_path( '/includes/templates/' . $this->widget_name . '.php' );
|
||||
|
||||
if ( !is_readable( $file_name ) ) return;
|
||||
|
||||
ob_start();
|
||||
require ($file_name);
|
||||
echo ob_get_clean(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
final class String_Encryption {
|
||||
|
||||
private $cipher = 'aes-256-ctr';
|
||||
private $salt;
|
||||
private $passphrase;
|
||||
|
||||
public function __construct() {
|
||||
$this->salt = $this->get_salt();
|
||||
$this->passphrase = $this->get_passphrase();
|
||||
}
|
||||
|
||||
public function encrypt( $string_to_encrypt ) {
|
||||
|
||||
if ( empty( $string_to_encrypt ) ) {
|
||||
return $string_to_encrypt;
|
||||
}
|
||||
|
||||
if ( ! $this->can_encrypt() ) {
|
||||
return $string_to_encrypt;
|
||||
}
|
||||
|
||||
$ivlen = openssl_cipher_iv_length( $this->cipher );
|
||||
$iv = openssl_random_pseudo_bytes( $ivlen );
|
||||
|
||||
$encrypted_string = openssl_encrypt(
|
||||
$string_to_encrypt . $this->salt,
|
||||
$this->cipher,
|
||||
$this->passphrase,
|
||||
0,
|
||||
$iv
|
||||
);
|
||||
|
||||
return base64_encode( $iv . $encrypted_string );
|
||||
}
|
||||
|
||||
public function decrypt( $string_to_decrypt ) {
|
||||
|
||||
if ( ! $this->can_encrypt() ) {
|
||||
return $string_to_decrypt;
|
||||
}
|
||||
|
||||
$encrypted_string = base64_decode( $string_to_decrypt, true );
|
||||
|
||||
$ivlen = openssl_cipher_iv_length( $this->cipher );
|
||||
$iv = substr( $encrypted_string, 0, $ivlen );
|
||||
|
||||
$encrypted_string = substr( $encrypted_string, $ivlen );
|
||||
|
||||
$decrypted_string = openssl_decrypt(
|
||||
$encrypted_string,
|
||||
$this->cipher,
|
||||
$this->passphrase,
|
||||
0,
|
||||
$iv
|
||||
);
|
||||
|
||||
if ( ! $decrypted_string || substr( $decrypted_string, -strlen( $this->salt ) ) !== $this->salt ) {
|
||||
return $string_to_decrypt;
|
||||
}
|
||||
|
||||
return substr( $decrypted_string, 0, -strlen( $this->salt ) );
|
||||
}
|
||||
|
||||
private function can_encrypt() {
|
||||
|
||||
if ( ! function_exists( 'openssl_encrypt' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! in_array( $this->cipher, openssl_get_cipher_methods() ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function get_passphrase() {
|
||||
|
||||
if ( function_exists( 'wp_salt' ) && wp_salt() ) {
|
||||
return wp_salt();
|
||||
}
|
||||
|
||||
return 'stratum_non_secret_passphrase';
|
||||
}
|
||||
|
||||
private function get_salt() {
|
||||
return 'stratum_non_secret_salt';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Frontend;
|
||||
use Elementor\Icons_Manager;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'accordion_items' => array(),
|
||||
'expand_icon' => '',
|
||||
'expand_icon_active' => '',
|
||||
'accordion_type' => 'accordion',
|
||||
'accordion_collapsible' => '',
|
||||
'accordion_interactivity' => 'click',
|
||||
'equal_height' => '',
|
||||
|
||||
), $settings ) );
|
||||
|
||||
$widget_class = 'stratum-advanced-accordion';
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
]);
|
||||
|
||||
$accordion_options = [
|
||||
'accordion_type' => $accordion_type,
|
||||
'accordion_collapsible' => ($accordion_collapsible == 'yes'),
|
||||
'accordion_interactivity' => $accordion_interactivity,
|
||||
'equal_height' => (($equal_height == 'yes' && $accordion_type == 'accordion') ? true : false),
|
||||
];
|
||||
|
||||
$out = "";
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $expand_icon, [ 'aria-hidden' => 'true' ] );
|
||||
$expand_icon_html = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $expand_icon_active, [ 'aria-hidden' => 'true' ] );
|
||||
$expand_icon_active_html = ob_get_clean();
|
||||
|
||||
$once_active = false;
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-accordion-options="<?php echo esc_attr( json_encode($accordion_options) ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__wrapper' ); ?>">
|
||||
<?php
|
||||
foreach ( $accordion_items as $index => $item ) {
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
|
||||
$item_class = stratum_css_class([
|
||||
$widget_class . '__item',
|
||||
(($item['active'] == 'yes' && $once_active == false) ? 'active-accordion' : ''),
|
||||
$current_item
|
||||
]);
|
||||
|
||||
if ($accordion_type == 'accordion' && $item['active'] == 'yes'){
|
||||
$once_active = true;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item['title_icon'], [ 'aria-hidden' => 'true' ] );
|
||||
$title_icon_html = ob_get_clean();
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item['title_icon_active'], [ 'aria-hidden' => 'true' ] );
|
||||
$title_icon_active_html = ob_get_clean();
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $item_class ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-header' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__title' ); ?>">
|
||||
<?php
|
||||
if ( ! empty( $title_icon_html ) || ! empty( $title_icon_active_html ) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__title-icon' ); ?>">
|
||||
<?php
|
||||
if ( ! empty( $title_icon_html ) ) {
|
||||
?>
|
||||
<span class="normal"><?php echo $title_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?></span>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( ! empty( $title_icon_active_html ) ) {
|
||||
?>
|
||||
<span class="active"><?php echo $title_icon_active_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
|
||||
echo esc_html($item['title']);
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__expand-icon' ); ?>">
|
||||
<?php
|
||||
if ( ! empty( $expand_icon_html ) ) {
|
||||
?>
|
||||
<span class="normal"><?php echo $expand_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( ! empty( $expand_icon_active_html ) ) {
|
||||
?>
|
||||
<span class="active"><?php echo $expand_icon_active_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__item-content-overlay' ); ?>"></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__text' ); ?>">
|
||||
<?php
|
||||
if ( $item['content_type'] == 'text' ) {
|
||||
if ( !empty($item['text']) ) {
|
||||
echo wp_kses_post( $item['text'] );
|
||||
}
|
||||
} elseif ( $item['content_type'] == 'template' ) {
|
||||
if ( !empty($item['accordion_template']) ) {
|
||||
echo $frontend->get_builder_content($item['accordion_template'], true); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
$class = 'stratum-advanced-google-map';
|
||||
$out = "";
|
||||
|
||||
//Get Api Key
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$api_key = isset( $stratum_api['google_api_key'] ) ? $stratum_api['google_api_key'] : '';
|
||||
|
||||
//If Empty Key
|
||||
if ( empty( $api_key ) ) {
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $class. '__notice' ); ?>">
|
||||
<p><?php echo esc_html__( 'Whoops! It seems like you didn\'t set Google Map API key. You can set it from Stratum > Settings > API > Google Api Key', 'stratum' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$options = [
|
||||
'center' => [
|
||||
'mapLat' => esc_attr( $settings[ 'map_lat' ] ),
|
||||
'mapLng' => esc_attr( $settings[ 'map_lng' ] )
|
||||
],
|
||||
'controls' => [
|
||||
'streetViewControl' => !empty( $settings[ 'street_view_control' ] ) ? true : false,
|
||||
'mapTypeControl' => !empty( $settings[ 'map_type_control' ] ) ? true : false,
|
||||
'zoomControl' => !empty( $settings[ 'zoom_control' ] ) ? true : false,
|
||||
'fullscreenControl' => !empty( $settings[ 'fullscreen_control' ] ) ? true : false
|
||||
],
|
||||
'zoomLevel' => $settings[ 'zoom_level' ],
|
||||
'markerTypeSetup' => $settings[ 'marker_type_setup' ],
|
||||
'mapTypeSetup' => $settings[ 'map_type_setup' ],
|
||||
'interaction' => $settings[ 'interaction' ],
|
||||
|
||||
'markers' => $this->get_markers_options( $settings ),
|
||||
'mapTheme' => $this->set_map_theme_style( $settings )
|
||||
];
|
||||
|
||||
$map_options = json_encode( $options );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ) ?>" data-map-options="<?php echo esc_attr( $map_options ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__container' ) ;?>"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
|
||||
use Stratum\Ajax\Advanced_Posts_Ajax;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'slide_animation_effect' => '',
|
||||
'slide_text_animation_effect' => '',
|
||||
'title_typography_html_tag' => 'h3',
|
||||
'show_image' => '',
|
||||
'show_title' => '',
|
||||
'show_content' => '',
|
||||
'show_excerpt' => '',
|
||||
'show_read_more' => '',
|
||||
'read_more_text' => '',
|
||||
'open_new_tab' => '',
|
||||
'excerpt_length' => apply_filters( 'excerpt_length', 25 ),
|
||||
'show_meta' => array(),
|
||||
'meta_fields_divider' => '',
|
||||
'image_size' => '',
|
||||
'image_hover_effect' => '',
|
||||
'posts_layout' => '',
|
||||
'pagination' => '',
|
||||
'page_pagination_style' => '',
|
||||
'scroll_icon' => '',
|
||||
'load_more_text' => '',
|
||||
'column_gap' => '',
|
||||
'row_gap' => '',
|
||||
'masonry' => '',
|
||||
'columns' => '',
|
||||
'columns_tablet' => '',
|
||||
'columns_mobile' => '',
|
||||
'animate_on_scroll' => '',
|
||||
'animation_effects' => '',
|
||||
|
||||
//Swiper
|
||||
'columns_count' => '1',
|
||||
'slides_in_columns' => '1',
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
//--Swiper
|
||||
), $settings ) );
|
||||
|
||||
//Query builder
|
||||
$query_args = [];
|
||||
stratum_build_custom_query( $query_args, $settings );
|
||||
|
||||
$q = new \WP_Query( $query_args );
|
||||
|
||||
$widget_class = 'stratum-advanced-posts';
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
'layout-'.$posts_layout,
|
||||
($masonry == '' || intval($columns) == 1 || $posts_layout == 'carousel' || $posts_layout == 'list' ? 'masonry-disable' : 'masonry-enable'),
|
||||
(($posts_layout == 'grid' && $masonry == '') ? "elementor-grid-{$columns} elementor-grid-tablet-{$columns_tablet} elementor-grid-mobile-{$columns_mobile}" : ''),
|
||||
((($posts_layout == 'grid' || $posts_layout == 'list') && $image_hover_effect != 'none') ? "image-effect-".esc_attr( $image_hover_effect ) : ''),
|
||||
(($posts_layout == 'carousel' && $slide_animation_effect != 'none') ? "slide-effect-".esc_attr( $slide_animation_effect ) : ''),
|
||||
(($posts_layout == 'carousel' && $slide_text_animation_effect != 'none' && (intval($columns_count) == 1 && intval($slides_in_columns) == 1 )) ? "has-text-animation-".esc_attr( $slide_text_animation_effect ) : '')
|
||||
]);
|
||||
|
||||
$wrapper_class = stratum_css_class([
|
||||
$widget_class . '__wrapper',
|
||||
(($posts_layout == 'grid' && $masonry == '') ? 'elementor-grid' : ''),
|
||||
((($posts_layout == 'grid' || $posts_layout == 'list') && ($animate_on_scroll == 'yes' || ($masonry == 'yes' && intval($columns) > 1))) ? "masonry-grid" : ''),
|
||||
((($posts_layout == 'grid' || $posts_layout == 'list') && $animate_on_scroll == 'yes') ? "animate_on_scroll ".esc_attr($animation_effects) : ''),
|
||||
]);
|
||||
|
||||
$query_options = [
|
||||
//Query args
|
||||
'include_ids' => $settings['include_ids'],
|
||||
'post_type' => $settings['post_type'],
|
||||
'posts_per_page' => $settings['posts_per_page'],
|
||||
'order' => $settings['order'],
|
||||
'orderby' => $settings['orderby'],
|
||||
'ignore_sticky_posts' => $settings['ignore_sticky_posts'],
|
||||
'pagination' => $settings['pagination'],
|
||||
'exclude_ids' => $settings['exclude_ids'],
|
||||
'exclude_current' => $settings['exclude_current'],
|
||||
'taxonomies' => $settings['taxonomies'],
|
||||
'terms_relation' => $settings['terms_relation'],
|
||||
|
||||
//Settings
|
||||
'posts_layout' => $settings['posts_layout'],
|
||||
'columns' => $settings['columns'],
|
||||
'masonry' => $settings['masonry'],
|
||||
'animate_on_scroll' => $settings['animate_on_scroll'],
|
||||
'show_title' => $settings['show_title'],
|
||||
'show_image' => $settings['show_image'],
|
||||
'image_size' => $settings['image_size'],
|
||||
'title_typography_html_tag' => stratum_validate_heading_html_tag( $settings['title_typography_html_tag'] ),
|
||||
'title_over_image' => $settings['title_over_image'],
|
||||
'show_meta' => $settings['show_meta'],
|
||||
'meta_fields_divider' => $settings['meta_fields_divider'],
|
||||
'show_content' => $settings['show_content'],
|
||||
'show_excerpt' => $settings['show_excerpt'],
|
||||
'excerpt_length' => $settings['excerpt_length'],
|
||||
'show_read_more' => $settings['show_read_more'],
|
||||
'open_new_tab' => $settings['open_new_tab'],
|
||||
'read_more_text' => $settings['read_more_text'],
|
||||
];
|
||||
|
||||
//Add terms from taxonomies list
|
||||
if (!empty($settings['taxonomies'])){
|
||||
foreach ($settings['taxonomies'] as $taxonomy_key => $taxonomy_name) {
|
||||
if (isset($settings[$taxonomy_name.'_terms'])){
|
||||
$query_options[$taxonomy_name.'_terms'] = $settings[$taxonomy_name.'_terms'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$masonry_options = [
|
||||
'columns' => $columns,
|
||||
'column_gap' => $column_gap['size'],
|
||||
'row_gap' => $row_gap['size'],
|
||||
];
|
||||
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
|
||||
//Generate options for swiper
|
||||
$slider_options = stratum_generate_swiper_options($settings);
|
||||
|
||||
if ( $posts_layout == 'grid' || $posts_layout == 'list' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>"
|
||||
<?php
|
||||
if ( $pagination == 'yes' && ( $page_pagination_style == 'load_more_btn' || $page_pagination_style == 'load_more_scroll' ) ) {
|
||||
?>
|
||||
data-query-options="<?php echo esc_attr( json_encode( $query_options ) ); ?>"
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
>
|
||||
<div class="<?php echo esc_attr( $wrapper_class ); ?>" data-masonry-options="<?php echo esc_attr( json_encode( $masonry_options ) ); ?>">
|
||||
<?php
|
||||
if ( $posts_layout == 'grid' && intval($columns) > 1 && $masonry == 'yes' ) {
|
||||
?>
|
||||
<div class="grid-sizer masonry-col-<?php echo esc_attr( $columns ); ?>"></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Get Articles
|
||||
echo Advanced_Posts_Ajax::get_instance()->get_articles($settings, 'render'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( $pagination == 'yes' ) {
|
||||
if ( $page_pagination_style == 'load_more_btn' || $page_pagination_style == 'load_more_scroll' ) {
|
||||
?>
|
||||
<nav class="ajax_load_more_pagination <?php if ( $page_pagination_style == 'load_more_scroll' ) { ?> load_more_scroll <?php } ?>" role="navigation">
|
||||
<?php
|
||||
if ( $page_pagination_style == 'load_more_scroll' ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__ajax-load-more-arrow' ); ?>"><i class="<?php echo esc_attr( $scroll_icon ); ?>"></i></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<a class="<?php echo esc_attr( $widget_class . '__ajax-load-more-btn' ); ?>" href="#" data-current-page="1" data-max-page="<?php echo esc_attr($q->max_num_pages); ?>"><?php echo esc_html($load_more_text); ?></a>
|
||||
</nav>
|
||||
<?php
|
||||
} else if ( $page_pagination_style == 'navigation' ) {
|
||||
?>
|
||||
<nav class="navigation pagination" role="navigation">
|
||||
<h2 class="screen-reader-text"><?php echo esc_html__('Posts navigation', 'stratum'); ?></h2>
|
||||
<div class="nav-links">
|
||||
<?php
|
||||
$pagination_args = array(
|
||||
'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
|
||||
'total' => $q->max_num_pages,
|
||||
'current' => max( 1, get_query_var( 'paged' ) ),
|
||||
'format' => '?paged=%#%',
|
||||
'show_all' => false,
|
||||
'type' => 'plain',
|
||||
'end_size' => 2,
|
||||
'mid_size' => 1,
|
||||
'prev_next' => true,
|
||||
'prev_text' => sprintf( '<i></i> %1$s', esc_html_x( '<', 'Previous post', 'stratum' ) ),
|
||||
'next_text' => sprintf( '%1$s <i></i>', esc_html_x( '>', 'Next post', 'stratum' ) ),
|
||||
'add_args' => false,
|
||||
'add_fragment' => ''
|
||||
);
|
||||
|
||||
$pagination_args = apply_filters( 'stratum/widgets/advanced-posts/pagination_args', $pagination_args );
|
||||
echo paginate_links( $pagination_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
} elseif ( $posts_layout == 'carousel' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-slider-options="<?php echo esc_attr( json_encode( $slider_options ) ); ?>">
|
||||
<div class="swiper swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
if ( $q->have_posts() ) {
|
||||
|
||||
while( $q->have_posts() ):
|
||||
$q->the_post();
|
||||
|
||||
$post_id = get_the_ID();
|
||||
$url = get_the_post_thumbnail_url($post_id, $image_size);
|
||||
|
||||
?>
|
||||
<div class="swiper-slide <?php echo esc_attr( $widget_class . '__post' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__image' ); ?>" style="background-image: url('<?php echo esc_url($url); ?>');"></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-container' ); ?>">
|
||||
|
||||
<?php
|
||||
if ( !empty( $show_meta ) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__entry-meta' ); ?>">
|
||||
<?php
|
||||
if ( in_array("date", $show_meta) ) {
|
||||
$archive_year = get_the_time('Y');
|
||||
$archive_month = get_the_time('m');
|
||||
$archive_day = get_the_time('d');
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__post-date' ); ?>">
|
||||
<time datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
|
||||
<a href="<?php echo esc_url( get_day_link( $archive_year, $archive_month, $archive_day) ); ?>">
|
||||
<?php echo esc_html( get_the_date( '' ) ); ?>
|
||||
</a>
|
||||
</time>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( in_array("author", $show_meta) ) {
|
||||
if ( in_array("date", $show_meta) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__meta-fields-divider' ); ?>"><?php echo esc_html($meta_fields_divider); ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-author' ); ?>">
|
||||
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>">
|
||||
<?php echo esc_html( get_the_author() ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( in_array("categories", $show_meta) ) {
|
||||
if ( in_array("date", $show_meta) || in_array("author", $show_meta) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__meta-fields-divider' ); ?>"><?php echo esc_html($meta_fields_divider); ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-categories' ); ?>">
|
||||
<?php echo get_the_category_list(', '); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( in_array("comments", $show_meta) ) {
|
||||
if ( in_array("date", $show_meta) || in_array("author", $show_meta) || in_array("categories", $show_meta) ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $widget_class . '__meta-fields-divider' ); ?>"><?php echo esc_html($meta_fields_divider); ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-comments' ); ?>">
|
||||
<a href="<?php echo esc_url( get_comments_link() ); ?>">
|
||||
<?php
|
||||
if ( get_comments_number() ) {
|
||||
echo esc_html(
|
||||
sprintf(
|
||||
_n( '%d Comment', '%d Comments', get_comments_number(), 'stratum' ),
|
||||
get_comments_number()
|
||||
)
|
||||
);
|
||||
} else {
|
||||
echo esc_html__( 'No comments', 'stratum' );
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $show_title == 'yes' ) {
|
||||
the_title( '<'.esc_attr($title_typography_html_tag).' class="'.esc_attr( $widget_class . '__post-title' ).'"><a href="'.esc_url(get_permalink()).'">', '</a></'.esc_attr($title_typography_html_tag).'>' );
|
||||
}
|
||||
|
||||
if ( $show_content == 'yes' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__post-content' ); ?>">
|
||||
<?php
|
||||
if ( $show_excerpt == 'yes' ) {
|
||||
|
||||
if ( $excerpt_length ) {
|
||||
\Stratum\Excerpt_Helper::get_instance()->setExcerptLength( $excerpt_length );
|
||||
add_filter( 'excerpt_length', array( 'Stratum\Excerpt_Helper', 'excerpt_length' ), 999 );
|
||||
}
|
||||
|
||||
the_excerpt();
|
||||
|
||||
remove_filter( 'excerpt_length', array( 'Stratum\Excerpt_Helper', 'excerpt_length' ), 999 );
|
||||
|
||||
} else {
|
||||
the_content();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $show_read_more == 'yes' ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__entry-footer' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__read-more' ); ?>">
|
||||
<a href="<?php the_permalink() ?>" <?php if ( $open_new_tab == 'yes') { ?> target="_blank" <?php } ?>>
|
||||
<?php echo esc_html($read_more_text); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__overlay' ); ?>"></div>
|
||||
</div>
|
||||
<?php
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
|
||||
} else {
|
||||
?><p><?php echo esc_html__( 'Nothing found.', 'stratum' ); ?></p><?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'pagination' ) {
|
||||
if ($pagination_style == 'scrollbar'){
|
||||
?><div class="swiper-scrollbar"></div><?php
|
||||
} else {
|
||||
?><div class="swiper-pagination"></div><?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'arrows' ) {
|
||||
?>
|
||||
<div class="stratum-swiper-button-prev"></div>
|
||||
<div class="stratum-swiper-button-next"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'animation_effect' => '',
|
||||
'text_animation_effect' => '',
|
||||
'sub_title_typography_html_tag' => 'div',
|
||||
'title_typography_html_tag' => 'h3',
|
||||
'description_typography_html_tag' => 'div',
|
||||
'slides' => array(),
|
||||
'image_size' => '',
|
||||
|
||||
//Swiper
|
||||
'columns_count' => '1',
|
||||
'slides_in_columns' => '1',
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
//--Swiper
|
||||
), $settings ) );
|
||||
|
||||
$sub_title_typography_html_tag = stratum_validate_heading_html_tag( $sub_title_typography_html_tag );
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
$description_typography_html_tag = stratum_validate_heading_html_tag( $description_typography_html_tag );
|
||||
|
||||
$widget_class = 'stratum-advanced-slider';
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
($animation_effect !='none' ? "stratum-effect-".esc_attr( $animation_effect ) : ''),
|
||||
(($text_animation_effect !='none' && (intval($columns_count) == 1 && intval($slides_in_columns) == 1 ) ) ? "has-text-animation-".esc_attr( $text_animation_effect ) : '')
|
||||
]);
|
||||
|
||||
//Generate options for swiper
|
||||
$slider_options = stratum_generate_swiper_options($settings);
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-slider-options="<?php echo esc_attr( json_encode($slider_options) ); ?>">
|
||||
<div class="swiper swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
foreach ( $slides as $index => $item ) {
|
||||
$id = $item[ 'image' ][ 'id' ];
|
||||
|
||||
if ( $id ) {
|
||||
$url = wp_get_attachment_image_url($id, $image_size );
|
||||
} else {
|
||||
$url = Utils::get_placeholder_image_src();
|
||||
}
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
?>
|
||||
<div class="swiper-slide <?php echo esc_attr($current_item); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__image' ); ?>" style="background-image: url('<?php echo esc_url($url); ?>'); "></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__slide-container' ); ?>">
|
||||
<?php
|
||||
if ( !empty($item['sub_title']) ) {
|
||||
?>
|
||||
<<?php echo esc_html($sub_title_typography_html_tag); ?> class="<?php echo esc_attr( $widget_class . '__sub-title' ); ?>">
|
||||
<?php echo esc_html($item['sub_title']); ?>
|
||||
</<?php echo esc_html($sub_title_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($item['title']) ) {
|
||||
?>
|
||||
<<?php echo esc_html($title_typography_html_tag); ?> class="<?php echo esc_attr( $widget_class . '__title' );?>">
|
||||
<?php echo esc_html($item['title']); ?>
|
||||
</<?php echo esc_html($title_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($item['description']) ) {
|
||||
?>
|
||||
<<?php echo esc_html($description_typography_html_tag); ?> class="<?php echo esc_attr( $widget_class . '__description' ); ?>">
|
||||
<?php echo esc_html($item['description']); ?>
|
||||
</<?php echo esc_html($description_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($item['button_text']) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__button' ); ?>">
|
||||
<a href="<?php echo esc_url( $item['button_link']['url'] ) ?>" <?php if ( $item['button_link']['is_external'] ) { ?>target="_blank" <?php } ?> ><?php echo esc_html( $item['button_text'] ); ?></a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__overlay' ); ?>"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ( $navigation == 'both' || $navigation == 'pagination' ) {
|
||||
if ( $pagination_style == 'scrollbar' ) {
|
||||
?>
|
||||
<div class="swiper-scrollbar"></div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="swiper-pagination"></div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( $navigation == 'both' || $navigation == 'arrows' ) {
|
||||
?>
|
||||
<div class="stratum-swiper-button-prev"></div>
|
||||
<div class="stratum-swiper-button-next"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Frontend;
|
||||
use Elementor\Icons_Manager;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'tabs_items' => array(),
|
||||
'item_icon' => '',
|
||||
'tabs_layout' => 'horizontal',
|
||||
'tabs_interactivity' => 'click',
|
||||
'equal_height' => '',
|
||||
'content_animation' => '',
|
||||
|
||||
), $settings ) );
|
||||
|
||||
$widget_class = 'stratum-advanced-tabs';
|
||||
|
||||
$is_active = false;
|
||||
foreach ( $tabs_items as $index => $item ) {
|
||||
if ($item['active']){
|
||||
$is_active = true;
|
||||
}
|
||||
}
|
||||
|
||||
$class = stratum_css_class([
|
||||
$widget_class,
|
||||
'tabs-layout-'.esc_attr($tabs_layout),
|
||||
($content_animation != 'none' ? $content_animation.'-animation' : ''),
|
||||
]);
|
||||
|
||||
$accordion_options = [
|
||||
'tabs_interactivity' => $tabs_interactivity,
|
||||
'equal_height' => ($equal_height == 'yes' ? true : false),
|
||||
];
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item_icon, [ 'aria-hidden' => 'true' ] );
|
||||
$item_icon_html = ob_get_clean();
|
||||
|
||||
$once_active_nav = false;
|
||||
$once_active_content = false;
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-tabs-options="<?php echo esc_attr( json_encode($accordion_options) ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__navigation' ); ?>">
|
||||
<?php
|
||||
foreach ( $tabs_items as $index => $item ) {
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
|
||||
$item_class = stratum_css_class([
|
||||
$widget_class . '__navigation-item',
|
||||
(($item['active'] == 'yes' && $once_active_nav == false) || ($index == 0 && $is_active == false) ? 'active-nav' : ''),
|
||||
$current_item
|
||||
]);
|
||||
|
||||
if ($item['active'] == 'yes'){
|
||||
$once_active_nav = true;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
Icons_Manager::render_icon( $item['tab_icon'], [ 'aria-hidden' => 'true' ] );
|
||||
$item_icon_html = ob_get_clean();
|
||||
?>
|
||||
<div data-tab-id="<?php echo esc_attr($index); ?>" class="<?php echo esc_attr( $item_class ); ?>">
|
||||
<?php
|
||||
if ( !empty($item['tab_title']) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__title' ); ?>">
|
||||
<?php echo esc_html($item['tab_title']); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ( !empty($item_icon_html) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__icon' ); ?>">
|
||||
<span><?php echo $item_icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__content' ); ?>">
|
||||
<?php
|
||||
foreach ( $tabs_items as $index => $item ) {
|
||||
$current_item = 'elementor-repeater-item-'.$item['_id'];
|
||||
|
||||
$item_class = stratum_css_class([
|
||||
$widget_class . '__content-item',
|
||||
(($item['active'] == 'yes' && $once_active_content == false ) || ($index == 0 && $is_active == false) ? 'active-content' : ''),
|
||||
$current_item
|
||||
]);
|
||||
|
||||
if ($item['active'] == 'yes'){
|
||||
$once_active_content = true;
|
||||
}
|
||||
?>
|
||||
<div data-tab-id="<?php echo esc_attr($index); ?>" class="<?php echo esc_attr( $item_class );?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__content-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $widget_class . '__content-overlay' ); ?>"></div>
|
||||
<div class="<?php echo esc_attr( $widget_class . '__text' ); ?>">
|
||||
<?php
|
||||
if ( $item['content_type'] == 'text' ) {
|
||||
if ( !empty($item['tab_text']) ) {
|
||||
echo wp_kses_post( $item['tab_text'] );
|
||||
}
|
||||
} elseif ( $item['content_type'] == 'template' ) {
|
||||
if ( !empty($item['tab_template']) ) {
|
||||
echo $frontend->get_builder_content($item['tab_template'], true); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( [
|
||||
'image' => '',
|
||||
'image_size' => '',
|
||||
'hosted_url' => '',
|
||||
'title' => '',
|
||||
'text' => '',
|
||||
'title_typography_html_tag' => 'h5',
|
||||
'link' => '',
|
||||
'link_target' => '',
|
||||
'link_rel' => '',
|
||||
'animation_effect' => 'none',
|
||||
'text_animation_effect' => 'none',
|
||||
'background_type' => 'image'
|
||||
], $settings ) );
|
||||
|
||||
$class = 'stratum-banner';
|
||||
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
|
||||
$id = $image[ 'id' ];
|
||||
$link = !empty( $link ) ? $link : "#";
|
||||
$url = wp_get_attachment_image_url( $image[ 'id' ], $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset($image[ 'id' ], $image_size);
|
||||
|
||||
?>
|
||||
<figure class="<?php echo esc_attr( $class . ' stratum-effect-' . $animation_effect . ' has-text-animation-' . $text_animation_effect ); ?> ">
|
||||
<a href="<?php echo esc_url( $link ); ?>" class="<?php echo esc_attr( $class.'__link' ); ?>"
|
||||
<?php
|
||||
if ( ! empty( $link_target ) ) {
|
||||
?>
|
||||
target="<?php echo esc_attr( $link_target ); ?>"
|
||||
<?php
|
||||
}
|
||||
if ( ! empty( $link_rel ) ) {
|
||||
?>
|
||||
rel="<?php echo esc_attr( $link_rel ); ?>"
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
>
|
||||
<?php
|
||||
if ( $link ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__wrapper' ); ?>">
|
||||
<?php
|
||||
if ( $background_type == 'video' ) {
|
||||
?>
|
||||
<video class="<?php echo esc_attr( $class.'__video' ); ?>" autoplay muted loop>
|
||||
<source src="<?php echo esc_url( $hosted_url[ 'url' ] ); ?>" type='video/mp4'>
|
||||
</video>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<img src="<?php if ( empty( $id ) ) { echo esc_url(Utils::get_placeholder_image_src()); } else { esc_url( $url ); } ?>" class="<?php echo esc_attr( $class . '__image' . ' wp-image-' . $id ); ?>" srcset="<?php echo esc_attr( $srcset ); ?>"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__overlay' ); ?>"></div>
|
||||
<figcaption class="<?php echo esc_attr( $class.'__content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__content-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__content-container' ); ?>">
|
||||
<<?php echo esc_html($title_typography_html_tag); ?> class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title ); ?></<?php echo esc_html($title_typography_html_tag); ?>>
|
||||
<div class="<?php echo esc_attr( $class.'__text' ); ?>"><?php echo esc_html( $text ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</figcaption>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
</figure>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
//Settings
|
||||
$text = ($type == 'php') ? $settings['text'] : '{{{settings.text}}}';
|
||||
$show_percents = ($type == 'php') ? $settings['show_percents'] : '{{{settings.show_percents}}}';
|
||||
$value = ($type == 'php') ? $settings['value'] : '{{{settings.value}}}';
|
||||
$round = ($type == 'php') ? $settings['round'] : '{{{settings.round}}}';
|
||||
$circle = ($type == 'php') ? $settings['circle'] : '{{{settings.circle}}}';
|
||||
$padding = ($type == 'php') ? $settings['padding'] : '{{{settings.padding}}}';
|
||||
$widget_width = ($type == 'php') ? $settings['widget_width'] : '{{{settings.widget_width}}}';
|
||||
$thickness = ($type == 'php') ? $settings['thickness'] : '{{{settings.thickness}}}';
|
||||
$line_color = ($type == 'php') ? $settings['line_color'] : '{{{settings.line_color}}}';
|
||||
$background_color = ($type == 'php') ? $settings['background_color'] : '{{{settings.background_color}}}';
|
||||
|
||||
//=======================RENDER TYPE=======================
|
||||
$js_settings = '';
|
||||
|
||||
//-----------PHP-----------
|
||||
if ( $type == 'php' ) {
|
||||
$options = [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'value' => isset($value['size']) ? $value['size'] : $value,
|
||||
'text' => ($show_percents == 'yes' ? true : false),
|
||||
'round' => ($round == 'yes' ? true : false),
|
||||
'circle' => ($circle == 'yes' ? true : false),
|
||||
'padding' => isset($padding['size']) ? $padding['size'] : $padding,
|
||||
'radius' => ($widget_width['size'] / 2),
|
||||
'thickness' => isset($thickness['size']) ? $thickness['size'] : $thickness,
|
||||
'bg' => $background_color,
|
||||
'color' => $line_color
|
||||
];
|
||||
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [ 'stratum-circle-progress-bar' ]
|
||||
] );
|
||||
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => 'stratum-circle-progress-bar__wrapper',
|
||||
'data-options' => json_encode( $options )
|
||||
] );
|
||||
//-----------/PHP-----------
|
||||
|
||||
}
|
||||
//-----------JS (BACKBONE)-----------
|
||||
elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<#
|
||||
const options = {
|
||||
min: 0,
|
||||
max: 100,
|
||||
value: (settings.value.size != '' ? settings.value.size : 0),
|
||||
text: (settings.show_percents == 'yes' ? true : false),
|
||||
round: (settings.round == 'yes' ? true : false),
|
||||
circle: (settings.circle == 'yes' ? true : false),
|
||||
padding: settings.padding.size,
|
||||
radius: (settings.widget_width.size / 2),
|
||||
thickness: settings.thickness.size,
|
||||
bg: settings.background_color,
|
||||
color: settings.line_color
|
||||
};
|
||||
|
||||
view.addRenderAttribute( 'widget', {
|
||||
'class': [ 'stratum-circle-progress-bar' ]
|
||||
} );
|
||||
|
||||
view.addRenderAttribute( 'wrapper', {
|
||||
'class': [ 'stratum-circle-progress-bar__wrapper' ],
|
||||
'data-options': JSON.stringify(options),
|
||||
} );
|
||||
#>
|
||||
<?php
|
||||
}
|
||||
//-----------/JS (BACKBONE)-----------
|
||||
|
||||
//Render attr
|
||||
$attr_widget = ($type == 'php') ? $this->get_render_attribute_string( 'widget' ) : "{{{ view.getRenderAttributeString( 'widget' ) }}}";
|
||||
$attr_wrapper = ($type == 'php') ? $this->get_render_attribute_string( 'wrapper' ): "{{{ view.getRenderAttributeString( 'wrapper' ) }}}";
|
||||
|
||||
?>
|
||||
|
||||
<div <?php echo $attr_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div <?php echo $attr_wrapper; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $show_percents != 'yes' ) {
|
||||
if ( $type == 'php' ) {
|
||||
if ( ! empty( $text ) ) {
|
||||
?>
|
||||
<span class="stratum-circle-progress-bar__title"><?php echo esc_html( $text ); ?></span>
|
||||
<?php
|
||||
}
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.show_percents == '' && settings.text != '' ) { #>
|
||||
<span class="stratum-circle-progress-bar__title"><?php echo esc_html( $text ); ?></span>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
use \Elementor\Frontend;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'content_type' => '',
|
||||
'content_items' => array(),
|
||||
'content_animation' => '',
|
||||
), $settings ) );
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
$class = 'stratum-content-switcher';
|
||||
$wrap_class = $class;
|
||||
|
||||
$animation_class = stratum_css_class( [ ( $content_animation != 'none' ? $content_animation.'-animation' : 'none-animation' ) ] );
|
||||
|
||||
|
||||
if ( $content_type === 'multiple' ) {
|
||||
$wrap_class .= ' is-multiple';
|
||||
}
|
||||
|
||||
if ( $content_type === 'toggle' ) {
|
||||
$wrap_class .= ' is-toggle';
|
||||
}
|
||||
|
||||
$once_active_nav = false;
|
||||
$once_active_sw = false;
|
||||
$once_active_content = false;
|
||||
|
||||
$is_active = false;
|
||||
|
||||
$unique_id = uniqid();
|
||||
|
||||
foreach ( $content_items as $index => $item ) {
|
||||
if ( $item[ 'active' ] ) {
|
||||
$is_active = true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="<?php echo esc_attr( $wrap_class ); ?> ">
|
||||
<div class="<?php echo esc_attr( $class . '__wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__nav' ) ;?>">
|
||||
<?php
|
||||
if ( $content_type === 'multiple' ) :
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__nav-content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__nav-pill' ); ?>"></div>
|
||||
<ul class="<?php echo esc_attr( $class . '__nav-items' ); ?>">
|
||||
<?php
|
||||
foreach ( $content_items as $index => $item ) :
|
||||
$item_class = stratum_css_class( [
|
||||
$class . '__nav-item',
|
||||
( ( $item[ 'active' ] == 'yes' && $once_active_nav == false) || ( $index == 0 && $is_active == false ) ? 'is-active' : '' )
|
||||
] );
|
||||
|
||||
if ( $item[ 'active' ] == 'yes' ) :
|
||||
$once_active_nav = true;
|
||||
endif;
|
||||
|
||||
if ( $content_type !== 'multiple' ) {
|
||||
$toggleNavCounter++;
|
||||
|
||||
if ( $toggleNavCounter === 3 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $item[ 'title' ] != '' ) :
|
||||
?>
|
||||
<li data-tab-id="<?php echo esc_attr( $index ); ?>" class="<?php echo esc_attr( $item_class ); ?>">
|
||||
<a class="<?php echo esc_attr( $class . '__nav-button' ); ?>" href="#" data-content="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>">
|
||||
<span class="<?php echo esc_attr( $class . '__nav-title' );?>"><?php echo esc_html__( $item[ 'title' ], 'stratum' ); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
else :
|
||||
$toggleNavCounter = 0;
|
||||
|
||||
?>
|
||||
<label class="<?php echo esc_attr( $class . '__label' ); ?>">
|
||||
<?php
|
||||
foreach ( $content_items as $index => $item ) :
|
||||
$toggleNavCounter++;
|
||||
|
||||
$item_class = stratum_css_class( [
|
||||
$class . '__nav-item',
|
||||
( ( $item[ 'active' ] == 'yes' && $once_active_sw == false) || ( $index == 0 && $is_active == false ) ? 'is-active' : '' )
|
||||
] );
|
||||
|
||||
if ( $item[ 'active' ] == 'yes' ) :
|
||||
$once_active_sw = true;
|
||||
endif;
|
||||
|
||||
if ( $toggleNavCounter === 3 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $item[ 'title' ] != '' ) :
|
||||
?>
|
||||
<a class="<?php echo esc_attr( $item_class . ' ' . $class . '__nav-button' ); ?>" href="#" data-content="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>">
|
||||
<span class="<?php echo esc_attr( $class . '__nav-title' ); ?>"><?php echo esc_html( $item[ 'title' ] ); ?></span>
|
||||
</a>
|
||||
|
||||
<?php
|
||||
if ( $toggleNavCounter === 1 ) {
|
||||
?>
|
||||
<input type="checkbox" />
|
||||
<i class="<?php echo esc_attr( $class . '__toggle' ); ?>"></i>
|
||||
<?php
|
||||
}
|
||||
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
</label>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '__content' . ' ' . $animation_class ); ?>">
|
||||
<?php
|
||||
foreach ( $content_items as $index => $item ) :
|
||||
$item_class = stratum_css_class( [
|
||||
$class . '__item',
|
||||
( ( $item[ 'active' ] == 'yes' && $once_active_content == false) || ( $index == 0 && $is_active == false ) ? 'is-active' : '' )
|
||||
] );
|
||||
|
||||
if ( $item[ 'active' ] == 'yes' ) :
|
||||
$once_active_content = true;
|
||||
endif;
|
||||
|
||||
if ( $content_type !== 'multiple' ) {
|
||||
$toggleContentCounter = 0;
|
||||
$toggleContentCounter++;
|
||||
|
||||
if ( $toggleContentCounter === 3 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $item[ 'content_template' ] ) ) :
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $item_class ); ?>" id="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>" >
|
||||
<div class="<?php echo esc_attr( $class . '__item-wrapper' ); ?>">
|
||||
<?php echo $frontend->get_builder_content( $item[ 'content_template' ], true ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
else :
|
||||
?>
|
||||
<div class="content-not-found" id="id-content-<?php echo esc_attr( $item[ '_id' ] . $unique_id ); ?>"></div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
endforeach;
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
use \Elementor\Plugin;
|
||||
|
||||
$current_date = new \DateTime(current_time('Y-m-d H:i:s')); //Server time
|
||||
|
||||
try {
|
||||
$target_date = new \DateTime( $settings['date_time'] );
|
||||
} catch ( Exception $e ) {
|
||||
return esc_html__( 'Invalid date.', 'stratum' );
|
||||
}
|
||||
|
||||
if ( $current_date < $target_date ) {
|
||||
$dateTime_until = $current_date->diff( $target_date )->format( "+%yy +%mo +%dd +%hh +%im +%ss" );
|
||||
} else {
|
||||
$dateTime_until = 'negative';
|
||||
}
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'date_time' => $dateTime_until,
|
||||
'show_years' => 'yes',
|
||||
'show_months' => 'yes',
|
||||
'show_weeks' => 'yes',
|
||||
'show_days' => 'yes',
|
||||
'show_hours' => 'yes',
|
||||
'show_minutes' => 'yes',
|
||||
'show_seconds' => 'yes',
|
||||
|
||||
'show_labels' => 'yes',
|
||||
'custom_labels' => '',
|
||||
'label_years' => 'Years',
|
||||
'label_months' => 'Months',
|
||||
'label_weeks' => 'Weeks',
|
||||
'label_days' => 'Days',
|
||||
'label_hours' => 'Hours',
|
||||
'label_minutes' => 'Minutes',
|
||||
'label_seconds' => 'Seconds',
|
||||
|
||||
'stratum_expire_actions' => [],
|
||||
'message_after_expire' => '',
|
||||
'expire_redirect_url' => '',
|
||||
), $settings ) );
|
||||
|
||||
if ($custom_labels == 'yes'){
|
||||
$custom_labels_arr = array(
|
||||
$label_years,
|
||||
$label_months,
|
||||
$label_weeks,
|
||||
$label_days,
|
||||
$label_hours,
|
||||
$label_minutes,
|
||||
$label_seconds
|
||||
);
|
||||
}
|
||||
|
||||
$is_editor = Plugin::instance()->editor->is_edit_mode();
|
||||
|
||||
$countdown_options = array(
|
||||
( $show_years == 'yes' ? 'data-years="true"' : '' ),
|
||||
( $show_months == 'yes' ? 'data-months="true"' : '' ),
|
||||
( $show_weeks == 'yes' ? 'data-weeks="true"' : '' ),
|
||||
( $show_days == 'yes' ? 'data-days="true"' : '' ),
|
||||
( $show_hours == 'yes' ? 'data-hours="true"' : '' ),
|
||||
( $show_minutes == 'yes' ? 'data-minutes="true"' : '' ),
|
||||
( $show_seconds == 'yes' ? 'data-seconds="true"' : '' ),
|
||||
( $custom_labels == 'yes' ? "data-labels='".json_encode($custom_labels_arr)."'" : '' ),
|
||||
((!$is_editor && !empty( $settings['stratum_expire_actions'] )) ? "data-expire-actions='".json_encode($stratum_expire_actions)."'" : '' ),
|
||||
((!$is_editor && is_array($stratum_expire_actions) && in_array("redirect", $stratum_expire_actions) && $expire_redirect_url['url'] != '') ? "data-expire-url='".esc_url($expire_redirect_url['url'])."'" : '' ),
|
||||
((!$is_editor && is_array($stratum_expire_actions) && in_array("message", $stratum_expire_actions) && $message_after_expire != '') ? "data-expire-text='".$message_after_expire."'" : '' )
|
||||
);
|
||||
|
||||
$countdown_options_str = implode( ' ', $countdown_options );
|
||||
|
||||
$widget_name = 'stratum-countdown';
|
||||
|
||||
$class = $block_name = 'stratum-countdown';
|
||||
|
||||
$wrapper_class = stratum_css_class([
|
||||
$widget_name . '__wrapper',
|
||||
($show_labels == 'yes' ? '' : 'hide_labels')
|
||||
]);
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $wrapper_class ); ?>">
|
||||
<div class="<?php
|
||||
echo esc_attr( $widget_name ); ?>__content" data-datetime="<?php
|
||||
echo esc_attr( !empty( $dateTime_until ) ? $dateTime_until : '' ); ?>" <?php
|
||||
echo $countdown_options_str; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
$start = $type == 'php' ? $settings[ 'start' ] : '{{{settings.start}}}';
|
||||
$end = $type == 'php' ? $settings[ 'end'] : '{{{settings.end}}}';
|
||||
$prefix = $type == 'php' ? $settings[ 'prefix' ] : '{{{settings.prefix}}}';
|
||||
$suffix = $type == 'php' ? $settings[ 'suffix' ] : '{{{settings.suffix}}}';
|
||||
|
||||
$duration = $type == 'php' ? $settings[ 'duration' ] : '{{{settings.duration}}}';
|
||||
$numerals = $type == 'php' ? $settings[ 'numerals' ] : '{{{settings.numerals}}}';
|
||||
|
||||
$smooth_animation = $type == 'php' ? $settings[ 'smooth_animation' ] : '{{{settings.smooth_animation}}}';
|
||||
$display_separator = $type == 'php' ? $settings[ 'display_separator' ] : '{{{settings.display_separator}}}';
|
||||
$decimal_places = $type == 'php' ? $settings[ 'decimal_places' ] : '{{{settings.decimal_places}}}';
|
||||
$animation_effect = $type == 'php' ? $settings[ 'animation_effect' ] : '{{{settings.animation_effect}}}';
|
||||
|
||||
$decimal_separator = $type == 'php' ? $settings[ 'decimal_separator' ] : '{{{settings.decimal_separator}}}';
|
||||
$thousands_separator = $type == 'php' ? $settings[ 'thousands_separator' ] : '{{{settings.thousands_separator}}}';
|
||||
|
||||
//=======================RENDER TYPE=======================
|
||||
$js_settings = '';
|
||||
|
||||
//-----------PHP-----------
|
||||
if ( $type == 'php' ) {
|
||||
|
||||
$options = [
|
||||
'start' => !empty( $start ) ? $start : 0,
|
||||
'end' => !empty( $end ) ? $end : 100,
|
||||
'decimalPlaces' => !empty( $decimal_places ) ? $decimal_places : 0,
|
||||
'duration' => !empty( $duration ) ? $duration : 3,
|
||||
|
||||
'useEasing' => !empty( $smooth_animation ) ? true : false,
|
||||
'useGrouping' => !empty( $display_separator ) ? true : false,
|
||||
|
||||
'separator' => $thousands_separator,
|
||||
'decimal' => $decimal_separator,
|
||||
'easingFn' => $animation_effect,
|
||||
'numerals' => $numerals
|
||||
];
|
||||
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [ 'stratum-counter' ]
|
||||
] );
|
||||
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => 'stratum-counter__wrapper',
|
||||
'data-options' => json_encode( $options )
|
||||
] );
|
||||
//-----------/PHP-----------
|
||||
}
|
||||
//-----------JS (BACKBONE)-----------
|
||||
else if ( $type == 'js' ) {
|
||||
?>
|
||||
<#
|
||||
const { start, end, decimal_places, duration, smooth_animation, display_separator, thousands_separator, decimal_separator, animation_effect, numerals } = settings;
|
||||
|
||||
const options = {
|
||||
start: start != '' ? start: 0,
|
||||
end: end != '' ? end: 0,
|
||||
|
||||
decimalPlaces: decimal_places != '' ? decimal_places : 0,
|
||||
duration: duration != '' ? duration : 3,
|
||||
|
||||
useEasing: smooth_animation != '' ? true : false,
|
||||
useGrouping: display_separator != '' ? true : false,
|
||||
|
||||
separator: thousands_separator,
|
||||
decimal: decimal_separator,
|
||||
easingFn: animation_effect,
|
||||
numerals: numerals
|
||||
};
|
||||
|
||||
view.addRenderAttribute( 'widget', {
|
||||
'class': [ 'stratum-counter' ]
|
||||
} );
|
||||
|
||||
view.addRenderAttribute( 'wrapper', {
|
||||
'class': [ 'stratum-counter__wrapper' ],
|
||||
'data-options': JSON.stringify( options )
|
||||
} );
|
||||
#>
|
||||
<?php
|
||||
}
|
||||
//-----------/JS (BACKBONE)-----------
|
||||
|
||||
$class = 'stratum-counter';
|
||||
|
||||
//Render attr
|
||||
$widget_class = $type == 'php' ? $this->get_render_attribute_string( 'widget' ) : "{{{ view.getRenderAttributeString( 'widget' ) }}}";
|
||||
$widget_wrapper = $type == 'php' ? $this->get_render_attribute_string( 'wrapper' ) : "{{{ view.getRenderAttributeString( 'wrapper' ) }}}";
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div <?php echo $widget_wrapper; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
if ( ! empty( $prefix ) ) { ?>
|
||||
<p class="stratum-counter__prefix"><?php echo esc_html( $prefix ); ?></p>
|
||||
<?php }
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.prefix != '' ) { #>
|
||||
<p class="stratum-counter__prefix"><?php echo esc_html( $prefix ); ?></p>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class ); ?>__number"></span>
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
if ( ! empty( $suffix ) ) { ?>
|
||||
<p class="stratum-counter__suffix"><?php echo esc_html( $suffix ); ?></p>
|
||||
<?php }
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.suffix != '' ) { #>
|
||||
<p class="stratum-counter__suffix"><?php echo esc_html( $suffix ); ?></p>
|
||||
<# } #>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
extract(shortcode_atts([
|
||||
'image' => [],
|
||||
'link' => [],
|
||||
'image_size' => 'full',
|
||||
'flip_effect' => 'flip',
|
||||
'flip_direction' => 'right',
|
||||
'icon_shape' => 'circle',
|
||||
'icon_view' => 'default',
|
||||
'show_button' => '',
|
||||
'button_text' => ''
|
||||
], $settings ));
|
||||
|
||||
$class = $this->get_name();
|
||||
|
||||
|
||||
/* #region Flip Box classes */
|
||||
$widget_class = [ $class, 'flip-box-effect-'.esc_attr( $flip_effect ) ];
|
||||
$icon_class = [ $class.'__icon-wrapper', 'stratum-view-'.$icon_view ];
|
||||
|
||||
if ( $flip_effect == 'flip' || $flip_effect == 'slide' || $flip_effect == 'push' ) {
|
||||
array_push(
|
||||
$widget_class,
|
||||
'flip-box-direction-'.esc_attr( $flip_direction )
|
||||
);
|
||||
}
|
||||
|
||||
if ( $icon_view != 'default' && $icon_shape == 'circle' || $icon_shape == 'square' ) {
|
||||
array_push(
|
||||
$icon_class,
|
||||
'stratum-shape-'.esc_attr( $icon_shape )
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'widget', 'class', $widget_class );
|
||||
$this->add_render_attribute( 'icon-wrapper', 'class', $icon_class );
|
||||
/* #endregion */
|
||||
|
||||
$widget_class = $this->get_render_attribute_string( 'widget' );
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class.'__inner' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__layer ' . $class . '__front' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__layer__overlay' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__layer__inner' ); ?>">
|
||||
<?php
|
||||
$graphic = $settings[ 'graphic_element' ];
|
||||
if ( $graphic == 'icon' ) {
|
||||
echo $this->flip_box_render_icon( $settings ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} else if ( $graphic == 'image' ) {
|
||||
echo $this->flip_box_render_image( $image, $image_size ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
$title = $settings[ 'front_title_text' ];
|
||||
$description = $settings[ 'front_description_text' ];
|
||||
?>
|
||||
<h3 class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title ); ?></h3>
|
||||
<div class="<?php echo esc_attr( $class.'__description' ); ?>"><?php echo esc_html( $description ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '__layer ' . $class . '__back' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__layer__overlay' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__layer__inner' ); ?>">
|
||||
<?php
|
||||
$title = $settings[ 'back_title_text' ];
|
||||
$description = $settings[ 'back_description_text' ];
|
||||
?>
|
||||
<h3 class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title ); ?></h3>
|
||||
<div class="<?php echo esc_attr( $class.'__description' ); ?>"><?php echo esc_html( $description ); ?></div>
|
||||
<?php
|
||||
if ( !empty($button_text) && $show_button == 'yes' ) {
|
||||
echo $this->flip_box_render_button( $button_text, $link ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
$class = 'stratum-horizontal-timeline';
|
||||
|
||||
$alignment = $settings[ 'horizontal_alignment' ];
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [
|
||||
$class,
|
||||
$class . '--align-' . $alignment
|
||||
]
|
||||
] );
|
||||
|
||||
$widget_class = $this->get_render_attribute_string( 'widget' );
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__inner' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__track' ); ?>">
|
||||
<?php
|
||||
/* #region Render card */
|
||||
$layout = $settings[ 'horisontal_layout' ]; ?>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '__list ' . $class . '__list--top' ); ?>"><?php
|
||||
|
||||
foreach ( $settings[ 'items_content' ] as $index => $item ) {
|
||||
|
||||
$uniqid = uniqid();
|
||||
$is_active = $item[ 'is_item_active' ];
|
||||
$title_html_tag = $settings[ 'item_title_tag' ];
|
||||
$this->add_render_attribute( 'item' . $uniqid, [ 'class' => [
|
||||
$class . '-item',
|
||||
!empty( $is_active ) ? 'is-active' : '',
|
||||
'elementor-repeater-item-' . esc_attr( $item[ '_id' ] )
|
||||
] ] );
|
||||
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $uniqid );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $layout != 'bottom' ) {
|
||||
if ( $layout == 'chess' ) {
|
||||
if ( (int)bcmod( strval( $index + 1 ), '2' ) != 0 ) {
|
||||
echo $this->_generate_card_content( $class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} else { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div>
|
||||
<?php }
|
||||
} else {
|
||||
echo $this->_generate_card_content($class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} else if ( $layout == 'bottom' ) { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div><?php
|
||||
} ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
/* #endregion */
|
||||
|
||||
/* #region Render points */
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__list ' . $class . '__list--middle' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__line' ); ?>"></div>
|
||||
<?php
|
||||
foreach ( $settings[ 'items_content' ] as $index => $item ) {
|
||||
$uniqid = uniqid();
|
||||
$is_active = $item[ 'is_item_active' ];
|
||||
|
||||
$this->add_render_attribute( 'item' . $uniqid, [ 'class' => [
|
||||
$class . '-item',
|
||||
!empty( $is_active ) ? 'is-active' : '',
|
||||
'elementor-repeater-item-' . esc_attr( $item[ '_id' ] )
|
||||
] ] );
|
||||
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $uniqid );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '-item__point' ); ?>">
|
||||
<?php echo $this->_generate_point_content( $class, $item, $index ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
/* #endregion */
|
||||
|
||||
/* #region Render meta */
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__list ' . $class . '__list--bottom' ); ?>">
|
||||
<?php
|
||||
foreach ( $settings[ 'items_content' ] as $index => $item ) {
|
||||
$uniqid = uniqid();
|
||||
$is_active = $item[ 'is_item_active' ];
|
||||
$this->add_render_attribute( 'item' . $uniqid, [ 'class' => [
|
||||
$class . '-item',
|
||||
!empty( $is_active ) ? 'is-active' : '',
|
||||
'elementor-repeater-item-' . esc_attr( $item[ '_id' ] )
|
||||
] ] );
|
||||
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $uniqid );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $layout != 'bottom' ) {
|
||||
if ( $layout == 'chess' ) {
|
||||
if ( (int)bcmod( strval( $index + 1 ), '2' ) != 0 ) { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
echo $this->_generate_card_content($class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} else { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div><?php
|
||||
}
|
||||
} else if ( $layout == 'bottom' ) {
|
||||
echo $this->_generate_card_content($class, $item, $settings, $title_html_tag, $index); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div><?php
|
||||
/* #endregion */
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
extract(shortcode_atts([
|
||||
'direction' => 'horizontal',
|
||||
'active_type' => 'activate-on-click',
|
||||
'skew_switcher' => '',
|
||||
'skew_direction' => 'right',
|
||||
'content_align' => 'center',
|
||||
'hovered_default_active' => 0,
|
||||
'opened_default_active' => 0
|
||||
], $settings ));
|
||||
|
||||
$class = $this->get_name();
|
||||
|
||||
/* #region Widget classes */
|
||||
$widget_class = [ $class, 'image-accordion-' . esc_attr( $direction ), $active_type ];
|
||||
|
||||
$skew_class = '';
|
||||
if ( $skew_switcher && $direction == 'horizontal' ) {
|
||||
$skew_class = 'skew-direction-' . $skew_direction;
|
||||
array_push(
|
||||
$widget_class,
|
||||
'image-accordion-skew'
|
||||
);
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'widget', 'class', $widget_class );
|
||||
$widget_class = $this->get_render_attribute_string( 'widget' );
|
||||
/* #endregion */
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( trim( $class . '__container' . ' ' . $skew_class ) ); ?>"><?php
|
||||
|
||||
foreach ( $settings[ 'image_content' ] as $index => $item ) {
|
||||
|
||||
/* #region Item classes */
|
||||
$item_classes = [ $class . '__item' ,'elementor-repeater-item-' . esc_attr( $item[ '_id' ] ) ];
|
||||
$default_active = $active_type == 'activate-on-click' ? $opened_default_active : $hovered_default_active;
|
||||
|
||||
if ( $default_active && ($default_active - 1) == $index ) {
|
||||
array_push( $item_classes, 'default-active' );
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'item' . $index, [ 'class' => $item_classes ] );
|
||||
$item_classes = $this->get_render_attribute_string( 'item' . $index );
|
||||
/* #endregion */
|
||||
?>
|
||||
<div <?php echo $item_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__background' ); ?>"></div>
|
||||
<div class="<?php echo esc_attr( $class . '__overlay' ); ?>">
|
||||
<?php
|
||||
/* #region Content classes */
|
||||
$this->add_render_attribute( 'content', [ 'class' => [ $class . '__content', 'image-accordion-' . $content_align ] ] );
|
||||
$content_classes = $this->get_render_attribute_string( 'content' );
|
||||
/* #endregion */
|
||||
|
||||
if ( $item[ 'content_switcher' ] ) {
|
||||
|
||||
$title = $item[ 'item_title' ];
|
||||
$description = $item[ 'item_description' ];
|
||||
?>
|
||||
<div <?php echo $content_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $item[ 'icon_switcher' ] ) {
|
||||
$icon = $item[ 'icon_updated' ]; ?>
|
||||
<i class="<?php echo esc_attr( $class . '__icon ' . $icon ); ?>"></i>
|
||||
<?php } ?>
|
||||
<h3 class="<?php echo esc_attr( $class . '__title' ); ?>">
|
||||
<?php echo esc_html( $title ); ?>
|
||||
</h3>
|
||||
<div class="<?php echo esc_attr( $class . '__description' ); ?>">
|
||||
<?php echo esc_html( $description ) ?>
|
||||
</div>
|
||||
<?php
|
||||
/* #region Render button */
|
||||
$link = $item[ 'link' ];
|
||||
$button_text = $item[ 'button_text' ];
|
||||
$show_button = $item[ 'show_button' ];
|
||||
|
||||
if ( ! empty( $button_text ) && $show_button == 'yes' ) {
|
||||
echo $this->image_accordion_render_button( $index, $button_text, $link ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
/* #endregion */
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Group_Control_Image_Size;
|
||||
use Elementor\Utils;
|
||||
use Elementor\Core\Settings\Manager;
|
||||
|
||||
if ( $type == 'php' ) {
|
||||
$dot_animation = $settings[ 'hotspot_dot_animation' ];
|
||||
|
||||
$dot_classes = [
|
||||
'stratum-image-hotspot__dot',
|
||||
!empty( $dot_animation ) ? 'has-animation-pulse' : ''
|
||||
];
|
||||
}
|
||||
|
||||
$class = 'stratum-image-hotspot';
|
||||
|
||||
$url_placeholder = Utils::get_placeholder_image_src();
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__image' ); ?>">
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
|
||||
list( , $id ) = array_values( $settings[ 'image' ] );
|
||||
|
||||
if ( empty( $id ) ) { ?>
|
||||
<img src="<?php echo esc_url( $url_placeholder ); ?>"/><?php
|
||||
} else {
|
||||
echo Group_Control_Image_Size::get_attachment_image_html( $settings ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# if ( settings.image.url != '' ) {
|
||||
const image = {
|
||||
id: settings.image.id,
|
||||
url: settings.image.url,
|
||||
size: settings.image_size,
|
||||
model: view.getEditModel()
|
||||
};
|
||||
|
||||
const image_url = elementor.imagesManager.getImageUrl( image );
|
||||
#>
|
||||
<img class="wp-image-{{ settings.image.id }}" src="{{ image_url }}" />
|
||||
<# } else { #>
|
||||
<img src="<?php echo esc_url( $url_placeholder ); ?>"/>
|
||||
<# } #>
|
||||
<?php
|
||||
}?>
|
||||
</div>
|
||||
<?php
|
||||
if ( $type == 'php' ) {
|
||||
foreach ( $settings[ 'hot_spots' ] as $index => $item ) {
|
||||
|
||||
$icon_class = $item[ 'hotspot_icon' ];
|
||||
$merge = array_merge( $dot_classes, [ 'elementor-repeater-item-'.esc_attr( $item[ '_id' ] ) ] );
|
||||
|
||||
$this->add_render_attribute( 'dot'.$index, [ 'class' => $merge ] );
|
||||
$dot_class = $this->get_render_attribute_string( 'dot'.$index );
|
||||
|
||||
$wrapper = [
|
||||
'class' => $class.'__dot-wrapper'
|
||||
];
|
||||
|
||||
if ( !empty( $item[ 'tooltip' ] ) ) {
|
||||
$options = [
|
||||
'open' => !empty( $item[ 'open_by_default' ] ) ? true : false,
|
||||
'tooltipArrow' => !empty( $item[ 'tooltip_arrow' ] ) ? true : false,
|
||||
'placement' => $item[ 'placement' ],
|
||||
'tooltipTheme' => $item[ 'tooltip_theme' ],
|
||||
'tooltipAnimation' => $item[ 'tooltip_animation' ],
|
||||
'tooltipTrigger' => $item[ 'tooltip_interactivity' ],
|
||||
'tooltipContent' => $item[ 'tooltip_content' ],
|
||||
'tooltipTitle' => $item[ 'tooltip_title' ]
|
||||
];
|
||||
|
||||
$wrapper[ 'data-options' ] = json_encode( $options );
|
||||
}
|
||||
|
||||
$this->add_render_attribute( 'wrapper'.$index, $wrapper );
|
||||
$wrapper_class = $this->get_render_attribute_string( 'wrapper'.$index );
|
||||
|
||||
echo $this->get_dot_template( $class, $dot_class, $wrapper_class, $icon_class, $type, $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
} elseif ( $type == 'js' ) {
|
||||
?>
|
||||
<# let index = 0; #>
|
||||
<# _.each( settings.hot_spots, item => { #>
|
||||
<#
|
||||
const { tooltip, open_by_default, placement, tooltip_arrow, tooltip_theme } = settings.hot_spots[ index ];
|
||||
const { tooltip_animation, tooltip_interactivity } = settings.hot_spots[ index ];
|
||||
|
||||
let options;
|
||||
if ( tooltip != '' ) {
|
||||
options = {
|
||||
open : open_by_default != '' ? true : false,
|
||||
tooltipArrow: tooltip_arrow != '' ? true : false,
|
||||
tooltipAnimation: tooltip_animation,
|
||||
tooltipTrigger: tooltip_interactivity,
|
||||
tooltipContent: item.tooltip_content,
|
||||
tooltipTheme: tooltip_theme,
|
||||
tooltipTitle: item.tooltip_title,
|
||||
placement : placement
|
||||
}
|
||||
}
|
||||
|
||||
view.addRenderAttribute( 'dot' + index, {
|
||||
'class': [
|
||||
'stratum-image-hotspot__dot',
|
||||
settings.hotspot_dot_animation != '' ? 'has-animation-pulse' : '',
|
||||
'elementor-repeater-item-' + item._id
|
||||
]
|
||||
} );
|
||||
|
||||
view.addRenderAttribute( 'wrapper' + index, {
|
||||
'class': [ 'stratum-image-hotspot__dot-wrapper' ],
|
||||
...tooltip && {
|
||||
'data-options': JSON.stringify( options )
|
||||
}
|
||||
} );
|
||||
#>
|
||||
|
||||
<?php
|
||||
$icon_class = "{{ item.hotspot_icon }}";
|
||||
|
||||
$dot_class = "{{{ view.getRenderAttributeString( 'dot' + index ) }}}";
|
||||
$wrapper_class = "{{{ view.getRenderAttributeString( 'wrapper' + index ) }}}";
|
||||
|
||||
echo $this->get_dot_template( $class, $dot_class, $wrapper_class, $icon_class, $type ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
<# index++; } ); #>
|
||||
<?php
|
||||
}?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'items' => 6,
|
||||
'columns' => 3,
|
||||
'columns_mobile' => 3,
|
||||
'columns_tablet' => 3,
|
||||
'animate_on_scroll' => '',
|
||||
'animation_effects' => '',
|
||||
), $settings ) );
|
||||
|
||||
extract( shortcode_atts(
|
||||
array(
|
||||
'media' => array()
|
||||
),
|
||||
$extra_params
|
||||
) );
|
||||
|
||||
|
||||
$widget_name = 'stratum-instagram';
|
||||
|
||||
$class = $block_name = 'stratum-instagram';
|
||||
|
||||
$wrapper_class = 'stratum-instagram__wrapper masonry-grid' . ( $animate_on_scroll == 'yes' ? (' ' . $animation_effects . ' animate_on_scroll') : '' );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $wrapper_class ); ?>">
|
||||
<?php
|
||||
$counter = 1;
|
||||
foreach ( $media as $value ) {
|
||||
if ( $counter <= $items ) {
|
||||
|
||||
$alt = '';
|
||||
if ( isset( $value->caption ) ) {
|
||||
$alt = wp_trim_words( $value->caption );
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $widget_name ); ?>__item masonry-item">
|
||||
<div class="<?php echo esc_attr( $widget_name ); ?>__media-wrapper">
|
||||
<a class="<?php echo esc_attr( $widget_name ); ?>__media-link" target="_blank" href="<?php echo esc_url( $value->permalink ); ?>">
|
||||
<?php
|
||||
if ( $value->media_type == 'IMAGE' || $value->media_type == 'CAROUSEL_ALBUM' ){ ?>
|
||||
<img class="<?php echo esc_attr( $widget_name ); ?>__media" src="<?php echo esc_url( $value->media_url ); ?>" alt="<?php echo esc_attr( $alt ); ?>"/>
|
||||
<?php } elseif ($value->media_type == 'VIDEO'){ ?>
|
||||
<img class="<?php echo esc_attr( $widget_name ); ?>__media" src="<?php echo esc_url( $value->thumbnail_url ); ?>" alt="<?php echo esc_attr( $alt ); ?>"/>
|
||||
<?php } ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
$counter ++;
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
$anim_url = $settings[ 'lottie_url' ];
|
||||
|
||||
if( empty( $anim_url ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$class = 'stratum-lottie-animations';
|
||||
$out = "";
|
||||
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => [ $class.'__wrapper' ],
|
||||
'data-lottie-url' => $settings[ 'lottie_url' ],
|
||||
'data-lottie-render' => $settings[ 'lottie_renderer' ],
|
||||
'data-lottie-loop' => $settings[ 'lottie_loop' ],
|
||||
'data-lottie-reverse' => $settings[ 'lottie_reverse' ],
|
||||
'data-lottie-speed' => $settings[ 'lottie_speed' ],
|
||||
'data-lottie-hover' => $settings[ 'lottie_hover' ]
|
||||
]);
|
||||
|
||||
if( $settings[ 'animate_on_scroll' ] ) {
|
||||
$this->add_render_attribute( 'wrapper', [
|
||||
'class' => 'stratum-lottie-scroll',
|
||||
'data-lottie-scroll' => 'true',
|
||||
'data-scroll-start' => $settings['animate_view']['sizes']['start'],
|
||||
'data-scroll-end' => $settings['animate_view']['sizes']['end'],
|
||||
'data-scroll-speed' => $settings[ 'animate_speed' ][ 'size' ]
|
||||
]);
|
||||
}
|
||||
|
||||
$wrapper_classes = $this->get_render_attribute_string( 'wrapper' );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div <?php echo $wrapper_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>></div>
|
||||
</div>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'gallery_images' => array(),
|
||||
'gallery_columns' => array(),
|
||||
'gutter' => array(),
|
||||
'animate_on_scroll' => false,
|
||||
'animation_effects' => '',
|
||||
'image_size' => '',
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-masonry-gallery';
|
||||
|
||||
$gallery_id = uniqid( 'gallery-' );
|
||||
|
||||
$options = [
|
||||
'columns' => $gallery_columns['size'],
|
||||
'gutter' => $gutter['size'],
|
||||
'animate' => ($animate_on_scroll == 'yes' ? true : false)
|
||||
];
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ) . ($animate_on_scroll == 'yes' ? ' animate_on_scroll' : ''); ?> masonry-grid <?php
|
||||
echo esc_attr($animation_effects); ?>" data-options="<?php echo esc_attr(json_encode($options)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
|
||||
|
||||
<div class="grid-sizer masonry-col-<?php echo esc_attr($gallery_columns['size']); ?>"></div>
|
||||
<?php
|
||||
foreach ( $gallery_images as $index => $image ) {
|
||||
$data_img = $this->_get_image_attributes( $image[ 'id' ] );
|
||||
|
||||
$url = wp_get_attachment_image_url( $image[ 'id' ], $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset( $image[ 'id' ], $image_size );
|
||||
$caption = wp_get_attachment_caption( $image[ 'id' ] );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__item' ); ?> masonry-item">
|
||||
<?php
|
||||
if (is_admin()){ ?>
|
||||
<a href="#" class="<?php echo esc_attr( $class . '__link' ); ?>">
|
||||
<?php } else { ?>
|
||||
<a data-elementor-open-lightbox="default" data-elementor-lightbox-slideshow="<?php echo esc_attr($gallery_id); ?>" href="<?php
|
||||
echo esc_url($image['url']); ?>" class="<?php echo esc_attr( $class . '__link' ); ?>">
|
||||
<?php } ?>
|
||||
<div class="<?php echo esc_attr( $class . '__image' ); ?>">
|
||||
<figure>
|
||||
<img class="wp-image-<?php echo esc_attr($image[ 'id' ]); ?>" alt="<?php
|
||||
echo esc_attr( $data_img[ 'alt' ] ); ?>" src="<?php echo esc_url($url); ?>" srcset="<?php
|
||||
echo $srcset; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"><?php
|
||||
|
||||
if ( ! empty( $caption ) ) { ?>
|
||||
<figcaption class="<?php echo esc_attr( $class . '__caption' ); ?>">
|
||||
<?php echo wp_kses_post( $data_img[ 'caption' ] ); ?>
|
||||
</figcaption>
|
||||
<?php } ?>
|
||||
</figure>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '__overlay' ); ?>"></div>
|
||||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( [
|
||||
'image' => '',
|
||||
'image_size' => 'full',
|
||||
'item_title' => '',
|
||||
'item_price' => '',
|
||||
'title_html_tag' => 'h3',
|
||||
'list_title' => '',
|
||||
'image_position' => '',
|
||||
'show_image' => 'no',
|
||||
'title_price_connector' => false
|
||||
], $settings ) );
|
||||
|
||||
$class = 'stratum-price-list';
|
||||
|
||||
$title_html_tag = stratum_validate_heading_html_tag( $title_html_tag );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.' '.$image_position ); ?>">
|
||||
<?php
|
||||
if ( $image[ 'id' ] && $show_image == 'yes' ) {
|
||||
$url = wp_get_attachment_image_url( $image[ 'id' ], $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset( $image[ 'id' ], $image_size );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__image-wrapper' ); ?>">
|
||||
<img src="<?php echo esc_url( $url ); ?>" class="wp-image-<?php echo esc_attr( $image[ 'id' ] . ' ' . $class . '__image' ); ?>" srcset="<?php echo esc_attr( $srcset ); ?>"/>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__content' ); ?>">
|
||||
<<?php echo esc_html($title_html_tag); ?> class="<?php echo esc_attr( $class.'__heading' ); ?>"><?php echo esc_html( $list_title ); ?></<?php echo esc_html($title_html_tag); ?>>
|
||||
<div class="<?php echo esc_attr( $class.'__items' ); ?>">
|
||||
<?php
|
||||
foreach ( $settings[ 'list_items' ] as $index => $item ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class.'__item' ); ?>">
|
||||
<?php
|
||||
$tag_name = stratum_validate_heading_html_tag( $item[ 'title_html_tag' ] );
|
||||
$title = $item[ 'item_title' ];
|
||||
$price = $item[ 'item_price' ];
|
||||
?>
|
||||
<<?php echo esc_html($tag_name); ?> class="<?php echo esc_attr( $class.'__title' ); ?>"><?php echo esc_html( $title );?></<?php echo esc_html($tag_name); ?>>
|
||||
<?php
|
||||
if ( $title_price_connector == 'yes' ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class.'__connector' ); ?>"></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class.'__price' ); ?>"><?php echo esc_html( $price ); ?></span>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'title_price_connector' => false,
|
||||
'items_divider' => false,
|
||||
'menu_items' => array(),
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-price-menu';
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<div class="<?php echo esc_attr( $class.'__items' ); ?>">
|
||||
<?php
|
||||
foreach ( $menu_items as $index => $item ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( 'elementor-repeater-item-'.$item['_id'] . ' ' . $class . '__item-wrapper' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__item' ); ?>">
|
||||
<?php
|
||||
$id = $item[ 'image' ][ 'id' ];
|
||||
|
||||
if ( $id && $item[ 'show_image' ] ) {
|
||||
$image_size = $item[ 'image_size' ];
|
||||
$url = wp_get_attachment_image_url( $id, $image_size );
|
||||
$srcset = wp_get_attachment_image_srcset( $id, $image_size );
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__image image-align-' . $item[ 'image_align' ] ); ?>">
|
||||
<img class="wp-image-<?php echo esc_attr( $id ); ?>" src="<?php echo esc_url( $url ); ?>" srcset="<?php echo esc_attr( $srcset ); ?>"/>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__content' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__header' ); ?>">
|
||||
<?php
|
||||
$tag_name = stratum_validate_heading_html_tag( $item[ 'title_html_tag' ] );
|
||||
$menu_title = $item[ 'menu_title' ];
|
||||
$menu_price = $item[ 'menu_price' ];
|
||||
?>
|
||||
<<?php echo esc_html($tag_name); ?> class="<?php echo esc_attr( $class . '__title' ); ?>"><?php echo esc_html( $menu_title ); ?></<?php echo esc_html($tag_name); ?>>
|
||||
<?php
|
||||
if ( $title_price_connector == 'yes' ) {
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__connector' ); ?>"></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__price' ); ?>"><?php echo esc_html( $menu_price ); ?></span>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '__description' ); ?>"><?php echo esc_html( $item[ 'menu_description' ] ); ?></div>
|
||||
<?php
|
||||
if ( $items_divider == 'yes') {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '__divider' ); ?>"></div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'title' => '',
|
||||
'title_typography' => array(),
|
||||
'title_typography_html_tag' => '',
|
||||
'subtitle' => '',
|
||||
'subtitles_typography' => array(),
|
||||
'subtitles_typography_html_tag' => '',
|
||||
'price_text' => '',
|
||||
'price' => '',
|
||||
'price_typography' => array(),
|
||||
'price_currency' => '',
|
||||
'price_description' => '',
|
||||
'content_items' => '',
|
||||
'align' => '',
|
||||
'button_show' => '',
|
||||
'button_text' => '',
|
||||
'button_url' => '',
|
||||
'title_color' => '',
|
||||
'title_color_hover' => '',
|
||||
'subtitle_color' => '',
|
||||
'subtitle_color_hover' => '',
|
||||
'price_color' => '',
|
||||
'price_color_hover' => '',
|
||||
'price_text_color' => '',
|
||||
'price_text_color_hover' => '',
|
||||
'description_color' => '',
|
||||
'description_color_hover' => '',
|
||||
'content_color' => '',
|
||||
'content_color_hover' => '',
|
||||
'button_color_font' => '',
|
||||
'button_color_font_hover' => '',
|
||||
'button_color_background' => '',
|
||||
'button_color_background_hover' => '',
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-price-table';
|
||||
|
||||
$title = wp_kses( $title, array(
|
||||
'span' => array(),
|
||||
'mark' => array(),
|
||||
'b' => array(),
|
||||
'strong' => array(),
|
||||
'br' => array()
|
||||
), $title );
|
||||
|
||||
$title_typography_html_tag = stratum_validate_heading_html_tag( $title_typography_html_tag );
|
||||
$subtitles_typography_html_tag = stratum_validate_heading_html_tag( $subtitles_typography_html_tag );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>">
|
||||
<div class="<?php echo esc_attr($class); ?>__wrapper">
|
||||
<?php
|
||||
//Headers
|
||||
if( !empty($subtitle) || !empty($title) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__header">
|
||||
<?php
|
||||
if ( !empty($subtitle) ) {
|
||||
?>
|
||||
<<?php echo esc_attr($subtitles_typography_html_tag); ?> class="<?php echo esc_attr($class); ?> __subtitle"><?php echo esc_html($subtitle); ?></<?php echo esc_attr($subtitles_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
if ( !empty($title) ) {
|
||||
?>
|
||||
<<?php echo esc_attr($title_typography_html_tag); ?> class="<?php echo esc_attr($class);?>__title"><?php echo esc_html($title); ?></<?php echo esc_attr($title_typography_html_tag); ?>>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Price section
|
||||
if ( !empty($price_text) || !empty($price) || !empty($price_description) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__price-wrapper">
|
||||
<?php
|
||||
if ( !empty($price_text) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__price-text"><?php echo esc_html($price_text); ?></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($price) ) {
|
||||
?>
|
||||
<p class="<?php echo esc_attr($class); ?>__price"><?php echo esc_html($price);
|
||||
if ( !empty( $price_currency ) ) {
|
||||
?><i class="<?php echo esc_attr($class); ?>__price-currency"><?php echo esc_html($price_currency); ?></i><?php
|
||||
}
|
||||
?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( !empty($price_description) ) {
|
||||
?>
|
||||
<p class="<?php echo esc_attr($class); ?>__price-description"><?php echo esc_html($price_description); ?></p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
//Content section
|
||||
if ( !empty($content_items) ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__content-wrapper">
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($content_items as $key => $item) {
|
||||
$item_id = 'elementor-repeater-item-'.esc_attr($item['_id']);
|
||||
?>
|
||||
<li class="<?php echo esc_attr($item_id . ' ' . $class . '__content');?>"><?php
|
||||
if ( !empty($item['item_icon']) ) {
|
||||
?><i class="<?php echo esc_attr($item['item_icon']); ?>"></i> <?php
|
||||
}
|
||||
echo esc_html($item['item_text']);
|
||||
?></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $button_show == 'yes' ) {
|
||||
//Button
|
||||
?>
|
||||
<div class="<?php echo esc_attr($class); ?>__button elementor-widget-button">
|
||||
<a href="<?php echo esc_url($button_url['url']); ?>" class="button elementor-button" <?php
|
||||
if ( $button_url['is_external'] ) {
|
||||
?>
|
||||
target="_blank"
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
><?php echo esc_html($button_text); ?></a>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
use \Elementor\Frontend;
|
||||
use \Elementor\Icons_Manager;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
'table_head_items' => array(),
|
||||
'table_body_items' => array(),
|
||||
'table_head_alignment_horizontal' => '',
|
||||
'table_body_alignment_horizontal' => '',
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-table';
|
||||
|
||||
$table_tr = [];
|
||||
$table_td = [];
|
||||
|
||||
$frontend = new Frontend;
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>">
|
||||
<table class="<?php echo esc_attr( $class . '__table' ); ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
foreach ( $table_head_items as $key => $table_head ) :
|
||||
$current_text_align = ! empty( $table_head[ 'table_content_alignment' ] ) ? $table_head[ 'table_content_alignment' ] : null;
|
||||
$current_bg = ! empty( $table_head[ 'table_head_unique_bgcolor' ] ) ? "style='background: " . esc_attr( $table_head[ 'table_head_unique_bgcolor' ] ) . ";'" : null;
|
||||
$current_text_color = ! empty( $table_head[ 'table_head_unique_text_color' ] ) ? "style='color: " . esc_attr( $table_head[ 'table_head_unique_text_color' ] ) . ";'" : null;
|
||||
$current_icon_color = ! empty( $table_head[ 'table_head_unique_icon_color' ] ) ? "color: " . esc_attr( $table_head[ 'table_head_unique_icon_color' ] ) . ";" : null;
|
||||
$current_media_space = ! empty( $table_head[ 'table_head_icon_margin' ][ 'top' ] ) || ! empty( $table_head[ 'table_head_icon_margin' ][ 'right' ] ) || ! empty( $table_head[ 'table_head_icon_margin' ][ 'bottom' ] ) || ! empty( $table_head[ 'table_head_icon_margin' ][ 'left' ] ) ? "margin: " . $table_head[ 'table_head_icon_margin' ][ 'top' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ' ' . $table_head[ 'table_head_icon_margin' ][ 'right' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ' ' . $table_head[ 'table_head_icon_margin' ][ 'bottom' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ' ' . $table_head[ 'table_head_icon_margin' ][ 'left' ] . $table_head[ 'table_head_icon_margin' ][ 'unit' ] . ";" : null;
|
||||
$icon_style = ! empty( $current_media_space ) || ! empty( $current_icon_color ) ? sprintf( 'style="%1$s %2$s"', esc_attr( $current_media_space ), esc_attr( $current_icon_color ) ) : null;
|
||||
?>
|
||||
<th colspan="<?php echo esc_attr( $table_head[ 'table_colspan_head' ] ); ?>" <?php echo $current_bg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__header-cell' ) . ' ' . esc_attr( 'align-content-' . ( ! empty( $current_text_align ) ? $current_text_align : $table_head_alignment_horizontal ) ); ?>">
|
||||
|
||||
<span class="<?php echo esc_attr( $class . '__cell-title' ) . ' ' . esc_attr( 'has-media-' . $table_head[ 'table_head_pos' ] ); ?>" <?php echo $current_text_color; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php echo esc_html__( $table_head[ 'table_head_title' ] );
|
||||
|
||||
if ( $table_head[ 'table_head_icon_type' ] != 'none' ) :
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__cell-icon' );?>" <?php echo $icon_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped?>>
|
||||
<?php
|
||||
if ( $table_head[ 'table_head_icon_type' ] == 'icon' ) :
|
||||
$migrated = isset( $table_head[ '__fa4_migrated' ][ 'table_head_icons' ] );
|
||||
$is_new = empty( $table_head[ 'table_head_icon' ] );
|
||||
|
||||
if ( $is_new || $migrated ) :
|
||||
Icons_Manager::render_icon( $table_head[ 'table_head_icons' ], [ 'aria-hidden' => 'true' ] );
|
||||
else: ?>
|
||||
<i class="<?php echo esc_attr( $table_head[ 'table_head_icon' ] ); ?>"></i>
|
||||
<?php endif;
|
||||
|
||||
elseif ( $table_head[ 'table_head_icon_type' ] == 'image' ) :
|
||||
?>
|
||||
<img src="<?php
|
||||
echo esc_url( $table_head[ 'table_head_image' ][ 'url' ] ); ?>" alt="<?php
|
||||
echo esc_attr( get_post_meta( $table_head[ 'table_head_image' ][ 'id' ], '_wp_attachment_image_alt', true ) );
|
||||
?>" style="width: <?php echo esc_attr( $table_head[ 'table_head_image_size' ] ); ?>px"/><?php
|
||||
endif; ?>
|
||||
|
||||
</span>
|
||||
<?php
|
||||
endif; ?>
|
||||
</span>
|
||||
</div>
|
||||
</th><?php
|
||||
endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $table_body_items as $key => $table_body ) :
|
||||
$row_id = uniqid();
|
||||
|
||||
if ( $table_body[ 'table_col_select' ] == 'Row' ) :
|
||||
$table_tr[] = [
|
||||
'id' => $row_id,
|
||||
'type' => $table_body[ 'table_col_select' ]
|
||||
];
|
||||
endif;
|
||||
|
||||
if ( $table_body[ 'table_col_select' ] == 'Col' ) :
|
||||
$table_tr_keys = array_keys( $table_tr );
|
||||
$last_key = end( $table_tr_keys );
|
||||
|
||||
$table_td[] = [
|
||||
'row_id' => $table_tr[ $last_key ][ 'id' ],
|
||||
'type' => $table_body[ 'table_col_select' ],
|
||||
'title' => esc_html__( $table_body[ 'table_col_title' ] ),
|
||||
'content_type' => $table_body[ 'table_col_content_type' ],
|
||||
'table_colspan' => $table_body[ 'table_colspan_body' ],
|
||||
'template' => $table_body[ 'table_col_template' ],
|
||||
'editor' => $table_body[ 'table_col_editor' ],
|
||||
'icon_type' => $table_body[ 'table_col_icon_type' ],
|
||||
'f4_comp' => isset( $table_body[ '__fa4_migrated' ][ 'table_col_icons' ] ),
|
||||
'icon' => empty( $table_body[ 'table_col_icon' ] ),
|
||||
'icons' => $table_body[ 'table_col_icons' ],
|
||||
'image' => $table_body[ 'table_col_image' ],
|
||||
'image_size' => $table_body[ 'table_col_image_size' ],
|
||||
'icon_pos' => $table_body[ 'table_col_pos' ],
|
||||
'content_align' => $table_body[ 'table_col_content_alignment' ],
|
||||
'icon_color' => $table_body[ 'table_body_unique_icon_color' ],
|
||||
'media_space' => $table_body[ 'table_col_margin' ],
|
||||
'text_color' => $table_body[ 'table_body_unique_text_color' ],
|
||||
'bg_color' => $table_body[ 'table_body_unique_bgcolor' ],
|
||||
];
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
for ( $i = 0; $i < count( $table_tr ); $i++ ) :
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
for ( $j = 0; $j < count( $table_td ); $j++ ) :
|
||||
if ( $table_tr[ $i ][ 'id' ] === $table_td[ $j ][ 'row_id' ] ) :
|
||||
$body_text_align = ! empty( $table_td[ $j ][ 'content_align' ] ) ? $table_td[ $j ][ 'content_align' ] : null;
|
||||
$body_bg = ! empty( $table_td[ $j ][ 'bg_color' ] ) ? "style='background: " . $table_td[ $j ][ 'bg_color' ] . ";'" : null;
|
||||
$body_text_color = ! empty( $table_td[ $j ][ 'text_color' ] ) ? "style='color: " . esc_attr( $table_td[ $j ][ 'text_color' ] ) . ";'" : null;
|
||||
$body_icon_color = ! empty( $table_td[ $j ][ 'icon_color' ] ) ? "color: " . esc_attr( $table_td[ $j ][ 'icon_color' ] ) . ";" : null;
|
||||
$body_media_space = ! empty( $table_td[ $j ][ 'media_space' ][ 'top' ] ) || ! empty( $table_td[ $j ][ 'media_space' ][ 'right' ] ) || ! empty( $table_td[ $j ][ 'media_space' ][ 'bottom' ] ) || ! empty( $table_td[ $j ][ 'media_space' ][ 'left' ] ) ? "margin: " . $table_td[ $j ][ 'media_space' ][ 'top' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ' ' . $table_td[ $j ][ 'media_space' ][ 'right' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ' ' . $table_td[ $j ][ 'media_space' ][ 'bottom' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ' ' . $table_td[ $j ][ 'media_space' ][ 'left' ] . $table_td[ $j ][ 'media_space' ][ 'unit' ] . ";" : null;
|
||||
$body_icon_style = ! empty( $body_media_space ) || ! empty( $body_icon_color ) ? sprintf( 'style="%1$s %2$s"', esc_attr( $body_media_space ), esc_attr( $body_icon_color ) ) : null;
|
||||
?>
|
||||
<td <?php echo $body_bg; ?> colspan="<?php echo esc_attr( $table_td[ $j ][ 'table_colspan' ] ); ?>"><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="<?php echo esc_attr( $class . '__body-cell' ) . ' ' . esc_attr( 'align-content-' . ( ! empty( $body_text_align ) ? $body_text_align : $table_body_alignment_horizontal ) ); ?>">
|
||||
<?php
|
||||
if ( $table_td[ $j ][ 'content_type' ] === 'default' ) :
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__cell-title' ) . ' ' . esc_attr( 'has-media-' . $table_td[ $j ][ 'icon_pos' ] ); ?>" <?php echo $body_text_color; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<?php echo wp_kses_post( $table_td[ $j ][ 'title' ] );
|
||||
|
||||
if ( $table_td[ $j ][ 'icon_type' ] != 'none' ) :
|
||||
?>
|
||||
<span class="<?php echo esc_attr( $class . '__cell-icon' ); ?>" <?php echo $body_icon_style; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<?php
|
||||
if ( $table_td[ $j ][ 'icon_type' ] == 'icon' ) :
|
||||
$migrated = isset( $table_td[ $j ][ 'f4_comp' ] );
|
||||
$is_new = empty( $table_td[ $j ][ 'icon' ] );
|
||||
|
||||
if ( $is_new || $migrated ) :
|
||||
Icons_Manager::render_icon( $table_td[ $j ][ 'icons' ], [ 'aria-hidden' => 'true' ] );
|
||||
else: ?>
|
||||
<i class="<?php echo esc_attr( $table_td[ $j ][ 'icon' ] ); ?>"></i><?php
|
||||
endif;
|
||||
|
||||
elseif ( $table_td[ $j ][ 'icon_type' ] == 'image' ) :
|
||||
?>
|
||||
<img src="<?php
|
||||
echo esc_url( $table_td[ $j ][ 'image' ][ 'url' ] ); ?>" alt="<?php
|
||||
echo esc_attr( get_post_meta( $table_td[ $j ][ 'image' ][ 'id' ], '_wp_attachment_image_alt', true ) );
|
||||
?>" style="width: <?php echo esc_attr( $table_td[ $j ][ 'image_size' ] ); ?>px"/><?php
|
||||
endif;
|
||||
?>
|
||||
</span>
|
||||
<?php
|
||||
endif; ?>
|
||||
</span>
|
||||
<?php
|
||||
elseif ( $table_td[ $j ][ 'content_type' ] === 'template' ) :
|
||||
$get_template = $frontend->get_builder_content( $table_td[ $j ][ 'template' ], true );
|
||||
|
||||
if ( ! empty( $get_template ) ) :
|
||||
echo $get_template; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
else : ?>
|
||||
<span><?php echo esc_html__( 'Template is not found', 'stratum' ); ?></span>
|
||||
<?php endif;
|
||||
else : ?>
|
||||
<div class="<?php echo esc_attr( $class . '__editor-content' ); ?>">
|
||||
<?php echo $table_td[ $j ][ 'editor' ]; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div><?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</td><?php
|
||||
endif;
|
||||
endfor;
|
||||
?>
|
||||
</tr><?php
|
||||
endfor; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
use Elementor\Utils;
|
||||
|
||||
extract( shortcode_atts( array(
|
||||
//Swiper
|
||||
'navigation' => 'both',
|
||||
'pagination_style' => 'bullets',
|
||||
'heading_typography_html_tag' => 'h3',
|
||||
'subtitle_typography_html_tag' => 'span',
|
||||
//--Swiper
|
||||
), $settings ) );
|
||||
|
||||
$class = 'stratum-testimonial-carousel';
|
||||
$slider_options = stratum_generate_swiper_options( $settings );
|
||||
|
||||
$heading_typography_html_tag = stratum_validate_heading_html_tag( $heading_typography_html_tag );
|
||||
$subtitle_typography_html_tag = stratum_validate_heading_html_tag( $subtitle_typography_html_tag );
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class ); ?>" data-slider-options="<?php echo esc_attr( json_encode( $slider_options ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>">
|
||||
<div class="swiper swiper-container stratum-main-swiper">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
foreach ( $settings[ 'slides' ] as $index => $item ) {
|
||||
|
||||
$current_item = 'elementor-repeater-item-' . $item[ '_id' ];?>
|
||||
<div class="swiper-slide <?php echo esc_attr( $current_item ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__wrapper" ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__container" ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__container-inner" ) ;?>">
|
||||
<div class="<?php echo esc_attr( $class . "__footer" ); ?>">
|
||||
<?php
|
||||
list( , $id ) = array_values( $item[ 'image' ] );
|
||||
|
||||
if ( ! empty( $item[ 'image' ][ 'url' ] ) ) {
|
||||
$url_placeholder = Utils::get_placeholder_image_src();
|
||||
$srcset = wp_get_attachment_image_srcset( $id, 'full' );
|
||||
$url = wp_get_attachment_image_url ( $id, 'full' );
|
||||
$src_url = empty( $url ) ? $url_placeholder : $url;
|
||||
?>
|
||||
<img src="<?php echo esc_url( $src_url ); ?>" class="<?php
|
||||
echo esc_attr( $class . '__image' ) . " wp-image-" . esc_attr( $id ) ?>" srcset="<?php
|
||||
echo $srcset; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>"/>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . "__content" ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . "__cite" );?> ">
|
||||
<<?php echo esc_html( $heading_typography_html_tag ); ?> class="<?php echo esc_attr( $class . "__heading" ); ?>">
|
||||
<?php echo esc_html( $item[ 'heading' ] ); ?>
|
||||
</<?php echo esc_html( $heading_typography_html_tag ); ?>>
|
||||
<<?php echo esc_html( $subtitle_typography_html_tag ); ?> class="<?php echo esc_attr( $class . "__subtitle" ); ?>">
|
||||
<?php echo esc_html( $item[ 'subtitle' ] ); ?>
|
||||
</<?php echo esc_html( $subtitle_typography_html_tag ); ?>>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . "__text" ); ?>">
|
||||
<?php echo esc_html( $item[ 'content' ] ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div><?php
|
||||
//swiper-wrapper
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'pagination' ) {
|
||||
if ( $pagination_style == 'scrollbar' ) { ?>
|
||||
<div class="swiper-scrollbar"></div>
|
||||
<?php } else { ?>
|
||||
<div class="swiper-pagination"></div>
|
||||
<?php }
|
||||
}?>
|
||||
</div><?php
|
||||
//swiper-container
|
||||
|
||||
if ( $navigation == 'both' || $navigation == 'arrows' ) { ?>
|
||||
<div class="stratum-swiper-button-prev"></div>
|
||||
<div class="stratum-swiper-button-next"></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
$class = 'stratum-vertical-timeline';
|
||||
|
||||
$alignment = $settings[ 'vertical_alignment' ];
|
||||
$this->add_render_attribute( 'widget', [
|
||||
'class' => [
|
||||
$class,
|
||||
$class . '--align-' . $alignment
|
||||
],
|
||||
'data-animation' => esc_attr( $settings[ 'animate_cards' ] )
|
||||
]);
|
||||
|
||||
$this->add_render_attribute( 'inner', [
|
||||
'class' => [
|
||||
$class . '-item__inner',
|
||||
$class . '-item__inner' . $this->_get_alignment( $settings, 'vertical' )
|
||||
]
|
||||
]);
|
||||
|
||||
$item_classes = [
|
||||
$class . '-item',
|
||||
$this->_get_alignment( $settings, 'horizontal' )
|
||||
];
|
||||
|
||||
$widget_classes = $this->get_render_attribute_string( 'widget' );
|
||||
$inner_classes = $this->get_render_attribute_string( 'inner' );
|
||||
|
||||
?>
|
||||
<div <?php echo $widget_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '__line' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '__line-progress' ); ?>"></div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '__list' ); ?>"><?php
|
||||
|
||||
foreach ( $settings[ 'image_content' ] as $index => $item ) {
|
||||
|
||||
$merge = array_merge( $item_classes, [ 'elementor-repeater-item-' . esc_attr( $item[ '_id' ] ) ] );
|
||||
$title_html_tag = stratum_validate_heading_html_tag( $settings[ 'title_tag' ] );
|
||||
|
||||
$this->add_render_attribute( 'item' . $index, [ 'class' => $merge ] );
|
||||
$item_class = $this->get_render_attribute_string( 'item' . $index );
|
||||
?>
|
||||
<div <?php echo $item_class; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div <?php echo $inner_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-inner' );?>">
|
||||
<?php
|
||||
/* #region Render image */
|
||||
if ( !empty( $item[ 'show_item_image' ] ) ) {
|
||||
echo $this->_get_timeline_image( $class, $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
/* #endregion */
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-content' );?>">
|
||||
<?php
|
||||
if ( ! empty( $item[ 'item_link' ][ 'url' ] ) ) {
|
||||
$this->add_link_attributes( 'url' . $index, $item[ 'item_link' ] ); ?>
|
||||
<a class="<?php echo esc_attr( $class . '-item__card-link' );?>" <?php
|
||||
echo $this->get_render_attribute_string( 'url' . $index ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>>
|
||||
<?php } ?>
|
||||
|
||||
<<?php echo esc_html($title_html_tag); ?> class="<?php echo esc_attr( $class . '-item__card-title' );?>">
|
||||
<?php echo esc_html( $item[ 'item_title' ] ); ?>
|
||||
</<?php echo esc_html($title_html_tag); ?>>
|
||||
|
||||
<?php
|
||||
if ( ! empty( $item[ 'item_link' ][ 'url' ] ) ) { ?>
|
||||
</a>
|
||||
<?php }
|
||||
|
||||
if ( $item[ 'item_description_type' ] === 'default' ) { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-description' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_description' ] ); ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-description' ); ?>">
|
||||
<?php echo wp_kses_post( $item[ 'item_description_editor' ] ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="<?php echo esc_attr( $class . '-item__card-arrow' ); ?>"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '-item__point' ); ?>">
|
||||
<?php
|
||||
echo $this->_generate_point_content( $class, $item, $index ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta' ); ?>">
|
||||
<div class="<?php echo esc_attr( $class . '-item__meta-content' ); ?>">
|
||||
<?php echo esc_html( $item[ 'item_meta' ] ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum\Managers;
|
||||
|
||||
use Stratum\String_Encryption;
|
||||
|
||||
class Token_Manager {
|
||||
|
||||
public function __construct() {
|
||||
// Deactivation hook.
|
||||
register_deactivation_hook( STRATUM_PLUGIN_FILE, [ $this, 'clear_scheduled_event' ] );
|
||||
|
||||
// Action hook to execute when the event is run
|
||||
add_action( 'stratum_refresh_instagram_token', [ $this, 'refresh_instagram_token' ] );
|
||||
add_filter( 'cron_schedules', [ $this , 'time_scheduled_event' ] );
|
||||
|
||||
add_action( 'update_option', [ $this, 'update_option' ], 10, 3 );
|
||||
add_action( 'admin_init', [ $this, 'error_message' ] );
|
||||
}
|
||||
|
||||
public function time_scheduled_event( $schedules ) {
|
||||
|
||||
if ( ! isset( $schedules[ 'two_weeks' ] ) ) {
|
||||
/*
|
||||
* https://developers.facebook.com/docs/instagram-basic-display-api/guides/long-lived-access-tokens/
|
||||
*/
|
||||
$schedules[ 'two_weeks' ] = [
|
||||
'interval' => WEEK_IN_SECONDS * 2,
|
||||
'display' => 'Once in Two Weeks'
|
||||
];
|
||||
}
|
||||
|
||||
return $schedules;
|
||||
}
|
||||
|
||||
public function schedule_token_refresh_event() {
|
||||
if ( ! wp_next_scheduled( 'stratum_refresh_instagram_token' ) ) {
|
||||
wp_schedule_event( time(), 'two_weeks', 'stratum_refresh_instagram_token' );
|
||||
}
|
||||
}
|
||||
|
||||
public function update_option( $option_name, $old_value, $value ) {
|
||||
if ( $option_name === 'stratum_api' ) {
|
||||
delete_option( 'stratum_instagram_token_cron_error_message' );
|
||||
|
||||
if ( $value === '' ) {
|
||||
$this->clear_scheduled_event();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function clear_scheduled_event() {
|
||||
$timestamp = wp_next_scheduled( 'stratum_refresh_instagram_token' );
|
||||
|
||||
if ( $timestamp ) {
|
||||
wp_unschedule_event( $timestamp, 'stratum_refresh_instagram_token' );
|
||||
}
|
||||
}
|
||||
|
||||
public function refresh_instagram_token() {
|
||||
|
||||
$encryption = new String_Encryption();
|
||||
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$instagram_access_token = isset( $stratum_api['instagram_access_token'] ) ? $encryption->decrypt( $stratum_api['instagram_access_token'] ) : '';
|
||||
|
||||
if ( ! empty( $instagram_access_token ) ) {
|
||||
$api_req = 'https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=' . $instagram_access_token;
|
||||
$response = wp_remote_get( $api_req );
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
update_option( 'stratum_instagram_token_cron_error_message', $response->get_error_message() );
|
||||
} else {
|
||||
$response_body = json_decode( wp_remote_retrieve_body( $response ), false );
|
||||
|
||||
if ( $response_body && json_last_error() === JSON_ERROR_NONE ) {
|
||||
if ( $response_body->error ) {
|
||||
update_option( 'stratum_instagram_token_cron_error_message', $response_body->error->message );
|
||||
} else {
|
||||
delete_option( 'stratum_instagram_token_cron_error_message' );
|
||||
|
||||
if ( ! empty( $response_body->access_token ) ) {
|
||||
// Update token
|
||||
$stratum_api[ 'instagram_access_token' ] = $encryption->encrypt( $response_body->access_token );
|
||||
update_option( 'stratum_api', $stratum_api );
|
||||
// Delete cache data
|
||||
delete_transient( 'stratum_instagram_response_data' );
|
||||
// Schedule token refresh
|
||||
$this->schedule_token_refresh_event();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
update_option( 'stratum_instagram_token_cron_error_message', __( 'Error in json_decode.', 'stratum' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function stratum_instagram_notice_token_error() {
|
||||
$instagram_token_error_message = get_option( 'stratum_instagram_token_cron_error_message' );
|
||||
|
||||
if ( ! empty( $instagram_token_error_message ) ) {
|
||||
?>
|
||||
<div class="notice notice-error">
|
||||
<p>
|
||||
<?php
|
||||
echo esc_html( sprintf(
|
||||
//translators: %s is an error message
|
||||
__( 'Update Instagram Token. Error: %s', 'stratum' ),
|
||||
$instagram_token_error_message
|
||||
) );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
public function error_message() {
|
||||
global $pagenow;
|
||||
|
||||
if ( $pagenow && $pagenow == 'admin.php' && current_user_can( 'manage_options' ) ) {
|
||||
if ( get_option( 'stratum_instagram_token_cron_error_message' ) !== '' ) {
|
||||
add_action( 'admin_notices', [ $this, 'stratum_instagram_notice_token_error' ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Load translations from the MO file.
|
||||
*/
|
||||
function stratum_load_textdomain() {
|
||||
load_plugin_textdomain( 'stratum', false, plugin_basename( STRATUM_PLUGIN_DIR ) . '/languages/' );
|
||||
}
|
||||
|
||||
add_action( 'plugins_loaded', 'stratum_load_textdomain' );
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Version_Control
|
||||
{
|
||||
/** @var string */
|
||||
protected $plugin_version = '';
|
||||
|
||||
/** @var string */
|
||||
protected $dbVersion = '';
|
||||
|
||||
/** @var bool */
|
||||
protected $needUpgrade = false;
|
||||
|
||||
public function __construct(){
|
||||
$settings = Settings::get_instance();
|
||||
|
||||
$this->plugin_version = $settings->getVersion();
|
||||
|
||||
$this->checkVersion();
|
||||
$this->addActions();
|
||||
}
|
||||
|
||||
protected function checkVersion()
|
||||
{
|
||||
$this->dbVersion = $this->getCurrentDatabaseVersion();
|
||||
|
||||
if (version_compare($this->plugin_version, $this->dbVersion, '>')) {
|
||||
$this->needUpgrade = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected function addActions()
|
||||
{
|
||||
if ($this->needUpgrade) {
|
||||
add_action('init', [$this, 'upgrade']);
|
||||
}
|
||||
}
|
||||
|
||||
public function upgrade()
|
||||
{
|
||||
// Nothing to do at the moment
|
||||
$this->afterUpgrade();
|
||||
}
|
||||
|
||||
protected function afterUpgrade()
|
||||
{
|
||||
$this->setCurrentDatabaseVersion($this->plugin_version);
|
||||
|
||||
if (version_compare($this->plugin_version, $this->dbVersion, '!=')) {
|
||||
$this->addVersionToHistory($this->plugin_version);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCurrentDatabaseVersion()
|
||||
{
|
||||
return get_option('stratum_db_version', '0.0.0');
|
||||
}
|
||||
|
||||
protected function setCurrentDatabaseVersion($version)
|
||||
{
|
||||
update_option('stratum_db_version', $version);
|
||||
}
|
||||
|
||||
protected function addVersionToHistory($version)
|
||||
{
|
||||
$versionHistory = get_option('stratum_db_version_history', []);
|
||||
|
||||
if (!in_array($version, $versionHistory)) {
|
||||
$versionHistory[] = $version;
|
||||
update_option('stratum_db_version_history', $versionHistory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
namespace Stratum\Managers;
|
||||
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
/**
|
||||
* Class WidgetsManager
|
||||
* @package Stratum
|
||||
*/
|
||||
class Widgets_Manager {
|
||||
|
||||
private $prefix;
|
||||
|
||||
/**
|
||||
* WidgetsManager constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
$settings = \Stratum\Settings::get_instance();
|
||||
|
||||
$this->prefix = $settings->getPrefix();
|
||||
|
||||
add_action( 'elementor/widgets/register', [ $this, 'register_widgets' ], 12 );
|
||||
add_action( 'elementor/elements/categories_registered', [ $this, 'register_widgets_categories' ] );
|
||||
|
||||
$this->register_ajax_templates();
|
||||
}
|
||||
|
||||
//Group element under Theme slug
|
||||
public function register_widgets_categories() {
|
||||
Plugin::instance()->elements_manager->add_category(
|
||||
'stratum-widgets',
|
||||
[
|
||||
'title' => esc_html__( 'Stratum Widgets', 'stratum' ),
|
||||
'icon' => 'font'
|
||||
],
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
public function unregister_standart_widgets() {
|
||||
Plugin::instance()->widgets_manager->unregister( 'button' );
|
||||
}
|
||||
|
||||
public function register_widgets() {
|
||||
|
||||
require_once stratum_get_plugin_path( '/includes/stratum-widget-base.php' );
|
||||
|
||||
if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
|
||||
if ( class_exists( 'Elementor\Plugin' ) ) {
|
||||
if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
|
||||
$elementor = Plugin::instance();
|
||||
if ( isset( $elementor->widgets_manager ) ) {
|
||||
if ( method_exists( $elementor->widgets_manager, 'register' ) ) {
|
||||
|
||||
//Files widgets list
|
||||
$widgets_list = [];
|
||||
|
||||
$stratum_get_widgets = get_option( 'stratum_widgets' );
|
||||
|
||||
if ( empty( $stratum_get_widgets ) ) {
|
||||
//Get all files
|
||||
if ( $handle = opendir( stratum_get_plugin_path( '/includes/widgets/' ) ) ) {
|
||||
while ( ( $file = readdir( $handle ) ) !== false ) {
|
||||
if ( $file != "." && $file != ".." ) {
|
||||
$widgets_list[] = str_replace( ".php", '', $file );
|
||||
}
|
||||
}
|
||||
closedir( $handle );
|
||||
}
|
||||
} else {
|
||||
foreach ( $stratum_get_widgets as $widget_name => $enabled ) {
|
||||
if ( $enabled == 'on' ) {
|
||||
$widgets_list[] = $widget_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($widgets_list as $key => $widget_name) {
|
||||
$path = stratum_get_plugin_path( '/includes/widgets/' . $widget_name . '.php' );
|
||||
|
||||
if ( file_exists( $path ) ) {
|
||||
require_once( $path );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function register_ajax_templates() {
|
||||
if ( class_exists( 'Elementor\Plugin' ) ) {
|
||||
if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
|
||||
$widgets_list = [];
|
||||
$stratum_get_widgets = get_option( 'stratum_widgets' );
|
||||
|
||||
if ( empty( $stratum_get_widgets ) ) {
|
||||
//Get all files
|
||||
if ( $handle = opendir( stratum_get_plugin_path( '/includes/widgets/' ) ) ) {
|
||||
while ( ( $file = readdir( $handle ) ) !== false ) {
|
||||
if ( $file != "." && $file != ".." ) {
|
||||
$widgets_list[] = str_replace( ".php", '', $file );
|
||||
}
|
||||
}
|
||||
closedir( $handle );
|
||||
}
|
||||
} else {
|
||||
foreach ( $stratum_get_widgets as $widget_name => $enabled ) {
|
||||
if ( $enabled == 'on' ) {
|
||||
$widgets_list[] = $widget_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $widgets_list as $key => $widget_name ) {
|
||||
$path = stratum_get_plugin_path( '/includes/ajax-templates/' . $widget_name . '.php' );
|
||||
|
||||
if ( file_exists( $path ) ) {
|
||||
require_once( $path );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,975 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Advanced_Accordion
|
||||
* Name: Advanced Accordion
|
||||
* Slug: advanced-accordion
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Core\Base\Document;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
use Stratum\Managers\Ajax_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Advanced_Accordion extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'advanced-accordion';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Advanced Accordion', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [ 'accordion', 'content', 'template' ];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-advanced-accordion';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$background_color = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color']) ? get_option( 'stratum_style' )['background_color'] : '') : '#71d7f7';
|
||||
$background_color_active = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_active']) ? get_option( 'stratum_style' )['background_color_active'] : '') : '#0097c6';
|
||||
$background_color_hover = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_hover']) ? get_option( 'stratum_style' )['background_color_hover'] : '') : '#008fbc';
|
||||
|
||||
$document_types = Plugin::instance()->documents->get_document_types( [
|
||||
'show_in_library' => true,
|
||||
] );
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_type',
|
||||
[
|
||||
'label' => esc_html__('Accordion Type', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'accordion',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'accordion' => esc_html__('Accordion', 'stratum'),
|
||||
'toggle' => esc_html__('Toggle', 'stratum'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_collapsible',
|
||||
[
|
||||
'label' => esc_html__( 'Collapsible', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'condition' => [
|
||||
'accordion_type' => 'accordion'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_interactivity',
|
||||
[
|
||||
'label' => esc_html__( 'Interactivity', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'click',
|
||||
'options' => [
|
||||
'click' => esc_html__( 'Click', 'stratum' ),
|
||||
'mouseenter' => esc_html__( 'Hover', 'stratum' )
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet.', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->start_controls_tabs( 'title_icon_styles' );
|
||||
|
||||
$repeater->start_controls_tab(
|
||||
'title_icon_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->start_controls_tab(
|
||||
'title_icon_active_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_icon_active',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->end_controls_tabs();
|
||||
|
||||
$repeater->add_control(
|
||||
'content_type',
|
||||
[
|
||||
'label' => esc_html__('Content Type', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'text',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'text' => esc_html__('Text', 'stratum'),
|
||||
'template' => esc_html__('Template', 'stratum'),
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'text',
|
||||
[
|
||||
'label' => esc_html__( 'Text', 'stratum' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_type' => 'text'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'accordion_template',
|
||||
[
|
||||
'label' => esc_html__('Template', 'stratum'),
|
||||
'type' => Stratum_AJAX_Control::QUERY,
|
||||
'label_block' => true,
|
||||
'multiple' => false,
|
||||
'ajax_route' => 'stratum_get_elementor_templates',
|
||||
'autocomplete' => [
|
||||
'object' => 'library_template',
|
||||
'query' => [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => Document::TYPE_META_KEY,
|
||||
'value' => array_keys( $document_types ),
|
||||
'compare' => 'IN',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'options' => Ajax_Manager::stratum_get_elementor_templates(),
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
'description' => esc_html__( 'Here you can see sections you saved as templates.', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'manage_templates',
|
||||
[
|
||||
'label' => esc_html__( 'Manage Templates', 'stratum' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::BUTTON,
|
||||
'button_type' => 'success',
|
||||
'text' => esc_html__( 'Library', 'stratum' ),
|
||||
'event' => 'stratum:OpenTemplatesLibrary',
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'active',
|
||||
[
|
||||
'label' => esc_html__( 'Unfolded by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'accordion_items',
|
||||
[
|
||||
'label' => esc_html__( 'Accordion items', 'stratum' ),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ title }}}',
|
||||
'show_label' => true,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'active' => 'yes'
|
||||
],
|
||||
[
|
||||
'text' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'active' => 'no'
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'General Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'equal_height',
|
||||
[
|
||||
'label' => esc_html__( 'Equal container height', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'accordion_type' => 'accordion'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing between items', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 1,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'accordion_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Items Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'accordion_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Items Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'accordion_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'accordion_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'accordion_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'accordion_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Expand icon style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_position',
|
||||
[
|
||||
'label' => esc_html__( 'Icon position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'right',
|
||||
'prefix_class' => 'stratum-advanced-accordion-icons-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 16,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon' => 'font-size: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}.stratum-advanced-accordion-icons-position-left .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}}.stratum-advanced-accordion-icons-position-right .stratum-advanced-accordion .stratum-advanced-accordion__expand-icon' => 'margin-left: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'expand_icon_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'expand_icon_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__expand-icon .normal' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-chevron-right',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'expand_icon_active_tab',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_active_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__expand-icon .active' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_active',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-chevron-down',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'expand_icon_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expand_icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header:hover .stratum-advanced-accordion__expand-icon span' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_header',
|
||||
[
|
||||
'label' => esc_html__( 'Header style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_align',
|
||||
[
|
||||
'label' => esc_html__( 'Title Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'header_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'header_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'header_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 16,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title-icon i' => 'font-size: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__title-icon' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'header_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'header_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'header_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'header_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'header_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'header_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__title-icon .normal' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_header_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_header_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__item-header' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'active_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_active_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header .stratum-advanced-accordion__title-icon .active' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_header_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item.active-accordion .stratum-advanced-accordion__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_header_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_active,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item.active-accordion .stratum-advanced-accordion__item-header' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'header_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'head_icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-header:hover .stratum-advanced-accordion__title-icon span' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_header_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__item-header:hover .stratum-advanced-accordion__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_header_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_hover,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item .stratum-advanced-accordion__item-header:hover' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-content .stratum-advanced-accordion__text' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'content_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-content .stratum-advanced-accordion__text',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'content_background',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_background_overlay',
|
||||
[
|
||||
'label' => esc_html__( 'Background Overlay', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-content-overlay' => 'background-color: {{VALUE}};'
|
||||
],
|
||||
'condition' => [
|
||||
'content_background_image[id]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'render_type' => 'template',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'render_type' => 'template',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'content_border',
|
||||
'separator' => 'before',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper',
|
||||
'render_type' => 'template',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'content_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-accordion .stratum-advanced-accordion__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Advanced_Accordion() );
|
||||
@@ -0,0 +1,800 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Advanced_Google_Map
|
||||
* Name: Advanced Google Map
|
||||
* Slug: advanced-google-map
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Advanced_Google_Map extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'advanced-google-map';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Advanced Google Map', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-advanced-google-map';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'google-map-api',
|
||||
'google-map-styles'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'general_settings',
|
||||
[
|
||||
'label' => esc_html__( 'General Settings', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_type_setup',
|
||||
[
|
||||
'label' => esc_html__( 'Google Map Type', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'single',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'single' => esc_html__( 'Single', 'stratum' ),
|
||||
'multiple' => esc_html__( 'Multiple Marker', 'stratum' )
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'interaction',
|
||||
[
|
||||
'label' => esc_html__( 'Zoom & Pan Interaction', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'cooperative',
|
||||
'label_block' => false,
|
||||
'separator' => 'after',
|
||||
'description' => esc_html__( 'These options are applied on frontend only.', 'stratum' ),
|
||||
'options' => [
|
||||
'cooperative' => esc_html__( 'Prevent zoom on page scroll', 'stratum' ),
|
||||
'greedy' => esc_html__( 'Enable zoom and pan', 'stratum' ),
|
||||
'none' => esc_html__( ' Disable zoom and pan' , 'stratum' )
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'zoom_level',
|
||||
[
|
||||
'label' => esc_html__( 'Zoom Level', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 2,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 22
|
||||
]
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_lat',
|
||||
[
|
||||
'label' => esc_html__( 'Center Latitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => false,
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true,
|
||||
'default' => esc_html__( '48.208174', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_lng',
|
||||
[
|
||||
'label' => esc_html__( 'Center Longitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => false,
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true,
|
||||
'default' => esc_html__( '16.373819', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Map Marker Settings Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Map Settings (With Marker only for single)
|
||||
*/
|
||||
$controls->start_controls_section(
|
||||
'map_marker_section',
|
||||
[
|
||||
'label' => esc_html__( 'Map Marker Settings', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Marker', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_type_setup',
|
||||
[
|
||||
'label' => esc_html__( 'Address Type', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'address' => [
|
||||
'title' => esc_html__( 'Address', 'stratum' ),
|
||||
'icon' => 'fa fa-map'
|
||||
],
|
||||
'coordinates' => [
|
||||
'title' => esc_html__( 'Coordinates', 'stratum' ),
|
||||
'icon' => 'fa fa-map-marker'
|
||||
]
|
||||
],
|
||||
'default' => 'coordinates',
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_geo_address',
|
||||
[
|
||||
'label' => esc_html__( 'Geo Address', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Wien, Austria', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single'],
|
||||
'marker_type_setup' => ['address']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_lat',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Latitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '48.208174', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single'],
|
||||
'marker_type_setup' => ['coordinates']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_lng',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Longitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '16.373819', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single'],
|
||||
'marker_type_setup' => ['coordinates']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'is_open_popup',
|
||||
[
|
||||
'label' => esc_html__( 'Opened by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'popup_max_width',
|
||||
[
|
||||
'label' => esc_html__( 'Popup Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'label_block' => false,
|
||||
'default' => 250,
|
||||
'condition' => [
|
||||
'map_type_setup' => ['single']
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'use_custom_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Use Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes'
|
||||
],
|
||||
'default' => [ 'url' => '' ],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_icon_width',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'marker_icon_height',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/**
|
||||
* Map Settings (With Markers only for Multiple)
|
||||
*/
|
||||
$controls->start_controls_section(
|
||||
'map_markers_section',
|
||||
[
|
||||
'label' => esc_html__( 'Map Marker Settings', 'stratum' ),
|
||||
'condition' => [
|
||||
'map_type_setup' => ['multiple']
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater = new Repeater();
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Marker', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_lat',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Latitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '48.208174', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_lng',
|
||||
[
|
||||
'label' => esc_html__( 'Marker Longitude', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( '16.373819', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'is_open_popup',
|
||||
[
|
||||
'label' => esc_html__( 'Opened by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'popup_max_width',
|
||||
[
|
||||
'label' => esc_html__( 'Popup Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'label_block' => false,
|
||||
'default' => 250
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'use_custom_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Use Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes'
|
||||
],
|
||||
'default' => [ 'url' => '' ]
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_icon_width',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$markersRepeater->add_control(
|
||||
'marker_icon_height',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 32,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 150
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'use_custom_icon' => 'yes',
|
||||
'marker_icon[url]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'markers',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '<i class="fa fa-map-marker" aria-hidden="true"></i> {{{ marker_title }}}',
|
||||
'default' => [
|
||||
[ 'marker_title' => esc_html__( 'Marker', 'stratum' ) ]
|
||||
],
|
||||
'item_actions' => [ 'sort' => false ],
|
||||
'fields' => $markersRepeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'map_controls',
|
||||
[
|
||||
'label' => esc_html__( 'Map Controls', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'street_view_control',
|
||||
[
|
||||
'label' => esc_html__( 'Street View Controls', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_type_control',
|
||||
[
|
||||
'label' => esc_html__( 'Map Type Control', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'zoom_control',
|
||||
[
|
||||
'label' => esc_html__( 'Zoom Control', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'fullscreen_control',
|
||||
[
|
||||
'label' => esc_html__( 'Fullscreen Control', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Map Marker Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_map_style_controls',
|
||||
[
|
||||
'label' => esc_html__( 'General Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'map_height',
|
||||
[
|
||||
'label' => esc_html__( 'Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 480,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1400,
|
||||
'step' => 10
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-google-map__container' => 'height: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'render_type' => 'ui'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'map_theme',
|
||||
[
|
||||
'label' => esc_html__( 'Map Theme', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_theme_source',
|
||||
[
|
||||
'label' => esc_html__( 'Theme Source', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'standard' => [
|
||||
'title' => esc_html__( 'Google Standard', 'stratum' ),
|
||||
'icon' => 'fa fa-map'
|
||||
],
|
||||
'snazzymaps' => [
|
||||
'title' => esc_html__( 'Snazzy Maps', 'stratum' ),
|
||||
'icon' => 'fa fa-map-marker'
|
||||
],
|
||||
'custom' => [
|
||||
'title' => esc_html__( 'Custom', 'stratum' ),
|
||||
'icon' => 'fa fa-edit'
|
||||
]
|
||||
],
|
||||
'default' => 'standard',
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_standards_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Google Themes', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'standard',
|
||||
'options' => [
|
||||
'standard' => esc_html__( 'Standard' , 'stratum' ),
|
||||
'silver' => esc_html__( 'Silver' , 'stratum' ),
|
||||
'retro' => esc_html__( 'Retro' , 'stratum' ),
|
||||
'dark' => esc_html__( 'Dark' , 'stratum' ),
|
||||
'night' => esc_html__( 'Night' , 'stratum' ),
|
||||
'aubergine' => esc_html__( 'Aubergine' , 'stratum' )
|
||||
],
|
||||
'description' => sprintf( '<a href="https://mapstyle.withgoogle.com/" target="_blank">%1$s</a> %2$s', esc_html__( 'Click here', 'stratum' ), esc_html__( 'to generate your own theme and use JSON within a Custom style field.', 'stratum' ) ),
|
||||
'condition' => [
|
||||
'map_theme_source' => 'standard'
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_snazzy_styles',
|
||||
[
|
||||
'label' => esc_html__( 'Snazzy Maps Themes', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'label_block' => true,
|
||||
'default' => 'blueWater',
|
||||
'options' => [
|
||||
'blueWater' => esc_html__( 'Blue Water' , 'stratum' ),
|
||||
'ultraLight' => esc_html__( 'Ultra Light' , 'stratum' ),
|
||||
'silverFox' => esc_html__( 'Silver Fox' , 'stratum' ),
|
||||
'shadesOfGrey' => esc_html__( 'Shades of Grey', 'stratum' ),
|
||||
'noLabels' => esc_html__( 'No Labels' , 'stratum' ),
|
||||
'trekWild' => esc_html__( 'Trek Wild' , 'stratum' ),
|
||||
'vintage' => esc_html__( 'Vintage' , 'stratum' ),
|
||||
'wireframe' => esc_html__( 'Wireframe' , 'stratum' ),
|
||||
'lightDream' => esc_html__( 'Light Dream' , 'stratum' )
|
||||
],
|
||||
'description' => sprintf( '<a href="https://snazzymaps.com/explore" target="_blank">%1$s</a> %2$s', esc_html__( 'Click here', 'stratum' ), esc_html__( 'to explore more themes and use JSON within a custom style field.', 'stratum' ) ),
|
||||
'condition' => [
|
||||
'map_theme_source'=> 'snazzymaps'
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'map_custom_style',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Style', 'stratum' ),
|
||||
'description' => sprintf( '<a href="https://mapstyle.withgoogle.com/" target="_blank">%1$s</a> %2$s', esc_html__( 'Click here', 'stratum' ), esc_html__( 'to get JSON style code to style your map', 'stratum' ) ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'condition' => [
|
||||
'map_theme_source' => 'custom'
|
||||
],
|
||||
'render_type' => 'none',
|
||||
'frontend_available' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
public function get_single_marker_option($marker) {
|
||||
$single_options = [
|
||||
'markerTitle' => $marker[ 'marker_title' ],
|
||||
'markerContent' => $marker[ 'marker_content' ],
|
||||
'popupMaxWidth' => $marker[ 'popup_max_width' ],
|
||||
'isOpenPopup' => !empty( $marker[ 'is_open_popup' ] ) ? true : false
|
||||
];
|
||||
if ( $marker[ 'use_custom_icon' ] ) {
|
||||
$custom_icon = [
|
||||
'markerIcon' => $marker[ 'marker_icon' ],
|
||||
'markerIconWidth' => $marker[ 'marker_icon_width' ],
|
||||
'markerIconHeight' => $marker[ 'marker_icon_height' ]
|
||||
];
|
||||
$single_options[ 'customIcon' ] = $custom_icon;
|
||||
}
|
||||
return $single_options;
|
||||
}
|
||||
|
||||
public function get_markers_options($settings) {
|
||||
$map_markers_amount = $settings[ 'map_type_setup' ];
|
||||
if ( $map_markers_amount == 'multiple' ) {
|
||||
|
||||
$markers_options = [];
|
||||
foreach ( $settings[ 'markers' ] as $marker ) {
|
||||
$marker_coords = [
|
||||
'markerLat' => $marker[ 'marker_lat' ],
|
||||
'markerLng' => $marker[ 'marker_lng' ]
|
||||
];
|
||||
|
||||
$marker_options = $this->get_single_marker_option( $marker );
|
||||
$markers_options []= array_merge( $marker_options, $marker_coords );
|
||||
}
|
||||
return $markers_options;
|
||||
} else {
|
||||
$marker_options = [];
|
||||
|
||||
$type_setup = $settings[ 'marker_type_setup' ];
|
||||
if ( $type_setup == 'coordinates' ) {
|
||||
|
||||
$marker_coords = [
|
||||
'markerLat' => $settings[ 'marker_lat' ],
|
||||
'markerLng' => $settings[ 'marker_lng' ]
|
||||
];
|
||||
|
||||
$marker_options []= array_merge( $marker_coords, $this->get_single_marker_option( $settings ) );
|
||||
} else {
|
||||
$geo = [ 'mapGeoAddress' => $settings[ 'map_geo_address' ] ];
|
||||
$marker_options []= array_merge( $geo, $this->get_single_marker_option( $settings ) );
|
||||
}
|
||||
return $marker_options;
|
||||
}
|
||||
}
|
||||
|
||||
public function set_map_theme_style($settings) {
|
||||
$theme_source = $settings[ 'map_theme_source' ];
|
||||
$standards_styles = $settings[ 'map_standards_styles' ];
|
||||
$snazzy_styles = $settings[ 'map_snazzy_styles' ];
|
||||
|
||||
if ( $theme_source == 'standard' ) {
|
||||
return $standards_styles;
|
||||
} else if ( $theme_source == 'snazzymaps' ) {
|
||||
return $snazzy_styles;
|
||||
} else {
|
||||
return json_decode(strip_tags(
|
||||
$settings[ 'map_custom_style' ]
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Advanced_Google_Map() );
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,999 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Advanced_Tabs
|
||||
* Name: Advanced Tabs
|
||||
* Slug: advanced-tabs
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Core\Base\Document;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
use Stratum\Managers\Ajax_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Advanced_Tabs extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'advanced-tabs';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Advanced Tabs', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_keywords() {
|
||||
return [ 'tabs', 'content', 'template' ];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-advanced-tabs';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$background_color = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color']) ? get_option( 'stratum_style' )['background_color'] : '') : '#71d7f7';
|
||||
$background_color_active = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_active']) ? get_option( 'stratum_style' )['background_color_active'] : '') : '#0097c6';
|
||||
$background_color_hover = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['background_color_hover']) ? get_option( 'stratum_style' )['background_color_hover'] : '') : '#008fbc';
|
||||
|
||||
$document_types = Plugin::instance()->documents->get_document_types( [
|
||||
'show_in_library' => true,
|
||||
] );
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_layout',
|
||||
[
|
||||
'label' => esc_html__('Tabs Layout', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'horizontal',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'horizontal' => esc_html__('Horizontal', 'stratum'),
|
||||
'vertical' => esc_html__('Vertical', 'stratum'),
|
||||
'icon_box' => esc_html__('Icon Box', 'stratum'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_interactivity',
|
||||
[
|
||||
'label' => esc_html__( 'Interactivity', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'click',
|
||||
'options' => [
|
||||
'click' => esc_html__( 'Click', 'stratum' ),
|
||||
'mouseenter' => esc_html__( 'Hover', 'stratum' )
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Title', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICONS,
|
||||
'default' => [
|
||||
'value' => 'fas fa-home',
|
||||
'library' => 'solid',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'content_type',
|
||||
[
|
||||
'label' => esc_html__('Content Type', 'stratum'),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'text',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'text' => esc_html__('Text', 'stratum'),
|
||||
'template' => esc_html__('Template', 'stratum'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_text',
|
||||
[
|
||||
'label' => esc_html__( 'Text', 'stratum' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_type' => 'text'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tab_template',
|
||||
[
|
||||
'label' => esc_html__('Template', 'stratum'),
|
||||
'type' => Stratum_AJAX_Control::QUERY,
|
||||
'label_block' => true,
|
||||
'multiple' => false,
|
||||
'ajax_route' => 'stratum_get_elementor_templates',
|
||||
'autocomplete' => [
|
||||
'object' => 'library_template',
|
||||
'query' => [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => Document::TYPE_META_KEY,
|
||||
'value' => array_keys( $document_types ),
|
||||
'compare' => 'IN',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'options' => Ajax_Manager::stratum_get_elementor_templates(),
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
'description' => esc_html__( 'Here you can see sections you saved as templates.', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'manage_templates',
|
||||
[
|
||||
'label' => esc_html__( 'Manage Templates', 'stratum' ),
|
||||
'label_block' => false,
|
||||
'type' => Controls_Manager::BUTTON,
|
||||
'button_type' => 'success',
|
||||
'text' => esc_html__( 'Library', 'stratum' ),
|
||||
'event' => 'stratum:OpenTemplatesLibrary',
|
||||
'condition' => [
|
||||
'content_type' => 'template'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'active',
|
||||
[
|
||||
'label' => esc_html__( 'Active by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_items',
|
||||
[
|
||||
'label' => esc_html__( 'Tab items', 'stratum' ),
|
||||
'title_field' => '<i class="{{ tab_icon.value }}" aria-hidden="true"></i> {{{ tab_title }}}',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'fields' => $repeater->get_controls(),
|
||||
'show_label' => true,
|
||||
'default' => [
|
||||
[
|
||||
'text' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 )
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_navigation_panel',
|
||||
[
|
||||
'label' => esc_html__( 'Navigation Panel Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_width',
|
||||
[
|
||||
'label' => esc_html__( 'Navigation Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
],
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => '15',
|
||||
'unit' => '%',
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-vertical .stratum-advanced-tabs__navigation' => 'min-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => ['vertical']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tabs_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing between tabs', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-horizontal .stratum-advanced-tabs__navigation-item:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-vertical .stratum-advanced-tabs__navigation-item:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-tabs.tabs-layout-icon_box .stratum-advanced-tabs__navigation-item:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_postion_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'top',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-horizontal-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'equal_height' => 'yes',
|
||||
'tabs_layout' => ['horizontal', 'icon_box']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_postion_vertical',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-vertical-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => 'vertical'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_align_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-horizontal-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
'stretch' => [
|
||||
'title' => esc_html__( 'Stretch', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-stretch',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => ['horizontal', 'icon_box']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_align_vertical',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'top',
|
||||
'prefix_class' => 'stratum-advanced-tabs-nav-vertical-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'middle' => [
|
||||
'title' => esc_html__( 'Middle', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
'stretch' => [
|
||||
'title' => esc_html__( 'Stretch', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-stretch',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => 'vertical'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'nav_panel_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_panel_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'nav_panel_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'nav_panel_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'nav_panel_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_navigation_items',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'nav_items_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__title',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_items_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_items_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'nav_items_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'nav_items_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'nav_items_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'nav_items_shadow',
|
||||
'separator' => 'before',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'nav_items_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'nav_items_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_nav_items_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_nav_items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'active_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_nav_items_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item.active-nav' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_active_nav_items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_active,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item.active-nav' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'nav_items_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_nav_items_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item:hover' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_nav_items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $background_color_hover,
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item:hover' => 'background-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_position_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Icon position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'prefix_class' => 'stratum-advanced-tabs-icons-horizontal-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => ['horizontal', 'vertical']
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_position_vertical',
|
||||
[
|
||||
'label' => esc_html__( 'Icon position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'top',
|
||||
'prefix_class' => 'stratum-advanced-tabs-icons-vertical-position-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'tabs_layout' => 'icon_box'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 16,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__icon i' => 'font-size: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__icon svg' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-horizontal-position-left .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-right: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-horizontal-position-right .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-left: {{SIZE}}{{UNIT}}',
|
||||
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-vertical-position-top .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
'{{WRAPPER}}.stratum-advanced-tabs-icons-vertical-position-bottom .stratum-advanced-tabs .stratum-advanced-tabs__icon' => 'margin-top: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'icons_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icon_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item .stratum-advanced-tabs__icon' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icon_active',
|
||||
array(
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_active_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item.active-nav .stratum-advanced-tabs__icon' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icon_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__navigation-item:hover .stratum-advanced-tabs__icon' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None', 'stratum' ),
|
||||
'slide' => esc_html__( 'Slide', 'stratum' ),
|
||||
'fade' => esc_html__( 'Fade', 'stratum' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'equal_height',
|
||||
[
|
||||
'label' => esc_html__( 'Equal container height', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'custom_content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content-item .stratum-advanced-tabs__text' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'content_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content-item .stratum-advanced-tabs__text',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'content_background',
|
||||
'types' => ['classic', 'gradient'],
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_background_overlay',
|
||||
[
|
||||
'label' => esc_html__( 'Background Overlay', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content-overlay' => 'background-color: {{VALUE}};'
|
||||
],
|
||||
'condition' => [
|
||||
'content_background_image[id]!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'content_border',
|
||||
'separator' => 'before',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'condition' => [
|
||||
'content_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-advanced-tabs .stratum-advanced-tabs__content',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Advanced_Tabs() );
|
||||
@@ -0,0 +1,553 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Banner
|
||||
* Name: Banner
|
||||
* Slug: stratum-banner
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Banner extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'banner';
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Banner', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-banner';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
//Colors
|
||||
$theme_colors_first_color = '#080808';
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'background_type' => 'image'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes(),
|
||||
'condition' => [
|
||||
'background_type' => 'image'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$this->add_control(
|
||||
'hosted_url',
|
||||
[
|
||||
'label' => esc_html__( 'Choose File', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'media_type' => 'video',
|
||||
'condition' => [
|
||||
'background_type' => 'video'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_type',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Background Type', 'stratum' ),
|
||||
'default' => 'image',
|
||||
'options' => [
|
||||
'image' => esc_html__( 'Image', 'stratum' ),
|
||||
'video' => esc_html__( 'Video', 'stratum' )
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Title', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Paste URL or type to search', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'link_target',
|
||||
[
|
||||
'label' => esc_html__( 'Open link in new window', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => '_blank',
|
||||
'condition' => [
|
||||
'link!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'link_rel',
|
||||
[
|
||||
'label' => esc_html__( 'Add nofollow', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'nofollow',
|
||||
'condition' => [
|
||||
'link!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'height',
|
||||
[
|
||||
'label' => esc_html__( 'Banner Height', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper' => 'height: {{VALUE}}px;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'block_paddings',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner .stratum-banner__content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effect',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'aries',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None' , 'stratum' ),
|
||||
'aries' => esc_html__( 'Aries' , 'stratum' ),
|
||||
'taurus' => esc_html__( 'Taurus', 'stratum' ),
|
||||
'gemini' => esc_html__( 'Gemini', 'stratum' ),
|
||||
'cancer' => esc_html__( 'Cancer', 'stratum' ),
|
||||
'leo' => esc_html__( 'Leo' , 'stratum' ),
|
||||
'virgo' => esc_html__( 'Virgo' , 'stratum' )
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text_animation_effect',
|
||||
[
|
||||
'label' => esc_html__( 'Text Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'none',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None' , 'stratum' ),
|
||||
'opacity' => esc_html__( 'Fade In' , 'stratum' ),
|
||||
'opacity-top' => esc_html__( 'Fade In Up' , 'stratum' ),
|
||||
'opacity-bottom' => esc_html__( 'Fade In Down' , 'stratum' ),
|
||||
'opacity-left' => esc_html__( 'Fade In Left' , 'stratum' ),
|
||||
'opacity-right' => esc_html__( 'Fade In Right', 'stratum' ),
|
||||
'opacity-zoom-in' => esc_html__( 'Zoom In' , 'stratum' ),
|
||||
'opacity-zoom-out' => esc_html__( 'Zoom Out' , 'stratum' )
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_align',
|
||||
[
|
||||
'label' => esc_html__( 'Title Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner .stratum-banner__title' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-banner__title',
|
||||
'label' => esc_html__( 'Title Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'title!' => ''
|
||||
],
|
||||
'defaults' => [
|
||||
'html_tag' => 'h5',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_width',
|
||||
[
|
||||
'label' => esc_html__( 'Title Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__title' => 'max-width: {{VALUE}}px;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'text_align',
|
||||
[
|
||||
'label' => esc_html__( 'Text Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'None', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner .stratum-banner__text' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'subtitles_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-banner__text',
|
||||
'label' => esc_html__( 'Description Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'text!' => ''
|
||||
],
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'text_width',
|
||||
[
|
||||
'label' => esc_html__( 'Description Width', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__text' => 'max-width: {{VALUE}}px;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'block_horizontal_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Block Horizontal Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'flex-start',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__content-wrapper' => 'align-items: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'block_vertical_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Block Vertical Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'flex-end',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Middle', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__content-wrapper' => 'justify-content: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'banner_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'banner_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 0.35
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0,
|
||||
'step' => 0.01
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__overlay' => 'opacity: {{SIZE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_overlay_color',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $theme_colors_first_color,
|
||||
'value' => $theme_colors_first_color,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__overlay' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__text' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'banner_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 0.5
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0,
|
||||
'step' => 0.01
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__overlay' => 'opacity: {{SIZE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_overlay_color',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => $theme_colors_first_color,
|
||||
'value' => $theme_colors_first_color,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__overlay' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__title' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__content-wrapper:before' => 'border-color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-banner__wrapper .stratum-banner__content-wrapper:after' => 'border-color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-banner__wrapper:hover .stratum-banner__text' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Banner() );
|
||||
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Circle_Progress_Bar
|
||||
* Name: Circle progress bar
|
||||
* Slug: circle-progress-bar
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Circle_Progress_Bar extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'circle-progress-bar';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Circle Progress Bar', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [ 'donutty', 'waypoints' ];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-circle-progress-bar';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$first_color = !empty(get_option( 'stratum_style' )) ? (!empty(get_option( 'stratum_style' )['primary_color']) ? get_option( 'stratum_style' )['primary_color'] : '') : '#3878ff';
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'widget_align',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'prefix_class' => 'stratum-circle-progress-bar-align%s-',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text',
|
||||
[
|
||||
'label' => esc_html__( 'Text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Enter your title', 'stratum' ),
|
||||
'default' => esc_html__( 'Text', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'show_percents',
|
||||
'operator' => '!=',
|
||||
'value' => 'yes',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_percents',
|
||||
[
|
||||
'label' => esc_html__( 'Show percent', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'widget_width',
|
||||
[
|
||||
'label' => esc_html__( 'Width', 'stratum' ),
|
||||
"description" => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'render_type' => 'ui',
|
||||
'default' => [
|
||||
'size' => 150,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1000,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar__wrapper' => 'width: {{SIZE}}px',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'value',
|
||||
[
|
||||
'label' => esc_html__( 'Progress', 'stratum' ),
|
||||
'description' => esc_html__( 'In Percent (%)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => '%' ,
|
||||
'render_type' => 'template',
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 75,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'round',
|
||||
[
|
||||
'label' => esc_html__( 'Round Corners', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'circle',
|
||||
[
|
||||
'label' => esc_html__( 'Circle', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'padding',
|
||||
[
|
||||
'label' => esc_html__( 'Background Padding', 'stratum' ),
|
||||
"description" => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => '%' ,
|
||||
'render_type' => 'template',
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 4,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'thickness',
|
||||
[
|
||||
'label' => esc_html__( 'Line Thickness', 'stratum' ),
|
||||
"description" => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => '%' ,
|
||||
'render_type' => 'template',
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 10,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'text_style',
|
||||
'selector' => '{{WRAPPER}} .stratum-circle-progress-bar .donut-text, {{WRAPPER}} .stratum-circle-progress-bar__title',
|
||||
'label' => esc_html__( 'Text Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'tabs_color_style');
|
||||
$controls->start_controls_tab(
|
||||
'tab_color_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#000000',
|
||||
'default' => '#000000',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar .donut-text, {{WRAPPER}} .stratum-circle-progress-bar .stratum-circle-progress-bar__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'line_color',
|
||||
[
|
||||
'label' => esc_html__( 'Line Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => $first_color,
|
||||
'default' => $first_color,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar svg .donut-fill' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#4682b426',
|
||||
'default' => '#4682b426',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar svg .donut-bg' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'text_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#000000',
|
||||
'default' => '#000000',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar:hover .donut-text, {{WRAPPER}} .stratum-circle-progress-bar:hover .stratum-circle-progress-bar__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'line_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Line Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => $first_color,
|
||||
'default' => $first_color,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar:hover svg .donut-fill' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#4682b426',
|
||||
'default' => '#4682b426',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-circle-progress-bar:hover svg .donut-bg' => 'stroke: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
$this->render_widget( 'js' );
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Circle_Progress_Bar() );
|
||||
@@ -0,0 +1,666 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Content_Switcher
|
||||
* Name: Content Switcher
|
||||
* Slug: stratum-content-switcher
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Core\Base\Document;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
|
||||
use Stratum\Managers\Ajax_Manager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Content_Switcher extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'content-switcher';
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Content Switcher', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'eicon-dual-button';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets', 'switch', 'content' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$document_types = Plugin::instance()->documents->get_document_types( [
|
||||
'show_in_library' => true,
|
||||
] );
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_type',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'description' => esc_html__( '', 'stratum' ),
|
||||
'default' => 'multiple',
|
||||
'options' => [
|
||||
'multiple' => esc_html__( 'Multiple Tabs', 'stratum' ),
|
||||
'toggle' => esc_html__( 'Toggle Tabs', 'stratum' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_type_description',
|
||||
[
|
||||
'raw' => '<strong>' . __( 'Please note:', 'stratum' ) . '</strong> ' . __( 'This style applies to only first two tabs.', 'stratum' ),
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
|
||||
'render_type' => 'ui',
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => __( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => __( 'Annual', 'stratum' ),
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'content_template',
|
||||
[
|
||||
'label' => esc_html__( 'Template', 'stratum' ),
|
||||
'type' => Stratum_AJAX_Control::QUERY,
|
||||
'label_block' => true,
|
||||
'multiple' => false,
|
||||
'ajax_route' => 'stratum_get_elementor_templates',
|
||||
'autocomplete' => [
|
||||
'object' => 'library_template',
|
||||
'query' => [
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => Document::TYPE_META_KEY,
|
||||
'value' => array_keys( $document_types ),
|
||||
'compare' => 'IN',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'options' => Ajax_Manager::stratum_get_elementor_templates(),
|
||||
'description' => esc_html__( 'Here you can see sections you saved as templates.', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'active',
|
||||
[
|
||||
'label' => esc_html__( 'Unfolded by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_items',
|
||||
[
|
||||
'label' => esc_html__( 'Items', 'stratum' ),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ title }}}',
|
||||
'fields' => $repeater->get_controls(),
|
||||
'default' => [
|
||||
[
|
||||
'title' => esc_html__( 'Starter', 'stratum' ),
|
||||
'active' => 'yes'
|
||||
],
|
||||
[
|
||||
'title' => esc_html__( 'Advanced', 'stratum' ),
|
||||
'active' => 'no'
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'General Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Navigation Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher .stratum-content-switcher__nav' => 'justify-content: {{VALUE}};',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_items_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_items_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'right' => '20',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_content_brcolor_multiple',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_content_brcolor_toggle',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_items_shadow_multiple',
|
||||
'selector' => '{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-content',
|
||||
'fields_options' => [
|
||||
'box_shadow_type' => [
|
||||
'default' => 'yes',
|
||||
],
|
||||
'box_shadow' => [
|
||||
'default' => [
|
||||
'horizontal' => 0,
|
||||
'vertical' => 4,
|
||||
'blur' => 24,
|
||||
'spread' => 0,
|
||||
'color' => 'rgba(0,0,0,0.1)',
|
||||
],
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'content_items_shadow_toggle',
|
||||
'selector' => '{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__label',
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_tabs_style',
|
||||
[
|
||||
'label' => esc_html__( 'Tabs Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'tabs_items_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-content-switcher .stratum-content-switcher__nav-title',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_items_padding_multiple',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '12',
|
||||
'bottom' => '12',
|
||||
'left' => '23',
|
||||
'right' => '23',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_items_padding_toggle',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '0',
|
||||
'bottom' => '0',
|
||||
'left' => '15',
|
||||
'right' => '15',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'tabs_items_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'right' => '20',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-pill' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'tabs_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#22262C',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-button' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-item > .stratum-content-switcher__nav-title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_pill_bgcolor',
|
||||
[
|
||||
'label' => esc_html__( 'Pill Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#F74A00',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-pill' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-item:hover > .stratum-content-switcher__nav-button' => 'color: {{VALUE}}',
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-item:hover > .stratum-content-switcher__nav-title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_active',
|
||||
[
|
||||
'label' => esc_html__( 'Active', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color_active_multiple',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#FFFFFF',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-multiple .stratum-content-switcher__nav-item.is-active > .stratum-content-switcher__nav-button' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'multiple',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'tab_text_color_active_toggle',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#5D74DE',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__nav-item.is-active > .stratum-content-switcher__nav-title' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_switch_tabs_style',
|
||||
[
|
||||
'label' => esc_html__( 'Toggle Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'condition' => [
|
||||
'content_type' => 'toggle',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_container_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '6',
|
||||
'right' => '16',
|
||||
'bottom' => '6',
|
||||
'left' => '16',
|
||||
'unit' => 'px',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_size',
|
||||
[
|
||||
'label' => esc_html__( 'Checkbox Switcher Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 9,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle::before' => '--toggle-size: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_container_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Switcher Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
'unit' => 'px',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'switch_checkbox_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Checkbox Switcher Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'default' => [
|
||||
'size' => 50,
|
||||
'unit' => '%',
|
||||
],
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle::before' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'switch_checkbox_bgcolor',
|
||||
[
|
||||
'label' => esc_html__( 'Switcher Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#5D74DEA1',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'switch_checkbox_color',
|
||||
[
|
||||
'label' => esc_html__( 'Checkbox Switcher Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'default' => '#5D74DE',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher.is-toggle .stratum-content-switcher__toggle::before' => 'background: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content_style',
|
||||
[
|
||||
'label' => esc_html__( 'Content Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'default' => [
|
||||
'top' => '20',
|
||||
'bottom' => '20',
|
||||
'left' => '20',
|
||||
'right' => '20',
|
||||
'unit' => 'px'
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-content-switcher__item-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'fade',
|
||||
'options' => [
|
||||
'none' => esc_html__( 'None', 'stratum' ),
|
||||
'fade' => esc_html__( 'Fade', 'stratum' ),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
// PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Content_Switcher() );
|
||||
@@ -0,0 +1,582 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Counter
|
||||
* Name: Counter
|
||||
* Slug: stratum-countdown
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Core\Schemes;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
|
||||
class Countdown extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'countdown';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
$script_depends = [
|
||||
'jquery-plugin',
|
||||
'jquery-countdown'
|
||||
];
|
||||
|
||||
preg_match( '/^(.*)_/', get_locale(), $current_locale );
|
||||
$locale_prefix = isset( $current_locale[ 1 ] ) && $current_locale[ 1 ] !='en' ? $current_locale[ 1 ] : '';
|
||||
|
||||
if ( $locale_prefix != '' ) {
|
||||
$locale_path = 'vendors/jquery.countdown/localization/jquery.countdown-' . $locale_prefix . '.js';
|
||||
|
||||
if ( file_exists( stratum_get_plugin_path( $locale_path ) ) ) {
|
||||
$script_depends[] = 'jquery-countdown-' . $locale_prefix;
|
||||
}
|
||||
}
|
||||
|
||||
return $script_depends;
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Countdown', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-countdown';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'date_time',
|
||||
[
|
||||
'label' => esc_html__( 'Select Date', 'stratum' ),
|
||||
'type' => Controls_Manager::DATE_TIME,
|
||||
'default' => gmdate( 'Y-m-d H:i', strtotime( '+1 week' ) + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ),
|
||||
/* translators: %s: Time zone. */
|
||||
'description' => sprintf( esc_html__( 'Date set according to your timezone: %s.', 'stratum' ), Utils::get_timezone_string() ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_years',
|
||||
[
|
||||
'label' => esc_html__( 'Years', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_months',
|
||||
[
|
||||
'label' => esc_html__( 'Months', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_weeks',
|
||||
[
|
||||
'label' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_days',
|
||||
[
|
||||
'label' => esc_html__( 'Days', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_hours',
|
||||
[
|
||||
'label' => esc_html__( 'Hours', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_minutes',
|
||||
[
|
||||
'label' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_seconds',
|
||||
[
|
||||
'label' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'stratum_expire_actions',
|
||||
[
|
||||
'label' => esc_html__( 'Actions After Expire', 'stratum' ),
|
||||
'description' => sprintf( esc_html__( 'Redirect, hide or show custom message', 'stratum' ), Utils::get_timezone_string() ),
|
||||
'type' => Controls_Manager::SELECT2,
|
||||
'options' => [
|
||||
'redirect' => esc_html__( 'Redirect', 'stratum' ),
|
||||
'hide' => esc_html__( 'Hide', 'stratum' ),
|
||||
'message' => esc_html__( 'Show Message', 'stratum' ),
|
||||
],
|
||||
'label_block' => true,
|
||||
'separator' => 'before',
|
||||
'render_type' => 'none',
|
||||
'multiple' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'message_after_expire',
|
||||
[
|
||||
'label' => esc_html__( 'Message', 'stratum' ),
|
||||
'type' => Controls_Manager::WYSIWYG,
|
||||
'separator' => 'before',
|
||||
'render_type' => 'none',
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_expire_actions' => 'message',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'expire_redirect_url',
|
||||
[
|
||||
'label' => esc_html__( 'Redirect URL', 'stratum' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'separator' => 'before',
|
||||
'options' => false,
|
||||
'render_type' => 'none',
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_expire_actions' => 'redirect',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_labels',
|
||||
[
|
||||
'label' => esc_html__( 'Show Label', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'label_on' => esc_html__( 'Show', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Hide', 'stratum' ),
|
||||
'default' => 'yes',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'custom_labels',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Label', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_years',
|
||||
[
|
||||
'label' => esc_html__( 'Years', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Years', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Years', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_years' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_months',
|
||||
[
|
||||
'label' => esc_html__( 'Months', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Months', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Months', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_months' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_weeks',
|
||||
[
|
||||
'label' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Weeks', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_weeks' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_days',
|
||||
[
|
||||
'label' => esc_html__( 'Days', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Days', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Days', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_days' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_hours',
|
||||
[
|
||||
'label' => esc_html__( 'Hours', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Hours', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Hours', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_hours' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_minutes',
|
||||
[
|
||||
'label' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Minutes', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_minutes' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_seconds',
|
||||
[
|
||||
'label' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'placeholder' => esc_html__( 'Seconds', 'stratum' ),
|
||||
'condition' => [
|
||||
'show_labels!' => '',
|
||||
'custom_labels!' => '',
|
||||
'show_seconds' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'box_width',
|
||||
[
|
||||
'label' => esc_html__( 'Box Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 100,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 300,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'min-width: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'box_align_horizontal',
|
||||
[
|
||||
'label' => esc_html__( 'Box Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'prefix_class' => 'stratum-countdown-horizontal-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
'stretch' => [
|
||||
'title' => esc_html__( 'Stretch', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-stretch',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'box_border',
|
||||
'selector' => '{{WRAPPER}} .stratum-countdown .countdown-section',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'box_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'box_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Space Between', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 10,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'margin-left: calc( {{SIZE}}{{UNIT}}/2 );',
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'margin-right: calc( {{SIZE}}{{UNIT}}/2 );',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'box_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'digits_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-countdown .countdown-section .countdown-amount',
|
||||
'label' => esc_html__( 'Digits Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'label_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-countdown .countdown-section .countdown-period',
|
||||
'label' => esc_html__( 'Label Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'countdown_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'countdown_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'box_color',
|
||||
[
|
||||
'label' => esc_html__( 'Box Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'digit_color',
|
||||
[
|
||||
'label' => esc_html__( 'Digit Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section .countdown-amount' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'label_color',
|
||||
[
|
||||
'label' => esc_html__( 'Label Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-countdown .countdown-section .countdown-period' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'countdown_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_box_color',
|
||||
[
|
||||
'label' => esc_html__( 'Box Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-countdown .countdown-section' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_digit_color',
|
||||
[
|
||||
'label' => esc_html__( 'Digit Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-countdown .countdown-section .countdown-amount' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_label_color',
|
||||
[
|
||||
'label' => esc_html__( 'Label Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-countdown .countdown-section .countdown-period' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Countdown() );
|
||||
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Counter
|
||||
* Name: Counter
|
||||
* Slug: stratum-counter
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Counter extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'counter';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [ 'countup', 'waypoints' ];
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Counter', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-counter';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'start',
|
||||
[
|
||||
'label' => esc_html__( 'Start Value', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => 0
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'end',
|
||||
[
|
||||
'label' => esc_html__( 'End Value', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => 100
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'duration',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Duration', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => 3
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'smooth_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Smooth Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'prefix',
|
||||
[
|
||||
'label' => esc_html__( 'Counter Prefix', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'suffix',
|
||||
[
|
||||
'label' => esc_html__( 'Counter Suffix', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'horizontal_alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Horizontal Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'flex-start',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-center',
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-h-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter' => 'justify-content: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effect',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'outExpo',
|
||||
'options' => [
|
||||
'outExpo' => esc_html__( 'OutExpo' , 'stratum' ),
|
||||
'outQuintic' => esc_html__( 'OutQuintic', 'stratum' ),
|
||||
'outCubic' => esc_html__( 'OutCubic' , 'stratum' )
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'display_separator',
|
||||
[
|
||||
'label' => esc_html__( 'Display Thousands Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'thousands_separator',
|
||||
[
|
||||
'label' => esc_html__( 'Thousands Separator', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => ','
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'prefix__typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-counter__prefix',
|
||||
'label' => esc_html__( 'Prefix Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'number__typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-counter__number',
|
||||
'label' => esc_html__( 'Number Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'suffix__typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-counter__suffix',
|
||||
'label' => esc_html__( 'Suffix Typography', 'stratum' ),
|
||||
'render_type' => 'ui',
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'decimal_places',
|
||||
[
|
||||
'label' => esc_html__( 'Decimal Places', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'min' => '0',
|
||||
'default' => '0'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'decimal_separator',
|
||||
[
|
||||
'label' => esc_html__( 'Decimal Separator', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => '.'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'numerals',
|
||||
[
|
||||
'label' => esc_html__( 'Numerals', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'default' => esc_html__( 'Default' , 'stratum' ),
|
||||
'eastern_arabic' => esc_html__( 'Eastern Arabic', 'stratum' ),
|
||||
'farsi' => esc_html__( 'Farsi' , 'stratum' )
|
||||
],
|
||||
'default' => 'default'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'counter_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'counter_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'prefix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Prefix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter .stratum-counter__prefix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'number_color',
|
||||
[
|
||||
'label' => esc_html__( 'Number Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter .stratum-counter__number' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'suffix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Suffix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-counter .stratum-counter__suffix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'counter_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_prefix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Prefix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-counter .stratum-counter__prefix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_number_color',
|
||||
[
|
||||
'label' => esc_html__( 'Number Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-counter .stratum-counter__number' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_suffix_color',
|
||||
[
|
||||
'label' => esc_html__( 'Suffix Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-counter .stratum-counter__suffix' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
$this->render_widget( 'js' );
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Counter() );
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,999 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Image_Accordion
|
||||
* Name: Image Accordion
|
||||
* Slug: image-accordion
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Plugin;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Border;
|
||||
use Elementor\Group_Control_Typography;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
use Elementor\Group_Control_Text_Shadow;
|
||||
use Elementor\Group_Control_Css_Filter;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Image_Accordion extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'image-accordion';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Image Accordion', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-image-accordion';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'general_settings_section',
|
||||
[
|
||||
'label' => esc_html__( 'General Settings', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-image: url("{{URL}}");',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'auto' => esc_html__( 'Auto' , 'stratum' ),
|
||||
'contain' => esc_html__( 'Contain', 'stratum' ),
|
||||
'cover' => esc_html__( 'Cover' , 'stratum' ),
|
||||
'custom' => esc_html__( 'Custom' , 'stratum' )
|
||||
],
|
||||
'default' => 'auto',
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-size: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_position',
|
||||
[
|
||||
'label' => esc_html__( 'Position', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'top left' => esc_html__( 'Top Left' , 'stratum' ),
|
||||
'top center' => esc_html__( 'Top Center' , 'stratum' ),
|
||||
'top right' => esc_html__( 'Top Right' , 'stratum' ),
|
||||
'center center' => esc_html__( 'Center Center', 'stratum' ),
|
||||
'center left' => esc_html__( 'Center Left' , 'stratum' ),
|
||||
'center right' => esc_html__( 'Center Right' , 'stratum' ),
|
||||
'bottom center' => esc_html__( 'Bottom Center', 'stratum' ),
|
||||
'bottom left' => esc_html__( 'Bottom Left' , 'stratum' ),
|
||||
'bottom right' => esc_html__( 'Bottom Right' , 'stratum' )
|
||||
],
|
||||
'default' => 'center center',
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-position: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_repeat',
|
||||
[
|
||||
'label' => esc_html__( 'Repeat', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'repeat' => esc_html__( 'Repeat' , 'stratum' ),
|
||||
'no-repeat' => esc_html__( 'No-repeat', 'stratum' ),
|
||||
'repeat-x' => esc_html__( 'Repeat-x' , 'stratum' ),
|
||||
'repeat-y' => esc_html__( 'Repeat-y' , 'stratum' ),
|
||||
],
|
||||
'default' => 'repeat',
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}::before, {{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__background' => 'background-repeat: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'content_switcher',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_switcher',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_updated',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICON,
|
||||
'default' => 'fas fa-star',
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'icon_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_description',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' ),
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'custom_position',
|
||||
[
|
||||
'label' => esc_html__( 'Custom Position','stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_responsive_control(
|
||||
'horizontal_offset',
|
||||
[
|
||||
'label' => esc_html__( 'Horizontal Offset', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 400
|
||||
]
|
||||
],
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__content' => 'position: absolute; left: {{SIZE}}{{UNIT}}'
|
||||
],
|
||||
'condition' => [
|
||||
'custom_position' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_responsive_control(
|
||||
'ver_offset',
|
||||
[
|
||||
'label' => esc_html__( 'Vertical Offset', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 400
|
||||
]
|
||||
],
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-image-accordion__content' => 'position: absolute; top: {{SIZE}}{{UNIT}}'
|
||||
],
|
||||
'condition' => [
|
||||
'custom_position' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'show_button',
|
||||
[
|
||||
'label' => esc_html__( 'Show button', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'separator' => 'before',
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'button_text',
|
||||
[
|
||||
'label' => esc_html__( 'Button Text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Click Here', 'stratum' ),
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes',
|
||||
'show_button!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'link',
|
||||
[
|
||||
'label' => esc_html__( 'Link', 'stratum' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'show_button!' => ''
|
||||
],
|
||||
'placeholder' => esc_html__( 'https://your-link.com', 'stratum' ),
|
||||
'condition' => [
|
||||
'content_switcher' => 'yes',
|
||||
'show_button!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_content',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'default' => [
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 ),
|
||||
'item_description' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 2 ),
|
||||
'item_description' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 3 ),
|
||||
'item_description' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'stratum' )
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls(),
|
||||
'title_field' => '{{{ item_title }}}'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'display_options_section',
|
||||
[
|
||||
'label' => esc_html__( 'Display Options', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hovered_default_active',
|
||||
[
|
||||
'label' => esc_html__( 'Hovered By Default Index', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'condition' => [
|
||||
'active_type' => 'activate-on-hover'
|
||||
],
|
||||
'description' => esc_html__( 'Set the index for the image to be hovered by default on page load, index starts from 1', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'opened_default_active',
|
||||
[
|
||||
'label' => esc_html__( 'Opened By Default Index', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'condition' => [
|
||||
'active_type' => 'activate-on-click'
|
||||
],
|
||||
'description' => esc_html__( 'Set the index for the image to be opened by default on page load, index starts from 1', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'direction',
|
||||
[
|
||||
'label' => esc_html__( 'Direction', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'horizontal',
|
||||
'options' => [
|
||||
'horizontal' => esc_html__( 'Horizontal','stratum' ),
|
||||
'vertical' => esc_html__( 'Vertical' ,'stratum' )
|
||||
],
|
||||
'label_block' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'skew_switcher',
|
||||
[
|
||||
'label' => esc_html__( 'Skew Images', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'direction' => 'horizontal'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'skew_direction',
|
||||
[
|
||||
'label' => esc_html__( 'Skew Direction', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'right',
|
||||
'options' => [
|
||||
'right' => esc_html__( 'Right','stratum' ),
|
||||
'left' => esc_html__( 'Left' ,'stratum' )
|
||||
],
|
||||
'label_block' => true,
|
||||
'condition' => [
|
||||
'direction' => 'horizontal',
|
||||
'skew_switcher' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'active_type',
|
||||
[
|
||||
'label' => esc_html__( 'Accordion Style', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'activate-on-click',
|
||||
'label_block' => false,
|
||||
'options' => [
|
||||
'activate-on-hover' => esc_html__( 'On Hover', 'stratum' ),
|
||||
'activate-on-click' => esc_html__( 'On Click', 'stratum' )
|
||||
],
|
||||
'label_block' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'height',
|
||||
[
|
||||
'label' => esc_html__( 'Image Height', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', 'em', 'vh' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 1000
|
||||
]
|
||||
],
|
||||
'label_block' => true,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__item' => 'height: {{SIZE}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_position',
|
||||
[
|
||||
'label' => esc_html__( 'Content Vertical Position', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top'
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Middle', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle'
|
||||
],
|
||||
'flex-end' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom'
|
||||
]
|
||||
],
|
||||
'toggle' => false,
|
||||
'default' => 'center',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__overlay' => 'justify-content: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_align',
|
||||
[
|
||||
'label' => esc_html__( 'Content Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title'=> esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left'
|
||||
],
|
||||
'center' => [
|
||||
'title'=> esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center'
|
||||
],
|
||||
'right' => [
|
||||
'title'=> esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right'
|
||||
]
|
||||
],
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'render_type' => 'template',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__content' => 'text-align: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'syle_front_section_section',
|
||||
[
|
||||
'label' => esc_html__( 'Images', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'overlay_background',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__overlay' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'overlay_hover_background',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Hover Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__item:hover .stratum-image-accordion__overlay' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'images_tabs' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'image_normal_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'css_filters_normal',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__background'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'image_hover_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'css_filters_hover',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__item:hover .stratum-image-accordion__background'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'icons_style_section',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'icons_active_tabs' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'icons_style_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon:hover' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_background_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Hover Color ', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon:hover' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'icon_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__icon'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em'],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 500
|
||||
],
|
||||
'em' => [
|
||||
'min' => 0,
|
||||
'max' => 20
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'font-size: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'icon_border',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__icon'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', '%' ,'em'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'border-radius: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'icon_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'icon_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'titles_style_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color ', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__title' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__title'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Text_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'title_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__title'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'title_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'description_style_tab',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Color ', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__description' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'description_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__description'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Text_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'description_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__description'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'description_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'description_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'button_style_section',
|
||||
[
|
||||
'label' => esc_html__( 'Button', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'button_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-image-accordion__button'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'button_tabs' );
|
||||
|
||||
$controls->start_controls_tab( 'normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_border_color',
|
||||
[
|
||||
'label' => esc_html__( 'Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'border-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_hover_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button:hover' => 'color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_hover_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button:hover' => 'background-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_hover_border_color',
|
||||
[
|
||||
'label' => esc_html__( 'Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button:hover' => 'border-color: {{VALUE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_border_width',
|
||||
[
|
||||
'label' => esc_html__( 'Border Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 20
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'border-width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-accordion__button' => 'border-radius: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'separator' => 'after'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
public function image_accordion_render_button( $index, $button_text, $link ) {
|
||||
$out = '';
|
||||
$this->add_render_attribute( 'button' . $index, 'class', [
|
||||
'stratum-image-accordion__button'
|
||||
] );
|
||||
|
||||
if ( ! empty( $link[ 'url' ] ) ) {
|
||||
$this->add_link_attributes( 'button' . $index, $link );
|
||||
}
|
||||
|
||||
$button_class = $this->get_render_attribute_string( 'button' . $index );
|
||||
$out .= "<a " . ( empty( $link[ 'url' ] ) ? "href='#' " : '' ) . $button_class. ">" . esc_html( $button_text ) . "</a>";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Image_Accordion() );
|
||||
@@ -0,0 +1,459 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Image_Hot_Spot
|
||||
* Name: Image Hot Spots
|
||||
* Slug: stratum-image-hotspot
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Utils;
|
||||
use Elementor\Repeater;
|
||||
use Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Image_Hot_Spot extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'image-hotspot';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Image Hotspot', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'popper',
|
||||
'tippy',
|
||||
'draggabilly',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'tippy-themes',
|
||||
'tippy-animation',
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-image-hotspot';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls = $this;
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes()
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->start_controls_tabs( 'hot_spots_tabs' );
|
||||
|
||||
$repeater->start_controls_tab ( 'tab_content', [ 'label' => esc_html__( 'Content', 'stratum' ) ]);
|
||||
|
||||
$repeater->add_control(
|
||||
'hotspot_icon',
|
||||
[
|
||||
'label' => esc_html__( 'Icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICON,
|
||||
'default' => 'fa fa-plus',
|
||||
'label_block' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->start_controls_tab( 'position', [ 'label' => esc_html__( 'Position', 'stratum' ) ] );
|
||||
|
||||
$repeater->add_control(
|
||||
'left_position',
|
||||
[
|
||||
'label' => esc_html__( 'Left Position', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 50
|
||||
],
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}' => 'left: {{SIZE}}%;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'top_position',
|
||||
[
|
||||
'label' => esc_html__( 'Top Position', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
'size' => 50
|
||||
],
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}' => 'top: {{SIZE}}%;'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->start_controls_tab( 'tab_tooltip', [ 'label' => esc_html__( 'Tooltip', 'stratum' ) ] );
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip',
|
||||
[
|
||||
'label' => esc_html__( 'Tooltip', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet.', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Type your title here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_content',
|
||||
[
|
||||
'label' => esc_html__( 'Tooltip Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Type your content here...', 'stratum' ),
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'open_by_default',
|
||||
[
|
||||
'label' => esc_html__( 'Opened by default', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_arrow',
|
||||
[
|
||||
'label' => esc_html__( 'Use Arrow', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No' , 'stratum' ),
|
||||
'return_value' => 'yes',
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'placement',
|
||||
[
|
||||
'label' => esc_html__( 'Placement', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'top',
|
||||
'options' => [
|
||||
'top' => esc_html__( 'Top' , 'stratum' ),
|
||||
'right' => esc_html__( 'Right' , 'stratum' ),
|
||||
'bottom' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'left' => esc_html__( 'Left' , 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_theme',
|
||||
[
|
||||
'label' => esc_html__( 'Theme', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'light',
|
||||
'options' => [
|
||||
'light' => esc_html__( 'Light' , 'stratum' ),
|
||||
'dark' => esc_html__( 'Dark' , 'stratum' ),
|
||||
'light-border' => esc_html__( 'Light Border', 'stratum' ),
|
||||
'google' => esc_html__( 'Google' , 'stratum' ),
|
||||
'translucent' => esc_html__( 'Translucent' , 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'fade',
|
||||
'options' => [
|
||||
'shift-away' => esc_html__( 'Shift Away' , 'stratum' ),
|
||||
'shift-toward' => esc_html__( 'Shift Toward', 'stratum' ),
|
||||
'fade' => esc_html__( 'Fade' , 'stratum' ),
|
||||
'scale' => esc_html__( 'Scale' , 'stratum' ),
|
||||
'perspective' => esc_html__( 'Perspective' , 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'tooltip_interactivity',
|
||||
[
|
||||
'label' => esc_html__( 'Interactivity', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'hover',
|
||||
'options' => [
|
||||
'hover' => esc_html__( 'Hover', 'stratum' ),
|
||||
'click' => esc_html__( 'Click', 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'tooltip' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->end_controls_tab();
|
||||
|
||||
$repeater->end_controls_tabs();
|
||||
|
||||
$controls->add_control(
|
||||
'hotspot_dot_animation',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hot_spots',
|
||||
[
|
||||
'label' => '',
|
||||
'title_field' => '<i class="{{ hotspot_icon }}" aria-hidden="true"></i> {{{ tooltip_title }}}',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'default' => [
|
||||
[
|
||||
'feature_icon' => 'fa fa-plus',
|
||||
'left_position' => 20,
|
||||
'top_position' => 30
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_hotspot_style',
|
||||
[
|
||||
'label' => esc_html__( 'Hotspot', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'hotspot_icon_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [ 'size' => '20' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 6,
|
||||
'max' => 50,
|
||||
'step' => 1
|
||||
]
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot-content' => 'font-size: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'hotspot_dot_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Point Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [ 'size' => '0' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 6,
|
||||
'max' => 100,
|
||||
'step' => 1
|
||||
]
|
||||
],
|
||||
'size_units' => [ 'px' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot' => 'padding: {{SIZE}}{{UNIT}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'hotspot_dot_opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Point Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [ 'size' => '1' ],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 1,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot' => 'opacity: {{SIZE}};'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_color_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#fff',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot-icon' => 'color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'icon_bg_color_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-image-hotspot__dot' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {
|
||||
$this->render_widget( 'js' );
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
public function get_dot_template($class, $dot_class, $wrapper_class, $icon_class, $type, $item = null) {
|
||||
$out = "";
|
||||
$out .= "<div ".$dot_class.">";
|
||||
$out .= "<div ".$wrapper_class."'>";
|
||||
$out .= "<div class='".esc_attr( $class."__dot-content" )."'>";
|
||||
$out .= "<i class='".esc_attr( $class."__dot-icon ".$icon_class )."'></i>";
|
||||
$out .= "</div>";
|
||||
$out .= "</div>";
|
||||
$out .= "</div>";
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Image_Hot_Spot() );
|
||||
@@ -0,0 +1,342 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Stratum_Instagram
|
||||
* Name: Instagram
|
||||
* Slug: stratum-instagram
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
// use \Stratum\Stratum_Widget_Base;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Instagram extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'instagram';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Instagram', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'anim-on-scroll',
|
||||
'modernizr-custom',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'scroll-anim-effects',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-instagram';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items',
|
||||
[
|
||||
'label' => esc_html__( 'Number of items', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
'step' => 1,
|
||||
'default' => 6
|
||||
]
|
||||
);
|
||||
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$access_token = isset( $stratum_api['instagram_access_token'] ) ? $stratum_api['instagram_access_token'] : '';
|
||||
|
||||
if (empty($access_token)){
|
||||
$controls->add_control(
|
||||
'api_key',
|
||||
[
|
||||
'label' => esc_html__( 'API KEY', 'stratum' ),
|
||||
'label_block' => true,
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'raw' => wp_kses(
|
||||
sprintf(
|
||||
__( 'Instagram Access Token is not set. <a href="%s" target="_blank">Connect Instagram Account</a>.', 'stratum' ),
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
),
|
||||
array( 'a' => array( 'href' => array(), 'target' => array() ) )
|
||||
),
|
||||
'content_classes' => 'api-key-description',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Style Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_on_scroll',
|
||||
[
|
||||
'label' => esc_html__( 'Animate on scroll', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effects',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'effect-2',
|
||||
'options' => [
|
||||
'effect-1' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'effect-2' => esc_html__( 'Move Up', 'stratum' ),
|
||||
'effect-3' => esc_html__( 'Scale up', 'stratum' ),
|
||||
'effect-4' => esc_html__( 'Fall perspective', 'stratum' ),
|
||||
'effect-5' => esc_html__( 'Fly', 'stratum' ),
|
||||
'effect-6' => esc_html__( 'Flip', 'stratum' ),
|
||||
'effect-7' => esc_html__( 'Helix', 'stratum' ),
|
||||
'effect-8' => esc_html__( 'Zoom In 3D', 'stratum' ),
|
||||
],
|
||||
'condition' => [
|
||||
'animate_on_scroll' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'columns',
|
||||
[
|
||||
'label' => esc_html__( 'Columns', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'min' => 1,
|
||||
'max' => 6,
|
||||
'step' => 1,
|
||||
'default' => 3,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__wrapper' => '--columns: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'padding_item',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'description' => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'tablet_default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'mobile_default' => [
|
||||
'size' => 5,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 30,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__item' => 'padding: {{SIZE}}px',
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__wrapper' => 'margin: -{{SIZE}}px',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'instagram_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'instagram_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#00000000',
|
||||
'default' => '#00000000',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__media-link:before' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'instagram_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'background_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#0000002e',
|
||||
'default' => '#0000002e',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-instagram .stratum-instagram__media-link:hover:before' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
protected function render( $instance = [] ) {
|
||||
|
||||
$media = $this->get_media();
|
||||
|
||||
if ( ! $media['success'] ) {
|
||||
?><p><?php
|
||||
echo wp_kses(
|
||||
$media['error'],
|
||||
array( 'a' => array( 'href' => array(), 'target' => array() ) )
|
||||
)
|
||||
?></p><?php
|
||||
return;
|
||||
}
|
||||
|
||||
$this->render_widget( 'php', [ 'media' => $media['media'] ] );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
private function get_media() {
|
||||
|
||||
$instagram_media = get_transient( 'stratum_instagram_response_data' );
|
||||
$success = true;
|
||||
$error = '';
|
||||
|
||||
// @todo: remove in next release
|
||||
// added for backward compatibility
|
||||
if ( isset( $instagram_media->data ) ) {
|
||||
$instagram_media = $instagram_media->data;
|
||||
}
|
||||
|
||||
if ( false === $instagram_media ) {
|
||||
|
||||
$encryption = new String_Encryption();
|
||||
$stratum_api = get_option( 'stratum_api', [] );
|
||||
$access_token = isset( $stratum_api['instagram_access_token'] ) ? $encryption->decrypt( $stratum_api['instagram_access_token'] ) : '';
|
||||
|
||||
//If Empty Token
|
||||
if ( empty( $access_token ) ) {
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
$error = sprintf(
|
||||
__( 'Instagram Access Token is not set. <a href="%s" target="_blank">Connect Instagram Account</a>.', 'stratum' ),
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => false,
|
||||
'error' => $error,
|
||||
'media' => $instagram_media
|
||||
);
|
||||
}
|
||||
|
||||
//Get data from Instagram
|
||||
$response = wp_remote_get(
|
||||
'https://graph.instagram.com/me/media?fields=id,media_type,media_url,permalink,caption,thumbnail_url,children{media_url,thumbnail_url}&access_token=' . $access_token . '&limit=100',
|
||||
array( 'timeout' => 15 )
|
||||
);
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
$success = false;
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
$error = $response->get_error_message();
|
||||
}
|
||||
} else {
|
||||
$instagram_media = json_decode( wp_remote_retrieve_body( $response ) );
|
||||
//JSON valid
|
||||
if ( json_last_error() === JSON_ERROR_NONE ) {
|
||||
if ( isset( $instagram_media->error ) ) {
|
||||
$success = false;
|
||||
$error = sprintf(
|
||||
__( 'The access token could not be decrypted. Your access token is currently invalid. <a href="%s" target="_blank">Please re-authorize your Instagram account</a>.', 'stratum' ),
|
||||
admin_url( 'admin.php?page=stratum-settings#stratum_api' )
|
||||
);
|
||||
|
||||
} else {
|
||||
if ( $instagram_media->data ) {
|
||||
$instagram_media = $instagram_media->data;
|
||||
//Cache response
|
||||
set_transient( 'stratum_instagram_response_data', $instagram_media, 30 * MINUTE_IN_SECONDS );
|
||||
} else {
|
||||
$success = false;
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
$error = $instagram_media->meta->error_message;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$success = false;
|
||||
$error = __( 'Error in json_decode.', 'stratum' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => $success,
|
||||
'error' => $error,
|
||||
'media' => $instagram_media
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Instagram() );
|
||||
@@ -0,0 +1,431 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Lottie_Animations
|
||||
* Name: Lottie Animations
|
||||
* Slug: lottie-animations
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Plugin;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Border;
|
||||
use Elementor\Group_Control_Css_Filter;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
use Elementor\Group_Control_Typography;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Lottie_Animations extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'lottie-animations';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Lottie Animations', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-lottie-animations';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'lottie-animations-api'
|
||||
];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'general_settings',
|
||||
[
|
||||
'label' => esc_html__( 'General Settings', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_url',
|
||||
[
|
||||
'label' => esc_html__( 'Animation JSON URL', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
|
||||
'label_block' => true
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_loop',
|
||||
[
|
||||
'label' => esc_html__( 'Loop','stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'true',
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_reverse',
|
||||
[
|
||||
'label' => esc_html__( 'Reverse', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'true',
|
||||
'default' => '',
|
||||
'condition' => [
|
||||
'lottie_loop' => 'true',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Only Play on Hover','stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'true',
|
||||
'default' => ''
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Speed', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'default' => 1,
|
||||
'min' => 0.1,
|
||||
'max' => 3,
|
||||
'step' => 0.1
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_on_scroll',
|
||||
[
|
||||
'label' => esc_html__( 'Animate On Scroll', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'false',
|
||||
'condition' => [
|
||||
'lottie_hover!' => 'true',
|
||||
'lottie_reverse!' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Speed', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 4
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 10,
|
||||
'step' => 0.1
|
||||
]
|
||||
],
|
||||
'condition' => [
|
||||
'lottie_hover!' => 'true',
|
||||
'animate_on_scroll' => 'true',
|
||||
'lottie_reverse!' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_view',
|
||||
[
|
||||
'label' => esc_html__( 'Viewport', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'sizes' => [
|
||||
'start' => 0,
|
||||
'end' => 100
|
||||
],
|
||||
'unit' => '%'
|
||||
],
|
||||
'labels' => [
|
||||
esc_html__( 'Bottom', 'stratum' ),
|
||||
esc_html__( 'Top', 'stratum' )
|
||||
],
|
||||
'scales' => 1,
|
||||
'handles' => 'range',
|
||||
'condition' => [
|
||||
'lottie_hover!' => 'true',
|
||||
'animate_on_scroll' => 'true',
|
||||
'lottie_reverse!' => 'true'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'animation_size',
|
||||
[
|
||||
'label' => esc_html__( 'Size', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'default' => [
|
||||
'unit' => 'px',
|
||||
'size' => 600
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 1,
|
||||
'max' => 800
|
||||
],
|
||||
'em' => [
|
||||
'min' => 1,
|
||||
'max' => 30
|
||||
]
|
||||
],
|
||||
'render_type' => 'template',
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_rotate',
|
||||
[
|
||||
'label' => esc_html__( 'Rotate (degrees)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'description' => esc_html__( 'Set rotation value in degress', 'stratum' ),
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => -180,
|
||||
'max' => 180
|
||||
]
|
||||
],
|
||||
'default' => [
|
||||
'size' => 0
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'transform: rotate({{SIZE}}deg)'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'animation_align',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'options' => [
|
||||
'flex-start' => [
|
||||
'title'=> esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left'
|
||||
],
|
||||
'center' => [
|
||||
'title'=> esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center'
|
||||
],
|
||||
'flex-end' => [
|
||||
'title'=> esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right'
|
||||
]
|
||||
],
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'separator' => 'before',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations' => 'justify-content: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_renderer',
|
||||
[
|
||||
'label' => esc_html__( 'Render As', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'svg' => esc_html__( 'SVG', 'stratum' ),
|
||||
'canvas' => esc_html__( 'Canvas', 'stratum' )
|
||||
],
|
||||
'default' => 'svg',
|
||||
'prefix_class' => 'stratum-lottie-',
|
||||
'render_type' => 'template',
|
||||
'label_block' => true,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control('render_notice',
|
||||
[
|
||||
'raw' => esc_html__( 'Set render type to canvas if you\'re having performance issues on the page.', 'stratum' ),
|
||||
'type' => Controls_Manager::RAW_HTML,
|
||||
'content_classes' => 'elementor-panel-alert elementor-panel-alert-info'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_lottie_style',
|
||||
[
|
||||
'label' => esc_html__( 'Animation', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
'show_label' => false
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'tabs_lottie' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_lottie_normal',
|
||||
[
|
||||
'label' => esc_html__( 'Normal', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_background',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0.10,
|
||||
'step' => 0.01
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'opacity: {{SIZE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'css_filters',
|
||||
'selector' => '{{WRAPPER}} .stratum-lottie-animations__wrapper'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'tab_lottie_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Hover', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'lottie_hover_background',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper:hover' => 'background-color: {{VALUE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'hover_opacity',
|
||||
[
|
||||
'label' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 1,
|
||||
'min' => 0.10,
|
||||
'step' => 0.01
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper:hover' => 'opacity: {{SIZE}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Css_Filter::get_type(),
|
||||
[
|
||||
'name' => 'hover_css_filters',
|
||||
'selector' => '{{WRAPPER}} .stratum-lottie-animations__wrapper:hover'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'lottie_border',
|
||||
'selector' => '{{WRAPPER}} .stratum-lottie-animations__wrapper',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control('lottie_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control('animation_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em', '%' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-lottie-animations__wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Lottie_Animations() );
|
||||
@@ -0,0 +1,400 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Images_Masonry
|
||||
* Name: Images Masonry
|
||||
* Slug: masonry-gallery
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Group_Control_Background;
|
||||
use \Elementor\Group_Control_Typography;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Images_Masonry extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'masonry-gallery';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Masonry Gallery', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'jquery-masonry',
|
||||
'anim-on-scroll',
|
||||
'modernizr-custom'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'scroll-anim-effects'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-masonry-gallery';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'gallery_images',
|
||||
[
|
||||
'label' => esc_html__( 'Gallery', 'stratum' ),
|
||||
'type' => Controls_Manager::GALLERY,
|
||||
'default' => [],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animate_on_scroll',
|
||||
[
|
||||
'label' => esc_html__( 'Animate on scroll', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'animation_effects',
|
||||
[
|
||||
'label' => esc_html__( 'Animation Effect', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'effect-2',
|
||||
'options' => [
|
||||
'effect-1' => esc_html__( 'Opacity', 'stratum' ),
|
||||
'effect-2' => esc_html__( 'Move Up', 'stratum' ),
|
||||
'effect-3' => esc_html__( 'Scale up', 'stratum' ),
|
||||
'effect-4' => esc_html__( 'Fall perspective', 'stratum' ),
|
||||
'effect-5' => esc_html__( 'Fly', 'stratum' ),
|
||||
'effect-6' => esc_html__( 'Flip', 'stratum' ),
|
||||
'effect-7' => esc_html__( 'Helix', 'stratum' ),
|
||||
'effect-8' => esc_html__( 'Zoom In 3D', 'stratum' ),
|
||||
],
|
||||
'condition' => [
|
||||
'animate_on_scroll' => 'yes',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'gallery_columns',
|
||||
[
|
||||
'label' => esc_html__( 'Columns', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 2,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 2,
|
||||
'max' => 10,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'gutter',
|
||||
[
|
||||
'label' => esc_html__( 'Gutter', 'stratum' ),
|
||||
'description' => esc_html__( 'In Pixels (px)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 2,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 30,
|
||||
'step' => 1,
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_animation_speed',
|
||||
[
|
||||
'label' => esc_html__( 'Hover Animation Speed', 'stratum' ),
|
||||
'description' => esc_html__( 'In Seconds', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 0.25,
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0.1,
|
||||
'max' => 2,
|
||||
'step' => 0.01,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__image' => 'transition: all {{SIZE}}s linear',
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__overlay' => 'transition: all {{SIZE}}s linear',
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__caption' => 'transition: all {{SIZE}}s linear',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'zoom_effect',
|
||||
[
|
||||
'prefix_class' => 'stratum-masonry-gallery-effect-',
|
||||
'return_value' => 'zoom',
|
||||
'label' => esc_html__( 'Zoom on hover', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'grayscale_effect',
|
||||
[
|
||||
'prefix_class' => 'stratum-masonry-gallery-effect-',
|
||||
'return_value' => 'grayscale',
|
||||
'label' => esc_html__( 'Colorize on hover', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'overlay_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'overlay_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'images_overlay_color',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#00000078',
|
||||
'default' => '#00000078',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__overlay' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'overlay_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'images_overlay_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Overlay Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'value' => '#00000000',
|
||||
'default' => '#00000000',
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item:hover .stratum-masonry-gallery__overlay' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_caption',
|
||||
[
|
||||
'label' => esc_html__( 'Caption', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'caption_padding',
|
||||
[
|
||||
'label' => __( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'caption_horizontal_align',
|
||||
[
|
||||
'label' => esc_html__( 'Horizontal Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'caption_vertical_align',
|
||||
[
|
||||
'label' => esc_html__( 'Vertical Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'bottom',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'top' => [
|
||||
'title' => esc_html__( 'Top', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-top'
|
||||
],
|
||||
'middle' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-middle'
|
||||
],
|
||||
'bottom' => [
|
||||
'title' => esc_html__( 'Bottom', 'stratum' ),
|
||||
'icon' => 'eicon-v-align-bottom'
|
||||
],
|
||||
],
|
||||
'selectors_dictionary' => [
|
||||
'top' => 'top: 0; bottom: 0;',
|
||||
'middle' => 'top: 50%; bottom: 0;',
|
||||
'bottom' => 'bottom: 0; top: unset;',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => '{{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Background::get_type(),
|
||||
[
|
||||
'name' => 'background',
|
||||
'types' => [ 'classic', 'gradient' ],
|
||||
'exclude' => [ 'image' ],
|
||||
'selector' => '{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'caption_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption',
|
||||
'label' => esc_html__( 'Typography', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'caption_color',
|
||||
[
|
||||
'label' => __( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'default' => '#FFFFFF',
|
||||
'value' => '',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-masonry-gallery__item .stratum-masonry-gallery__caption' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
//PHP template (refresh elements)
|
||||
protected function render() {
|
||||
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
//JavaScript "Backbone" template (live preview)
|
||||
protected function content_template() {
|
||||
}
|
||||
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
|
||||
public function _get_image_attributes( $id ) {
|
||||
$attachment = get_post( $id );
|
||||
$image_data = [
|
||||
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
|
||||
'caption' => $attachment->post_excerpt,
|
||||
'description' => $attachment->post_content,
|
||||
'title' => $attachment->post_title,
|
||||
];
|
||||
|
||||
return $image_data;
|
||||
}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Images_Masonry() );
|
||||
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Price_List
|
||||
* Name: Price List
|
||||
* Slug: stratum-price-list
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Price_List extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'price-list';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Price List', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-price-list';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'list_title',
|
||||
[
|
||||
'label' => esc_html__( 'Heading', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [ 'active' => true ],
|
||||
'default' => esc_html__( 'List Heading', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_html_tag',
|
||||
[
|
||||
'label' => esc_html__( 'Heading HTML Tag', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1' , 'stratum' ),
|
||||
'h2' => esc_html__( 'H2' , 'stratum' ),
|
||||
'h3' => esc_html__( 'H3' , 'stratum' ),
|
||||
'h4' => esc_html__( 'H4' , 'stratum' ),
|
||||
'h5' => esc_html__( 'H5', 'stratum' ),
|
||||
'h6' => esc_html__( 'H6' , 'stratum' ),
|
||||
'div' => esc_html__( 'div' , 'stratum' ),
|
||||
'p' => esc_html__( 'p' , 'stratum' )
|
||||
],
|
||||
'default' => 'h5'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'item_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Title', 'stratum' ),
|
||||
'default' => esc_html__( 'Title', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_html_tag',
|
||||
[
|
||||
'label' => esc_html__( 'Title HTML Tag', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1' , 'stratum' ),
|
||||
'h2' => esc_html__( 'H2' , 'stratum' ),
|
||||
'h3' => esc_html__( 'H3' , 'stratum' ),
|
||||
'h4' => esc_html__( 'H4' , 'stratum' ),
|
||||
'h5' => esc_html__( 'H5 ', 'stratum' ),
|
||||
'h6' => esc_html__( 'H6' , 'stratum' ),
|
||||
'div' => esc_html__( 'div' , 'stratum' ),
|
||||
'span' => esc_html__( 'span', 'stratum' ),
|
||||
'p' => esc_html__( 'p' , 'stratum' )
|
||||
],
|
||||
'default' => 'span'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_price',
|
||||
[
|
||||
'label' => esc_html__( 'Price', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => '$11'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'list_items',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ item_title }}}',
|
||||
'default' => [
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 ),
|
||||
'item_price' => '$69'
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 2 ),
|
||||
'item_price' => '$49'
|
||||
],
|
||||
[
|
||||
'item_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 3 ),
|
||||
'item_price' => '$19'
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'show_image',
|
||||
[
|
||||
'label' => esc_html__( 'Show Image', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'type' => 'select',
|
||||
'default' => 'full',
|
||||
'options' => \Stratum\Stratum::get_instance()->get_scripts_manager()->get_image_sizes(),
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_width',
|
||||
[
|
||||
'label' => esc_html__( 'Image Width', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'default' => [
|
||||
'size' => 250,
|
||||
'unit' => 'px'
|
||||
],
|
||||
'range' => [
|
||||
'px' => [
|
||||
'max' => 600,
|
||||
'min' => 10,
|
||||
'step' => 1
|
||||
]
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list__image-wrapper' => 'width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_position',
|
||||
[
|
||||
'label' => esc_html__( 'Image position', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'default' => 'has-image-left',
|
||||
'options' => [
|
||||
'has-image-top' => esc_html__( 'Top' , 'stratum' ),
|
||||
'has-image-left' => esc_html__( 'Left' , 'stratum' ),
|
||||
'has-image-right' => esc_html__( 'Right', 'stratum' )
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_price_connector',
|
||||
[
|
||||
'label' => esc_html__( 'Title-Price Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Content Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list .stratum-price-list__wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'price_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'heading_color',
|
||||
[
|
||||
'label' => esc_html__( 'Heading Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list .stratum-price-list__heading' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list__items .stratum-price-list__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list__items .stratum-price-list__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'heading_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Heading Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list:hover .stratum-price-list__heading' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list:hover .stratum-price-list__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_hover_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-list:hover .stratum-price-list__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Price_List() );
|
||||
@@ -0,0 +1,396 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Price_Menu
|
||||
* Name: Price Menu
|
||||
* Slug: stratum-price-menu
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Group_Control_Box_Shadow;
|
||||
use \Elementor\Controls_Manager;
|
||||
use Elementor\Repeater;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Price_Menu extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'price-menu';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Price Menu', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-price-menu';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'menu_title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Title', 'stratum' ),
|
||||
'default' => esc_html__( 'Title', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_html_tag',
|
||||
[
|
||||
'label' => esc_html__( 'Title HTML Tag', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'h1' => esc_html__( 'H1' , 'stratum' ),
|
||||
'h2' => esc_html__( 'H2' , 'stratum' ),
|
||||
'h3' => esc_html__( 'H3' , 'stratum' ),
|
||||
'h4' => esc_html__( 'H4' , 'stratum' ),
|
||||
'h5' => esc_html__( 'H5', 'stratum' ),
|
||||
'h6' => esc_html__( 'H6' , 'stratum' ),
|
||||
'div' => esc_html__( 'div' , 'stratum' ),
|
||||
'span' => esc_html__( 'span', 'stratum' ),
|
||||
'p' => esc_html__( 'p' , 'stratum' )
|
||||
],
|
||||
'default' => 'span'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'menu_description',
|
||||
[
|
||||
'label' => esc_html__( 'Description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Description', 'stratum' ),
|
||||
'default' => esc_html__( 'Description', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'menu_price',
|
||||
[
|
||||
'label' => esc_html__( 'Price', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'default' => '$49'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-price-menu__title' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'price_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-price-menu__price' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Description Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}} .stratum-price-menu__description' => 'color: {{VALUE}}',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'show_image',
|
||||
[
|
||||
'label' => esc_html__( 'Show Image', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => '',
|
||||
'label_on' => esc_html__( 'On', 'stratum' ),
|
||||
'label_off' => esc_html__( 'Off', 'stratum' ),
|
||||
'return_value' => 'yes'
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'type' => 'select',
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes(),
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_align',
|
||||
[
|
||||
'label' => esc_html__( 'Image Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'left',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [
|
||||
'active' => true
|
||||
],
|
||||
'condition' => [
|
||||
'show_image' => 'yes'
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'menu_items',
|
||||
[
|
||||
'label' => '',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ menu_title }}}',
|
||||
'default' => [
|
||||
[
|
||||
'menu_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 1 ),
|
||||
'menu_price' => '$69'
|
||||
],
|
||||
[
|
||||
'menu_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 2 ),
|
||||
'menu_price' => '$49'
|
||||
],
|
||||
[
|
||||
'menu_title' => sprintf( esc_html__( 'Item #%d', 'stratum' ), 3 ),
|
||||
'menu_price' => '$19'
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_price_connector',
|
||||
[
|
||||
'label' => esc_html__( 'Title-Price Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_divider',
|
||||
[
|
||||
'label' => esc_html__( 'Items Separator', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'no',
|
||||
'label_on' => esc_html__( 'Yes', 'stratum' ),
|
||||
'label_off' => esc_html__( 'No', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_animate',
|
||||
[
|
||||
'label' => esc_html__( 'Animate items', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'return_value' => 'animate',
|
||||
'default' => '',
|
||||
'prefix_class' => 'stratum-price-menu-items-',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'items_gap',
|
||||
[
|
||||
'label' => esc_html__( 'Items Gap', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'size_units' => [ 'px', 'em' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper' => 'margin-bottom: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'items_images_width',
|
||||
[
|
||||
'label' => esc_html__( 'Image width', 'stratum' ),
|
||||
'description' => esc_html__( 'In Percent (%)', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'%' => [
|
||||
'min' => 0,
|
||||
'max' => 80,
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%' ],
|
||||
'default' => [
|
||||
'size' => '50',
|
||||
'unit' => '%',
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => '%',
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => '%',
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__image' => 'width: {{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.stratum-price-menu-items-animate .stratum-price-menu__image.image-align-left' => 'margin-left: -{{SIZE}}{{UNIT}};',
|
||||
'{{WRAPPER}}.stratum-price-menu-items-animate .stratum-price-menu__image.image-align-right' => 'margin-right: -{{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'render_type' => 'ui',
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper' => 'background-color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'items_border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'items_border_radius',
|
||||
[
|
||||
'label' => esc_html__('Border Radius', 'stratum'),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => ['px', 'em', '%'],
|
||||
'condition' => [
|
||||
'items_border_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'items_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-menu .stratum-price-menu__item-wrapper',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'items_paddings',
|
||||
[
|
||||
'label' => esc_html__( 'Content Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'size_units' => [ 'px', '%', 'em' ],
|
||||
'allowed_dimensions' => [ 'top', 'right', 'bottom', 'left' ],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-menu .stratum-price-menu__content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Price_Menu() );
|
||||
@@ -0,0 +1,843 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Price_Table
|
||||
* Name: Price Table
|
||||
* Slug: stratum-price-table
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use \Elementor\Group_Control_Border;
|
||||
use \Elementor\Controls_Manager;
|
||||
use \Elementor\Utils;
|
||||
use \Elementor\Plugin;
|
||||
use \Elementor\Repeater;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Price_Table extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'price-table';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Price Table', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-price-table';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
$controls = $this;
|
||||
|
||||
$first_color = '#000';
|
||||
$second_color = '#000';
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_general',
|
||||
[
|
||||
'label' => esc_html__( 'General', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_CONTENT,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title',
|
||||
[
|
||||
'label' => esc_html__( 'Title', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Premium', 'stratum' ),
|
||||
'title' => esc_html__( 'Title', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'title_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__header .stratum-price-table__title',
|
||||
'label' => esc_html__( 'Title Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'title!' => ''
|
||||
],
|
||||
'defaults' => [
|
||||
'html_tag' => 'h5',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Plan', 'stratum' ),
|
||||
'title' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'subtitles_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__subtitle',
|
||||
'label' => esc_html__( 'Subtitle Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'subtitle!' => ''
|
||||
],
|
||||
'defaults' => [
|
||||
'html_tag' => 'h4',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_text',
|
||||
[
|
||||
'label' => esc_html__( 'Price Text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'rows' => 10,
|
||||
'default' => esc_html__( 'Min Price', 'stratum' ),
|
||||
'title' => esc_html__( 'Price Text', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'price_text_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__price-text',
|
||||
'label' => esc_html__( 'Price Subtitle Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'subtitle!' => ''
|
||||
],
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price',
|
||||
[
|
||||
'label' => esc_html__( 'Price', 'stratum' ),
|
||||
'type' => Controls_Manager::NUMBER,
|
||||
'step' => 1,
|
||||
'default' => 7.50,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'price_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__price-wrapper .stratum-price-table__price',
|
||||
'label' => esc_html__( 'Price Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'condition' => [
|
||||
'price!' => ''
|
||||
],
|
||||
'exclude' => ['html_tag']
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_currency',
|
||||
[
|
||||
'label' => esc_html__( 'Currency', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => '$',
|
||||
'title' => esc_html__( 'Currency', 'stratum' ),
|
||||
'condition' => [
|
||||
'price!' => ''
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'currency_align',
|
||||
[
|
||||
'label' => esc_html__( 'Currency Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'right',
|
||||
'prefix_class' => 'stratum-price-table-currency-align-',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_description',
|
||||
[
|
||||
'label' => esc_html__( 'Price description', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'per 10GH/s', 'stratum' ),
|
||||
'title' => esc_html__( 'Price description', 'stratum' ),
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'item_text',
|
||||
[
|
||||
'label' => esc_html__( 'Item text', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Caption', 'stratum' ),
|
||||
'default' => esc_html__( 'Text', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'item_icon',
|
||||
[
|
||||
'label_block' => true,
|
||||
'label' => esc_html__( 'Item icon', 'stratum' ),
|
||||
'type' => Controls_Manager::ICON
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_color',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} {{CURRENT_ITEM}}.stratum-price-table__content i' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'item_icon!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'icon_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Icon Color (Hover)', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover {{CURRENT_ITEM}}.stratum-price-table__content i' => 'color: {{VALUE}}',
|
||||
],
|
||||
'condition' => [
|
||||
'item_icon!' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_items',
|
||||
[
|
||||
'label' => esc_html__( 'List items', 'stratum' ),
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'title_field' => '{{{ item_text }}}',
|
||||
'default' => [
|
||||
[
|
||||
'item_text' => esc_html__( 'First', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_text' => esc_html__( 'Second', 'stratum' )
|
||||
],
|
||||
[
|
||||
'item_text' => esc_html__( 'Third', 'stratum' )
|
||||
]
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'align',
|
||||
[
|
||||
'label' => esc_html__( 'List Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'fa fa-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'None', 'stratum' ),
|
||||
'icon' => 'fa fa-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'fa fa-align-right',
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__wrapper .stratum-price-table__content-wrapper' => 'text-align: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'line_border',
|
||||
[
|
||||
'label' => esc_html__( 'List border', 'stratum' ),
|
||||
'type' => Controls_Manager::POPOVER_TOGGLE,
|
||||
'label_off' => esc_html__( 'Default', 'stratum' ),
|
||||
'label_on' => esc_html__( 'Custom', 'stratum' ),
|
||||
'return_value' => 'yes',
|
||||
]
|
||||
);
|
||||
|
||||
/*------------------------BORDER POPOVER------------------------*/
|
||||
$controls->start_popover();
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'border',
|
||||
'label' => esc_html__( 'Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-price-table__content-wrapper li',
|
||||
'condition' => [
|
||||
'line_border' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_popover();
|
||||
/*------------------------------------------------*/
|
||||
|
||||
$controls->add_control(
|
||||
'button_show',
|
||||
[
|
||||
'label' => esc_html__( 'Show button', 'stratum' ),
|
||||
'type' => Controls_Manager::SWITCHER,
|
||||
'default' => 'yes',
|
||||
'separator' => 'before',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_align',
|
||||
[
|
||||
'label' => esc_html__( 'Button Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'toggle' => false,
|
||||
'prefix_class' => 'stratum-price-table-button-align%s-',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
'full' => [
|
||||
'title' => esc_html__( 'Justified', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-justify',
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'button_show' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_text',
|
||||
[
|
||||
'label' => esc_html__( 'Button caption', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'default' => esc_html__( 'Purchase', 'stratum' ),
|
||||
'title' => esc_html__( 'Button caption', 'stratum' ),
|
||||
'condition' => [
|
||||
'button_show' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_url',
|
||||
[
|
||||
'label' => esc_html__( 'Button URL', 'stratum' ),
|
||||
'type' => Controls_Manager::URL,
|
||||
'placeholder' => 'https://',
|
||||
'show_external' => true,
|
||||
'default' => [
|
||||
'url' => '',
|
||||
'is_external' => true,
|
||||
'nofollow' => true,
|
||||
],
|
||||
'condition' => [
|
||||
'button_text!' => '',
|
||||
'button_show' => 'yes'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'stratum_button_border',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border', 'stratum' ),
|
||||
'type' => Controls_Manager::SELECT,
|
||||
'options' => [
|
||||
'' => esc_html__( 'None', 'stratum' ),
|
||||
'solid' => esc_html__( 'Solid', 'stratum' ),
|
||||
'double' => esc_html__( 'Double', 'stratum' ),
|
||||
'dotted' => esc_html__( 'Dotted', 'stratum' ),
|
||||
'dashed' => esc_html__( 'Dashed', 'stratum' ),
|
||||
'groove' => esc_html__( 'Groove', 'stratum' ),
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-style: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'button_border_width',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Width', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'default' => [
|
||||
'top' => 1,
|
||||
'right' => 1,
|
||||
'bottom' => 1,
|
||||
'left' => 1,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => '',
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => ''
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-radius: {{SIZE}}{{UNIT}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_style',
|
||||
[
|
||||
'label' => esc_html__( 'Style', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->start_controls_tabs( 'price_table_styles' );
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_table_normal',
|
||||
array(
|
||||
'label' => esc_html__( 'Normal', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__header .stratum-price-table__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'title',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_color',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__subtitle' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__price-wrapper .stratum-price-table__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_text_color',
|
||||
[
|
||||
'label' => esc_html__( 'Price Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__price-text' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'description_color',
|
||||
[
|
||||
'label' => esc_html__( 'Description Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__price-wrapper .stratum-price-table__price-description' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price_description',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Content Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__content-wrapper .stratum-price-table__content' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_font',
|
||||
[
|
||||
'label' => esc_html__( 'Button Font Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_background',
|
||||
[
|
||||
'label' => esc_html__( 'Button Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'background-color: {{VALUE}}; border-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_border',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-price-table__button .button' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->start_controls_tab(
|
||||
'price_table_hover',
|
||||
array(
|
||||
'label' => esc_html__( 'Hover', 'stratum' ),
|
||||
)
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'title_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Title Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__header .stratum-price-table__title' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'title',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__subtitle' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Price Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__price-wrapper .stratum-price-table__price' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'price_text_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Price Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__price-text' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'relation' => 'or',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'subtitle',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
], [
|
||||
'name' => 'price_text',
|
||||
'operator' => '!=',
|
||||
'value' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'description_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Description Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__price-wrapper .stratum-price-table__price-description' => 'color: {{VALUE}}',
|
||||
],
|
||||
'conditions' => [
|
||||
'relation' => 'and',
|
||||
'terms' => [
|
||||
[
|
||||
'name' => 'price_description',
|
||||
'operator' => '!=',
|
||||
'value' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_color_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Content Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__content-wrapper .stratum-price-table__content' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_font_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Button Font Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__button .button:hover' => 'color: {{VALUE}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
$controls->add_control(
|
||||
'button_color_background_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Button Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__button .button:hover' => 'background-color: {{VALUE}};',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'button_color_border_hover',
|
||||
[
|
||||
'label' => esc_html__( 'Button Border Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}}:hover .stratum-price-table__button .button:hover' => 'border-color: {{VALUE}};',
|
||||
],
|
||||
'condition' => [
|
||||
'stratum_button_border!' => '',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_tab();
|
||||
|
||||
$controls->end_controls_tabs();
|
||||
|
||||
$controls->end_controls_section();
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Price_Table() );
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,521 @@
|
||||
<?php
|
||||
/**
|
||||
* Class: Testimonial_Carousel
|
||||
* Name: Testimonial Carousel
|
||||
* Slug: stratum-testimonial-carousel
|
||||
*/
|
||||
|
||||
namespace Stratum;
|
||||
|
||||
use Elementor\Controls_Manager;
|
||||
use Elementor\Group_Control_Box_Shadow;
|
||||
use Elementor\Group_Control_Border;
|
||||
use Elementor\Repeater;
|
||||
use Elementor\Utils;
|
||||
use Elementor\Core\Schemes;
|
||||
use Elementor\Plugin;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
class Testimonial_Carousel extends Stratum_Widget_Base {
|
||||
protected $widget_name = 'testimonial-carousel';
|
||||
|
||||
public $default_arrows_color = '#7a7a7a';
|
||||
|
||||
public function __construct($data = [], $args = null) {
|
||||
parent::__construct( $data, $args );
|
||||
}
|
||||
|
||||
public function get_title() {
|
||||
return esc_html__( 'Testimonial Carousel', 'stratum' );
|
||||
}
|
||||
|
||||
public function get_script_depends() {
|
||||
return [
|
||||
'swiper',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_style_depends() {
|
||||
return [
|
||||
'font-awesome-5-all',
|
||||
'font-awesome-4-shim'
|
||||
];
|
||||
}
|
||||
|
||||
public function get_icon() {
|
||||
return 'stratum-icon-testimonial-carousel';
|
||||
}
|
||||
|
||||
public function get_categories() {
|
||||
return [ 'stratum-widgets' ];
|
||||
}
|
||||
|
||||
protected function register_controls() {
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Content Tab
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
$controls = $this;
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater = new Repeater();
|
||||
|
||||
$repeater->add_control(
|
||||
'content',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXTAREA,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'default' => esc_html__( 'Type your content here...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::MEDIA,
|
||||
'default' => [
|
||||
'url' => Utils::get_placeholder_image_src()
|
||||
],
|
||||
'dynamic' => [ 'active' => true ]
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'image_size',
|
||||
[
|
||||
'type' => 'select',
|
||||
'label' => esc_html__( 'Image Size', 'stratum' ),
|
||||
'default' => 'full',
|
||||
'options' => Stratum::get_instance()->get_scripts_manager()->get_image_sizes()
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'heading',
|
||||
[
|
||||
'label' => esc_html__( 'Heading', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Write heading...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$repeater->add_control(
|
||||
'subtitle',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'type' => Controls_Manager::TEXT,
|
||||
'dynamic' => [
|
||||
'active' => true,
|
||||
],
|
||||
'label_block' => true,
|
||||
'placeholder' => esc_html__( 'Write subtitle...', 'stratum' )
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'slides',
|
||||
[
|
||||
'label' => 'Slides',
|
||||
'type' => Controls_Manager::REPEATER,
|
||||
'separator' => 'after',
|
||||
'default' => [
|
||||
[
|
||||
'heading' => esc_html__( 'Title', 'stratum' ),
|
||||
'subtitle' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'heading' => esc_html__( 'Title', 'stratum' ),
|
||||
'subtitle' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' )
|
||||
],
|
||||
[
|
||||
'heading' => esc_html__( 'Title', 'stratum' ),
|
||||
'subtitle' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'content' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'stratum' )
|
||||
],
|
||||
],
|
||||
'fields' => $repeater->get_controls()
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'alignment',
|
||||
[
|
||||
'label' => esc_html__( 'Alignment', 'stratum' ),
|
||||
'type' => Controls_Manager::CHOOSE,
|
||||
'default' => 'center',
|
||||
'options' => [
|
||||
'left' => [
|
||||
'title' => esc_html__( 'Left', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-left',
|
||||
],
|
||||
'center' => [
|
||||
'title' => esc_html__( 'Center', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-center',
|
||||
],
|
||||
'right' => [
|
||||
'title' => esc_html__( 'Right', 'stratum' ),
|
||||
'icon' => 'eicon-text-align-right',
|
||||
],
|
||||
],
|
||||
'prefix_class' => 'stratum-testimonial-carousel-align%s-',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'slider_width',
|
||||
[
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'label' => esc_html__( 'Slider Width', 'stratum' ),
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 1140
|
||||
],
|
||||
'%' => [
|
||||
'min' => 50
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'default' => [
|
||||
'unit' => '%',
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel .stratum-testimonial-carousel__container' => 'max-width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'content_width',
|
||||
[
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'label' => esc_html__( 'Content Width', 'stratum' ),
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 100,
|
||||
'max' => 1140
|
||||
],
|
||||
'%' => [
|
||||
'min' => 50
|
||||
],
|
||||
],
|
||||
'size_units' => [ '%', 'px' ],
|
||||
'default' => [
|
||||
'unit' => '%'
|
||||
],
|
||||
'tablet_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'mobile_default' => [
|
||||
'unit' => '%',
|
||||
'size' => 100,
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel .stratum-testimonial-carousel__content' => 'max-width: {{SIZE}}{{UNIT}};'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_slides_style',
|
||||
[
|
||||
'label' => esc_html__( 'Slides', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'slide_background_color',
|
||||
[
|
||||
'label' => esc_html__( 'Background Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container' => 'background-color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Box_Shadow::get_type(),
|
||||
[
|
||||
'name' => 'slide_box_shadow',
|
||||
'selector' => '{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container',
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Group_Control_Border::get_type(),
|
||||
[
|
||||
'name' => 'slide_box_border',
|
||||
'label' => esc_html__( 'Box Border', 'stratum' ),
|
||||
'selector' => '{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container',
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'slide_border_radius',
|
||||
[
|
||||
'label' => esc_html__( 'Border Radius', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'size_units' => [ 'px', '%' ],
|
||||
'range' => [
|
||||
'%' => [
|
||||
'max' => 50,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container' => 'border-radius: {{SIZE}}{{UNIT}}'
|
||||
],
|
||||
'condition' => [
|
||||
'slide_box_border_border!' => ''
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'slide_padding',
|
||||
[
|
||||
'label' => esc_html__( 'Padding', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__container-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'slide_margin',
|
||||
[
|
||||
'label' => esc_html__( 'Margin', 'stratum' ),
|
||||
'type' => Controls_Manager::DIMENSIONS,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-main-swiper .swiper-slide .stratum-testimonial-carousel__wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
|
||||
],
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$controls->start_controls_section(
|
||||
'section_content_style',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'tab' => Controls_Manager::TAB_STYLE,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'image_style',
|
||||
[
|
||||
'label' => esc_html__( 'Image', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'image_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__footer' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'heading_style',
|
||||
[
|
||||
'label' => esc_html__( 'Heading', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'heading_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__heading' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'heading_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__heading' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'heading_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-testimonial-carousel__heading',
|
||||
'label' => esc_html__( 'Heading Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'h3',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_style',
|
||||
[
|
||||
'label' => esc_html__( 'Subtitle', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_responsive_control(
|
||||
'subtitle_spacing',
|
||||
[
|
||||
'label' => esc_html__( 'Spacing', 'stratum' ),
|
||||
'type' => Controls_Manager::SLIDER,
|
||||
'range' => [
|
||||
'px' => [
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
],
|
||||
],
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}}',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'subtitle_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__subtitle' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'subtitle_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-testimonial-carousel__subtitle',
|
||||
'label' => esc_html__( 'Subtitle Typography', 'stratum' ),
|
||||
'render_type' => 'template',
|
||||
'defaults' => [
|
||||
'html_tag' => 'span',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_style',
|
||||
[
|
||||
'label' => esc_html__( 'Content', 'stratum' ),
|
||||
'type' => Controls_Manager::HEADING,
|
||||
'separator' => 'before'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_control(
|
||||
'content_color',
|
||||
[
|
||||
'label' => esc_html__( 'Text Color', 'stratum' ),
|
||||
'type' => Controls_Manager::COLOR,
|
||||
'selectors' => [
|
||||
'{{WRAPPER}} .stratum-testimonial-carousel__text' => 'color: {{VALUE}}'
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$controls->add_group_control(
|
||||
Stratum_Group_Control_Typography::get_type(),
|
||||
[
|
||||
'name' => 'text_typography',
|
||||
'selector' => '{{WRAPPER}} .stratum-testimonial-carousel__text',
|
||||
'label' => esc_html__( 'Text Typography', 'stratum' ),
|
||||
'render_type' => 'template'
|
||||
]
|
||||
);
|
||||
|
||||
$controls->end_controls_section();
|
||||
|
||||
$sections = new \Stratum\Sections( $this );
|
||||
$sections->advanced_carousel(
|
||||
[
|
||||
'settings' => Controls_Manager::TAB_CONTENT,
|
||||
'navigation' => Controls_Manager::TAB_STYLE
|
||||
],
|
||||
[],
|
||||
[
|
||||
'mousewheel_control',
|
||||
'slides_to_scroll',
|
||||
'dynamic_bullets',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
protected function render() {
|
||||
$this->render_widget( 'php' );
|
||||
}
|
||||
|
||||
protected function content_template() {}
|
||||
public function render_plain_content( $instance = [] ) {}
|
||||
}
|
||||
|
||||
Plugin::instance()->widgets_manager->register( new Testimonial_Carousel() );
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,202 @@
|
||||
=== Stratum - Elementor Widgets ===
|
||||
Contributors: MotoPress
|
||||
Donate link: https://motopress.com/
|
||||
Tags: elementor, elementor addons, elementor plugins, elementor widgets, elementor extras, elementor essential addons, page builder, accordion, google map, slider, tabs, instagram, timeline, lottie, countdown, table
|
||||
Requires at least: 5.0
|
||||
Tested up to: 6.4
|
||||
Requires PHP: 5.6
|
||||
Stable tag: 1.4.0
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
20+ Premium Elementor widgets, including Advanced Slider, Instagram, Google Maps, Advanced Accordion, Post Grid.
|
||||
|
||||
== Description ==
|
||||
|
||||
Stratum is a free collection of 20+ [Elementor addons](https://motopress.com/products/stratum/) with the aim of enhancing the existing widget functionality of your favorite page builder. Not only do Elementor extras by Stratum provide you with highly-customizable elements but also offer automatic adjustment to the visual styling of your current theme.
|
||||
|
||||
* [View Demo](https://stratum.getmotopress.com/)
|
||||
* [Stratum Elementor widgets](https://motopress.com/blog/category/stratum-elementor-widgets/) overview
|
||||
* [Facebook Community](https://www.facebook.com/groups/stratumaddon)
|
||||
* [Stratum Free/PRO Comparison Table](https://motopress.com/stratum-elementor-widgets-pro-vs-lite/?utm_source=wp-org-stratum-page&utm_medium=text-link&utm_campaign=stratum-pro-table)
|
||||
|
||||
[youtube https://www.youtube.com/watch?v=nXFzhxWzxdo]
|
||||
|
||||
= WHY STRATUM WIDGETS? =
|
||||
|
||||
* FREE collection of 20+ business-oriented widgets;
|
||||
* Inherits visual styling of your current theme;
|
||||
* Does NOT slow down your website;
|
||||
* Elementor template library integration;
|
||||
* Compatible with other Elementor addons;
|
||||
* Fully-adaptive Elementor kit.
|
||||
|
||||
== LIST OF FREE ELEMENTOR WIDGETS ==
|
||||
|
||||
Take a look at the entire collection of Elementor essential addons by Stratum:
|
||||
|
||||
1. [Advanced Accordion](https://stratum.getmotopress.com/advanced-accordion/) - create interactive content using the horizontal accordion tabs; change the accordion type to toggle; integrate the accordion to your custom Library templates.
|
||||
1. [Advanced Google Map](https://stratum.getmotopress.com/advanced-google-map/) - insert your business location on an interactive Google map; use the unlimited number of Google Maps custom markets and map styles.
|
||||
1. [Advanced Posts](https://stratum.getmotopress.com/advanced-posts/) - display the latest project news & showcase the automatically sourced posts and pages using various grid, list, carousel, and masonry layouts.
|
||||
1. [Advanced Slider](https://stratum.getmotopress.com/advanced-slider/) - display product carousels, intro sliders, to make the user focus on the important message; alter the number of columns, horizontal and vertical scrolling, navigation, etc.
|
||||
1. [Advanced Tabs](https://stratum.getmotopress.com/advanced-tabs/) - create fully-customizable horizontal or vertical-oriented tabs that support custom Library templates; shrink the content alignment to space-consuming tabs.
|
||||
1. [Banner](https://stratum.getmotopress.com/banner/) - create animated banners for promos and announcements; add dynamics to your WordPress page; promote several offers at once.
|
||||
1. [Circle Progress Bar](https://stratum.getmotopress.com/circle-progress-bar/) - display the progress in percentages and/or with a text description.
|
||||
1. [Counter](https://stratum.getmotopress.com/counter/) - visualize data using the dynamic animated counter widget.
|
||||
1. [Flip Box](https://stratum.getmotopress.com/flip-box/) - make flip boxes with animation with fully customizable front & back sections; choose between 6 flip effects (the same number as the Pro widget).
|
||||
1. [Image Accordion](https://stratum.getmotopress.com/image-accordion/) - create compact-style image galleries & banners with multiple-image display; highlight your images with amazing hover and click effects.
|
||||
1. [Image Hotspot](https://stratum.getmotopress.com/image-hotspot/) - create animated pointers with tooltips and place them over images; change the styling of pointers & tooltips.
|
||||
1. [Instagram](https://stratum.getmotopress.com/instagram/) - implement a real-life Instagram feed to your WordPress website; display any number of posts & change the number of columns; use it as a free PR tool to attract site visitors to follow your business Instagram profile.
|
||||
1. [Masonry Gallery](https://stratum.getmotopress.com/masonry-gallery/) - create a stunning gallery display using multiple animation effects.
|
||||
1. [Price List](https://stratum.getmotopress.com/price-list/) - create stunning menus, catalogs, and other types of price lists for a website of any kind.
|
||||
1. [Price Menu](https://stratum.getmotopress.com/price-menu/) - display food menus or other listings with prices in a beautiful and structured way.
|
||||
1. [Price Table](https://stratum.getmotopress.com/price-table/) - let customers compare the pricing for each product/service visually using this widget.
|
||||
1. [Testimonial Carousel](https://stratum.getmotopress.com/testimonial-carousel/) - showcase testimonials in the most beautiful & space-consuming way using a carousel; edit reviews in the style that matches your entire website theme.
|
||||
1. [Vertical Timeline](https://stratum.getmotopress.com/vertical-timeline/) - display events in a media-rich vertical timeline graph with smooth animation effects.
|
||||
1. [Horizontal Timeline](https://stratum.getmotopress.com/horizontal-timeline/) - show events in chronological order using a horizontal timeline framework.
|
||||
1. [Lottie Animations](https://stratum.getmotopress.com/lottie-animations/) - add high-quality animations to your WordPress site using the Lottie Animations library and customize animations further.
|
||||
1. [Countdown](https://stratum.getmotopress.com/countdown/) - create a circle or box-styled animated countdown timer and set the real-time countdown up to seconds.
|
||||
1. [Table](https://stratum.getmotopress.com/table/) - the table widget will allow you to create responsive data tables, style rows and columns.
|
||||
1. [Content Switcher](https://stratum.getmotopress.com/content-switcher/) - create tabs or a toggle to structure your content, pricing plans or any other categorized data.
|
||||
|
||||
It makes no difference what kind of a business niche you are involved in, nor does it matter whether you develop an Elementor website for yourself or do it as a service. Stratum made both for beginners and pro users to get their best results while styling up content elements for their Elementor websites.
|
||||
|
||||
Unlike many other third-party Elementor plugins, Stratum offers premium addons for free. Also, the add-on includes several free alternatives to Elementor Pro widgets (Flip Box, Advanced Posts, Testimonial Carousel, etc).
|
||||
|
||||
== 20+ Business-Oriented Elementor Extras ==
|
||||
|
||||
The Stratum's widgets for Elementor help you add business-critical content modules to your website built with the Elementor page builder, including animated promo banners, ready-to-go elements for restaurant menus, pricing and comparison tables, and more beautiful content. Elementor plus Stratum means Elementor premium addons without extra charge!
|
||||
|
||||
All Stratum Elementor widgets are free, while advanced customization settings are available only in a PRO Stratum version.
|
||||
|
||||
[Check out all the extra features of Stratum](https://motopress.com/stratum-elementor-widgets-pro-vs-lite/?utm_source=wp-org-stratum-page&utm_medium=text-link&utm_campaign=stratum-pro).
|
||||
|
||||
== Ready-To-Go Styling of all Elementor Addons ==
|
||||
|
||||
The unique feature that differs Stratum for Elementor from many other premium third-party addons is the ability of any widget to inherit the styling of the current Elementor theme (typography and colors).
|
||||
|
||||
The default design set by Stratum addon is able to reduce the time for customizing and adjusting extra widgets to the theme.
|
||||
|
||||
== Template Library Integration ==
|
||||
|
||||
Integrating custom theme content into Stratum Elementor addons means increasing your working efficiency. Stratum stands for fast yet beautiful and advanced editing as in premium add ons.
|
||||
|
||||
== Build a Mega Menu with Elementor ==
|
||||
|
||||
Want to create a content-rich site navigation menu with Elementor widgets? The Stratum Mega Menu Elementor addon is the solution - you can feature your products, posts, banners or whatever content in submenus and fully tweak their styling. Get Elementor PRO addons for free!
|
||||
|
||||
* [Startum Elementor Mega Menu Plugin](https://motopress.com/products/stratum-menu/?utm_source=wp_org_stratum_page&utm_medium=text_link&utm_campaign=stratum_mega_menu)
|
||||
* [Stratum Mega Menu Demo](https://stratum.getmotopress.com/stratum-mega-menu/?utm_source=wp_org_stratum_page&utm_medium=text_link&utm_campaign=stratum_mega_menu)
|
||||
|
||||
== Copyright ==
|
||||
|
||||
Stratum, Copyright (C) 2020, MotoPress https://motopress.com/
|
||||
Stratum plugin is distributed under the terms of the GNU GPL.
|
||||
|
||||
== Credits ==
|
||||
|
||||
* class.settings-api.php, Copyright 2016 Tareq Hasan, MIT license.
|
||||
* CountUp.js, Copyright 2019 Jamie Perkins, MIT license.
|
||||
* nested.js, Copyright 2013 Andreas Pihlström, MIT license.
|
||||
* masonry.pkgd.min.js, Copyright 2016 David DeSandro, MIT license.
|
||||
* animOnScroll.js, Copyright 2013 Codrops, MIT license.
|
||||
* modernizr.js, Copyright 2014 Faruk, Paul, Alex, Ryan, Patrick, Stu, and Richard, MIT license.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload the plugin to the /wp-content/plugins/ directory.
|
||||
2. Activate the Stratum - Elementor Addons plugin through the 'Plugins' menu in WordPress. (Elementor must be installed and activated!).
|
||||
3. Find Stratum widgets in Elementor.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.4.0, Mar 25 2024 =
|
||||
* Added Instagram Access Token encryption.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.16, Feb 13 2024 =
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.15, May 24 2023 =
|
||||
* Improved compatibility with latest Elementor versions.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.14, Mar 10 2023 =
|
||||
* Fixed miscellaneous Elementor deprecations.
|
||||
|
||||
= 1.3.13, Mar 23 2022 =
|
||||
* Fixed an issue with missing descriptions in the Vertical Timeline widget.
|
||||
* Fixed an issue with multiple markers in the Advanced Google Maps widget.
|
||||
* Fixed an issue when the Swiper slider may not have been initialized with the "Improved Asset Loading" Elementor option enabled.
|
||||
* Fixed an issue with the currency alignment in the Price Table widget.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.12, Nov 30 2021 =
|
||||
* Fixed an issue with Advanced Slider on mobile devices.
|
||||
|
||||
= 1.3.11, Oct 27 2021 =
|
||||
* Security - sanitization and escaping.
|
||||
|
||||
= 1.3.10, Aug 17 2021 =
|
||||
* Fixed an issue with links in Horizontal Timeline and Accordion widgets.
|
||||
|
||||
= 1.3.9, Jul 21 2021 =
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.8, May 5 2021 =
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.7, Apr 1 2021 =
|
||||
* Added Table widget.
|
||||
* Added Content Switcher widget.
|
||||
* Added the ability to automatically refresh Instagram access token.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.6, Feb 17 2021 =
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.5, Dec 23 2020 =
|
||||
* Improved compatibility with WordPress 5.6 and Elementor Pro.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.4, Sep 8 2020 =
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.3.3, Aug 28 2020 =
|
||||
* Added Vertical Timeline widget.
|
||||
* Added Horizontal Timeline widget.
|
||||
* Added Lottie Animations widget.
|
||||
* Added Countdown widget.
|
||||
|
||||
= 1.3.2, Aug 12 2020 =
|
||||
* Improved compatibility with WordPress 5.5.
|
||||
|
||||
= 1.3.1, Jul 31 2020 =
|
||||
* Fixed an issue with Instagram widget.
|
||||
|
||||
= 1.3.0, Jun 10 2020 =
|
||||
* Added Advanced Accordion widget.
|
||||
* Added Advanced Tabs widget.
|
||||
* Added Image Accordion widget.
|
||||
* Improved the plugin color palette.
|
||||
* Added the Templates Library control.
|
||||
* Fixed an issue with "Instagram getToken" in the Instagram widget.
|
||||
* Fixed an issue with controls in the Advanced Google Maps widget.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.2.0, Apr 29 2020 =
|
||||
* Added Advanced Google Map widget.
|
||||
* Added Advanced Posts widget.
|
||||
* Added Advanced Slider widget.
|
||||
* Added Testimonial Carousel widget.
|
||||
* Added Flip Box widget.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.1.0, Mar 30 2020 =
|
||||
* Added Image Hotspot widget.
|
||||
* Added Masonry Gallery widget.
|
||||
* Added Circular Progress Bar widget.
|
||||
* Minor bugfixes and improvements.
|
||||
|
||||
= 1.0.0, Mar 6 2020 =
|
||||
* Initial commit.
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Stratum - Elementor Widgets
|
||||
* Plugin URI: https://motopress.com/products/stratum/
|
||||
* Description: Advanced Elementor addon to extend page builder capabilities and add more advanced features.
|
||||
* Version: 1.4.0
|
||||
* Author: MotoPress
|
||||
* Author URI: https://motopress.com/
|
||||
* License: GPLv2 or later
|
||||
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Text Domain: stratum
|
||||
* Domain Path: /languages
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( !defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( !class_exists( 'Stratum\Stratum' ) ) {
|
||||
|
||||
define( 'STRATUM_PLUGIN_FILE', __FILE__ );
|
||||
define( 'STRATUM_PLUGIN_DIR', plugin_dir_path( STRATUM_PLUGIN_FILE ) ); // The path with trailing slash
|
||||
|
||||
require_once plugin_dir_path( STRATUM_PLUGIN_FILE ) . 'includes/load.php';
|
||||
|
||||
function stratum() {
|
||||
return \Stratum\Stratum::get_instance();
|
||||
}
|
||||
|
||||
//Init Plugin
|
||||
stratum();
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
/**
|
||||
* animOnScroll.js v1.0.0
|
||||
* http://www.codrops.com
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Copyright 2013, Codrops
|
||||
* http://www.codrops.com
|
||||
*/
|
||||
;( function( window ) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var docElem = window.document.documentElement;
|
||||
|
||||
function classReg( className ) {
|
||||
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
|
||||
}
|
||||
|
||||
// classList support for class management
|
||||
// altho to be fair, the api sucks because it won't accept multiple classes at once
|
||||
var hasClass, addClass, removeClass;
|
||||
|
||||
if ( 'classList' in document.documentElement ) {
|
||||
hasClass = function( elem, c ) {
|
||||
return elem.classList.contains( c );
|
||||
};
|
||||
addClass = function( elem, c ) {
|
||||
elem.classList.add( c );
|
||||
};
|
||||
removeClass = function( elem, c ) {
|
||||
elem.classList.remove( c );
|
||||
};
|
||||
}
|
||||
else {
|
||||
hasClass = function( elem, c ) {
|
||||
return classReg( c ).test( elem.className );
|
||||
};
|
||||
addClass = function( elem, c ) {
|
||||
if ( !hasClass( elem, c ) ) {
|
||||
elem.className = elem.className + ' ' + c;
|
||||
}
|
||||
};
|
||||
removeClass = function( elem, c ) {
|
||||
elem.className = elem.className.replace( classReg( c ), ' ' );
|
||||
};
|
||||
}
|
||||
|
||||
function toggleClass( elem, c ) {
|
||||
var fn = hasClass( elem, c ) ? removeClass : addClass;
|
||||
fn( elem, c );
|
||||
}
|
||||
|
||||
var classie = {
|
||||
// full names
|
||||
hasClass: hasClass,
|
||||
addClass: addClass,
|
||||
removeClass: removeClass,
|
||||
toggleClass: toggleClass,
|
||||
// short names
|
||||
has: hasClass,
|
||||
add: addClass,
|
||||
remove: removeClass,
|
||||
toggle: toggleClass
|
||||
};
|
||||
|
||||
// transport
|
||||
if ( typeof define === 'function' && define.amd ) {
|
||||
// AMD
|
||||
define( classie );
|
||||
} else {
|
||||
// browser global
|
||||
window.classie = classie;
|
||||
}
|
||||
|
||||
function getViewportH() {
|
||||
var client = docElem['clientHeight'],
|
||||
inner = window['innerHeight'];
|
||||
|
||||
if( client < inner )
|
||||
return inner;
|
||||
else
|
||||
return client;
|
||||
}
|
||||
|
||||
function scrollY() {
|
||||
return window.pageYOffset || docElem.scrollTop;
|
||||
}
|
||||
|
||||
// http://stackoverflow.com/a/5598797/989439
|
||||
function getOffset( el ) {
|
||||
var offsetTop = 0, offsetLeft = 0;
|
||||
do {
|
||||
if ( !isNaN( el.offsetTop ) ) {
|
||||
offsetTop += el.offsetTop;
|
||||
}
|
||||
if ( !isNaN( el.offsetLeft ) ) {
|
||||
offsetLeft += el.offsetLeft;
|
||||
}
|
||||
} while( el = el.offsetParent )
|
||||
|
||||
return {
|
||||
top : offsetTop,
|
||||
left : offsetLeft
|
||||
}
|
||||
}
|
||||
|
||||
function inViewport( el, h ) {
|
||||
var elH = el.offsetHeight,
|
||||
scrolled = scrollY(),
|
||||
viewed = scrolled + getViewportH(),
|
||||
elTop = getOffset(el).top,
|
||||
elBottom = elTop + elH,
|
||||
// if 0, the element is considered in the viewport as soon as it enters.
|
||||
// if 1, the element is considered in the viewport only when it's fully inside
|
||||
// value in percentage (1 >= h >= 0)
|
||||
h = h || 0;
|
||||
|
||||
return (elTop + elH * h) <= viewed && (elBottom - elH * h) >= scrolled;
|
||||
}
|
||||
|
||||
function extend( a, b ) {
|
||||
for( var key in b ) {
|
||||
if( b.hasOwnProperty( key ) ) {
|
||||
a[key] = b[key];
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
function AnimOnScroll( el, options, masonryOptions ) {
|
||||
this.el = el;
|
||||
this.options = extend( this.defaults, options );
|
||||
this.masonryOptions = masonryOptions;
|
||||
this._init();
|
||||
}
|
||||
|
||||
AnimOnScroll.prototype = {
|
||||
defaults : {
|
||||
// Minimum and a maximum duration of the animation (random value is chosen)
|
||||
minDuration : 0,
|
||||
maxDuration : 0,
|
||||
// The viewportFactor defines how much of the appearing item has to be visible in order to trigger the animation
|
||||
// if we'd use a value of 0, this would mean that it would add the animation class as soon as the item is in the viewport.
|
||||
// If we were to use the value of 1, the animation would only be triggered when we see all of the item in the viewport (100% of it)
|
||||
viewportFactor : 0,
|
||||
animateVisible : false
|
||||
},
|
||||
_init : function() {
|
||||
this.items = Array.prototype.slice.call( jQuery(this.el).find('.masonry-item') );
|
||||
this.itemsCount = this.items.length;
|
||||
this.itemsRenderedCount = 0;
|
||||
this.didScroll = false;
|
||||
|
||||
var self = this;
|
||||
|
||||
imagesLoaded( this.el, function() {
|
||||
|
||||
// initialize masonry
|
||||
if (self.masonryOptions){
|
||||
new Masonry( self.el, self.masonryOptions );
|
||||
}
|
||||
|
||||
if( Modernizr.cssanimations ) {
|
||||
// the items already shown...
|
||||
self.items.forEach( function( el, i ) {
|
||||
if( inViewport( el ) ) {
|
||||
self._checkTotalRendered();
|
||||
|
||||
//fade item after init
|
||||
if (self.options.animateVisible){
|
||||
setTimeout( function() {
|
||||
self._scrollPage();
|
||||
}, 500 );
|
||||
} else {
|
||||
//show item on init
|
||||
classie.add( el, 'shown' );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// animate on scroll the items inside the viewport
|
||||
window.addEventListener( 'scroll', function() {
|
||||
self._onScrollFn();
|
||||
}, false );
|
||||
window.addEventListener( 'resize', function() {
|
||||
self._resizeHandler();
|
||||
}, false );
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
_onScrollFn : function() {
|
||||
var self = this;
|
||||
if( !this.didScroll ) {
|
||||
this.didScroll = true;
|
||||
setTimeout( function() { self._scrollPage(); }, 60 );
|
||||
}
|
||||
},
|
||||
_scrollPage : function() {
|
||||
var self = this;
|
||||
this.items.forEach( function( el, i ) {
|
||||
if( !classie.has( el, 'shown' ) && !classie.has( el, 'animate' ) && inViewport( el, self.options.viewportFactor ) ) {
|
||||
setTimeout( function() {
|
||||
var el_offset = $( self.el ).offset();
|
||||
var el_scrollY = (parseFloat(scrollY() - el_offset.top) < 0) ? 0 : (scrollY() - el_offset.top);
|
||||
var perspY = el_scrollY + getViewportH() / 2;
|
||||
self.el.style.WebkitPerspectiveOrigin = '50% ' + perspY + 'px';
|
||||
self.el.style.MozPerspectiveOrigin = '50% ' + perspY + 'px';
|
||||
self.el.style.perspectiveOrigin = '50% ' + perspY + 'px';
|
||||
|
||||
self._checkTotalRendered();
|
||||
|
||||
if( self.options.minDuration && self.options.maxDuration ) {
|
||||
var randDuration = ( Math.random() * ( self.options.maxDuration - self.options.minDuration ) + self.options.minDuration ) + 's';
|
||||
el.style.WebkitAnimationDuration = randDuration;
|
||||
el.style.MozAnimationDuration = randDuration;
|
||||
el.style.animationDuration = randDuration;
|
||||
}
|
||||
|
||||
classie.add( el, 'animate' );
|
||||
}, 25 );
|
||||
}
|
||||
});
|
||||
this.didScroll = false;
|
||||
},
|
||||
_resizeHandler : function() {
|
||||
var self = this;
|
||||
function delayed() {
|
||||
self._scrollPage();
|
||||
self.resizeTimeout = null;
|
||||
}
|
||||
if ( this.resizeTimeout ) {
|
||||
clearTimeout( this.resizeTimeout );
|
||||
}
|
||||
this.resizeTimeout = setTimeout( delayed, 1000 );
|
||||
},
|
||||
_checkTotalRendered : function() {
|
||||
++this.itemsRenderedCount;
|
||||
if( this.itemsRenderedCount === this.itemsCount ) {
|
||||
window.removeEventListener( 'scroll', this._onScrollFn );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add to global namespace
|
||||
window.AnimOnScroll = AnimOnScroll;
|
||||
|
||||
} )( window );
|
||||
@@ -0,0 +1,209 @@
|
||||
.masonry-grid .masonry-item.shown,
|
||||
.no-js .masonry-grid .masonry-item,
|
||||
.no-cssanimations .masonry-grid .masonry-item
|
||||
{
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.masonry-grid .masonry-item a,
|
||||
.masonry-grid .masonry-item img {
|
||||
outline: none;
|
||||
border: none;
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Effect 1: opacity */
|
||||
.masonry-grid.effect-1 .masonry-item.animate {
|
||||
-webkit-animation: fadeIn 0.65s ease forwards;
|
||||
animation: fadeIn 0.65s ease forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fadeIn {
|
||||
0% { }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
0% { }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
|
||||
/* Effect 2: Move Up */
|
||||
.masonry-grid.effect-2 .masonry-item.animate {
|
||||
-webkit-transform: translateY(200px);
|
||||
transform: translateY(200px);
|
||||
-webkit-animation: moveUp 0.65s ease forwards;
|
||||
animation: moveUp 0.65s ease forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes moveUp {
|
||||
0% { }
|
||||
100% { -webkit-transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes moveUp {
|
||||
0% { }
|
||||
100% { -webkit-transform: translateY(0); transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Effect 3: Scale up */
|
||||
.masonry-grid.effect-3 .masonry-item.animate {
|
||||
-webkit-transform: scale(0.6);
|
||||
transform: scale(0.6);
|
||||
-webkit-animation: scaleUp 0.65s ease-in-out forwards;
|
||||
animation: scaleUp 0.65s ease-in-out forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes scaleUp {
|
||||
0% { }
|
||||
100% { -webkit-transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes scaleUp {
|
||||
0% { }
|
||||
100% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Effect 4: fall perspective */
|
||||
.masonry-grid.effect-4 {
|
||||
-webkit-perspective: 1300px;
|
||||
perspective: 1300px;
|
||||
}
|
||||
|
||||
.masonry-grid.effect-4 .masonry-item.animate {
|
||||
-webkit-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
-webkit-transform: translateZ(400px) translateY(300px) rotateX(-90deg);
|
||||
transform: translateZ(400px) translateY(300px) rotateX(-90deg);
|
||||
-webkit-animation: fallPerspective .8s ease-in-out forwards;
|
||||
animation: fallPerspective .8s ease-in-out forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fallPerspective {
|
||||
0% { }
|
||||
100% { -webkit-transform: translateZ(0px) translateY(0px) rotateX(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes fallPerspective {
|
||||
0% { }
|
||||
100% { -webkit-transform: translateZ(0px) translateY(0px) rotateX(0deg); transform: translateZ(0px) translateY(0px) rotateX(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Effect 5: fly (based on http://lab.hakim.se/scroll-effects/ by @hakimel) */
|
||||
.masonry-grid.effect-5 {
|
||||
-webkit-perspective: 1300px;
|
||||
perspective: 1300px;
|
||||
}
|
||||
|
||||
.masonry-grid.effect-5 .masonry-item.animate {
|
||||
-webkit-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
-webkit-transform-origin: 50% 50% -300px;
|
||||
transform-origin: 50% 50% -300px;
|
||||
-webkit-transform: rotateX(-180deg);
|
||||
transform: rotateX(-180deg);
|
||||
-webkit-animation: fly .8s ease-in-out forwards;
|
||||
animation: fly .8s ease-in-out forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fly {
|
||||
0% { }
|
||||
100% { -webkit-transform: rotateX(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes fly {
|
||||
0% { }
|
||||
100% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Effect 6: flip (based on http://lab.hakim.se/scroll-effects/ by @hakimel) */
|
||||
.masonry-grid.effect-6 {
|
||||
-webkit-perspective: 1300px;
|
||||
perspective: 1300px;
|
||||
}
|
||||
|
||||
.masonry-grid.effect-6 .masonry-item.animate {
|
||||
-webkit-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
-webkit-transform-origin: 0% 0%;
|
||||
transform-origin: 0% 0%;
|
||||
-webkit-transform: rotateX(-80deg);
|
||||
transform: rotateX(-80deg);
|
||||
-webkit-animation: flip .8s ease-in-out forwards;
|
||||
animation: flip .8s ease-in-out forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes flip {
|
||||
0% { }
|
||||
100% { -webkit-transform: rotateX(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes flip {
|
||||
0% { }
|
||||
100% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Effect 7: helix (based on http://lab.hakim.se/scroll-effects/ by @hakimel) */
|
||||
.masonry-grid.effect-7 {
|
||||
-webkit-perspective: 1300px;
|
||||
perspective: 1300px;
|
||||
}
|
||||
|
||||
.masonry-grid.effect-7 .masonry-item.animate {
|
||||
-webkit-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
-webkit-transform: rotateY(-180deg);
|
||||
transform: rotateY(-180deg);
|
||||
-webkit-animation: helix .8s ease-in-out forwards;
|
||||
animation: helix .8s ease-in-out forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes helix {
|
||||
0% { }
|
||||
100% { -webkit-transform: rotateY(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes helix {
|
||||
0% { }
|
||||
100% { -webkit-transform: rotateY(0deg); transform: rotateY(0deg); opacity: 1; }
|
||||
}
|
||||
|
||||
/* Effect 8: Zoom In */
|
||||
.masonry-grid.effect-8 {
|
||||
-webkit-perspective: 1300px;
|
||||
perspective: 1300px;
|
||||
}
|
||||
|
||||
.masonry-grid.effect-8 .masonry-item.animate {
|
||||
-webkit-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
-webkit-transform: scale(0.4);
|
||||
transform: scale(0.4);
|
||||
-webkit-animation: popUp .8s ease-in forwards;
|
||||
animation: popUp .8s ease-in forwards;
|
||||
}
|
||||
|
||||
@-webkit-keyframes popUp {
|
||||
0% { }
|
||||
70% { -webkit-transform: scale(1.1); opacity: .8; -webkit-animation-timing-function: ease-out; }
|
||||
100% { -webkit-transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes popUp {
|
||||
0% { }
|
||||
70% { -webkit-transform: scale(1.1); transform: scale(1.1); opacity: .8; -webkit-animation-timing-function: ease-out; animation-timing-function: ease-out; }
|
||||
100% { -webkit-transform: scale(1); transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
.masonry-grid .masonry-item {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 400px) {
|
||||
.masonry-grid .masonry-item {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
// playground: stackblitz.com/edit/countup-typescript
|
||||
var CountUp = /** @class */ (function () {
|
||||
function CountUp(target, endVal, options) {
|
||||
var _this = this;
|
||||
this.target = target;
|
||||
this.endVal = endVal;
|
||||
this.options = options;
|
||||
this.version = '2.0.4';
|
||||
this.defaults = {
|
||||
startVal: 0,
|
||||
decimalPlaces: 0,
|
||||
duration: 2,
|
||||
useEasing: true,
|
||||
useGrouping: true,
|
||||
smartEasingThreshold: 999,
|
||||
smartEasingAmount: 333,
|
||||
separator: ',',
|
||||
decimal: '.',
|
||||
prefix: '',
|
||||
suffix: ''
|
||||
};
|
||||
this.finalEndVal = null; // for smart easing
|
||||
this.useEasing = true;
|
||||
this.countDown = false;
|
||||
this.error = '';
|
||||
this.startVal = 0;
|
||||
this.paused = true;
|
||||
this.count = function (timestamp) {
|
||||
if (!_this.startTime) {
|
||||
_this.startTime = timestamp;
|
||||
}
|
||||
var progress = timestamp - _this.startTime;
|
||||
_this.remaining = _this.duration - progress;
|
||||
// to ease or not to ease
|
||||
if (_this.useEasing) {
|
||||
if (_this.countDown) {
|
||||
_this.frameVal = _this.startVal - _this.easingFn(progress, 0, _this.startVal - _this.endVal, _this.duration);
|
||||
}
|
||||
else {
|
||||
_this.frameVal = _this.easingFn(progress, _this.startVal, _this.endVal - _this.startVal, _this.duration);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (_this.countDown) {
|
||||
_this.frameVal = _this.startVal - ((_this.startVal - _this.endVal) * (progress / _this.duration));
|
||||
}
|
||||
else {
|
||||
_this.frameVal = _this.startVal + (_this.endVal - _this.startVal) * (progress / _this.duration);
|
||||
}
|
||||
}
|
||||
// don't go past endVal since progress can exceed duration in the last frame
|
||||
if (_this.countDown) {
|
||||
_this.frameVal = (_this.frameVal < _this.endVal) ? _this.endVal : _this.frameVal;
|
||||
}
|
||||
else {
|
||||
_this.frameVal = (_this.frameVal > _this.endVal) ? _this.endVal : _this.frameVal;
|
||||
}
|
||||
// decimal
|
||||
_this.frameVal = Math.round(_this.frameVal * _this.decimalMult) / _this.decimalMult;
|
||||
// format and print value
|
||||
_this.printValue(_this.frameVal);
|
||||
// whether to continue
|
||||
if (progress < _this.duration) {
|
||||
_this.rAF = requestAnimationFrame(_this.count);
|
||||
}
|
||||
else if (_this.finalEndVal !== null) {
|
||||
// smart easing
|
||||
_this.update(_this.finalEndVal);
|
||||
}
|
||||
else {
|
||||
if (_this.callback) {
|
||||
_this.callback();
|
||||
}
|
||||
}
|
||||
};
|
||||
// default format and easing functions
|
||||
this.formatNumber = function (num) {
|
||||
var neg = (num < 0) ? '-' : '';
|
||||
var result, x, x1, x2, x3;
|
||||
result = Math.abs(num).toFixed(_this.options.decimalPlaces);
|
||||
result += '';
|
||||
x = result.split('.');
|
||||
x1 = x[0];
|
||||
x2 = x.length > 1 ? _this.options.decimal + x[1] : '';
|
||||
if (_this.options.useGrouping) {
|
||||
x3 = '';
|
||||
for (var i = 0, len = x1.length; i < len; ++i) {
|
||||
if (i !== 0 && (i % 3) === 0) {
|
||||
x3 = _this.options.separator + x3;
|
||||
}
|
||||
x3 = x1[len - i - 1] + x3;
|
||||
}
|
||||
x1 = x3;
|
||||
}
|
||||
// optional numeral substitution
|
||||
if (_this.options.numerals && _this.options.numerals.length) {
|
||||
x1 = x1.replace(/[0-9]/g, function (w) { return _this.options.numerals[+w]; });
|
||||
x2 = x2.replace(/[0-9]/g, function (w) { return _this.options.numerals[+w]; });
|
||||
}
|
||||
return neg + _this.options.prefix + x1 + x2 + _this.options.suffix;
|
||||
};
|
||||
this.easeOutExpo = function (t, b, c, d) {
|
||||
return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b;
|
||||
};
|
||||
this.options = __assign({}, this.defaults, options);
|
||||
this.formattingFn = (this.options.formattingFn) ?
|
||||
this.options.formattingFn : this.formatNumber;
|
||||
this.easingFn = (this.options.easingFn) ?
|
||||
this.options.easingFn : this.easeOutExpo;
|
||||
this.startVal = this.validateValue(this.options.startVal);
|
||||
this.frameVal = this.startVal;
|
||||
this.endVal = this.validateValue(endVal);
|
||||
this.options.decimalPlaces = Math.max(0 || this.options.decimalPlaces);
|
||||
this.decimalMult = Math.pow(10, this.options.decimalPlaces);
|
||||
this.resetDuration();
|
||||
this.options.separator = String(this.options.separator);
|
||||
this.useEasing = this.options.useEasing;
|
||||
if (this.options.separator === '') {
|
||||
this.options.useGrouping = false;
|
||||
}
|
||||
this.el = (typeof target === 'string') ? document.getElementById(target) : target;
|
||||
if (this.el) {
|
||||
this.printValue(this.startVal);
|
||||
}
|
||||
else {
|
||||
this.error = '[CountUp] target is null or undefined';
|
||||
}
|
||||
}
|
||||
// determines where easing starts and whether to count down or up
|
||||
CountUp.prototype.determineDirectionAndSmartEasing = function () {
|
||||
var end = (this.finalEndVal) ? this.finalEndVal : this.endVal;
|
||||
this.countDown = (this.startVal > end);
|
||||
var animateAmount = end - this.startVal;
|
||||
if (Math.abs(animateAmount) > this.options.smartEasingThreshold) {
|
||||
this.finalEndVal = end;
|
||||
var up = (this.countDown) ? 1 : -1;
|
||||
this.endVal = end + (up * this.options.smartEasingAmount);
|
||||
this.duration = this.duration / 2;
|
||||
}
|
||||
else {
|
||||
this.endVal = end;
|
||||
this.finalEndVal = null;
|
||||
}
|
||||
if (this.finalEndVal) {
|
||||
this.useEasing = false;
|
||||
}
|
||||
else {
|
||||
this.useEasing = this.options.useEasing;
|
||||
}
|
||||
};
|
||||
// start animation
|
||||
CountUp.prototype.start = function (callback) {
|
||||
if (this.error) {
|
||||
return;
|
||||
}
|
||||
this.callback = callback;
|
||||
if (this.duration > 0) {
|
||||
this.determineDirectionAndSmartEasing();
|
||||
this.paused = false;
|
||||
this.rAF = requestAnimationFrame(this.count);
|
||||
}
|
||||
else {
|
||||
this.printValue(this.endVal);
|
||||
}
|
||||
};
|
||||
// pause/resume animation
|
||||
CountUp.prototype.pauseResume = function () {
|
||||
if (!this.paused) {
|
||||
cancelAnimationFrame(this.rAF);
|
||||
}
|
||||
else {
|
||||
this.startTime = null;
|
||||
this.duration = this.remaining;
|
||||
this.startVal = this.frameVal;
|
||||
this.determineDirectionAndSmartEasing();
|
||||
this.rAF = requestAnimationFrame(this.count);
|
||||
}
|
||||
this.paused = !this.paused;
|
||||
};
|
||||
// reset to startVal so animation can be run again
|
||||
CountUp.prototype.reset = function () {
|
||||
cancelAnimationFrame(this.rAF);
|
||||
this.paused = true;
|
||||
this.resetDuration();
|
||||
this.startVal = this.validateValue(this.options.startVal);
|
||||
this.frameVal = this.startVal;
|
||||
this.printValue(this.startVal);
|
||||
};
|
||||
// pass a new endVal and start animation
|
||||
CountUp.prototype.update = function (newEndVal) {
|
||||
cancelAnimationFrame(this.rAF);
|
||||
this.startTime = null;
|
||||
this.endVal = this.validateValue(newEndVal);
|
||||
if (this.endVal === this.frameVal) {
|
||||
return;
|
||||
}
|
||||
this.startVal = this.frameVal;
|
||||
if (!this.finalEndVal) {
|
||||
this.resetDuration();
|
||||
}
|
||||
this.determineDirectionAndSmartEasing();
|
||||
this.rAF = requestAnimationFrame(this.count);
|
||||
};
|
||||
CountUp.prototype.printValue = function (val) {
|
||||
var result = this.formattingFn(val);
|
||||
if (this.el.tagName === 'INPUT') {
|
||||
var input = this.el;
|
||||
input.value = result;
|
||||
}
|
||||
else if (this.el.tagName === 'text' || this.el.tagName === 'tspan') {
|
||||
this.el.textContent = result;
|
||||
}
|
||||
else {
|
||||
this.el.innerHTML = result;
|
||||
}
|
||||
};
|
||||
CountUp.prototype.ensureNumber = function (n) {
|
||||
return (typeof n === 'number' && !isNaN(n));
|
||||
};
|
||||
CountUp.prototype.validateValue = function (value) {
|
||||
var newValue = Number(value);
|
||||
if (!this.ensureNumber(newValue)) {
|
||||
this.error = "[CountUp] invalid start or end value: " + value;
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return newValue;
|
||||
}
|
||||
};
|
||||
CountUp.prototype.resetDuration = function () {
|
||||
this.startTime = null;
|
||||
this.duration = Number(this.options.duration) * 1000;
|
||||
this.remaining = this.duration;
|
||||
};
|
||||
return CountUp;
|
||||
}());
|
||||
@@ -0,0 +1 @@
|
||||
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var i,a=1,s=arguments.length;a<s;a++)for(var n in i=arguments[a])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)},CountUp=function(){function t(t,i,a){var s=this;this.target=t,this.endVal=i,this.options=a,this.version="2.0.4",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:""},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.count=function(t){s.startTime||(s.startTime=t);var i=t-s.startTime;s.remaining=s.duration-i,s.useEasing?s.countDown?s.frameVal=s.startVal-s.easingFn(i,0,s.startVal-s.endVal,s.duration):s.frameVal=s.easingFn(i,s.startVal,s.endVal-s.startVal,s.duration):s.countDown?s.frameVal=s.startVal-(s.startVal-s.endVal)*(i/s.duration):s.frameVal=s.startVal+(s.endVal-s.startVal)*(i/s.duration),s.countDown?s.frameVal=s.frameVal<s.endVal?s.endVal:s.frameVal:s.frameVal=s.frameVal>s.endVal?s.endVal:s.frameVal,s.frameVal=Math.round(s.frameVal*s.decimalMult)/s.decimalMult,s.printValue(s.frameVal),i<s.duration?s.rAF=requestAnimationFrame(s.count):null!==s.finalEndVal?s.update(s.finalEndVal):s.callback&&s.callback()},this.formatNumber=function(t){var i,a,n,e,r,o=t<0?"-":"";if(i=Math.abs(t).toFixed(s.options.decimalPlaces),n=(a=(i+="").split("."))[0],e=a.length>1?s.options.decimal+a[1]:"",s.options.useGrouping){r="";for(var l=0,h=n.length;l<h;++l)0!==l&&l%3==0&&(r=s.options.separator+r),r=n[h-l-1]+r;n=r}return s.options.numerals&&s.options.numerals.length&&(n=n.replace(/[0-9]/g,function(t){return s.options.numerals[+t]}),e=e.replace(/[0-9]/g,function(t){return s.options.numerals[+t]})),o+s.options.prefix+n+e+s.options.suffix},this.easeOutExpo=function(t,i,a,s){return a*(1-Math.pow(2,-10*t/s))*1024/1023+i},this.options=__assign({},this.defaults,a),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(i),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.decimalMult=Math.pow(10,this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el="string"==typeof t?document.getElementById(t):t,this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined"}return t.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var i=t-this.startVal;if(Math.abs(i)>this.options.smartEasingThreshold){this.finalEndVal=t;var a=this.countDown?1:-1;this.endVal=t+a*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},t.prototype.start=function(t){this.error||(this.callback=t,this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},t.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},t.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},t.prototype.update=function(t){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(t),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal||this.resetDuration(),this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},t.prototype.printValue=function(t){var i=this.formattingFn(t);"INPUT"===this.el.tagName?this.el.value=i:"text"===this.el.tagName||"tspan"===this.el.tagName?this.el.textContent=i:this.el.innerHTML=i},t.prototype.ensureNumber=function(t){return"number"==typeof t&&!isNaN(t)},t.prototype.validateValue=function(t){var i=Number(t);return this.ensureNumber(i)?i:(this.error="[CountUp] invalid start or end value: "+t,null)},t.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},t}();
|
||||
@@ -0,0 +1,398 @@
|
||||
/**
|
||||
* donutty // Create SVG donut charts with Javascript
|
||||
* @author simeydotme <[email protected]>
|
||||
* @version 2.0.0
|
||||
* @license MIT
|
||||
* @link http://simey.me
|
||||
* @preserve
|
||||
*/
|
||||
|
||||
(function( doc, win ) {
|
||||
|
||||
var donutty,
|
||||
namespace = "http://www.w3.org/2000/svg";
|
||||
|
||||
function isDefined( input ) {
|
||||
return typeof input !== "undefined";
|
||||
}
|
||||
|
||||
function float( input ) {
|
||||
return parseFloat( input, 10 );
|
||||
}
|
||||
|
||||
function truth( input ) {
|
||||
return isDefined( input ) && ( input === true || input === "true" );
|
||||
}
|
||||
|
||||
donutty = win.Donutty = function( el, options ) {
|
||||
|
||||
if ( el && typeof el === "string" ) {
|
||||
this.$wrapper = doc.querySelectorAll( el )[0];
|
||||
} else if ( doc.querySelector( `.${el.className}` ) ) {
|
||||
this.$wrapper = el;
|
||||
} else {
|
||||
this.$wrapper = doc.body;
|
||||
options = el;
|
||||
}
|
||||
|
||||
if ( !this.$wrapper ) {
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
if ( !isDefined( options ) ) {
|
||||
|
||||
options = this.getOptionsFromTag();
|
||||
|
||||
}
|
||||
|
||||
this.state = {};
|
||||
this.options = options || {};
|
||||
this.options.min = isDefined( this.options.min ) ? float( this.options.min ) : 0;
|
||||
this.options.max = isDefined( this.options.max ) ? float( this.options.max ) : 100;
|
||||
this.options.value = isDefined( this.options.value ) ? float( this.options.value ) : 50;
|
||||
this.options.round = isDefined( this.options.round ) ? truth( this.options.round ) : true;
|
||||
this.options.circle = isDefined( this.options.circle ) ? truth( this.options.circle ) : true;
|
||||
this.options.padding = isDefined( this.options.padding ) ? float( this.options.padding ) : 4;
|
||||
this.options.radius = float( this.options.radius ) || 50;
|
||||
this.options.thickness = float( this.options.thickness ) || 10;
|
||||
this.options.bg = this.options.bg || "rgba(70, 130, 180, 0.15)";
|
||||
this.options.color = this.options.color || "mediumslateblue";
|
||||
this.options.transition = this.options.transition || "all 1.2s cubic-bezier(0.57, 0.13, 0.18, 0.98)";
|
||||
this.options.text = isDefined( this.options.text ) ? this.options.text : false;
|
||||
|
||||
this.init();
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.getOptionsFromTag = function() {
|
||||
|
||||
return JSON.parse(JSON.stringify(this.$wrapper.dataset));
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.init = function() {
|
||||
|
||||
this.$wrapper.donutty = this;
|
||||
|
||||
var values;
|
||||
|
||||
// create the state object from the options,
|
||||
// and then get the dash values for use in element creation
|
||||
this.createState();
|
||||
values = this.getDashValues();
|
||||
|
||||
this.createSvg();
|
||||
this.createBg( values );
|
||||
this.createDonut( values );
|
||||
this.createText();
|
||||
this.insertFragments( values );
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.createState = function() {
|
||||
|
||||
this.state.min = this.options.min;
|
||||
this.state.max = this.options.max;
|
||||
this.state.value = this.options.value;
|
||||
this.state.bg = this.options.bg;
|
||||
this.state.color = this.options.color;
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.createText = function() {
|
||||
|
||||
if ( typeof this.options.text === "function" ) {
|
||||
|
||||
this.$text = doc.createElement( "span" );
|
||||
this.$text.setAttribute( "class", "donut-text" );
|
||||
this.$text.style.opacity = 0;
|
||||
this.updateText();
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.createBg = function( values ) {
|
||||
|
||||
this.$bg = doc.createElementNS( namespace, "circle" );
|
||||
|
||||
this.$bg.setAttribute( "cx", "50%" );
|
||||
this.$bg.setAttribute( "cy", "50%" );
|
||||
this.$bg.setAttribute( "r", this.options.radius );
|
||||
this.$bg.setAttribute( "fill", "transparent" );
|
||||
this.$bg.setAttribute( "stroke", this.state.bg );
|
||||
this.$bg.setAttribute( "stroke-width", this.options.thickness + this.options.padding );
|
||||
this.$bg.setAttribute( "stroke-dasharray", values.full * values.multiplier );
|
||||
this.$bg.setAttribute( "class", "donut-bg" );
|
||||
|
||||
if ( this.options.round ) {
|
||||
this.$bg.setAttribute( "stroke-linecap", "round" );
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.createDonut = function( values ) {
|
||||
|
||||
this.$donut = doc.createElementNS( namespace, "circle" );
|
||||
|
||||
this.$donut.setAttribute( "fill", "transparent" );
|
||||
this.$donut.setAttribute( "cx", "50%" );
|
||||
this.$donut.setAttribute( "cy", "50%" );
|
||||
this.$donut.setAttribute( "r", this.options.radius );
|
||||
this.$donut.setAttribute( "stroke", this.state.color );
|
||||
this.$donut.setAttribute( "stroke-width", this.options.thickness );
|
||||
this.$donut.setAttribute( "stroke-dashoffset", values.full );
|
||||
this.$donut.setAttribute( "stroke-dasharray", values.full );
|
||||
this.$donut.setAttribute( "class", "donut-fill" );
|
||||
this.$donut.style.opacity = 0;
|
||||
|
||||
if ( this.options.round ) {
|
||||
this.$donut.setAttribute( "stroke-linecap", "round" );
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.createSvg = function() {
|
||||
|
||||
var viewbox = this.options.radius * 2 + this.options.thickness + ( this.options.padding * 2 ),
|
||||
rotateExtra = this.options.round ? this.options.thickness / 3 : 0,
|
||||
rotate = this.options.circle ? 90 + rotateExtra : -225;
|
||||
|
||||
this.$html = doc.createDocumentFragment();
|
||||
this.$svg = doc.createElementNS( namespace, "svg" );
|
||||
|
||||
this.$svg.setAttribute( "xmlns", namespace );
|
||||
this.$svg.setAttribute( "viewbox", "0 0 " + viewbox + " " + viewbox );
|
||||
this.$svg.setAttribute( "transform", "rotate( " + rotate +" )" );
|
||||
this.$svg.setAttribute( "preserveAspectRatio", "xMidYMid meet" );
|
||||
this.$svg.setAttribute( "class", "donut" );
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.insertFragments = function( values ) {
|
||||
|
||||
this.$svg.appendChild( this.$bg );
|
||||
this.$svg.appendChild( this.$donut );
|
||||
this.$html.appendChild( this.$svg );
|
||||
|
||||
if ( this.$text ) {
|
||||
this.$html.appendChild( this.$text );
|
||||
}
|
||||
|
||||
this.$wrapper.appendChild( this.$html );
|
||||
|
||||
// because of a strange bug in browsers not updating
|
||||
// the "preserveAspectRatio" setting when applied programmatically,
|
||||
// we need to essentially delete the DOM fragment, and then
|
||||
// set the innerHTML of the parent so that it updates in browser.
|
||||
this.$wrapper.innerHTML = this.$wrapper.innerHTML;
|
||||
|
||||
// and because we just destroyed the DOM fragment and all
|
||||
// the references to it, we now set all those references again.
|
||||
this.$svg = this.$wrapper.querySelector(".donut");
|
||||
this.$bg = this.$wrapper.querySelector(".donut-bg");
|
||||
this.$donut = this.$wrapper.querySelector(".donut-fill");
|
||||
if ( this.$text ) {
|
||||
this.$text = this.$wrapper.querySelector(".donut-text");
|
||||
}
|
||||
|
||||
// now the references are re-set, we can go
|
||||
// ahead and animate the element again.
|
||||
this.animate( values.fill, values.full );
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.getDashValues = function() {
|
||||
|
||||
var circumference,
|
||||
percentageFilled,
|
||||
absoluteFilled,
|
||||
multiplier;
|
||||
|
||||
multiplier = this.options.circle ? 1 : 0.75;
|
||||
circumference = 2 * Math.PI * this.options.radius;
|
||||
percentageFilled = ( this.state.value - this.state.min ) / ( this.state.max - this.state.min ) * 100;
|
||||
absoluteFilled = circumference - ( ( circumference * multiplier ) / 100 * percentageFilled );
|
||||
|
||||
if (
|
||||
this.options.round &&
|
||||
this.options.circle &&
|
||||
percentageFilled < 100 &&
|
||||
absoluteFilled < this.options.thickness
|
||||
) {
|
||||
|
||||
// when in circle mode, if the linecaps are "round"
|
||||
// then the circle would look complete if it is actually
|
||||
// only ~97% complete, this is because the linecaps
|
||||
// overhang the stroke.
|
||||
absoluteFilled = this.options.thickness;
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
fill: absoluteFilled,
|
||||
full: circumference,
|
||||
multiplier: multiplier
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
donutty.prototype.animate = function( fill, full ) {
|
||||
|
||||
var _this = this;
|
||||
|
||||
// ensure the transition property is applied before
|
||||
// the actual properties are set, so that browser renders
|
||||
// the transition
|
||||
_this.$bg.style.transition = this.options.transition;
|
||||
_this.$donut.style.transition = this.options.transition;
|
||||
if ( _this.$text ) {
|
||||
_this.$text.style.transition = this.options.transition;
|
||||
}
|
||||
|
||||
// use a short timeout (~60fps) to simulate a new
|
||||
// animation frame (not using rAF due to ie9 problems)
|
||||
window.setTimeout( function() {
|
||||
|
||||
_this.$bg.setAttribute( "stroke", _this.state.bg );
|
||||
_this.$bg.style.opacity = 1;
|
||||
|
||||
_this.$donut.setAttribute( "stroke-dashoffset", fill );
|
||||
_this.$donut.setAttribute( "stroke-dasharray", full );
|
||||
_this.$donut.setAttribute( "stroke", _this.state.color );
|
||||
_this.$donut.style.opacity = 1;
|
||||
|
||||
if ( _this.$text ) {
|
||||
_this.$text.style.opacity = 1;
|
||||
}
|
||||
|
||||
}, 16 );
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* use the current state to set the text inside
|
||||
* the text element (only if option is provided);
|
||||
* @return {object} the donut instance
|
||||
*/
|
||||
donutty.prototype.updateText = function() {
|
||||
|
||||
if ( typeof this.options.text === "function" ) {
|
||||
|
||||
this.$text.innerHTML = this.options.text( this.state );
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* set an individual state property for the chart
|
||||
* @param {string} prop the property to set
|
||||
* @param {string/number} val the value of the given property
|
||||
* @return {object} the donut instance
|
||||
* @chainable
|
||||
*/
|
||||
donutty.prototype.set = function( prop, val ) {
|
||||
|
||||
var values;
|
||||
|
||||
if ( isDefined( prop ) && isDefined( val ) ) {
|
||||
|
||||
this.state[ prop ] = val;
|
||||
values = this.getDashValues();
|
||||
this.updateText();
|
||||
this.animate( values.fill, values.full );
|
||||
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* set multiple state properties with an object
|
||||
* @param {object} newState a map of properties to set
|
||||
* @return {object} the donut instance
|
||||
* @chainable
|
||||
*/
|
||||
donutty.prototype.setState = function( newState ) {
|
||||
|
||||
var values;
|
||||
|
||||
if ( isDefined( newState.value ) ) {
|
||||
this.state.value = newState.value;
|
||||
}
|
||||
|
||||
if ( isDefined( newState.min ) ) {
|
||||
this.state.min = newState.min;
|
||||
}
|
||||
|
||||
if ( isDefined( newState.max ) ) {
|
||||
this.state.max = newState.max;
|
||||
}
|
||||
|
||||
if ( isDefined( newState.bg ) ) {
|
||||
this.state.bg = newState.bg;
|
||||
}
|
||||
|
||||
if ( isDefined( newState.color ) ) {
|
||||
this.state.color = newState.color;
|
||||
}
|
||||
|
||||
values = this.getDashValues();
|
||||
this.updateText();
|
||||
this.animate( values.fill, values.full );
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
}( document, window ));
|
||||
|
||||
// jquery constructor
|
||||
|
||||
( function( Donutty, $ ) {
|
||||
|
||||
if ( typeof window.$ !== "undefined" ) {
|
||||
|
||||
$( function() {
|
||||
|
||||
$.fn.donutty = function( options ) {
|
||||
|
||||
return $( this ).each( function() {
|
||||
|
||||
new Donutty( this, options );
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
$( "[data-donutty]" ).donutty();
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
console.warn( "Can't find jQuery to attach Donutty" );
|
||||
|
||||
}
|
||||
|
||||
}( Donutty, jQuery ));
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* donutty // Create SVG donut charts with Javascript
|
||||
* @author simeydotme <[email protected]>
|
||||
* @version 2.0.0
|
||||
* @license MIT
|
||||
* @link http://simey.me
|
||||
* @preserve
|
||||
*/
|
||||
!function(t,i){var s,e="http://www.w3.org/2000/svg";function o(t){return void 0!==t}function n(t){return parseFloat(t,10)}function r(t){return o(t)&&(!0===t||"true"===t)}(s=i.Donutty=function(i,s){return i&&"string"==typeof i?this.$wrapper=t.querySelectorAll(i)[0]:t.querySelector(`.${i.className}`)?this.$wrapper=i:(this.$wrapper=t.body,s=i),this.$wrapper?(o(s)||(s=this.getOptionsFromTag()),this.state={},this.options=s||{},this.options.min=o(this.options.min)?n(this.options.min):0,this.options.max=o(this.options.max)?n(this.options.max):100,this.options.value=o(this.options.value)?n(this.options.value):50,this.options.round=!o(this.options.round)||r(this.options.round),this.options.circle=!o(this.options.circle)||r(this.options.circle),this.options.padding=o(this.options.padding)?n(this.options.padding):4,this.options.radius=n(this.options.radius)||50,this.options.thickness=n(this.options.thickness)||10,this.options.bg=this.options.bg||"rgba(70, 130, 180, 0.15)",this.options.color=this.options.color||"mediumslateblue",this.options.transition=this.options.transition||"all 1.2s cubic-bezier(0.57, 0.13, 0.18, 0.98)",this.options.text=!!o(this.options.text)&&this.options.text,this.init(),this):this}).prototype.getOptionsFromTag=function(){return JSON.parse(JSON.stringify(this.$wrapper.dataset))},s.prototype.init=function(){var t;return this.$wrapper.donutty=this,this.createState(),t=this.getDashValues(),this.createSvg(),this.createBg(t),this.createDonut(t),this.createText(),this.insertFragments(t),this},s.prototype.createState=function(){return this.state.min=this.options.min,this.state.max=this.options.max,this.state.value=this.options.value,this.state.bg=this.options.bg,this.state.color=this.options.color,this},s.prototype.createText=function(){return"function"==typeof this.options.text&&(this.$text=t.createElement("span"),this.$text.setAttribute("class","donut-text"),this.$text.style.opacity=0,this.updateText()),this},s.prototype.createBg=function(i){return this.$bg=t.createElementNS(e,"circle"),this.$bg.setAttribute("cx","50%"),this.$bg.setAttribute("cy","50%"),this.$bg.setAttribute("r",this.options.radius),this.$bg.setAttribute("fill","transparent"),this.$bg.setAttribute("stroke",this.state.bg),this.$bg.setAttribute("stroke-width",this.options.thickness+this.options.padding),this.$bg.setAttribute("stroke-dasharray",i.full*i.multiplier),this.$bg.setAttribute("class","donut-bg"),this.options.round&&this.$bg.setAttribute("stroke-linecap","round"),this},s.prototype.createDonut=function(i){return this.$donut=t.createElementNS(e,"circle"),this.$donut.setAttribute("fill","transparent"),this.$donut.setAttribute("cx","50%"),this.$donut.setAttribute("cy","50%"),this.$donut.setAttribute("r",this.options.radius),this.$donut.setAttribute("stroke",this.state.color),this.$donut.setAttribute("stroke-width",this.options.thickness),this.$donut.setAttribute("stroke-dashoffset",i.full),this.$donut.setAttribute("stroke-dasharray",i.full),this.$donut.setAttribute("class","donut-fill"),this.$donut.style.opacity=0,this.options.round&&this.$donut.setAttribute("stroke-linecap","round"),this},s.prototype.createSvg=function(){var i=2*this.options.radius+this.options.thickness+2*this.options.padding,s=this.options.round?this.options.thickness/3:0,o=this.options.circle?90+s:-225;return this.$html=t.createDocumentFragment(),this.$svg=t.createElementNS(e,"svg"),this.$svg.setAttribute("xmlns",e),this.$svg.setAttribute("viewbox","0 0 "+i+" "+i),this.$svg.setAttribute("transform","rotate( "+o+" )"),this.$svg.setAttribute("preserveAspectRatio","xMidYMid meet"),this.$svg.setAttribute("class","donut"),this},s.prototype.insertFragments=function(t){this.$svg.appendChild(this.$bg),this.$svg.appendChild(this.$donut),this.$html.appendChild(this.$svg),this.$text&&this.$html.appendChild(this.$text),this.$wrapper.appendChild(this.$html),this.$wrapper.innerHTML=this.$wrapper.innerHTML,this.$svg=this.$wrapper.querySelector(".donut"),this.$bg=this.$wrapper.querySelector(".donut-bg"),this.$donut=this.$wrapper.querySelector(".donut-fill"),this.$text&&(this.$text=this.$wrapper.querySelector(".donut-text")),this.animate(t.fill,t.full)},s.prototype.getDashValues=function(){var t,i,s,e;return e=this.options.circle?1:.75,s=(t=2*Math.PI*this.options.radius)-t*e/100*(i=(this.state.value-this.state.min)/(this.state.max-this.state.min)*100),this.options.round&&this.options.circle&&i<100&&s<this.options.thickness&&(s=this.options.thickness),{fill:s,full:t,multiplier:e}},s.prototype.animate=function(t,i){var s=this;s.$bg.style.transition=this.options.transition,s.$donut.style.transition=this.options.transition,s.$text&&(s.$text.style.transition=this.options.transition),window.setTimeout(function(){s.$bg.setAttribute("stroke",s.state.bg),s.$bg.style.opacity=1,s.$donut.setAttribute("stroke-dashoffset",t),s.$donut.setAttribute("stroke-dasharray",i),s.$donut.setAttribute("stroke",s.state.color),s.$donut.style.opacity=1,s.$text&&(s.$text.style.opacity=1)},16)},s.prototypeLine truncated
|
||||
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* Draggabilly PACKAGED v2.2.0
|
||||
* Make that shiz draggable
|
||||
* https://draggabilly.desandro.com
|
||||
* MIT license
|
||||
*/
|
||||
|
||||
!function(i,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(t){return e(i,t)}):"object"==typeof module&&module.exports?module.exports=e(i,require("jquery")):i.jQueryBridget=e(i,i.jQuery)}(window,function(t,i){"use strict";var c=Array.prototype.slice,e=t.console,p=void 0===e?function(){}:function(t){e.error(t)};function n(d,o,u){(u=u||i||t.jQuery)&&(o.prototype.option||(o.prototype.option=function(t){u.isPlainObject(t)&&(this.options=u.extend(!0,this.options,t))}),u.fn[d]=function(t){if("string"==typeof t){var i=c.call(arguments,1);return s=i,a="$()."+d+'("'+(r=t)+'")',(e=this).each(function(t,i){var e=u.data(i,d);if(e){var n=e[r];if(n&&"_"!=r.charAt(0)){var o=n.apply(e,s);h=void 0===h?o:h}else p(a+" is not a valid method")}else p(d+" not initialized. Cannot call methods, i.e. "+a)}),void 0!==h?h:e}var e,r,s,h,a,n;return n=t,this.each(function(t,i){var e=u.data(i,d);e?(e.option(n),e._init()):(e=new o(i,n),u.data(i,d,e))}),this},r(u))}function r(t){!t||t&&t.bridget||(t.bridget=n)}return r(i||t.jQuery),n}),function(t,i){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return i()}):"object"==typeof module&&module.exports?module.exports=i():t.getSize=i()}(window,function(){"use strict";function m(t){var i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}var e="undefined"==typeof console?function(){}:function(t){console.error(t)},y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],b=y.length;function E(t){var i=getComputedStyle(t);return i||e("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),i}var _,x=!1;function P(t){if(function(){if(!x){x=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(t);var e=E(t);P.isBoxSizeOuter=_=200==m(e.width),i.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var i=E(t);if("none"==i.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},i=0;i<b;i++)t[y[i]]=0;return t}();var e={};e.width=t.offsetWidth,e.height=t.offsetHeight;for(var n=e.isBorderBox="border-box"==i.boxSizing,o=0;o<b;o++){var r=y[o],s=i[r],h=parseFloat(s);e[r]=isNaN(h)?0:h}var a=e.paddingLeft+e.paddingRight,d=e.paddingTop+e.paddingBottom,u=e.marginLeft+e.marginRight,c=e.marginTop+e.marginBottom,p=e.borderLeftWidth+e.borderRightWidth,f=e.borderTopWidth+e.borderBottomWidth,g=n&&_,l=m(i.width);!1!==l&&(e.width=l+(g?0:a+p));var v=m(i.height);return!1!==v&&(e.height=v+(g?0:d+f)),e.innerWidth=e.width-(a+p),e.innerHeight=e.height-(d+f),e.outerWidth=e.width+u,e.outerHeight=e.height+c,e}}return P}),function(t,i){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",i):"object"==typeof module&&module.exports?module.exports=i():t.EvEmitter=i()}("undefined"!=typeof window?window:this,function(){function t(){}var i=t.prototype;return i.on=function(t,i){if(t&&i){var e=this._events=this._events||{},n=e[t]=e[t]||[];return-1==n.indexOf(i)&&n.push(i),this}},i.once=function(t,i){if(t&&i){this.on(t,i);var e=this._onceEvents=this._onceEvents||{};return(e[t]=e[t]||{})[i]=!0,this}},i.off=function(t,i){var e=this._events&&this._events[t];if(e&&e.length){var n=e.indexOf(i);return-1!=n&&e.splice(n,1),this}},i.emitEvent=function(t,i){var e=this._events&&this._events[t];if(e&&e.length){e=e.slice(0),i=i||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<e.length;o++){var r=e[o];n&&n[r]&&(this.off(t,r),delete n[r]),r.apply(this,i)}return this}},i.allOff=function(){delete this._events,delete this._onceEvents},t}),function(i,e){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return e(i,t)}):"object"==typeof module&&module.exports?module.exports=e(i,require("ev-emitter")):i.Unipointer=e(i,i.EvEmitter)}(window,function(o,t){function i(){}var e=i.prototype=Object.create(t.prototype);e.bindStartEvent=function(t){this._bindStartEvent(t,!0)},e.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},e._bindStartEvent=function(t,i){var e=(i=void 0===i||i)?"addEventListener":"removeEventListener",n="mousedown";o.PointerEvent?n="pointerdown":"ontouchstart"in o&&(n="touchstart"),t[e](n,this)},e.handleEvent=function(t){var i="on"+t.type;this[i]&&this[i](t)},e.getTouch=function(t){for(var i=0;i<t.length;i++){var e=t[i];if(e.identifier==this.pointerIdentifier)return e}},e.onmousedown=function(t){var i=t.button;i&&0!==i&&1!==i||this._pointerDown(t,t)},e.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},e.onpointerdown=function(t){this._pointerDown(t,t)},e._pointerDown=fuLine truncated
|
||||
@@ -0,0 +1,6 @@
|
||||
/*! http://keith-wood.name/countdown.html
|
||||
Countdown for jQuery v2.1.0.
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) January 2008.
|
||||
Available under the MIT (http://keith-wood.name/licence.html) license.
|
||||
Please attribute the author if you use it. */
|
||||
!function(e){"use strict";e.JQPlugin.createPlugin({name:"countdown",defaultOptions:{until:null,since:null,timezone:null,serverSync:null,format:"dHMS",layout:"",compact:!1,padZeroes:!1,significant:0,description:"",expiryUrl:"",expiryText:"",alwaysExpire:!1,onExpiry:null,onTick:null,tickInterval:1},regionalOptions:{"":{labels:["Years","Months","Weeks","Days","Hours","Minutes","Seconds"],labels1:["Year","Month","Week","Day","Hour","Minute","Second"],compactLabels:["y","m","w","d"],whichLabels:null,digits:["0","1","2","3","4","5","6","7","8","9"],timeSeparator:":",isRTL:!1}},_rtlClass:"countdown-rtl",_sectionClass:"countdown-section",_amountClass:"countdown-amount",_periodClass:"countdown-period",_rowClass:"countdown-row",_holdingClass:"countdown-holding",_showClass:"countdown-show",_descrClass:"countdown-descr",_timerElems:[],_init:function(){var t=this;this._super(),this._serverSyncs=[];var i="function"==typeof Date.now?Date.now:function(){return(new Date).getTime()},s=window.performance&&"function"==typeof window.performance.now;var n=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null,o=0;!n||e.noRequestAnimationFrame?(e.noRequestAnimationFrame=null,e.countdown._timer=setInterval(function(){t._updateElems()},1e3)):(o=window.animationStartTime||window.webkitAnimationStartTime||window.mozAnimationStartTime||window.oAnimationStartTime||window.msAnimationStartTime||i(),n(function e(r){var a=r<1e12?s?window.performance.now()+window.performance.timing.navigationStart:i():r||i();a-o>=1e3&&(t._updateElems(),o=a),n(e)}))},UTCDate:function(e,t,i,s,n,o,r,a){"object"==typeof t&&t instanceof Date&&(a=t.getMilliseconds(),r=t.getSeconds(),o=t.getMinutes(),n=t.getHours(),s=t.getDate(),i=t.getMonth(),t=t.getFullYear());var l=new Date;return l.setUTCFullYear(t),l.setUTCDate(1),l.setUTCMonth(i||0),l.setUTCDate(s||1),l.setUTCHours(n||0),l.setUTCMinutes((o||0)-(Math.abs(e)<30?60*e:e)),l.setUTCSeconds(r||0),l.setUTCMilliseconds(a||0),l},periodsToSeconds:function(e){return 31557600*e[0]+2629800*e[1]+604800*e[2]+86400*e[3]+3600*e[4]+60*e[5]+e[6]},resync:function(){var t=this;e("."+this._getMarker()).each(function(){var i=e.data(this,t.name);if(i.options.serverSync){for(var s=null,n=0;n<t._serverSyncs.length;n++)if(t._serverSyncs[n][0]===i.options.serverSync){s=t._serverSyncs[n];break}if(t._eqNull(s[2])){var o=e.isFunction(i.options.serverSync)?i.options.serverSync.apply(this,[]):null;s[2]=(o?(new Date).getTime()-o.getTime():0)-s[1]}i._since&&i._since.setMilliseconds(i._since.getMilliseconds()+s[2]),i._until.setMilliseconds(i._until.getMilliseconds()+s[2])}});for(var i=0;i<t._serverSyncs.length;i++)t._eqNull(t._serverSyncs[i][2])||(t._serverSyncs[i][1]+=t._serverSyncs[i][2],delete t._serverSyncs[i][2])},_instSettings:function(e,t){return{_periods:[0,0,0,0,0,0,0]}},_addElem:function(e){this._hasElem(e)||this._timerElems.push(e)},_hasElem:function(t){return e.inArray(t,this._timerElems)>-1},_removeElem:function(t){this._timerElems=e.map(this._timerElems,function(e){return e===t?null:e})},_updateElems:function(){for(var e=this._timerElems.length-1;e>=0;e--)this._updateCountdown(this._timerElems[e])},_optionsChanged:function(t,i,s){s.layout&&(s.layout=s.layout.replace(/</g,"<").replace(/>/g,">")),this._resetExtraLabels(i.options,s);var n=i.options.timezone!==s.timezone;e.extend(i.options,s),this._adjustSettings(t,i,!this._eqNull(s.until)||!this._eqNull(s.since)||n);var o=new Date;(i._since&&i._since<o||i._until&&i._until>o)&&this._addElem(t[0]),this._updateCountdown(t,i)},_updateCountdown:function(t,i){if(t=t.jquery?t:e(t),(i=i||this._getInst(t))&&i.options){if(t.html(this._generateHTML(i)).toggleClass(this._rtlClass,i.options.isRTL),"pause"!==i._hold&&e.isFunction(i.options.onTick)){var s="lap"!==i._hold?i._periods:this._calculatePeriods(i,i._show,i.options.significant,new Date);1!==i.options.tickInterval&&this.periodsToSeconds(s)%i.options.tickInterval!=0||i.options.onTick.apply(t[0],[s])}if("pause"!==i._hold&&(i._since?i._now.getTime()<i._since.getTime():i._now.getTime()>=i._until.getTime())&&!i._expiring){if(i._expiring=!0,this._hasElem(t[0])||i.options.alwaysExpire){if(this._removeElem(t[0]),e.isFunction(i.options.onExpiry)&&i.options.onExpiry.apply(t[0],[]),i.options.expiryText){var n=i.options.layout;i.options.layout=i.options.expiryText,this._updateCountdown(t[0],i),i.options.layout=n}i.options.expiryUrl&&(window.location=i.options.expiryUrl)}i._expiring=!1}else"pause"===i._hold&&this._removeElem(t[0])}},_resetExtraLabels:function(e,t){var i=null;for(i in t)i.match(/[Ll]abels[02-9]|compactLabels1/)&&(e[i]=t[i]);for(i in e)i.match(/[Ll]abels[02-9]|compactLabels1/)&&void 0===t[i]&&(e[i]=null)},_eqNull:function(e){return null==e},_adjustSettings:function(t,i,s){for(var n=null,o=0;o<this._serverSyncs.length;o++)if(this._serverSyncs[o][0]===i.options.serverSync){n=this._serverSyncs[o][1];break}var r=null,a=null;Line truncated
|
||||
@@ -0,0 +1,9 @@
|
||||
/*! Simple JavaScript Inheritance
|
||||
* By John Resig http://ejohn.org/
|
||||
* MIT Licensed.
|
||||
*/
|
||||
!function(){"use strict";var a=!1;window.JQClass=function(){},JQClass.classes={},JQClass.extend=function b(c){function d(){!a&&this._init&&this._init.apply(this,arguments)}var e=this.prototype;a=!0;var f=new this;a=!1;for(var g in c)if("function"==typeof c[g]&&"function"==typeof e[g])f[g]=function(a,b){return function(){var c=this._super;this._super=function(b){return e[a].apply(this,b||[])};var d=b.apply(this,arguments);return this._super=c,d}}(g,c[g]);else if("object"==typeof c[g]&&"object"==typeof e[g]&&"defaultOptions"===g){var h,i=e[g],j=c[g],k={};for(h in i)k[h]=i[h];for(h in j)k[h]=j[h];f[g]=k}else f[g]=c[g];return d.prototype=f,d.prototype.constructor=d,d.extend=b,d}}(),/*! Abstract base class for collection plugins v1.0.2.
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.
|
||||
Licensed under the MIT license (http://keith-wood.name/licence.html). */
|
||||
function($){"use strict";function camelCase(a){return a.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}JQClass.classes.JQPlugin=JQClass.extend({name:"plugin",defaultOptions:{},regionalOptions:{},deepMerge:!0,_getMarker:function(){return"is-"+this.name},_init:function(){$.extend(this.defaultOptions,this.regionalOptions&&this.regionalOptions[""]||{});var a=camelCase(this.name);$[a]=this,$.fn[a]=function(b){var c=Array.prototype.slice.call(arguments,1),d=this,e=this;return this.each(function(){if("string"==typeof b){if("_"===b[0]||!$[a][b])throw"Unknown method: "+b;var f=$[a][b].apply($[a],[this].concat(c));if(f!==d&&void 0!==f)return e=f,!1}else $[a]._attach(this,b)}),e}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_attach:function(a,b){if(a=$(a),!a.hasClass(this._getMarker())){a.addClass(this._getMarker()),b=$.extend(this.deepMerge,{},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c),this._postAttach(a,c),this.option(a,b)}},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(elem){try{var data=elem.data(this.name.toLowerCase())||"";data=data.replace(/(\\?)'/g,function(a,b){return b?"'":'"'}).replace(/([a-zA-Z0-9]+):/g,function(a,b,c){var d=data.substring(0,c).match(/"/g);return d&&d.length%2!==0?b+":":'"'+b+'":'}).replace(/\\:/g,":"),data=$.parseJSON("{"+data+"}");for(var key in data)if(data.hasOwnProperty(key)){var value=data[key];"string"==typeof value&&value.match(/^new Date\(([-0-9,\s]*)\)$/)&&(data[key]=eval(value))}return data}catch(a){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name),e=b||{};return!b||"string"==typeof b&&"undefined"==typeof c?(e=(d||{}).options,e&&b?e[b]:e):void(a.hasClass(this._getMarker())&&("string"==typeof b&&(e={},e[b]=c),this._optionsChanged(a,d,e),$.extend(d.options,e)))},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a),a.hasClass(this._getMarker())&&(this._preDestroy(a,this._getInst(a)),a.removeData(this.name).removeClass(this._getMarker()))},_preDestroy:function(a,b){}}),$.JQPlugin={createPlugin:function(a,b){"object"==typeof a&&(b=a,a="JQPlugin"),a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b),new JQClass.classes[c]}}}(jQuery);
|
||||
//# sourceMappingURL=jquery.plugin.min.map
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Arabic (عربي) initialisation for the jQuery countdown extension
|
||||
Translated by Talal Al Asmari ([email protected]), April 2009. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ar = {
|
||||
labels: ['سنوات','أشهر','أسابيع','أيام','ساعات','دقائق','ثواني'],
|
||||
labels1: ['سنة','شهر','أسبوع','يوم','ساعة','دقيقة','ثانية'],
|
||||
compactLabels: ['س','ش','أ','ي'],
|
||||
whichLabels: null,
|
||||
digits: ['٠','١','٢','٣','٤','٥','٦','٧','٨','٩'],
|
||||
timeSeparator: ':',
|
||||
isRTL: true
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ar);
|
||||
})(jQuery);
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Bulgarian initialisation for the jQuery countdown extension
|
||||
* Written by Manol Trendafilov [email protected] (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.bg = {
|
||||
labels: ['Години','Месеца','Седмица','Дни','Часа','Минути','Секунди'],
|
||||
labels1: ['Година','Месец','Седмица','Ден','Час','Минута','Секунда'],
|
||||
compactLabels: ['l','m','n','d'],
|
||||
compactLabels1: ['g','m','n','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.bg);
|
||||
})(jQuery);
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Bengali/Bangla initialisation for the jQuery countdown extension
|
||||
* Written by Mohammed Tajuddin ([email protected]) Jan 2011. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.bn = {
|
||||
labels: ['বছর','মাস','সপ্তাহ','দিন','ঘন্টা','মিনিট','সেকেন্ড'],
|
||||
labels1: ['বছর','মাস','সপ্তাহ','দিন','ঘন্টা','মিনিট','সেকেন্ড'],
|
||||
compactLabels: ['ব','মা','স','দি'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.bn);
|
||||
})(jQuery);
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Bosnian Latin initialisation for the jQuery countdown extension
|
||||
* Written by Miralem Mehic miralem@mehic.info (2011) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.bs = {
|
||||
labels: ['Godina','Mjeseci','Sedmica','Dana','Sati','Minuta','Sekundi'],
|
||||
labels1: ['Godina','Mjesec','Sedmica','Dan','Sat','Minuta','Sekunda'],
|
||||
labels2: ['Godine','Mjeseca','Sedmica','Dana','Sata','Minute','Sekunde'],
|
||||
compactLabels: ['g','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.bs);
|
||||
})(jQuery);
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Catalan initialisation for the jQuery countdown extension
|
||||
Written by Amanida Media www.amanidamedia.com (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ca = {
|
||||
labels: ['Anys','Mesos','Setmanes','Dies','Hores','Minuts','Segons'],
|
||||
labels1: ['Anys','Mesos','Setmanes','Dies','Hores','Minuts','Segons'],
|
||||
compactLabels: ['a','m','s','g'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ca);
|
||||
})(jQuery);
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Czech initialisation for the jQuery countdown extension
|
||||
* Written by Roman Chlebec (creamd@c64.sk) (2008) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.cs = {
|
||||
labels: ['Roků','Měsíců','Týdnů','Dní','Hodin','Minut','Sekund'],
|
||||
labels1: ['Rok','Měsíc','Týden','Den','Hodina','Minuta','Sekunda'],
|
||||
labels2: ['Roky','Měsíce','Týdny','Dny','Hodiny','Minuty','Sekundy'],
|
||||
compactLabels: ['r','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.cs);
|
||||
})(jQuery);
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/* http://keith-wood.name/countdown.html
Welsh initialisation for the jQuery countdown extension
Written by Gareth Jones | http://garethvjones.com | October 2011. */
(function($) {
'use strict';
$.countdown.regionalOptions.cy = {
labels: ['Blynyddoedd','Mis','Wythnosau','Diwrnodau','Oriau','Munudau','Eiliadau'],
labels1: ['Blwyddyn','Mis','Wythnos','Diwrnod','Awr','Munud','Eiliad'],
compactLabels: ['b','m','w','d'],
whichLabels: null,
digits: ['0','1','2','3','4','5','6','7','8','9'],
timeSeparator: ':',
|
||||
isRTL: false
};
$.countdown.setDefaults($.countdown.regionalOptions.cy);
})(jQuery);
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Danish initialisation for the jQuery countdown extension
|
||||
Written by Buch (admin@buch90.dk). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.da = {
|
||||
labels: ['År','Måneder','Uger','Dage','Timer','Minutter','Sekunder'],
|
||||
labels1: ['År','Måned','Uge','Dag','Time','Minut','Sekund'],
|
||||
compactLabels: ['Å','M','U','D'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.da);
|
||||
})(jQuery);
|
||||
Loaded 100 of 7322 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user