diff --git a/src/lib/components/HorizontalScrollPhotoGrid.svelte b/src/lib/components/HorizontalPhotoScroll.svelte similarity index 51% rename from src/lib/components/HorizontalScrollPhotoGrid.svelte rename to src/lib/components/HorizontalPhotoScroll.svelte index a5468a9..f91fcbb 100644 --- a/src/lib/components/HorizontalScrollPhotoGrid.svelte +++ b/src/lib/components/HorizontalPhotoScroll.svelte @@ -1,32 +1,26 @@
- {#each photoItems as item} - {#if isAlbum(item)} - - {item.title} -

{item.title}

-
- {:else} - {@const mediaId = item.id.replace(/^(media|photo)-/, '')} - - {item.alt} - {#if item.caption} -

{item.caption}

- {/if} -
- {/if} + {#each photos as photo} + {@const mediaId = photo.id.replace(/^(media|photo)-/, '')} + + {photo.alt} + {#if showCaptions && photo.caption} +

{photo.caption}

+ {/if} +
{/each}
diff --git a/src/lib/components/MasonryPhotoGrid.svelte b/src/lib/components/MasonryPhotoGrid.svelte index a6d72c3..ce9a29f 100644 --- a/src/lib/components/MasonryPhotoGrid.svelte +++ b/src/lib/components/MasonryPhotoGrid.svelte @@ -1,69 +1,13 @@ - - -
- - {#snippet children({ item })} - - {/snippet} - -
- - + \ No newline at end of file diff --git a/src/lib/components/PhotoGrid.new.svelte b/src/lib/components/PhotoGrid.new.svelte deleted file mode 100644 index 24c801a..0000000 --- a/src/lib/components/PhotoGrid.new.svelte +++ /dev/null @@ -1,246 +0,0 @@ - - -
- {#if columns === 1 || columns === 2} - - {#each columnItems as columnPhotos, colIndex} -
- {#each columnPhotos as item} -
- - {#if showCaptions && !('photos' in item)} -

{item.caption || ''}

- {/if} -
- {/each} -
- {/each} - {:else if columns === 3} - -
- {#each processedItems() as { item, span, columnStart }} -
1} - style={columnStart ? `grid-column-start: ${columnStart};` : ''} - style:grid-column-end={span > 1 ? `span ${span}` : ''} - > - - {#if showCaptions && !('photos' in item)} -

{item.caption || ''}

- {/if} -
- {/each} -
- {:else} - -
- {#each photoItems as item} -
- - {#if showCaptions && !('photos' in item)} -

{item.caption || ''}

- {/if} -
- {/each} -
- {/if} -
- - \ No newline at end of file diff --git a/src/lib/components/PhotoGrid.svelte b/src/lib/components/PhotoGrid.svelte index da01c6a..7d6452e 100644 --- a/src/lib/components/PhotoGrid.svelte +++ b/src/lib/components/PhotoGrid.svelte @@ -1,122 +1,236 @@ -
- {#each photos as photo} -
- {#if onPhotoClick} - - {:else} - - {/if} + + +
+ {#if masonry && masonryConfig()} + {@const config = masonryConfig()} + + + {#snippet children({ item })} +
+ + {#if showCaptions} +

{item.caption || ''}

+ {/if} +
+ {/snippet} +
+ {:else if (columns === 1 || columns === 2 || columns === 3) && !masonry} + + {#each columnPhotos as column, colIndex} +
+ {#each column as photo} +
+ + {#if showCaptions} +

{photo.caption || ''}

+ {/if} +
+ {/each} +
+ {/each} + {:else} + +
+ {#each photos as photo} +
+ + {#if showCaptions} +

{photo.caption || ''}

+ {/if} +
+ {/each}
- {/each} + {/if}
+ \ No newline at end of file diff --git a/src/lib/components/SingleColumnPhotoGrid.new.svelte b/src/lib/components/SingleColumnPhotoGrid.new.svelte deleted file mode 100644 index 8dde6b1..0000000 --- a/src/lib/components/SingleColumnPhotoGrid.new.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - - \ No newline at end of file diff --git a/src/lib/components/SingleColumnPhotoGrid.svelte b/src/lib/components/SingleColumnPhotoGrid.svelte index 803126f..f06ba47 100644 --- a/src/lib/components/SingleColumnPhotoGrid.svelte +++ b/src/lib/components/SingleColumnPhotoGrid.svelte @@ -1,60 +1,12 @@ -
- {#each photoItems as item} -
- - {#if !isAlbum(item) && item.caption} -
-

{item.caption}

-
- {/if} -
- {/each} -
- - + \ No newline at end of file diff --git a/src/lib/components/ThreeColumnPhotoGrid.new.svelte b/src/lib/components/ThreeColumnPhotoGrid.new.svelte deleted file mode 100644 index cf4608c..0000000 --- a/src/lib/components/ThreeColumnPhotoGrid.new.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - - \ No newline at end of file diff --git a/src/lib/components/ThreeColumnPhotoGrid.svelte b/src/lib/components/ThreeColumnPhotoGrid.svelte index 1f804fb..ad2df82 100644 --- a/src/lib/components/ThreeColumnPhotoGrid.svelte +++ b/src/lib/components/ThreeColumnPhotoGrid.svelte @@ -1,282 +1,12 @@ -
- {#each gridItems as { item, spanFull }} - - {/each} -
- - + \ No newline at end of file diff --git a/src/lib/components/TwoColumnPhotoGrid.new.svelte b/src/lib/components/TwoColumnPhotoGrid.new.svelte deleted file mode 100644 index fe027bb..0000000 --- a/src/lib/components/TwoColumnPhotoGrid.new.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - - \ No newline at end of file diff --git a/src/lib/components/TwoColumnPhotoGrid.svelte b/src/lib/components/TwoColumnPhotoGrid.svelte index 4f25e38..5be9155 100644 --- a/src/lib/components/TwoColumnPhotoGrid.svelte +++ b/src/lib/components/TwoColumnPhotoGrid.svelte @@ -1,51 +1,12 @@ -
-
- {#each column1 as item} - - {/each} -
-
- {#each column2 as item} - - {/each} -
-
- - + \ No newline at end of file diff --git a/src/routes/albums/[slug]/+page.svelte b/src/routes/albums/[slug]/+page.svelte index adf2ee8..9171dbd 100644 --- a/src/routes/albums/[slug]/+page.svelte +++ b/src/routes/albums/[slug]/+page.svelte @@ -1,6 +1,6 @@ + +
+

PhotoGrid Component Test

+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ {``} +
+ +
+ +
+
+ + \ No newline at end of file