New dev branch
18
blocks/lcp-gallery/.editorconfig
Normal file
@ -0,0 +1,18 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
# WordPress Coding Standards
|
||||
# https://make.wordpress.org/core/handbook/coding-standards/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = tab
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
30
blocks/lcp-gallery/.gitignore
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Output of `npm pack`
|
||||
*.tgz
|
||||
|
||||
# Output of `wp-scripts plugin-zip`
|
||||
*.zip
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
2
blocks/lcp-gallery/assets/css/lcp-gallery.css
Normal file
@ -0,0 +1,2 @@
|
||||
.admin-bar .lg-outer {top:32px;height:calc(100% - 32px)!important}
|
||||
|
||||
845
blocks/lcp-gallery/assets/css/lg-transitions.css
Normal file
@ -0,0 +1,845 @@
|
||||
.lg-css3.lg-zoom-in .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-zoom-in .lg-item.lg-prev-slide {
|
||||
-webkit-transform: scale3d(1.3, 1.3, 1.3);
|
||||
transform: scale3d(1.3, 1.3, 1.3);
|
||||
}
|
||||
.lg-css3.lg-zoom-in .lg-item.lg-next-slide {
|
||||
-webkit-transform: scale3d(1.3, 1.3, 1.3);
|
||||
transform: scale3d(1.3, 1.3, 1.3);
|
||||
}
|
||||
.lg-css3.lg-zoom-in .lg-item.lg-current {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-zoom-in .lg-item.lg-prev-slide, .lg-css3.lg-zoom-in .lg-item.lg-next-slide, .lg-css3.lg-zoom-in .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-lollipop-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-lollipop-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
-o-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
-ms-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
-webkit-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
transform: translate3d(0, 0, 0) scale(0.5);
|
||||
}
|
||||
.lg-css3.lg-lollipop-rev .lg-item.lg-next-slide {
|
||||
-webkit-transform: translate3d(100%, 0, 0);
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-lollipop-rev .lg-item.lg-current {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-lollipop-rev .lg-item.lg-prev-slide, .lg-css3.lg-lollipop-rev .lg-item.lg-next-slide, .lg-css3.lg-lollipop-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-ver-cross .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(0deg, 20deg) translate3d(0, -100%, 0px);
|
||||
-o-transform: skew(0deg, 20deg) translate3d(0, -100%, 0px);
|
||||
-ms-transform: skew(0deg, 20deg) translate3d(0, -100%, 0px);
|
||||
-webkit-transform: skew(0deg, 20deg) translate3d(0, -100%, 0px);
|
||||
transform: skew(0deg, 20deg) translate3d(0, -100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(0deg, 20deg) translate3d(0, 100%, 0px);
|
||||
-o-transform: skew(0deg, 20deg) translate3d(0, 100%, 0px);
|
||||
-ms-transform: skew(0deg, 20deg) translate3d(0, 100%, 0px);
|
||||
-webkit-transform: skew(0deg, 20deg) translate3d(0, 100%, 0px);
|
||||
transform: skew(0deg, 20deg) translate3d(0, 100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-ver-cross .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-ver-cross .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-lollipop .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-lollipop .lg-item.lg-prev-slide {
|
||||
-webkit-transform: translate3d(-100%, 0, 0);
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-lollipop .lg-item.lg-next-slide {
|
||||
-moz-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
-o-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
-ms-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
-webkit-transform: translate3d(0, 0, 0) scale(0.5);
|
||||
transform: translate3d(0, 0, 0) scale(0.5);
|
||||
}
|
||||
.lg-css3.lg-lollipop .lg-item.lg-current {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-lollipop .lg-item.lg-prev-slide, .lg-css3.lg-lollipop .lg-item.lg-next-slide, .lg-css3.lg-lollipop .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-ver-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(-60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
-o-transform: skew(-60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
-ms-transform: skew(-60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
-webkit-transform: skew(-60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
transform: skew(-60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-rev .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(-60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
-o-transform: skew(-60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
-ms-transform: skew(-60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
-webkit-transform: skew(-60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
transform: skew(-60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-rev .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-rev .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-ver-rev .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-ver-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-rotate-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-rotate-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
-ms-transform: rotate(360deg);
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
.lg-css3.lg-rotate-rev .lg-item.lg-next-slide {
|
||||
-moz-transform: rotate(-360deg);
|
||||
-o-transform: rotate(-360deg);
|
||||
-ms-transform: rotate(-360deg);
|
||||
-webkit-transform: rotate(-360deg);
|
||||
transform: rotate(-360deg);
|
||||
}
|
||||
.lg-css3.lg-rotate-rev .lg-item.lg-current {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-ms-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-rotate-rev .lg-item.lg-prev-slide, .lg-css3.lg-rotate-rev .lg-item.lg-next-slide, .lg-css3.lg-rotate-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-ver .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
-o-transform: skew(60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
-ms-transform: skew(60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
-webkit-transform: skew(60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
transform: skew(60deg, 0deg) translate3d(0, -100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
-o-transform: skew(60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
-ms-transform: skew(60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
-webkit-transform: skew(60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
transform: skew(60deg, 0deg) translate3d(0, 100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-ver .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-ver .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-rotate .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-rotate .lg-item.lg-prev-slide {
|
||||
-moz-transform: rotate(-360deg);
|
||||
-o-transform: rotate(-360deg);
|
||||
-ms-transform: rotate(-360deg);
|
||||
-webkit-transform: rotate(-360deg);
|
||||
transform: rotate(-360deg);
|
||||
}
|
||||
.lg-css3.lg-rotate .lg-item.lg-next-slide {
|
||||
-moz-transform: rotate(360deg);
|
||||
-o-transform: rotate(360deg);
|
||||
-ms-transform: rotate(360deg);
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
.lg-css3.lg-rotate .lg-item.lg-current {
|
||||
-moz-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
-ms-transform: rotate(0deg);
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-rotate .lg-item.lg-prev-slide, .lg-css3.lg-rotate .lg-item.lg-next-slide, .lg-css3.lg-rotate .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
-o-transform: skew(20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
-ms-transform: skew(20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
-webkit-transform: skew(20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
transform: skew(20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
-o-transform: skew(20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
-ms-transform: skew(20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
-webkit-transform: skew(20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
transform: skew(20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew .lg-item.lg-next-slide, .lg-css3.lg-slide-skew .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-scale-up .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-scale-up .lg-item.lg-prev-slide {
|
||||
-moz-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
-o-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
-ms-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
-webkit-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
}
|
||||
.lg-css3.lg-scale-up .lg-item.lg-next-slide {
|
||||
-moz-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
-o-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
-ms-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
-webkit-transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
transform: scale3d(0.8, 0.8, 0.8) translate3d(0%, 10%, 0);
|
||||
}
|
||||
.lg-css3.lg-scale-up .lg-item.lg-current {
|
||||
-moz-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-o-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-ms-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-webkit-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-scale-up .lg-item.lg-prev-slide, .lg-css3.lg-scale-up .lg-item.lg-next-slide, .lg-css3.lg-scale-up .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-vertical-growth .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-vertical-growth .lg-item.lg-prev-slide {
|
||||
-moz-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, -150%, 0);
|
||||
-o-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, -150%, 0);
|
||||
-ms-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, -150%, 0);
|
||||
-webkit-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, -150%, 0);
|
||||
transform: scale3d(0.5, 0.5, 0.5) translate3d(0, -150%, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-vertical-growth .lg-item.lg-next-slide {
|
||||
-moz-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, 150%, 0);
|
||||
-o-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, 150%, 0);
|
||||
-ms-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, 150%, 0);
|
||||
-webkit-transform: scale3d(0.5, 0.5, 0.5) translate3d(0, 150%, 0);
|
||||
transform: scale3d(0.5, 0.5, 0.5) translate3d(0, 150%, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-vertical-growth .lg-item.lg-current {
|
||||
-moz-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-o-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-ms-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-webkit-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-vertical-growth .lg-item.lg-prev-slide, .lg-css3.lg-slide-vertical-growth .lg-item.lg-next-slide, .lg-css3.lg-slide-vertical-growth .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-circular-vertical .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-circular-vertical .lg-item.lg-prev-slide {
|
||||
-moz-transform: scale3d(0, 0, 0) translate3d(0, -100%, 0);
|
||||
-o-transform: scale3d(0, 0, 0) translate3d(0, -100%, 0);
|
||||
-ms-transform: scale3d(0, 0, 0) translate3d(0, -100%, 0);
|
||||
-webkit-transform: scale3d(0, 0, 0) translate3d(0, -100%, 0);
|
||||
transform: scale3d(0, 0, 0) translate3d(0, -100%, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-circular-vertical .lg-item.lg-next-slide {
|
||||
-moz-transform: scale3d(0, 0, 0) translate3d(0, 100%, 0);
|
||||
-o-transform: scale3d(0, 0, 0) translate3d(0, 100%, 0);
|
||||
-ms-transform: scale3d(0, 0, 0) translate3d(0, 100%, 0);
|
||||
-webkit-transform: scale3d(0, 0, 0) translate3d(0, 100%, 0);
|
||||
transform: scale3d(0, 0, 0) translate3d(0, 100%, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-circular-vertical .lg-item.lg-current {
|
||||
-moz-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-o-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-ms-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-webkit-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-circular-vertical .lg-item.lg-prev-slide, .lg-css3.lg-slide-circular-vertical .lg-item.lg-next-slide, .lg-css3.lg-slide-circular-vertical .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-vertical .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-vertical .lg-item.lg-prev-slide {
|
||||
-webkit-transform: translate3d(0, -100%, 0);
|
||||
transform: translate3d(0, -100%, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-vertical .lg-item.lg-next-slide {
|
||||
-webkit-transform: translate3d(0, 100%, 0);
|
||||
transform: translate3d(0, 100%, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-vertical .lg-item.lg-current {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-vertical .lg-item.lg-prev-slide, .lg-css3.lg-slide-vertical .lg-item.lg-next-slide, .lg-css3.lg-slide-vertical .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-circular .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-circular .lg-item.lg-prev-slide {
|
||||
-moz-transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
|
||||
-o-transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
|
||||
-ms-transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
|
||||
-webkit-transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
|
||||
transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-circular .lg-item.lg-next-slide {
|
||||
-moz-transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
|
||||
-o-transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
|
||||
-ms-transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
|
||||
-webkit-transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
|
||||
transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-slide-circular .lg-item.lg-current {
|
||||
-moz-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-o-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-ms-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-webkit-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-circular .lg-item.lg-prev-slide, .lg-css3.lg-slide-circular .lg-item.lg-next-slide, .lg-css3.lg-slide-circular .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-soft-zoom .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-soft-zoom .lg-item.lg-prev-slide {
|
||||
-webkit-transform: scale3d(1.1, 1.1, 1.1);
|
||||
transform: scale3d(1.1, 1.1, 1.1);
|
||||
}
|
||||
.lg-css3.lg-soft-zoom .lg-item.lg-next-slide {
|
||||
-webkit-transform: scale3d(0.9, 0.9, 0.9);
|
||||
transform: scale3d(0.9, 0.9, 0.9);
|
||||
}
|
||||
.lg-css3.lg-soft-zoom .lg-item.lg-current {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-soft-zoom .lg-item.lg-prev-slide, .lg-css3.lg-soft-zoom .lg-item.lg-next-slide, .lg-css3.lg-soft-zoom .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-cross-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(0deg, -60deg) translate3d(-100%, 0%, 0px);
|
||||
-o-transform: skew(0deg, -60deg) translate3d(-100%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, -60deg) translate3d(-100%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, -60deg) translate3d(-100%, 0%, 0px);
|
||||
transform: skew(0deg, -60deg) translate3d(-100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross-rev .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(0deg, -60deg) translate3d(100%, 0%, 0px);
|
||||
-o-transform: skew(0deg, -60deg) translate3d(100%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, -60deg) translate3d(100%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, -60deg) translate3d(100%, 0%, 0px);
|
||||
transform: skew(0deg, -60deg) translate3d(100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross-rev .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross-rev .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-cross-rev .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-cross-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-tube .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-tube .lg-item.lg-prev-slide {
|
||||
-moz-transform: scale3d(1, 0, 1) translate3d(-100%, 0, 0);
|
||||
-o-transform: scale3d(1, 0, 1) translate3d(-100%, 0, 0);
|
||||
-ms-transform: scale3d(1, 0, 1) translate3d(-100%, 0, 0);
|
||||
-webkit-transform: scale3d(1, 0, 1) translate3d(-100%, 0, 0);
|
||||
transform: scale3d(1, 0, 1) translate3d(-100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-tube .lg-item.lg-next-slide {
|
||||
-moz-transform: scale3d(1, 0, 1) translate3d(100%, 0, 0);
|
||||
-o-transform: scale3d(1, 0, 1) translate3d(100%, 0, 0);
|
||||
-ms-transform: scale3d(1, 0, 1) translate3d(100%, 0, 0);
|
||||
-webkit-transform: scale3d(1, 0, 1) translate3d(100%, 0, 0);
|
||||
transform: scale3d(1, 0, 1) translate3d(100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-tube .lg-item.lg-current {
|
||||
-moz-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-o-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-ms-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
-webkit-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-tube .lg-item.lg-prev-slide, .lg-css3.lg-tube .lg-item.lg-next-slide, .lg-css3.lg-tube .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-cross .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(0deg, 60deg) translate3d(-100%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 60deg) translate3d(-100%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 60deg) translate3d(-100%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 60deg) translate3d(-100%, 0%, 0px);
|
||||
transform: skew(0deg, 60deg) translate3d(-100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(0deg, 60deg) translate3d(100%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 60deg) translate3d(100%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 60deg) translate3d(100%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 60deg) translate3d(100%, 0%, 0px);
|
||||
transform: skew(0deg, 60deg) translate3d(100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-cross .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-cross .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-cross .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-zoom-in-big .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-zoom-in-big .lg-item.lg-prev-slide {
|
||||
-webkit-transform: scale3d(2, 2, 2);
|
||||
transform: scale3d(2, 2, 2);
|
||||
}
|
||||
.lg-css3.lg-zoom-in-big .lg-item.lg-next-slide {
|
||||
-webkit-transform: scale3d(2, 2, 2);
|
||||
transform: scale3d(2, 2, 2);
|
||||
}
|
||||
.lg-css3.lg-zoom-in-big .lg-item.lg-current {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-zoom-in-big .lg-item.lg-prev-slide, .lg-css3.lg-zoom-in-big .lg-item.lg-next-slide, .lg-css3.lg-zoom-in-big .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-only-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(-10deg, 0deg);
|
||||
-o-transform: skew(-10deg, 0deg);
|
||||
-ms-transform: skew(-10deg, 0deg);
|
||||
-webkit-transform: skew(-10deg, 0deg);
|
||||
transform: skew(-10deg, 0deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-rev .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(-10deg, 0deg);
|
||||
-o-transform: skew(-10deg, 0deg);
|
||||
-ms-transform: skew(-10deg, 0deg);
|
||||
-webkit-transform: skew(-10deg, 0deg);
|
||||
transform: skew(-10deg, 0deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-rev .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg);
|
||||
-o-transform: skew(0deg, 0deg);
|
||||
-ms-transform: skew(0deg, 0deg);
|
||||
-webkit-transform: skew(0deg, 0deg);
|
||||
transform: skew(0deg, 0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-rev .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-only-rev .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-only-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-zoom-in-out .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-zoom-in-out .lg-item.lg-prev-slide {
|
||||
-webkit-transform: scale3d(2, 2, 2);
|
||||
transform: scale3d(2, 2, 2);
|
||||
}
|
||||
.lg-css3.lg-zoom-in-out .lg-item.lg-next-slide {
|
||||
-webkit-transform: scale3d(0, 0, 0);
|
||||
transform: scale3d(0, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-zoom-in-out .lg-item.lg-current {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-zoom-in-out .lg-item.lg-prev-slide, .lg-css3.lg-zoom-in-out .lg-item.lg-next-slide, .lg-css3.lg-zoom-in-out .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-only-y-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(0deg, -10deg);
|
||||
-o-transform: skew(0deg, -10deg);
|
||||
-ms-transform: skew(0deg, -10deg);
|
||||
-webkit-transform: skew(0deg, -10deg);
|
||||
transform: skew(0deg, -10deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y-rev .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(0deg, -10deg);
|
||||
-o-transform: skew(0deg, -10deg);
|
||||
-ms-transform: skew(0deg, -10deg);
|
||||
-webkit-transform: skew(0deg, -10deg);
|
||||
transform: skew(0deg, -10deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y-rev .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg);
|
||||
-o-transform: skew(0deg, 0deg);
|
||||
-ms-transform: skew(0deg, 0deg);
|
||||
-webkit-transform: skew(0deg, 0deg);
|
||||
transform: skew(0deg, 0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y-rev .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-only-y-rev .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-only-y-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-only-y .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(0deg, 10deg);
|
||||
-o-transform: skew(0deg, 10deg);
|
||||
-ms-transform: skew(0deg, 10deg);
|
||||
-webkit-transform: skew(0deg, 10deg);
|
||||
transform: skew(0deg, 10deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(0deg, 10deg);
|
||||
-o-transform: skew(0deg, 10deg);
|
||||
-ms-transform: skew(0deg, 10deg);
|
||||
-webkit-transform: skew(0deg, 10deg);
|
||||
transform: skew(0deg, 10deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg);
|
||||
-o-transform: skew(0deg, 0deg);
|
||||
-ms-transform: skew(0deg, 0deg);
|
||||
-webkit-transform: skew(0deg, 0deg);
|
||||
transform: skew(0deg, 0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only-y .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-only-y .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-only-y .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-zoom-out-big .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-zoom-out-big .lg-item.lg-prev-slide {
|
||||
-webkit-transform: scale3d(0, 0, 0);
|
||||
transform: scale3d(0, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-zoom-out-big .lg-item.lg-next-slide {
|
||||
-webkit-transform: scale3d(0, 0, 0);
|
||||
transform: scale3d(0, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-zoom-out-big .lg-item.lg-current {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-zoom-out-big .lg-item.lg-prev-slide, .lg-css3.lg-zoom-out-big .lg-item.lg-next-slide, .lg-css3.lg-zoom-out-big .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-only .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(10deg, 0deg);
|
||||
-o-transform: skew(10deg, 0deg);
|
||||
-ms-transform: skew(10deg, 0deg);
|
||||
-webkit-transform: skew(10deg, 0deg);
|
||||
transform: skew(10deg, 0deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(10deg, 0deg);
|
||||
-o-transform: skew(10deg, 0deg);
|
||||
-ms-transform: skew(10deg, 0deg);
|
||||
-webkit-transform: skew(10deg, 0deg);
|
||||
transform: skew(10deg, 0deg);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg);
|
||||
-o-transform: skew(0deg, 0deg);
|
||||
-ms-transform: skew(0deg, 0deg);
|
||||
-webkit-transform: skew(0deg, 0deg);
|
||||
transform: skew(0deg, 0deg);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-only .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-only .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-only .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-zoom-out-in .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-zoom-out-in .lg-item.lg-prev-slide {
|
||||
-webkit-transform: scale3d(0, 0, 0);
|
||||
transform: scale3d(0, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-zoom-out-in .lg-item.lg-next-slide {
|
||||
-webkit-transform: scale3d(2, 2, 2);
|
||||
transform: scale3d(2, 2, 2);
|
||||
}
|
||||
.lg-css3.lg-zoom-out-in .lg-item.lg-current {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-zoom-out-in .lg-item.lg-prev-slide, .lg-css3.lg-zoom-out-in .lg-item.lg-next-slide, .lg-css3.lg-zoom-out-in .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(-20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
-o-transform: skew(-20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
-ms-transform: skew(-20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
-webkit-transform: skew(-20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
transform: skew(-20deg, 0deg) translate3d(-100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-rev .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(-20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
-o-transform: skew(-20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
-ms-transform: skew(-20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
-webkit-transform: skew(-20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
transform: skew(-20deg, 0deg) translate3d(100%, 0%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-rev .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-rev .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-rev .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-zoom-out .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-zoom-out .lg-item.lg-prev-slide {
|
||||
-webkit-transform: scale3d(0.7, 0.7, 0.7);
|
||||
transform: scale3d(0.7, 0.7, 0.7);
|
||||
}
|
||||
.lg-css3.lg-zoom-out .lg-item.lg-next-slide {
|
||||
-webkit-transform: scale3d(0.7, 0.7, 0.7);
|
||||
transform: scale3d(0.7, 0.7, 0.7);
|
||||
}
|
||||
.lg-css3.lg-zoom-out .lg-item.lg-current {
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-zoom-out .lg-item.lg-prev-slide, .lg-css3.lg-zoom-out .lg-item.lg-next-slide, .lg-css3.lg-zoom-out .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-css3.lg-slide-skew-ver-cross-rev .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross-rev .lg-item.lg-prev-slide {
|
||||
-moz-transform: skew(0deg, -20deg) translate3d(0, -100%, 0px);
|
||||
-o-transform: skew(0deg, -20deg) translate3d(0, -100%, 0px);
|
||||
-ms-transform: skew(0deg, -20deg) translate3d(0, -100%, 0px);
|
||||
-webkit-transform: skew(0deg, -20deg) translate3d(0, -100%, 0px);
|
||||
transform: skew(0deg, -20deg) translate3d(0, -100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross-rev .lg-item.lg-next-slide {
|
||||
-moz-transform: skew(0deg, -20deg) translate3d(0, 100%, 0px);
|
||||
-o-transform: skew(0deg, -20deg) translate3d(0, 100%, 0px);
|
||||
-ms-transform: skew(0deg, -20deg) translate3d(0, 100%, 0px);
|
||||
-webkit-transform: skew(0deg, -20deg) translate3d(0, 100%, 0px);
|
||||
transform: skew(0deg, -20deg) translate3d(0, 100%, 0px);
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross-rev .lg-item.lg-current {
|
||||
-moz-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-o-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-ms-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
-webkit-transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
transform: skew(0deg, 0deg) translate3d(0%, 0%, 0px);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide-skew-ver-cross-rev .lg-item.lg-prev-slide, .lg-css3.lg-slide-skew-ver-cross-rev .lg-item.lg-next-slide, .lg-css3.lg-slide-skew-ver-cross-rev .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=lg-transitions.css.map */
|
||||
1
blocks/lcp-gallery/assets/css/lightgallery-bundle.min.css
vendored
Normal file
1151
blocks/lcp-gallery/assets/css/lightgallery.css
Normal file
1
blocks/lcp-gallery/assets/css/lightgallery.min.css
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-1.jpg
Normal file
|
After Width: | Height: | Size: 2.0 MiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-10.jpg
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 23 KiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-2.jpg
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-3.jpg
Normal file
|
After Width: | Height: | Size: 376 KiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-4.jpg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-5.jpg
Normal file
|
After Width: | Height: | Size: 344 KiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-6.jpg
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-7.jpg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-8.jpg
Normal file
|
After Width: | Height: | Size: 3.2 MiB |
BIN
blocks/lcp-gallery/assets/img/sample/sample-img-9.jpg
Normal file
|
After Width: | Height: | Size: 531 KiB |
8
blocks/lcp-gallery/assets/js/lg-autoplay.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(t="undefined"!=typeof globalThis?globalThis:t||self).lgAutoplay=o()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var o,e=1,s=arguments.length;e<s;e++)for(var r in o=arguments[e])Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r]);return t}).apply(this,arguments)},o="lgSlideItemLoad",e="lgBeforeSlide",s="lgAfterSlide",r="lgDragStart",i="lgDragEnd",a="lgAutoplay",l="lgAutoplayStart",n="lgAutoplayStop",u={autoplay:!0,slideShowAutoplay:!1,slideShowInterval:5e3,progressBar:!0,forceSlideShowAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar",autoplayPluginStrings:{toggleAutoplay:"Toggle Autoplay"}};return function(){function p(o){return this.core=o,this.settings=t(t({},u),this.core.settings),this}return p.prototype.init=function(){var t=this;this.settings.autoplay&&(this.interval=!1,this.fromAuto=!0,this.pausedOnTouchDrag=!1,this.pausedOnSlideChange=!1,this.settings.autoplayControls&&this.controls(),this.settings.progressBar&&this.core.outer.append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),this.settings.slideShowAutoplay&&this.core.LGel.once(o+".autoplay",(function(){t.startAutoPlay()})),this.core.LGel.on(r+".autoplay touchstart.lg.autoplay",(function(){t.interval&&(t.stopAutoPlay(),t.pausedOnTouchDrag=!0)})),this.core.LGel.on(i+".autoplay touchend.lg.autoplay",(function(){!t.interval&&t.pausedOnTouchDrag&&(t.startAutoPlay(),t.pausedOnTouchDrag=!1)})),this.core.LGel.on(e+".autoplay",(function(){t.showProgressBar(),!t.fromAuto&&t.interval?(t.stopAutoPlay(),t.pausedOnSlideChange=!0):t.pausedOnSlideChange=!1,t.fromAuto=!1})),this.core.LGel.on(s+".autoplay",(function(){t.pausedOnSlideChange&&!t.interval&&t.settings.forceSlideShowAutoplay&&(t.startAutoPlay(),t.pausedOnSlideChange=!1)})),this.showProgressBar())},p.prototype.showProgressBar=function(){var t=this;if(this.settings.progressBar&&this.fromAuto){var o=this.core.outer.find(".lg-progress-bar"),e=this.core.outer.find(".lg-progress");this.interval&&(e.removeAttr("style"),o.removeClass("lg-start"),setTimeout((function(){e.css("transition","width "+(t.core.settings.speed+t.settings.slideShowInterval)+"ms ease 0s"),o.addClass("lg-start")}),20))}},p.prototype.controls=function(){var t=this,o='<button aria-label="'+this.settings.autoplayPluginStrings.toggleAutoplay+'" type="button" class="lg-autoplay-button lg-icon"></button>';this.core.outer.find(this.settings.appendAutoplayControlsTo).append(o),this.core.outer.find(".lg-autoplay-button").first().on("click.lg.autoplay",(function(){t.core.outer.hasClass("lg-show-autoplay")?t.stopAutoPlay():t.interval||t.startAutoPlay()}))},p.prototype.startAutoPlay=function(){var t=this;this.core.outer.find(".lg-progress").css("transition","width "+(this.core.settings.speed+this.settings.slideShowInterval)+"ms ease 0s"),this.core.outer.addClass("lg-show-autoplay"),this.core.outer.find(".lg-progress-bar").addClass("lg-start"),this.core.LGel.trigger(l,{index:this.core.index}),this.interval=setInterval((function(){t.core.index+1<t.core.galleryItems.length?t.core.index++:t.core.index=0,t.core.LGel.trigger(a,{index:t.core.index}),t.fromAuto=!0,t.core.slide(t.core.index,!1,!1,"next")}),this.core.settings.speed+this.settings.slideShowInterval)},p.prototype.stopAutoPlay=function(){this.interval&&(this.core.LGel.trigger(n,{index:this.core.index}),this.core.outer.find(".lg-progress").removeAttr("style"),this.core.outer.removeClass("lg-show-autoplay"),this.core.outer.find(".lg-progress-bar").removeClass("lg-start")),clearInterval(this.interval),this.interval=!1},p.prototype.closeGallery=function(){this.stopAutoPlay()},p.prototype.destroy=function(){this.settings.autoplay&&this.core.outer.find(".lg-progress-bar").remove(),this.core.LGel.off(".lg.autoplay"),this.core.LGel.off(".autoplay")},p}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-comment.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgComment=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},e="lgBeforeSlide",o="lgAfterSlide",n={commentBox:!1,fbComments:!1,disqusComments:!1,disqusConfig:{title:void 0,language:"en"},commentsMarkup:'<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>',commentPluginStrings:{toggleComments:"Toggle Comments"}};return function(){function i(e,o){return this.core=e,this.$LG=o,this.settings=t(t({},n),this.core.settings),this}return i.prototype.init=function(){this.settings.commentBox&&(this.setMarkup(),this.toggleCommentBox(),this.settings.fbComments?this.addFbComments():this.settings.disqusComments&&this.addDisqusComments())},i.prototype.setMarkup=function(){this.core.outer.append(this.settings.commentsMarkup+'<div class="lg-comment-overlay"></div>');var t='<button type="button" aria-label="'+this.settings.commentPluginStrings.toggleComments+'" class="lg-comment-toggle lg-icon"></button>';this.core.$toolbar.append(t)},i.prototype.toggleCommentBox=function(){var t=this;this.core.outer.find(".lg-comment-toggle").first().on("click.lg.comment",(function(){t.core.outer.toggleClass("lg-comment-active")})),this.core.outer.find(".lg-comment-overlay").first().on("click.lg.comment",(function(){t.core.outer.removeClass("lg-comment-active")})),this.core.outer.find(".lg-comment-close").first().on("click.lg.comment",(function(){t.core.outer.removeClass("lg-comment-active")}))},i.prototype.addFbComments=function(){var t=this,n=this;this.core.LGel.on(e+".comment",(function(e){var o=t.core.galleryItems[e.detail.index].fbHtml;t.core.outer.find(".lg-comment-body").html(o)})),this.core.LGel.on(o+".comment",(function(){try{FB.XFBML.parse()}catch(t){n.$LG(window).on("fbAsyncInit",(function(){FB.XFBML.parse()}))}}))},i.prototype.addDisqusComments=function(){var t=this,n=this.$LG("#disqus_thread");n.remove(),this.core.outer.find(".lg-comment-body").append('<div id="disqus_thread"></div>'),this.core.LGel.on(e+".comment",(function(){n.html("")})),this.core.LGel.on(o+".comment",(function(e){var o=e.detail.index,n=t;setTimeout((function(){try{DISQUS.reset({reload:!0,config:function(){this.page.identifier=n.core.galleryItems[o].disqusIdentifier,this.page.url=n.core.galleryItems[o].disqusURL,this.page.title=n.settings.disqusConfig.title,this.language=n.settings.disqusConfig.language}})}catch(t){console.error("Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/")}}),n.core.lGalleryOn?0:1e3)}))},i.prototype.destroy=function(){this.core.LGel.off(".lg.comment"),this.core.LGel.off(".comment")},i}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-fullscreen.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l():"function"==typeof define&&define.amd?define(l):(e="undefined"!=typeof globalThis?globalThis:e||self).lgFullscreen=l()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var l,n=1,t=arguments.length;n<t;n++)for(var c in l=arguments[n])Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);return e}).apply(this,arguments)},l={fullScreen:!0,fullscreenPluginStrings:{toggleFullscreen:"Toggle Fullscreen"}};return function(){function n(n,t){return this.core=n,this.$LG=t,this.settings=e(e({},l),this.core.settings),this}return n.prototype.init=function(){var e="";if(this.settings.fullScreen){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))return;e='<button type="button" aria-label="'+this.settings.fullscreenPluginStrings.toggleFullscreen+'" class="lg-fullscreen lg-icon"></button>',this.core.$toolbar.append(e),this.fullScreen()}},n.prototype.isFullScreen=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},n.prototype.requestFullscreen=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},n.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},n.prototype.fullScreen=function(){var e=this;this.$LG(document).on("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId,(function(){e.core.lgOpened&&e.core.outer.toggleClass("lg-fullscreen-on")})),this.core.outer.find(".lg-fullscreen").first().on("click.lg",(function(){e.isFullScreen()?e.exitFullscreen():e.requestFullscreen()}))},n.prototype.closeGallery=function(){this.isFullScreen()&&this.exitFullscreen()},n.prototype.destroy=function(){this.$LG(document).off("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId)},n}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-hash.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgHash=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},e="lgAfterSlide",i="lgAfterClose",o={hash:!0,galleryId:"1",customSlideName:!1};return function(){function s(e,i){return this.core=e,this.$LG=i,this.settings=t(t({},o),this.core.settings),this}return s.prototype.init=function(){var t=this;this.settings.hash&&(this.oldHash=window.location.hash,setTimeout((function(){t.buildFromHash()}),100),this.core.LGel.on(e+".hash",this.onAfterSlide.bind(this)),this.core.LGel.on(i+".hash",this.onCloseAfter.bind(this)),this.$LG(window).on("hashchange.lg.hash.global"+this.core.lgId,this.onHashchange.bind(this)))},s.prototype.onAfterSlide=function(t){var e=this.core.galleryItems[t.detail.index].slideName;e=this.settings.customSlideName&&e||t.detail.index,history.replaceState?history.replaceState(null,"",window.location.pathname+window.location.search+"#lg="+this.settings.galleryId+"&slide="+e):window.location.hash="lg="+this.settings.galleryId+"&slide="+e},s.prototype.getIndexFromUrl=function(t){void 0===t&&(t=window.location.hash);var e=t.split("&slide=")[1],i=0;if(this.settings.customSlideName)for(var o=0;o<this.core.galleryItems.length;o++){if(this.core.galleryItems[o].slideName===e){i=o;break}}else i=parseInt(e,10);return isNaN(i)?0:i},s.prototype.buildFromHash=function(){var t=window.location.hash;if(t.indexOf("lg="+this.settings.galleryId)>0){this.$LG(document.body).addClass("lg-from-hash");var e=this.getIndexFromUrl(t);return this.core.openGallery(e),!0}},s.prototype.onCloseAfter=function(){this.oldHash&&this.oldHash.indexOf("lg="+this.settings.galleryId)<0?history.replaceState?history.replaceState(null,"",this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash=""},s.prototype.onHashchange=function(){if(this.core.lgOpened){var t=window.location.hash,e=this.getIndexFromUrl(t);t.indexOf("lg="+this.settings.galleryId)>-1?this.core.slide(e,!1,!1):this.core.lGalleryOn&&this.core.closeGallery()}},s.prototype.closeGallery=function(){this.settings.hash&&this.$LG(document.body).removeClass("lg-from-hash")},s.prototype.destroy=function(){this.core.LGel.off(".lg.hash"),this.core.LGel.off(".hash"),this.$LG(window).off("hashchange.lg.hash.global"+this.core.lgId)},s}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-medium-zoom.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(o,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(o="undefined"!=typeof globalThis?globalThis:o||self).lgMediumZoom=t()}(this,(function(){"use strict";var o=function(){return(o=Object.assign||function(o){for(var t,e=1,i=arguments.length;e<i;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o}).apply(this,arguments)},t="lgBeforeOpen",e={margin:40,mediumZoom:!0,backgroundColor:"#000"};return function(){function i(t,i){var n=this;this.core=t,this.$LG=i,this.core.getMediaContainerPosition=function(){return{top:n.settings.margin,bottom:n.settings.margin}};var s={controls:!1,download:!1,counter:!1,showCloseIcon:!1,extraProps:["lgBackgroundColor"],closeOnTap:!1,enableSwipe:!1,enableDrag:!1,swipeToClose:!1,addClass:this.core.settings.addClass+" lg-medium-zoom"};return this.core.settings=o(o({},this.core.settings),s),this.settings=o(o(o({},e),this.core.settings),s),this}return i.prototype.toggleItemClass=function(){for(var o=0;o<this.core.items.length;o++){this.$LG(this.core.items[o]).toggleClass("lg-medium-zoom-item")}},i.prototype.init=function(){var o=this;this.settings.mediumZoom&&(this.core.LGel.on(t+".medium",(function(){o.core.$backdrop.css("background-color",o.core.galleryItems[o.core.index].lgBackgroundColor||o.settings.backgroundColor)})),this.toggleItemClass(),this.core.outer.on("click.lg.medium",(function(){o.core.closeGallery()})))},i.prototype.destroy=function(){this.toggleItemClass()},i}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-pager.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).lgPager=t()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},t="lgUpdateSlides",r="lgBeforeSlide",o={pager:!0};return function(){function i(t,r){return this.core=t,this.$LG=r,this.settings=e(e({},o),this.core.settings),this}return i.prototype.getPagerHtml=function(e){for(var t="",r=0;r<e.length;r++)t+='<span data-lg-item-id="'+r+'" class="lg-pager-cont"> \n <span data-lg-item-id="'+r+'" class="lg-pager"></span>\n <div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+e[r].thumb+'" /></div>\n </span>';return t},i.prototype.init=function(){var e=this;if(this.settings.pager){var o;this.core.$lgComponents.prepend('<div class="lg-pager-outer"></div>');var i=this.core.outer.find(".lg-pager-outer");i.html(this.getPagerHtml(this.core.galleryItems)),i.first().on("click.lg touchend.lg",(function(t){var r=e.$LG(t.target);if(r.hasAttribute("data-lg-item-id")){var o=parseInt(r.attr("data-lg-item-id"));e.core.slide(o,!1,!0,!1)}})),i.first().on("mouseover.lg",(function(){clearTimeout(o),i.addClass("lg-pager-hover")})),i.first().on("mouseout.lg",(function(){o=setTimeout((function(){i.removeClass("lg-pager-hover")}))})),this.core.LGel.on(r+".pager",(function(t){var r=t.detail.index;e.manageActiveClass.call(e,r)})),this.core.LGel.on(t+".pager",(function(){i.empty(),i.html(e.getPagerHtml(e.core.galleryItems)),e.manageActiveClass(e.core.index)}))}},i.prototype.manageActiveClass=function(e){var t=this.core.outer.find(".lg-pager-cont");t.removeClass("lg-pager-active"),t.eq(e).addClass("lg-pager-active")},i.prototype.destroy=function(){this.core.outer.find(".lg-pager-outer").remove(),this.core.LGel.off(".lg.pager"),this.core.LGel.off(".pager")},i}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-relative-caption.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgRelativeCaption=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},e="lgContainerResize",i="lgSlideItemLoad",o="lgBeforeSlide",n="lgAfterSlide",s={relativeCaption:!1};return function(){function l(e){this.core=e;var i={addClass:this.core.settings.addClass+" lg-relative-caption"};return this.core.settings=t(t({},this.core.settings),i),this.settings=t(t(t({},s),this.core.settings),i),this}return l.prototype.init=function(){var t=this;this.settings.relativeCaption&&(this.core.LGel.on(i+".caption",(function(e){var i=e.detail,o=i.index,n=i.delay;setTimeout((function(){o===t.core.index&&t.setRelativeCaption(o)}),n)})),this.core.LGel.on(n+".caption",(function(e){var i=e.detail.index;setTimeout((function(){t.core.getSlideItem(i).hasClass("lg-complete")&&t.setRelativeCaption(i)}))})),this.core.LGel.on(o+".caption",(function(e){var i=e.detail.index;setTimeout((function(){t.core.getSlideItem(i).removeClass("lg-show-caption")}))})),this.core.LGel.on(e+".caption",(function(e){t.setRelativeCaption(t.core.index)})))},l.prototype.setCaptionStyle=function(t,e,i){var o=this.core.getSlideItem(t).find(".lg-relative-caption-item"),n=this.core.getSlideItem(t).find(".lg-sub-html");n.css("width",e.width+"px").css("left",e.left+"px");var s=o.get().getBoundingClientRect(),l=i.bottom-e.bottom-s.height;n.css("top","auto").css("bottom",Math.max(l,0)+"px")},l.prototype.setRelativeCaption=function(t){var e=this.core.getSlideItem(t);if(e.hasClass("lg-current")){var i=this.core.getSlideItem(t).find(".lg-object").get().getBoundingClientRect(),o=this.core.getSlideItem(t).get().getBoundingClientRect();this.setCaptionStyle(t,i,o),e.addClass("lg-show-caption")}},l.prototype.destroy=function(){this.core.LGel.off(".caption")},l}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-rotate.min.js
vendored
Normal file
8
blocks/lcp-gallery/assets/js/lg-share.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgShare=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function e(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var o=Array(t),n=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,n++)o[n]=i[s];return o}var r={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",pinterest:!0,pinterestDropdownText:"Pinterest",additionalShareOptions:[],sharePluginStrings:{share:"Share"}};function o(t){return"//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t.facebookShareUrl||window.location.href)}function n(t){var e=encodeURIComponent(t.twitterShareUrl||window.location.href);return"//twitter.com/intent/tweet?text="+t.tweetText+"&url="+e}function i(t){var e=t.pinterestText,r=encodeURIComponent(t.src);return"http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(t.pinterestShareUrl||window.location.href)+"&media="+r+"&description="+e}var s="lgAfterSlide";return function(){function a(e){return this.shareOptions=[],this.core=e,this.settings=t(t({},r),this.core.settings),this}return a.prototype.init=function(){this.settings.share&&(this.shareOptions=e(this.getDefaultShareOptions(),this.settings.additionalShareOptions),this.setLgShareMarkup(),this.core.outer.find(".lg-share .lg-dropdown").append(this.getShareListHtml()),this.core.LGel.on(s+".share",this.onAfterSlide.bind(this)))},a.prototype.getShareListHtml=function(){var t="";return this.shareOptions.forEach((function(e){t+=e.dropdownHTML})),t},a.prototype.setLgShareMarkup=function(){var t=this;this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.sharePluginStrings.share+'" aria-haspopup="true" aria-expanded="false" class="lg-share lg-icon">\n <ul class="lg-dropdown" style="position: absolute;"></ul></button>'),this.core.outer.append('<div class="lg-dropdown-overlay"></div>'),this.core.outer.find(".lg-share").first().on("click.lg",(function(){t.core.outer.toggleClass("lg-dropdown-active"),t.core.outer.hasClass("lg-dropdown-active")?t.core.outer.attr("aria-expanded",!0):t.core.outer.attr("aria-expanded",!1)})),this.core.outer.find(".lg-dropdown-overlay").first().on("click.lg",(function(){t.core.outer.removeClass("lg-dropdown-active"),t.core.outer.attr("aria-expanded",!1)}))},a.prototype.onAfterSlide=function(t){var e=this,r=t.detail.index,o=this.core.galleryItems[r];setTimeout((function(){e.shareOptions.forEach((function(t){var r=t.selector;e.core.outer.find(r).attr("href",t.generateLink(o))}))}),100)},a.prototype.getShareListItemHTML=function(t,e){return'<li><a class="lg-share-'+t+'" rel="noopener" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+e+"</span></a></li>"},a.prototype.getDefaultShareOptions=function(){return e(this.settings.facebook?[{type:"facebook",generateLink:o,dropdownHTML:this.getShareListItemHTML("facebook",this.settings.facebookDropdownText),selector:".lg-share-facebook"}]:[],this.settings.twitter?[{type:"twitter",generateLink:n,dropdownHTML:this.getShareListItemHTML("twitter",this.settings.twitterDropdownText),selector:".lg-share-twitter"}]:[],this.settings.pinterest?[{type:"pinterest",generateLink:i,dropdownHTML:this.getShareListItemHTML("pinterest",this.settings.pinterestDropdownText),selector:".lg-share-pinterest"}]:[])},a.prototype.destroy=function(){this.core.outer.find(".lg-dropdown-overlay").remove(),this.core.outer.find(".lg-share").remove(),this.core.LGel.off(".lg.share"),this.core.LGel.off(".share")},a}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-thumbnail.min.js
vendored
Normal file
8
blocks/lcp-gallery/assets/js/lg-video.min.js
vendored
Normal file
8
blocks/lcp-gallery/assets/js/lg-vimeo-thumbnail.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.8.2 | November 28th 2024
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgVimeoThumbnail=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t,e,n,o){return new(n||(n=Promise))((function(i,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,l)}a((o=o.apply(t,e||[])).next())}))}function n(t,e){var n,o,i,r,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(r){return function(l){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(!(i=u.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){u=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){u.label=r[1];break}if(6===r[0]&&u.label<i[1]){u.label=i[1],i=r;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(r);break}i[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,l])}}}var o="lgInit",i={showVimeoThumbnails:!0,showThumbnailWithPlayButton:!1};return function(){function r(e){return this.core=e,this.settings=t(t({},i),this.core.settings),this}return r.prototype.init=function(){var t=this;this.settings.showVimeoThumbnails&&this.core.LGel.on(o+".vimeothumbnails",(function(e){var n=e.detail.instance;n.$container.find(".lg-thumb-outer").get()&&t.setVimeoThumbnails(n)}))},r.prototype.setVimeoThumbnails=function(t){return e(this,void 0,void 0,(function(){var e,o,i;return n(this,(function(n){switch(n.label){case 0:e=0,n.label=1;case 1:return e<t.galleryItems.length?(o=t.galleryItems[e],(o.__slideVideoInfo||{}).vimeo?[4,fetch("https://vimeo.com/api/oembed.json?url="+encodeURIComponent(o.src))]:[3,4]):[3,5];case 2:return[4,n.sent().json()];case 3:i=n.sent(),t.$container.find(".lg-thumb-item").eq(e).find("img").attr("src",this.settings.showThumbnailWithPlayButton?i.thumbnail_url_with_play_button:i.thumbnail_url),n.label=4;case 4:return e++,[3,1];case 5:return[2]}}))}))},r.prototype.destroy=function(){this.core.LGel.off(".lg.vimeothumbnails"),this.core.LGel.off(".vimeothumbnails")},r}()}));
|
||||
8
blocks/lcp-gallery/assets/js/lg-zoom.min.js
vendored
Normal file
8
blocks/lcp-gallery/assets/js/lightgallery.min.js
vendored
Normal file
33
blocks/lcp-gallery/components/lightGallery.js
Normal file
@ -0,0 +1,33 @@
|
||||
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import LightGallery from 'lightgallery/react';
|
||||
import lgZoom from 'lightgallery/plugins/zoom';
|
||||
import lgThumbnail from 'lightgallery/plugins/thumbnail';
|
||||
import { LightGallery as ILightGallery } from 'lightgallery/lightgallery';
|
||||
import '../style.css';
|
||||
|
||||
export const App = () => {
|
||||
|
||||
const dynamicEl = [
|
||||
{
|
||||
src: '...',
|
||||
responsive: '...',
|
||||
thumb: '...',
|
||||
subHtml: `...`,
|
||||
},
|
||||
{
|
||||
src: '...',
|
||||
responsive: '...',
|
||||
subHtml: `...`,
|
||||
},
|
||||
// Add more placeholder images as needed
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<LightGallery
|
||||
dynamic={true}
|
||||
dynamicEl={dynamicEl}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
668
blocks/lcp-gallery/components/style.css
Normal file
@ -0,0 +1,668 @@
|
||||
@font-face {
|
||||
font-family: "lg";
|
||||
src: url("../fonts/lg.woff2?io9a6k") format("woff2"), url("../fonts/lg.ttf?io9a6k") format("truetype"), url("../fonts/lg.woff?io9a6k") format("woff"), url("../fonts/lg.svg?io9a6k#lg") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
.lg-icon {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: "lg" !important;
|
||||
speak: never;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
line-height: 1;
|
||||
/* Better Font Rendering =========== */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.lg-container {
|
||||
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
}
|
||||
|
||||
.lg-next,
|
||||
.lg-prev {
|
||||
background-color: rgba(0, 0, 0, 0.45);
|
||||
border-radius: 2px;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-size: 22px;
|
||||
margin-top: -10px;
|
||||
padding: 8px 10px 9px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
z-index: 1084;
|
||||
outline: none;
|
||||
border: none;
|
||||
}
|
||||
.lg-next.disabled,
|
||||
.lg-prev.disabled {
|
||||
opacity: 0 !important;
|
||||
cursor: default;
|
||||
}
|
||||
.lg-next:hover:not(.disabled),
|
||||
.lg-prev:hover:not(.disabled) {
|
||||
color: #fff;
|
||||
}
|
||||
.lg-single-item .lg-next,
|
||||
.lg-single-item .lg-prev {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.lg-next {
|
||||
right: 20px;
|
||||
}
|
||||
.lg-next:before {
|
||||
content: "\e095";
|
||||
}
|
||||
|
||||
.lg-prev {
|
||||
left: 20px;
|
||||
}
|
||||
.lg-prev:after {
|
||||
content: "\e094";
|
||||
}
|
||||
|
||||
@-webkit-keyframes lg-right-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: -30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes lg-right-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: -30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes lg-right-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: -30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@keyframes lg-right-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: -30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes lg-left-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: 30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes lg-left-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: 30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes lg-left-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: 30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
@keyframes lg-left-end {
|
||||
0% {
|
||||
left: 0;
|
||||
}
|
||||
50% {
|
||||
left: 30px;
|
||||
}
|
||||
100% {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
.lg-outer.lg-right-end .lg-object {
|
||||
-webkit-animation: lg-right-end 0.3s;
|
||||
-o-animation: lg-right-end 0.3s;
|
||||
animation: lg-right-end 0.3s;
|
||||
position: relative;
|
||||
}
|
||||
.lg-outer.lg-left-end .lg-object {
|
||||
-webkit-animation: lg-left-end 0.3s;
|
||||
-o-animation: lg-left-end 0.3s;
|
||||
animation: lg-left-end 0.3s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.lg-toolbar {
|
||||
z-index: 1082;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.lg-media-overlap .lg-toolbar {
|
||||
background-image: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
|
||||
}
|
||||
.lg-toolbar .lg-icon {
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-size: 24px;
|
||||
height: 47px;
|
||||
line-height: 27px;
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
width: 50px;
|
||||
text-decoration: none !important;
|
||||
outline: medium none;
|
||||
will-change: color;
|
||||
-webkit-transition: color 0.2s linear;
|
||||
-o-transition: color 0.2s linear;
|
||||
transition: color 0.2s linear;
|
||||
background: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.lg-toolbar .lg-icon.lg-icon-18 {
|
||||
font-size: 18px;
|
||||
}
|
||||
.lg-toolbar .lg-icon:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.lg-toolbar .lg-close:after {
|
||||
content: "\e070";
|
||||
}
|
||||
.lg-toolbar .lg-maximize {
|
||||
font-size: 22px;
|
||||
}
|
||||
.lg-toolbar .lg-maximize:after {
|
||||
content: "\e90a";
|
||||
}
|
||||
.lg-toolbar .lg-download:after {
|
||||
content: "\e0f2";
|
||||
}
|
||||
|
||||
.lg-sub-html {
|
||||
color: #eee;
|
||||
font-size: 16px;
|
||||
padding: 10px 40px;
|
||||
text-align: center;
|
||||
z-index: 1080;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.2s ease-out 0s;
|
||||
-o-transition: opacity 0.2s ease-out 0s;
|
||||
transition: opacity 0.2s ease-out 0s;
|
||||
}
|
||||
.lg-sub-html h4 {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.lg-sub-html p {
|
||||
font-size: 12px;
|
||||
margin: 5px 0 0;
|
||||
}
|
||||
.lg-sub-html a {
|
||||
color: inherit;
|
||||
}
|
||||
.lg-sub-html a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.lg-media-overlap .lg-sub-html {
|
||||
background-image: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
|
||||
}
|
||||
.lg-item .lg-sub-html {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.lg-error-msg {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.lg-counter {
|
||||
color: #999;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
padding-left: 20px;
|
||||
padding-top: 12px;
|
||||
height: 47px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.lg-closing .lg-toolbar,
|
||||
.lg-closing .lg-prev,
|
||||
.lg-closing .lg-next,
|
||||
.lg-closing .lg-sub-html {
|
||||
opacity: 0;
|
||||
-webkit-transition: -webkit-transform 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, color 0.08 linear;
|
||||
-moz-transition: -moz-transform 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, color 0.08 linear;
|
||||
-o-transition: -o-transform 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, color 0.08 linear;
|
||||
transition: transform 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.08 cubic-bezier(0, 0, 0.25, 1) 0s, color 0.08 linear;
|
||||
}
|
||||
|
||||
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-img-wrap,
|
||||
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-video-cont,
|
||||
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-media-cont {
|
||||
opacity: 0;
|
||||
-moz-transform: scale3d(0.5, 0.5, 0.5);
|
||||
-o-transform: scale3d(0.5, 0.5, 0.5);
|
||||
-ms-transform: scale3d(0.5, 0.5, 0.5);
|
||||
-webkit-transform: scale3d(0.5, 0.5, 0.5);
|
||||
transform: scale3d(0.5, 0.5, 0.5);
|
||||
will-change: transform, opacity;
|
||||
-webkit-transition: -webkit-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
||||
-moz-transition: -moz-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
||||
-o-transition: -o-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
||||
transition: transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
||||
}
|
||||
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-img-wrap,
|
||||
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-video-cont,
|
||||
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-media-cont {
|
||||
opacity: 1;
|
||||
-moz-transform: scale3d(1, 1, 1);
|
||||
-o-transform: scale3d(1, 1, 1);
|
||||
-ms-transform: scale3d(1, 1, 1);
|
||||
-webkit-transform: scale3d(1, 1, 1);
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
|
||||
.lg-icon:focus-visible {
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
outline: 1px dashed rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.lg-toolbar .lg-icon:focus-visible {
|
||||
border-radius: 8px;
|
||||
outline-offset: -5px;
|
||||
}
|
||||
|
||||
.lg-group:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.lg-container {
|
||||
display: none;
|
||||
outline: none;
|
||||
}
|
||||
.lg-container.lg-show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.lg-on {
|
||||
scroll-behavior: unset;
|
||||
}
|
||||
|
||||
.lg-overlay-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.lg-toolbar,
|
||||
.lg-prev,
|
||||
.lg-next,
|
||||
.lg-pager-outer,
|
||||
.lg-hide-sub-html .lg-sub-html {
|
||||
opacity: 0;
|
||||
will-change: transform, opacity;
|
||||
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
-moz-transition: -moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
-o-transition: -o-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
}
|
||||
|
||||
.lg-show-in .lg-toolbar,
|
||||
.lg-show-in .lg-prev,
|
||||
.lg-show-in .lg-next,
|
||||
.lg-show-in .lg-pager-outer {
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-show-in.lg-hide-sub-html .lg-sub-html {
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-show-in .lg-hide-items .lg-prev {
|
||||
opacity: 0;
|
||||
-webkit-transform: translate3d(-10px, 0, 0);
|
||||
transform: translate3d(-10px, 0, 0);
|
||||
}
|
||||
.lg-show-in .lg-hide-items .lg-next {
|
||||
opacity: 0;
|
||||
-webkit-transform: translate3d(10px, 0, 0);
|
||||
transform: translate3d(10px, 0, 0);
|
||||
}
|
||||
.lg-show-in .lg-hide-items .lg-toolbar {
|
||||
opacity: 0;
|
||||
-webkit-transform: translate3d(0, -10px, 0);
|
||||
transform: translate3d(0, -10px, 0);
|
||||
}
|
||||
.lg-show-in .lg-hide-items.lg-hide-sub-html .lg-sub-html {
|
||||
opacity: 0;
|
||||
-webkit-transform: translate3d(0, 20px, 0);
|
||||
transform: translate3d(0, 20px, 0);
|
||||
}
|
||||
|
||||
.lg-outer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1050;
|
||||
text-align: left;
|
||||
opacity: 0.001;
|
||||
outline: none;
|
||||
will-change: auto;
|
||||
overflow: hidden;
|
||||
-webkit-transition: opacity 0.15s ease 0s;
|
||||
-o-transition: opacity 0.15s ease 0s;
|
||||
transition: opacity 0.15s ease 0s;
|
||||
}
|
||||
.lg-outer * {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.lg-outer.lg-zoom-from-image {
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-outer.lg-visible {
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-prev-slide, .lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-next-slide, .lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-current {
|
||||
-webkit-transition-duration: inherit !important;
|
||||
transition-duration: inherit !important;
|
||||
-webkit-transition-timing-function: inherit !important;
|
||||
transition-timing-function: inherit !important;
|
||||
}
|
||||
.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-current {
|
||||
-webkit-transition-duration: 0s !important;
|
||||
transition-duration: 0s !important;
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-outer.lg-grab img.lg-object {
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: -o-grab;
|
||||
cursor: -ms-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
.lg-outer.lg-grabbing img.lg-object {
|
||||
cursor: move;
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: -o-grabbing;
|
||||
cursor: -ms-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
.lg-outer .lg-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.lg-outer .lg-inner {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
-webkit-transition: opacity 0s;
|
||||
-o-transition: opacity 0s;
|
||||
transition: opacity 0s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.lg-outer .lg-item {
|
||||
display: none !important;
|
||||
}
|
||||
.lg-outer .lg-item:not(.lg-start-end-progress) {
|
||||
background: url("../images/loading.gif") no-repeat scroll center center transparent;
|
||||
}
|
||||
.lg-outer.lg-css3 .lg-prev-slide,
|
||||
.lg-outer.lg-css3 .lg-current,
|
||||
.lg-outer.lg-css3 .lg-next-slide {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.lg-outer.lg-css .lg-current {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.lg-outer .lg-item,
|
||||
.lg-outer .lg-img-wrap {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.lg-outer .lg-item:before,
|
||||
.lg-outer .lg-img-wrap:before {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.lg-outer .lg-img-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
white-space: nowrap;
|
||||
font-size: 0;
|
||||
}
|
||||
.lg-outer .lg-item.lg-complete {
|
||||
background-image: none;
|
||||
}
|
||||
.lg-outer .lg-item.lg-current {
|
||||
z-index: 1060;
|
||||
}
|
||||
.lg-outer .lg-object {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: auto;
|
||||
height: auto;
|
||||
position: relative;
|
||||
}
|
||||
.lg-outer .lg-empty-html.lg-sub-html,
|
||||
.lg-outer .lg-empty-html .lg-sub-html {
|
||||
display: none;
|
||||
}
|
||||
.lg-outer.lg-hide-download .lg-download {
|
||||
opacity: 0.75;
|
||||
pointer-events: none;
|
||||
}
|
||||
.lg-outer .lg-first-slide .lg-dummy-img {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
}
|
||||
.lg-outer.lg-components-open:not(.lg-zoomed) .lg-components {
|
||||
-webkit-transform: translate3d(0, 0%, 0);
|
||||
transform: translate3d(0, 0%, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html {
|
||||
opacity: 1;
|
||||
transition: opacity 0.2s ease-out 0.15s;
|
||||
}
|
||||
.lg-outer .lg-media-cont {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
}
|
||||
.lg-outer .lg-media-cont .lg-object {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.lg-outer .lg-has-iframe .lg-media-cont {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.lg-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1040;
|
||||
background-color: #000;
|
||||
opacity: 0;
|
||||
will-change: auto;
|
||||
-webkit-transition: opacity 333ms ease-in 0s;
|
||||
-o-transition: opacity 333ms ease-in 0s;
|
||||
transition: opacity 333ms ease-in 0s;
|
||||
}
|
||||
.lg-backdrop.in {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.lg-css3.lg-no-trans .lg-prev-slide,
|
||||
.lg-css3.lg-no-trans .lg-next-slide,
|
||||
.lg-css3.lg-no-trans .lg-current {
|
||||
-webkit-transition: none 0s ease 0s !important;
|
||||
-moz-transition: none 0s ease 0s !important;
|
||||
-o-transition: none 0s ease 0s !important;
|
||||
transition: none 0s ease 0s !important;
|
||||
}
|
||||
.lg-css3.lg-use-css3 .lg-item {
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
.lg-css3.lg-fade .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-fade .lg-item.lg-current {
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-fade .lg-item.lg-prev-slide, .lg-css3.lg-fade .lg-item.lg-next-slide, .lg-css3.lg-fade .lg-item.lg-current {
|
||||
-webkit-transition: opacity 0.1s ease 0s;
|
||||
-moz-transition: opacity 0.1s ease 0s;
|
||||
-o-transition: opacity 0.1s ease 0s;
|
||||
transition: opacity 0.1s ease 0s;
|
||||
}
|
||||
.lg-css3.lg-use-css3 .lg-item.lg-start-progress {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
|
||||
transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
|
||||
}
|
||||
.lg-css3.lg-use-css3 .lg-item.lg-start-end-progress {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s;
|
||||
}
|
||||
.lg-css3.lg-slide.lg-use-css3 .lg-item {
|
||||
opacity: 0;
|
||||
}
|
||||
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide {
|
||||
-webkit-transform: translate3d(-100%, 0, 0);
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide {
|
||||
-webkit-transform: translate3d(100%, 0, 0);
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
opacity: 1;
|
||||
}
|
||||
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
|
||||
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
||||
}
|
||||
|
||||
.lg-container {
|
||||
display: none;
|
||||
}
|
||||
.lg-container.lg-show {
|
||||
display: block;
|
||||
}
|
||||
.lg-container.lg-dragging-vertical .lg-backdrop {
|
||||
-webkit-transition-duration: 0s !important;
|
||||
transition-duration: 0s !important;
|
||||
}
|
||||
.lg-container.lg-dragging-vertical .lg-css3 .lg-item.lg-current {
|
||||
-webkit-transition-duration: 0s !important;
|
||||
transition-duration: 0s !important;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.lg-inline .lg-backdrop,
|
||||
.lg-inline .lg-outer {
|
||||
position: absolute;
|
||||
}
|
||||
.lg-inline .lg-backdrop {
|
||||
z-index: 1;
|
||||
}
|
||||
.lg-inline .lg-outer {
|
||||
z-index: 2;
|
||||
}
|
||||
.lg-inline .lg-maximize:after {
|
||||
content: "\e909";
|
||||
}
|
||||
|
||||
.lg-components {
|
||||
-webkit-transform: translate3d(0, 100%, 0);
|
||||
transform: translate3d(0, 100%, 0);
|
||||
will-change: transform;
|
||||
-webkit-transition: -webkit-transform 0.35s ease-out 0s;
|
||||
-moz-transition: -moz-transform 0.35s ease-out 0s;
|
||||
-o-transition: -o-transform 0.35s ease-out 0s;
|
||||
transition: transform 0.35s ease-out 0s;
|
||||
z-index: 1080;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=lightgallery.css.map */
|
||||
549
blocks/lcp-gallery/lcp-gallery.php
Normal file
@ -0,0 +1,549 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Lcp Gallery
|
||||
* Description: Example block scaffolded with Create Block tool.
|
||||
* Requires at least: 6.1
|
||||
* Requires PHP: 7.0
|
||||
* Version: 0.1.0
|
||||
* Author: The WordPress Contributors
|
||||
* License: GPL-2.0-or-later
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Text Domain: lcp
|
||||
*
|
||||
* @package CreateBlock
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the block using the metadata loaded from the `block.json` file.
|
||||
* Behind the scenes, it registers also all assets so they can be enqueued
|
||||
* through the block editor in the corresponding context.
|
||||
*
|
||||
* @see https://developer.wordpress.org/reference/functions/register_block_type/
|
||||
*/
|
||||
if (!function_exists('lcp_random_string')) {
|
||||
|
||||
function lcp_random_string($length = 8, $css_compliant = false, $include_character_types = '') {
|
||||
// Define character sets
|
||||
$lowercase = 'abcdefghijklmnopqrstuvwxyz';
|
||||
$uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$numbers = '0123456789';
|
||||
$special_chars = '!@#$%^&*()_+-=[]{}|;:,.<>?';
|
||||
$all_chars = $lowercase . $uppercase . $numbers . $special_chars;
|
||||
|
||||
// Default to using all characters if no specific types are provided
|
||||
if (empty($include_character_types)) {
|
||||
$include_character_types = 'all';
|
||||
}
|
||||
|
||||
// Build the allowed character set
|
||||
$char_set = '';
|
||||
|
||||
if ($include_character_types === 'all') {
|
||||
// Include everything
|
||||
$char_set = $all_chars;
|
||||
} else {
|
||||
// Add specific types requested
|
||||
if (strpos($include_character_types, 'lowercase') !== false) {
|
||||
$char_set .= $lowercase;
|
||||
}
|
||||
if (strpos($include_character_types, 'uppercase') !== false) {
|
||||
$char_set .= $uppercase;
|
||||
}
|
||||
if (strpos($include_character_types, 'numbers') !== false) {
|
||||
$char_set .= $numbers;
|
||||
}
|
||||
if (strpos($include_character_types, 'special') !== false) {
|
||||
$char_set .= $special_chars;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that the string is valid for CSS (starts with a letter and can only include letters, digits, hyphens, or underscores)
|
||||
$css_char_set = $lowercase . $uppercase . $numbers . '-_';
|
||||
|
||||
// Random string generation logic
|
||||
$random_string = '';
|
||||
$first_char = '';
|
||||
|
||||
// If CSS compliant, start with a letter (either lowercase or uppercase)
|
||||
if ($css_compliant) {
|
||||
// Ensure the first character is a letter (CSS compliant start)
|
||||
$first_char = $lowercase[rand(0, strlen($lowercase) - 1)];
|
||||
$random_string .= $first_char;
|
||||
$length--; // Decrease length by 1 as we already added the first char
|
||||
}
|
||||
|
||||
// Fill the rest of the string with random characters from the valid set (CSS compliant)
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
// Use only characters that are CSS compliant (letters, digits, hyphens, or underscores)
|
||||
$random_string .= $css_char_set[rand(0, strlen($css_char_set) - 1)];
|
||||
}
|
||||
|
||||
// Return the string
|
||||
return $random_string;
|
||||
}
|
||||
}
|
||||
|
||||
// Return an array of Media IDs
|
||||
function get_media_ids($attributes) {
|
||||
// Ensure 'galleryItems' exists in the attributes array
|
||||
if (isset($attributes['galleryItems']) && $attributes['source'] == "manual") {
|
||||
// Extract 'id' from each item in the 'galleryItems' array
|
||||
$media_ids = array_map(function($item) {
|
||||
return $item['id']; // Return the 'id' value from each array item
|
||||
}, $attributes['galleryItems']); // Use $attributes['galleryItems'] here
|
||||
// Check if we need to include the post thumbnail
|
||||
if ($attributes['includePostThumbnail']) {
|
||||
// Get the featured image (post thumbnail) ID
|
||||
$featured_media_id = get_post_thumbnail_id(get_the_ID());
|
||||
if ($featured_media_id) {
|
||||
// Add the featured media ID to the beginning of the array
|
||||
array_unshift($media_ids, $featured_media_id);
|
||||
}
|
||||
}
|
||||
// Return the array of media IDs
|
||||
return $media_ids;
|
||||
}
|
||||
// Return an empty array if 'galleryItems' doesn't exist or 'source' is not 'manual'
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
//Get the gallery items from the media IDs
|
||||
function get_gallery_items_data($media_ids) {
|
||||
$gallery_items = array();
|
||||
|
||||
// Loop through each media ID
|
||||
foreach ($media_ids as $media_id) {
|
||||
// Get the full-size image URL
|
||||
$image_url = wp_get_attachment_url($media_id);
|
||||
|
||||
// Get the attachment metadata, including available image sizes
|
||||
$metadata = wp_get_attachment_metadata($media_id);
|
||||
|
||||
// Initialize the `data-lg-size` and `data-responsive` attributes
|
||||
$lg_size = '';
|
||||
$responsive_data = '';
|
||||
|
||||
// Check if metadata exists and extract image sizes
|
||||
if (isset($metadata['sizes'])) {
|
||||
// Loop through the sizes and build the data-lg-size and data-responsive attributes
|
||||
foreach ($metadata['sizes'] as $size_name => $size_info) {
|
||||
// data-lg-size format: width-height-width (for each image size)
|
||||
$lg_size .= $size_info['width'] . '-' . $size_info['height'] . '-'. $size_info['width'] . ', ';
|
||||
|
||||
// Get the URL of the size's image for data-responsive
|
||||
$file_url = wp_get_attachment_image_url($media_id, $size_name); // Get the URL of the size's image
|
||||
|
||||
// Add the image URL and width to the data-responsive string
|
||||
if ($file_url) {
|
||||
$responsive_data .= $file_url . ' ' . $size_info['width'] . ', ';
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up trailing commas and spaces
|
||||
$lg_size = rtrim($lg_size, ', ');
|
||||
$responsive_data = rtrim($responsive_data, ', ');
|
||||
}
|
||||
|
||||
// Get the caption from the media's post (if available)
|
||||
$caption = get_post_field('post_excerpt', $media_id); // Retrieves the caption (if set)
|
||||
|
||||
// Get the alt text from the media's metadata (if available)
|
||||
$alt_text = get_post_meta($media_id, '_wp_attachment_image_alt', true);
|
||||
|
||||
// Use a fallback for alt text if it's empty
|
||||
if (empty($alt_text)) {
|
||||
$alt_text = 'No alt text available';
|
||||
}
|
||||
|
||||
// Add the gallery item to the array
|
||||
$gallery_items[] = array(
|
||||
'src' => esc_url($image_url), // Full-size image URL
|
||||
'responsive' => esc_attr($responsive_data), // Responsive srcset
|
||||
'thumb' => wp_get_attachment_image_url($media_id, 'thumbnail'), // Thumbnail URL
|
||||
'medium' => wp_get_attachment_image_url($media_id, 'medium'), // Medium URL
|
||||
'subHtml' => !empty($caption) ?
|
||||
'<div class="lightGallery-captions"><p>' . esc_html($caption) . '</p></div>' :
|
||||
'<div><h4>' . esc_html($alt_text) . '</h4></div>',
|
||||
'lg_size' => $lg_size, // The data-lg-size string
|
||||
'responsive_data' => $responsive_data, // The data-responsive string
|
||||
'size' => 'full' // Added size attribute for better responsive handling
|
||||
);
|
||||
}
|
||||
|
||||
// Return the array of gallery items
|
||||
return $gallery_items;
|
||||
}
|
||||
|
||||
// Build the HTML for the gallery items
|
||||
function build_gallery_items_html($gallery_items_data, $attributes) {
|
||||
// Initialize an empty string for the HTML output
|
||||
$html = '';
|
||||
|
||||
// If the gallery is set to render dynamically, limit the number of items if applicable
|
||||
// otherwise, return all items
|
||||
if ($attributes['dynamic']) {
|
||||
// Get the value of 'maxInitialItems' from attributes, default to 0 if not set
|
||||
$max_initial_items = isset($attributes['maxInitialItems']) ? (int) $attributes['maxInitialItems'] : 0;
|
||||
// Limit the number of gallery items based on maxInitialItems
|
||||
if ($max_initial_items > 0) {
|
||||
// Slice the array to only include the first $max_initial_items items
|
||||
$gallery_items_data = array_slice($gallery_items_data, 0, $max_initial_items);
|
||||
}
|
||||
}
|
||||
|
||||
// Loop through each gallery item and create the HTML
|
||||
foreach ($gallery_items_data as $item) {
|
||||
$src = $item['src'];
|
||||
$thumb = $item['thumb'];
|
||||
$medium = $item['medium'];
|
||||
$sub_html = $item['subHtml'];
|
||||
$lg_size = $item['lg_size']; // Fetch the lg_size data for the current item
|
||||
$responsive = $item['responsive_data']; // Fetch the responsive data (URLs + widths)
|
||||
|
||||
// Create the HTML structure for each item, including data-responsive
|
||||
$html .= '
|
||||
<a data-lg-size="' . esc_attr($lg_size) . '"
|
||||
data-responsive="' . esc_attr($responsive) . '"
|
||||
class="lcp-gallery-item"
|
||||
data-src="' . esc_url($src) . '"
|
||||
data-sub-html="' . esc_attr($sub_html) . '">
|
||||
<img class="img-fluid" src="' . esc_url($medium) . '" />
|
||||
</a>';
|
||||
}
|
||||
|
||||
// Return the constructed HTML
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Array of required plugins
|
||||
function build_plugins_json($attributes) {
|
||||
// Initialize the plugins array
|
||||
$plugins = array();
|
||||
|
||||
// Check if lgSettings['zoom'] is true and add 'lgShare' to the plugins array
|
||||
if (isset($attributes['lgSettings']['zoom']) && $attributes['lgSettings']['zoom'] === true) {
|
||||
$plugins[] = 'lgZoom';
|
||||
}
|
||||
// Check if lgSettings['share'] is true and add 'lgShare' to the plugins array
|
||||
if (isset($attributes['lgSettings']['share']) && $attributes['lgSettings']['share'] === true) {
|
||||
$plugins[] = 'lgShare';
|
||||
}
|
||||
// Check if lgSettings['share'] is true and add 'lgShare' to the plugins array
|
||||
if (isset($attributes['lgSettings']['autoplay']) && $attributes['lgSettings']['autoplay'] === true) {
|
||||
$plugins[] = 'lgAutoplay';
|
||||
}
|
||||
if (isset($attributes['lgSettings']['fullScreen']) && $attributes['lgSettings']['fullScreen'] === true) {
|
||||
$plugins[] = 'lgFullScreen';
|
||||
}
|
||||
if (isset($attributes['lgSettings']['thumbnail']) && $attributes['lgSettings']['thumbnail'] === true) {
|
||||
$plugins[] = 'lgThumbnail';
|
||||
}
|
||||
if (isset($attributes['lgSettings']['rotate']) && $attributes['lgSettings']['rotate'] === true) {
|
||||
$plugins[] = 'lgRotate';
|
||||
}
|
||||
// JSON encode the plugins array and return the result
|
||||
return ($plugins);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Build array of dynamic elements - returns an array
|
||||
function build_dynamic_elements_array($gallery_items_data) {
|
||||
$dynamic_elements = [];
|
||||
|
||||
foreach ($gallery_items_data as $item) {
|
||||
$src = $item['src'];
|
||||
$responsive = $item['responsive'] ?: ''; // Fallback if responsive is empty
|
||||
$thumb = $item['thumb'];
|
||||
$subHtml = $item['subHtml'];
|
||||
$alt_text = isset($item['alt_text']) ? $item['alt_text'] : 'No title available';
|
||||
|
||||
$subHtmlContent = '<div class="lightGallery-captions"><h4>' . esc_html($alt_text) . '</h4><p>' . esc_html($subHtml) . '</p></div>';
|
||||
|
||||
$dynamic_elements[] = [
|
||||
'src' => esc_url($src),
|
||||
'responsive' => esc_attr($responsive),
|
||||
'thumb' => esc_url($thumb),
|
||||
'subHtml' => $subHtmlContent,
|
||||
];
|
||||
}
|
||||
|
||||
return $dynamic_elements;
|
||||
}
|
||||
|
||||
// Build the gallery settings JSON
|
||||
function build_gallery_settings_json($attributes,$unique_class) {
|
||||
$container_class = ".". $unique_class;
|
||||
// Step 1: Get the media IDs based on the attributes
|
||||
$media_ids = get_media_ids($attributes);
|
||||
if (empty($media_ids)) {
|
||||
return json_encode(['error' => 'No media IDs found']);
|
||||
}
|
||||
|
||||
// Step 2: Get the gallery items data
|
||||
$gallery_items_data = get_gallery_items_data($media_ids);
|
||||
if (empty($gallery_items_data)) {
|
||||
return json_encode(['error' => 'No gallery items data found']);
|
||||
}
|
||||
|
||||
// Step 3: Build the dynamic elements array
|
||||
$dynamic_elements = build_dynamic_elements_array($gallery_items_data);
|
||||
if (empty($dynamic_elements)) {
|
||||
return json_encode(['error' => 'No dynamic elements found']);
|
||||
}
|
||||
|
||||
// Step 4: Initialize lgSettings from $attributes
|
||||
$lgSettings = isset($attributes['lgSettings']) ? $attributes['lgSettings'] : [];
|
||||
|
||||
// Step 5: Modify lgSettings if initialLayout is "inline"
|
||||
if (isset($attributes['initialLayout']) && $attributes['initialLayout'] == "inline") {
|
||||
$lgSettings['container'] = $container_class;
|
||||
}
|
||||
|
||||
// Step 6: Add dynamic elements to lgSettings if dynamic is true
|
||||
if (isset($lgSettings['dynamic']) && $lgSettings['dynamic']) {
|
||||
$lgSettings['dynamicEl'] = $dynamic_elements;
|
||||
}
|
||||
|
||||
// Step 7: Return the modified lgSettings object as JSON
|
||||
$json = json_encode($lgSettings);
|
||||
|
||||
// Step 8: Check for JSON encoding errors
|
||||
if ($json === false) {
|
||||
return json_encode(['error' => 'JSON encoding failed', 'error_details' => json_last_error_msg()]);
|
||||
}
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
|
||||
// Build the gallery styles based on $attributes and a unique class for rendering multiple galleries on the same page
|
||||
function build_gallery_styles($attributes,$unique_class) {
|
||||
$styles = "<style>";
|
||||
$styles .= "
|
||||
.$unique_class {
|
||||
background-color: $background_color;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: $item_spacing;
|
||||
justify-content: center;
|
||||
background:red;
|
||||
}
|
||||
";
|
||||
|
||||
$styles .= "</style>";
|
||||
|
||||
// Return the generated styles
|
||||
return $styles;
|
||||
}
|
||||
|
||||
// Render the block
|
||||
function render_lcp_gallery_block($attributes) {
|
||||
$unique_class = lcp_random_string(8, true);
|
||||
// Get the media IDs based on the attributes
|
||||
$media_ids = get_media_ids($attributes);
|
||||
|
||||
// Get the gallery items data using the media IDs
|
||||
$gallery_items_data = get_gallery_items_data($media_ids);
|
||||
|
||||
// Generate the HTML for the gallery items
|
||||
$gallery_items_html = build_gallery_items_html($gallery_items_data, $attributes);
|
||||
|
||||
// Generate the gallery settings JSON
|
||||
$gallery_settings_json = build_gallery_settings_json($attributes,$unique_class);
|
||||
|
||||
|
||||
|
||||
|
||||
// Generate styles for the gallery based on the unique class
|
||||
$classes = 'lcp-gallery'; // Start with lcp-gallery class
|
||||
|
||||
// Check if 'initialLayout' is set to 'grid' and add grid column classes if applicable
|
||||
if (isset($attributes['initialLayout']) && $attributes['initialLayout'] === 'grid') {
|
||||
// Image aspect ratios
|
||||
$classes .= ' aspect-' . esc_attr($attributes['itemsAspectRatio']);
|
||||
// Grid classes
|
||||
$classes .= ' grid';
|
||||
// Grid columns
|
||||
if (isset($attributes['gridColumnsLarge'])) {
|
||||
$classes .= ' large-' . esc_attr($attributes['gridColumnsLarge']) . '-columns';
|
||||
}
|
||||
if (isset($attributes['gridColumnsMedium'])) {
|
||||
$classes .= ' medium-' . esc_attr($attributes['gridColumnsMedium']) . '-columns';
|
||||
}
|
||||
if (isset($attributes['gridColumnsSmall'])) {
|
||||
$classes .= ' small-' . esc_attr($attributes['gridColumnsSmall']) . '-columns';
|
||||
}
|
||||
}
|
||||
|
||||
// Add 'initialLayout' class if it exists and isn't 'grid'
|
||||
if (isset($attributes['initialLayout']) && !empty($attributes['initialLayout']) && $attributes['initialLayout'] !== 'grid') {
|
||||
$classes .= ' ' . esc_attr($attributes['initialLayout']);
|
||||
}
|
||||
|
||||
// Build the styles using the unique class (if necessary)
|
||||
$styles = build_gallery_styles($attributes, $unique_class);
|
||||
|
||||
// Return the complete gallery HTML with the unique class and the settings as a JSON string
|
||||
return "
|
||||
<div class= '{$classes}' data-lgSettings='" . esc_attr($gallery_settings_json) . "'>
|
||||
{$gallery_items_html}
|
||||
</div>";
|
||||
}
|
||||
/* Initialize Gallery Block */
|
||||
function lcp_gallery_block_init() {
|
||||
register_block_type( __DIR__ . '/build', array(
|
||||
'render_callback' => 'render_lcp_gallery_block',
|
||||
));
|
||||
|
||||
}
|
||||
add_action( 'init', 'lcp_gallery_block_init' );
|
||||
|
||||
/* Set Block Flag for Dynamic Enqueue */
|
||||
|
||||
|
||||
/* Enqueue scripts and styles */
|
||||
function enqueue_lightgallery_scripts() {
|
||||
// Enqueue styles
|
||||
wp_enqueue_style('lcp-gallery', get_template_directory_uri() . '/blocks/lcp-gallery/assets/css/lcp-gallery.css');
|
||||
wp_enqueue_style('lightgallery-css', get_template_directory_uri() . '/blocks/lcp-gallery/assets/css/lightgallery-bundle.min.css');
|
||||
wp_enqueue_style('lg-transitions-css', get_template_directory_uri() . '/blocks/gallery/assets/css/lg-transitions.css');
|
||||
|
||||
// Enqueue scripts
|
||||
wp_enqueue_script('lightgallery-js', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lightgallery.min.js', array(), null, true);
|
||||
wp_enqueue_script('lg-autoplay', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-autoplay.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-comment', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-comment.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-fullscreen', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-fullscreen.min.js', array(), null, true);
|
||||
wp_enqueue_script('lg-hash', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-hash.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-medium-zoom', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-medium-zoom.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-pager', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-pager.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-relative-caption', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-relative-caption.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-rotate', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-rotate.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-share', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-share.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-thumbnail', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-thumbnail.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-video', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-video.min.js', array('lightgallery-js'), null, true);
|
||||
wp_enqueue_script('lg-zoom', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-zoom.min.js', array('lightgallery-js'), null, true);
|
||||
|
||||
// Check for plugins and enqueue if necessary
|
||||
//if ( in_array( 'lg_zoom', $lcp_gallery_enqueue_data['plugins'], true ) ) {
|
||||
// wp_enqueue_script('lg-zoom', get_template_directory_uri() . '/blocks/lcp-gallery/assets/js/lg-zoom.min.js', array('lightgallery-js'), null, true);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
add_action('wp_enqueue_scripts', 'enqueue_lightgallery_scripts');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* REST */
|
||||
add_action('rest_api_init', function () {
|
||||
// Register a custom route
|
||||
register_rest_route('custom/v1', '/get-gallery-supported-plugins-data', [
|
||||
'methods' => 'GET',
|
||||
'callback' => 'get_gallery_supported_plugins_data',
|
||||
'permission_callback' => '__return_true', // Publicly accessible
|
||||
]);
|
||||
});
|
||||
|
||||
// Callback function to get gallery supported plugin data
|
||||
function get_gallery_supported_plugins_data() {
|
||||
// Check if Jet Engine is active
|
||||
if ( ! class_exists( 'Jet_Engine' ) ) {
|
||||
return rest_ensure_response( [ 'jetengine_active' => false ] );
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
$post_types = [];
|
||||
|
||||
// Query to get all rows with 'content-type' status
|
||||
$results = $wpdb->get_results( "
|
||||
SELECT * FROM {$wpdb->prefix}jet_post_types
|
||||
|
||||
" );
|
||||
|
||||
// Loop through each row
|
||||
foreach ( $results as $row ) {
|
||||
// Unserialize the 'args' column to get the post type details
|
||||
$args = maybe_unserialize( $row->args );
|
||||
$meta_fields = maybe_unserialize( $row->meta_fields );
|
||||
|
||||
// Get the slug value (used for related_table)
|
||||
$related_table = isset( $args['slug'] ) ? $args['slug'] : '';
|
||||
|
||||
// Initialize the post type array
|
||||
$post_type_data = [
|
||||
'status' => $row->status,
|
||||
'args' => $args,
|
||||
'gallery_fields' => [],
|
||||
'related_table' => $related_table, // Add related_table with slug value
|
||||
];
|
||||
|
||||
// If there are meta_fields, filter out the gallery fields
|
||||
if ( isset( $meta_fields ) && is_array( $meta_fields ) ) {
|
||||
foreach ( $meta_fields as $field ) {
|
||||
if ( isset( $field['type'] ) && $field['type'] === 'gallery' ) {
|
||||
$post_type_data['meta_fields'][] = $field;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the post type to the array if gallery fields exist
|
||||
if ( ! empty( $post_type_data['meta_fields'] ) ) {
|
||||
$post_types[] = $post_type_data;
|
||||
}
|
||||
}
|
||||
|
||||
return rest_ensure_response( [
|
||||
'jetengine_active' => true,
|
||||
'post_types' => $post_types,
|
||||
] );
|
||||
}
|
||||
|
||||
/* GALLERY CPT */
|
||||
function create_lcp_gallery_cpt() {
|
||||
$labels = array(
|
||||
'name' => 'Galleries',
|
||||
'singular_name' => 'Gallery',
|
||||
'menu_name' => 'Galleries',
|
||||
'name_admin_bar' => 'Gallery',
|
||||
'add_new' => 'Add New',
|
||||
'add_new_item' => 'Add New Gallery',
|
||||
'new_item' => 'New LCP Gallery',
|
||||
'edit_item' => 'Edit LCP Gallery',
|
||||
'view_item' => 'View LCP Gallery',
|
||||
'all_items' => 'All LCP Galleries',
|
||||
'search_items' => 'Search LCP Galleries',
|
||||
'parent_item_colon' => 'Parent LCP Galleries:',
|
||||
'not_found' => 'No LCP Galleries found.',
|
||||
'not_found_in_trash' => 'No LCP Galleries found in Trash.',
|
||||
);
|
||||
|
||||
$args = array(
|
||||
'labels' => $labels,
|
||||
'public' => true, // Makes it public on the front end
|
||||
'has_archive' => true, // Enables the archive page
|
||||
'show_in_rest' => true, // Enables support for the block editor (Gutenberg)
|
||||
'rewrite' => array( 'slug' => 'lcpgallery' ), // Set the custom slug
|
||||
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'custom-fields' ), // Post type features
|
||||
'menu_icon' => 'dashicons-images-alt2', // Optional icon for admin menu
|
||||
'show_in_menu' => true, // Show it in the admin menu
|
||||
'show_ui' => true, // Ensure it shows in the WordPress admin
|
||||
'hierarchical' => false, // Set to true for hierarchical post type (like Pages)
|
||||
);
|
||||
|
||||
// Register the custom post type
|
||||
register_post_type( 'lcpgallery', $args );
|
||||
}
|
||||
|
||||
// Hook into the 'init' action to register the custom post type
|
||||
add_action( 'init', 'create_lcp_gallery_cpt' );
|
||||
23
blocks/lcp-gallery/package.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "gallery",
|
||||
"version": "0.1.0",
|
||||
"description": "Example block scaffolded with Create Block tool.",
|
||||
"author": "The WordPress Contributors",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"main": "build/index.js",
|
||||
"scripts": {
|
||||
"build": "wp-scripts build",
|
||||
"format": "wp-scripts format",
|
||||
"lint:css": "wp-scripts lint-style",
|
||||
"lint:js": "wp-scripts lint-js",
|
||||
"packages-update": "wp-scripts packages-update",
|
||||
"plugin-zip": "wp-scripts plugin-zip",
|
||||
"start": "wp-scripts start"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@wordpress/scripts": "^30.7.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"lightgallery": "^2.8.2"
|
||||
}
|
||||
}
|
||||
55
blocks/lcp-gallery/readme.txt
Normal file
@ -0,0 +1,55 @@
|
||||
=== Gallery ===
|
||||
Contributors: The WordPress Contributors
|
||||
Tags: block
|
||||
Tested up to: 6.6
|
||||
Stable tag: 0.1.0
|
||||
License: GPL-2.0-or-later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Example block scaffolded with Create Block tool.
|
||||
|
||||
== Description ==
|
||||
|
||||
This is the long description. No limit, and you can use Markdown (as well as in the following sections).
|
||||
|
||||
For backwards compatibility, if this section is missing, the full length of the short description will be used, and
|
||||
Markdown parsed.
|
||||
|
||||
== Installation ==
|
||||
|
||||
This section describes how to install the plugin and get it working.
|
||||
|
||||
e.g.
|
||||
|
||||
1. Upload the plugin files to the `/wp-content/plugins/gallery` directory, or install the plugin through the WordPress plugins screen directly.
|
||||
1. Activate the plugin through the 'Plugins' screen in WordPress
|
||||
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= A question that someone might have =
|
||||
|
||||
An answer to that question.
|
||||
|
||||
= What about foo bar? =
|
||||
|
||||
Answer to foo bar dilemma.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
|
||||
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
|
||||
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
|
||||
(or jpg, jpeg, gif).
|
||||
2. This is the second screen shot
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 0.1.0 =
|
||||
* Release
|
||||
|
||||
== Arbitrary section ==
|
||||
|
||||
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
|
||||
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
|
||||
"installation." Arbitrary sections will be shown below the built-in sections outlined above.
|
||||
409
blocks/lcp-gallery/src/block.json
Normal file
@ -0,0 +1,409 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "lcp/lcp-gallery",
|
||||
"version": "0.1.0",
|
||||
"title": "LCP Gallery",
|
||||
"category": "widgets",
|
||||
"icon": "",
|
||||
"description": "A dynamic or static gallery based on the Lightgallery javascript plugin",
|
||||
"example": {},
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"attributes": {
|
||||
"lgSettingsOld" :{
|
||||
"type": "object",
|
||||
"default": {
|
||||
"mode": "fade",
|
||||
"cssEasing": "ease",
|
||||
"loop": true,
|
||||
"keyPress": true,
|
||||
"controls": true,
|
||||
"thumbs": false,
|
||||
"zoom": true,
|
||||
"slideEndAnimatoin": true,
|
||||
"fullScreen": true,
|
||||
"autoplay": false,
|
||||
"slideShowAutoplay": false,
|
||||
"autoplayControls": true,
|
||||
"pauseOnHover": false,
|
||||
"progressBar": false,
|
||||
"exThumbImage": "data-exthumbimage",
|
||||
"showThumbByDefault": false,
|
||||
"currentPagerPosition": "middle",
|
||||
"addClass": "",
|
||||
"isMobile": false,
|
||||
"mobileSettings": {
|
||||
"controls": false,
|
||||
"showCloseIcon": true,
|
||||
"enableTouch": true,
|
||||
"enableDrag": true
|
||||
},
|
||||
"imageAutoPlay": true,
|
||||
"slideShowInterval": 5000,
|
||||
"counter": true,
|
||||
"closeOnEscape": true,
|
||||
"showCloseIcon": true,
|
||||
"swipeThreshold": 50,
|
||||
"draggable": true,
|
||||
"slideSpeed": 400,
|
||||
"hideBarsDelay": 3000,
|
||||
"dynamic": true,
|
||||
"dynamicEl": [],
|
||||
"captionDelay": 0,
|
||||
"videoMaxWidth": "100%",
|
||||
"videoAutoplay": true,
|
||||
"videoJS": false,
|
||||
"audio": false,
|
||||
"audioJS": false,
|
||||
"lightboxWidth": "auto",
|
||||
"lightboxHeight": "auto",
|
||||
"videojs": {
|
||||
"autoplay": true,
|
||||
"controls": true
|
||||
},
|
||||
"gestureSettings": {
|
||||
"zoom": true,
|
||||
"drag": true
|
||||
},
|
||||
"ariaLabelledby": "lightgallery-caption",
|
||||
"ariaDescribedby": "lightgallery-description",
|
||||
"thumbnailSelector": ".lg-thumbnail",
|
||||
"galleryClass": "lg-gallery",
|
||||
"selectableThumbs": false,
|
||||
"slideTransition": "ease-in-out",
|
||||
"share": false,
|
||||
"hash": false,
|
||||
"download": false,
|
||||
"allowMediaOverlap": false,
|
||||
"responsive": true,
|
||||
"fullscreenBtn": true,
|
||||
"prevHtml": "",
|
||||
"nextHtml": "",
|
||||
"closeHtml": "",
|
||||
"playHtml": "<i class='lg-icon lg-icon-play'></i>",
|
||||
"pauseHtml": "<i class='lg-icon lg-icon-pause'></i>"
|
||||
}
|
||||
},
|
||||
"parseElementForItems": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"parsedTargetElement": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"parsedExcludedElements": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"lgSettings": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"zoom": false,
|
||||
"thumbnail": false,
|
||||
"toggleThumb":false,
|
||||
"thumbWidth": 120,
|
||||
"thumbHeight": "80px",
|
||||
"thumbMargin": 4,
|
||||
"hash": false,
|
||||
"galleryId": "1",
|
||||
"dynamic": false,
|
||||
"mode": "lg-fade",
|
||||
"cssEasing": "ease",
|
||||
"rotate": false,
|
||||
"fullScreen": false,
|
||||
"autoplay": false,
|
||||
"download": false,
|
||||
"container": "",
|
||||
"closeable": true,
|
||||
"zoomFromOrigin": false,
|
||||
"plugins": []
|
||||
}
|
||||
},
|
||||
"hashGalleryId": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"source": {
|
||||
"type": "string",
|
||||
"default": "manual"
|
||||
},
|
||||
"galleryItems": {
|
||||
"type": "array"
|
||||
},
|
||||
"sourceMetaField": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"sourceTable": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"sourceColumn": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"includePostThumbnail": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"initialLayout": {
|
||||
"type": "string",
|
||||
"default": "grid"
|
||||
},
|
||||
"initialLayoutLarge": {
|
||||
"type": "string",
|
||||
"default": "inline"
|
||||
},
|
||||
"initialLayoutSmall": {
|
||||
"type": "string",
|
||||
"default": "inline"
|
||||
},
|
||||
"justifiedRowHeightSmall": {
|
||||
"type": "string",
|
||||
"default": "150px"
|
||||
},
|
||||
"justifiedRowHeightMedium": {
|
||||
"type": "string",
|
||||
"default": "150px"
|
||||
},
|
||||
"justifiedRowHeightLarge": {
|
||||
"type": "string",
|
||||
"default": "150px"
|
||||
},
|
||||
"justifiedLastRow": {
|
||||
"type": "string",
|
||||
"default": "justify"
|
||||
},
|
||||
"maxInitialItems": {
|
||||
"type": "number",
|
||||
"default": 0
|
||||
},
|
||||
"initialImageSize": {
|
||||
"type": "string",
|
||||
"default": "medium-large"
|
||||
},
|
||||
"inlineHeightSmall": {
|
||||
"type": "string",
|
||||
"default": "300px"
|
||||
},
|
||||
"inlineHeightMedium": {
|
||||
"type": "string",
|
||||
"default": "400px"
|
||||
},
|
||||
"inlineHeightLarge": {
|
||||
"type": "string",
|
||||
"default": "500px"
|
||||
},
|
||||
"containerWidthDesktop": {
|
||||
"type": "string",
|
||||
"default": "100%"
|
||||
},
|
||||
"containerWidthTablet": {
|
||||
"type": "string",
|
||||
"default": "100%"
|
||||
},
|
||||
"containerWidthMobile": {
|
||||
"type": "string",
|
||||
"default": "100%"
|
||||
},
|
||||
"itemsAspectRatio": {
|
||||
"type": "string",
|
||||
"default": "1-1"
|
||||
},
|
||||
"gridColumns": {
|
||||
"type": "number",
|
||||
"default": 4
|
||||
},
|
||||
"gridColumnsLarge": {
|
||||
"type": "number",
|
||||
"default": 4
|
||||
},
|
||||
"gridColumnsMedium": {
|
||||
"type": "number",
|
||||
"default": 3
|
||||
},
|
||||
"gridColumnsSmall": {
|
||||
"type": "number",
|
||||
"default": 2
|
||||
},
|
||||
"gridGapLarge": {
|
||||
"type": "number",
|
||||
"default": 10
|
||||
},
|
||||
"gridGapMedium": {
|
||||
"type": "number",
|
||||
"default": 10
|
||||
},
|
||||
"gridGapSmall": {
|
||||
"type": "number",
|
||||
"default": 10
|
||||
},
|
||||
"downloadLimitRoles": {
|
||||
"type": "array",
|
||||
"default": ""
|
||||
},
|
||||
"allowHideThumbnails": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"thumbnailsStyle": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"thumbnailActiveStyle": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"thumbnailBorders": {
|
||||
"type": "object"
|
||||
},
|
||||
"thumbnailBordersSelected": {
|
||||
"type": "object"
|
||||
},
|
||||
"showCaptions": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"showItemTitle": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"showItemDescription": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"lgMode": {
|
||||
"type": "string",
|
||||
"default": "lg-slide"
|
||||
},
|
||||
"downloadSize": {
|
||||
"type": "string",
|
||||
"default": "full"
|
||||
},
|
||||
"allowShare": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"lgVideo": {
|
||||
"type": "boolean",
|
||||
"default": "true"
|
||||
},
|
||||
"dynamic": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
|
||||
"loop": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
|
||||
|
||||
"speed": {
|
||||
"type": "number",
|
||||
"default": 500
|
||||
},
|
||||
"slideDelay": {
|
||||
"type": "number",
|
||||
"default": 200
|
||||
},
|
||||
"hash": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"allowZoom": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"closable": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"closeOnTap": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"container": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"showControls": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"showCounter": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"showMaximizeIcon": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"easing": {
|
||||
"type": "string",
|
||||
"default": "ease"
|
||||
},
|
||||
"download": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"thumbnail": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"appendThumbnailsTo": {
|
||||
"type": "string",
|
||||
"default": ".lg-components"
|
||||
},
|
||||
"appendSubHtmlTo": {
|
||||
"type": "string",
|
||||
"default": ".lg-item"
|
||||
},
|
||||
"thumbWidth": {
|
||||
"type": "string",
|
||||
"default": "80px"
|
||||
},
|
||||
"thumbHeight": {
|
||||
"type": "string",
|
||||
"default": "80px"
|
||||
},
|
||||
"thumbnailsBorders": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"top": { "color": "#000000", "style": "solid", "width": "10px" },
|
||||
"right": { "color": "#000000", "style": "solid", "width": "10px" },
|
||||
"bottom": { "color": "#000000", "style": "solid", "width": "10px" },
|
||||
"left": { "color": "#000000", "style": "solid", "width": "10px" }
|
||||
}
|
||||
},
|
||||
"thumbnailsBordersSelected": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"top": { "color": "#000000", "style": "solid", "width": "1px" },
|
||||
"right": { "color": "#000000", "style": "solid", "width": "1px" },
|
||||
"bottom": { "color": "#000000", "style": "solid", "width": "1px" },
|
||||
"left": { "color": "#000000", "style": "solid", "width": "1px" }
|
||||
}
|
||||
},
|
||||
"thumbMargin": {
|
||||
"type": "number",
|
||||
"default": 5
|
||||
},
|
||||
"toggleThumb": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"numberOfSlideItemsInDom": {
|
||||
"type": "number",
|
||||
"default": 10
|
||||
}
|
||||
|
||||
},
|
||||
"textdomain": "lcp",
|
||||
"editorScript": "file:./index.js",
|
||||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style-index.css",
|
||||
"viewScript": ["file:./view.js"],
|
||||
"viewStyle": [ "file:./lightgallery-bundle.min.css" ]
|
||||
|
||||
}
|
||||
738
blocks/lcp-gallery/src/edit.js
Normal file
@ -0,0 +1,738 @@
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useBlockProps, InspectorControls, MediaUpload, MediaUploadCheck } from '@wordpress/block-editor';
|
||||
import { useState, useEffect } from 'react';
|
||||
import {
|
||||
PanelBody,
|
||||
SelectControl,
|
||||
Button,
|
||||
ToggleControl,
|
||||
TextControl,
|
||||
__experimentalNumberControl as NumberControl,
|
||||
__experimentalUnitControl as UnitControl,
|
||||
TabPanel,
|
||||
__experimentalBorderControl as BorderControl
|
||||
} from '@wordpress/components';
|
||||
import metadata from './block.json';
|
||||
import './editor.scss';
|
||||
|
||||
import LightGallery from 'lightgallery/react';
|
||||
import 'lightgallery/css/lightgallery.css';
|
||||
import 'lightgallery/css/lg-zoom.css';
|
||||
import 'lightgallery/css/lg-thumbnail.css';
|
||||
import lgThumbnail from 'lightgallery/plugins/thumbnail';
|
||||
import lgZoom from 'lightgallery/plugins/zoom';
|
||||
|
||||
|
||||
|
||||
// Check if JetEngine or ACF/SCF are activated and get their gallery field data
|
||||
const { apiFetch } = wp;
|
||||
|
||||
apiFetch({ path: '/custom/v1/get-gallery-supported-plugins-data' })
|
||||
.then((data) => {
|
||||
console.log(data); // Log the entire data object
|
||||
if (data.jetengine_active) {
|
||||
console.log('Jet Engine is activated');
|
||||
// Other logic here
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error fetching Jet Engine status:', error);
|
||||
});
|
||||
|
||||
|
||||
const MultiMediaUpload = ({ onSelect }) => {
|
||||
const [mediaIds, setMediaIds] = useState([]);
|
||||
|
||||
const handleSelectMedia = (media) => {
|
||||
const selectedMedia = media.map((item) => ({
|
||||
id: item.id,
|
||||
url: item.url,
|
||||
alt: item.alt || ''
|
||||
}));
|
||||
setMediaIds(selectedMedia);
|
||||
onSelect(selectedMedia);
|
||||
};
|
||||
|
||||
return (
|
||||
<MediaUploadCheck>
|
||||
<MediaUpload
|
||||
onSelect={handleSelectMedia}
|
||||
allowedTypes={['image', 'video']}
|
||||
multiple
|
||||
gallery
|
||||
render={({ open }) => (
|
||||
<Button onClick={open} isPrimary>
|
||||
{__('Open Media Library')}
|
||||
</Button>
|
||||
)}
|
||||
/>
|
||||
</MediaUploadCheck>
|
||||
);
|
||||
};
|
||||
|
||||
export default function Edit(props) {
|
||||
const { attributes, setAttributes } = props;
|
||||
const {
|
||||
galleryItems = [],
|
||||
source,
|
||||
sourceMetaField,
|
||||
sourceTable,
|
||||
sourceColumn,
|
||||
includePostThumbnail,
|
||||
initialLayout,
|
||||
itemsAspectRatio,
|
||||
gridColumnsLarge,
|
||||
gridColumnsMedium,
|
||||
gridColumnsSmall,
|
||||
gridGapLarge,
|
||||
gridGapMedium,
|
||||
gridGapSmall,
|
||||
|
||||
download,
|
||||
|
||||
downloadSize,
|
||||
|
||||
maxInitialItems,
|
||||
thumbnail,
|
||||
inlineHeightLarge,
|
||||
inlineHeightMedium,
|
||||
inlineHeightSmall,
|
||||
justifiedRowHeightSmall,
|
||||
justifiedRowHeightMedium,
|
||||
justifiedRowHeightLarge,
|
||||
justifiedLastRow,
|
||||
thumbnailsBorders,
|
||||
thumbnailsBordersSelected,
|
||||
thumbnailsStyle,
|
||||
thumbnailActiveStyle,
|
||||
showCaptions,
|
||||
zoomFromOrigin,
|
||||
|
||||
lgSettings
|
||||
} = attributes;
|
||||
|
||||
// Handle Updating LightGallery settings
|
||||
const [settings, setSettings] = useState(lgSettings);
|
||||
useEffect(() => {
|
||||
// Only update state if lgSettings actually change
|
||||
if (JSON.stringify(settings) !== JSON.stringify(lgSettings)) {
|
||||
setSettings(lgSettings);
|
||||
}
|
||||
}, [lgSettings]); // Runs only when lgSettings change
|
||||
|
||||
const [borders, setBorders] = useState(thumbnailsBorders || {
|
||||
top: { color: '#000000', style: 'solid', width: '1px' },
|
||||
right: { color: '#000000', style: 'solid', width: '1px' },
|
||||
bottom: { color: '#000000', style: 'solid', width: '1px' },
|
||||
left: { color: '#000000', style: 'solid', width: '1px' }
|
||||
});
|
||||
|
||||
const [selectedBorders, setSelectedBorders] = useState(thumbnailsBordersSelected || {
|
||||
top: { color: '#000000', style: 'solid', width: '1px' },
|
||||
right: { color: '#000000', style: 'solid', width: '1px' },
|
||||
bottom: { color: '#000000', style: 'solid', width: '1px' },
|
||||
left: { color: '#000000', style: 'solid', width: '1px' }
|
||||
});
|
||||
|
||||
const handleSelectMedia = (selectedMedia) => {
|
||||
setAttributes({ galleryItems: selectedMedia });
|
||||
};
|
||||
|
||||
const handleBorderChange = (newBorders) => {
|
||||
setBorders(newBorders);
|
||||
setAttributes({ thumbnailsBorders: newBorders });
|
||||
};
|
||||
|
||||
const handleBorderSelectedChange = (newBorders) => {
|
||||
setSelectedBorders(newBorders);
|
||||
setAttributes({ thumbnailsBordersSelected: newBorders });
|
||||
};
|
||||
|
||||
|
||||
|
||||
// lightGallery Transistion Styles
|
||||
const lgTransitionStyles = [
|
||||
{ label: 'lg-slide', value: 'lg-slide' },
|
||||
{ label: 'lg-fade', value: 'lg-fade' },
|
||||
{ label: 'lg-zoom-in', value: 'lg-zoom-in' },
|
||||
{ label: 'lg-zoom-in-big', value: 'lg-zoom-in-big' },
|
||||
{ label: 'lg-zoom-out', value: 'lg-zoom-out' },
|
||||
{ label: 'lg-zoom-out-big', value: 'lg-zoom-out-big' },
|
||||
{ label: 'lg-zoom-out-in', value: 'lg-zoom-out-in' },
|
||||
{ label: 'lg-zoom-in-out', value: 'lg-zoom-in-out' },
|
||||
{ label: 'lg-soft-zoom', value: 'lg-soft-zoom' },
|
||||
{ label: 'lg-scale-up', value: 'lg-scale-up' },
|
||||
{ label: 'lg-slide-circular', value: 'lg-slide-circular' },
|
||||
{ label: 'lg-slide-circular-vertical', value: 'lg-slide-circular-vertical' },
|
||||
{ label: 'lg-slide-vertical', value: 'lg-slide-vertical' },
|
||||
{ label: 'lg-slide-vertical-growth', value: 'lg-slide-vertical-growth' },
|
||||
{ label: 'lg-slide-skew-only', value: 'lg-slide-skew-only' },
|
||||
{ label: 'lg-slide-skew-only-rev', value: 'lg-slide-skew-only-rev' },
|
||||
{ label: 'lg-slide-skew-only-y', value: 'lg-slide-skew-only-y' },
|
||||
{ label: 'lg-slide-skew-only-y-rev', value: 'lg-slide-skew-only-y-rev' },
|
||||
{ label: 'lg-slide-skew', value: 'lg-slide-skew' },
|
||||
{ label: 'lg-slide-skew-rev', value: 'lg-slide-skew-rev' },
|
||||
{ label: 'lg-slide-skew-cross', value: 'lg-slide-skew-cross' },
|
||||
{ label: 'lg-slide-skew-cross-rev', value: 'lg-slide-skew-cross-rev' },
|
||||
{ label: 'lg-slide-skew-ver', value: 'lg-slide-skew-ver' },
|
||||
{ label: 'lg-slide-skew-ver-rev', value: 'lg-slide-skew-ver-rev' },
|
||||
{ label: 'lg-slide-skew-ver-cross', value: 'lg-slide-skew-ver-cross' },
|
||||
{ label: 'lg-slide-skew-ver-cross-rev', value: 'lg-slide-skew-ver-cross-rev' },
|
||||
{ label: 'lg-lollipop', value: 'lg-lollipop' },
|
||||
{ label: 'lg-lollipop-rev', value: 'lg-lollipop-rev' },
|
||||
{ label: 'lg-rotate', value: 'lg-rotate' },
|
||||
{ label: 'lg-rotate-rev', value: 'lg-rotate-rev' },
|
||||
{ label: 'lg-tube', value: 'lg-tube' }
|
||||
];
|
||||
|
||||
const galleryClasses = `lcp-gallery ${initialLayout}`;
|
||||
|
||||
|
||||
const lgPluginRequirements = [
|
||||
{ setting: 'zoom', plugin: 'lgZoom' },
|
||||
{ setting: 'thumbnail', plugin: 'lgThumbnail' },
|
||||
{ setting: 'rotate', plugin: 'lgRotate' },
|
||||
{ setting: 'autoplay', plugin: 'lgAutoplay' },
|
||||
{ setting: 'fullScreen', plugin: 'lgFullScreen' },
|
||||
{ setting: 'download', plugin: 'lgDownload' },
|
||||
// Add more settings and corresponding plugins as needed
|
||||
];
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
// Initialize plugins array
|
||||
const updatedPlugins = [];
|
||||
|
||||
// Loop through the plugin requirements
|
||||
lgPluginRequirements.forEach(({ setting, plugin }) => {
|
||||
// If the setting is enabled, add the corresponding plugin to the plugins array
|
||||
if (lgSettings[setting]) {
|
||||
updatedPlugins.push(plugin);
|
||||
}
|
||||
});
|
||||
|
||||
// Use function-based setAttributes to get the latest lgSettings and update plugins array
|
||||
setAttributes((prevAttributes) => {
|
||||
const updatedLgSettings = {
|
||||
...prevAttributes.lgSettings,
|
||||
plugins: updatedPlugins, // Updated plugins array
|
||||
};
|
||||
|
||||
// Log the lgSettings after update
|
||||
console.log("Updated lgSettings:", updatedLgSettings);
|
||||
|
||||
return {
|
||||
...prevAttributes,
|
||||
lgSettings: updatedLgSettings,
|
||||
};
|
||||
});
|
||||
}, [lgSettings.zoom, lgSettings.thumbnail, lgSettings.rotate, lgSettings.autoplay, lgSettings.fullScreen, lgSettings.download, setAttributes]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<InspectorControls>
|
||||
{/* Settings and Style Tabs */}
|
||||
<TabPanel
|
||||
className="my-tab-panel"
|
||||
activeClass="active-tab"
|
||||
tabs={[
|
||||
{
|
||||
name: 'settings',
|
||||
title: __('Settings'),
|
||||
className: 'settings-tab'
|
||||
},
|
||||
{
|
||||
name: 'style',
|
||||
title: __('Style Settings'),
|
||||
className: 'style-tab'
|
||||
}
|
||||
]}
|
||||
>
|
||||
{({ name }) => {
|
||||
if (name === 'settings') {
|
||||
return (
|
||||
<>
|
||||
{/* Source Settings */}
|
||||
<PanelBody title={__('Source Settings')}>
|
||||
<SelectControl
|
||||
label={__('Gallery Items Source', metadata.textdomain)}
|
||||
value={source}
|
||||
onChange={(newValue) => setAttributes({ source: newValue })}
|
||||
options={[
|
||||
{ value: 'manual', label: __('Manually Select', metadata.textdomain) },
|
||||
{ value: 'lcp_post_gallery', label: __('Post Gallery', metadata.textdomain) },
|
||||
{ value: 'meta_field', label: __('Meta field of current post', metadata.textdomain) },
|
||||
{ value: 'linked_table', label: __('Linked Table', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
{source === 'manual' && <MultiMediaUpload onSelect={handleSelectMedia} />}
|
||||
{source === 'meta_field' && (
|
||||
<TextControl
|
||||
label={__('Meta Field Name')}
|
||||
value={sourceMetaField}
|
||||
onChange={(newValue) => setAttributes({ sourceMetaField: newValue })}
|
||||
/>
|
||||
)}
|
||||
{source === 'linked_table' && (
|
||||
<>
|
||||
<TextControl
|
||||
label={__('Table Name')}
|
||||
value={sourceTable}
|
||||
onChange={(newValue) => setAttributes({ sourceTable: newValue })}
|
||||
/>
|
||||
<TextControl
|
||||
label={__('Column Name')}
|
||||
value={sourceColumn}
|
||||
onChange={(newValue) => setAttributes({ sourceColumn: newValue })}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{/* Parse an element for gallery items */}
|
||||
<ToggleControl
|
||||
checked={attributes.parseElementForItems}
|
||||
label={__('Parse element for gallery items', metadata.textdomain)}
|
||||
onChange={(value) => {
|
||||
setAttributes({
|
||||
parseElementForItems: value, // Set as a boolean directly
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
{attributes.parseElementForItems && (
|
||||
<TextControl
|
||||
label={__('Elements to parse')}
|
||||
value={attributes.parsedTargetElement} // Corrected to use string directly
|
||||
onChange={(newValue) => setAttributes({ parsedTargetElement: newValue })}
|
||||
/>
|
||||
)}
|
||||
<ToggleControl
|
||||
onChange={(isChecked) => setAttributes({ includePostThumbnail: isChecked })}
|
||||
checked={includePostThumbnail}
|
||||
label={__('Include Post Thumbnail (Featured Image)', metadata.textdomain)}
|
||||
/>
|
||||
|
||||
</PanelBody>
|
||||
{/* Display Settings */}
|
||||
<PanelBody title={__('Display Settings')}>
|
||||
<SelectControl
|
||||
label={__('Initial Layout', metadata.textdomain)}
|
||||
value={initialLayout}
|
||||
onChange={(newValue) => setAttributes({ initialLayout: newValue })}
|
||||
options={[
|
||||
{ value: 'inline', label: __('Inline', metadata.textdomain) },
|
||||
{ value: 'grid', label: __('Grid', metadata.textdomain) },
|
||||
{ value: 'justified', label: __('Justified', metadata.textdomain) },
|
||||
{ value: 'button', label: __('Button', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
{initialLayout === 'button' && (
|
||||
<TextControl
|
||||
label={__('Button Text')}
|
||||
value={sourceColumn}
|
||||
onChange={(newValue) => setAttributes({ sourceColumn: newValue })}
|
||||
/>
|
||||
)
|
||||
}
|
||||
<ToggleControl
|
||||
onChange={(isChecked) => setAttributes({ thumbnail: isChecked })}
|
||||
checked={thumbnail}
|
||||
label={__('Show Thumbnails', metadata.textdomain)}
|
||||
/>
|
||||
{thumbnail && (
|
||||
<>
|
||||
<SelectControl
|
||||
label={__('Thumbnails Position - Desktop', metadata.textdomain)}
|
||||
value={itemsAspectRatio}
|
||||
onChange={(newValue) => setAttributes({ itemsAspectRatio: newValue })}
|
||||
options={[
|
||||
{ value: 'bottom', label: __('Bottom', metadata.textdomain) },
|
||||
{ value: 'right', label: __('Right', metadata.textdomain) },
|
||||
{ value: 'left', label: __('Left', metadata.textdomain) },
|
||||
{ value: 'hidden', label: __('Hidden', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
<SelectControl
|
||||
label={__('Thumbnails Position - Tablet', metadata.textdomain)}
|
||||
value={itemsAspectRatio}
|
||||
onChange={(newValue) => setAttributes({ itemsAspectRatio: newValue })}
|
||||
options={[
|
||||
{ value: 'bottom', label: __('Bottom', metadata.textdomain) },
|
||||
{ value: 'right', label: __('Right', metadata.textdomain) },
|
||||
{ value: 'left', label: __('Left', metadata.textdomain) },
|
||||
{ value: 'hidden', label: __('Hidden', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
<SelectControl
|
||||
label={__('Thumbnails Position - Mobile', metadata.textdomain)}
|
||||
value={itemsAspectRatio}
|
||||
onChange={(newValue) => setAttributes({ itemsAspectRatio: newValue })}
|
||||
options={[
|
||||
{ value: 'bottom', label: __('Bottom', metadata.textdomain) },
|
||||
{ value: 'right', label: __('Right', metadata.textdomain) },
|
||||
{ value: 'left', label: __('Left', metadata.textdomain) },
|
||||
{ value: 'hidden', label: __('Hidden', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{initialLayout !== 'inline' && initialLayout !== 'justified' && (
|
||||
<SelectControl
|
||||
label={__('Items Aspect Ratio', metadata.textdomain)}
|
||||
value={itemsAspectRatio}
|
||||
onChange={(newValue) => setAttributes({ itemsAspectRatio: newValue })}
|
||||
options={[
|
||||
{ value: '1-1', label: __('1:1', metadata.textdomain) },
|
||||
{ value: '16-9', label: __('16:9', metadata.textdomain) },
|
||||
{ value: '3-2', label: __('3:2', metadata.textdomain) },
|
||||
{ value: '3-4', label: __('3:4', metadata.textdomain) },
|
||||
{ value: '4-5', label: __('4:5', metadata.textdomain) },
|
||||
{ value: '2-3', label: __('2:3', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
{initialLayout !== 'inline' && (
|
||||
<NumberControl
|
||||
label={__('Max Initial Images')}
|
||||
onChange={(newValue) => setAttributes({ maxInitialItems: newValue })}
|
||||
value={maxInitialItems}
|
||||
isShiftStepEnabled
|
||||
shiftStep={1}
|
||||
min={0}
|
||||
/>
|
||||
)}
|
||||
</PanelBody>
|
||||
{/* Gallery Settings */}
|
||||
<PanelBody title={__('Gallery Settings')}>
|
||||
{/* Dynamic Settings */}
|
||||
<ToggleControl
|
||||
label={__('Dynamic Load', 'lcp')}
|
||||
checked={lgSettings.dynamic}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
['dynamic']: value,
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/* Zoom Settings - Zoom requires lgZoom plugin */}
|
||||
<ToggleControl
|
||||
label={__('Enable Zoom', 'lcp')}
|
||||
checked={lgSettings.zoom}
|
||||
onChange={(value) => {
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
zoom: value, // Update the zoom setting
|
||||
plugins: value
|
||||
? [...lgSettings.plugins, 'lgZoom'] // Add lgZoom plugin if enabled
|
||||
: lgSettings.plugins.filter(plugin => plugin !== 'lgZoom'), // Remove lgZoom plugin if disabled
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/* Fullscreen Settings - fullScreen requires lgFullscreen plugin */}
|
||||
<ToggleControl
|
||||
label={__('Enable Fullscreen', 'lcp')}
|
||||
checked={lgSettings.fullScreen}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
fullScreen: value, // Update the zoom setting
|
||||
plugins: value
|
||||
? [...lgSettings.plugins, 'lgFullScreen'] // Add lgFullScreen plugin if enabled
|
||||
: lgSettings.plugins.filter(plugin => plugin !== 'lgFullScreen'), // Remove lgFullScreen plugin if disabled
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/* Sharing Settings - Sharing requires lgShare plugin */}
|
||||
<ToggleControl
|
||||
label={__('Enable Sharing', 'lcp')}
|
||||
checked={lgSettings.share}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
share: value, // Update the zoom setting
|
||||
plugins: value
|
||||
? [...lgSettings.plugins, 'lgShare'] // Add lgShare plugin if enabled
|
||||
: lgSettings.plugins.filter(plugin => plugin !== 'lgShare'), // Remove lgShare plugin if disabled
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/* Autoplay Settings - Autoplay requires lgAutoplay plugin */}
|
||||
<ToggleControl
|
||||
label={__('Enable Autoplay', 'lcp')}
|
||||
checked={lgSettings.autoplay}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
autoplay: value, // Update the zoom setting
|
||||
plugins: value
|
||||
? [...lgSettings.plugins, 'lgAutoplay'] // Add lgAutoplay plugin if enabled
|
||||
: lgSettings.plugins.filter(plugin => plugin !== 'lgAutoplay'), // Remove lgAutoplay plugin if disabled
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* HASH SETTINGS - Hashrequires lghash plugin */}
|
||||
<ToggleControl
|
||||
label={__('Enable Hash', 'lcp')}
|
||||
checked={lgSettings.hash}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
hash: value, // Update the zoom setting
|
||||
plugins: value
|
||||
? [...lgSettings.plugins, 'lgHash'] // Add lgAutoplay plugin if enabled
|
||||
: lgSettings.plugins.filter(plugin => plugin !== 'lgHash'), // Remove lgAutoplay plugin if disabled
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/* Hash requires a unique id in lgSettings.galleryId */}
|
||||
{lgSettings.hash && (
|
||||
<TextControl
|
||||
label={__('Hash', 'lcp')}
|
||||
value={lgSettings.hashGalleryId} // Use an appropriate value for this input
|
||||
onChange={(newValue) => {
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
galleryId: newValue, // Update the hashValue based on the text input
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
<ToggleControl
|
||||
label={__('Zoom From Origin', 'lcp')}
|
||||
checked={lgSettings.zoomFromOrigin}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
zoomFromOrigin: value, // Update the zoomFromOrigin setting
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/*Captions Settings */}
|
||||
<ToggleControl
|
||||
onChange={(isChecked) => setAttributes({ showCaptions: isChecked })}
|
||||
checked={showCaptions}
|
||||
label={__('Show Captions', metadata.textdomain)}
|
||||
/>
|
||||
|
||||
{/*Download Controls - If download is true, show options to set download size */}
|
||||
<ToggleControl
|
||||
checked={lgSettings.download}
|
||||
label={__('Allow Download', metadata.textdomain)}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
['download']: value,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/* Options to set available download size */}
|
||||
{download && (
|
||||
<SelectControl
|
||||
label={__('Download Size', metadata.textdomain)}
|
||||
value={downloadSize}
|
||||
onChange={(newValue) => setAttributes({ downloadSize: newValue })}
|
||||
options={[
|
||||
{ value: 'full', label: __('Full', metadata.textdomain) },
|
||||
{ value: 'medium', label: __('Medium', metadata.textdomain) },
|
||||
{ value: 'large', label: __('Large', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
{/* Add the SelectControl for Transition */}
|
||||
<SelectControl
|
||||
label="Transition Style"
|
||||
value={lgSettings.mode || 'lg-slide'} // Default value is 'lg-slide'
|
||||
options={lgTransitionStyles}
|
||||
onChange={(value) => {
|
||||
// Update autoplay
|
||||
setAttributes({
|
||||
lgSettings: {
|
||||
...lgSettings,
|
||||
['mode']: value,
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
{/* Add the TextControl for specific container to open the gallery in*/}
|
||||
{initialLayout != "inline"}{
|
||||
<TextControl
|
||||
label={__('Open gallery in container')}
|
||||
value={lgSettings.container}
|
||||
onChange={(newValue) => setAttributes({ lgSettings: {
|
||||
...lgSettings, // spread the current lgSettings object
|
||||
container: newValue // update only the container property
|
||||
} })}
|
||||
/>
|
||||
}
|
||||
</PanelBody>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (name === 'style') {
|
||||
return (
|
||||
<PanelBody title={__('Style Settings')}>
|
||||
{initialLayout === 'inline' && (
|
||||
<>
|
||||
<UnitControl
|
||||
label={__('Inline Height - Desktop')}
|
||||
onChange={(value) => setAttributes({ inlineHeightLarge: value })}
|
||||
value={inlineHeightLarge}
|
||||
/>
|
||||
<UnitControl
|
||||
label={__('Inline Height - Tablet')}
|
||||
onChange={(value) => setAttributes({ inlineHeightMedium: value })}
|
||||
value={inlineHeightMedium}
|
||||
/>
|
||||
<UnitControl
|
||||
label={__('Inline Height - Mobile')}
|
||||
onChange={(value) => setAttributes({ inlineHeightSmall: value })}
|
||||
value={inlineHeightSmall}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{initialLayout === 'justified' && (
|
||||
<>
|
||||
<SelectControl
|
||||
label={__('Last Row', metadata.textdomain)}
|
||||
value={justifiedLastRow}
|
||||
onChange={(newValue) => setAttributes({ justifiedLastRow: newValue })}
|
||||
options={[
|
||||
{ value: 'justify', label: __('Justify', metadata.textdomain) },
|
||||
{ value: 'nojustify', label: __('Unjustified', metadata.textdomain) },
|
||||
{ value: 'left', label: __('Align Left', metadata.textdomain) },
|
||||
{ value: 'center', label: __('Align Center', metadata.textdomain) },
|
||||
{ value: 'right', label: __('Align Right', metadata.textdomain) },
|
||||
{ value: 'hide', label: __('Hide', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
<UnitControl
|
||||
label={__('Row Height - Desktop')}
|
||||
onChange={(value) => setAttributes({ justifiedRowHeightLarge: value })}
|
||||
value={justifiedRowHeightLarge}
|
||||
/>
|
||||
<UnitControl
|
||||
label={__('Row Height - Tablet')}
|
||||
onChange={(value) => setAttributes({ justifiedRowHeightMedium: value })}
|
||||
value={justifiedRowHeightMedium}
|
||||
/>
|
||||
<UnitControl
|
||||
label={__('Row Height - Mobile')}
|
||||
onChange={(value) => setAttributes({ justifiedRowHeightSmall: value })}
|
||||
value={justifiedRowHeightSmall}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{initialLayout === 'grid' && (
|
||||
<>
|
||||
<NumberControl
|
||||
label={__('Grid Columns - Desktop')}
|
||||
onChange={(newValue) => setAttributes({ gridColumnsLarge: newValue })}
|
||||
value={gridColumnsLarge}
|
||||
isShiftStepEnabled
|
||||
shiftStep={1}
|
||||
min={1}
|
||||
max={9}
|
||||
/>
|
||||
<NumberControl
|
||||
label={__('Grid Columns - Tablet')}
|
||||
onChange={(newValue) => setAttributes({ gridColumnsMedium: newValue })}
|
||||
value={gridColumnsMedium}
|
||||
isShiftStepEnabled
|
||||
shiftStep={1}
|
||||
min={1}
|
||||
max={9}
|
||||
/>
|
||||
<NumberControl
|
||||
label={__('Grid Columns - Mobile')}
|
||||
onChange={(newValue) => setAttributes({ gridColumnsSmall: newValue })}
|
||||
value={gridColumnsSmall}
|
||||
isShiftStepEnabled
|
||||
shiftStep={1}
|
||||
min={1}
|
||||
max={9}
|
||||
/>
|
||||
<NumberControl
|
||||
label={__('Grid Gap')}
|
||||
onChange={(newValue) => setAttributes({ gridGapLarge: newValue })}
|
||||
value={gridGapLarge}
|
||||
isShiftStepEnabled
|
||||
shiftStep={1}
|
||||
min={0}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{thumbnail && (
|
||||
<>
|
||||
<BorderControl
|
||||
label={__('Thumbnail Borders')}
|
||||
value={borders}
|
||||
onChange={handleBorderChange}
|
||||
/>
|
||||
<BorderControl
|
||||
label={__('Thumbnail Borders - Selected')}
|
||||
value={thumbnailsBordersSelected}
|
||||
onChange={handleBorderSelectedChange}
|
||||
/>
|
||||
<SelectControl
|
||||
label={__('Thumbnail Style', metadata.textdomain)}
|
||||
value={thumbnailsStyle}
|
||||
onChange={(newValue) => setAttributes({ thumbnailsStyle: newValue })}
|
||||
options={[
|
||||
{ value: '', label: __('None', metadata.textdomain) },
|
||||
{ value: 'lg-thumbnail-blur', label: __('Blur', metadata.textdomain) },
|
||||
{ value: 'lg-thumbnail-grayscale', label: __('Monochrome', metadata.textdomain) }
|
||||
]}
|
||||
/>
|
||||
<SelectControl
|
||||
label={__('Thumbnail Style - Selected', metadata.textdomain)}
|
||||
value={thumbnailActiveStyle}
|
||||
onChange={(newValue) => setAttributes({ thumbnailActiveStyle: newValue })}
|
||||
options={[
|
||||
{ value: '', label: __('None', metadata.textdomain) },
|
||||
{ value: 'lg-thumbnail-active-grayscale', label: __('Monochrome', metadata.textdomain) },
|
||||
{ value: 'lg-thumbnail-active-blur', label: __('Blur', metadata.textdomain) }
|
||||
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</PanelBody>
|
||||
);
|
||||
}
|
||||
}}
|
||||
</TabPanel>
|
||||
</InspectorControls>
|
||||
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
171
blocks/lcp-gallery/src/editor.scss
Normal file
@ -0,0 +1,171 @@
|
||||
/**
|
||||
* The following styles get applied inside the editor only.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
|
||||
.wp-block-create-block-lcp-gallery {
|
||||
background-color: #21759b;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.lcp-gallery.inline {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.lcp-gallery.inline .gallery-item {
|
||||
display:none
|
||||
}
|
||||
|
||||
|
||||
.lcp-gallery .gallery-item,.lcp-gallery .gallery-item > img {
|
||||
width:100%
|
||||
}
|
||||
|
||||
.lcp-gallery .gallery-item.last:after {content:"";width:100%;height:100%;background:red;position:absolute;top:0;left:0;opacity:.5}
|
||||
|
||||
// Thumbnails
|
||||
.lg-thumbnail-grayscale .lg-thumb-item:not(.active) img {filter: grayscale(100%);}
|
||||
.lg-thumbnail-active-grayscale .lg-thumb-item.active img {filter: grayscale(100%);}
|
||||
.lg-thumbnail-blur .lg-thumb-item:not(.active) img {filter: blur(1px);}
|
||||
.lg-thumbnail-active-blur .lg-thumb-item.active img {filter: blur(1px);}
|
||||
|
||||
.lg-outer {background:none}
|
||||
// Gallery More Images
|
||||
.lcp-display-none {display:none}
|
||||
.gallery-item {position:relative}
|
||||
span.gallery-more {position: absolute;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
z-index: 10;
|
||||
color: #fff;
|
||||
font-size: 40px;
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
color: white;}
|
||||
|
||||
/* Aspect Ratio */
|
||||
.lcp-gallery.aspect-1-1 .gallery-item {aspect-ratio:1/1}
|
||||
.lcp-gallery.aspect-2-3 .gallery-item {aspect-ratio:2/3}
|
||||
.lcp-gallery.aspect-3-4 .gallery-item {aspect-ratio:3/4}
|
||||
.lcp-gallery.aspect-4-5 .gallery-item {aspect-ratio:4/5}
|
||||
.lcp-gallery.aspect-3-2 .gallery-item {aspect-ratio:3/2}
|
||||
.lcp-gallery.aspect-16-9 .gallery-item {aspect-ratio:16/9}
|
||||
|
||||
.gallery-item img {object-fit:cover}
|
||||
/* Container Styles */
|
||||
|
||||
/* Grid Styles */
|
||||
.lcp-gallery.grid {
|
||||
display:grid
|
||||
}
|
||||
.lcp-gallery.grid .gallery-item img{
|
||||
height:100%;
|
||||
object-fit:cover
|
||||
|
||||
}
|
||||
.lcp-gallery.grid {
|
||||
gap:1rem;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr
|
||||
}
|
||||
@media only screen and (min-width: 1167px) {
|
||||
.lcp-gallery.grid.large-1-columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-2-columns {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-3-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-4-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-5-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-6-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-7-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-8-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-9-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Medium screens (min-width: 768px and max-width: 1166px) */
|
||||
@media only screen and (min-width: 768px) and (max-width: 1166px) {
|
||||
.lcp-gallery.grid.medium-1-columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-2-columns {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-3-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-4-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-5-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-6-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-7-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-8-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-9-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Small screens (max-width: 767px) */
|
||||
@media only screen and (max-width: 767px) {
|
||||
.lcp-gallery.grid.small-1-columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-2-columns {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-3-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-4-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-5-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-6-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-7-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-8-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-9-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
39
blocks/lcp-gallery/src/index.js
Normal file
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Registers a new block provided a unique name and an object defining its behavior.
|
||||
*
|
||||
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
|
||||
*/
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
|
||||
/**
|
||||
* Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
|
||||
* All files containing `style` keyword are bundled together. The code used
|
||||
* gets applied both to the front of your site and to the editor.
|
||||
*
|
||||
* @see https://www.npmjs.com/package/@wordpress/scripts#using-css
|
||||
*/
|
||||
import './style.scss';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import Edit from './edit';
|
||||
import save from './save';
|
||||
import metadata from './block.json';
|
||||
|
||||
/**
|
||||
* Every block starts by registering a new block type definition.
|
||||
*
|
||||
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
|
||||
*/
|
||||
registerBlockType( metadata.name, {
|
||||
/**
|
||||
* @see ./edit.js
|
||||
*/
|
||||
edit: Edit,
|
||||
|
||||
/**
|
||||
* @see ./save.js
|
||||
*/
|
||||
save,
|
||||
} );
|
||||
22
blocks/lcp-gallery/src/save.js
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* React hook that is used to mark the block wrapper element.
|
||||
* It provides all the necessary props like the class name.
|
||||
*
|
||||
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
|
||||
*/
|
||||
import { useBlockProps } from '@wordpress/block-editor';
|
||||
|
||||
/**
|
||||
* The save function defines the way in which the different attributes should
|
||||
* be combined into the final markup, which is then serialized by the block
|
||||
* editor into `post_content`.
|
||||
*
|
||||
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
|
||||
*
|
||||
* @return {Element} Element to render.
|
||||
*/
|
||||
export default function save() {
|
||||
return (
|
||||
null
|
||||
);
|
||||
}
|
||||
187
blocks/lcp-gallery/src/style.scss
Normal file
@ -0,0 +1,187 @@
|
||||
/**
|
||||
* The following styles get applied both on the front of your site
|
||||
* and in the editor.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
|
||||
.wp-block-create-block-gallery {
|
||||
background-color: #21759b;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.lcp-gallery.inline {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.lcp-gallery.inline .gallery-item {
|
||||
display:none
|
||||
}
|
||||
|
||||
|
||||
.lcp-gallery .gallery-item,.lcp-gallery .gallery-item > img {
|
||||
width:100%
|
||||
}
|
||||
|
||||
.lcp-gallery .gallery-item.last:after {content:"";width:100%;height:100%;background:red;position:absolute;top:0;left:0;opacity:.5}
|
||||
|
||||
// Thumbnails
|
||||
.lg-thumbnail-grayscale .lg-thumb-item:not(.active) img {filter: grayscale(100%);}
|
||||
.lg-thumbnail-active-grayscale .lg-thumb-item.active img {filter: grayscale(100%);}
|
||||
.lg-thumbnail-blur .lg-thumb-item:not(.active) img {filter: blur(1px);}
|
||||
.lg-thumbnail-active-blur .lg-thumb-item.active img {filter: blur(1px);}
|
||||
|
||||
.lg-outer {background:none}
|
||||
// Gallery More Images
|
||||
.lcp-display-none {display:none}
|
||||
.gallery-item {position:relative}
|
||||
span.gallery-more {position: absolute;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
z-index: 10;
|
||||
color: #fff;
|
||||
font-size: 40px;
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
color: white;}
|
||||
|
||||
/* Aspect Ratio */
|
||||
.lcp-gallery.aspect-1-1 .lcp-gallery-item {aspect-ratio:1/1}
|
||||
.lcp-gallery.aspect-2-3 .lcp-gallery-item {aspect-ratio:2/3}
|
||||
.lcp-gallery.aspect-3-4 .lcp-gallery-item {aspect-ratio:3/4}
|
||||
.lcp-gallery.aspect-4-5 .lcp-gallery-item {aspect-ratio:4/5}
|
||||
.lcp-gallery.aspect-3-2 .lcp-gallery-item {aspect-ratio:3/2}
|
||||
.lcp-gallery.aspect-16-9 .lcp-gallery-item {aspect-ratio:16/9}
|
||||
|
||||
.gallery-item img {object-fit:cover}
|
||||
/* Container Styles */
|
||||
|
||||
/* Grid Styles */
|
||||
.lcp-gallery.grid {
|
||||
display:grid
|
||||
}
|
||||
.lcp-gallery.grid .gallery-item img{
|
||||
height:100%;
|
||||
object-fit:cover
|
||||
|
||||
}
|
||||
.lcp-gallery.grid {
|
||||
gap:1rem;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr
|
||||
}
|
||||
@media only screen and (min-width: 1167px) {
|
||||
.lcp-gallery.grid.large-1-columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-2-columns {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-3-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-4-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-5-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-6-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-7-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-8-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.large-9-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Medium screens (min-width: 768px and max-width: 1166px) */
|
||||
@media only screen and (min-width: 768px) and (max-width: 1166px) {
|
||||
.lcp-gallery.grid.medium-1-columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-2-columns {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-3-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-4-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-5-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-6-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-7-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-8-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.medium-9-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Small screens (max-width: 767px) */
|
||||
@media only screen and (max-width: 767px) {
|
||||
.lcp-gallery.grid.small-1-columns {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-2-columns {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-3-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-4-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-5-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-6-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-7-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-8-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
.lcp-gallery.grid.small-9-columns {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.lcp-gallery.grid > a > img {
|
||||
width:100%;
|
||||
height:100%;
|
||||
object-fit:cover
|
||||
}
|
||||
|
||||
.lcp-gallery.grid>a>img {
|
||||
height: 100%;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
display: block; /* Add this */
|
||||
}
|
||||
71
blocks/lcp-gallery/src/view.js
Normal file
@ -0,0 +1,71 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Check if LightGallery is loaded
|
||||
if (typeof lightGallery === 'function') {
|
||||
// Select all elements with the class '.lcp-gallery'
|
||||
const galleryContainers = document.querySelectorAll('.lcp-gallery');
|
||||
|
||||
galleryContainers.forEach(galleryContainer => {
|
||||
// Retrieve the JSON string from the data-lgsettings attribute
|
||||
const lgSettingsAttr = galleryContainer.getAttribute('data-lgsettings');
|
||||
|
||||
if (lgSettingsAttr) {
|
||||
try {
|
||||
// Parse the JSON string to a JavaScript object
|
||||
const lgSettings = JSON.parse(lgSettingsAttr);
|
||||
|
||||
// Log the settings to debug
|
||||
console.log("LightGallery Settings:", lgSettings);
|
||||
|
||||
// Ensure that plugins are mapped to actual functions if available
|
||||
const availablePlugins = {
|
||||
lgZoom: lgZoom,
|
||||
lgThumbnail: lgThumbnail,
|
||||
lgFullScreen: lgFullscreen,
|
||||
lgRotate: lgRotate,
|
||||
lgAutoplay: lgAutoplay,
|
||||
lgShare: lgShare,
|
||||
lgComment: lgComment,
|
||||
lgHash: lgHash,
|
||||
lgPager: lgPager,
|
||||
lgVideo: lgVideo,
|
||||
lgMediumZoom: lgMediumZoom
|
||||
};
|
||||
|
||||
// Map the plugin names to actual plugin functions
|
||||
if (Array.isArray(lgSettings.plugins)) {
|
||||
lgSettings.plugins = lgSettings.plugins.map(pluginName => availablePlugins[pluginName] || pluginName);
|
||||
}
|
||||
|
||||
// Initialize LightGallery for the gallery container (only once)
|
||||
let galleryInstance = null;
|
||||
|
||||
// Initialize the gallery only once per container
|
||||
if (!galleryContainer.classList.contains('lg-initialized')) {
|
||||
galleryInstance = lightGallery(galleryContainer, lgSettings);
|
||||
galleryContainer.classList.add('lg-initialized'); // Mark the gallery as initialized
|
||||
}
|
||||
|
||||
// Add click event listener to the gallery items
|
||||
const galleryItems = galleryContainer.querySelectorAll('.lcp-gallery-item');
|
||||
galleryItems.forEach((item, index) => {
|
||||
item.addEventListener('click', () => {
|
||||
// Check if galleryInstance is valid and open the gallery at the correct index
|
||||
if (galleryInstance && typeof galleryInstance.openGallery === 'function') {
|
||||
galleryInstance.openGallery(index); // Pass the index to open the correct image
|
||||
} else {
|
||||
console.error('LightGallery instance is not initialized correctly or missing openGallery method.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error parsing data-lgsettings JSON:', error);
|
||||
}
|
||||
} else {
|
||||
console.error('data-lgsettings attribute is missing for a gallery.');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('LightGallery is not defined');
|
||||
}
|
||||
});
|
||||