Changeset 3355919
- Timestamp:
- 09/04/2025 09:46:54 AM (7 months ago)
- Location:
- luzuk-photo-gallery
- Files:
-
- 38 added
- 3 deleted
- 5 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/css (added)
-
tags/1.0.1/assets/css/admin.css (added)
-
tags/1.0.1/assets/css/bootstrap.min.css (added)
-
tags/1.0.1/assets/css/ekko-lightbox.css (added)
-
tags/1.0.1/assets/css/frontend.css (added)
-
tags/1.0.1/assets/css/lightbox.css (added)
-
tags/1.0.1/assets/css/style.css (added)
-
tags/1.0.1/assets/js (added)
-
tags/1.0.1/assets/js/admin.js (added)
-
tags/1.0.1/assets/js/bootstrap.min.js (added)
-
tags/1.0.1/assets/js/ekko-lightbox.js (added)
-
tags/1.0.1/assets/js/frontend.js (added)
-
tags/1.0.1/assets/js/lightbox.js (added)
-
tags/1.0.1/assets/js/luzukphoto.min.js (added)
-
tags/1.0.1/assets/js/popper.min.js (added)
-
tags/1.0.1/blocks (added)
-
tags/1.0.1/blocks/gallery (added)
-
tags/1.0.1/blocks/gallery/block.json (added)
-
tags/1.0.1/blocks/gallery/editor.css (added)
-
tags/1.0.1/blocks/gallery/index.js (added)
-
tags/1.0.1/images (added)
-
tags/1.0.1/images/default.png (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-lzg-admin-menu.php (added)
-
tags/1.0.1/includes/class-lzg-assets.php (added)
-
tags/1.0.1/includes/class-lzg-block.php (added)
-
tags/1.0.1/includes/class-lzg-cpt.php (added)
-
tags/1.0.1/includes/class-lzg-metabox.php (added)
-
tags/1.0.1/includes/class-lzg-plugin.php (added)
-
tags/1.0.1/includes/class-lzg-render.php (added)
-
tags/1.0.1/includes/class-lzg-rest.php (added)
-
tags/1.0.1/includes/class-lzg-settings.php (added)
-
tags/1.0.1/includes/class-lzg-shortcode.php (added)
-
tags/1.0.1/includes/helpers.php (added)
-
tags/1.0.1/luzuk-photo-gallery.php (added)
-
tags/1.0.1/readme.txt (added)
-
trunk/MASONRY-FIX-README.md (deleted)
-
trunk/assets/css/frontend.css (modified) (1 diff)
-
trunk/assets/js/ev-emitter.js (deleted)
-
trunk/assets/js/frontend.js (modified) (1 diff)
-
trunk/assets/js/masonry.min.js (deleted)
-
trunk/includes/class-lzg-assets.php (modified) (1 diff)
-
trunk/luzuk-photo-gallery.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
luzuk-photo-gallery/trunk/assets/css/frontend.css
r3355792 r3355919 3 3 .lzg-layout-grid .lzg-items{grid-template-columns:repeat(var(--lzg-cols),1fr)} 4 4 .lzg-layout-justified .lzg-items{grid-auto-rows:1fr} 5 .lzg-layout-masonry .lzg-items{position:relative;display:block} 6 .lzg-layout-masonry .lzg-item{position:absolute;width:calc((100% - (var(--lzg-gutter) * (var(--lzg-cols) - 1)) / var(--lzg-cols))} 5 .lzg-layout-masonry .lzg-items{display:block;column-count:var(--lzg-cols);column-gap:var(--lzg-gutter)} 6 .lzg-layout-masonry .lzg-item{break-inside:avoid;page-break-inside:avoid;-webkit-column-break-inside:avoid;-moz-column-break-inside:avoid;margin-bottom:var(--lzg-gutter)} 7 .lzg-layout-masonry .lzg-img{width:100%;height:auto;object-fit:initial} 7 8 .lzg-item{position:relative;overflow:hidden;border-radius:var(--lzg-radius)} 8 9 .lzg-img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .3s ease,opacity .3s ease} -
luzuk-photo-gallery/trunk/assets/js/frontend.js
r3355792 r3355919 13 13 }); 14 14 15 // Masonry layout initialization16 document.querySelectorAll('.lzg-layout-masonry .lzg-items').forEach(function(container){17 // Wait for images to load before initializing masonry18 var images = container.querySelectorAll('.lzg-img');19 var loadedImages = 0;20 21 if (images.length === 0) {22 // No images, initialize immediately23 initMasonry(container);24 } else {25 // Wait for all images to load26 images.forEach(function(img){27 if (img.complete) {28 loadedImages++;29 if (loadedImages === images.length) {30 initMasonry(container);31 }32 } else {33 img.addEventListener('load', function(){34 loadedImages++;35 if (loadedImages === images.length) {36 initMasonry(container);37 }38 });39 img.addEventListener('error', function(){40 loadedImages++;41 if (loadedImages === images.length) {42 initMasonry(container);43 }44 });45 }46 });47 }48 });49 50 // Initialize masonry layout51 function initMasonry(container) {52 if (typeof window.Masonry !== 'undefined') {53 // Use the Masonry library if available54 new window.Masonry(container, {55 itemSelector: '.lzg-item',56 columnWidth: '.lzg-item',57 percentPosition: true,58 gutter: parseInt(getComputedStyle(container).getPropertyValue('--lzg-gutter')) || 059 });60 } else {61 // Fallback to custom masonry implementation62 initCustomMasonry(container);63 }64 }65 66 // Custom masonry implementation67 function initCustomMasonry(container) {68 var items = container.querySelectorAll('.lzg-item');69 var gutter = parseInt(getComputedStyle(container).getPropertyValue('--lzg-gutter')) || 0;70 var cols = parseInt(getComputedStyle(container).getPropertyValue('--lzg-cols')) || 3;71 72 if (items.length === 0) return;73 74 // Reset container height75 container.style.height = 'auto';76 77 // Calculate item width78 var containerWidth = container.offsetWidth;79 var itemWidth = (containerWidth - (gutter * (cols - 1))) / cols;80 81 // Set item widths82 items.forEach(function(item){83 item.style.width = itemWidth + 'px';84 item.style.position = 'absolute';85 });86 87 // Calculate positions88 var colHeights = new Array(cols).fill(0);89 var positions = [];90 91 items.forEach(function(item, index){92 var col = index % cols;93 var x = col * (itemWidth + gutter);94 var y = colHeights[col];95 96 positions.push({x: x, y: y, item: item});97 98 // Update column height99 colHeights[col] += item.offsetHeight + gutter;100 });101 102 // Apply positions103 positions.forEach(function(pos){104 pos.item.style.left = pos.x + 'px';105 pos.item.style.top = pos.y + 'px';106 });107 108 // Set container height109 var maxHeight = Math.max.apply(null, colHeights);110 container.style.height = maxHeight + 'px';111 }112 113 15 // Lightbox init 114 16 if(typeof window.lzgLightboxInit === 'function'){ -
luzuk-photo-gallery/trunk/includes/class-lzg-assets.php
r3355792 r3355919 53 53 wp_enqueue_style( 'lzg-frontend', LZG_URL . 'assets/css/frontend.css', array(), LZG_VER ); 54 54 wp_enqueue_style( 'lzg-lightbox', LZG_URL . 'assets/css/lightbox.css', array(), LZG_VER ); 55 wp_enqueue_script( 'lzg-ev-emitter', LZG_URL . 'assets/js/ev-emitter.js', array(), LZG_VER, true );56 wp_enqueue_script( 'lzg-masonry', LZG_URL . 'assets/js/masonry.min.js', array( 'lzg-ev-emitter' ), LZG_VER, true );57 55 wp_enqueue_script( 'lzg-lightbox', LZG_URL . 'assets/js/lightbox.js', array(), LZG_VER, true ); 58 wp_enqueue_script( 'lzg-frontend', LZG_URL . 'assets/js/frontend.js', array( 'lzg-masonry'), LZG_VER, true );56 wp_enqueue_script( 'lzg-frontend', LZG_URL . 'assets/js/frontend.js', array(), LZG_VER, true ); 59 57 } 60 58 -
luzuk-photo-gallery/trunk/luzuk-photo-gallery.php
r3355792 r3355919 4 4 * Plugin URI: https://wordpress.org/plugins/luzuk-photo-gallery/ 5 5 * Description: Lightweight, accessible photo gallery with grid, masonry, justified, and carousel layouts. Shortcode and Gutenberg block included. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Author: Luzuk 8 8 * Author URI: https://www.luzuk.com/ -
luzuk-photo-gallery/trunk/readme.txt
r3355792 r3355919 5 5 Tested up to: 6.6 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 = 1.0.0 = 51 51 * Initial release. 52 53 = 1.0.2 = 54 * Fixed some errors. 52 55 53 56 === Luzuk Photo Gallery ===
Note: See TracChangeset
for help on using the changeset viewer.