first commit
This commit is contained in:
@@ -0,0 +1,427 @@
|
||||
/* Magnific Popup CSS */
|
||||
.mfp-bg {
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1042;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
background: var(--mfp-overlay-color, #FFFFFF);
|
||||
opacity: var(--mfp-overlay-opacity, 1);
|
||||
}
|
||||
|
||||
.mfp-wrap {
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1043;
|
||||
position: fixed;
|
||||
outline: none !important;
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.mfp-container {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
right: 0;
|
||||
top: 0;
|
||||
padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.mfp-container:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.mfp-align-top .mfp-container:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mfp-content {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin: 0 auto;
|
||||
text-align: right;
|
||||
z-index: 1045;
|
||||
}
|
||||
|
||||
.mfp-inline-holder .mfp-content,
|
||||
.mfp-ajax-holder .mfp-content {
|
||||
width: 100%;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mfp-ajax-cur {
|
||||
cursor: progress;
|
||||
}
|
||||
|
||||
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
||||
cursor: zoom-out;
|
||||
}
|
||||
|
||||
.mfp-zoom {
|
||||
cursor: pointer;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
|
||||
.mfp-auto-cursor .mfp-content {
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mfp-close,
|
||||
.mfp-arrow,
|
||||
.mfp-preloader,
|
||||
.mfp-counter {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.mfp-loading.mfp-figure {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mfp-hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.mfp-preloader {
|
||||
color: var(--mfp-controls-text-color, #3D3D3D);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: auto;
|
||||
text-align: center;
|
||||
margin-top: -0.8em;
|
||||
right: 8px;
|
||||
left: 8px;
|
||||
z-index: 1044;
|
||||
}
|
||||
|
||||
.mfp-preloader a {
|
||||
color: var(--mfp-controls-text-color, #3D3D3D);
|
||||
}
|
||||
|
||||
.mfp-preloader a:hover {
|
||||
color: var(--mfp-controls-text-color-hover, #000000);
|
||||
}
|
||||
|
||||
.mfp-s-ready .mfp-preloader {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mfp-s-error .mfp-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button.mfp-close, button.mfp-arrow {
|
||||
overflow: visible;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
-webkit-appearance: none;
|
||||
display: block;
|
||||
outline: none;
|
||||
padding: 0;
|
||||
z-index: 1046;
|
||||
box-shadow: none;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
button::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.mfp-close {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
opacity: 0.65;
|
||||
padding: 0 10px 18px 0;
|
||||
color: var(--mfp-controls-color, #000000);
|
||||
font-style: normal;
|
||||
font-size: 28px;
|
||||
font-family: Arial, Baskerville, monospace;
|
||||
}
|
||||
|
||||
.mfp-close:hover, .mfp-close:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mfp-close:active {
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.mfp-close-btn-in .mfp-close {
|
||||
color: var(--mfp-inner-close-icon-color, #E0E0E0);
|
||||
}
|
||||
|
||||
.mfp-image-holder .mfp-close,
|
||||
.mfp-iframe-holder .mfp-close {
|
||||
color: var(--mfp-controls-color, #000000);
|
||||
left: -6px;
|
||||
text-align: left;
|
||||
padding-left: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mfp-counter {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
color: var(--mfp-controls-text-color, #3D3D3D);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.mfp-arrow {
|
||||
position: absolute;
|
||||
opacity: 0.65;
|
||||
margin: 0;
|
||||
top: 50%;
|
||||
margin-top: -55px;
|
||||
padding: 0;
|
||||
width: 90px;
|
||||
height: 110px;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.mfp-arrow:active {
|
||||
margin-top: -54px;
|
||||
}
|
||||
|
||||
.mfp-arrow:hover, .mfp-arrow:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mfp-arrow:before, .mfp-arrow:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
margin-top: 35px;
|
||||
margin-right: 35px;
|
||||
border: medium inset transparent;
|
||||
}
|
||||
|
||||
.mfp-arrow:after {
|
||||
border-top-width: 13px;
|
||||
border-bottom-width: 13px;
|
||||
top: 8px;
|
||||
}
|
||||
|
||||
.mfp-arrow:before {
|
||||
border-top-width: 21px;
|
||||
border-bottom-width: 21px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.mfp-arrow-left {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.mfp-arrow-left:after {
|
||||
border-left: 17px solid var(--mfp-controls-color, #000000);
|
||||
margin-right: 31px;
|
||||
}
|
||||
|
||||
.mfp-arrow-left:before {
|
||||
margin-right: 25px;
|
||||
border-left: 27px solid var(--mfp-controls-border-color, #FFFFFF);
|
||||
}
|
||||
|
||||
.mfp-arrow-right {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.mfp-arrow-right:after {
|
||||
border-right: 17px solid var(--mfp-controls-color, #000000);
|
||||
margin-right: 39px;
|
||||
}
|
||||
|
||||
.mfp-arrow-right:before {
|
||||
border-right: 27px solid var(--mfp-controls-border-color, #FFFFFF);
|
||||
}
|
||||
|
||||
.mfp-iframe-holder {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.mfp-iframe-holder .mfp-content {
|
||||
line-height: 0;
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
.mfp-iframe-holder .mfp-close {
|
||||
top: -40px;
|
||||
}
|
||||
|
||||
.mfp-iframe-scaler {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
padding-top: 56.25%;
|
||||
}
|
||||
|
||||
.mfp-iframe-scaler iframe {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: var(--mfp-shadow, none);
|
||||
background: var(--mfp-iframe-background, #FFFFFF);
|
||||
}
|
||||
|
||||
/* Main image in popup */
|
||||
img.mfp-img {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
line-height: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 40px 0 40px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* The shadow behind the image */
|
||||
.mfp-figure {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.mfp-figure:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 40px;
|
||||
bottom: 40px;
|
||||
display: block;
|
||||
left: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: -1;
|
||||
box-shadow: var(--mfp-shadow, none);
|
||||
background: var(--mfp-image-background, #E6E6E6);
|
||||
}
|
||||
|
||||
.mfp-figure small {
|
||||
color: var(--mfp-caption-subtitle-color, #434343);
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.mfp-figure figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mfp-bottom-bar {
|
||||
margin-top: -36px;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mfp-title {
|
||||
text-align: right;
|
||||
line-height: 18px;
|
||||
color: var(--mfp-caption-title-color, #000000);
|
||||
word-wrap: break-word;
|
||||
padding-left: 36px;
|
||||
}
|
||||
|
||||
.mfp-image-holder .mfp-content {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.mfp-gallery .mfp-image-holder .mfp-figure {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
|
||||
/**
|
||||
* Remove all paddings around the image on small screen
|
||||
*/
|
||||
.mfp-img-mobile .mfp-image-holder {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
.mfp-img-mobile img.mfp-img {
|
||||
padding: 0;
|
||||
}
|
||||
.mfp-img-mobile .mfp-figure:after {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.mfp-img-mobile .mfp-figure small {
|
||||
display: inline;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.mfp-img-mobile .mfp-bottom-bar {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
bottom: 0;
|
||||
margin: 0;
|
||||
top: auto;
|
||||
padding: 3px 5px;
|
||||
position: fixed;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.mfp-img-mobile .mfp-bottom-bar:empty {
|
||||
padding: 0;
|
||||
}
|
||||
.mfp-img-mobile .mfp-counter {
|
||||
left: 5px;
|
||||
top: 3px;
|
||||
}
|
||||
.mfp-img-mobile .mfp-close {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 900px) {
|
||||
.mfp-arrow {
|
||||
transform: scale(0.75);
|
||||
}
|
||||
.mfp-arrow-left {
|
||||
transform-origin: 0;
|
||||
}
|
||||
.mfp-arrow-right {
|
||||
transform-origin: 100%;
|
||||
}
|
||||
.mfp-container {
|
||||
padding-right: 6px;
|
||||
padding-left: 6px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,427 @@
|
||||
/* Magnific Popup CSS */
|
||||
.mfp-bg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1042;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
background: var(--mfp-overlay-color, #FFFFFF);
|
||||
opacity: var(--mfp-overlay-opacity, 1);
|
||||
}
|
||||
|
||||
.mfp-wrap {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1043;
|
||||
position: fixed;
|
||||
outline: none !important;
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.mfp-container {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.mfp-container:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.mfp-align-top .mfp-container:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mfp-content {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
z-index: 1045;
|
||||
}
|
||||
|
||||
.mfp-inline-holder .mfp-content,
|
||||
.mfp-ajax-holder .mfp-content {
|
||||
width: 100%;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mfp-ajax-cur {
|
||||
cursor: progress;
|
||||
}
|
||||
|
||||
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
||||
cursor: zoom-out;
|
||||
}
|
||||
|
||||
.mfp-zoom {
|
||||
cursor: pointer;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
|
||||
.mfp-auto-cursor .mfp-content {
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mfp-close,
|
||||
.mfp-arrow,
|
||||
.mfp-preloader,
|
||||
.mfp-counter {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.mfp-loading.mfp-figure {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mfp-hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.mfp-preloader {
|
||||
color: var(--mfp-controls-text-color, #3D3D3D);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: auto;
|
||||
text-align: center;
|
||||
margin-top: -0.8em;
|
||||
left: 8px;
|
||||
right: 8px;
|
||||
z-index: 1044;
|
||||
}
|
||||
|
||||
.mfp-preloader a {
|
||||
color: var(--mfp-controls-text-color, #3D3D3D);
|
||||
}
|
||||
|
||||
.mfp-preloader a:hover {
|
||||
color: var(--mfp-controls-text-color-hover, #000000);
|
||||
}
|
||||
|
||||
.mfp-s-ready .mfp-preloader {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mfp-s-error .mfp-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button.mfp-close, button.mfp-arrow {
|
||||
overflow: visible;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
-webkit-appearance: none;
|
||||
display: block;
|
||||
outline: none;
|
||||
padding: 0;
|
||||
z-index: 1046;
|
||||
box-shadow: none;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
button::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.mfp-close {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
opacity: 0.65;
|
||||
padding: 0 0 18px 10px;
|
||||
color: var(--mfp-controls-color, #000000);
|
||||
font-style: normal;
|
||||
font-size: 28px;
|
||||
font-family: Arial, Baskerville, monospace;
|
||||
}
|
||||
|
||||
.mfp-close:hover, .mfp-close:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mfp-close:active {
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.mfp-close-btn-in .mfp-close {
|
||||
color: var(--mfp-inner-close-icon-color, #E0E0E0);
|
||||
}
|
||||
|
||||
.mfp-image-holder .mfp-close,
|
||||
.mfp-iframe-holder .mfp-close {
|
||||
color: var(--mfp-controls-color, #000000);
|
||||
right: -6px;
|
||||
text-align: right;
|
||||
padding-right: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mfp-counter {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
color: var(--mfp-controls-text-color, #3D3D3D);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.mfp-arrow {
|
||||
position: absolute;
|
||||
opacity: 0.65;
|
||||
margin: 0;
|
||||
top: 50%;
|
||||
margin-top: -55px;
|
||||
padding: 0;
|
||||
width: 90px;
|
||||
height: 110px;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.mfp-arrow:active {
|
||||
margin-top: -54px;
|
||||
}
|
||||
|
||||
.mfp-arrow:hover, .mfp-arrow:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mfp-arrow:before, .mfp-arrow:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
margin-top: 35px;
|
||||
margin-left: 35px;
|
||||
border: medium inset transparent;
|
||||
}
|
||||
|
||||
.mfp-arrow:after {
|
||||
border-top-width: 13px;
|
||||
border-bottom-width: 13px;
|
||||
top: 8px;
|
||||
}
|
||||
|
||||
.mfp-arrow:before {
|
||||
border-top-width: 21px;
|
||||
border-bottom-width: 21px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.mfp-arrow-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.mfp-arrow-left:after {
|
||||
border-right: 17px solid var(--mfp-controls-color, #000000);
|
||||
margin-left: 31px;
|
||||
}
|
||||
|
||||
.mfp-arrow-left:before {
|
||||
margin-left: 25px;
|
||||
border-right: 27px solid var(--mfp-controls-border-color, #FFFFFF);
|
||||
}
|
||||
|
||||
.mfp-arrow-right {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.mfp-arrow-right:after {
|
||||
border-left: 17px solid var(--mfp-controls-color, #000000);
|
||||
margin-left: 39px;
|
||||
}
|
||||
|
||||
.mfp-arrow-right:before {
|
||||
border-left: 27px solid var(--mfp-controls-border-color, #FFFFFF);
|
||||
}
|
||||
|
||||
.mfp-iframe-holder {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.mfp-iframe-holder .mfp-content {
|
||||
line-height: 0;
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
.mfp-iframe-holder .mfp-close {
|
||||
top: -40px;
|
||||
}
|
||||
|
||||
.mfp-iframe-scaler {
|
||||
width: 100%;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
padding-top: 56.25%;
|
||||
}
|
||||
|
||||
.mfp-iframe-scaler iframe {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-shadow: var(--mfp-shadow, none);
|
||||
background: var(--mfp-iframe-background, #FFFFFF);
|
||||
}
|
||||
|
||||
/* Main image in popup */
|
||||
img.mfp-img {
|
||||
width: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
line-height: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 40px 0 40px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* The shadow behind the image */
|
||||
.mfp-figure {
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.mfp-figure:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 40px;
|
||||
bottom: 40px;
|
||||
display: block;
|
||||
right: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: -1;
|
||||
box-shadow: var(--mfp-shadow, none);
|
||||
background: var(--mfp-image-background, #E6E6E6);
|
||||
}
|
||||
|
||||
.mfp-figure small {
|
||||
color: var(--mfp-caption-subtitle-color, #434343);
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.mfp-figure figure {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mfp-bottom-bar {
|
||||
margin-top: -36px;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.mfp-title {
|
||||
text-align: left;
|
||||
line-height: 18px;
|
||||
color: var(--mfp-caption-title-color, #000000);
|
||||
word-wrap: break-word;
|
||||
padding-right: 36px;
|
||||
}
|
||||
|
||||
.mfp-image-holder .mfp-content {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.mfp-gallery .mfp-image-holder .mfp-figure {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
|
||||
/**
|
||||
* Remove all paddings around the image on small screen
|
||||
*/
|
||||
.mfp-img-mobile .mfp-image-holder {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.mfp-img-mobile img.mfp-img {
|
||||
padding: 0;
|
||||
}
|
||||
.mfp-img-mobile .mfp-figure:after {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.mfp-img-mobile .mfp-figure small {
|
||||
display: inline;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.mfp-img-mobile .mfp-bottom-bar {
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
bottom: 0;
|
||||
margin: 0;
|
||||
top: auto;
|
||||
padding: 3px 5px;
|
||||
position: fixed;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.mfp-img-mobile .mfp-bottom-bar:empty {
|
||||
padding: 0;
|
||||
}
|
||||
.mfp-img-mobile .mfp-counter {
|
||||
right: 5px;
|
||||
top: 3px;
|
||||
}
|
||||
.mfp-img-mobile .mfp-close {
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 900px) {
|
||||
.mfp-arrow {
|
||||
transform: scale(0.75);
|
||||
}
|
||||
.mfp-arrow-left {
|
||||
transform-origin: 0;
|
||||
}
|
||||
.mfp-arrow-right {
|
||||
transform-origin: 100%;
|
||||
}
|
||||
.mfp-container {
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Common Style */
|
||||
.sight-portfolio-area-filter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 64px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.sight-portfolio-area-filter {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__title {
|
||||
margin-left: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__title:after {
|
||||
width: 40px;
|
||||
height: 1px;
|
||||
background: currentColor;
|
||||
content: "";
|
||||
display: block;
|
||||
margin: 4px 24px 0 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 16px 0 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.sight-portfolio-area-filter__list {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list-item {
|
||||
display: block;
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.sight-portfolio-area-filter__list-item {
|
||||
margin-right: 16px;
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list-item a {
|
||||
display: block;
|
||||
color: currentColor;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list-item.sight-filter-active a {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.sight-portfolio-area__pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 48px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail .pk-pin-it-container {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail:hover .sight-portfolio-view-more {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-view-more {
|
||||
background-color: var(--sight-view-more-background, rgba(40, 40, 40, 0.25));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-view-more-label {
|
||||
color: var(--sight-view-more-label-color, white);
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__content:not(:first-child) {
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__title:not(:first-child) {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta:not(:first-child) {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta a {
|
||||
font-size: inherit;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta > *:not(:last-child) {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta > *:not(:first-child):before {
|
||||
content: '\00b7';
|
||||
font-weight: 600;
|
||||
margin-left: 0.5em;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta .sight-portfolio-meta-icon {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta .sight-portfolio-meta-category .sight-portfolio-meta-item {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta .sight-portfolio-meta-category .sight-portfolio-meta-item:last-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__caption:not(:first-child) {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-area__main {
|
||||
opacity: 1;
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
.sight-portfolio-area__main.sight-portfolio-loading {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.sight-portfolio-area__main .sight-portfolio-entry-request {
|
||||
position: relative;
|
||||
top: 1rem;
|
||||
opacity: 0.4;
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Common Style */
|
||||
.sight-portfolio-area-filter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 64px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.sight-portfolio-area-filter {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__title {
|
||||
margin-right: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__title:after {
|
||||
width: 40px;
|
||||
height: 1px;
|
||||
background: currentColor;
|
||||
content: "";
|
||||
display: block;
|
||||
margin: 4px 0 0 24px;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 16px 0 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.sight-portfolio-area-filter__list {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list-item {
|
||||
display: block;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.sight-portfolio-area-filter__list-item {
|
||||
margin-left: 16px;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list-item a {
|
||||
display: block;
|
||||
color: currentColor;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-filter__list-item.sight-filter-active a {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.sight-portfolio-area__pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 48px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail .pk-pin-it-container {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__thumbnail:hover .sight-portfolio-view-more {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-view-more {
|
||||
background-color: var(--sight-view-more-background, rgba(40, 40, 40, 0.25));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-view-more-label {
|
||||
color: var(--sight-view-more-label-color, white);
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__content:not(:first-child) {
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__title:not(:first-child) {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta:not(:first-child) {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta a {
|
||||
font-size: inherit;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta > *:not(:last-child) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta > *:not(:first-child):before {
|
||||
content: '\00b7';
|
||||
font-weight: 600;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta .sight-portfolio-meta-icon {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta .sight-portfolio-meta-category .sight-portfolio-meta-item {
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__meta .sight-portfolio-meta-category .sight-portfolio-meta-item:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry .sight-portfolio-entry__caption:not(:first-child) {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.sight-portfolio-area__main {
|
||||
opacity: 1;
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
.sight-portfolio-area__main.sight-portfolio-loading {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.sight-portfolio-area__main .sight-portfolio-entry-request {
|
||||
position: relative;
|
||||
top: 1rem;
|
||||
opacity: 0.4;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Layout Standard */
|
||||
.sight-block-portfolio-layout-standard .sight-portfolio-area__main {
|
||||
display: grid;
|
||||
grid-gap: var(--sight-portfolio-area-grid-gap, 40px);
|
||||
grid-template-columns: repeat(var(--sight-portfolio-area-grid-columns, 2), minmax(0, 1fr));
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Layout Standard */
|
||||
.sight-block-portfolio-layout-standard .sight-portfolio-area__main {
|
||||
display: grid;
|
||||
grid-gap: var(--sight-portfolio-area-grid-gap, 40px);
|
||||
grid-template-columns: repeat(var(--sight-portfolio-area-grid-columns, 2), minmax(0, 1fr));
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Vars */
|
||||
.sight-portfolio-area-lightbox {
|
||||
--sight-zoom-icon-popup-color: white;
|
||||
--sight-zoom-icon-popup-background: rgba(0, 0, 0, 0.6);
|
||||
--sight-zoom-icon-popup-font-size: 16px;
|
||||
}
|
||||
|
||||
/* Common Style */
|
||||
.sight-portfolio-area-lightbox .sight-zoom-icon-popup {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
left: 1rem;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
line-height: 2rem;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
color: var(--sight-zoom-icon-popup-color);
|
||||
background: var(--sight-zoom-icon-popup-background);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-lightbox .sight-zoom-icon-popup:before {
|
||||
font-family: 'sight-portfolio-icons';
|
||||
font-size: var(--sight-zoom-icon-popup-font-size);
|
||||
content: "\e912";
|
||||
}
|
||||
|
||||
.sight-portfolio-area-lightbox .sight-image-popup:hover ~ .sight-zoom-icon-popup {
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Vars */
|
||||
.sight-portfolio-area-lightbox {
|
||||
--sight-zoom-icon-popup-color: white;
|
||||
--sight-zoom-icon-popup-background: rgba(0, 0, 0, 0.6);
|
||||
--sight-zoom-icon-popup-font-size: 16px;
|
||||
}
|
||||
|
||||
/* Common Style */
|
||||
.sight-portfolio-area-lightbox .sight-zoom-icon-popup {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
line-height: 2rem;
|
||||
text-align: center;
|
||||
opacity: 0;
|
||||
color: var(--sight-zoom-icon-popup-color);
|
||||
background: var(--sight-zoom-icon-popup-background);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.sight-portfolio-area-lightbox .sight-zoom-icon-popup:before {
|
||||
font-family: 'sight-portfolio-icons';
|
||||
font-size: var(--sight-zoom-icon-popup-font-size);
|
||||
content: "\e912";
|
||||
}
|
||||
|
||||
.sight-portfolio-area-lightbox .sight-image-popup:hover ~ .sight-zoom-icon-popup {
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -0,0 +1,541 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Basic Style */
|
||||
@font-face {
|
||||
font-family: 'sight-portfolio-icons';
|
||||
src: url("../icon-fonts/sight-portfolio-icons.eot?2kdktd");
|
||||
src: url("../icon-fonts/sight-portfolio-icons.eot?2kdktd#iefix") format("embedded-opentype"), url("../icon-fonts/sight-portfolio-icons.ttf?2kdktd") format("truetype"), url("../icon-fonts/sight-portfolio-icons.woff?2kdktd") format("woff"), url("../icon-fonts/sight-portfolio-icons.svg?2kdktd#sight-portfolio") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
[class^="sight-portfolio-icons-"],
|
||||
[class*=" sight-portfolio-icons-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'sight-portfolio-icons' !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;
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-plus:before {
|
||||
content: "\e912";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-volume-full:before {
|
||||
content: "\e909";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-volume-mute:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-pause:before {
|
||||
content: "\e900";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-play:before {
|
||||
content: "\e901";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-youtube:before {
|
||||
content: "\e910";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-share-top:before {
|
||||
content: "\e934";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-down:before {
|
||||
content: "\e902";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-down-circle:before {
|
||||
content: "\e903";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-left:before {
|
||||
content: "\e904";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-left-circle:before {
|
||||
content: "\e905";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-right:before {
|
||||
content: "\e906";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-right-circle:before {
|
||||
content: "\e907";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-up-circle:before {
|
||||
content: "\e908";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-bookmark:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-down:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-left:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-right:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-up:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-eye:before {
|
||||
content: "\e911";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-film:before {
|
||||
content: "\e914";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-share:before {
|
||||
content: "\e920";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-watch:before {
|
||||
content: "\e922";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-x:before {
|
||||
content: "\e923";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-x-circle:before {
|
||||
content: "\e924";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-bottom:before {
|
||||
content: "\e938";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-top:before {
|
||||
content: "\e939";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-left:before {
|
||||
content: "\e93a";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-right:before {
|
||||
content: "\e93b";
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__thumbnail img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__overlay {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background {
|
||||
display: flex;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background:after, .sight-portfolio-overlay-background:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
transition: 0.25s;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background:after {
|
||||
background: var(--sight-color-overlay-background);
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background.sight-portfolio-overlay-transparent:after, .sight-portfolio-overlay-background.sight-portfolio-overlay-transparent:before {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-link {
|
||||
position: absolute;
|
||||
display: block;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-content {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-content a {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio:not(.sight-portfolio-ratio-original) .sight-portfolio-overlay-background {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio:not(.sight-portfolio-ratio-original) .sight-portfolio-overlay-background img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio:not(.sight-portfolio-ratio-original):before {
|
||||
content: '';
|
||||
display: table;
|
||||
box-sizing: border-box;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-landscape:before,
|
||||
.sight-portfolio-ratio-landscape-4-3:before {
|
||||
padding-bottom: 75%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-landscape-3-2:before {
|
||||
padding-bottom: 66.66667%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-landscape-16-9:before {
|
||||
padding-bottom: 56.25%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-portrait:before,
|
||||
.sight-portfolio-ratio-portrait-3-4:before {
|
||||
padding-bottom: 133.33333%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-portrait-2-3:before {
|
||||
padding-bottom: 150%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-square:before {
|
||||
padding-bottom: 100%;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-background:after, .sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-background:before {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content > * {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content .sight-portfolio-entry__read-more {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content .sight-portfolio-entry__read-more:not(:only-child) {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay:hover .sight-portfolio-overlay-content {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay:hover .sight-portfolio-overlay-background:after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-overlay-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-overlay-content:not(:first-child) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-entry__thumbnail img {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container .sight-portfolio-video-inner {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 50%;
|
||||
margin: auto;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
opacity: 0;
|
||||
transition: opacity .5s;
|
||||
max-width: unset;
|
||||
transform: translate(50%, -50%);
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container .sight-portfolio-video-inner.active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.75);
|
||||
border-left-color: transparent;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
-webkit-animation: loader-rotate 1s linear infinite;
|
||||
animation: loader-rotate 1s linear infinite;
|
||||
top: 50%;
|
||||
margin: -20px auto 0;
|
||||
transition: opacity 0.25s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader:after {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: rgba(255, 255, 255, 0.75);
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 27px;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loader-rotate {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loader-rotate {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background:hover .sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-overlay-background .sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="always"] .sight-portfolio-video-loader {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.75);
|
||||
border-left-color: transparent;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
-webkit-animation: loader-rotate 1s linear infinite;
|
||||
animation: loader-rotate 1s linear infinite;
|
||||
top: 50%;
|
||||
margin: -20px auto 0;
|
||||
transition: opacity 0.25s;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="always"] .sight-portfolio-video-loader:after {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: rgba(255, 255, 255, 0.75);
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
right: 27px;
|
||||
}
|
||||
|
||||
@keyframes loader-rotate {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-video-container[data-video-type="always"] .sight-portfolio-video-loader {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
opacity: 0;
|
||||
z-index: 4;
|
||||
transform: translateX(9999px);
|
||||
transition: opacity 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-video-controls {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control:after {
|
||||
position: relative;
|
||||
font-family: "sight-portfolio-icons";
|
||||
font-style: normal;
|
||||
opacity: 1;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control .sight-portfolio-tooltip {
|
||||
position: absolute;
|
||||
width: -webkit-max-content;
|
||||
width: -moz-max-content;
|
||||
width: max-content;
|
||||
display: -ms-grid;
|
||||
-ms-grid-columns: max-content;
|
||||
top: 100%;
|
||||
right: -9999px;
|
||||
padding-right: 50%;
|
||||
padding-bottom: 8px;
|
||||
transform: translateY(-30%);
|
||||
transition: transform 0.5s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control .sight-portfolio-tooltip span {
|
||||
background: white;
|
||||
display: block;
|
||||
position: relative;
|
||||
padding: 4px 16px;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
color: black;
|
||||
transform: translate(50%, 0);
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control .sight-portfolio-tooltip span:after {
|
||||
bottom: 100%;
|
||||
right: 50%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
border-color: transparent;
|
||||
border-bottom-color: white;
|
||||
border-width: 7px;
|
||||
margin-right: -7px;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control:hover .sight-portfolio-tooltip {
|
||||
transform: translateY(0);
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control:hover .sight-portfolio-tooltip span {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-link:after {
|
||||
content: "\e910";
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-play:after {
|
||||
content: "\e900";
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-pause:after {
|
||||
content: "\e901";
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-unmute:after {
|
||||
content: "\e909";
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-mute:after {
|
||||
content: "\e90a";
|
||||
}
|
||||
@@ -0,0 +1,541 @@
|
||||
/**
|
||||
* Environment for all styles (variables, additions, etc).
|
||||
*/
|
||||
/* Icons */
|
||||
/* Basic Style */
|
||||
@font-face {
|
||||
font-family: 'sight-portfolio-icons';
|
||||
src: url("../icon-fonts/sight-portfolio-icons.eot?2kdktd");
|
||||
src: url("../icon-fonts/sight-portfolio-icons.eot?2kdktd#iefix") format("embedded-opentype"), url("../icon-fonts/sight-portfolio-icons.ttf?2kdktd") format("truetype"), url("../icon-fonts/sight-portfolio-icons.woff?2kdktd") format("woff"), url("../icon-fonts/sight-portfolio-icons.svg?2kdktd#sight-portfolio") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
[class^="sight-portfolio-icons-"],
|
||||
[class*=" sight-portfolio-icons-"] {
|
||||
/* use !important to prevent issues with browser extensions that change fonts */
|
||||
font-family: 'sight-portfolio-icons' !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;
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-plus:before {
|
||||
content: "\e912";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-volume-full:before {
|
||||
content: "\e909";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-volume-mute:before {
|
||||
content: "\e90a";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-pause:before {
|
||||
content: "\e900";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-play:before {
|
||||
content: "\e901";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-youtube:before {
|
||||
content: "\e910";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-share-top:before {
|
||||
content: "\e934";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-down:before {
|
||||
content: "\e902";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-down-circle:before {
|
||||
content: "\e903";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-left:before {
|
||||
content: "\e904";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-left-circle:before {
|
||||
content: "\e905";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-right:before {
|
||||
content: "\e906";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-right-circle:before {
|
||||
content: "\e907";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-up-circle:before {
|
||||
content: "\e908";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-bookmark:before {
|
||||
content: "\e90b";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-down:before {
|
||||
content: "\e90c";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-left:before {
|
||||
content: "\e90d";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-right:before {
|
||||
content: "\e90e";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-chevron-up:before {
|
||||
content: "\e90f";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-eye:before {
|
||||
content: "\e911";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-film:before {
|
||||
content: "\e914";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-share:before {
|
||||
content: "\e920";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-watch:before {
|
||||
content: "\e922";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-x:before {
|
||||
content: "\e923";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-x-circle:before {
|
||||
content: "\e924";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-bottom:before {
|
||||
content: "\e938";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-top:before {
|
||||
content: "\e939";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-left:before {
|
||||
content: "\e93a";
|
||||
}
|
||||
|
||||
.sight-portfolio-icons-arrow-long-right:before {
|
||||
content: "\e93b";
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__thumbnail img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__overlay {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background {
|
||||
display: flex;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background:after, .sight-portfolio-overlay-background:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
transition: 0.25s;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background:after {
|
||||
background: var(--sight-color-overlay-background);
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background.sight-portfolio-overlay-transparent:after, .sight-portfolio-overlay-background.sight-portfolio-overlay-transparent:before {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-link {
|
||||
position: absolute;
|
||||
display: block;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-content {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-content a {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio:not(.sight-portfolio-ratio-original) .sight-portfolio-overlay-background {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio:not(.sight-portfolio-ratio-original) .sight-portfolio-overlay-background img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-ratio:not(.sight-portfolio-ratio-original):before {
|
||||
content: '';
|
||||
display: table;
|
||||
box-sizing: border-box;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-landscape:before,
|
||||
.sight-portfolio-ratio-landscape-4-3:before {
|
||||
padding-bottom: 75%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-landscape-3-2:before {
|
||||
padding-bottom: 66.66667%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-landscape-16-9:before {
|
||||
padding-bottom: 56.25%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-portrait:before,
|
||||
.sight-portfolio-ratio-portrait-3-4:before {
|
||||
padding-bottom: 133.33333%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-portrait-2-3:before {
|
||||
padding-bottom: 150%;
|
||||
}
|
||||
|
||||
.sight-portfolio-ratio-square:before {
|
||||
padding-bottom: 100%;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-background:after, .sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-background:before {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content > * {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content .sight-portfolio-entry__read-more {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay .sight-portfolio-overlay-content .sight-portfolio-entry__read-more:not(:only-child) {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay:hover .sight-portfolio-overlay-content {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-entry__overlay:hover .sight-portfolio-overlay-background:after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-overlay-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.sight-portfolio-entry__inner.sight-portfolio-overlay-content:not(:first-child) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-entry__thumbnail img {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container .sight-portfolio-video-inner {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin: auto;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
opacity: 0;
|
||||
transition: opacity .5s;
|
||||
max-width: unset;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container .sight-portfolio-video-inner.active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.75);
|
||||
border-right-color: transparent;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
-webkit-animation: loader-rotate 1s linear infinite;
|
||||
animation: loader-rotate 1s linear infinite;
|
||||
top: 50%;
|
||||
margin: -20px auto 0;
|
||||
transition: opacity 0.25s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader:after {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: rgba(255, 255, 255, 0.75);
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 27px;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loader-rotate {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loader-rotate {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-overlay-background:hover .sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-overlay-background .sight-portfolio-video-container[data-video-type="hover"] .sight-portfolio-video-loader {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="always"] .sight-portfolio-video-loader {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.75);
|
||||
border-right-color: transparent;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
-webkit-animation: loader-rotate 1s linear infinite;
|
||||
animation: loader-rotate 1s linear infinite;
|
||||
top: 50%;
|
||||
margin: -20px auto 0;
|
||||
transition: opacity 0.25s;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-container[data-video-type="always"] .sight-portfolio-video-loader:after {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
background: rgba(255, 255, 255, 0.75);
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 27px;
|
||||
}
|
||||
|
||||
@keyframes loader-rotate {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-video-container[data-video-type="always"] .sight-portfolio-video-loader {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
opacity: 0;
|
||||
z-index: 4;
|
||||
transform: translateX(-9999px);
|
||||
transition: opacity 0.25s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-bg-init .sight-portfolio-video-controls {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control:after {
|
||||
position: relative;
|
||||
font-family: "sight-portfolio-icons";
|
||||
font-style: normal;
|
||||
opacity: 1;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control .sight-portfolio-tooltip {
|
||||
position: absolute;
|
||||
width: -webkit-max-content;
|
||||
width: -moz-max-content;
|
||||
width: max-content;
|
||||
display: -ms-grid;
|
||||
-ms-grid-columns: max-content;
|
||||
top: 100%;
|
||||
left: -9999px;
|
||||
padding-left: 50%;
|
||||
padding-bottom: 8px;
|
||||
transform: translateY(-30%);
|
||||
transition: transform 0.5s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control .sight-portfolio-tooltip span {
|
||||
background: white;
|
||||
display: block;
|
||||
position: relative;
|
||||
padding: 4px 16px;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
color: black;
|
||||
transform: translate(-50%, 0);
|
||||
transition: opacity 0.5s;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control .sight-portfolio-tooltip span:after {
|
||||
bottom: 100%;
|
||||
left: 50%;
|
||||
border: solid transparent;
|
||||
content: " ";
|
||||
height: 0;
|
||||
width: 0;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
border-color: transparent;
|
||||
border-bottom-color: white;
|
||||
border-width: 7px;
|
||||
margin-left: -7px;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control:hover .sight-portfolio-tooltip {
|
||||
transform: translateY(0);
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-control:hover .sight-portfolio-tooltip span {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-link:after {
|
||||
content: "\e910";
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-play:after {
|
||||
content: "\e900";
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-pause:after {
|
||||
content: "\e901";
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-unmute:after {
|
||||
content: "\e909";
|
||||
}
|
||||
|
||||
.sight-portfolio-video-controls .sight-portfolio-player-mute:after {
|
||||
content: "\e90a";
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Portfolio Entry
|
||||
*
|
||||
* @var $attributes - attributes
|
||||
* @var $options - options
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
?>
|
||||
<article <?php $portfolio_entry->item_class(); ?>>
|
||||
<div <?php $portfolio_entry->item_outer_class(); ?>>
|
||||
<?php
|
||||
$portfolio_entry->item_attachment();
|
||||
$portfolio_entry->item_content();
|
||||
?>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Portfolio Categories
|
||||
*
|
||||
* @var $attributes - attributes
|
||||
* @var $options - options
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
$class_name = sight_portfolio_area_classes( $attributes, $options );
|
||||
|
||||
$categories = get_terms(
|
||||
array(
|
||||
'taxonomy' => 'sight-categories',
|
||||
'hide_empty' => false,
|
||||
'include' => isset( $attributes['categories_filter_ids'] ) ? $attributes['categories_filter_ids'] : '',
|
||||
'orderby' => isset( $attributes['categories_orderby'] ) ? $attributes['categories_orderby'] : 'name',
|
||||
'order' => isset( $attributes['categories_order'] ) ? $attributes['categories_order'] : 'ASC',
|
||||
'number' => isset( $attributes['number_items'] ) ? $attributes['number_items'] : null,
|
||||
)
|
||||
);
|
||||
|
||||
if ( $categories ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class_name ); ?>">
|
||||
|
||||
<div class="sight-portfolio-area__outer">
|
||||
<div class="sight-portfolio-area__main" <?php sight_portfolio_area_main_attrs( $attributes, $options ); ?>>
|
||||
<?php
|
||||
// Start the Loop.
|
||||
foreach ( $categories as $category ) {
|
||||
|
||||
$attachment_id = get_term_meta( $category->term_id, 'sight_featured_image', true );
|
||||
|
||||
// Get item project.
|
||||
if ( wp_get_attachment_image( $attachment_id ) ) {
|
||||
|
||||
$portfolio_entry = new Sight_Entry( $attributes, $options );
|
||||
|
||||
// Set settings.
|
||||
$portfolio_entry->object_id = $category->term_id;
|
||||
$portfolio_entry->attachment_id = $attachment_id;
|
||||
|
||||
// Init portfolio entry.
|
||||
$portfolio_entry->init();
|
||||
|
||||
require apply_filters( 'sight_portfolio_item_path', SIGHT_PATH . 'render/handler/portfolio-entry.php', $attributes, $options, $portfolio_entry );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
require SIGHT_PATH . 'render/handler/post-area-none.php';
|
||||
}
|
||||
|
||||
wp_reset_postdata();
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Portfolio Custom
|
||||
*
|
||||
* @var $attributes - attributes
|
||||
* @var $options - options
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
$class_name = sight_portfolio_area_classes( $attributes, $options );
|
||||
|
||||
if ( $attributes['custom_images'] && count( $attributes['custom_images'] ) > $attributes['number_items'] ) {
|
||||
$attributes['custom_images'] = array_slice( $attributes['custom_images'], 0, $attributes['number_items'] );
|
||||
}
|
||||
|
||||
if ( $attributes['custom_images'] ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class_name ); ?>">
|
||||
|
||||
<div class="sight-portfolio-area__outer">
|
||||
<div class="sight-portfolio-area__main" <?php sight_portfolio_area_main_attrs( $attributes, $options ); ?>>
|
||||
<?php
|
||||
// Start the Loop.
|
||||
foreach ( $attributes['custom_images'] as $attachment_id ) {
|
||||
|
||||
// Get item project.
|
||||
if ( wp_get_attachment_image( $attachment_id ) ) {
|
||||
|
||||
$portfolio_entry = new Sight_Entry( $attributes, $options );
|
||||
|
||||
// Set settings.
|
||||
$portfolio_entry->attachment_id = $attachment_id;
|
||||
|
||||
// Init portfolio entry.
|
||||
$portfolio_entry->init();
|
||||
|
||||
require apply_filters( 'sight_portfolio_item_path', SIGHT_PATH . 'render/handler/portfolio-entry.php', $attributes, $options, $portfolio_entry );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
require SIGHT_PATH . 'render/handler/post-area-none.php';
|
||||
}
|
||||
|
||||
wp_reset_postdata();
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Sight block template
|
||||
*
|
||||
* @var $attributes - attributes
|
||||
* @var $options - options
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
switch ( $attributes['source'] ) {
|
||||
case 'projects':
|
||||
require SIGHT_PATH . 'render/handler/post-area-projects.php';
|
||||
break;
|
||||
case 'categories':
|
||||
require SIGHT_PATH . 'render/handler/post-area-categories.php';
|
||||
break;
|
||||
case 'post':
|
||||
require SIGHT_PATH . 'render/handler/post-area-post.php';
|
||||
break;
|
||||
case 'custom':
|
||||
require SIGHT_PATH . 'render/handler/post-area-custom.php';
|
||||
break;
|
||||
default:
|
||||
require SIGHT_PATH . 'render/handler/post-area-none.php';
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Portfolio None
|
||||
*
|
||||
* @var $attributes - attributes
|
||||
* @var $options - options
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<div class="sight-content-not-found">
|
||||
<p><?php esc_html_e( 'It looks like your portfolio is empty. Please add new projects to your portfolio.', 'sight' ); ?></p>
|
||||
</div>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Portfolio Post
|
||||
*
|
||||
* @var $attributes - attributes
|
||||
* @var $options - options
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
$class_name = sight_portfolio_area_classes( $attributes, $options );
|
||||
|
||||
if ( $attributes['custom_post'] ) {
|
||||
$attachments = get_attached_media( 'image', $attributes['custom_post'] );
|
||||
|
||||
if ( $attachments && count( $attachments ) > $attributes['number_items'] ) {
|
||||
$attachments = array_slice( $attachments, 0, $attributes['number_items'] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $attachments ) && $attachments ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class_name ); ?>">
|
||||
|
||||
<div class="sight-portfolio-area__outer">
|
||||
<div class="sight-portfolio-area__main" <?php sight_portfolio_area_main_attrs( $attributes, $options ); ?>>
|
||||
<?php
|
||||
// Start the Loop.
|
||||
foreach ( $attachments as $attachment ) {
|
||||
|
||||
// Get item project.
|
||||
if ( wp_get_attachment_image( $attachment->ID ) ) {
|
||||
|
||||
$portfolio_entry = new Sight_Entry( $attributes, $options );
|
||||
|
||||
// Set settings.
|
||||
$portfolio_entry->attachment_id = $attachment->ID;
|
||||
|
||||
// Init portfolio entry.
|
||||
$portfolio_entry->init();
|
||||
|
||||
require apply_filters( 'sight_portfolio_item_path', SIGHT_PATH . 'render/handler/portfolio-entry.php', $attributes, $options, $portfolio_entry );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
require SIGHT_PATH . 'render/handler/post-area-none.php';
|
||||
}
|
||||
|
||||
wp_reset_postdata();
|
||||
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
/**
|
||||
* Portfolio Projects
|
||||
*
|
||||
* @var $attributes - attributes
|
||||
* @var $options - options
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
$class_name = sight_portfolio_area_classes( $attributes, $options );
|
||||
|
||||
// Args Query.
|
||||
$args_query = array(
|
||||
'post_type' => $attributes['projects_filter_post_type'],
|
||||
'ignore_sticky_posts' => true,
|
||||
'posts_per_page' => $attributes['number_items'],
|
||||
);
|
||||
|
||||
// Filter Categories.
|
||||
if ( 'sight-projects' === $attributes['projects_filter_post_type'] ) {
|
||||
|
||||
if ( isset( $attributes['projects_filter_categories'] ) ) {
|
||||
$filter_categories = $attributes['projects_filter_categories'];
|
||||
|
||||
if ( $filter_categories ) {
|
||||
$args_query['tax_query'][] = array(
|
||||
'taxonomy' => 'sight-categories',
|
||||
'field' => 'id',
|
||||
'terms' => $filter_categories,
|
||||
);
|
||||
|
||||
$args_query['tax_query']['relation'] = 'OR';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Filter Offset.
|
||||
if ( isset( $attributes['projects_filter_offset'] ) ) {
|
||||
$args_query['offset'] = (int) $attributes['projects_filter_offset'];
|
||||
}
|
||||
|
||||
// Filter Orderby.
|
||||
if ( $attributes['projects_orderby'] ) {
|
||||
$type_post_views = sight_post_views_enabled();
|
||||
// Order by Views.
|
||||
if ( $type_post_views && 'views' === $attributes['projects_orderby'] ) {
|
||||
$args_query['orderby'] = $type_post_views;
|
||||
// Don't hide posts without views.
|
||||
$args_query['views_query']['hide_empty'] = false;
|
||||
|
||||
} else {
|
||||
$args_query['orderby'] = $attributes['projects_orderby'];
|
||||
}
|
||||
}
|
||||
|
||||
// Filter Order.
|
||||
if ( $attributes['projects_order'] ) {
|
||||
$args_query['order'] = $attributes['projects_order'];
|
||||
}
|
||||
|
||||
/** ---------------------------------- */
|
||||
/** ---------------------------------- */
|
||||
|
||||
// WP Query.
|
||||
$portfolio_list = new WP_Query( $args_query );
|
||||
|
||||
// WP Query Data.
|
||||
if ( isset( $options['pagination_type'] ) ) {
|
||||
$portfolio_list->pagination_type = $options['pagination_type'];
|
||||
} else {
|
||||
$portfolio_list->pagination_type = 'none';
|
||||
}
|
||||
|
||||
// Theme data.
|
||||
$data = array(
|
||||
'is_sight_query' => true,
|
||||
'max_num_pages' => $portfolio_list->max_num_pages,
|
||||
'pagination_type' => $portfolio_list->pagination_type,
|
||||
'query_vars' => $portfolio_list->query,
|
||||
);
|
||||
|
||||
$args = sight_portfolio_get_load_more_args( $data, $attributes, $options );
|
||||
|
||||
// Set posts per page.
|
||||
$args['posts_per_page'] = $args_query['posts_per_page'];
|
||||
|
||||
$query_data = sight_encode_data( $args );
|
||||
|
||||
if ( $portfolio_list->have_posts() ) {
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $class_name ); ?>" data-items-area="<?php echo esc_attr( $query_data ); ?>">
|
||||
|
||||
<?php if ( isset( $options['filter_items'] ) && $options['filter_items'] ) { ?>
|
||||
<div class="sight-portfolio-area-filter">
|
||||
<div class="sight-portfolio-area-filter__title"><?php esc_html_e( 'Categories', 'sight' ); ?></div>
|
||||
|
||||
<ul class="sight-portfolio-area-filter__list">
|
||||
|
||||
<li class="sight-portfolio-area-filter__list-item sight-filter-all sight-filter-active">
|
||||
<a href="#" data-filter="*">
|
||||
<?php esc_html_e( 'All', 'sight' ); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php
|
||||
$categories = get_terms(
|
||||
array(
|
||||
'taxonomy' => 'sight-categories',
|
||||
'hide_empty' => false,
|
||||
'include' => isset( $filter_categories ) && $filter_categories ? $filter_categories : array(),
|
||||
)
|
||||
);
|
||||
|
||||
foreach ( $categories as $category ) {
|
||||
?>
|
||||
<li class="sight-portfolio-area-filter__list-item">
|
||||
<a href="#" data-filter="<?php echo esc_attr( $category->slug ); ?>">
|
||||
<?php echo esc_html( $category->name ); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="sight-portfolio-area__outer">
|
||||
<div class="sight-portfolio-area__main" <?php sight_portfolio_area_main_attrs( $attributes, $options ); ?>>
|
||||
<?php
|
||||
// Start the Loop.
|
||||
while ( $portfolio_list->have_posts() ) {
|
||||
$portfolio_list->the_post();
|
||||
|
||||
$portfolio_entry = new Sight_Entry( $attributes, $options );
|
||||
|
||||
// Init portfolio entry.
|
||||
$portfolio_entry->init();
|
||||
|
||||
// Get item project.
|
||||
require apply_filters( 'sight_portfolio_item_path', SIGHT_PATH . 'render/handler/portfolio-entry.php', $attributes, $options, $portfolio_entry );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
require SIGHT_PATH . 'render/handler/post-area-none.php';
|
||||
}
|
||||
|
||||
wp_reset_postdata();
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="sight-portfolio-icons" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="pause" d="M341.333 661.333h128v-426.667h-128zM554.667 661.333h128v-426.667h-128z" />
|
||||
<glyph unicode="" glyph-name="play" d="M298.667 704v-512l426.667 256z" />
|
||||
<glyph unicode="" glyph-name="arrow-down" d="M840.533 456.534c-17.067 17.067-42.667 17.067-59.733 0l-226.133-226.133v494.933c0 25.6-17.067 42.667-42.667 42.667s-42.667-17.067-42.667-42.667v-494.933l-226.133 226.133c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l298.667-298.667c4.267-4.267 8.533-8.533 12.8-8.533 4.267-4.267 12.8-4.267 17.067-4.267s12.8 0 17.067 4.267c4.267 4.267 8.533 4.267 12.8 8.533l298.667 298.667c17.067 17.067 17.067 42.667 0 59.733z" />
|
||||
<glyph unicode="" glyph-name="arrow-down-circle" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM512 42.667c-213.333 0-384 170.667-384 384s170.667 384 384 384c213.333 0 384-170.667 384-384s-170.667-384-384-384zM652.8 456.534l-98.133-98.133v238.933c0 25.6-17.067 42.667-42.667 42.667s-42.667-17.067-42.667-42.667v-238.933l-98.133 98.133c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l170.667-170.667c4.267-4.267 8.533-8.533 12.8-8.533 4.267-4.267 12.8-4.267 17.067-4.267s12.8 0 17.067 4.267c4.267 4.267 8.533 4.267 12.8 8.533l170.667 170.667c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0z" />
|
||||
<glyph unicode="" glyph-name="arrow-left" d="M810.667 469.334h-494.933l226.133 226.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-298.667-298.667c-4.267-4.267-8.533-8.533-8.533-12.8-4.267-8.533-4.267-21.333 0-34.133 4.267-4.267 4.267-8.533 8.533-12.8l298.667-298.667c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-226.133 226.133h494.933c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667z" />
|
||||
<glyph unicode="" glyph-name="arrow-left-circle" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM512 42.667c-213.333 0-384 170.667-384 384s170.667 384 384 384c213.333 0 384-170.667 384-384s-170.667-384-384-384zM682.667 469.334h-238.933l98.133 98.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-170.667-170.667c-4.267-4.267-8.533-8.533-8.533-12.8-4.267-8.533-4.267-21.333 0-34.133 4.267-4.267 4.267-8.533 8.533-12.8l170.667-170.667c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-98.133 98.133h238.933c25.6 0 42.667 17.067 42.667 42.667s-17.067 42.667-42.667 42.667z" />
|
||||
<glyph unicode="" glyph-name="arrow-right" d="M849.067 409.6c4.267 8.533 4.267 21.333 0 34.133-4.267 4.267-4.267 8.533-8.533 12.8l-298.667 298.667c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l226.133-226.133h-494.933c-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h494.933l-226.133-226.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8l298.667 298.667c4.267 4.267 8.533 8.533 8.533 12.8z" />
|
||||
<glyph unicode="" glyph-name="arrow-right-circle" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM512 42.667c-213.333 0-384 170.667-384 384s170.667 384 384 384c213.333 0 384-170.667 384-384s-170.667-384-384-384zM721.067 443.734c-4.267 4.267-4.267 8.533-8.533 12.8l-170.667 170.667c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l98.133-98.133h-238.933c-25.6 0-42.667-17.067-42.667-42.667s17.067-42.667 42.667-42.667h238.933l-98.133-98.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8l170.667 170.667c4.267 4.267 8.533 8.533 8.533 12.8 4.267 12.8 4.267 21.333 0 34.133z" />
|
||||
<glyph unicode="" glyph-name="arrow-up-circle" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM512 42.667c-213.333 0-384 170.667-384 384s170.667 384 384 384c213.333 0 384-170.667 384-384s-170.667-384-384-384zM541.867 627.2c-4.267 4.267-8.533 8.533-12.8 8.533-8.533 4.267-21.333 4.267-34.133 0-4.267-4.267-8.533-4.267-12.8-8.533l-170.667-170.667c-17.067-17.067-17.067-42.667 0-59.733s42.667-17.067 59.733 0l98.133 98.133v-238.933c0-25.6 17.067-42.667 42.667-42.667s42.667 17.067 42.667 42.667v238.933l98.133-98.133c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-170.667 170.667z" />
|
||||
<glyph unicode="" glyph-name="volume-full" d="M682.667 64c150.485 66.005 255.957 209.451 255.957 384s-105.472 317.995-255.957 384v-85.333c101.845-59.136 170.624-172.672 170.624-298.667s-68.779-239.531-170.624-298.667v-85.333zM682.667 661.333v-426.667c52.267 46.933 85.333 137.771 85.333 213.333s-33.067 166.4-85.333 213.333zM170.667 234.667h115.072l311.595-207.701v842.069l-311.595-207.701h-115.072c-47.061 0-85.333-38.272-85.333-85.333v-256c0-47.061 38.272-85.333 85.333-85.333z" />
|
||||
<glyph unicode="" glyph-name="volume-mute" d="M329.685 690.645l-171.52 171.52-60.331-60.331 768-768 60.331 60.331-86.187 86.187c61.44 71.979 98.645 164.309 98.645 267.648 0 174.549-105.472 317.995-255.957 384v-85.333c101.845-59.136 170.624-172.672 170.624-298.667 0-78.165-26.88-151.168-71.296-209.664l-54.869 54.869c25.685 46.592 40.875 104.021 40.875 154.795 0 75.563-33.067 166.4-85.333 213.333v-323.669l-85.333 85.333v446.037l-267.648-178.389zM170.667 234.667h115.072l311.595-207.701v159.872l-464.981 464.981c-27.776-14.123-47.019-42.624-47.019-75.819v-256c0-47.061 38.272-85.333 85.333-85.333z" />
|
||||
<glyph unicode="" glyph-name="bookmark" d="M725.333 853.334h-426.667c-72.533 0-128-55.467-128-128v-682.667c0-17.067 8.533-29.867 21.333-38.4s29.867-4.267 42.667 4.267l273.067 196.267 273.067-196.267c8.533-4.267 17.067-8.533 25.6-8.533s12.8 0 21.333 4.267c12.8 8.533 21.333 21.333 21.333 38.4v682.667c4.267 72.533-51.2 128-123.733 128zM768 123.734l-230.4 166.4c-8.533 4.267-17.067 8.533-25.6 8.533s-17.067-4.267-25.6-8.533l-230.4-166.4v601.6c0 25.6 17.067 42.667 42.667 42.667h426.667c25.6 0 42.667-17.067 42.667-42.667v-601.6z" />
|
||||
<glyph unicode="" glyph-name="chevron-down" d="M797.867 584.534c-17.067 17.067-42.667 17.067-59.733 0l-226.133-226.133-226.133 226.133c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l256-256c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8l256 256c17.067 17.067 17.067 42.667 0 59.733z" />
|
||||
<glyph unicode="" glyph-name="chevron-left" d="M443.733 426.667l226.133 226.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-256-256c-17.067-17.067-17.067-42.667 0-59.733l256-256c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-226.133 226.133z" />
|
||||
<glyph unicode="" glyph-name="chevron-right" d="M669.867 456.534l-256 256c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l226.133-226.133-226.133-226.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l256 256c17.067 17.067 17.067 42.667 0 59.733z" />
|
||||
<glyph unicode="" glyph-name="chevron-up" d="M797.867 328.534l-256 256c-17.067 17.067-42.667 17.067-59.733 0l-256-256c-17.067-17.067-17.067-42.667 0-59.733s42.667-17.067 59.733 0l226.133 226.133 226.133-226.133c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733z" />
|
||||
<glyph unicode="" glyph-name="youtube" d="M961.707 675.413c-10.773 40.64-42.613 72.64-82.987 83.52-73.173 19.733-366.72 19.733-366.72 19.733s-293.547 0-366.72-19.733c-40.373-10.88-72.213-42.88-82.987-83.52-19.627-73.707-19.627-227.413-19.627-227.413s0-153.707 19.627-227.413c10.773-40.64 42.613-72.64 82.987-83.52 73.173-19.733 366.72-19.733 366.72-19.733s293.547 0 366.72 19.733c40.373 10.88 72.213 42.88 82.987 83.52 19.627 73.707 19.627 227.413 19.627 227.413s0 153.707-19.627 227.413zM416 308.427v279.147l245.333-139.573-245.333-139.573z" />
|
||||
<glyph unicode="" glyph-name="eye" d="M1019.733 443.734c-8.533 17.067-187.733 366.933-507.733 366.933s-499.2-349.867-507.733-366.933c-4.267-12.8-4.267-25.6 0-38.4 8.533-12.8 187.733-362.667 507.733-362.667s499.2 349.867 507.733 366.933c4.267 8.533 4.267 25.6 0 34.133zM512 128c-230.4 0-379.733 230.4-422.4 298.667 38.4 68.267 192 298.667 422.4 298.667s379.733-230.4 422.4-298.667c-42.667-68.267-192-298.667-422.4-298.667zM512 597.334c-93.867 0-170.667-76.8-170.667-170.667s76.8-170.667 170.667-170.667c93.867 0 170.667 76.8 170.667 170.667s-76.8 170.667-170.667 170.667zM512 341.334c-46.933 0-85.333 38.4-85.333 85.333s38.4 85.333 85.333 85.333c46.933 0 85.333-38.4 85.333-85.333s-38.4-85.333-85.333-85.333z" />
|
||||
<glyph unicode="" glyph-name="plus" d="M213.333 384h256v-256c0-23.552 19.115-42.667 42.667-42.667s42.667 19.115 42.667 42.667v256h256c23.552 0 42.667 19.115 42.667 42.667s-19.115 42.667-42.667 42.667h-256v256c0 23.552-19.115 42.667-42.667 42.667s-42.667-19.115-42.667-42.667v-256h-256c-23.552 0-42.667-19.115-42.667-42.667s19.115-42.667 42.667-42.667z" />
|
||||
<glyph unicode="" glyph-name="film" d="M844.8 896h-665.6c-76.8 0-136.533-59.733-136.533-136.533v-665.6c0-76.8 59.733-136.533 136.533-136.533h665.6c76.8 0 136.533 59.733 136.533 136.533v665.6c0 76.8-59.733 136.533-136.533 136.533zM768 597.334h128v-128h-128v128zM682.667 469.334h-341.333v341.333h341.333v-341.333zM256 469.334h-128v128h128v-128zM128 384h128v-128h-128v128zM341.333 384h341.333v-341.333h-341.333v341.333zM768 384h128v-128h-128v128zM896 759.467v-76.8h-128v128h76.8c29.867 0 51.2-21.333 51.2-51.2zM179.2 810.667h76.8v-128h-128v76.8c0 29.867 21.333 51.2 51.2 51.2zM128 93.867v76.8h128v-128h-76.8c-29.867 0-51.2 21.333-51.2 51.2zM844.8 42.667h-76.8v128h128v-76.8c0-29.867-21.333-51.2-51.2-51.2z" />
|
||||
<glyph unicode="" glyph-name="share" d="M768 298.667c-46.933 0-89.6-21.333-119.467-51.2l-226.133 132.267c0 17.067 4.267 29.867 4.267 46.933s-4.267 29.867-8.533 46.933l226.133 132.267c34.133-29.867 76.8-51.2 123.733-51.2 93.867 0 170.667 76.8 170.667 170.667s-76.8 170.667-170.667 170.667-170.667-76.8-170.667-170.667c0-17.067 4.267-29.867 8.533-46.933l-230.4-132.267c-29.867 29.867-72.533 51.2-119.467 51.2-93.867 0-170.667-76.8-170.667-170.667s76.8-170.667 170.667-170.667c46.933 0 89.6 21.333 119.467 51.2l226.133-132.267c0-17.067-4.267-29.867-4.267-46.933 0-93.867 76.8-170.667 170.667-170.667s170.667 76.8 170.667 170.667-76.8 170.667-170.667 170.667zM768 810.667c46.933 0 85.333-38.4 85.333-85.333s-38.4-85.333-85.333-85.333-85.333 38.4-85.333 85.333 38.4 85.333 85.333 85.333zM256 341.334c-46.933 0-85.333 38.4-85.333 85.333s38.4 85.333 85.333 85.333 85.333-38.4 85.333-85.333c0-46.933-38.4-85.333-85.333-85.333zM768 42.667c-46.933 0-85.333 38.4-85.333 85.333 0 17.067 4.267 29.867 12.8 42.667 0 0 0 0 0 0s0 0 0 0c12.8 25.6 42.667 42.667 72.533 42.667 46.933 0 85.333-38.4 85.333-85.333s-38.4-85.333-85.333-85.333z" />
|
||||
<glyph unicode="" glyph-name="watch" d="M853.333 426.667c0 98.133-42.667 183.467-106.667 247.467l-12.8 149.333c-8.533 64-59.733 115.2-128 115.2 0 0 0 0 0 0h-187.733c-64 0-119.467-51.2-128-115.2l-12.8-149.333c-64-59.733-106.667-149.333-106.667-247.467s42.667-187.733 106.667-247.467l12.8-149.333c8.533-64 64-115.2 128-115.2 0 0 0 0 0 0h183.467c0 0 0 0 0 0 68.267 0 119.467 51.2 128 115.2l12.8 145.067c68.267 64 110.933 153.6 110.933 251.733zM375.467 814.934c0 21.333 21.333 38.4 42.667 38.4h187.733c21.333 0 42.667-17.067 42.667-38.4l8.533-76.8c-46.933 17.067-93.867 29.867-145.067 29.867s-98.133-12.8-140.8-29.867l4.267 76.8zM256 426.667c0 140.8 115.2 256 256 256s256-115.2 256-256-115.2-256-256-256-256 115.2-256 256zM648.533 38.4c0-21.333-21.333-38.4-42.667-38.4 0 0 0 0 0 0h-187.733c0 0 0 0 0 0-21.333 0-38.4 17.067-42.667 38.4l-8.533 76.8c42.667-21.333 89.6-29.867 140.8-29.867s98.133 12.8 140.8 29.867v-76.8zM546.133 332.8c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-51.2 51.2v110.933c0 25.6-17.067 42.667-42.667 42.667s-42.667-17.067-42.667-42.667v-128c0-12.8 4.267-21.333 12.8-29.867l64-64z" />
|
||||
<glyph unicode="" glyph-name="x" d="M571.733 426.667l226.133 226.133c17.067 17.067 17.067 42.667 0 59.733s-42.667 17.067-59.733 0l-226.133-226.133-226.133 226.133c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l226.133-226.133-226.133-226.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l226.133 226.133 226.133-226.133c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-226.133 226.133z" />
|
||||
<glyph unicode="" glyph-name="x-circle" d="M512 896c-260.267 0-469.333-209.067-469.333-469.333s209.067-469.333 469.333-469.333 469.333 209.067 469.333 469.333-209.067 469.333-469.333 469.333zM512 42.667c-213.333 0-384 170.667-384 384s170.667 384 384 384c213.333 0 384-170.667 384-384s-170.667-384-384-384zM669.867 584.534c-17.067 17.067-42.667 17.067-59.733 0l-98.133-98.133-98.133 98.133c-17.067 17.067-42.667 17.067-59.733 0s-17.067-42.667 0-59.733l98.133-98.133-98.133-98.133c-17.067-17.067-17.067-42.667 0-59.733 8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8l98.133 98.133 98.133-98.133c8.533-8.533 21.333-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-98.133 98.133 98.133 98.133c17.067 17.067 17.067 42.667 0 59.733z" />
|
||||
<glyph unicode="" glyph-name="share-top" d="M853.333 469.334c-25.6 0-42.667-17.067-42.667-42.667v-341.333c0-25.6-17.067-42.667-42.667-42.667h-512c-25.6 0-42.667 17.067-42.667 42.667v341.333c0 25.6-17.067 42.667-42.667 42.667s-42.667-17.067-42.667-42.667v-341.333c0-72.533 55.467-128 128-128h512c72.533 0 128 55.467 128 128v341.333c0 25.6-17.067 42.667-42.667 42.667zM371.2 652.8l98.133 98.133v-452.267c0-25.6 17.067-42.667 42.667-42.667s42.667 17.067 42.667 42.667v452.267l98.133-98.133c8.533-8.533 17.067-12.8 29.867-12.8s21.333 4.267 29.867 12.8c17.067 17.067 17.067 42.667 0 59.733l-170.667 170.667c-4.267 4.267-8.533 8.533-12.8 8.533-8.533 4.267-21.333 4.267-34.133 0-4.267-4.267-8.533-4.267-12.8-8.533l-170.667-170.667c-17.067-17.067-17.067-42.667 0-59.733s42.667-17.067 59.733 0z" />
|
||||
<glyph unicode="" glyph-name="arrow-long-bottom" d="M479.22 960.001v-897.794l-183.579 183.579-45.886-47.54 262.245-262.245 262.245 262.245-45.89 45.885-183.576-181.924v897.794z" />
|
||||
<glyph unicode="" glyph-name="arrow-long-top" d="M479.22-64.001v897.794l-183.579-183.579-45.886 47.54 262.245 262.245 262.245-262.245-45.89-45.885-183.576 181.924v-897.794z" />
|
||||
<glyph unicode="" glyph-name="arrow-long-left" d="M1024.001 415.22h-897.794l183.579-183.579-47.54-45.886-262.245 262.245 262.245 262.245 45.885-45.89-181.924-183.576h897.794z" />
|
||||
<glyph unicode="" glyph-name="arrow-long-right" d="M-0.001 415.22h897.794l-183.579-183.579 47.54-45.886 262.245 262.245-262.245 262.245-45.885-45.89 181.924-183.576h-897.794z" />
|
||||
</font></defs></svg>
|
||||
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Lightbox
|
||||
*/
|
||||
|
||||
import {
|
||||
$,
|
||||
$window,
|
||||
$doc,
|
||||
$body,
|
||||
sight
|
||||
} from './utility';
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
$.fn.SightLightbox = function( options ) {
|
||||
|
||||
var settings = $.extend( {
|
||||
gallery : false,
|
||||
}, options);
|
||||
|
||||
var containerSelector = this;
|
||||
var imageSelector = null;
|
||||
|
||||
$( containerSelector ).each( function() {
|
||||
|
||||
if ( $( this ).is( 'img' ) ) {
|
||||
imageSelector = this;
|
||||
} else {
|
||||
imageSelector = $( this ).find( 'img' );
|
||||
}
|
||||
|
||||
$( imageSelector ).each( function() {
|
||||
|
||||
var link = $( this ).closest( '.sight-portfolio-entry' ).find( '.sight-portfolio-overlay-link' );
|
||||
|
||||
if ( ! $( link ).is( 'a' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var imagehref = $( link ).attr( 'href' );
|
||||
|
||||
if ( ! imagehref.match( /\.(gif|jpeg|jpg|png)/ ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$( link ).addClass( 'sight-image-popup' );
|
||||
});
|
||||
|
||||
if ( $( this ).closest( '.elementor-element' ).length > 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$( containerSelector ).magnificPopup( {
|
||||
delegate: '.sight-image-popup',
|
||||
type: 'image',
|
||||
tClose: sight_lightbox_localize.text_close + '(Esc)',
|
||||
tLoading: sight_lightbox_localize.text_loading,
|
||||
gallery: {
|
||||
enabled: settings.gallery,
|
||||
tPrev: sight_lightbox_localize.text_previous,
|
||||
tNext: sight_lightbox_localize.text_next,
|
||||
tCounter: '<span class="mfp-counter">%curr% ' + sight_lightbox_localize.text_counter + ' %total%</span>'
|
||||
},
|
||||
image: {
|
||||
titleSrc: function( item ) {
|
||||
let entry = item.el.closest( '.sight-portfolio-entry' );
|
||||
|
||||
if ( $( entry ).hasClass( 'sight-portfolio-entry-custom' ) ) {
|
||||
|
||||
return $( entry ).find( '.sight-portfolio-entry__caption' ).text();
|
||||
|
||||
} else if ( $( entry ).hasClass( 'sight-portfolio-entry-post' ) ) {
|
||||
|
||||
return $( entry ).find( '.sight-portfolio-entry__caption' ).text();
|
||||
|
||||
} else {
|
||||
return $( entry ).find( '.sight-portfolio-entry__heading' ).text();
|
||||
}
|
||||
}
|
||||
},
|
||||
} );
|
||||
} );
|
||||
|
||||
};
|
||||
|
||||
function initSightLightbox() {
|
||||
$( '.sight-portfolio-area-lightbox' ).imagesLoaded( function() {
|
||||
$( '.sight-portfolio-area-lightbox' ).SightLightbox( { gallery: true } );
|
||||
} );
|
||||
}
|
||||
|
||||
$( document ).ready( function() {
|
||||
initSightLightbox();
|
||||
$( document.body ).on( 'post-load image-load', function() {
|
||||
initSightLightbox();
|
||||
} );
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,272 @@
|
||||
/**
|
||||
* AJAX Load More.
|
||||
*
|
||||
* Contains functions for AJAX Load More.
|
||||
*/
|
||||
|
||||
import {
|
||||
$,
|
||||
$window,
|
||||
$doc,
|
||||
$body,
|
||||
sight
|
||||
} from './utility';
|
||||
|
||||
/**
|
||||
* Insert Load More
|
||||
*/
|
||||
function sight_portfolio_load_more_insert( container, settings ) {
|
||||
if ( 'none' === settings.pagination_type ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $( container ).find( '.sight-portfolio-area__pagination' ).length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$( container ).append( '<div class="sight-portfolio-area__pagination"><button class="sight-portfolio-load-more">' + settings.translation.load_more + '</button></div>' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next posts
|
||||
*/
|
||||
function sight_portfolio_ajax_get_posts( container, reload ) {
|
||||
var pagination = $( container ).find( '.sight-portfolio-area__pagination' );
|
||||
var loadMore = $( container ).find( '.sight-portfolio-load-more' );
|
||||
var settings = $( container ).data( 'settings' );
|
||||
var page = $( container ).data( 'page' );
|
||||
|
||||
// Filter terms.
|
||||
var terms = [];
|
||||
|
||||
$( container ).find( '.sight-portfolio-area-filter__list li' ).each( function( index, elem ) {
|
||||
if ( $( this ).is( '.sight-filter-active:not(.sight-filter-all)' ) ) {
|
||||
terms.push( $( this ).find( 'a' ).data( 'filter' ) );
|
||||
}
|
||||
} );
|
||||
|
||||
// Set area loading.
|
||||
$( container ).find( '.sight-portfolio-area__main' ).addClass( 'sight-portfolio-loading' );
|
||||
|
||||
// Set ajax settings.
|
||||
if ( reload ) {
|
||||
page = 1;
|
||||
}
|
||||
|
||||
var data = {
|
||||
action: 'sight_portfolio_ajax_load_more',
|
||||
terms: terms,
|
||||
page: page,
|
||||
posts_per_page: settings.posts_per_page,
|
||||
query_data: settings.query_data,
|
||||
attributes: settings.attributes,
|
||||
options: settings.options,
|
||||
_ajax_nonce: settings.nonce,
|
||||
};
|
||||
|
||||
// Set the loading state.
|
||||
$( container ).data( 'loading', true );
|
||||
|
||||
// Set button text to Load More.
|
||||
$( loadMore ).text( settings.translation.loading );
|
||||
|
||||
// Request Url.
|
||||
var sight_pagination_url;
|
||||
|
||||
if ( 'ajax_restapi' === settings.type ) {
|
||||
sight_pagination_url = settings.rest_url;
|
||||
} else {
|
||||
sight_pagination_url = settings.url;
|
||||
}
|
||||
|
||||
// Send Request.
|
||||
$.post( sight_pagination_url, data, function( res ) {
|
||||
if ( res.success ) {
|
||||
|
||||
// Get the posts.
|
||||
var data = $( res.data.content );
|
||||
|
||||
data.imagesLoaded( function() {
|
||||
|
||||
// Append new posts to list, standard and grid archives.
|
||||
if ( reload ) {
|
||||
$( container ).find( '.sight-portfolio-area__main' ).html( data );
|
||||
} else {
|
||||
$( container ).find( '.sight-portfolio-area__main' ).append( data );
|
||||
}
|
||||
|
||||
// Entry animations.
|
||||
$( container ).find( '.sight-portfolio-entry-request' ).each( function() {
|
||||
if ( !$( this ).is( 'sight-portfolio-entry-animation' ) ) {
|
||||
$( this ).addClass( 'sight-portfolio-entry-animation' ).animate( {opacity: 1, top: 0}, 600);
|
||||
}
|
||||
} );
|
||||
|
||||
// WP Post Load trigger.
|
||||
$( window ).trigger( 'post-load' );
|
||||
|
||||
// Reinit Facebook widgets.
|
||||
if ( $( '#fb-root' ).length ) {
|
||||
FB.XFBML.parse();
|
||||
}
|
||||
|
||||
// Set button text to Load More.
|
||||
$( loadMore ).text( settings.translation.load_more );
|
||||
|
||||
// Increment a page.
|
||||
page = page + 1;
|
||||
|
||||
$( container ).data( 'page', page );
|
||||
|
||||
// Set the loading state.
|
||||
$( container ).data( 'loading', false );
|
||||
} );
|
||||
|
||||
// Remove Button on Posts End.
|
||||
if ( res.data.posts_end || !data.length ) {
|
||||
|
||||
// Remove Load More button.
|
||||
$( pagination ).remove();
|
||||
} else {
|
||||
|
||||
// Add Load More button.
|
||||
sight_portfolio_load_more_insert( container, settings );
|
||||
}
|
||||
|
||||
$( container ).find( '.sight-portfolio-area__main' ).removeClass( 'sight-portfolio-loading' );
|
||||
} else {
|
||||
$( container ).find( '.sight-portfolio-area__main' ).removeClass( 'sight-portfolio-loading' );
|
||||
}
|
||||
|
||||
|
||||
} ).fail( function( xhr, textStatus, e ) {
|
||||
// console.log(xhr.responseText);
|
||||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialization Load More
|
||||
*/
|
||||
function sight_portfolio_load_more_init( infinite, blockId ) {
|
||||
|
||||
$( '.sight-portfolio-area' ).each( function() {
|
||||
|
||||
var sight_ajax_settings;
|
||||
|
||||
if ( blockId ) {
|
||||
let itemId = $( this ).closest( `[data-block]` ).attr( 'id' );
|
||||
|
||||
if ( itemId !== blockId ) {
|
||||
return;
|
||||
}
|
||||
} else if ( $( this ).data( 'init' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var archive_data = $( this ).data( 'items-area' );
|
||||
|
||||
if ( archive_data ) {
|
||||
sight_ajax_settings = JSON.parse( window.atob( archive_data ) );
|
||||
}
|
||||
|
||||
if ( sight_ajax_settings ) {
|
||||
// Set load more settings.
|
||||
$( this ).data( 'settings', sight_ajax_settings );
|
||||
$( this ).data( 'page', 2 );
|
||||
$( this ).data( 'loading', false );
|
||||
$( this ).data( 'scrollHandling', {
|
||||
allow: $.parseJSON( 'infinite' === sight_ajax_settings.pagination_type ? true : false ),
|
||||
delay: 400
|
||||
} );
|
||||
|
||||
if ( !infinite && ( 'infinite' === sight_ajax_settings.pagination_type ? true : false ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add load more button.
|
||||
if ( sight_ajax_settings.max_num_pages > 1 ) {
|
||||
sight_portfolio_load_more_insert( this, sight_ajax_settings );
|
||||
}
|
||||
}
|
||||
|
||||
$( this ).data( 'init', true );
|
||||
} );
|
||||
}
|
||||
|
||||
sight_portfolio_load_more_init( true, false );
|
||||
|
||||
sight.addAction( 'sight.components.serverSideRender.onChange', 'sight/portfolio/loadmore', function( props ) {
|
||||
if ( 'sight/portfolio' === props.block ) {
|
||||
|
||||
let blockId = $( `[id=block-${props.blockProps.clientId}]` ).attr( 'id' );
|
||||
|
||||
sight_portfolio_load_more_init( false, blockId );
|
||||
}
|
||||
} );
|
||||
|
||||
// On Scroll Event.
|
||||
$( window ).scroll( function() {
|
||||
|
||||
$( '.sight-portfolio-area .sight-portfolio-load-more' ).each( function() {
|
||||
|
||||
var container = $( this ).closest( '.sight-portfolio-area' );
|
||||
|
||||
// Vars loading.
|
||||
var loading = $( container ).data( 'loading' );
|
||||
var scrollHandling = $( container ).data( 'scrollHandling' );
|
||||
|
||||
if ( 'undefined' === typeof scrollHandling ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $( this ).length && !loading && scrollHandling.allow ) {
|
||||
|
||||
scrollHandling.allow = false;
|
||||
|
||||
$( container ).data( 'scrollHandling', scrollHandling );
|
||||
|
||||
setTimeout( function() {
|
||||
var scrollHandling = $( container ).data( 'scrollHandling' );
|
||||
|
||||
if ( 'undefined' === typeof scrollHandling ) {
|
||||
return;
|
||||
}
|
||||
|
||||
scrollHandling.allow = true;
|
||||
|
||||
$( container ).data( 'scrollHandling', scrollHandling );
|
||||
}, scrollHandling.delay );
|
||||
|
||||
var offset = $( this ).offset().top - $( window ).scrollTop();
|
||||
if ( 4000 > offset ) {
|
||||
sight_portfolio_ajax_get_posts( container );
|
||||
}
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
// On Click Event.
|
||||
$( 'body' ).on( 'click', '.sight-portfolio-load-more', function() {
|
||||
var container = $( this ).closest( '.sight-portfolio-area' );
|
||||
var loading = $( this ).data( 'loading' );
|
||||
|
||||
if ( !loading ) {
|
||||
sight_portfolio_ajax_get_posts( container, false );
|
||||
}
|
||||
} );
|
||||
|
||||
// On Click Categories.
|
||||
$( 'body' ).on( 'click', '.sight-portfolio-area-filter__list a', function( e ) {
|
||||
var container = $( this ).closest( '.sight-portfolio-area' );
|
||||
|
||||
// Remove active item.
|
||||
$( this ).parent().siblings().removeClass( 'sight-filter-active' );
|
||||
|
||||
// Active item.
|
||||
$( this ).parent().addClass( 'sight-filter-active' );
|
||||
|
||||
// Ajax.
|
||||
sight_portfolio_ajax_get_posts( container, true );
|
||||
|
||||
e.preventDefault();
|
||||
} );
|
||||
@@ -0,0 +1,544 @@
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Video Background */
|
||||
|
||||
import {
|
||||
$,
|
||||
$window,
|
||||
$doc,
|
||||
$body
|
||||
} from './utility';
|
||||
|
||||
var sightVideoPortfolio = {};
|
||||
|
||||
( function() {
|
||||
var $this;
|
||||
var YTdeferredDone = false;
|
||||
var initAPI = false;
|
||||
var process = false;
|
||||
var contex = [];
|
||||
var players = [];
|
||||
var attrs = [];
|
||||
|
||||
// Create deferred object
|
||||
var YTdeferred = $.Deferred();
|
||||
|
||||
if ( typeof window.onYouTubePlayerAPIReady !== 'undefined' ) {
|
||||
if ( typeof window.sightYTAPIReady === 'undefined' ) {
|
||||
window.sightYTAPIReady = [];
|
||||
}
|
||||
window.sightYTAPIReady.push( window.onYouTubePlayerAPIReady );
|
||||
}
|
||||
|
||||
window.onYouTubePlayerAPIReady = function() {
|
||||
if ( typeof window.sightYTAPIReady !== 'undefined' ) {
|
||||
if ( window.sightYTAPIReady.length ) {
|
||||
window.sightYTAPIReady.pop()();
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve when youtube callback is called
|
||||
// passing YT as a parameter.
|
||||
YTdeferred.resolve( window.YT );
|
||||
};
|
||||
|
||||
// Whenever youtube callback was called = deferred resolved
|
||||
// your custom function will be executed with YT as an argument.
|
||||
YTdeferred.done( function( YT ) {
|
||||
YTdeferredDone = true;
|
||||
} );
|
||||
|
||||
// Embedding youtube iframe api.
|
||||
function embedYoutubeAPI() {
|
||||
if ( 'function' === typeof( window.onYTReady ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tag = document.createElement( 'script' );
|
||||
tag.src = 'https://www.youtube.com/iframe_api';
|
||||
|
||||
var firstScriptTag = document.getElementsByTagName( 'script' )[ 0 ];
|
||||
firstScriptTag.parentNode.insertBefore( tag, firstScriptTag );
|
||||
}
|
||||
|
||||
$.fn.contexObject = function( id, type ) {
|
||||
if ( 'string' === typeof id ) {
|
||||
id = `[data-id="${id}"]`;
|
||||
} else {
|
||||
id = this;
|
||||
}
|
||||
|
||||
if ( 'wrap' === type ) {
|
||||
return $( id ).closest( '.sight-portfolio-video-wrap' );
|
||||
} else if ( 'container' === type ) {
|
||||
return $( id ).closest( '.sight-portfolio-video-container' );
|
||||
} else if ( 'inner' === type ) {
|
||||
return $( id ).closest( '.sight-portfolio-video-wrap' ).find( '.sight-portfolio-video-inner' );
|
||||
} else {
|
||||
return $( id );
|
||||
}
|
||||
};
|
||||
|
||||
// Object Video Portfolio.
|
||||
sightVideoPortfolio = {
|
||||
|
||||
/** Initialize */
|
||||
init: function( e ) {
|
||||
if ( $( 'body' ).hasClass( 'wp-admin' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this = sightVideoPortfolio;
|
||||
|
||||
// Init events.
|
||||
$this.events( e );
|
||||
},
|
||||
|
||||
// Video rescale.
|
||||
rescaleVideoBackground: function() {
|
||||
$( '.sight-portfolio-video-init' ).each( function() {
|
||||
let w = $( this ).parent().width();
|
||||
let h = $( this ).parent().height();
|
||||
|
||||
var hideControl = 400;
|
||||
|
||||
let id = $( this ).attr( 'data-id' );
|
||||
|
||||
if ( w / h > 16 / 9 ) {
|
||||
if ( 'youtube' === $( this ).parent().data( 'video-mode' ) ) {
|
||||
players[ id ].setSize( w, w / 16 * 9 + hideControl );
|
||||
} else {
|
||||
players[ id ].width( w );
|
||||
players[ id ].height( w / 16 * 9 + hideControl );
|
||||
}
|
||||
} else {
|
||||
if ( 'youtube' === $( this ).parent().data( 'video-mode' ) ) {
|
||||
players[ id ].setSize( h / 9 * 16, h + hideControl );
|
||||
} else {
|
||||
players[ id ].width( h / 9 * 16 );
|
||||
players[ id ].height( h + hideControl );
|
||||
}
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
// Init video background.
|
||||
initVideoBackground: function( mode, object ) {
|
||||
|
||||
$( '.sight-portfolio-video-inner' ).each( function() {
|
||||
|
||||
// The mode.
|
||||
if ( !$( this ).parent().is( `[data-video-mode="${mode}"]` ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The state.
|
||||
var isInit = $( this ).hasClass( 'sight-portfolio-video-init' );
|
||||
|
||||
var id = null;
|
||||
|
||||
// Generate unique ID.
|
||||
if ( !isInit ) {
|
||||
id = Math.random().toString( 36 ).substr( 2, 9 );
|
||||
} else {
|
||||
id = $( this ).attr( 'data-id' );
|
||||
}
|
||||
|
||||
// Create contex.
|
||||
contex[ id ] = this;
|
||||
|
||||
// The monitor.
|
||||
var isInView = $( contex[ id ] ).isInViewport();
|
||||
|
||||
// The actived.
|
||||
var isActive = $( contex[ id ] ).hasClass( 'active' );
|
||||
|
||||
// Get video attrs.
|
||||
var youtubeID = $( contex[ id ] ).parent().data( 'youtube-id' );
|
||||
var videoType = $( contex[ id ] ).parent().data( 'video-type' );
|
||||
var videoStart = $( contex[ id ] ).parent().data( 'video-start' );
|
||||
var videoEnd = $( contex[ id ] ).parent().data( 'video-end' );
|
||||
|
||||
// Initialization.
|
||||
if ( isInView && !isInit ) {
|
||||
|
||||
// Add init class.
|
||||
$( contex[ id ] ).addClass( 'sight-portfolio-video-init' );
|
||||
|
||||
// Add unique ID.
|
||||
$( contex[ id ] ).attr( 'data-id', id );
|
||||
|
||||
// Check video mode.
|
||||
if ( 'youtube' === mode ) {
|
||||
// Check video id.
|
||||
if ( typeof youtubeID === 'undefined' || !youtubeID ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Video attrs.
|
||||
attrs[ id ] = {
|
||||
'videoId': youtubeID,
|
||||
'startSeconds': videoStart,
|
||||
'endSeconds': videoEnd,
|
||||
'suggestedQuality': 'hd720'
|
||||
};
|
||||
|
||||
// Creating a player.
|
||||
players[ id ] = new YT.Player( contex[ id ], {
|
||||
playerVars: {
|
||||
autoplay: 0,
|
||||
autohide: 1,
|
||||
modestbranding: 1,
|
||||
rel: 0,
|
||||
showinfo: 0,
|
||||
controls: 0,
|
||||
disablekb: 1,
|
||||
enablejsapi: 0,
|
||||
iv_load_policy: 3,
|
||||
playsinline: 1,
|
||||
loop: 1
|
||||
},
|
||||
events: {
|
||||
'onReady': function() {
|
||||
|
||||
players[ id ].cueVideoById( attrs[ id ] );
|
||||
players[ id ].mute();
|
||||
|
||||
if ( 'always' === videoType ) {
|
||||
$this.playVideo( id );
|
||||
}
|
||||
},
|
||||
'onStateChange': function( e ) {
|
||||
if ( e.data === 1 ) {
|
||||
$( this ).contexObject( id ).closest( '.sight-portfolio-video-wrap' ).addClass( 'sight-portfolio-video-bg-init' );
|
||||
$( this ).contexObject( id ).addClass( 'active' );
|
||||
} else if ( e.data === 0 ) {
|
||||
players[ id ].seekTo( attrs[ id ].startSeconds );
|
||||
} else if ( e.data === 5 ) {
|
||||
players[ id ].videoReady = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
} else {
|
||||
// Creating a player.
|
||||
players[ id ] = $( contex[ id ] );
|
||||
|
||||
// Ready play.
|
||||
players[ id ].on( 'canplay', function() {
|
||||
players[ id ].videoReady = true;
|
||||
|
||||
if ( true !== players[ id ].start ) {
|
||||
players[ id ].start = true;
|
||||
|
||||
this.currentTime = videoStart ? videoStart : 0;
|
||||
|
||||
if ( 'always' === videoType ) {
|
||||
$this.playVideo( id );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// Play.
|
||||
players[ id ].on( 'play', function() {
|
||||
players[ id ].parents( '.sight-portfolio-video-wrap' ).addClass( 'sight-portfolio-video-bg-init' );
|
||||
players[ id ].addClass( 'active' );
|
||||
} );
|
||||
|
||||
// Ended.
|
||||
players[ id ].on( 'timeupdate', function() {
|
||||
if ( videoEnd && this.currentTime >= videoEnd ) {
|
||||
players[ id ].trigger( 'pause' );
|
||||
|
||||
this.currentTime = videoStart;
|
||||
|
||||
players[ id ].trigger( 'play' );
|
||||
}
|
||||
} );
|
||||
|
||||
players[ id ].trigger( 'load' );
|
||||
}
|
||||
|
||||
$this.rescaleVideoBackground();
|
||||
}
|
||||
|
||||
// Pause and play.
|
||||
if ( 'always' === videoType && isActive && isInit && ! $this.getVideoUpause( id ) ) {
|
||||
|
||||
if ( isInView ) {
|
||||
$this.playVideo( id );
|
||||
}
|
||||
|
||||
if ( ! isInView ) {
|
||||
$this.pauseVideo( id );
|
||||
}
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
// Construct video background.
|
||||
constructVideoBackground: function( object ) {
|
||||
if ( $( 'body' ).hasClass( 'wp-admin' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( process ) {
|
||||
return;
|
||||
}
|
||||
|
||||
process = true;
|
||||
|
||||
// Smart init API.
|
||||
if ( !initAPI ) {
|
||||
let elements = $( '[data-video-mode="youtube"][data-youtube-id]' );
|
||||
|
||||
if ( elements.length ) {
|
||||
embedYoutubeAPI();
|
||||
|
||||
initAPI = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !initAPI ) {
|
||||
process = false;
|
||||
}
|
||||
|
||||
// Play Video.
|
||||
$this.initVideoBackground( 'local', object );
|
||||
|
||||
if ( initAPI && YTdeferredDone ) {
|
||||
$this.initVideoBackground( 'youtube', object );
|
||||
}
|
||||
|
||||
process = false;
|
||||
},
|
||||
|
||||
// Get video type.
|
||||
getVideoType: function( id ) {
|
||||
return $( this ).contexObject( id, 'container' ).data( 'video-type' );
|
||||
},
|
||||
|
||||
// Get video mode.
|
||||
getVideoMode: function( id ) {
|
||||
return $( this ).contexObject( id, 'container' ).data( 'video-mode' );
|
||||
},
|
||||
|
||||
// Get video state.
|
||||
getVideoState: function( id ) {
|
||||
return players[ id ].videoState;
|
||||
},
|
||||
|
||||
// Get video ready.
|
||||
getVideoReady: function( id ) {
|
||||
return players[ id ].videoReady ? players[ id ].videoReady : false;
|
||||
},
|
||||
|
||||
// Get video upause.
|
||||
getVideoUpause: function( id ) {
|
||||
return players[ id ].videoUpause ? players[ id ].videoUpause : false;
|
||||
},
|
||||
|
||||
// Get video volume.
|
||||
getVideoVolume: function( id ) {
|
||||
return players[ id ].videoVolume ? players[ id ].videoVolume : 'mute';
|
||||
},
|
||||
|
||||
// Change video upause.
|
||||
changeVideoUpause: function( id, val ) {
|
||||
players[ id ].videoUpause = val;
|
||||
},
|
||||
|
||||
// Play video.
|
||||
playVideo: function( id ) {
|
||||
if ( 'play' === players[ id ].videoState ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! players[ id ].videoReady ) {
|
||||
return setTimeout(function(){
|
||||
$this.playVideo( id );
|
||||
}, 100);
|
||||
}
|
||||
|
||||
if ( 'youtube' === $this.getVideoMode( id ) ) {
|
||||
players[ id ].playVideo();
|
||||
} else {
|
||||
players[ id ].trigger( 'play' );
|
||||
}
|
||||
|
||||
// Change control.
|
||||
let control = $( this ).contexObject( id, 'wrap' ).find( '.sight-portfolio-player-state' );
|
||||
|
||||
$( control ).removeClass( 'sight-portfolio-player-pause' );
|
||||
$( control ).addClass( 'sight-portfolio-player-play' );
|
||||
|
||||
// Set state.
|
||||
players[ id ].videoState = 'play';
|
||||
},
|
||||
|
||||
// Pause video.
|
||||
pauseVideo: function( id ) {
|
||||
if ( 'pause' === players[ id ].videoState ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! players[ id ].videoReady ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'youtube' === $this.getVideoMode( id ) ) {
|
||||
players[ id ].pauseVideo();
|
||||
} else {
|
||||
players[ id ].trigger( 'pause' );
|
||||
}
|
||||
|
||||
// Change control.
|
||||
let control = $( this ).contexObject( id, 'wrap' ).find( '.sight-portfolio-player-state' );
|
||||
|
||||
$( control ).removeClass( 'sight-portfolio-player-play' );
|
||||
$( control ).addClass( 'sight-portfolio-player-pause' );
|
||||
|
||||
// Set state.
|
||||
players[ id ].videoState = 'pause';
|
||||
},
|
||||
|
||||
// Unmute video.
|
||||
unmuteVideo: function( id ) {
|
||||
if ( ! players[ id ].videoReady ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'youtube' === $this.getVideoMode( id ) ) {
|
||||
players[ id ].unMute();
|
||||
} else {
|
||||
players[ id ].prop( 'muted', false );
|
||||
}
|
||||
|
||||
// Change control.
|
||||
let control = $( this ).contexObject( id, 'wrap' ).find( '.sight-portfolio-player-volume' );
|
||||
|
||||
$( control ).removeClass( 'sight-portfolio-player-mute' );
|
||||
$( control ).addClass( 'sight-portfolio-player-unmute' );
|
||||
|
||||
// Set state.
|
||||
players[ id ].videoVolume = 'unmute';
|
||||
},
|
||||
|
||||
// Mute video.
|
||||
muteVideo: function( id ) {
|
||||
if ( ! players[ id ].videoReady ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'youtube' === $this.getVideoMode( id ) ) {
|
||||
players[ id ].mute();
|
||||
} else {
|
||||
players[ id ].prop( 'muted', true );
|
||||
}
|
||||
|
||||
// Change control.
|
||||
let control = $( this ).contexObject( id, 'wrap' ).find( '.sight-portfolio-player-volume' );
|
||||
|
||||
$( control ).removeClass( 'sight-portfolio-player-unmute' );
|
||||
$( control ).addClass( 'sight-portfolio-player-mute' );
|
||||
|
||||
// Set state.
|
||||
players[ id ].videoVolume = 'muted';
|
||||
},
|
||||
|
||||
// Toogle video state.
|
||||
toogleVideoState: function( id ) {
|
||||
if ( 'play' === $this.getVideoState( id ) ) {
|
||||
$this.pauseVideo( id );
|
||||
} else {
|
||||
$this.playVideo( id );
|
||||
}
|
||||
},
|
||||
|
||||
// Toogle video volume.
|
||||
toogleVideoVolume: function( id ) {
|
||||
if ( 'unmute' === $this.getVideoVolume( id ) ) {
|
||||
$this.muteVideo( id );
|
||||
} else {
|
||||
$this.unmuteVideo( id );
|
||||
}
|
||||
},
|
||||
|
||||
/** Events */
|
||||
events: function( e ) {
|
||||
// State Control.
|
||||
$doc.on( 'click', '.sight-portfolio-player-state', function() {
|
||||
let id = $( this ).contexObject( false, 'inner' ).attr( 'data-id' );
|
||||
|
||||
$this.toogleVideoState( id );
|
||||
|
||||
if ( 'play' === $this.getVideoState( id ) ) {
|
||||
$this.changeVideoUpause( id, false );
|
||||
} else {
|
||||
$this.changeVideoUpause( id, true );
|
||||
}
|
||||
} );
|
||||
|
||||
// Stop Control.
|
||||
$doc.on( 'click', '.sight-portfolio-player-stop', function() {
|
||||
let id = $( this ).contexObject( false, 'inner' ).attr( 'data-id' );
|
||||
|
||||
if ( 'play' === $this.getVideoState( id ) ) {
|
||||
$this.changeVideoUpause( id, true );
|
||||
}
|
||||
|
||||
$this.pauseVideo( id );
|
||||
} );
|
||||
|
||||
// Volume Control.
|
||||
$doc.on( 'click', '.sight-portfolio-player-volume', function() {
|
||||
let id = $( this ).contexObject( false, 'inner' ).attr( 'data-id' );
|
||||
|
||||
$this.toogleVideoVolume( id );
|
||||
} );
|
||||
|
||||
// Mouseover.
|
||||
$doc.on( 'mouseover mousemove', '.sight-portfolio-entry__thumbnail', function() {
|
||||
let id = $( this ).contexObject( false, 'inner' ).attr( 'data-id' );
|
||||
|
||||
if ( 'hover' === $this.getVideoType( id ) ) {
|
||||
$this.playVideo( id );
|
||||
}
|
||||
} );
|
||||
|
||||
// Mouseout.
|
||||
$doc.on( 'mouseout', '.sight-portfolio-entry__thumbnail', function() {
|
||||
let id = $( this ).contexObject( false, 'inner' ).attr( 'data-id' );
|
||||
|
||||
if ( 'hover' === $this.getVideoType( id ) ) {
|
||||
$this.pauseVideo( id );
|
||||
}
|
||||
} );
|
||||
|
||||
// Document scroll.
|
||||
$window.on( 'load scroll resize scrollstop', function() {
|
||||
$this.constructVideoBackground();
|
||||
} );
|
||||
|
||||
// Document ready.
|
||||
$doc.ready( function() {
|
||||
$this.constructVideoBackground();
|
||||
} );
|
||||
|
||||
// Post load.
|
||||
$body.on( 'post-load', function() {
|
||||
$this.constructVideoBackground();
|
||||
} );
|
||||
|
||||
// Document resize.
|
||||
$window.on( 'resize', function() {
|
||||
$this.rescaleVideoBackground();
|
||||
} );
|
||||
|
||||
// Init.
|
||||
$this.constructVideoBackground();
|
||||
}
|
||||
};
|
||||
} )();
|
||||
|
||||
// Initialize.
|
||||
sightVideoPortfolio.init();
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,954 @@
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
__webpack_require__(1);
|
||||
__webpack_require__(3);
|
||||
module.exports = __webpack_require__(4);
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 1 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _utility__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
||||
/**
|
||||
* Lightbox
|
||||
*/
|
||||
|
||||
|
||||
(function ($) {
|
||||
$.fn.SightLightbox = function (options) {
|
||||
var settings = $.extend({
|
||||
gallery: false
|
||||
}, options);
|
||||
var containerSelector = this;
|
||||
var imageSelector = null;
|
||||
$(containerSelector).each(function () {
|
||||
if ($(this).is('img')) {
|
||||
imageSelector = this;
|
||||
} else {
|
||||
imageSelector = $(this).find('img');
|
||||
}
|
||||
|
||||
$(imageSelector).each(function () {
|
||||
var link = $(this).closest('.sight-portfolio-entry').find('.sight-portfolio-overlay-link');
|
||||
|
||||
if (!$(link).is('a')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var imagehref = $(link).attr('href');
|
||||
|
||||
if (!imagehref.match(/\.(gif|jpeg|jpg|png)/)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(link).addClass('sight-image-popup');
|
||||
});
|
||||
|
||||
if ($(this).closest('.elementor-element').length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(containerSelector).magnificPopup({
|
||||
delegate: '.sight-image-popup',
|
||||
type: 'image',
|
||||
tClose: sight_lightbox_localize.text_close + '(Esc)',
|
||||
tLoading: sight_lightbox_localize.text_loading,
|
||||
gallery: {
|
||||
enabled: settings.gallery,
|
||||
tPrev: sight_lightbox_localize.text_previous,
|
||||
tNext: sight_lightbox_localize.text_next,
|
||||
tCounter: '<span class="mfp-counter">%curr% ' + sight_lightbox_localize.text_counter + ' %total%</span>'
|
||||
},
|
||||
image: {
|
||||
titleSrc: function titleSrc(item) {
|
||||
var entry = item.el.closest('.sight-portfolio-entry');
|
||||
|
||||
if ($(entry).hasClass('sight-portfolio-entry-custom')) {
|
||||
return $(entry).find('.sight-portfolio-entry__caption').text();
|
||||
} else if ($(entry).hasClass('sight-portfolio-entry-post')) {
|
||||
return $(entry).find('.sight-portfolio-entry__caption').text();
|
||||
} else {
|
||||
return $(entry).find('.sight-portfolio-entry__heading').text();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
function initSightLightbox() {
|
||||
$('.sight-portfolio-area-lightbox').imagesLoaded(function () {
|
||||
$('.sight-portfolio-area-lightbox').SightLightbox({
|
||||
gallery: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
initSightLightbox();
|
||||
$(document.body).on('post-load image-load', function () {
|
||||
initSightLightbox();
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
/***/ }),
|
||||
/* 2 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$", function() { return $; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$window", function() { return $window; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$doc", function() { return $doc; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$body", function() { return $body; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sight", function() { return sight; });
|
||||
// Create csco object.
|
||||
var sight = {
|
||||
addAction: function addAction(x, y, z) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if ('undefined' !== typeof wp && 'undefined' !== typeof wp.hooks) {
|
||||
sight.addAction = wp.hooks.addAction;
|
||||
}
|
||||
|
||||
if ('undefined' === typeof window.load_more_query) {
|
||||
window.load_more_query = [];
|
||||
}
|
||||
/**
|
||||
* Window size
|
||||
*/
|
||||
|
||||
|
||||
var $ = jQuery;
|
||||
var $window = $(window);
|
||||
var $doc = $(document);
|
||||
var $body = $('body');
|
||||
/**
|
||||
* In Viewport checker
|
||||
*/
|
||||
|
||||
$.fn.isInViewport = function () {
|
||||
var elementTop = $(this).offset().top;
|
||||
var elementBottom = elementTop + $(this).outerHeight();
|
||||
var viewportTop = $(window).scrollTop();
|
||||
var viewportBottom = viewportTop + $(window).height();
|
||||
return elementBottom > viewportTop && elementTop < viewportBottom;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 3 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _utility__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
||||
/**
|
||||
* AJAX Load More.
|
||||
*
|
||||
* Contains functions for AJAX Load More.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Insert Load More
|
||||
*/
|
||||
|
||||
function sight_portfolio_load_more_insert(container, settings) {
|
||||
if ('none' === settings.pagination_type) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area__pagination').length) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).append('<div class="sight-portfolio-area__pagination"><button class="sight-portfolio-load-more">' + settings.translation.load_more + '</button></div>');
|
||||
}
|
||||
/**
|
||||
* Get next posts
|
||||
*/
|
||||
|
||||
|
||||
function sight_portfolio_ajax_get_posts(container, reload) {
|
||||
var pagination = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area__pagination');
|
||||
var loadMore = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-load-more');
|
||||
var settings = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('settings');
|
||||
var page = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('page'); // Filter terms.
|
||||
|
||||
var terms = [];
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area-filter__list li').each(function (index, elem) {
|
||||
if (Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).is('.sight-filter-active:not(.sight-filter-all)')) {
|
||||
terms.push(Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).find('a').data('filter'));
|
||||
}
|
||||
}); // Set area loading.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area__main').addClass('sight-portfolio-loading'); // Set ajax settings.
|
||||
|
||||
if (reload) {
|
||||
page = 1;
|
||||
}
|
||||
|
||||
var data = {
|
||||
action: 'sight_portfolio_ajax_load_more',
|
||||
terms: terms,
|
||||
page: page,
|
||||
posts_per_page: settings.posts_per_page,
|
||||
query_data: settings.query_data,
|
||||
attributes: settings.attributes,
|
||||
options: settings.options,
|
||||
_ajax_nonce: settings.nonce
|
||||
}; // Set the loading state.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('loading', true); // Set button text to Load More.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(loadMore).text(settings.translation.loading); // Request Url.
|
||||
|
||||
var sight_pagination_url;
|
||||
|
||||
if ('ajax_restapi' === settings.type) {
|
||||
sight_pagination_url = settings.rest_url;
|
||||
} else {
|
||||
sight_pagination_url = settings.url;
|
||||
} // Send Request.
|
||||
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$"].post(sight_pagination_url, data, function (res) {
|
||||
if (res.success) {
|
||||
// Get the posts.
|
||||
var data = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(res.data.content);
|
||||
data.imagesLoaded(function () {
|
||||
// Append new posts to list, standard and grid archives.
|
||||
if (reload) {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area__main').html(data);
|
||||
} else {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area__main').append(data);
|
||||
} // Entry animations.
|
||||
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-entry-request').each(function () {
|
||||
if (!Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).is('sight-portfolio-entry-animation')) {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).addClass('sight-portfolio-entry-animation').animate({
|
||||
opacity: 1,
|
||||
top: 0
|
||||
}, 600);
|
||||
}
|
||||
}); // WP Post Load trigger.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(window).trigger('post-load'); // Reinit Facebook widgets.
|
||||
|
||||
if (Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('#fb-root').length) {
|
||||
FB.XFBML.parse();
|
||||
} // Set button text to Load More.
|
||||
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(loadMore).text(settings.translation.load_more); // Increment a page.
|
||||
|
||||
page = page + 1;
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('page', page); // Set the loading state.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('loading', false);
|
||||
}); // Remove Button on Posts End.
|
||||
|
||||
if (res.data.posts_end || !data.length) {
|
||||
// Remove Load More button.
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(pagination).remove();
|
||||
} else {
|
||||
// Add Load More button.
|
||||
sight_portfolio_load_more_insert(container, settings);
|
||||
}
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area__main').removeClass('sight-portfolio-loading');
|
||||
} else {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).find('.sight-portfolio-area__main').removeClass('sight-portfolio-loading');
|
||||
}
|
||||
}).fail(function (xhr, textStatus, e) {// console.log(xhr.responseText);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Initialization Load More
|
||||
*/
|
||||
|
||||
|
||||
function sight_portfolio_load_more_init(infinite, blockId) {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('.sight-portfolio-area').each(function () {
|
||||
var sight_ajax_settings;
|
||||
|
||||
if (blockId) {
|
||||
var itemId = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).closest("[data-block]").attr('id');
|
||||
|
||||
if (itemId !== blockId) {
|
||||
return;
|
||||
}
|
||||
} else if (Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('init')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var archive_data = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('items-area');
|
||||
|
||||
if (archive_data) {
|
||||
sight_ajax_settings = JSON.parse(window.atob(archive_data));
|
||||
}
|
||||
|
||||
if (sight_ajax_settings) {
|
||||
// Set load more settings.
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('settings', sight_ajax_settings);
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('page', 2);
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('loading', false);
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('scrollHandling', {
|
||||
allow: _utility__WEBPACK_IMPORTED_MODULE_0__["$"].parseJSON('infinite' === sight_ajax_settings.pagination_type ? true : false),
|
||||
delay: 400
|
||||
});
|
||||
|
||||
if (!infinite && ('infinite' === sight_ajax_settings.pagination_type ? true : false)) {
|
||||
return;
|
||||
} // Add load more button.
|
||||
|
||||
|
||||
if (sight_ajax_settings.max_num_pages > 1) {
|
||||
sight_portfolio_load_more_insert(this, sight_ajax_settings);
|
||||
}
|
||||
}
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('init', true);
|
||||
});
|
||||
}
|
||||
|
||||
sight_portfolio_load_more_init(true, false);
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["sight"].addAction('sight.components.serverSideRender.onChange', 'sight/portfolio/loadmore', function (props) {
|
||||
if ('sight/portfolio' === props.block) {
|
||||
var blockId = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])("[id=block-".concat(props.blockProps.clientId, "]")).attr('id');
|
||||
sight_portfolio_load_more_init(false, blockId);
|
||||
}
|
||||
}); // On Scroll Event.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(window).scroll(function () {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('.sight-portfolio-area .sight-portfolio-load-more').each(function () {
|
||||
var container = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).closest('.sight-portfolio-area'); // Vars loading.
|
||||
|
||||
var loading = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('loading');
|
||||
var scrollHandling = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('scrollHandling');
|
||||
|
||||
if ('undefined' === typeof scrollHandling) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).length && !loading && scrollHandling.allow) {
|
||||
scrollHandling.allow = false;
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('scrollHandling', scrollHandling);
|
||||
setTimeout(function () {
|
||||
var scrollHandling = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('scrollHandling');
|
||||
|
||||
if ('undefined' === typeof scrollHandling) {
|
||||
return;
|
||||
}
|
||||
|
||||
scrollHandling.allow = true;
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(container).data('scrollHandling', scrollHandling);
|
||||
}, scrollHandling.delay);
|
||||
var offset = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).offset().top - Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(window).scrollTop();
|
||||
|
||||
if (4000 > offset) {
|
||||
sight_portfolio_ajax_get_posts(container);
|
||||
}
|
||||
}
|
||||
});
|
||||
}); // On Click Event.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('body').on('click', '.sight-portfolio-load-more', function () {
|
||||
var container = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).closest('.sight-portfolio-area');
|
||||
var loading = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).data('loading');
|
||||
|
||||
if (!loading) {
|
||||
sight_portfolio_ajax_get_posts(container, false);
|
||||
}
|
||||
}); // On Click Categories.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('body').on('click', '.sight-portfolio-area-filter__list a', function (e) {
|
||||
var container = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).closest('.sight-portfolio-area'); // Remove active item.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).parent().siblings().removeClass('sight-filter-active'); // Active item.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).parent().addClass('sight-filter-active'); // Ajax.
|
||||
|
||||
sight_portfolio_ajax_get_posts(container, true);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
/* 4 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _utility__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
||||
/** ----------------------------------------------------------------------------
|
||||
* Video Background */
|
||||
|
||||
var sightVideoPortfolio = {};
|
||||
|
||||
(function () {
|
||||
var $this;
|
||||
var YTdeferredDone = false;
|
||||
var initAPI = false;
|
||||
var process = false;
|
||||
var contex = [];
|
||||
var players = [];
|
||||
var attrs = []; // Create deferred object
|
||||
|
||||
var YTdeferred = _utility__WEBPACK_IMPORTED_MODULE_0__["$"].Deferred();
|
||||
|
||||
if (typeof window.onYouTubePlayerAPIReady !== 'undefined') {
|
||||
if (typeof window.sightYTAPIReady === 'undefined') {
|
||||
window.sightYTAPIReady = [];
|
||||
}
|
||||
|
||||
window.sightYTAPIReady.push(window.onYouTubePlayerAPIReady);
|
||||
}
|
||||
|
||||
window.onYouTubePlayerAPIReady = function () {
|
||||
if (typeof window.sightYTAPIReady !== 'undefined') {
|
||||
if (window.sightYTAPIReady.length) {
|
||||
window.sightYTAPIReady.pop()();
|
||||
}
|
||||
} // Resolve when youtube callback is called
|
||||
// passing YT as a parameter.
|
||||
|
||||
|
||||
YTdeferred.resolve(window.YT);
|
||||
}; // Whenever youtube callback was called = deferred resolved
|
||||
// your custom function will be executed with YT as an argument.
|
||||
|
||||
|
||||
YTdeferred.done(function (YT) {
|
||||
YTdeferredDone = true;
|
||||
}); // Embedding youtube iframe api.
|
||||
|
||||
function embedYoutubeAPI() {
|
||||
if ('function' === typeof window.onYTReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
var tag = document.createElement('script');
|
||||
tag.src = 'https://www.youtube.com/iframe_api';
|
||||
var firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
}
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$"].fn.contexObject = function (id, type) {
|
||||
if ('string' === typeof id) {
|
||||
id = "[data-id=\"".concat(id, "\"]");
|
||||
} else {
|
||||
id = this;
|
||||
}
|
||||
|
||||
if ('wrap' === type) {
|
||||
return Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(id).closest('.sight-portfolio-video-wrap');
|
||||
} else if ('container' === type) {
|
||||
return Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(id).closest('.sight-portfolio-video-container');
|
||||
} else if ('inner' === type) {
|
||||
return Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(id).closest('.sight-portfolio-video-wrap').find('.sight-portfolio-video-inner');
|
||||
} else {
|
||||
return Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(id);
|
||||
}
|
||||
}; // Object Video Portfolio.
|
||||
|
||||
|
||||
sightVideoPortfolio = {
|
||||
/** Initialize */
|
||||
init: function init(e) {
|
||||
if (Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('body').hasClass('wp-admin')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this = sightVideoPortfolio; // Init events.
|
||||
|
||||
$this.events(e);
|
||||
},
|
||||
// Video rescale.
|
||||
rescaleVideoBackground: function rescaleVideoBackground() {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('.sight-portfolio-video-init').each(function () {
|
||||
var w = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).parent().width();
|
||||
var h = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).parent().height();
|
||||
var hideControl = 400;
|
||||
var id = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).attr('data-id');
|
||||
|
||||
if (w / h > 16 / 9) {
|
||||
if ('youtube' === Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).parent().data('video-mode')) {
|
||||
players[id].setSize(w, w / 16 * 9 + hideControl);
|
||||
} else {
|
||||
players[id].width(w);
|
||||
players[id].height(w / 16 * 9 + hideControl);
|
||||
}
|
||||
} else {
|
||||
if ('youtube' === Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).parent().data('video-mode')) {
|
||||
players[id].setSize(h / 9 * 16, h + hideControl);
|
||||
} else {
|
||||
players[id].width(h / 9 * 16);
|
||||
players[id].height(h + hideControl);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// Init video background.
|
||||
initVideoBackground: function initVideoBackground(mode, object) {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('.sight-portfolio-video-inner').each(function () {
|
||||
// The mode.
|
||||
if (!Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).parent().is("[data-video-mode=\"".concat(mode, "\"]"))) {
|
||||
return;
|
||||
} // The state.
|
||||
|
||||
|
||||
var isInit = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).hasClass('sight-portfolio-video-init');
|
||||
var id = null; // Generate unique ID.
|
||||
|
||||
if (!isInit) {
|
||||
id = Math.random().toString(36).substr(2, 9);
|
||||
} else {
|
||||
id = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).attr('data-id');
|
||||
} // Create contex.
|
||||
|
||||
|
||||
contex[id] = this; // The monitor.
|
||||
|
||||
var isInView = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).isInViewport(); // The actived.
|
||||
|
||||
var isActive = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).hasClass('active'); // Get video attrs.
|
||||
|
||||
var youtubeID = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).parent().data('youtube-id');
|
||||
var videoType = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).parent().data('video-type');
|
||||
var videoStart = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).parent().data('video-start');
|
||||
var videoEnd = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).parent().data('video-end'); // Initialization.
|
||||
|
||||
if (isInView && !isInit) {
|
||||
// Add init class.
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).addClass('sight-portfolio-video-init'); // Add unique ID.
|
||||
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]).attr('data-id', id); // Check video mode.
|
||||
|
||||
if ('youtube' === mode) {
|
||||
// Check video id.
|
||||
if (typeof youtubeID === 'undefined' || !youtubeID) {
|
||||
return;
|
||||
} // Video attrs.
|
||||
|
||||
|
||||
attrs[id] = {
|
||||
'videoId': youtubeID,
|
||||
'startSeconds': videoStart,
|
||||
'endSeconds': videoEnd,
|
||||
'suggestedQuality': 'hd720'
|
||||
}; // Creating a player.
|
||||
|
||||
players[id] = new YT.Player(contex[id], {
|
||||
playerVars: {
|
||||
autoplay: 0,
|
||||
autohide: 1,
|
||||
modestbranding: 1,
|
||||
rel: 0,
|
||||
showinfo: 0,
|
||||
controls: 0,
|
||||
disablekb: 1,
|
||||
enablejsapi: 0,
|
||||
iv_load_policy: 3,
|
||||
playsinline: 1,
|
||||
loop: 1
|
||||
},
|
||||
events: {
|
||||
'onReady': function onReady() {
|
||||
players[id].cueVideoById(attrs[id]);
|
||||
players[id].mute();
|
||||
|
||||
if ('always' === videoType) {
|
||||
$this.playVideo(id);
|
||||
}
|
||||
},
|
||||
'onStateChange': function onStateChange(e) {
|
||||
if (e.data === 1) {
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id).closest('.sight-portfolio-video-wrap').addClass('sight-portfolio-video-bg-init');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id).addClass('active');
|
||||
} else if (e.data === 0) {
|
||||
players[id].seekTo(attrs[id].startSeconds);
|
||||
} else if (e.data === 5) {
|
||||
players[id].videoReady = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Creating a player.
|
||||
players[id] = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(contex[id]); // Ready play.
|
||||
|
||||
players[id].on('canplay', function () {
|
||||
players[id].videoReady = true;
|
||||
|
||||
if (true !== players[id].start) {
|
||||
players[id].start = true;
|
||||
this.currentTime = videoStart ? videoStart : 0;
|
||||
|
||||
if ('always' === videoType) {
|
||||
$this.playVideo(id);
|
||||
}
|
||||
}
|
||||
}); // Play.
|
||||
|
||||
players[id].on('play', function () {
|
||||
players[id].parents('.sight-portfolio-video-wrap').addClass('sight-portfolio-video-bg-init');
|
||||
players[id].addClass('active');
|
||||
}); // Ended.
|
||||
|
||||
players[id].on('timeupdate', function () {
|
||||
if (videoEnd && this.currentTime >= videoEnd) {
|
||||
players[id].trigger('pause');
|
||||
this.currentTime = videoStart;
|
||||
players[id].trigger('play');
|
||||
}
|
||||
});
|
||||
players[id].trigger('load');
|
||||
}
|
||||
|
||||
$this.rescaleVideoBackground();
|
||||
} // Pause and play.
|
||||
|
||||
|
||||
if ('always' === videoType && isActive && isInit && !$this.getVideoUpause(id)) {
|
||||
if (isInView) {
|
||||
$this.playVideo(id);
|
||||
}
|
||||
|
||||
if (!isInView) {
|
||||
$this.pauseVideo(id);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// Construct video background.
|
||||
constructVideoBackground: function constructVideoBackground(object) {
|
||||
if (Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('body').hasClass('wp-admin')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (process) {
|
||||
return;
|
||||
}
|
||||
|
||||
process = true; // Smart init API.
|
||||
|
||||
if (!initAPI) {
|
||||
var elements = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])('[data-video-mode="youtube"][data-youtube-id]');
|
||||
|
||||
if (elements.length) {
|
||||
embedYoutubeAPI();
|
||||
initAPI = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!initAPI) {
|
||||
process = false;
|
||||
} // Play Video.
|
||||
|
||||
|
||||
$this.initVideoBackground('local', object);
|
||||
|
||||
if (initAPI && YTdeferredDone) {
|
||||
$this.initVideoBackground('youtube', object);
|
||||
}
|
||||
|
||||
process = false;
|
||||
},
|
||||
// Get video type.
|
||||
getVideoType: function getVideoType(id) {
|
||||
return Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id, 'container').data('video-type');
|
||||
},
|
||||
// Get video mode.
|
||||
getVideoMode: function getVideoMode(id) {
|
||||
return Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id, 'container').data('video-mode');
|
||||
},
|
||||
// Get video state.
|
||||
getVideoState: function getVideoState(id) {
|
||||
return players[id].videoState;
|
||||
},
|
||||
// Get video ready.
|
||||
getVideoReady: function getVideoReady(id) {
|
||||
return players[id].videoReady ? players[id].videoReady : false;
|
||||
},
|
||||
// Get video upause.
|
||||
getVideoUpause: function getVideoUpause(id) {
|
||||
return players[id].videoUpause ? players[id].videoUpause : false;
|
||||
},
|
||||
// Get video volume.
|
||||
getVideoVolume: function getVideoVolume(id) {
|
||||
return players[id].videoVolume ? players[id].videoVolume : 'mute';
|
||||
},
|
||||
// Change video upause.
|
||||
changeVideoUpause: function changeVideoUpause(id, val) {
|
||||
players[id].videoUpause = val;
|
||||
},
|
||||
// Play video.
|
||||
playVideo: function playVideo(id) {
|
||||
if ('play' === players[id].videoState) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!players[id].videoReady) {
|
||||
return setTimeout(function () {
|
||||
$this.playVideo(id);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
if ('youtube' === $this.getVideoMode(id)) {
|
||||
players[id].playVideo();
|
||||
} else {
|
||||
players[id].trigger('play');
|
||||
} // Change control.
|
||||
|
||||
|
||||
var control = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id, 'wrap').find('.sight-portfolio-player-state');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).removeClass('sight-portfolio-player-pause');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).addClass('sight-portfolio-player-play'); // Set state.
|
||||
|
||||
players[id].videoState = 'play';
|
||||
},
|
||||
// Pause video.
|
||||
pauseVideo: function pauseVideo(id) {
|
||||
if ('pause' === players[id].videoState) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!players[id].videoReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ('youtube' === $this.getVideoMode(id)) {
|
||||
players[id].pauseVideo();
|
||||
} else {
|
||||
players[id].trigger('pause');
|
||||
} // Change control.
|
||||
|
||||
|
||||
var control = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id, 'wrap').find('.sight-portfolio-player-state');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).removeClass('sight-portfolio-player-play');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).addClass('sight-portfolio-player-pause'); // Set state.
|
||||
|
||||
players[id].videoState = 'pause';
|
||||
},
|
||||
// Unmute video.
|
||||
unmuteVideo: function unmuteVideo(id) {
|
||||
if (!players[id].videoReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ('youtube' === $this.getVideoMode(id)) {
|
||||
players[id].unMute();
|
||||
} else {
|
||||
players[id].prop('muted', false);
|
||||
} // Change control.
|
||||
|
||||
|
||||
var control = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id, 'wrap').find('.sight-portfolio-player-volume');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).removeClass('sight-portfolio-player-mute');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).addClass('sight-portfolio-player-unmute'); // Set state.
|
||||
|
||||
players[id].videoVolume = 'unmute';
|
||||
},
|
||||
// Mute video.
|
||||
muteVideo: function muteVideo(id) {
|
||||
if (!players[id].videoReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ('youtube' === $this.getVideoMode(id)) {
|
||||
players[id].mute();
|
||||
} else {
|
||||
players[id].prop('muted', true);
|
||||
} // Change control.
|
||||
|
||||
|
||||
var control = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(id, 'wrap').find('.sight-portfolio-player-volume');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).removeClass('sight-portfolio-player-unmute');
|
||||
Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(control).addClass('sight-portfolio-player-mute'); // Set state.
|
||||
|
||||
players[id].videoVolume = 'muted';
|
||||
},
|
||||
// Toogle video state.
|
||||
toogleVideoState: function toogleVideoState(id) {
|
||||
if ('play' === $this.getVideoState(id)) {
|
||||
$this.pauseVideo(id);
|
||||
} else {
|
||||
$this.playVideo(id);
|
||||
}
|
||||
},
|
||||
// Toogle video volume.
|
||||
toogleVideoVolume: function toogleVideoVolume(id) {
|
||||
if ('unmute' === $this.getVideoVolume(id)) {
|
||||
$this.muteVideo(id);
|
||||
} else {
|
||||
$this.unmuteVideo(id);
|
||||
}
|
||||
},
|
||||
|
||||
/** Events */
|
||||
events: function events(e) {
|
||||
// State Control.
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$doc"].on('click', '.sight-portfolio-player-state', function () {
|
||||
var id = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(false, 'inner').attr('data-id');
|
||||
$this.toogleVideoState(id);
|
||||
|
||||
if ('play' === $this.getVideoState(id)) {
|
||||
$this.changeVideoUpause(id, false);
|
||||
} else {
|
||||
$this.changeVideoUpause(id, true);
|
||||
}
|
||||
}); // Stop Control.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$doc"].on('click', '.sight-portfolio-player-stop', function () {
|
||||
var id = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(false, 'inner').attr('data-id');
|
||||
|
||||
if ('play' === $this.getVideoState(id)) {
|
||||
$this.changeVideoUpause(id, true);
|
||||
}
|
||||
|
||||
$this.pauseVideo(id);
|
||||
}); // Volume Control.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$doc"].on('click', '.sight-portfolio-player-volume', function () {
|
||||
var id = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(false, 'inner').attr('data-id');
|
||||
$this.toogleVideoVolume(id);
|
||||
}); // Mouseover.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$doc"].on('mouseover mousemove', '.sight-portfolio-entry__thumbnail', function () {
|
||||
var id = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(false, 'inner').attr('data-id');
|
||||
|
||||
if ('hover' === $this.getVideoType(id)) {
|
||||
$this.playVideo(id);
|
||||
}
|
||||
}); // Mouseout.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$doc"].on('mouseout', '.sight-portfolio-entry__thumbnail', function () {
|
||||
var id = Object(_utility__WEBPACK_IMPORTED_MODULE_0__["$"])(this).contexObject(false, 'inner').attr('data-id');
|
||||
|
||||
if ('hover' === $this.getVideoType(id)) {
|
||||
$this.pauseVideo(id);
|
||||
}
|
||||
}); // Document scroll.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$window"].on('load scroll resize scrollstop', function () {
|
||||
$this.constructVideoBackground();
|
||||
}); // Document ready.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$doc"].ready(function () {
|
||||
$this.constructVideoBackground();
|
||||
}); // Post load.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$body"].on('post-load', function () {
|
||||
$this.constructVideoBackground();
|
||||
}); // Document resize.
|
||||
|
||||
_utility__WEBPACK_IMPORTED_MODULE_0__["$window"].on('resize', function () {
|
||||
$this.rescaleVideoBackground();
|
||||
}); // Init.
|
||||
|
||||
$this.constructVideoBackground();
|
||||
}
|
||||
};
|
||||
})(); // Initialize.
|
||||
|
||||
|
||||
sightVideoPortfolio.init();
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
@@ -0,0 +1,43 @@
|
||||
// Create csco object.
|
||||
var sight = {
|
||||
addAction: function( x, y, z ) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if ( 'undefined' !== typeof wp && 'undefined' !== typeof wp.hooks ) {
|
||||
sight.addAction = wp.hooks.addAction;
|
||||
}
|
||||
|
||||
if ( 'undefined' === typeof window.load_more_query ) {
|
||||
window.load_more_query = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Window size
|
||||
*/
|
||||
const $ = jQuery;
|
||||
const $window = $( window );
|
||||
const $doc = $( document );
|
||||
const $body = $( 'body' );
|
||||
|
||||
/**
|
||||
* In Viewport checker
|
||||
*/
|
||||
$.fn.isInViewport = function() {
|
||||
var elementTop = $( this ).offset().top;
|
||||
var elementBottom = elementTop + $( this ).outerHeight();
|
||||
|
||||
var viewportTop = $( window ).scrollTop();
|
||||
var viewportBottom = viewportTop + $( window ).height();
|
||||
|
||||
return elementBottom > viewportTop && elementTop < viewportBottom;
|
||||
};
|
||||
|
||||
export {
|
||||
$,
|
||||
$window,
|
||||
$doc,
|
||||
$body,
|
||||
sight
|
||||
};
|
||||
@@ -0,0 +1,637 @@
|
||||
<?php
|
||||
/**
|
||||
* The Class Portfolio Entry
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'Sight_Entry' ) ) {
|
||||
/**
|
||||
* Create Class Portfolio Entry
|
||||
*/
|
||||
class Sight_Entry {
|
||||
/**
|
||||
* The attributes.
|
||||
*
|
||||
* @var string $attributes The attributes.
|
||||
*/
|
||||
public $attributes = null;
|
||||
|
||||
/**
|
||||
* The options.
|
||||
*
|
||||
* @var string $options The options.
|
||||
*/
|
||||
public $options = null;
|
||||
|
||||
/**
|
||||
* The source.
|
||||
*
|
||||
* @var string $source The source.
|
||||
*/
|
||||
public $source = null;
|
||||
|
||||
/**
|
||||
* The object_id.
|
||||
*
|
||||
* @var string $object_id The object_id.
|
||||
*/
|
||||
public $object_id = null;
|
||||
|
||||
/**
|
||||
* The obgect_link.
|
||||
*
|
||||
* @var string $obgect_link The obgect_link.
|
||||
*/
|
||||
public $obgect_link = null;
|
||||
|
||||
/**
|
||||
* The attachment_id.
|
||||
*
|
||||
* @var string $attachment_id The attachment_id.
|
||||
*/
|
||||
public $attachment_id = null;
|
||||
|
||||
/**
|
||||
* The attachment_lightbox.
|
||||
*
|
||||
* @var string $attachment_lightbox The attachment_lightbox.
|
||||
*/
|
||||
public $attachment_lightbox = null;
|
||||
|
||||
/**
|
||||
* The attachment_lightbox_icon.
|
||||
*
|
||||
* @var string $attachment_lightbox_icon The attachment_lightbox_icon.
|
||||
*/
|
||||
public $attachment_lightbox_icon = null;
|
||||
|
||||
/**
|
||||
* The attachment_link.
|
||||
*
|
||||
* @var string $attachment_link The attachment_link.
|
||||
*/
|
||||
public $attachment_link = null;
|
||||
|
||||
/**
|
||||
* The attachment_link_to.
|
||||
*
|
||||
* @var string $attachment_link_to The attachment_link_to.
|
||||
*/
|
||||
public $attachment_link_to = null;
|
||||
|
||||
/**
|
||||
* The attachment_full_link.
|
||||
*
|
||||
* @var string $attachment_full_link The attachment_full_link.
|
||||
*/
|
||||
public $attachment_full_link = null;
|
||||
|
||||
/**
|
||||
* The attachment_view_more.
|
||||
*
|
||||
* @var string $attachment_view_more The attachment_view_more.
|
||||
*/
|
||||
public $attachment_view_more = null;
|
||||
|
||||
/**
|
||||
* The attachment_view_more_label.
|
||||
*
|
||||
* @var string $attachment_view_more_label The attachment_view_more_label.
|
||||
*/
|
||||
public $attachment_view_more_label = null;
|
||||
|
||||
/**
|
||||
* The attachment_html.
|
||||
*
|
||||
* @var string $attachment_html The attachment_html.
|
||||
*/
|
||||
public $attachment_html = null;
|
||||
|
||||
/**
|
||||
* The attachment_title.
|
||||
*
|
||||
* @var string $attachment_title The attachment_title.
|
||||
*/
|
||||
public $attachment_title = null;
|
||||
|
||||
/**
|
||||
* The attachment_title_tag.
|
||||
*
|
||||
* @var string $attachment_title_tag The attachment_title_tag.
|
||||
*/
|
||||
public $attachment_title_tag = 'h3';
|
||||
|
||||
/**
|
||||
* The attachment_meta.
|
||||
*
|
||||
* @var string $attachment_meta The attachment_meta.
|
||||
*/
|
||||
public $attachment_meta = null;
|
||||
|
||||
/**
|
||||
* The attachment_caption.
|
||||
*
|
||||
* @var string $attachment_caption The attachment_caption.
|
||||
*/
|
||||
public $attachment_caption = null;
|
||||
|
||||
/**
|
||||
* The attachment_orientation.
|
||||
*
|
||||
* @var string $attachment_orientation The attachment_orientation.
|
||||
*/
|
||||
public $attachment_orientation = null;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* This function will initialize the initialize
|
||||
*
|
||||
* @param array $attributes The attributes of block.
|
||||
* @param array $options The options of block.
|
||||
*/
|
||||
public function __construct( $attributes, $options ) {
|
||||
$this->attributes = $attributes;
|
||||
$this->options = $options;
|
||||
|
||||
// Set source of entry.
|
||||
$this->source = $attributes['source'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Init Entry
|
||||
*/
|
||||
public function init() {
|
||||
$this->set_object_id();
|
||||
$this->set_object_link();
|
||||
$this->set_attachment_id();
|
||||
$this->set_attachment_lightbox();
|
||||
$this->set_attachment_lightbox_icon();
|
||||
$this->set_attachment_link();
|
||||
$this->set_attachment_link_to();
|
||||
$this->set_attachment_full_link();
|
||||
$this->set_attachment_view_more();
|
||||
$this->set_attachment_view_more_label();
|
||||
$this->set_attachment_html();
|
||||
$this->set_attachment_title();
|
||||
$this->set_attachment_title_tag();
|
||||
$this->set_attachment_meta();
|
||||
$this->set_attachment_caption();
|
||||
$this->set_attachment_orientation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Object Id
|
||||
*/
|
||||
public function set_object_id() {
|
||||
if ( 'projects' === $this->source ) {
|
||||
$this->object_id = get_the_ID();
|
||||
}
|
||||
if ( 'categories' === $this->source ) {
|
||||
$this->object_id = intval( $this->object_id );
|
||||
}
|
||||
if ( 'post' === $this->source ) {
|
||||
$this->object_id = intval( $this->attachment_id );
|
||||
}
|
||||
if ( 'custom' === $this->source ) {
|
||||
$this->object_id = intval( $this->attachment_id );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Object Link
|
||||
*/
|
||||
public function set_object_link() {
|
||||
if ( 'projects' === $this->source ) {
|
||||
$this->object_link = get_permalink( get_the_ID() );
|
||||
}
|
||||
if ( 'categories' === $this->source ) {
|
||||
$this->object_link = get_term_link( $this->object_id );
|
||||
|
||||
if ( empty( sight_is_archive() ) ) {
|
||||
$this->object_link = null;
|
||||
}
|
||||
}
|
||||
if ( 'post' === $this->source ) {
|
||||
$this->object_link = get_attachment_link( $this->attachment_id );
|
||||
}
|
||||
if ( 'custom' === $this->source ) {
|
||||
$this->object_link = get_attachment_link( $this->attachment_id );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Id
|
||||
*/
|
||||
public function set_attachment_id() {
|
||||
if ( 'projects' === $this->source ) {
|
||||
$this->attachment_id = get_post_thumbnail_id();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Lightbox
|
||||
*/
|
||||
public function set_attachment_lightbox() {
|
||||
if ( ! isset( $this->attributes['attachment_lightbox'] ) || ! $this->attributes['attachment_lightbox'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->attachment_lightbox = true;
|
||||
}
|
||||
/**
|
||||
* Set Attachment Lightbox Icon
|
||||
*/
|
||||
public function set_attachment_lightbox_icon() {
|
||||
if ( ! isset( $this->attributes['attachment_lightbox'] ) || ! $this->attributes['attachment_lightbox'] ) {
|
||||
return;
|
||||
}
|
||||
if ( ! isset( $this->attributes['attachment_lightbox_icon'] ) || ! $this->attributes['attachment_lightbox_icon'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->attachment_lightbox_icon = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Link
|
||||
*/
|
||||
public function set_attachment_link() {
|
||||
$this->attachment_link = wp_get_attachment_image_url( $this->attachment_id, $this->attributes['attachment_size'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Full Link
|
||||
*/
|
||||
public function set_attachment_full_link() {
|
||||
$this->attachment_full_link = wp_get_attachment_image_url( $this->attachment_id, 'full' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Html
|
||||
*/
|
||||
public function set_attachment_html() {
|
||||
$attrs = apply_filters( 'sight_portfolio_attachment_attrs', array(), $this->attributes );
|
||||
|
||||
$this->attachment_html = wp_get_attachment_image( $this->attachment_id, $this->attributes['attachment_size'], false, $attrs );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Link To
|
||||
*/
|
||||
public function set_attachment_link_to() {
|
||||
if ( isset( $this->attributes['attachment_link_to'] ) && $this->attributes['attachment_link_to'] ) {
|
||||
$this->attachment_link_to = $this->attributes['attachment_link_to'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment View More
|
||||
*/
|
||||
public function set_attachment_view_more() {
|
||||
if ( isset( $this->attributes['attachment_view_more'] ) && $this->attributes['attachment_view_more'] ) {
|
||||
$this->attachment_view_more = $this->attributes['attachment_view_more'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment View More Label
|
||||
*/
|
||||
public function set_attachment_view_more_label() {
|
||||
switch ( $this->attachment_link_to ) {
|
||||
case 'media':
|
||||
$this->attachment_view_more_label = apply_filters( 'sight_portfolio_view_more', esc_html__( 'View Media', 'sight' ), $this );
|
||||
break;
|
||||
case 'page':
|
||||
$this->attachment_view_more_label = apply_filters( 'sight_portfolio_view_more', esc_html__( 'View Project', 'sight' ), $this );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Title
|
||||
*/
|
||||
public function set_attachment_title() {
|
||||
if ( ! isset( $this->attributes['meta_title'] ) || ! $this->attributes['meta_title'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'projects' === $this->source ) {
|
||||
$this->attachment_title = get_the_title( $this->object_id );
|
||||
}
|
||||
if ( 'categories' === $this->source ) {
|
||||
$this->attachment_title = get_term( $this->object_id, 'sight-categories' )->name;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set Attachment Title Tag
|
||||
*/
|
||||
public function set_attachment_title_tag() {
|
||||
if ( ! isset( $this->attributes['meta_title'] ) || ! $this->attributes['meta_title'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isset( $this->attributes['typography_heading_tag'] ) && $this->attributes['typography_heading_tag'] ) {
|
||||
$this->attachment_title_tag = $this->attributes['typography_heading_tag'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Meta
|
||||
*/
|
||||
public function set_attachment_meta() {
|
||||
ob_start();
|
||||
|
||||
// Meta Category.
|
||||
if ( isset( $this->attributes['meta_category'] ) && $this->attributes['meta_category'] ) {
|
||||
|
||||
if ( 'projects' === $this->source ) {
|
||||
|
||||
$terms_list = array();
|
||||
|
||||
$terms = get_the_terms( $this->object_id, 'sight-categories' );
|
||||
|
||||
foreach ( $terms as $term ) {
|
||||
if ( sight_is_archive() ) {
|
||||
$link = get_term_link( $term );
|
||||
|
||||
if ( ! is_wp_error( $link ) ) {
|
||||
$terms_list[] = '<a class="sight-portfolio-meta-item" href="' . esc_url( $link ) . '" rel="tag">' . $term->name . '</a>';
|
||||
}
|
||||
} else {
|
||||
$terms_list[] = '<span class="sight-portfolio-meta-item">' . $term->name . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if ( $terms_list ) {
|
||||
?>
|
||||
<div class="sight-portfolio-meta-category">
|
||||
<?php call_user_func( 'printf', '%s', join( '', $terms_list ) ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Meta Date.
|
||||
if ( isset( $this->attributes['meta_date'] ) && $this->attributes['meta_date'] ) {
|
||||
?>
|
||||
<div class="sight-portfolio-meta-date">
|
||||
<?php call_user_func( 'printf', '%s', get_the_date( '', $this->object_id ) ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
$this->attachment_meta = ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Caption
|
||||
*/
|
||||
public function set_attachment_caption() {
|
||||
if ( ! isset( $this->attributes['meta_caption'] ) || ! $this->attributes['meta_caption'] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'projects' === $this->source ) {
|
||||
$this->attachment_caption = sight_get_the_excerpt( $this->attributes['meta_caption_length'] );
|
||||
}
|
||||
if ( 'categories' === $this->source ) {
|
||||
$this->attachment_caption = sight_str_truncate( term_description( $this->object_id ), $this->attributes['meta_caption_length'] );
|
||||
}
|
||||
if ( 'custom' === $this->source ) {
|
||||
$this->attachment_caption = sight_str_truncate( wp_get_attachment_caption( $this->attachment_id ), $this->attributes['meta_caption_length'] );
|
||||
}
|
||||
if ( 'post' === $this->source ) {
|
||||
$this->attachment_caption = sight_str_truncate( wp_get_attachment_caption( $this->attachment_id ), $this->attributes['meta_caption_length'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Attachment Orientation
|
||||
*/
|
||||
public function set_attachment_orientation() {
|
||||
if ( isset( $this->attributes['attachment_orientation'] ) && $this->attributes['attachment_orientation'] ) {
|
||||
$this->attachment_orientation = sprintf( 'sight-portfolio-overlay-ratio sight-portfolio-ratio-%s', $this->attributes['attachment_orientation'] );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Item Content
|
||||
*/
|
||||
public function has_item_content() {
|
||||
$has_item_content = false;
|
||||
|
||||
if ( $this->attachment_title ) {
|
||||
$has_item_content = true;
|
||||
}
|
||||
if ( $this->attachment_meta ) {
|
||||
$has_item_content = true;
|
||||
}
|
||||
if ( $this->attachment_caption ) {
|
||||
$has_item_content = true;
|
||||
}
|
||||
|
||||
return apply_filters( 'sight_entry_has_item_content', $has_item_content, $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile Item Class
|
||||
*
|
||||
* @param string $class The class of entry.
|
||||
*/
|
||||
public function item_class( $class = array() ) {
|
||||
$classes = array();
|
||||
|
||||
if ( $class ) {
|
||||
if ( ! is_array( $class ) ) {
|
||||
$class = preg_split( '#\s+#', $class );
|
||||
}
|
||||
$classes = array_map( 'esc_attr', $class );
|
||||
} else {
|
||||
// Ensure that we always coerce class to being an array.
|
||||
$class = array();
|
||||
}
|
||||
|
||||
// Set individual class.
|
||||
$classes[] = 'sight-portfolio-entry sight-portfolio-video-wrap';
|
||||
|
||||
// Set entry source.
|
||||
if ( $this->source ) {
|
||||
$classes[] = 'sight-portfolio-entry-' . $this->source;
|
||||
}
|
||||
|
||||
// Set entry object id.
|
||||
if ( $this->object_id ) {
|
||||
$classes[] = 'sight-portfolio-entry-' . $this->object_id;
|
||||
}
|
||||
|
||||
// Set entry link to.
|
||||
if ( $this->attachment_link_to ) {
|
||||
$classes[] = 'sight-portfolio-entry-link-' . $this->attachment_link_to;
|
||||
}
|
||||
|
||||
// Set entry request class.
|
||||
if ( 'standard' === $this->attributes['layout'] ) {
|
||||
|
||||
if ( isset( $_REQUEST['action'] ) && 'sight_portfolio_ajax_load_more' === $_REQUEST['action'] ) {
|
||||
$classes[] = 'sight-portfolio-entry-request';
|
||||
}
|
||||
}
|
||||
|
||||
// For projects.
|
||||
if ( 'projects' === $this->source ) {
|
||||
$post = get_post( get_the_ID() );
|
||||
|
||||
$classes[] = 'type-' . $post->post_type;
|
||||
$classes[] = 'status-' . $post->post_status;
|
||||
|
||||
// Post thumbnails.
|
||||
if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) && ! is_attachment( $post ) ) {
|
||||
$classes[] = 'has-post-thumbnail';
|
||||
}
|
||||
}
|
||||
|
||||
call_user_func( 'printf', 'class="%s"', join( ' ', $classes ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile Item Outer Class
|
||||
*
|
||||
* @param string $class The class of entry.
|
||||
*/
|
||||
public function item_outer_class( $class = array() ) {
|
||||
$classes = array();
|
||||
|
||||
if ( $class ) {
|
||||
if ( ! is_array( $class ) ) {
|
||||
$class = preg_split( '#\s+#', $class );
|
||||
}
|
||||
$classes = array_map( 'esc_attr', $class );
|
||||
} else {
|
||||
// Ensure that we always coerce class to being an array.
|
||||
$class = array();
|
||||
}
|
||||
|
||||
// Set individual class.
|
||||
$classes[] = 'sight-portfolio-entry-outer';
|
||||
|
||||
call_user_func( 'printf', 'class="%s"', join( ' ', $classes ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile Item Attachment
|
||||
*/
|
||||
public function item_attachment() {
|
||||
if ( ! $this->attachment_html ) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( $this->attachment_link_to ) {
|
||||
case 'media':
|
||||
$attachment_link = $this->attachment_full_link;
|
||||
break;
|
||||
case 'page':
|
||||
$attachment_link = $this->object_link;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $this->attachment_lightbox ) {
|
||||
$attachment_link = $this->attachment_full_link;
|
||||
}
|
||||
?>
|
||||
<div class="sight-portfolio-entry__inner sight-portfolio-entry__thumbnail sight-portfolio-entry__overlay <?php echo esc_attr( $this->attachment_orientation ); ?>">
|
||||
<figure class="sight-portfolio-overlay-background">
|
||||
<?php do_action( 'sight_entry_item_attachment_before', $this ); ?>
|
||||
|
||||
<?php call_user_func( 'printf', '%s', $this->attachment_html ); ?>
|
||||
|
||||
<?php do_action( 'sight_entry_item_attachment_after', $this ); ?>
|
||||
|
||||
<?php
|
||||
if ( $this->attachment_view_more ) {
|
||||
?>
|
||||
<span class="sight-portfolio-view-more">
|
||||
<span class="sight-portfolio-view-more-label">
|
||||
<?php echo esc_html( $this->attachment_view_more_label ); ?>
|
||||
</span>
|
||||
</span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( isset( $this->attributes['video'] ) && $this->attributes['video'] && 'none' !== $this->attributes['video'] ) {
|
||||
sight_get_video_background( $this->attributes['video'], null, null, 'default', (bool) $this->attributes['video_controls'] );
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( isset( $attachment_link ) ) {
|
||||
?>
|
||||
<a class="sight-portfolio-overlay-link" href="<?php echo esc_url( $attachment_link ); ?>"></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ( $this->attachment_lightbox_icon ) {
|
||||
?>
|
||||
<span class="sight-zoom-icon-popup"></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</figure>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile Item Content
|
||||
*/
|
||||
public function item_content() {
|
||||
if ( $this->has_item_content() ) {
|
||||
?>
|
||||
<div class="sight-portfolio-entry__inner sight-portfolio-entry__content">
|
||||
<?php do_action( 'sight_entry_item_content_before', $this ); ?>
|
||||
|
||||
<?php if ( $this->attachment_title ) { ?>
|
||||
<div class="sight-portfolio-entry__title">
|
||||
<?php if ( $this->object_link ) { ?>
|
||||
<<?php echo esc_html( $this->attachment_title_tag ); ?> class="sight-portfolio-entry__heading">
|
||||
<a href="<?php echo esc_url( $this->object_link ); ?>">
|
||||
<?php echo wp_kses( $this->attachment_title, 'post' ); ?>
|
||||
</a>
|
||||
</<?php echo esc_html( $this->attachment_title_tag ); ?>>
|
||||
<?php } else { ?>
|
||||
<<?php echo esc_html( $this->attachment_title_tag ); ?> class="sight-portfolio-entry__heading">
|
||||
<?php echo wp_kses( $this->attachment_title, 'post' ); ?>
|
||||
</<?php echo esc_html( $this->attachment_title_tag ); ?>>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $this->attachment_meta ) { ?>
|
||||
<div class="sight-portfolio-entry__meta">
|
||||
<?php echo wp_kses( $this->attachment_meta, 'post' ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( $this->attachment_caption ) { ?>
|
||||
<div class="sight-portfolio-entry__caption">
|
||||
<?php echo wp_kses( $this->attachment_caption, 'post' ); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php do_action( 'sight_entry_item_content_after', $this ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
<?php
|
||||
/**
|
||||
* Portfolio Load More Posts via AJAX.
|
||||
*
|
||||
* @package sight
|
||||
*/
|
||||
|
||||
/**
|
||||
* Processing data query for load more
|
||||
*
|
||||
* @param string $method Processing method $wp_query.
|
||||
* @param array $data Data array.
|
||||
*/
|
||||
function sight_portfolio_load_more_query_data( $method = 'get', $data = array() ) {
|
||||
global $wp_query;
|
||||
|
||||
$output = array();
|
||||
|
||||
$vars = array(
|
||||
'in_the_loop',
|
||||
'is_single',
|
||||
'is_page',
|
||||
'is_archive',
|
||||
'is_author',
|
||||
'is_category',
|
||||
'is_tag',
|
||||
'is_tax',
|
||||
'is_home',
|
||||
'is_singular',
|
||||
'is_post_query',
|
||||
);
|
||||
|
||||
if ( 'get' === $method ) {
|
||||
$output = $data;
|
||||
}
|
||||
|
||||
foreach ( $vars as $variable ) {
|
||||
if ( ! isset( $wp_query->$variable ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( 'get' === $method ) {
|
||||
$output[ $variable ] = $wp_query->$variable;
|
||||
}
|
||||
if ( ! isset( $data[ $variable ] ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( 'init' === $method ) {
|
||||
$wp_query->$variable = $data[ $variable ];
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'get' === $method ) {
|
||||
$output = apply_filters( 'ajax_query_args', $output );
|
||||
}
|
||||
|
||||
return wp_json_encode( $output );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get load more args.
|
||||
*
|
||||
* @param array $data The data.
|
||||
* @param array $attributes The attributes.
|
||||
* @param array $options The options.
|
||||
*/
|
||||
function sight_portfolio_get_load_more_args( $data, $attributes = false, $options = false ) {
|
||||
// Ajax Type.
|
||||
$ajax_type = version_compare( get_bloginfo( 'version' ), '4.7', '>=' ) ? 'ajax_restapi' : 'ajax';
|
||||
|
||||
$ajax_type = apply_filters( 'ajax_load_more_method', $ajax_type );
|
||||
|
||||
$args = array(
|
||||
'type' => $ajax_type,
|
||||
'nonce' => wp_create_nonce(),
|
||||
'url' => admin_url( 'admin-ajax.php' ),
|
||||
'rest_url' => esc_url( get_rest_url( null, '/sight/v1/portfolio-more-posts' ) ),
|
||||
'posts_per_page' => get_query_var( 'posts_per_page' ),
|
||||
'query_data' => sight_portfolio_load_more_query_data( 'get', $data ),
|
||||
'attributes' => wp_json_encode( $attributes ),
|
||||
'options' => wp_json_encode( $options ),
|
||||
'max_num_pages' => $data['max_num_pages'],
|
||||
'pagination_type' => $data['pagination_type'],
|
||||
'translation' => array(
|
||||
'load_more' => esc_html__( 'Load more', 'sight' ),
|
||||
'loading' => esc_html__( 'Loading', 'sight' ),
|
||||
),
|
||||
);
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after the query variable object is created, but before the actual query is run.
|
||||
*
|
||||
* @param object $wp_query WP Query.
|
||||
*/
|
||||
function sight_portfolio_pre_get_posts( &$wp_query ) {
|
||||
|
||||
if ( isset( $wp_query->query['is_sight_query'] ) ) {
|
||||
$offset = (int) $wp_query->get( 'offset' );
|
||||
$paged = (int) $wp_query->get( 'paged' );
|
||||
$posts_per_page = (int) $wp_query->get( 'posts_per_page' );
|
||||
|
||||
if ( $wp_query->is_paged ) {
|
||||
$page_offset = $offset + ( ( $paged - 1 ) * $posts_per_page );
|
||||
|
||||
$wp_query->set( 'offset', $page_offset );
|
||||
} else {
|
||||
$wp_query->set( 'offset', $offset );
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'pre_get_posts', 'sight_portfolio_pre_get_posts', 1 );
|
||||
|
||||
/**
|
||||
* Filters the number of found posts for the query.
|
||||
*
|
||||
* @param int $found_posts The number of posts found.
|
||||
* @param object $wp_query WP Query.
|
||||
*/
|
||||
function sight_portfolio_found_posts( $found_posts, $wp_query ) {
|
||||
|
||||
if ( isset( $wp_query->query['is_sight_query'] ) ) {
|
||||
|
||||
$offset = isset( $wp_query->query['offset'] ) ? $wp_query->query['offset'] : 0;
|
||||
|
||||
$found_posts = (int) $found_posts - (int) $offset;
|
||||
}
|
||||
|
||||
return $found_posts;
|
||||
}
|
||||
add_filter( 'found_posts', 'sight_portfolio_found_posts', 1, 2 );
|
||||
|
||||
/**
|
||||
* Get More Posts
|
||||
*/
|
||||
function sight_portfolio_load_more_posts() {
|
||||
|
||||
$posts_end = false;
|
||||
|
||||
// Response default.
|
||||
$response = array(
|
||||
'page' => 2,
|
||||
'posts_per_page' => 10,
|
||||
'query_data' => array(),
|
||||
);
|
||||
|
||||
if ( wp_doing_ajax() ) {
|
||||
check_ajax_referer();
|
||||
}
|
||||
|
||||
// Set response values of ajax query.
|
||||
if ( isset( $_POST['page'] ) && $_POST['page'] ) { // Input var ok.
|
||||
$response['page'] = sanitize_key( $_POST['page'] ); // Input var ok; sanitization ok.
|
||||
}
|
||||
if ( isset( $_POST['posts_per_page'] ) && $_POST['posts_per_page'] ) { // Input var ok.
|
||||
$response['posts_per_page'] = sanitize_key( $_POST['posts_per_page'] ); // Input var ok; sanitization ok.
|
||||
}
|
||||
if ( isset( $_POST['query_data'] ) && $_POST['query_data'] ) { // Input var ok.
|
||||
$response['query_data'] = map_deep( json_decode( stripslashes( $_POST['query_data'] ), true ), 'sanitize_text_field' ); // Input var ok; sanitization ok.
|
||||
}
|
||||
if ( isset( $_POST['attributes'] ) && $_POST['attributes'] ) { // Input var ok.
|
||||
$response['attributes'] = map_deep( json_decode( stripslashes( $_POST['attributes'] ), true ), 'sanitize_text_field' ); // Input var ok; sanitization ok.
|
||||
}
|
||||
if ( isset( $_POST['options'] ) && $_POST['options'] ) { // Input var ok.
|
||||
$response['options'] = map_deep( json_decode( stripslashes( $_POST['options'] ), true ), 'sanitize_text_field' ); // Input var ok; sanitization ok.
|
||||
}
|
||||
|
||||
// Set Query Vars.
|
||||
$query_vars = array_merge(
|
||||
(array) $response['query_data']['query_vars'],
|
||||
array(
|
||||
'is_sight_query' => true,
|
||||
'paged' => (int) $response['page'],
|
||||
'posts_per_page' => (int) $response['posts_per_page'],
|
||||
)
|
||||
);
|
||||
|
||||
// Supportfolio filtering for wp authors.
|
||||
if ( $response['query_data']['is_author'] && $query_vars['author'] ) {
|
||||
$query_vars['supportfolio_filters'] = true;
|
||||
}
|
||||
|
||||
$attributes = $response['attributes'];
|
||||
$options = $response['options'];
|
||||
|
||||
// Get Posts.
|
||||
ob_start();
|
||||
|
||||
if ( isset( $_POST['terms'] ) && $_POST['terms'] ) { // Input var ok.
|
||||
$terms = array_map( 'sanitize_text_field', $_POST['terms'] ); // Input var ok; sanitization ok.
|
||||
|
||||
if ( $terms ) {
|
||||
$query_vars['tax_query'] = array();
|
||||
|
||||
$query_vars['tax_query'][] = array(
|
||||
'taxonomy' => 'sight-categories',
|
||||
'field' => 'slug',
|
||||
'terms' => $terms,
|
||||
);
|
||||
|
||||
$query_vars['tax_query']['relation'] = 'AND';
|
||||
}
|
||||
}
|
||||
|
||||
$the_query = new WP_Query( $query_vars );
|
||||
|
||||
$global_name = 'wp_query';
|
||||
|
||||
$GLOBALS[ $global_name ] = $the_query;
|
||||
|
||||
sight_portfolio_load_more_query_data( 'init', $response['query_data'] );
|
||||
|
||||
if ( $the_query->have_posts() ) :
|
||||
|
||||
// Set query vars, so that we can get them across all templates.
|
||||
set_query_var( 'sight_query', $response['query_data'] );
|
||||
|
||||
// Get total number of posts.
|
||||
$total = $the_query->post_count;
|
||||
|
||||
while ( $the_query->have_posts() ) :
|
||||
$the_query->the_post();
|
||||
|
||||
// Start counting posts.
|
||||
$current = $the_query->current_post + 1 + $query_vars['posts_per_page'] * $query_vars['paged'] - $query_vars['posts_per_page'];
|
||||
|
||||
// Check End of posts.
|
||||
if ( $the_query->found_posts - $current <= 0 ) {
|
||||
$posts_end = true;
|
||||
}
|
||||
|
||||
$portfolio_entry = new Sight_Entry( $attributes, $options );
|
||||
|
||||
// Init portfolio entry.
|
||||
$portfolio_entry->init();
|
||||
|
||||
// Get item project.
|
||||
require apply_filters( 'sight_portfolio_item_path', SIGHT_PATH . 'render/handler/portfolio-entry.php', $attributes, $options, $portfolio_entry );
|
||||
|
||||
endwhile;
|
||||
|
||||
endif;
|
||||
|
||||
wp_reset_postdata();
|
||||
|
||||
$content = ob_get_clean();
|
||||
|
||||
if ( ! $content ) {
|
||||
$posts_end = true;
|
||||
}
|
||||
|
||||
// Return Result.
|
||||
$result = array(
|
||||
'posts_end' => $posts_end,
|
||||
'content' => $content,
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX Load More
|
||||
*/
|
||||
function sight_portfolio_ajax_load_more() {
|
||||
|
||||
// Check Nonce.
|
||||
check_ajax_referer();
|
||||
|
||||
// Get Posts.
|
||||
$data = sight_portfolio_load_more_posts();
|
||||
|
||||
// Return Result.
|
||||
wp_send_json_success( $data );
|
||||
|
||||
}
|
||||
add_action( 'wp_ajax_sight_portfolio_ajax_load_more', 'sight_portfolio_ajax_load_more' );
|
||||
add_action( 'wp_ajax_nopriv_sight_portfolio_ajax_load_more', 'sight_portfolio_ajax_load_more' );
|
||||
|
||||
|
||||
/**
|
||||
* More Posts API Response
|
||||
*
|
||||
* @param array $request REST API Request.
|
||||
*/
|
||||
function sight_portfolio_more_posts_restapi( $request ) {
|
||||
|
||||
// Get Data.
|
||||
$data = array(
|
||||
'success' => true,
|
||||
'data' => sight_portfolio_load_more_posts(),
|
||||
);
|
||||
|
||||
// Return Result.
|
||||
return rest_ensure_response( $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register REST More Posts Routes
|
||||
*/
|
||||
function sight_portfolio_register_more_posts_route() {
|
||||
|
||||
register_rest_route(
|
||||
'sight/v1',
|
||||
'/portfolio-more-posts',
|
||||
array(
|
||||
'methods' => WP_REST_Server::CREATABLE,
|
||||
'callback' => 'sight_portfolio_more_posts_restapi',
|
||||
'permission_callback' => function() {
|
||||
return true;
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'rest_api_init', 'sight_portfolio_register_more_posts_route' );
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
/**
|
||||
* Render Front End.
|
||||
*
|
||||
* @link https://codesupply.co
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @package Sight
|
||||
*/
|
||||
|
||||
/**
|
||||
* The initialize block.
|
||||
*/
|
||||
class Sight_Frontend_Render {
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||
add_filter( 'powerkit_pinit_exclude_selectors', array( $this, 'sight_pinit_exclude_selector' ) );
|
||||
add_filter( 'powerkit_lightbox_exclude_selectors', array( $this, 'sight_lightbox_exclude_selector' ) );
|
||||
add_filter( 'pk_toc_exclude', array( $this, 'sight_toc_exclude_selectors' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue the block's assets for the editor.
|
||||
*/
|
||||
public function enqueue_scripts() {
|
||||
|
||||
// Scripts.
|
||||
wp_register_script(
|
||||
'magnific-popup',
|
||||
SIGHT_URL . 'render/js/jquery.magnific-popup.min.js',
|
||||
array( 'jquery', 'imagesloaded' ),
|
||||
filemtime( SIGHT_PATH . 'render/js/jquery.magnific-popup.min.js' ),
|
||||
true
|
||||
);
|
||||
|
||||
wp_register_script(
|
||||
'sight-block-script',
|
||||
SIGHT_URL . 'render/js/sight.js',
|
||||
array( 'jquery', 'imagesloaded', 'magnific-popup' ),
|
||||
filemtime( SIGHT_PATH . 'render/js/sight.js' ),
|
||||
true
|
||||
);
|
||||
|
||||
wp_enqueue_script( 'sight-block-script' );
|
||||
|
||||
wp_localize_script( 'sight-block-script', 'sight_lightbox_localize', array(
|
||||
'text_previous' => esc_html__( 'Previous', 'sight' ),
|
||||
'text_next' => esc_html__( 'Next', 'sight' ),
|
||||
'text_close' => esc_html__( 'Close', 'sight' ),
|
||||
'text_loading' => esc_html__( 'Loading', 'sight' ),
|
||||
'text_counter' => esc_html__( 'of', 'sight' ),
|
||||
) );
|
||||
|
||||
// Styles.
|
||||
wp_enqueue_style(
|
||||
'magnific-popup',
|
||||
SIGHT_URL . 'render/css/magnific-popup.css',
|
||||
array(),
|
||||
filemtime( SIGHT_PATH . 'render/css/magnific-popup.css' )
|
||||
);
|
||||
|
||||
wp_enqueue_style(
|
||||
'sight',
|
||||
SIGHT_URL . 'render/css/sight.css',
|
||||
array(),
|
||||
filemtime( SIGHT_PATH . 'render/css/sight.css' )
|
||||
);
|
||||
|
||||
wp_enqueue_style(
|
||||
'sight-common',
|
||||
SIGHT_URL . 'render/css/sight-common.css',
|
||||
array(),
|
||||
filemtime( SIGHT_PATH . 'render/css/sight-common.css' )
|
||||
);
|
||||
|
||||
wp_enqueue_style(
|
||||
'sight-lightbox',
|
||||
SIGHT_URL . 'render/css/sight-lightbox.css',
|
||||
array(),
|
||||
filemtime( SIGHT_PATH . 'render/css/sight-lightbox.css' )
|
||||
);
|
||||
|
||||
wp_enqueue_style(
|
||||
'sight-layout-standard',
|
||||
SIGHT_URL . 'render/css/sight-layout-standard.css',
|
||||
array(),
|
||||
filemtime( SIGHT_PATH . 'render/css/sight-layout-standard.css' )
|
||||
);
|
||||
|
||||
wp_style_add_data( 'sight', 'rtl', 'replace' );
|
||||
wp_style_add_data( 'sight-common', 'rtl', 'replace' );
|
||||
wp_style_add_data( 'sight-layout-standard', 'rtl', 'replace' );
|
||||
}
|
||||
|
||||
/**
|
||||
* PinIt exclude selectors
|
||||
*
|
||||
* @param string $selectors List selectors.
|
||||
*/
|
||||
public function sight_pinit_exclude_selector( $selectors ) {
|
||||
$selectors[] = '.sight-portfolio-entry-link-page';
|
||||
|
||||
return $selectors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Powerkit Lightbox exclude selector
|
||||
*
|
||||
* @param string $selectors List selectors.
|
||||
*/
|
||||
public function sight_lightbox_exclude_selector( $selectors ) {
|
||||
$selectors[] = '.sight-portfolio-area';
|
||||
|
||||
return $selectors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add exclude selectors of TOC
|
||||
*
|
||||
* @param string $list List selectors.
|
||||
*/
|
||||
public function sight_toc_exclude_selectors( $list ) {
|
||||
$list .= '|.sight-portfolio-entry__heading';
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
new Sight_Frontend_Render();
|
||||
Reference in New Issue
Block a user