| Server IP : 167.179.152.94 / Your IP : 216.73.216.169 Web Server : Apache/2.4.66 (Debian) System : Linux 6d8cbb3dc321 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64 User : ( 1000) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/plugins/visual-portfolio/assets/js/ |
Upload File : |
import $ from 'jquery';
const { screenSizes } = window.VPData;
// Init Options.
$(document).on('initOptions.vpf', (event, self) => {
if (event.namespace !== 'vpf') {
return;
}
self.defaults.masonryColumns = 3;
self.defaults.masonryHorizontalOrder = 'false';
if (!self.options.masonryColumns) {
self.options.masonryColumns = self.defaults.masonryColumns;
}
if (!self.options.masonryImagesAspectRatio) {
self.options.masonryImagesAspectRatio =
self.defaults.masonryImagesAspectRatio;
}
});
// Init Layout.
$(document).on('initLayout.vpf', (event, self) => {
if (event.namespace !== 'vpf') {
return;
}
if (self.options.layout !== 'masonry') {
return;
}
// columns.
self.addStyle('.vp-portfolio__item-wrap', {
width: `${100 / self.options.masonryColumns}%`,
});
// calculate responsive.
let count = self.options.masonryColumns - 1;
let currentPoint = Math.min(screenSizes.length - 1, count);
for (; currentPoint >= 0; currentPoint -= 1) {
if (count > 0 && typeof screenSizes[currentPoint] !== 'undefined') {
self.addStyle(
'.vp-portfolio__item-wrap',
{
width: `${100 / count}%`,
},
`screen and (max-width: ${screenSizes[currentPoint]}px)`
);
}
count -= 1;
}
});