File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ let thumb
23
23
class ="flex w-full rounded-[1px] transition {FOCUS_OUTLINE }"
24
24
type =" button"
25
25
class:opacity- 50={isHidden }
26
- style:aspect-ratio ={aspectRatio }
27
26
on:click ={onClick }
28
27
>
29
28
<ObserveIntersection once element ={thumb } threshold ={0.45 } let:intersecting >
@@ -32,6 +31,7 @@ let thumb
32
31
class:opacity- 0={!intersecting }
33
32
class:translate-y- 6={!intersecting }
34
33
class:delay- 75={isDelayed }
34
+ style:aspect-ratio ={aspectRatio }
35
35
bind:this ={thumb }
36
36
>
37
37
<img
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ let masonryElement
22
22
23
23
export const refreshLayout = async () => {
24
24
/* Get the post relayout number of columns */
25
+ console .log (' COLS' , getComputedStyle (grid ._el ).gridTemplateColumns )
25
26
let ncol = getComputedStyle (grid ._el ).gridTemplateColumns .split (' ' ).length
26
27
let gap = Number .parseFloat (getComputedStyle (grid ._el ).gap )
27
28
@@ -69,7 +70,7 @@ const calcGrid = async (element) => {
69
70
_el: element,
70
71
gap: Number .parseFloat (getComputedStyle (element).gap ),
71
72
// @ts-ignore
72
- items: [... element .children ].filter (
73
+ items: [... element .childNodes ].filter (
73
74
(c ) =>
74
75
c .nodeType === 1 &&
75
76
Number (getComputedStyle (c).gridColumnEnd ) !== - 1 ,
@@ -105,19 +106,14 @@ $: if (items) {
105
106
}
106
107
< / script>
107
108
108
- < div
109
- bind: this = {masonryElement}
110
- class = " masonry-grid grid place-items-center {gapClass}"
111
- >
109
+ < div bind: this = {masonryElement} class = " masonry-grid grid {gapClass}" >
112
110
< slot / >
113
111
< / div>
114
112
115
113
< style>
116
114
.masonry - grid {
117
115
grid: 1fr auto / repeat (2 , 1fr );
118
116
grid: masonry / repeat (2 , 1fr );
119
- }
120
- .masonry - grid > : global (* ) {
121
- align- self : start;
117
+ align- items: start;
122
118
}
123
119
< / style>
You can’t perform that action at this time.
0 commit comments